Index: trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 950)
@@ -272,4 +272,12 @@
   WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
 
+  #if MTK_DLT_CODING_FIX_H0091
+    if(( !pcPPS->getSPS()->getVPS()->getDepthId( pcPPS->getSPS()->getLayerId() ) )||
+        pcPPS->getLayerId() != 1  )
+    {
+        pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false );
+    }
+  #endif
+
 #if !H_MV
   WRITE_FLAG( 0, "pps_extension_flag" );
Index: trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 950)
@@ -401,4 +401,7 @@
 #if H_3D_IC
   Bool      m_bUseIC;
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  Bool      m_bUseICLowLatencyEnc;
+#endif
 #endif
 #if H_3D_INTER_SDC
@@ -511,4 +514,8 @@
   Void       setUseIC                       ( Bool bVal )    { m_bUseIC = bVal; }
   Bool       getUseIC                       ()               { return m_bUseIC; }
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  Void       setUseICLowLatencyEnc          ( Bool bVal )    { m_bUseICLowLatencyEnc = bVal; }
+  Bool       getUseICLowLatencyEnc          ()               { return m_bUseICLowLatencyEnc; }
+#endif
 #endif
 #if H_3D_INTER_SDC
Index: trunk/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 950)
@@ -1814,10 +1814,27 @@
     rpcTempCU->initAvailableFlags();
     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
-    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo
+    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
+#if !ETRIKHU_CLEANUP_H0083
+      , vspFlag
+#endif
+      , inheritedVSPDisInfo
 #if H_3D_SPIVMP
-      , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
+#if !ETRIKHU_CLEANUP_H0083_MISSING
+      , bSPIVMPFlag
+#endif
+      , pcMvFieldSP, puhInterDirSP
 #endif
       , numValidMergeCand 
       );
+
+#if ETRIKHU_CLEANUP_H0083
+    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
+#if H_3D_SPIVMP
+      , bSPIVMPFlag
+#endif
+      , numValidMergeCand 
+      );
+#endif
+
 #else
     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
@@ -2383,6 +2400,11 @@
     pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0);
     
+#if RWTH_DBBP_NO_SPU_H0057
+    AOF( rpcTempCU->getSPIVMPFlag(0) == false );
+    AOF( rpcTempCU->getVSPFlag(0) == 0 );
+#else
     pDBBPTmpData->ahVSPFlag[uiSegment] = rpcTempCU->getVSPFlag(0);
     pDBBPTmpData->acDvInfo[uiSegment] = rpcTempCU->getDvInfo(0);
+#endif
     
     for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
@@ -2416,6 +2438,8 @@
     rpcTempCU->setMergeIndexSubParts(pDBBPTmpData->auhMergeIndex[uiSegment], uiPartAddr, uiSegment, uhDepth);
     
+#if !RWTH_DBBP_NO_SPU_H0057
     rpcTempCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uhDepth);
     rpcTempCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uhDepth);
+#endif
     
     for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 950)
@@ -163,5 +163,14 @@
     uiAbsPartIdx = 0;
   }
-
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+  else
+  {
+    g_aICEnableCANDIDATE[pcCU->getSlice()->getDepth()]++;
+    if(pcCU->getICFlag(uiAbsPartIdx))
+    {
+      g_aICEnableNUM[pcCU->getSlice()->getDepth()]++;
+    }
+  }
+#endif
   if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
     m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
@@ -246,5 +255,10 @@
   
 #if H_3D_DBBP
+
+#if MTK_DBBP_SIGNALING_H0094
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
+#else
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
+#endif
   {
     encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
@@ -252,5 +266,7 @@
     if( pcCU->getDBBPFlag(uiAbsPartIdx) )
     {
+#if !MTK_DBBP_SIGNALING_H0094
       AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
+#endif
       // restore virtual partition size for DBBP blocks
       pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
@@ -274,4 +290,5 @@
     return;
   }
+#if !MTK_SDC_FLAG_FIX_H0095
 #if H_3D_DIM_SDC
   if( pcCU->getSDCFlag(uiAbsPartIdx) )
@@ -279,4 +296,5 @@
     return;
   }
+#endif
 #endif
   
Index: trunk/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 950)
@@ -93,5 +93,5 @@
 , m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
-#if H_3D_DIM_DMM
+#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -169,5 +169,5 @@
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if H_3D_DIM_DMM
+#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
 #endif
@@ -255,5 +255,5 @@
       curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
       curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG );  
-#if H_3D_DIM_DMM
+#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
       curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
 #endif
@@ -319,5 +319,5 @@
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if H_3D_DIM_DMM
+#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
 #endif
@@ -482,7 +482,13 @@
     m_pcBinIf->encodeBin( 1, rcSCModel );
     UInt uiCount = 0;
+#if QC_SIMP_DELTADC_CODING_H0131
+    Bool bNoExGo = ( uiSymbol < 3 );
+
+    while( --uiSymbol && ++uiCount < 3 )
+#else
     Bool bNoExGo = (uiSymbol < 13);
 
     while( --uiSymbol && ++uiCount < 13 )
+#endif
     {
       m_pcBinIf->encodeBin( 1, rcSCModel );
@@ -520,5 +526,9 @@
   for ( Int i = 0; i < iNumBit; i++ )
   {
+#if MTK_DMM_SIMP_CODE_H0092
+      m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 );
+#else
     m_pcBinIf->encodeBin( ( uiTabIdx >> i ) & 1, m_cDmm1DataSCModel.get(0, 0, 0) );
+#endif
   }
 }
@@ -1233,5 +1243,9 @@
   if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
   {
+#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
+    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
+#else
     m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
+#endif
   }
   if( isDimMode( dir ) )
@@ -2313,6 +2327,9 @@
       dimDeltaDC = isDimDeltaDC( dir );
     }
-
+#if MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113
+    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
+#else
     m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
+#endif
   }
   else //all-zero inter SDC is not allowed
@@ -2356,6 +2373,8 @@
 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
+#if !MTK_DBBP_SIGNALING_H0094
   PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
   AOF( ePartSize == RWTH_DBBP_PACK_MODE );
+#endif
   AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
   AOF( !pcCU->getSlice()->getIsDepth() );
Index: trunk/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 950)
@@ -258,5 +258,5 @@
   ContextModel3DBuffer m_cDdcDataSCModel;
   ContextModel3DBuffer m_cAngleFlagSCModel;
-#if H_3D_DIM_DMM
+#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
   ContextModel3DBuffer m_cDmm1DataSCModel;
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 950)
@@ -1146,5 +1146,5 @@
         for( UInt uiX = 0; uiX < uiWidth; uiX++ )
         {
-#if H_3D_DIM
+#if H_3D_DIM && !SEC_NO_RESI_DLT_H0105
           if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
           {
@@ -1221,5 +1221,5 @@
       for( UInt uiX = 0; uiX < uiWidth; uiX++ )
       {
-#if H_3D_DIM
+#if H_3D_DIM && !SEC_NO_RESI_DLT_H0105
         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
         {
@@ -1989,4 +1989,12 @@
   // get DC prediction for each segment
   Pel apDCPredValues[2];
+#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
+  if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )
+  {
+    apDCPredValues[0] = pcCU->getDmmPredictor( 0 );
+    apDCPredValues[1] = pcCU->getDmmPredictor( 1 );
+  }
+  else
+#endif
   analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
 
@@ -3666,6 +3674,8 @@
       pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[0], 0, 0, pcCU->getDepth(0)); // interprets depth relative to LCU level
       
+#if !RWTH_DBBP_NO_SPU_H0057
       pcCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[0], 0, 0, pcCU->getDepth(0));
       pcCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[0], 0, 0, pcCU->getDepth(0));
+#endif
       
       for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
@@ -3697,12 +3707,29 @@
       pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
 #if H_3D_VSP
+#if !ETRIKHU_CLEANUP_H0083
                                         , vspFlag
+#endif
                                         , inheritedVSPDisInfo
 #endif
 #if H_3D_SPIVMP
-                                        , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
+#if !ETRIKHU_CLEANUP_H0083_MISSING
+        , pbSPIVMPFlag
+#endif
+        , pcMvFieldSP, puhInterDirSP
+#endif
+        , numValidMergeCand
+        );
+
+#if ETRIKHU_CLEANUP_H0083
+      pcCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
+#if H_3D_VSP
+        , vspFlag
+#endif
+#if H_3D_SPIVMP
+        , pbSPIVMPFlag
 #endif
                                         , numValidMergeCand
         );
+#endif
 #else
       pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
@@ -3718,12 +3745,29 @@
     pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
 #if H_3D_VSP
+#if !ETRIKHU_CLEANUP_H0083
                                       , vspFlag
+#endif
                                       , inheritedVSPDisInfo
 #endif
 #if H_3D_SPIVMP
-                                      , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
+#if !ETRIKHU_CLEANUP_H0083_MISSING
+      , pbSPIVMPFlag 
+#endif
+      , pcMvFieldSP, puhInterDirSP
+#endif
+      , numValidMergeCand
+      );
+
+#if ETRIKHU_CLEANUP_H0083
+    pcCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
+#if H_3D_VSP
+      , vspFlag
+#endif
+#if H_3D_SPIVMP
+      , pbSPIVMPFlag
 #endif
                                       , numValidMergeCand
       );
+#endif
 #else
     pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
Index: trunk/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 884)
+++ trunk/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 950)
@@ -866,5 +866,9 @@
      )
   {
+#if MTK_LOW_LATENCY_IC_ENCODING_H0086
+    pcSlice ->xSetApplyIC(pcEncTop->getUseICLowLatencyEnc());
+#else
     pcSlice ->xSetApplyIC();
+#endif
     if ( pcSlice->getApplyIC() )
     {
