Index: branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 598)
+++ branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 601)
@@ -874,5 +874,9 @@
   // get DC prediction for each segment
   Pel apDCPredValues[2];
+#if KWU_SDC_SIMPLE_DC_E0117
+  m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
+#else
   m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride);
+#endif
   
   // reconstruct residual based on mask + DC residuals
Index: branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 598)
+++ branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 601)
@@ -89,5 +89,7 @@
 #if H_3D_DIM_DMM
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
+#if !SEC_DMM2_E0146
 , m_cDmm2DataSCModel          ( 1,             1,               NUM_DMM2_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 , m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -177,5 +179,7 @@
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
+#if !SEC_DMM2_E0146
   m_cDmm2DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM2_DATA );
+#endif
   m_cDmm3DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM3_DATA );
 #endif
@@ -251,5 +255,7 @@
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
+#if !SEC_DMM2_E0146
   m_cDmm2DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );
+#endif
   m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
 #endif
@@ -438,4 +444,5 @@
   ruiTabIdx = uiIdx;
 }
+#if !SEC_DMM2_E0146
 Void TDecSbac::xParseDmm2Offset( Int& riOffset )
 {
@@ -463,4 +470,5 @@
   riOffset = iDeltaEnd;
 }
+#endif
 Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit )
 {
@@ -1154,4 +1162,5 @@
       pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth );
     } break;
+#if !SEC_DMM2_E0146
   case( DMM2_IDX ):
     {
@@ -1160,4 +1169,5 @@
       pcCU->setDmm2DeltaEndSubParts( iOffset, absPartIdx, depth );
     } break;
+#endif
   case( DMM3_IDX ):
     {
@@ -1227,5 +1237,7 @@
   if( puIdx == 2 )
   {
+#if !LGE_SDC_REMOVE_DC_E0158
     while( binNum < 2 && symbol )
+#endif
     {
       ctxDepthMode = puIdx*3 + binNum;
@@ -1235,6 +1247,10 @@
     }
          if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;}
+#if LGE_SDC_REMOVE_DC_E0158
+    else if( modeCode == 1 ) { dir = 0;          sdcFlag = 0;}
+#else
     else if( modeCode == 2 ) { dir = 0;          sdcFlag = 0;}
     else if( modeCode == 3 ) { dir =     DC_IDX; sdcFlag = 1;}
+#endif
   }
   else if( puIdx == 0 )
@@ -1254,4 +1270,37 @@
   else
   {
+#if ZJU_DEPTH_INTRA_MODE_E0204
+      UInt maxBinNum = 0;
+      m_pcTDecBinIf->decodeBinEP(symbol);
+      if( symbol == 1 )
+      {
+          maxBinNum = 3;
+      }
+      else
+      {
+          maxBinNum = 2;
+          symbol = 1;
+      }
+      while( binNum<maxBinNum && symbol )
+      {
+          ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum );
+          m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode));
+          modeCode = (modeCode<<1)+symbol;
+          binNum++;
+      }
+      if( maxBinNum == 3 )
+      {
+          if ( modeCode == 0 )       { dir =  PLANAR_IDX;             sdcFlag = 1;}
+          else if ( modeCode == 2 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
+          else if ( modeCode == 6 )  { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
+          else if ( modeCode == 7 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
+      }
+      else
+      {
+          if ( modeCode == 0 )       { dir = 5;                       sdcFlag = 0;}
+          else if ( modeCode == 2 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
+          else if ( modeCode == 3 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
+      }
+#else
     ctxDepthMode = puIdx*3 ;
     m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
@@ -1283,5 +1332,15 @@
       {
         binNum = 0;
+#if LGE_SDC_REMOVE_DC_E0158
+#if !SEC_DMM2_E0146
+        while( symbol && binNum < 2 )
+#endif
+#else
+#if SEC_DMM2_E0146
+        while( symbol && binNum < 2 )
+#else
         while( symbol && binNum < 3 )
+#endif
+#endif
         {
           ctxDepthMode = puIdx*3 + 2;
@@ -1298,7 +1357,21 @@
     else if( modeCode == 5  ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
     else if( modeCode == 6  ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
+#if LGE_SDC_REMOVE_DC_E0158
+#if SEC_DMM2_E0146
+    else if( modeCode == 7 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
+#else
+    else if( modeCode == 14 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
+    else if( modeCode == 15 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;}
+#endif
+#else
     else if( modeCode == 14 ) { dir =      DC_IDX;             sdcFlag = 1;}
+#if SEC_DMM2_E0146
+    else if( modeCode == 15 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
+#else
     else if( modeCode == 30 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
     else if( modeCode == 31 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;}
+#endif
+#endif
+#endif
   }
   pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
Index: branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 598)
+++ branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 601)
@@ -102,5 +102,7 @@
 #if H_3D_DIM_DMM
   Void  xParseDmm1WedgeIdx   ( UInt& ruiTabIdx, Int iNumBit );
+#if !SEC_DMM2_E0146
   Void  xParseDmm2Offset     ( Int& riOffset );
+#endif
   Void  xParseDmm3WedgeIdx   ( UInt& ruiIntraIdx, Int iNumBit );
 #endif
@@ -214,5 +216,7 @@
 #if H_3D_DIM_DMM
   ContextModel3DBuffer m_cDmm1DataSCModel;
+#if !SEC_DMM2_E0146
   ContextModel3DBuffer m_cDmm2DataSCModel;
+#endif
   ContextModel3DBuffer m_cDmm3DataSCModel;
 #endif
