Index: branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h	(revision 781)
+++ branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h	(revision 782)
@@ -119,5 +119,7 @@
 #if QC_GENERIC_SDC_G0122
 #define NUM_ANGLE_FLAG_CTX            3
+#if !QC_SDC_UNIFY_G0130
 #define NUM_INTRASDC_FLAG_CTX         3
+#endif
 #endif
 #endif
@@ -128,8 +130,11 @@
 #endif
 
-#if H_3D_INTER_SDC
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
 #define NUM_INTER_SDC_FLAG_CTX        1      ///< number of context models for inter SDC flag
 #define NUM_INTER_SDC_SIGN_FLAG_CTX   1      ///< number of context models for sign of inter SDC residual
 #define NUM_INTER_SDC_RESIDUAL_CTX    1      ///< number of context models for abs of inter SDC residual
+#endif
+#if QC_SDC_UNIFY_G0130
+#define NUM_SDC_FLAG_CTX              1      ///< number of context models for inter SDC flag
 #endif
 // ====================================================================================================================
@@ -417,4 +422,5 @@
   { 155, 170, 157 },
 };
+#if !QC_SDC_UNIFY_G0130
 static const UChar 
 INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =
@@ -425,4 +431,5 @@
 };
 #endif
+#endif
 
 static const UChar 
@@ -467,5 +474,5 @@
 #endif
 
-#if H_3D_INTER_SDC
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
 static const UChar 
 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] =
@@ -493,5 +500,13 @@
 #endif
 //! \}
-
-
-#endif
+#if QC_SDC_UNIFY_G0130
+static const UChar 
+INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] =
+{
+  { 154 },  
+  { 154 },
+  { 154 },
+};
+#endif
+
+#endif
Index: branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 781)
+++ branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 782)
@@ -123,6 +123,13 @@
 #if H_3D_DIM_SDC
   m_pbSDCFlag             = NULL;
+#if QC_SDC_UNIFY_G0130
+  for( Int i = 0; i < 4; i++ )
+  {
+    m_apSegmentDCOffset[i]  = NULL;
+  }
+#else
   m_apSegmentDCOffset[0]  = NULL;
   m_apSegmentDCOffset[1]  = NULL;
+#endif
 #endif
 #endif
@@ -146,4 +153,5 @@
 #endif
 #if H_3D_INTER_SDC
+#if !QC_SDC_UNIFY_G0130
   m_pbInterSDCFlag       = NULL;
   for( Int i = 0; i < 4; i++ )
@@ -151,4 +159,5 @@
     m_apSegmentInterDCOffset[i] = NULL;
   }
+#endif
   m_pucInterSDCMask       = NULL;
 #endif
@@ -272,9 +281,16 @@
 #if H_3D_DIM_SDC
     m_pbSDCFlag             = (Bool*)xMalloc(Bool, uiNumPartition);
+#if QC_SDC_UNIFY_G0130
+    for( Int i = 0; i < 4; i++ )
+    {
+      m_apSegmentDCOffset[i]  = (Pel*)xMalloc(Pel, uiNumPartition);
+    }
+#else
     m_apSegmentDCOffset[0]  = (Pel*)xMalloc(Pel, uiNumPartition);
     m_apSegmentDCOffset[1]  = (Pel*)xMalloc(Pel, uiNumPartition);
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
     m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
     for( Int i = 0; i < 4; i++ )
@@ -400,9 +416,16 @@
 #if H_3D_DIM_SDC
     if ( m_pbSDCFlag            ) { xFree(m_pbSDCFlag);             m_pbSDCFlag             = NULL; }
+#if QC_SDC_UNIFY_G0130
+    for( Int i = 0; i < 4; i++ )
+    {
+      if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]);  m_apSegmentDCOffset[i]  = NULL; }
+    }
+#else
     if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]);  m_apSegmentDCOffset[0]  = NULL; }
     if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]);  m_apSegmentDCOffset[1]  = NULL; }
 #endif
+#endif
 #endif    
-#if H_3D_INTER_SDC
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
     if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
     for(Int i = 0; i < 4; i++ )
@@ -554,5 +577,5 @@
     m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
 #endif
-#if H_3D_INTER_SDC
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
     m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
 #endif
@@ -616,9 +639,16 @@
 #if H_3D_DIM_SDC
     memset( m_pbSDCFlag             + firstElement,     0,                numElements * sizeof( *m_pbSDCFlag            ) );
+#if QC_SDC_UNIFY_G0130
+    for( Int i = 0; i < 4; i++ )
+    {
+      memset( m_apSegmentDCOffset[i]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[i] ) );
+    }
+#else
     memset( m_apSegmentDCOffset[0]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[0] ) );
     memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
     memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
     for( Int i = 0; i < 4; i++ )
@@ -788,9 +818,16 @@
 #if H_3D_DIM_SDC
       m_pbSDCFlag           [ui] = false;
+#if QC_SDC_UNIFY_G0130
+      for( Int i = 0; i < 4; i++ )
+      {
+        m_apSegmentDCOffset[i][ui] = 0;
+      }
+#else
       m_apSegmentDCOffset[0][ui] = 0;
       m_apSegmentDCOffset[1][ui] = 0;
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
       m_pbInterSDCFlag[ui] = false;
       for( Int i = 0; i < 4; i++ )
@@ -901,9 +938,16 @@
 #if H_3D_DIM_SDC
   memset( m_pbSDCFlag,            0, sizeof(Bool) * m_uiNumPartition  );
+#if QC_SDC_UNIFY_G0130
+  for( Int i = 0; i < 4; i++ )
+  {
+    memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition   );
+  }
+#else
   memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
   memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
   memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
   for( Int i = 0; i < 4; i++ )
@@ -978,9 +1022,16 @@
 #if H_3D_DIM_SDC
       m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
+#if QC_SDC_UNIFY_G0130
+      for( Int i = 0; i < 4; i++ )
+      {
+        m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ];
+      }
+#else
       m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
       m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
       m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
       for( Int i = 0; i < 4; i++ )
@@ -1134,9 +1185,16 @@
 #if H_3D_DIM_SDC
   m_pbSDCFlag               = pcCU->getSDCFlag()              + uiPart;
+#if QC_SDC_UNIFY_G0130
+  for( Int i = 0; i < 4; i++ )
+  {
+    m_apSegmentDCOffset[i]    = pcCU->getSDCSegmentDCOffset(i)  + uiPart;
+  }
+#else
   m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0)  + uiPart;
   m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1)  + uiPart;
 #endif
+#endif
 #endif  
-#if H_3D_INTER_SDC
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
   m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
   for( Int i = 0; i < 4; i++ )
@@ -1328,9 +1386,16 @@
 #if H_3D_DIM_SDC
   memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(),             iSizeInBool  );
+#if QC_SDC_UNIFY_G0130
+  for( Int i = 0; i < 4; i++ )
+  {
+    memcpy( m_apSegmentDCOffset[i]  + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition);
+  }
+#else
   memcpy( m_apSegmentDCOffset[0]  + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
   memcpy( m_apSegmentDCOffset[1]  + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
   memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
   for( Int i = 0; i < 4; i++ )
@@ -1450,9 +1515,16 @@
 #if H_3D_DIM_SDC
   memcpy( rpcCU->getSDCFlag()             + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
+#if QC_SDC_UNIFY_G0130
+  for( Int i = 0; i < 4; i++ )
+  {
+    memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition);
+  }
+#else
   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);
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
   memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
   for( Int i = 0;i < 4; i++ )
@@ -1558,9 +1630,16 @@
 #if H_3D_DIM_SDC
   memcpy( rpcCU->getSDCFlag()             + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
+#if QC_SDC_UNIFY_G0130
+  for( Int i = 0; i < 4; i++ )
+  {
+    memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart);
+  }
+#else
   memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
   memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
 #endif
 #endif
-#if H_3D_INTER_SDC
+#endif
+#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
   memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
   for( Int i = 0; i < 4; i++ )
@@ -2293,4 +2372,5 @@
 
 #if H_3D_INTER_SDC
+#if !QC_SDC_UNIFY_G0130
 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
@@ -2302,4 +2382,5 @@
   return 0;
 }
+#endif
 
 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )
@@ -2404,4 +2485,7 @@
 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
 {
+#if QC_SDC_UNIFY_G0130
+  return 0;
+#else
   TComDataCU* pcTempCU;
   UInt        uiTempPartIdx;
@@ -2417,4 +2501,5 @@
 
   return uiCtx;
+#endif
 }
 
Index: branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 781)
+++ branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 782)
@@ -215,10 +215,16 @@
 #if H_3D_DIM_SDC
   Bool*         m_pbSDCFlag;
+#if QC_SDC_UNIFY_G0130
+  Pel*          m_apSegmentDCOffset[4];
+#else
   Pel*          m_apSegmentDCOffset[2];
 #endif
 #endif
+#endif
 #if H_3D_INTER_SDC
+#if !QC_SDC_UNIFY_G0130
   Bool*         m_pbInterSDCFlag;
   Int*          m_apSegmentInterDCOffset[4];
+#endif
   UChar*        m_pucInterSDCMask;
 #endif
@@ -578,4 +584,5 @@
 #endif
 #if H_3D_INTER_SDC
+#if !QC_SDC_UNIFY_G0130
   Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
   Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
@@ -585,5 +592,5 @@
   Int           getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }
   Void          setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }
-
+#endif
   Void          xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );
 
Index: branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 781)
+++ branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 782)
@@ -236,5 +236,7 @@
 #endif
 #define QC_GENERIC_SDC_G0122              1  // Generalize SDC to all depth intra modes
-
+#if H_3D_DIM_SDC && H_3D_INTER_SDC
+#define QC_SDC_UNIFY_G0130                1  // Unify intra SDC and inter SDC
+#endif
 #define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
