Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h	(revision 667)
@@ -109,5 +109,9 @@
 #define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
 #define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
+#if QC_DIM_DELTADC_UNIFY_F0132
+#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
+#else
 #define NUM_DDC_DATA_CTX              2       ///< number of context models for deltaDC data (DMM or RBC)
+#endif
 #if H_3D_DIM_DMM
 #define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
@@ -405,7 +409,13 @@
 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 
 {
+#if QC_DIM_DELTADC_UNIFY_F0132
+  { 154 }, 
+  { 154 }, 
+  { 154 }, 
+#else
   { CNU, CNU }, 
   { CNU, CNU }, 
   { CNU, CNU }, 
+#endif
 };
 #if H_3D_DIM_DMM
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp	(revision 667)
@@ -475,6 +475,10 @@
   assert( biSegPattern );
   Int* piMask = NULL;
+#if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171
+  piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering
+#else
   if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM
   else            piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );
+#endif
   assert( piMask );
   Int maskStride = 2*iWidth + 1;  
@@ -491,5 +495,9 @@
     Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx );
 #if H_3D_DIM_DMM
+#if QC_DIM_DELTADC_UNIFY_F0132
+    if( isDmmMode || isRbcMode)
+#else
     if( isDmmMode )
+#endif
     {
 #if H_3D_DIM_DLT
@@ -502,5 +510,5 @@
     }
 #endif
-#if H_3D_DIM_RBC
+#if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132
     if( isRbcMode )
     {
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 667)
@@ -218,4 +218,6 @@
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
                                               // LG_ZEROINTRADEPTHRESI_A0087
+#define QC_DIM_DELTADC_UNIFY_F0132        1   // Unify delta DC coding in depth intra modes
+#define HHI_DIM_PREDSAMP_FIX_F0171        1
 #endif
 ///// ***** VIEW SYNTHESIS PREDICTION *********
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 667)
@@ -408,4 +408,22 @@
 }
 
+#if QC_DIM_DELTADC_UNIFY_F0132
+Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg )
+{
+  UInt absValDeltaDC = 0;
+  xReadExGolombLevel( absValDeltaDC, m_cDdcDataSCModel.get(0, 0, 0) );
+  rValDeltaDC = (Pel)absValDeltaDC + ( uiNumSeg > 1 ? 0 : 1 );
+
+  if( rValDeltaDC != 0 )
+  {
+    UInt uiSign;
+    m_pcTDecBinIf->decodeBinEP( uiSign );
+    if ( uiSign )
+    {
+      rValDeltaDC = -rValDeltaDC;
+    }
+  }
+}
+#else
 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt dimType )
 {
@@ -424,4 +442,6 @@
   }
 }
+#endif
+
 #if H_3D_DIM_DMM
 Void TDecSbac::xParseDmm1WedgeIdx( UInt& ruiTabIdx, Int iNumBit )
@@ -1157,5 +1177,5 @@
   }
 
-#if H_3D_DIM_SDC
+#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
   if( pcCU->getSDCFlag(absPartIdx) )
   {
@@ -1173,7 +1193,48 @@
   {
 #endif
+#if QC_DIM_DELTADC_UNIFY_F0132
+    if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
+#else
     if( dimType < DIM_NUM_TYPE )
+#endif
     {
       UInt symbol;
+#if QC_DIM_DELTADC_UNIFY_F0132
+      UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
+
+      if( pcCU->getSDCFlag( absPartIdx ) )
+      {
+        assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
+        pcCU->setTrIdxSubParts(0, absPartIdx, depth);
+        pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
+      }
+
+      m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
+
+      if( symbol )
+      {
+        if( !pcCU->getSDCFlag( absPartIdx ) )
+        {
+          dir += symbol;
+        }
+      }
+      for( UInt segment = 0; segment < uiNumSegments; segment++ )
+      {
+        Pel valDeltaDC = 0;
+        if( symbol )
+        {
+          xParseDimDeltaDC( valDeltaDC, uiNumSegments );
+        }
+
+        if( pcCU->getSDCFlag( absPartIdx ) )
+        {
+          pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
+        }
+        else
+        {
+          pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
+        }
+      }
+#else
       m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
       if( symbol )
@@ -1187,6 +1248,7 @@
         }
       }
-    }
-#if H_3D_DIM_SDC
+#endif
+    }
+#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
   }
 #endif
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h	(revision 667)
@@ -99,5 +99,9 @@
 #if H_3D_DIM
   Void  xReadExGolombLevel   ( UInt& ruiSymbol, ContextModel& rcSCModel  );
+#if QC_DIM_DELTADC_UNIFY_F0132
+  Void  xParseDimDeltaDC     ( Pel& rValDeltaDC, UInt uiNumSeg );
+#else
   Void  xParseDimDeltaDC     ( Pel& rValDeltaDC, UInt dimType );
+#endif
 #if H_3D_DIM_DMM
   Void  xParseDmm1WedgeIdx   ( UInt& ruiTabIdx, Int iNumBit );
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 667)
@@ -518,4 +518,15 @@
 }
 
+#if QC_DIM_DELTADC_UNIFY_F0132
+Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
+{
+  xWriteExGolombLevel( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ), m_cDdcDataSCModel.get(0, 0, 0) );
+  if( valDeltaDC != 0 )
+  {
+    UInt uiSign = valDeltaDC > 0 ? 0 : 1;
+    m_pcBinIf->encodeBinEP( uiSign );
+  }
+}
+#else
 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt dimType )
 {
@@ -527,4 +538,5 @@
   }
 }
+#endif
 
 #if H_3D_DIM_DMM
@@ -1225,5 +1237,5 @@
   }
 
-#if H_3D_DIM_SDC
+#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
   if( pcCU->getSDCFlag( absPartIdx ) )
   {
@@ -1238,6 +1250,41 @@
   {
 #endif
+#if QC_DIM_DELTADC_UNIFY_F0132
+    if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
+#else
     if( dimType < DIM_NUM_TYPE )
-    {
+#endif
+    {
+#if QC_DIM_DELTADC_UNIFY_F0132
+      UInt dimDeltaDC;
+      Pel  deltaDC;
+      UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
+      if( pcCU->getSDCFlag( absPartIdx ) )
+      {
+        if( uiNumSegments==1 )
+        {
+          dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
+        }
+        else
+        {
+          dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
+        }
+      }
+      else
+      {
+        dimDeltaDC = isDimDeltaDC( dir );
+      }
+
+      m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
+
+      if( dimDeltaDC ) 
+      {
+        for( UInt segment = 0; segment < uiNumSegments; segment++ )
+        {
+          deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
+          xCodeDimDeltaDC( deltaDC, uiNumSegments );
+        }
+      }
+#else
       UInt dimDeltaDC = isDimDeltaDC( dir );
       m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
@@ -1249,6 +1296,7 @@
         }
       }
-    }
-#if H_3D_DIM_SDC
+#endif
+    }
+#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
   }
 #endif
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h	(revision 667)
@@ -118,5 +118,9 @@
   #if H_3D_DIM
   Void  xWriteExGolombLevel  ( UInt uiSymbol, ContextModel& rcSCModel  );
+#if QC_DIM_DELTADC_UNIFY_F0132
+  Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt uiNumSeg );
+#else
   Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt dimType );
+#endif
 #if H_3D_DIM_DMM
   Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
Index: branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 665)
+++ branches/HTM-8.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 667)
@@ -2928,5 +2928,9 @@
         {
           Pel deltaDC1 = 0; Pel deltaDC2 = 0;
+#if QC_DIM_DELTADC_UNIFY_F0132
+          xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
+#else
           xSearchRbcDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
+#endif
           pcCU->setDimDeltaDC( RBC_IDX, 0, uiPartOffset, deltaDC1 );
           pcCU->setDimDeltaDC( RBC_IDX, 1, uiPartOffset, deltaDC2 );
