Index: /branches/HTM-14.1-update-dev1-RWTH/HTM.xcodeproj/project.pbxproj
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/HTM.xcodeproj/project.pbxproj	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/HTM.xcodeproj/project.pbxproj	(revision 1221)
@@ -339,5 +339,5 @@
 		78486FDD1B0B62C70098FD5A /* ContextModel3DBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ContextModel3DBuffer.cpp; sourceTree = "<group>"; };
 		78486FDE1B0B62C70098FD5A /* ContextModel3DBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContextModel3DBuffer.h; sourceTree = "<group>"; };
-		78486FDF1B0B62C70098FD5A /* ContextTables.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContextTables.h; sourceTree = "<group>"; };
+		78486FDF1B0B62C70098FD5A /* ContextTables.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ContextTables.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		78486FE01B0B62C70098FD5A /* Debug.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Debug.cpp; sourceTree = "<group>"; };
 		78486FE11B0B62C70098FD5A /* Debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Debug.h; sourceTree = "<group>"; };
@@ -372,6 +372,6 @@
 		78486FFE1B0B62C70098FD5A /* TComPicYuv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TComPicYuv.h; sourceTree = "<group>"; };
 		78486FFF1B0B62C70098FD5A /* TComPicYuvMD5.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TComPicYuvMD5.cpp; sourceTree = "<group>"; };
-		784870001B0B62C70098FD5A /* TComPrediction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TComPrediction.cpp; sourceTree = "<group>"; };
-		784870011B0B62C70098FD5A /* TComPrediction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TComPrediction.h; sourceTree = "<group>"; };
+		784870001B0B62C70098FD5A /* TComPrediction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = TComPrediction.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		784870011B0B62C70098FD5A /* TComPrediction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TComPrediction.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		784870021B0B62C70098FD5A /* TComRdCost.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TComRdCost.cpp; sourceTree = "<group>"; };
 		784870031B0B62C70098FD5A /* TComRdCost.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TComRdCost.h; sourceTree = "<group>"; };
@@ -395,5 +395,5 @@
 		784870151B0B62C70098FD5A /* TComYuv.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TComYuv.cpp; sourceTree = "<group>"; };
 		784870161B0B62C70098FD5A /* TComYuv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TComYuv.h; sourceTree = "<group>"; };
-		784870171B0B62C70098FD5A /* TypeDef.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypeDef.h; sourceTree = "<group>"; };
+		784870171B0B62C70098FD5A /* TypeDef.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TypeDef.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		784870191B0B62C70098FD5A /* AnnexBread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AnnexBread.cpp; sourceTree = "<group>"; };
 		7848701A1B0B62C70098FD5A /* AnnexBread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnnexBread.h; sourceTree = "<group>"; };
@@ -415,6 +415,6 @@
 		7848702A1B0B62C70098FD5A /* TDecGop.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TDecGop.cpp; sourceTree = "<group>"; };
 		7848702B1B0B62C70098FD5A /* TDecGop.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDecGop.h; sourceTree = "<group>"; };
-		7848702C1B0B62C70098FD5A /* TDecSbac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TDecSbac.cpp; sourceTree = "<group>"; };
-		7848702D1B0B62C70098FD5A /* TDecSbac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDecSbac.h; sourceTree = "<group>"; };
+		7848702C1B0B62C70098FD5A /* TDecSbac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = TDecSbac.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		7848702D1B0B62C70098FD5A /* TDecSbac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TDecSbac.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		7848702E1B0B62C70098FD5A /* TDecSlice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TDecSlice.cpp; sourceTree = "<group>"; };
 		7848702F1B0B62C70098FD5A /* TDecSlice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDecSlice.h; sourceTree = "<group>"; };
@@ -453,8 +453,8 @@
 		784870511B0B62C70098FD5A /* TEncSampleAdaptiveOffset.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TEncSampleAdaptiveOffset.cpp; sourceTree = "<group>"; };
 		784870521B0B62C70098FD5A /* TEncSampleAdaptiveOffset.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TEncSampleAdaptiveOffset.h; sourceTree = "<group>"; };
-		784870531B0B62C70098FD5A /* TEncSbac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TEncSbac.cpp; sourceTree = "<group>"; };
-		784870541B0B62C70098FD5A /* TEncSbac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TEncSbac.h; sourceTree = "<group>"; };
-		784870551B0B62C70098FD5A /* TEncSearch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TEncSearch.cpp; sourceTree = "<group>"; };
-		784870561B0B62C70098FD5A /* TEncSearch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TEncSearch.h; sourceTree = "<group>"; };
+		784870531B0B62C70098FD5A /* TEncSbac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = TEncSbac.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		784870541B0B62C70098FD5A /* TEncSbac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TEncSbac.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+		784870551B0B62C70098FD5A /* TEncSearch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = TEncSearch.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		784870561B0B62C70098FD5A /* TEncSearch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TEncSearch.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		784870571B0B62C70098FD5A /* TEncSlice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TEncSlice.cpp; sourceTree = "<group>"; };
 		784870581B0B62C70098FD5A /* TEncSlice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TEncSlice.h; sourceTree = "<group>"; };
Index: /branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1221)
@@ -2485,14 +2485,14 @@
       dlt.setUseBitmapRep(layer, bDltBitMapRepFlag);
       
-#ifdef DEBUG
-      printf("---------------------------------------------\n");
-      printf("LayerId: %d\n", layer);
-      printf("getUseDLTFlag: %d\n", dlt.getUseDLTFlag(layer));
-      printf("getInterViewDltPredEnableFlag: %d\n", dlt.getInterViewDltPredEnableFlag(layer));
-      printf("getUseBitmapRep: %d\n", dlt.getUseBitmapRep(layer));
-      printf("getNumDepthValues: %d\n", dlt.getNumDepthValues(layer));
-      for(Int i=0; i<dlt.getNumDepthValues(layer); i++)
-        printf("depthValue[%d] = %d\n", i, dlt.idx2DepthValue(layer, i));
-#endif
+//#ifdef DEBUG
+//      printf("---------------------------------------------\n");
+//      printf("LayerId: %d\n", layer);
+//      printf("getUseDLTFlag: %d\n", dlt.getUseDLTFlag(layer));
+//      printf("getInterViewDltPredEnableFlag: %d\n", dlt.getInterViewDltPredEnableFlag(layer));
+//      printf("getUseBitmapRep: %d\n", dlt.getUseBitmapRep(layer));
+//      printf("getNumDepthValues: %d\n", dlt.getNumDepthValues(layer));
+//      for(Int i=0; i<dlt.getNumDepthValues(layer); i++)
+//        printf("depthValue[%d] = %d\n", i, dlt.idx2DepthValue(layer, i));
+//#endif
     }
   }
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/ContextTables.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/ContextTables.h	(revision 1221)
@@ -177,8 +177,8 @@
 #define NUM_DMM_MODE_CTX              1       ///< number of context models for DMM modes
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
 #define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or SDC)
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 #define SDC_NUM_RESIDUAL_FLAG_CTX     1
 #define SDC_NUM_RESIDUAL_CTX          1
@@ -577,5 +577,5 @@
 };
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
 static const UChar
 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 
@@ -586,5 +586,5 @@
 };
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 static const UChar
 INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] =
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComCodingStatistics.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComCodingStatistics.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComCodingStatistics.h	(revision 1221)
@@ -93,5 +93,5 @@
   STATS__CABAC_BITS__ALIGNED_ESCAPE_BITS,
 
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   STATS__CABAC_BITS__DELTADC_SIGN_EP,
   STATS__CABAC_BITS__DELTADC_PREFIX,
@@ -154,5 +154,5 @@
     "CABAC_BITS__ALIGNED_SIGN_BIT",
     "CABAC_BITS__ALIGNED_ESCAPE_BITS"
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
    ,"STATS__CABAC_BITS__DELTADC_SIGN_EP"
    ,"STATS__CABAC_BITS__DELTADC_PREFIX"
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1221)
@@ -112,5 +112,5 @@
   m_dmm1WedgeTabIdx = NULL;
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   m_pbSDCFlag             = NULL;
   m_apSegmentDCOffset[0]  = NULL;
@@ -258,5 +258,5 @@
     m_dmm1WedgeTabIdx    = (UInt*)xMalloc(UInt, uiNumPartition);
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     m_pbSDCFlag             = (Bool*)xMalloc(Bool, uiNumPartition);
     m_apSegmentDCOffset[0]  = (Pel*)xMalloc(Pel, uiNumPartition);
@@ -473,5 +473,5 @@
     if ( m_dmm1WedgeTabIdx    ) { xFree( m_dmm1WedgeTabIdx );  m_dmm1WedgeTabIdx = NULL;  }
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     if ( m_pbSDCFlag            ) { xFree(m_pbSDCFlag);             m_pbSDCFlag             = NULL; }
     if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]);  m_apSegmentDCOffset[0]  = NULL; }
@@ -614,6 +614,6 @@
     m_pbSPIVMPFlag[ui] = pcFrom->m_pbSPIVMPFlag[ui];
 #endif
-#if H_3D_DIM_SDC
-    m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
+#if NH_3D_INTRA_SDC
+  memset( m_pbSDCFlag, false, m_uiNumPartition * sizeof( *m_pbSDCFlag ) );
 #endif
 #if H_3D_DBBP
@@ -653,8 +653,8 @@
   memset( m_dmm1WedgeTabIdx,    0,                        m_uiNumPartition * sizeof( *m_dmm1WedgeTabIdx   ) );
 #endif
-#if H_3D_DIM_SDC
-    memset( m_pbSDCFlag             + firstElement,     0,                numElements * sizeof( *m_pbSDCFlag            ) );
-    memset( m_apSegmentDCOffset[0]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[0] ) );
-    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
+#if NH_3D_INTRA_SDC
+    memset( m_pbSDCFlag,     false,                m_uiNumPartition * sizeof( *m_pbSDCFlag ) );
+    memset( m_apSegmentDCOffset[0],     0,                m_uiNumPartition * sizeof( *m_apSegmentDCOffset[0] ) );
+    memset( m_apSegmentDCOffset[1],     0,                m_uiNumPartition * sizeof( *m_apSegmentDCOffset[1] ) );
 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup
     m_apDmmPredictor[0] = 0;
@@ -811,5 +811,5 @@
     m_dmm1WedgeTabIdx    [ui] = 0;
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
       m_pbSDCFlag           [ui] = false;
       m_apSegmentDCOffset[0][ui] = 0;
@@ -917,5 +917,5 @@
   memset( m_dmm1WedgeTabIdx,    0, sizeof(UInt) * m_uiNumPartition );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   memset( m_pbSDCFlag,            0, sizeof(Bool) * m_uiNumPartition  );
   memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
@@ -974,8 +974,8 @@
   m_dmm1WedgeTabIdx    [ui] = pcCU->m_dmm1WedgeTabIdx  [uiPartOffset+ui];
 #endif
-#if H_3D_DIM_SDC
-      m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
-      m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
-      m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
+#if NH_3D_INTRA_SDC
+    m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
+    m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
+    m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
 #endif
 #if H_3D_DBBP
@@ -1092,5 +1092,5 @@
   m_dmm1WedgeTabIdx    = pcCU->getDmm1WedgeTabIdx()  + uiPart;
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   m_pbSDCFlag               = pcCU->getSDCFlag()              + uiPart;
   m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0)  + uiPart;
@@ -1294,6 +1294,6 @@
   memcpy( m_dmm1WedgeTabIdx    + uiOffset, pcCU->getDmm1WedgeTabIdx(),         sizeof(UInt) * uiNumPartition );
 #endif
-#if H_3D_DIM_SDC
-  memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(),             iSizeInBool  );
+#if NH_3D_INTRA_SDC
+  memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(), sizeof( *m_pbSDCFlag ) * uiNumPartition  );
   memcpy( m_apSegmentDCOffset[0]  + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
   memcpy( m_apSegmentDCOffset[1]  + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
@@ -1417,8 +1417,8 @@
   memcpy( pCtu->getDmm1WedgeTabIdx()           + m_absZIdxInCtu, m_dmm1WedgeTabIdx,  sizeof(UInt) * m_uiNumPartition );
 #endif
-#if H_3D_DIM_SDC
-  memcpy( rpcCU->getSDCFlag()             + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
-  memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
-  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
+#if NH_3D_INTRA_SDC
+  memcpy( pCtu->getSDCFlag()             + m_absZIdxInCtu, m_pbSDCFlag, sizeof(Bool) * m_uiNumPartition );
+  memcpy( pCtu->getSDCSegmentDCOffset(0) + m_absZIdxInCtu, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
+  memcpy( pCtu->getSDCSegmentDCOffset(1) + m_absZIdxInCtu, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
 #endif
 #if H_3D_DBBP
@@ -1478,9 +1478,4 @@
 #if H_3D_SPIVMP
   memcpy( rpcCU->getSPIVMPFlag()        + uiPartOffset, m_pbSPIVMPFlag,        sizeof(Bool) * uiQNumPart );
-#endif
-#if H_3D_DIM_SDC
-  memcpy( rpcCU->getSDCFlag()             + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
-  memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
-  memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
 #endif
 #if H_3D_DBBP
@@ -2136,12 +2131,4 @@
 #endif
 
-#if H_3D_DIM_SDC
-UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
-{
-  return 0;
-}
-
-#endif
-
 
 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
@@ -2395,9 +2382,9 @@
 }
 
-#if H_3D_DIM_SDC
-Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiDepth )
+#if NH_3D_INTRA_SDC
+Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt absPartIdx, UInt depth )
 {
   assert( sizeof( *m_pbSDCFlag) == 1 );
-  memset( m_pbSDCFlag + uiAbsPartIdx, bSDCFlag, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) );
+  memset( m_pbSDCFlag + absPartIdx, bSDCFlag, m_pcPic->getNumPartitionsInCtu() >> ( 2 * depth ) );
 }
 
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.h	(revision 1221)
@@ -186,5 +186,5 @@
   UInt*         m_dmm1WedgeTabIdx;
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Bool*         m_pbSDCFlag;
   Pel*          m_apSegmentDCOffset[2];
@@ -563,5 +563,5 @@
   Void  setDmm1WedgeTabIdxSubParts    ( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Bool*         getSDCFlag          ()                        { return m_pbSDCFlag;               }
   Bool          getSDCFlag          ( UInt uiIdx )            { return m_pbSDCFlag[uiIdx];        }
@@ -577,5 +577,4 @@
   Pel           getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; }
 #endif
-  UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
 #endif
   
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1221)
@@ -535,5 +535,5 @@
   assert( iWidth == iHeight  );
   assert( iWidth >= DMM_MIN_SIZE && iWidth <= DMM_MAX_SIZE );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   assert( !pcCU->getSDCFlag( uiAbsPartIdx ) );
 #endif
@@ -569,5 +569,5 @@
   assignBiSegDCs( pDst, uiStride, biSegPattern, patternStride, segDC1, segDC2 );
 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup
-#if H_3D_DIM_SDC  
+#if NH_3D_INTRA_SDC
   pcCU->setDmmPredictor(segDC1, 0);
   pcCU->setDmmPredictor(segDC2, 1);
@@ -2389,5 +2389,5 @@
 
 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
-#if NH_3D_SDC
+#if NH_3D_INTRA_SDC
 Void TComPrediction::predConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& predDC )
 {
@@ -2400,5 +2400,5 @@
 #endif
 #else // PM: should be obsolete after cleanup
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
                                          ,UInt uiIntraMode
@@ -2465,5 +2465,5 @@
   }
 }
-#endif // H_3D_DIM_SDC
+#endif // NH_3D_INTRA_SDC
 #endif
 
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComPrediction.h	(revision 1221)
@@ -171,9 +171,9 @@
 #endif
 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
-#if NH_3D_SDC
+#if NH_3D_INTRA_SDC
   Void predConstantSDC            ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& predDC );
 #endif
 #else // PM: should be obsolete after cleanup
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Void analyzeSegmentsSDC         ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride, UInt uiIntraMode, Bool orgDC=false );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.cpp	(revision 1221)
@@ -543,9 +543,9 @@
 UInt64 g_nSymbolCounter = 0;
 #if H_MV_ENC_DEC_TRAC
-Bool g_traceCU = false; 
+Bool g_traceCU = true;
 Bool g_tracePU = false; 
 Bool g_traceTU = false; 
-Bool g_disableNumbering = false; 
-Bool g_disableHLSTrace = false; 
+Bool g_disableNumbering = true;
+Bool g_disableHLSTrace = true;
 UInt64 g_stopAtCounter       = 937234; 
 Bool g_traceCopyBack         = false; 
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TComRom.h	(revision 1221)
@@ -157,5 +157,5 @@
 // Change later
 #ifndef ENC_DEC_TRACE
-#define ENC_DEC_TRACE 0
+#define ENC_DEC_TRACE 1
 #endif
 #endif
@@ -176,4 +176,5 @@
 #define DTRACE_CABAC_R( x,y ) if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, x,    y );
 #define DTRACE_CABAC_N        if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "\n"    );
+
 #if H_MV_ENC_DEC_TRAC
  extern Bool   g_traceCU; 
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TypeDef.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibCommon/TypeDef.h	(revision 1221)
@@ -70,6 +70,6 @@
 #define NH_3D_VSO                         1
 #define NH_3D_DMM                         1   // Depth modeling modes
-#define NH_3D_SDC                         1   // Segment-wise DC coding for intra and inter
-#define NH_3D_DLT                         1   // Depth Lookup Table
+#define NH_3D_DLT                         0   // Depth Lookup Table
+#define NH_3D_INTRA_SDC                   1   // Segment-wise DC Coding method for INTRA
 #define NH_3D_ENC_DEPTH                   1   // Encoder optimizations for depth, incl.
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1221)
@@ -628,14 +628,14 @@
         }
         
-#ifdef DEBUG
-        printf("---------------------------------------------\n");
-        printf("LayerId: %d\n", layerId);
-        printf("getUseDLTFlag: %d\n", pcDLT->getUseDLTFlag(layerId));
-        printf("getInterViewDltPredEnableFlag: %d\n", pcDLT->getInterViewDltPredEnableFlag(layerId));
-        printf("getUseBitmapRep: %d\n", pcDLT->getUseBitmapRep(layerId));
-        printf("getNumDepthValues: %d\n", pcDLT->getNumDepthValues(layerId));
-        for(Int i=0; i<pcDLT->getNumDepthValues(layerId); i++)
-          printf("depthValue[%d] = %d\n", i, pcDLT->idx2DepthValue(layerId, i));
-#endif
+//#ifdef DEBUG
+//        printf("---------------------------------------------\n");
+//        printf("LayerId: %d\n", layerId);
+//        printf("getUseDLTFlag: %d\n", pcDLT->getUseDLTFlag(layerId));
+//        printf("getInterViewDltPredEnableFlag: %d\n", pcDLT->getInterViewDltPredEnableFlag(layerId));
+//        printf("getUseBitmapRep: %d\n", pcDLT->getUseBitmapRep(layerId));
+//        printf("getNumDepthValues: %d\n", pcDLT->getNumDepthValues(layerId));
+//        for(Int i=0; i<pcDLT->getNumDepthValues(layerId); i++)
+//          printf("depthValue[%d] = %d\n", i, pcDLT->idx2DepthValue(layerId, i));
+//#endif
       }
     }
@@ -3390,5 +3390,5 @@
 }
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1221)
@@ -123,8 +123,8 @@
   Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  parseDeltaDC        ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); };
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  parseSDCFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1221)
@@ -527,5 +527,5 @@
     if(pcCU->getIPCMFlag(uiAbsPartIdx))
     {
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
       m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
 #endif
@@ -642,10 +642,10 @@
       break;
     case MODE_INTRA:
-#if H_3D
-    if( m_ppcCU[uiDepth]->getDISFlag(0) )
-    {
-      xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );
-    }
-#if H_3D_DIM_SDC
+#if NH_3D
+    if( false /*m_ppcCU[uiDepth]->getDISFlag(0)*/ )
+    {
+      //xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );
+    }
+#if NH_3D_INTRA_SDC
     else if( m_ppcCU[uiDepth]->getSDCFlag(0) )
     {
@@ -1183,5 +1183,5 @@
 }
 
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -1191,9 +1191,10 @@
   TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
 
-  Bool bAboveAvail    = false;
-  Bool bLeftAvail     = false;
   UInt uiWidth        = pcCU->getWidth ( 0 );
   UInt uiHeight       = pcCU->getHeight( 0 );
   UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx );
+  const Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
+  const TComSPS     &sps    = *(pcCU->getSlice()->getSPS());
+  const ChromaFormat chFmt  = pcCU->getPic()->getChromaFormat();
 
   UInt sdcDepth = 0;
@@ -1203,6 +1204,5 @@
   Pel* piResi;
 
-  UInt uiZOrder;        
-  Pel* piRecIPred;      
+  Pel* piRecIPred;
   UInt uiRecIPredStride;
   
@@ -1214,5 +1214,4 @@
 
 #if NH_3D_DMM
-  TComWedgelet* dmm4Segmentation = NULL;
   if( isDmmMode( uiLumaPredMode ) )
   {
@@ -1262,49 +1261,35 @@
     uiNumSegments = 1;
 
-    UInt numParts = 1;
-    UInt uiSubPartIdx = uiAbsPartIdx;
-
-    if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1)
-    {
-      numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
+    if( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )
+    {
       sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
-      uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
-    }
-
-    for ( Int i = 0; i < numParts; i++ )
-    {
-      uiStride    = pcRecoYuv->getStride  ();
-      piReco      = pcRecoYuv->getLumaAddr( uiSubPartIdx );
-      piPred      = pcPredYuv->getLumaAddr( uiSubPartIdx );
-      piResi      = pcResiYuv->getLumaAddr( uiSubPartIdx );
-
-      uiZOrder          = pcCU->getZorderIdxInCU() + uiSubPartIdx;
-      piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-      uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
-
-      AOF( uiWidth == uiHeight );
-
-      //===== init availability pattern =====
-      pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiSubPartIdx );
-      pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
-
-      m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
-
-      if ( numParts > 1 )
-      {
-        for( UInt uiY = 0; uiY < uiHeight; uiY++ )
-        {
-          for( UInt uiX = 0; uiX < uiWidth; uiX++ )
-          {
-            piReco        [ uiX ] = ClipY( piPred[ uiX ] );
-            piRecIPred    [ uiX ] = piReco[ uiX ];
-          }
-          piPred     += uiStride;
-          piReco     += uiStride;
-          piRecIPred += uiRecIPredStride;
-        }
-      }
-      uiSubPartIdx += ( (uiWidth * uiWidth) >> 4 );
-    }
+    }
+    
+    //===== loop over partitions =====
+    TComTURecurse tuRecurseCU(pcCU, 0);
+    TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (sdcDepth==0)?TComTU::DONT_SPLIT:TComTU::QUAD_SPLIT);
+
+    do
+    {
+      const TComRectangle &puRect = tuRecurseWithPU.getRect(COMPONENT_Y);
+      const UInt uiAbsPartIdxTU = tuRecurseWithPU.GetAbsPartIdxTU();
+      
+      Pel* piPredTU        = pcPredYuv->getAddr   ( COMPONENT_Y, uiAbsPartIdxTU );
+      UInt uiStrideTU      = pcPredYuv->getStride ( COMPONENT_Y );
+      
+      //===== init pattern for luma prediction =====
+      Bool bAboveAvail = false;
+      Bool bLeftAvail  = false;
+      
+      if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
+      {
+        m_pcPrediction->initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
+      }
+      
+      const Bool bUseFilter = TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiLumaPredMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
+      
+      m_pcPrediction->predIntraAng( COMPONENT_Y, uiLumaPredMode, NULL, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiLumaPredMode) );
+      
+    } while (tuRecurseWithPU.nextSection(tuRecurseCU));
 
     // reset to full block
@@ -1312,11 +1297,11 @@
     uiHeight = pcCU->getHeight( 0 );
 
-    piReco            = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
-    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-    piResi            = pcResiYuv->getLumaAddr( uiAbsPartIdx );
-
-    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
-    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
+    uiStride          = pcRecoYuv->getStride( COMPONENT_Y );
+    piReco            = pcRecoYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
+    piPred            = pcPredYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
+    piResi            = pcResiYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
+    
+    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getAddr  ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx );
+    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y );
 
     m_pcPrediction->predConstantSDC( piPred, uiStride, uiWidth, apDCPredValues[0] ); apDCPredValues[1] = 0;
@@ -1488,5 +1473,5 @@
       Pel pResiDC = apDCResiValues[ucSegment];
       
-      pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResiDC );
+      pReco    [ uiX ] = ClipBD( pPred[ uiX ] + pResiDC, bitDepthY );
       pRecIPred[ uiX ] = pReco[ uiX ];
     }
@@ -1498,8 +1483,8 @@
   }
   
-  // clear UV
-  UInt  uiStrideC     = pcPredYuv->getCStride();
-  Pel   *pRecCb       = pcPredYuv->getCbAddr();
-  Pel   *pRecCr       = pcPredYuv->getCrAddr();
+  // clear chroma
+  UInt  uiStrideC     = pcPredYuv->getStride( COMPONENT_Cb );
+  Pel   *pRecCb       = pcPredYuv->getAddr  ( COMPONENT_Cb, uiAbsPartIdx );
+  Pel   *pRecCr       = pcPredYuv->getAddr  ( COMPONENT_Cr, uiAbsPartIdx );
   
   for (Int y=0; y<uiHeight/2; y++)
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.h	(revision 1221)
@@ -127,5 +127,5 @@
   Void xReconDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1221)
@@ -162,7 +162,6 @@
   {
     decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     decodeSDCFlag   ( pcCU, uiAbsPartIdx, uiDepth );
-    if(!pcCU->getSDCFlag(uiAbsPartIdx))
 #endif
     if (pcCU->getPic()->getChromaFormat()!=CHROMA_400)
@@ -961,12 +960,10 @@
 Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool& bCodeDQP, Bool& isChromaQpAdjCoded )
 {
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )
   {
     assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
+    assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 );
 }
 #endif
@@ -982,5 +979,5 @@
   if( pcCU->getSlice()->getIsDepth() )
   {
-#if H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
     if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     {
@@ -1040,5 +1037,5 @@
 }
 
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1221)
@@ -91,8 +91,8 @@
   virtual Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   virtual Void  parseDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   virtual Void parseSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
@@ -183,5 +183,5 @@
 #endif
 
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void decodeSDCFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1221)
@@ -111,8 +111,8 @@
 , m_cDmmModeSCModel                          ( 1,             1,                      NUM_DMM_MODE_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
 , m_cDdcDataSCModel                          ( 1,             1,                      NUM_DDC_DATA_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 , m_cSDCResidualFlagSCModel                  ( 1,             1,                     SDC_NUM_RESIDUAL_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSDCResidualSCModel                      ( 1,             1,                     SDC_NUM_RESIDUAL_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
@@ -202,8 +202,8 @@
   m_cDmmModeSCModel.initBuffer                    ( sliceType, qp, (UChar*)INIT_DMM_MODE );
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
   m_cDdcDataSCModel.initBuffer                    ( sliceType, qp, (UChar*)INIT_DDC_DATA );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   m_cSDCResidualFlagSCModel.initBuffer            ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
   m_cSDCResidualSCModel.initBuffer                ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );
@@ -247,10 +247,4 @@
 #if H_3D_IC
   m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
-#endif
-#if H_3D_DIM_SDC
-  m_cSDCResidualFlagSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
-  m_cSDCResidualSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
-  m_cSDCFlagSCModel.initBuffer            ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
-  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
 #endif
 #if H_3D_DBBP
@@ -2340,8 +2334,8 @@
 #endif
 
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
 {
-#if H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   if( !(pcCU->getSDCFlag( absPartIdx )) )
 #endif
@@ -2352,11 +2346,11 @@
 
   UInt symbol = 1;
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
   {
     m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
-      assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );
-      pcCU->setTrIdxSubParts( 0, absPartIdx, depth );
-      pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth );
+    assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );
+    assert( pcCU->getTransformIdx(absPartIdx) == 0 );
+    assert( pcCU->getCbf(absPartIdx, COMPONENT_Y) == 1 );
     }
 #endif
@@ -2376,5 +2370,5 @@
     if( pcCU->isIntra( absPartIdx ) )
     {
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
       if( pcCU->getSDCFlag( absPartIdx ) )
       {
@@ -2387,5 +2381,5 @@
         pcCU->setDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx, valDeltaDC );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
       }
 #endif
@@ -2415,4 +2409,6 @@
     }
   }
+  
+  DTRACE_CU("delta_dc", rValDeltaDC);
 }
 
@@ -2507,11 +2503,10 @@
 }
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
   UInt uiSymbol = 0;
-  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
-
-  m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
+
+  m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, 0 ) );
   DTRACE_CU("dc_only_flag", uiSymbol)
   if( uiSymbol )
@@ -2519,5 +2514,5 @@
     pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth );
     pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
-    pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );
+    pcCU->setCbfSubParts(1, COMPONENT_Y, uiAbsPartIdx, uiDepth);
   }
   else
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecSbac.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecSbac.h	(revision 1221)
@@ -107,5 +107,5 @@
   Void  xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange );
 #endif
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  xReadExGolombLevelDdc( UInt& ruiSymbol );
   Void  xParseDeltaDC        ( Pel& rValDeltaDC, UInt uiNumSeg );
@@ -116,8 +116,8 @@
   Void  xParseDmm1WedgeIdx   ( UInt& ruiTabIdx, Int iNumBit );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Void  xParseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  parseSDCFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
@@ -136,5 +136,5 @@
   Void parseDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  parseDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
 #endif
@@ -229,8 +229,8 @@
   ContextModel3DBuffer m_cDmmModeSCModel;
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
   ContextModel3DBuffer m_cDdcDataSCModel;
 #endif
-#if H_3D_DIM_SDC  
+#if NH_3D_INTRA_SDC  
   ContextModel3DBuffer m_cSDCResidualFlagSCModel;
   ContextModel3DBuffer m_cSDCResidualSCModel;
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1221)
@@ -2843,5 +2843,5 @@
    assert(0);
  }
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1221)
@@ -126,5 +126,5 @@
   Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  codeDeltaDC      ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/ ) { assert(0); };
 #endif
@@ -136,5 +136,5 @@
 #endif
 
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1221)
@@ -1597,6 +1597,6 @@
     if(pcCU->getIPCMFlag(uiAbsPartIdx))
     {
-#if H_3D_DIM_SDC
-      m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
+#if NH_3D_INTRA_SDC
+      m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx );
 #endif  
 
@@ -1612,6 +1612,6 @@
   m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx );
 #endif
-#if H_3D_DIM_SDC
-  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
+#if NH_3D_INTRA_SDC
+  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx );
 #endif  
 #if H_3D_ARP
@@ -2470,5 +2470,5 @@
   rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
   rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
 #endif
@@ -2700,6 +2700,11 @@
     m_pcPredSearch->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], resiLuma DEBUG_STRING_PASS_INTO(sTest) );
   }
-#if H_3D_DIM_SDC
-  if( !rpcTempCU->getSDCFlag( 0 ) )
+  
+#if NH_3D_INTRA_SDC
+  if( rpcTempCU->getSDCFlag( 0 ) )
+  {
+    assert( rpcTempCU->getTransformIdx(0) == 0 );
+    assert( rpcTempCU->getCbf(0, COMPONENT_Y) == 1 );
+  }
 #endif
 
@@ -2720,5 +2725,5 @@
   m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0 );
   m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
@@ -2805,5 +2810,5 @@
   m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
   m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1221)
@@ -514,7 +514,5 @@
   {
     encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx,true );
-#if H_3D_DIM_SDC
-    if(!pcCU->getSDCFlag(uiAbsPartIdx))
-#endif
+    
     if (pcCU->getPic()->getChromaFormat()!=CHROMA_400)
     {
@@ -713,12 +711,10 @@
 #endif
 
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) )
   {
     assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
+    assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 );
   }
 #endif
@@ -734,5 +730,5 @@
   if( pcCU->getSlice()->getIsDepth() )
   {
-#if H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
     if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     {
@@ -843,5 +839,5 @@
 }
 
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TEncEntropy::encodeDeltaDC  ( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -849,7 +845,12 @@
 }
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
+  if( bRD )
+  {
+    uiAbsPartIdx = 0;
+  }
+  
   if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getInterSdcFlag() ) || 
     ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getIntraSdcWedgeFlag() ) )
@@ -863,10 +864,5 @@
   }
 
-  assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
+  assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N );
 
   m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx );
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1221)
@@ -84,5 +84,5 @@
   virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   virtual Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
@@ -93,5 +93,5 @@
   virtual Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   virtual Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
@@ -181,8 +181,8 @@
   Void encodeICFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
 #endif
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void encodeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void encodeSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
 #endif
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1221)
@@ -106,8 +106,8 @@
 , m_cDmmModeSCModel                    ( 1,             1,                      NUM_DMM_MODE_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
 , m_cDdcDataSCModel                    ( 1,             1,                      NUM_DDC_DATA_CTX                     , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
-#if H_3D_DIM_SDC                                                                                                     
+#if NH_3D_INTRA_SDC
 , m_cSDCResidualFlagSCModel            ( 1,             1,                      SDC_NUM_RESIDUAL_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSDCResidualSCModel                ( 1,             1,                      SDC_NUM_RESIDUAL_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
@@ -187,8 +187,8 @@
   m_cDmmModeSCModel.initBuffer                    ( eSliceType, iQp, (UChar*)INIT_DMM_MODE );
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
   m_cDdcDataSCModel.initBuffer                    ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
 #endif
-#if H_3D_DIM_SDC                                 
+#if NH_3D_INTRA_SDC
   m_cSDCResidualFlagSCModel.initBuffer            ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
   m_cSDCResidualSCModel.initBuffer                ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
@@ -243,5 +243,5 @@
       curCost += m_cCUICFlagSCModel.calcCost                   ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
 #endif                                                     
-#if H_3D_DIM_SDC                                           
+#if NH_3D_INTRA_SDC
       curCost += m_cSDCFlagSCModel.calcCost                    ( curSliceType, qp, (UChar*)INIT_SDC_FLAG );
 #endif                                                     
@@ -280,5 +280,5 @@
       curCost += m_cDmmModeSCModel.calcCost                    ( curSliceType, qp, (UChar*)INIT_DMM_MODE );
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
       curCost += m_cDdcDataSCModel.calcCost                    ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
 #endif
@@ -307,10 +307,4 @@
 #if H_3D_IC
   m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
-#endif
-#if H_3D_DIM_SDC
-  m_cSDCResidualFlagSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
-  m_cSDCResidualSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
-  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
-  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
 #endif
 #if H_3D_DBBP
@@ -799,12 +793,4 @@
 Void TEncSbac::codePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
-#if H_3D_DIM_SDC
-  if ( pcCU->getSlice()->isIntra() )
-  {
-    assert( pcCU->isIntra(uiAbsPartIdx) );
-    return;
-  }
-#endif
-  
   // get context function is here
   m_pcBinIf->encodeBin( pcCU->isIntra( uiAbsPartIdx ) ? 1 : 0, m_cCUPredModeSCModel.get( 0, 0, 0 ) );
@@ -2487,8 +2473,8 @@
 }
 
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )
 {
-#if H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   if( !(pcCU->getSDCFlag( absPartIdx )) )
 #endif
@@ -2504,5 +2490,5 @@
 
   UInt hasDeltaDC = 1;
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
   {
@@ -2526,5 +2512,5 @@
       if( pcCU->isIntra( absPartIdx ) )
       {
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
         if( pcCU->getSDCFlag( absPartIdx ) )
         {
@@ -2537,5 +2523,5 @@
         deltaDC = pcCU->getDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
         }
 #endif
@@ -2554,4 +2540,5 @@
 Void TEncSbac::xCodeDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
 {
+  DTRACE_CU("delta_dc", valDeltaDC);
   xWriteExGolombLevelDdc( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ) );
   if( valDeltaDC != 0 )
@@ -2639,11 +2626,10 @@
 #endif
 
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
   UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
-  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
   DTRACE_CU("dc_only_flag", uiSymbol)
-  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
+  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, 0 ) );
 }
 
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.h	(revision 1221)
@@ -115,5 +115,5 @@
   Void  xWriteEpExGolomb     ( UInt uiSymbol, UInt uiCount );
   Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange );
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  xWriteExGolombLevelDdc( UInt uiSymbol );
   Void  xCodeDeltaDC         ( Pel valDeltaDC, UInt uiNumSeg );
@@ -149,8 +149,8 @@
   Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
-#if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void  codeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
 #endif
-#if H_3D_INTER_SDC
+#if NH_3D_INTRA_SDC || H_3D_INTER_SDC
   Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
@@ -252,8 +252,8 @@
   ContextModel3DBuffer m_cDmmModeSCModel;
 #endif
-#if NH_3D_DMM || NH_3D_SDC
+#if NH_3D_DMM || NH_3D_INTRA_SDC
   ContextModel3DBuffer m_cDdcDataSCModel;
 #endif
-#if H_3D_DIM_SDC  
+#if NH_3D_INTRA_SDC  
   ContextModel3DBuffer m_cSDCResidualFlagSCModel;
   ContextModel3DBuffer m_cSDCResidualSCModel;
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1221)
@@ -1031,5 +1031,5 @@
         if ( pcCU->getIPCMFlag (0))
         {
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
             m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
@@ -1051,7 +1051,7 @@
       {
         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
           m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
-          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) ) 
+          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) )
           {
             m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 );
@@ -1066,5 +1066,5 @@
       {
         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
           }
           m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
@@ -1076,5 +1076,5 @@
             }
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
           if( uiAbsPartIdx == 0 )  
           {
@@ -1974,13 +1974,14 @@
 }
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
 {
 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC
-  Bool bAboveAvail    = false;
-  Bool bLeftAvail     = false;
   UInt uiWidth        = pcCU->getWidth ( 0 );
   UInt uiHeight       = pcCU->getHeight( 0 );
   UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx );
+  const Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
+  const TComSPS     &sps    = *(pcCU->getSlice()->getSPS());
+  const ChromaFormat chFmt  = pcCU->getPic()->getChromaFormat();
 
   UInt sdcDepth = 0;
@@ -1990,6 +1991,5 @@
   Pel* piReco;        
 
-  UInt uiZOrder;         
-  Pel* piRecIPred;       
+  Pel* piRecIPred;
   UInt uiRecIPredStride; 
 
@@ -2001,5 +2001,4 @@
   UInt uiMaskStride = 0;
 #if NH_3D_DMM
-  TComWedgelet* dmm4Segmentation = NULL;
   if( isDmmMode( uiLumaPredMode ) )
   {
@@ -2051,50 +2050,37 @@
 #endif
     uiNumSegments = 1;
-
-    UInt numParts = 1;
-    UInt uiSubPartIdx = uiAbsPartIdx;
-
+    
     if( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )
     {
-      numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
       sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
-      uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
-    }
-
-    for ( Int i = 0; i < numParts; i++ )
-    {
-      uiStride          = pcOrgYuv ->getStride  ();
-      piOrg             = pcOrgYuv ->getLumaAddr( uiSubPartIdx );
-      piPred            = pcPredYuv->getLumaAddr( uiSubPartIdx );
-      piReco            = pcPredYuv->getLumaAddr( uiSubPartIdx );
-
-      uiZOrder          = pcCU->getZorderIdxInCU() + uiSubPartIdx;
-      piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-      uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
-
-      AOF( uiWidth == uiHeight );
-
-      //===== init availability pattern =====
-      pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiSubPartIdx );
-      pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
-
-      predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
-
-      if ( numParts > 1 )
-      {
-        for( UInt uiY = 0; uiY < uiHeight; uiY++ )
-        {
-          for( UInt uiX = 0; uiX < uiWidth; uiX++ )
-          {
-            piPred        [ uiX ] = ClipY( piPred[ uiX ] );
-            piRecIPred    [ uiX ] = piPred[ uiX ];
-          }
-          piPred     += uiStride;
-          piRecIPred += uiRecIPredStride;
-        }
-      }
-
-      uiSubPartIdx += ( ( uiWidth * uiWidth ) >> 4 );
-    }
+    }
+    
+    //===== loop over partitions =====
+    TComTURecurse tuRecurseCU(pcCU, 0);
+    TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (sdcDepth==0)?TComTU::DONT_SPLIT:TComTU::QUAD_SPLIT);
+    
+    do
+    {
+      const TComRectangle &puRect = tuRecurseWithPU.getRect(COMPONENT_Y);
+      const UInt uiAbsPartIdxTU = tuRecurseWithPU.GetAbsPartIdxTU();
+      
+      Pel* piOrgTU         = pcOrgYuv ->getAddr   ( COMPONENT_Y, uiAbsPartIdxTU );
+      Pel* piPredTU        = pcPredYuv->getAddr   ( COMPONENT_Y, uiAbsPartIdxTU );
+      UInt uiStrideTU      = pcPredYuv->getStride ( COMPONENT_Y );
+      
+      //===== init pattern for luma prediction =====
+      Bool bAboveAvail = false;
+      Bool bLeftAvail  = false;
+      
+      if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
+      {
+        initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
+      }
+      
+      const Bool bUseFilter = TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiLumaPredMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
+      
+      predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiLumaPredMode) );
+      
+    } while (tuRecurseWithPU.nextSection(tuRecurseCU));
 
     // reset to full block
@@ -2102,12 +2088,11 @@
     uiHeight = pcCU->getHeight( 0 );
 
-    uiStride          = pcOrgYuv ->getStride  ();
-    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
-    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-    piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-
-    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
-    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
+    uiStride          = pcOrgYuv ->getStride( COMPONENT_Y );
+    piOrg             = pcOrgYuv ->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
+    piPred            = pcPredYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
+    piReco            = pcPredYuv->getAddr  ( COMPONENT_Y, uiAbsPartIdx );
+    
+    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getAddr  ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx );
+    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y );
 
     // get predicted and original DC
@@ -2273,4 +2258,5 @@
     if( !bZeroResidual )
     {
+#if NH_3D_DLT
       Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
       Int   pTestIdx    = pPredIdx + pResidualIdx + iSDCDeltaResi;
@@ -2279,4 +2265,7 @@
         pResidualIdx += iSDCDeltaResi;
       }
+#else
+      pResidualIdx += iSDCDeltaResi;
+#endif
     }
     // save SDC DC offset
@@ -2314,5 +2303,5 @@
       Pel pResiDC = apDCResiValues[ucSegment];
 
-      pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResiDC );
+      pReco    [ uiX ] = ClipBD( pPred[ uiX ] + pResiDC, bitDepthY);
       pRecIPred[ uiX ] = pReco[ uiX ];
     }
@@ -2323,8 +2312,8 @@
   }
 
-  // clear UV
-  UInt  uiStrideC     = pcPredYuv->getCStride();
-  Pel   *pRecCb       = pcPredYuv->getCbAddr();
-  Pel   *pRecCr       = pcPredYuv->getCrAddr();
+  // clear chroma
+  UInt  uiStrideC     = pcPredYuv->getStride( COMPONENT_Cb );
+  Pel   *pRecCb       = pcPredYuv->getAddr  ( COMPONENT_Cb, uiAbsPartIdx );
+  Pel   *pRecCr       = pcPredYuv->getAddr  ( COMPONENT_Cr, uiAbsPartIdx );
 
   for (Int y=0; y<uiHeight/2; y++)
@@ -2346,11 +2335,22 @@
 #endif
 
-  //===== determine distortion =====
-#if H_3D_VSO
-  if ( m_pcRdCost->getUseVSO() )
-    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
+  //===== determine distortion =====  
+#if NH_3D_VSO
+  if( m_pcRdCost->getUseVSO() )
+  {
+    if( m_pcRdCost->getUseEstimatedVSD() )
+    {
+      ruiDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
+    }
+    else
+    {
+      ruiDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
+    }
+  }
   else
 #endif
-    ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
+  {
+    ruiDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, COMPONENT_Y, DF_SAD );
+  }
 
   //===== determine rate and r-d cost =====
@@ -2371,12 +2371,12 @@
 
   // encode pred direction + DC residual data
-  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
+  m_pcEntropyCoder->encodePredInfo( pcCU, 0 );
   m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 
   Bool bDummy = false;
-  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
+  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), bDummy, bDummy );
   UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
 
-#if H_3D_VSO
+#if NH_3D_VSO
   if ( m_pcRdCost->getUseLambdaScaleVSO())
     dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
@@ -3239,5 +3239,5 @@
     UInt rdSDC = m_pcEncCfg->getIsDepth() ? numModesForFullRD : 0;
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     Bool    bBestUseSDC   = false;
     Pel     apBestDCOffsets[2] = {0,0};
@@ -3290,5 +3290,5 @@
       pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
 
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
 #if H_3D_FAST_INTRA_SDC
       Bool bTestSDC = ( ( m_pcEncCfg->getUseSDC() &&  pcCU->getSlice()->getIntraSdcWedgeFlag() ) && pcCU->getSDCAvailable(uiPartOffset) && uiMode >= numModesForFullRD);
@@ -3337,9 +3337,9 @@
 #if NH_3D_ENC_DEPTH
           UInt zeroResiTest = (pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP()) ? 1 : 0;
-#if H_3D_DIM_SDC
-          bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);
+#if NH_3D_INTRA_SDC
+          zeroResiTest |= pcCU->getSDCFlag(uiPartOffset);
           if( uiSDC != 0 && iSDCDeltaResi != 0 )
           {
-            bTestZeroResi = false;
+            zeroResiTest = 0;
           }
 #endif
@@ -3364,13 +3364,13 @@
       }
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
             if( pcCU->getSDCFlag(uiPartOffset) )
             {
               pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);
-              pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);
+              pcCU->setCbfSubParts(1, COMPONENT_Y, uiPartOffset, uiDepth + uiInitTrDepth);
 
               // start encoding with SDC
-              xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
-              if ( testZeroResi == 0 && iOffset <= 3 )
+              xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( zeroResi != 0 ), iSDCDeltaResi );
+              if ( zeroResi == 0 && iOffset <= 3 )
               {
                 dOffsetCost [iOffset -1] = dPUCost;
@@ -3403,5 +3403,5 @@
 #endif
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
             }
 #endif
@@ -3424,5 +3424,5 @@
         dBestPUCost   = dPUCost;
 
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
               if( pcCU->getSDCFlag(uiPartOffset) )
               {
@@ -3430,5 +3430,11 @@
 
                 // copy reconstruction
-                pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight);
+                UInt uiWidthPU  = tuRecurseWithPU.getRect( COMPONENT_Y ).width;
+                UInt uiHeightPU = tuRecurseWithPU.getRect( COMPONENT_Y ).height;
+                UInt    uiWidth        = pcCU->getWidth (0) >> uiInitTrDepth;
+                UInt    uiHeight       = pcCU->getHeight(0) >> uiInitTrDepth;
+                AOF(uiWidth==uiWidthPU);
+                AOF(uiHeight==uiHeightPU);
+                pcPredYuv->copyPartToPartComponent(COMPONENT_Y, pcRecoYuv, uiPartOffset, uiWidth, uiHeight);
 
                 // copy DC values
@@ -3463,9 +3469,8 @@
           ::memcpy( m_puhQTTempCbf[compID], pcCU->getCbf( compID  ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
           ::memcpy( m_puhQTTempTransformSkipFlag[compID],  pcCU->getTransformSkip(compID)  + uiPartOffset, uiQPartNum * sizeof( UChar ) );
-#if H_3D_DIM_SDC
-              }
-#endif
-
-        }
+        }
+#if NH_3D_INTRA_SDC
+        }
+#endif
       }
 #if HHI_RQT_INTRA_SPEEDUP_MOD
@@ -3479,5 +3484,5 @@
           }
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
         } // SDC residual loop
       } // SDC loop
@@ -3510,5 +3515,5 @@
 
       pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
       pcCU->setSDCFlagSubParts(false, uiPartOffset, uiDepth + uiInitTrDepth);
 #endif
@@ -3543,5 +3548,5 @@
         uiBestPUDistY = uiPUDistY;
         dBestPUCost   = dPUCost;
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
         bBestUseSDC   = false;
 #endif
@@ -3580,9 +3585,9 @@
     //--- update overall distortion ---
     uiOverallDistY += uiBestPUDistY;
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     if( bBestUseSDC )
     {
       pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);
-      pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);
+      pcCU->setCbfSubParts(1, COMPONENT_Y, uiPartOffset, uiDepth + uiInitTrDepth);
 
       //=== copy best DC segment values back to CU ====
@@ -3602,5 +3607,5 @@
       ::memcpy( pcCU->getCbf( compID  ) + uiPartOffset, m_puhQTTempCbf[compID], uiQPartNum * sizeof( UChar ) );
       ::memcpy( pcCU->getTransformSkip( compID  ) + uiPartOffset, m_puhQTTempTransformSkipFlag[compID ], uiQPartNum * sizeof( UChar ) );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     }
 #endif
@@ -3639,5 +3644,5 @@
     //=== update PU data ====
     pcCU->setIntraDirSubParts     ( CHANNEL_TYPE_LUMA, uiBestPUMode, uiPartOffset, uiDepth + uiInitTrDepth );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     pcCU->setSDCFlagSubParts          ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth );
 #endif
@@ -6162,5 +6167,5 @@
 #endif
 
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Bool bNonSkip = false;
 #else
@@ -7226,5 +7231,5 @@
     m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
     m_pcEntropyCoder->encodePredInfo( pcCU, 0 );
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
     m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
@@ -7769,5 +7774,5 @@
 #endif
 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
-#if NH_3D_SDC
+#if NH_3D_INTRA_SDC
 Void TEncSearch::xCalcConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC )
 {
Index: /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.h	(revision 1220)
+++ /branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.h	(revision 1221)
@@ -356,9 +356,9 @@
   Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
 #endif
-#if H_3D_DIM_SDC
+#if NH_3D_INTRA_SDC
   Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi    );
 #endif
 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
-#if NH_3D_SDC
+#if NH_3D_INTRA_SDC
   Void xCalcConstantSDC           ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC );
 #endif
