Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h	(revision 382)
@@ -128,5 +128,10 @@
 
 #if RWTH_SDC_DLT_B0036
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+#define DEPTH_MODE_NUM_FLAG_CTX          8
+#define DMM_DELTA_NUM_FLAG_CTX           1
+#else
 #define SDC_NUM_FLAG_CTX                 3
+#endif
 #define SDC_NUM_RESIDUAL_FLAG_CTX        1
 #define SDC_NUM_SIGN_FLAG_CTX            1
@@ -523,4 +528,18 @@
 
 #if RWTH_SDC_DLT_B0036
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+static const UChar INIT_DEPTHMODE_FLAG[3][DEPTH_MODE_NUM_FLAG_CTX]=
+{
+  {0,  0,  64,   0, CNU,   0, CNU, 0},
+  {0, 64,   0, CNU,   0, CNU,   0, 0},
+  {64, 0, CNU,   0, CNU,   0,   0, 0}
+};
+static const UChar INIT_DMMDELTA_FLAG[3][DMM_DELTA_NUM_FLAG_CTX]=
+{
+  {0},
+  {0},
+  {64}
+};
+#else
 static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] =
 {
@@ -535,4 +554,5 @@
   }
 };
+#endif
 
 static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] =
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 382)
@@ -2907,4 +2907,5 @@
 }
 
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
 {
@@ -2923,4 +2924,5 @@
   return uiCtx;
 }
+#endif
 
 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx )
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 382)
@@ -808,5 +808,7 @@
   Void          setSDCFlagSubParts  ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
   
-  UInt          getCtxSDCFlag              ( UInt uiAbsPartIdx );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
+  UInt          getCtxSDCFlag               ( UInt uiAbsPartIdx );
+#endif
   
   Bool          getSDCAvailable             ( UInt uiAbsPartIdx );
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 382)
@@ -76,4 +76,5 @@
 #define FIX_SDC_ENC_RD_WVSO_D0163         1   // JCT3V-D0163: fix for SDC encoder rd-cost (VSO -> WVSO)
 
+#define PKU_QC_DEPTH_INTRA_UNI_D0195      1   // JCT3V-D0195: unified syntax table for depth intra coding tools
 ///// ***** TMVP/AMVP *********
 #define TMVP_DEPTH_SWITCH                 1   // JCT3V-B0092 additional encoder option only 
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 382)
@@ -2426,4 +2426,5 @@
 
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -2434,4 +2435,5 @@
   assert(0);
 }
+#endif
 Void TDecCavlc::parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
 {
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 382)
@@ -171,6 +171,8 @@
   Void parseDFSvlc         ( Int&  riVal,  const Char *pSymbolName  );
 #if RWTH_SDC_DLT_B0036
-  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
+  Void parseSDCFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+#endif
   Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
 #endif
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 382)
@@ -117,4 +117,5 @@
   m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
   
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   // if B-Slice, code SDC flag later
@@ -125,8 +126,10 @@
   }
 #endif
+#endif
 }
 
 Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
@@ -137,7 +140,9 @@
   }
 #endif
+#endif
   
   m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
@@ -154,8 +159,10 @@
   }
 #endif
+#endif
 }
 
 Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
 {
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   if( pcCU->getSDCFlag(uiAbsPartIdx) )
@@ -164,4 +171,5 @@
     return;
   }
+#endif
 #endif
   
@@ -178,4 +186,7 @@
       decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 );
       decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+      if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
       decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
     }
@@ -183,4 +194,7 @@
     {
       decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+      if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
       decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
     }
@@ -789,6 +803,7 @@
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-    
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
     decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
+#endif
     return;
   }
@@ -847,4 +862,5 @@
 
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -861,5 +877,5 @@
   m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
 }
-
+#endif
 Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h	(revision 382)
@@ -137,6 +137,8 @@
   
 #if RWTH_SDC_DLT_B0036
-  virtual Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
+  virtual Void parseSDCFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
   virtual Void parseSDCPredMode     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
+#endif
   virtual Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
 #endif
@@ -232,6 +234,8 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+#endif
   Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 382)
@@ -95,6 +95,8 @@
 , m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 , m_cDmmFlagSCModel           ( 1,             1,               NUM_DMM_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cDmmModeSCModel           ( 1,             1,               NUM_DMM_MODE_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 , m_cDmmDataSCModel           ( 1,             1,               NUM_DMM_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -106,5 +108,10 @@
 #endif
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 , m_cSDCFlagSCModel             ( 1,             1,                 SDC_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
+#else
+, m_cDepthModeModel             ( 1,             1,                 DEPTH_MODE_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
+, m_cDmmDeltaFlagModel             ( 1,             1,                 DMM_DELTA_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 , m_cSDCResidualFlagSCModel     ( 1,             2,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSDCResidualSignFlagSCModel ( 1,             2,  SDC_NUM_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
@@ -200,10 +207,17 @@
   m_uiLastDQpNonZero  = 0;
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cDmmFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_FLAG );
   m_cDmmModeSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_MODE );
+#endif
   m_cDmmDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_DATA );
 #endif
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cSDCFlagSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
+#else
+  m_cDepthModeModel.initBuffer              ( sliceType, qp, (UChar*)INIT_DEPTHMODE_FLAG );
+  m_cDmmDeltaFlagModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMMDELTA_FLAG );
+#endif
   m_cSDCResidualFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
   m_cSDCResidualSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );
@@ -279,10 +293,17 @@
   m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cDmmFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG );
   m_cDmmModeSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_MODE );
+#endif
   m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
 #endif
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
+#else
+  m_cDepthModeModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG );
+  m_cDmmDeltaFlagModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG );
+#endif
   m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
   m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
@@ -869,10 +890,218 @@
   pcCU->setPredModeSubParts( (PredMode)iPredMode, uiAbsPartIdx, uiDepth );
 }
-  
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+Void TDecSbac::parseDepthIntraMode  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
+{
+  UInt uiPuIdx = ( pcCU->getWidth(uiAbsPartIdx) == 64 )? 2 : ( ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && pcCU->getWidth(uiAbsPartIdx) == 8 )? 0 : 1);
+  UInt uiDir = 0;
+  Bool bSDCFlag = 0;
+  UInt uiSymbol = 1;
+  UInt uiCode = 0 ;
+  UInt uiBinNum = 0;
+  UInt uiCtxDepthMode = 0;
+  if ( uiPuIdx ==2 )
+  {
+    while(uiBinNum<2 && uiSymbol)
+    {
+      uiCtxDepthMode = uiPuIdx*3 + uiBinNum;
+      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+      uiCode = (uiCode<<1)+uiSymbol;
+      uiBinNum++;
+    }
+    if (uiCode == 0)      { uiDir = PLANAR_IDX; bSDCFlag = 1;}
+    else if (uiCode == 2) { uiDir = 0;          bSDCFlag = 0;}
+    else if (uiCode == 3) { uiDir = DC_IDX;     bSDCFlag = 1;}
+  }
+  else if ( uiPuIdx ==0 )
+  {
+    while(uiBinNum<3 && uiSymbol)
+    {
+      uiCtxDepthMode = uiPuIdx*3 + ( uiBinNum >= 2? 2 : uiBinNum );
+      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+      uiCode = (uiCode<<1)+uiSymbol;
+      uiBinNum++;
+    }
+    if (uiCode == 0)      { uiDir = 0;                     bSDCFlag = 0;}
+    else if (uiCode == 2) { uiDir = DMM_WEDGE_FULL_IDX;    bSDCFlag = 0;}
+    else if (uiCode == 6) { uiDir = DMM_WEDGE_PREDTEX_IDX; bSDCFlag = 0;}
+    else if (uiCode == 7) { uiDir = EDGE_INTRA_IDX;        bSDCFlag = 0;}
+  }
+  else
+  {
+    uiCtxDepthMode = uiPuIdx*3 ;
+    m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+    uiCode = (uiCode<<1)+uiSymbol;
+    if (!uiSymbol)
+    {
+      uiCtxDepthMode = uiPuIdx*3 + 1;
+      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+      uiCode = (uiCode<<1)+uiSymbol;
+      if (uiSymbol) 
+      { 
+        uiCtxDepthMode = uiPuIdx*3 + 2;
+        m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+        uiCode = (uiCode<<1)+uiSymbol;
+      }
+    }
+    else
+    {
+      uiCtxDepthMode = uiPuIdx*3 + 1;
+      m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+      uiCode = (uiCode<<1)+uiSymbol;
+      if (!uiSymbol) 
+      { 
+        uiCtxDepthMode = uiPuIdx*3 + 2;
+        m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+        uiCode = (uiCode<<1)+uiSymbol;
+      }
+      else
+      {
+        uiBinNum = 0;
+        while( uiSymbol && uiBinNum<3 )
+        {
+          uiCtxDepthMode = uiPuIdx*3 + 2;
+          m_pcTDecBinIf->decodeBin(uiSymbol,m_cDepthModeModel.get(0,0,uiCtxDepthMode));
+          uiCode = (uiCode<<1)+uiSymbol;
+          uiBinNum++;
+        }
+      }
+    }
+    if (uiCode == 0)       { uiDir = PLANAR_IDX;              bSDCFlag = 1;}
+    else if (uiCode == 2)  { uiDir = 5;                       bSDCFlag = 0;}
+    else if (uiCode == 3)  { uiDir = DMM_WEDGE_FULL_IDX;      bSDCFlag = 1;}
+    else if (uiCode == 4)  { uiDir = DMM_WEDGE_FULL_IDX;      bSDCFlag = 0;}
+    else if (uiCode == 5)  { uiDir = DMM_CONTOUR_PREDTEX_IDX; bSDCFlag = 0;}
+    else if (uiCode == 6)  { uiDir = DMM_WEDGE_PREDTEX_IDX;   bSDCFlag = 0;}
+    else if (uiCode == 14) { uiDir = DC_IDX;                  bSDCFlag = 1;}
+    else if (uiCode == 31) { uiDir = DMM_WEDGE_PREDDIR_IDX;   bSDCFlag = 0;}
+    else if (uiCode == 30) { uiDir = EDGE_INTRA_IDX;          bSDCFlag = 0;}
+  }
+  pcCU->setLumaIntraDirSubParts( (UChar)uiDir, uiAbsPartIdx, uiDepth );
+  pcCU->setSDCFlagSubParts(bSDCFlag, uiAbsPartIdx, 0, uiDepth); 
+}
+Void TDecSbac::parseDepthModelingTable  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
+{
+  parseDepthIntraMode(pcCU,uiAbsPartIdx,uiDepth);
+  
+  UInt uiDir = pcCU->getLumaIntraDir(uiAbsPartIdx);
+  Bool bSdcFlag =  pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx);
+  Bool bDmmFlag = (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX &&(!bSdcFlag))? 1:0;
+  if (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX)//DMM modes and SDC DMM1
+  {
+    if( uiDir == DMM_WEDGE_FULL_IDX )          { xParseWedgeFullInfo          ( pcCU, uiAbsPartIdx, uiDepth ); }
+    else if( uiDir == DMM_WEDGE_PREDTEX_IDX )  { xParseWedgePredTexInfo       ( pcCU, uiAbsPartIdx, uiDepth ); }
+    else if( uiDir == DMM_WEDGE_PREDDIR_IDX )  { xParseWedgePredDirInfo       ( pcCU, uiAbsPartIdx, uiDepth ); }
+  } 
+  else if(uiDir >= EDGE_INTRA_IDX)//CCM mode
+  {
+    xParseEdgeIntraInfo( pcCU, uiAbsPartIdx, uiDepth );
+  }
+
+  UInt uiSymbol;
+  if (bDmmFlag)
+  {
+    if (bDmmFlag)
+    {
+      m_pcTDecBinIf->decodeBin( uiSymbol , m_cDmmDeltaFlagModel.get(0, 0, 0) );
+      uiDir += uiSymbol;
+    }
+    if (uiSymbol)
+    {
+      UInt uiDC;
+      Int iDC = 0,iDC1 = 0,iDC2 = 0;
+      for ( Int i = 0; i  <2; i++ )
+      {
+        xReadExGolombLevel( uiDC, m_cDmmDataSCModel.get(0, 0, 1) );
+        iDC = uiDC;
+        if ( uiDC )
+        {
+          UInt uiSign;
+          m_pcTDecBinIf->decodeBinEP( uiSign );
+          if ( uiSign )
+          {
+            iDC = -iDC;
+          }
+        }
+        if ( i == 0 ) { iDC1 = iDC; }
+        else          { iDC2 = iDC; }
+      }
+
+      if( uiDir == DMM_WEDGE_FULL_D_IDX )   
+      { 
+        pcCU->setWedgeFullDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
+        pcCU->setWedgeFullDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
+      }
+      else if( uiDir == DMM_WEDGE_PREDDIR_D_IDX ) 
+      { 
+        pcCU->setWedgePredDirDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
+        pcCU->setWedgePredDirDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
+      }
+      else if( uiDir == DMM_WEDGE_PREDTEX_D_IDX)  
+      { 
+        pcCU->setWedgePredTexDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
+        pcCU->setWedgePredTexDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
+      }
+      else if (uiDir== DMM_CONTOUR_PREDTEX_D_IDX )
+      {
+        pcCU->setContourPredTexDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth );
+        pcCU->setContourPredTexDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth );
+      }
+    }
+  }
+  else if (uiDir >= EDGE_INTRA_IDX)
+  {
+    m_pcTDecBinIf->decodeBin( uiSymbol, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) );
+    if( uiSymbol )
+    {
+      uiDir = EDGE_INTRA_DELTA_IDX;
+      Int iDeltaDC = 0,iDeltaDC0 = 0,iDeltaDC1 = 0;
+      for (Int i = 0; i<2; i++)
+      {
+        xReadExGolombLevel( (UInt &) iDeltaDC, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) );
+        if( iDeltaDC != 0 )
+        {
+          UInt uiSign;
+          m_pcTDecBinIf->decodeBinEP( uiSign );
+          if ( uiSign )
+          {
+            iDeltaDC = -iDeltaDC;
+          }
+        }
+        if ( i == 0 ) { iDeltaDC0 = iDeltaDC; }
+        else          { iDeltaDC1 = iDeltaDC; }
+      }
+
+      pcCU->setEdgeDeltaDC0( uiAbsPartIdx, iDeltaDC0 );
+      pcCU->setEdgeDeltaDC1( uiAbsPartIdx, iDeltaDC1 );
+    }
+  }
+  else if(bSdcFlag)//SDC mode
+  {
+    assert(pcCU->getPartitionSize(uiAbsPartIdx)!=SIZE_NxN);
+    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
+    pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth);
+
+    UInt uiNumSegments = ( uiDir == DC_IDX || uiDir == PLANAR_IDX )? 1 : 2;
+    for (int uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
+    {
+      parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
+    }
+  }
+
+  pcCU->setLumaIntraDirSubParts( (UChar)uiDir, uiAbsPartIdx, uiDepth );
+}
+#endif
 Void TDecSbac::parseIntraDirLumaAng  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
   UInt uiSymbol;
   Int  intraPredMode;
-
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+  if (pcCU->getSlice()->getSPS()->isDepth())
+  {
+    parseDepthModelingTable(pcCU, uiAbsPartIdx, uiDepth);
+  }
+  if (pcCU->getLumaIntraDir(uiAbsPartIdx)<NUM_INTRA_MODE && !pcCU->getSDCFlag(uiAbsPartIdx))
+  {
+#else
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
   UInt uiFlag = 0;
@@ -928,10 +1157,12 @@
     }
 #endif
-
+#endif
     Int uiPreds[3] = {-1, -1, -1};
     Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds);  
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if LGE_EDGE_INTRA_A0070
     UInt uiCheckBit = 0;
 #endif
+#endif
 
     m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUIntraPredSCModel.get( 0, 0, 0) );
@@ -953,4 +1184,5 @@
 
       m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if LGE_EDGE_INTRA_A0070
       if (bCodeEdgeIntra)
@@ -964,4 +1196,5 @@
       }
 #endif
+#endif
       intraPredMode = uiSymbol;
 
@@ -979,7 +1212,9 @@
         std::swap(uiPreds[1], uiPreds[2]);
       }
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if LGE_EDGE_INTRA_A0070
       if ( intraPredMode != EDGE_INTRA_IDX)
       {
+#endif
 #endif
         for ( Int i = 0; i < uiPredNum; i++ )
@@ -987,9 +1222,12 @@
           intraPredMode += ( intraPredMode >= uiPreds[i] );
         }
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if LGE_EDGE_INTRA_A0070
       }
 #endif
-    }
-
+#endif
+    }
+
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if LGE_EDGE_INTRA_A0070
     if( intraPredMode == EDGE_INTRA_IDX )
@@ -1035,6 +1273,9 @@
   }
 #endif
-
   pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth );
+#else
+    pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth );
+  }
+#endif
 }
 
@@ -2335,4 +2576,5 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -2388,4 +2630,5 @@
   pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth);
 }
+#endif
 
 Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h	(revision 382)
@@ -120,6 +120,8 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+#endif
   Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
 #endif
@@ -178,5 +180,8 @@
   Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-  
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+  Void parseDepthIntraMode  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+  Void parseDepthModelingTable( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+#endif
   Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   
@@ -253,6 +258,8 @@
 
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   ContextModel3DBuffer m_cDmmFlagSCModel;
   ContextModel3DBuffer m_cDmmModeSCModel;
+#endif
   ContextModel3DBuffer m_cDmmDataSCModel;
 #endif
@@ -265,5 +272,10 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   ContextModel3DBuffer m_cSDCFlagSCModel;
+#else
+  ContextModel3DBuffer m_cDepthModeModel;
+  ContextModel3DBuffer m_cDmmDeltaFlagModel;
+#endif
   
   ContextModel3DBuffer m_cSDCResidualFlagSCModel;
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 382)
@@ -1406,5 +1406,9 @@
 }
 
-Void TEncCavlc::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx )
+Void TEncCavlc::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+                                    , Bool bSdcRD
+#endif
+                                    )
 {
   assert(0);
@@ -1884,14 +1888,15 @@
 
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
   assert(0);
 }
-
+#endif
 Void TEncCavlc::codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
 {
   assert(0);
 }
-
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TEncCavlc::codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
@@ -1899,3 +1904,4 @@
 }
 #endif
+#endif
 //! \}
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h	(revision 382)
@@ -183,5 +183,9 @@
   Void codeQtRootCbf     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
   
-  Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx );
+  Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    , Bool bSdcRD = false
+#endif
+    );
   
   Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx );
@@ -209,8 +213,12 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#endif
   Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void codeSDCPredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
+#endif
 
 };
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 382)
@@ -828,4 +828,5 @@
   m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx );
   
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   // if B-Slice, code SDC flag later
@@ -835,4 +836,5 @@
     encodeSDCFlag(pcCU, uiAbsPartIdx, bRD);
   }
+#endif
 #endif
 }
@@ -876,4 +878,5 @@
     }
   }
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
@@ -883,7 +886,9 @@
   }
 #endif
+#endif
   
   m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   // code SDC flag now!
@@ -899,4 +904,5 @@
     }
   }
+#endif
 #endif
 }
@@ -1179,7 +1185,15 @@
 
 // Intra direction for Luma
-Void TEncEntropy::encodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx )
-{
-  m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx );
+Void TEncEntropy::encodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+                                           ,Bool bSdcRD
+#endif
+                                           )
+{
+  m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    ,bSdcRD
+#endif
+    );
 }
 
@@ -1195,5 +1209,9 @@
 }
 
-Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
+Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+                                 ,Bool bSdcRD
+#endif
+                                 )
 {
   if( bRD )
@@ -1202,4 +1220,5 @@
   }
 
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if RWTH_SDC_DLT_B0036
   if( pcCU->getSDCFlag(uiAbsPartIdx) )
@@ -1208,4 +1227,5 @@
     return;
   }
+#endif
 #endif
 
@@ -1222,10 +1242,20 @@
       encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2 );
       encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3 );
-      encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+      if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
+        encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
     }
     else                                                              // if it is not NxN size, encode 1 intra directions
     {
-      encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx );
-      encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
+      encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+        ,bSdcRD
+#endif
+        );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+      if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
+        encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
     }
   }
@@ -1417,6 +1447,7 @@
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-    
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
     encodeSDCResidualData(pcCU, uiAbsPartIdx);
+#endif
     return;
   }
@@ -1715,4 +1746,5 @@
 
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
@@ -1734,5 +1766,5 @@
   m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx);
 }
-
+#endif
 Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h	(revision 382)
@@ -123,7 +123,11 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   virtual Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
+#endif
   virtual Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   virtual Void codeSDCPredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
+#endif
 #endif
   
@@ -133,5 +137,9 @@
   virtual Void codeQtCbf         ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ) = 0;
   virtual Void codeQtRootCbf     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-  virtual Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
+  virtual Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    , Bool bSdcRD = false
+#endif
+    ) = 0;
   
   virtual Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
@@ -265,6 +273,14 @@
   Void encodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
   Void encodeIPCMInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-  Void encodePredInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-  Void encodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+  Void encodePredInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    ,Bool bSdcRD = false
+#endif
+    );
+  Void encodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+ ,Bool bSdcRD = false 
+#endif
+    );
   
   Void encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
@@ -284,7 +300,11 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void encodeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
+#endif
   Void encodeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void encodeSDCPredMode   ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
+#endif
 #endif
 
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 382)
@@ -103,6 +103,8 @@
 , m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 , m_cDmmFlagSCModel           ( 1,             1,               NUM_DMM_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cDmmModeSCModel           ( 1,             1,               NUM_DMM_MODE_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 , m_cDmmDataSCModel           ( 1,             1,               NUM_DMM_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -114,5 +116,10 @@
 #endif
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 , m_cSDCFlagSCModel             ( 1,             1,                 SDC_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
+#else
+, m_cDepthModeModel             ( 1,             1,                 DEPTH_MODE_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
+, m_cDmmDeltaFlagModel             ( 1,             1,                 DMM_DELTA_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 , m_cSDCResidualFlagSCModel     ( 1,             2,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSDCResidualSignFlagSCModel ( 1,             2,  SDC_NUM_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
@@ -187,6 +194,8 @@
   m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cDmmFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG );
   m_cDmmModeSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_MODE );
+#endif
   m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
 #endif
@@ -198,5 +207,10 @@
 #endif
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
+#else
+  m_cDepthModeModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG );
+  m_cDmmDeltaFlagModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG );
+#endif
   m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
   m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
@@ -340,10 +354,17 @@
   m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cDmmFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG );
   m_cDmmModeSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_MODE );
+#endif
   m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
 #endif
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
+#else
+  m_cDepthModeModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG );
+  m_cDmmDeltaFlagModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG );
+#endif
   m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
   m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
@@ -542,5 +563,13 @@
 }
 
-
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+Void TEncSbac::loadDepthMode( TEncSbac* pSrc)
+{
+  m_pcBinIf->copyState( pSrc->m_pcBinIf );
+
+  this->m_cDepthModeModel      .copyFrom( &pSrc->m_cDepthModeModel       );
+  this->m_cDmmDeltaFlagModel   .copyFrom( &pSrc->m_cDmmDeltaFlagModel       );
+}
+#endif
 Void  TEncSbac::store( TEncSbac* pDest)
 {
@@ -966,9 +995,150 @@
 }
 #endif
-
-Void TEncSbac::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx )
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+Void TEncSbac::codeDepthIntraMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
+{
+  UInt uiCodeWordTable[3][9] =    {{0, 0, 0, 2, 0,6, 0, 0, 7},{0, 2, 3, 4, 5, 6, 14, 31, 30},{0, 2, 0, 0, 0, 0, 3, 0, 0}};
+  UInt uiCodeWordLenTable[3][9] = {{0, 1, 0, 2, 0,3, 0, 0, 3},{2, 3, 3, 3, 3, 3,  4,  5,  5},{1, 2, 0, 0, 0, 0, 2, 0, 0}};
+  UInt uiDir = pcCU->getLumaIntraDir(uiAbsPartIdx);
+  Bool bSdcFlag = pcCU->getSDCFlag(uiAbsPartIdx);
+  UInt uiPuIdx = ( pcCU->getWidth(uiAbsPartIdx) == 64 )? 2 : ( ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && pcCU->getWidth(uiAbsPartIdx) == 8 ) ? 0 : 1 );
+  UInt uiCodeIdx = 0;
+  if ( bSdcFlag ) 
+  { 
+    switch(uiDir)
+    {
+      case PLANAR_IDX: uiCodeIdx = 0; break;
+      case DC_IDX:     uiCodeIdx = 6; break;
+      default:         uiCodeIdx = 2;
+    }
+  }
+  else if ( uiDir>=EDGE_INTRA_IDX ) 
+  { 
+    uiCodeIdx = 8; 
+  }
+  else if ( uiDir<NUM_INTRA_MODE )  
+  { 
+    uiCodeIdx = 1; 
+  }
+  else 
+  {
+    if (uiDir== DMM_WEDGE_FULL_IDX     || uiDir==DMM_WEDGE_FULL_D_IDX     )     {uiCodeIdx = 3;}
+    if (uiDir== DMM_CONTOUR_PREDTEX_IDX|| uiDir==DMM_CONTOUR_PREDTEX_D_IDX)     {uiCodeIdx = 4;}
+    if (uiDir== DMM_WEDGE_PREDTEX_IDX  || uiDir==DMM_WEDGE_PREDTEX_D_IDX  )     {uiCodeIdx = 5;}
+    if (uiDir== DMM_WEDGE_PREDDIR_IDX  || uiDir==DMM_WEDGE_PREDDIR_D_IDX  )     {uiCodeIdx = 7;}
+  }
+  //mode coding
+  for (UInt i=0; i<uiCodeWordLenTable[uiPuIdx][uiCodeIdx]; i++)
+  {
+    UInt uiBit = uiCodeWordTable[uiPuIdx][uiCodeIdx] & ( 1<<(uiCodeWordLenTable[uiPuIdx][uiCodeIdx]-i-1) );
+    UInt uiCtxDepthMode = uiPuIdx*3 + ( i >= 2? 2 : i );
+    m_pcBinIf->encodeBin( uiBit!=0 , m_cDepthModeModel.get(0, 0, uiCtxDepthMode) );
+  }
+}
+Void TEncSbac::codeDepthModelingTable( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bSdcRD)
+{
+  UInt uiDir = pcCU->getLumaIntraDir( uiAbsPartIdx );
+  Bool bSdcFlag =  pcCU->getSDCFlag(uiAbsPartIdx);
+  Bool bDmmFlag = (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX &&(!bSdcFlag))? 1:0;
+
+  codeDepthIntraMode(pcCU,uiAbsPartIdx);
+  
+  if (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX )//DMM modes or SDC DMM1
+  {
+    assert(pcCU->getWidth(uiAbsPartIdx)<64);
+    assert(pcCU->getWidth(uiAbsPartIdx)<64);
+    if( uiDir == DMM_WEDGE_FULL_IDX || uiDir == DMM_WEDGE_FULL_D_IDX)             { xCodeWedgeFullInfo     ( pcCU, uiAbsPartIdx ); }
+    else if( uiDir == DMM_WEDGE_PREDTEX_IDX || uiDir == DMM_WEDGE_PREDTEX_D_IDX ) { xCodeWedgePredTexInfo  ( pcCU, uiAbsPartIdx ); }
+    else if( uiDir == DMM_WEDGE_PREDDIR_IDX || uiDir == DMM_WEDGE_PREDDIR_D_IDX)  { xCodeWedgePredDirInfo  ( pcCU, uiAbsPartIdx ); }
+  } 
+  else if(uiDir >= EDGE_INTRA_IDX)//CCM mode
+  {
+    assert(pcCU->getWidth(uiAbsPartIdx)<64);
+    xCodeEdgeIntraInfo( pcCU, uiAbsPartIdx );
+  }
+
+  if (bDmmFlag)
+  {
+    m_pcBinIf->encodeBin( (uiDir&1) , m_cDmmDeltaFlagModel.get(0, 0, 0) );
+    if (uiDir&1)
+    {
+      Int iDeltaDC1 = 0,iDeltaDC2 = 0;
+      if ( uiDir == DMM_WEDGE_FULL_D_IDX )
+      {
+        iDeltaDC1 = pcCU->getWedgeFullDeltaDC1( uiAbsPartIdx );
+        iDeltaDC2 = pcCU->getWedgeFullDeltaDC2( uiAbsPartIdx );
+      }
+      else if ( uiDir == DMM_WEDGE_PREDTEX_D_IDX )
+      {
+        iDeltaDC1 = pcCU->getWedgePredTexDeltaDC1( uiAbsPartIdx );
+        iDeltaDC2 = pcCU->getWedgePredTexDeltaDC2( uiAbsPartIdx );
+      }
+      else if ( uiDir == DMM_WEDGE_PREDDIR_D_IDX )
+      {
+        iDeltaDC1 = pcCU->getWedgePredDirDeltaDC1( uiAbsPartIdx );
+        iDeltaDC2 = pcCU->getWedgePredDirDeltaDC2( uiAbsPartIdx );
+      }
+      else if ( uiDir == DMM_CONTOUR_PREDTEX_D_IDX )
+      {
+        iDeltaDC1 = pcCU->getContourPredTexDeltaDC1( uiAbsPartIdx );
+        iDeltaDC2 = pcCU->getContourPredTexDeltaDC2( uiAbsPartIdx );
+
+      }
+
+      for ( Int i = 0; i < 2; i++ )
+      {
+        Int iDeltaDC = (i==0)? iDeltaDC1 : iDeltaDC2;
+        xWriteExGolombLevel( UInt( abs( iDeltaDC ) ), m_cDmmDataSCModel.get(0, 0, 1) );
+        if ( iDeltaDC != 0 )
+        {
+          UInt uiSign = iDeltaDC > 0 ? 0 : 1;
+          m_pcBinIf->encodeBinEP( uiSign );
+        }
+      }
+    }
+  }
+  else if (uiDir>=EDGE_INTRA_IDX)
+  {
+    m_pcBinIf->encodeBin( (uiDir == EDGE_INTRA_DELTA_IDX), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) );
+    if( uiDir == EDGE_INTRA_DELTA_IDX )
+    {
+      Int iDeltaDC0 = pcCU->getEdgeDeltaDC0( uiAbsPartIdx );
+      Int iDeltaDC1 = pcCU->getEdgeDeltaDC1( uiAbsPartIdx );
+
+      for ( Int i = 0; i < 2; i++ )
+      {
+        Int iDeltaDC = (i==0)? iDeltaDC0 : iDeltaDC1;
+        xWriteExGolombLevel( UInt( abs( iDeltaDC ) ), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) );
+        if ( iDeltaDC != 0 )
+        {
+          UInt uiSign = iDeltaDC > 0 ? 0 : 1;
+          m_pcBinIf->encodeBinEP( uiSign );
+        }
+      }
+    }
+  }
+  if (pcCU->getSDCFlag(uiAbsPartIdx))//SDC mode
+  {
+    assert(pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N);
+    UInt uiNumSegments = ( uiDir == DC_IDX || uiDir == PLANAR_IDX )? 1 : 2;
+    if(!bSdcRD)
+    {
+      for (int uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
+      {
+        codeSDCResidualData(pcCU, uiAbsPartIdx, uiSeg);
+      }
+    }
+  }
+}
+#endif
+Void TEncSbac::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+                                   , Bool bSdcRD
+#endif
+                                   )
 {
   UInt uiDir         = pcCU->getLumaIntraDir( uiAbsPartIdx );
 
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
   if( pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) <= DMM_WEDGEMODEL_MAX_SIZE )
@@ -1070,5 +1240,12 @@
   }
 #endif
-  
+#else
+  if (pcCU->getSlice()->getSPS()->isDepth())
+  {
+    codeDepthModelingTable(pcCU, uiAbsPartIdx, bSdcRD);
+  }
+  if (pcCU->getLumaIntraDir(uiAbsPartIdx)<NUM_INTRA_MODE && !pcCU->getSDCFlag(uiAbsPartIdx))
+  {
+#endif
   Int uiPreds[3] = {-1, -1, -1};
   Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds);  
@@ -1116,12 +1293,19 @@
 
     m_pcBinIf->encodeBinsEP( uiDir, 5 );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 #if LGE_EDGE_INTRA_A0070
   if (bCodeEdgeIntra)
     if (uiDir == 31) m_pcBinIf->encodeBinsEP(0,1);
 #endif
+#endif
    }
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+  }
+#else
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
   }
 #endif
+#endif
+
   return;
 }
@@ -2397,4 +2581,5 @@
 
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
 Void TEncSbac::codeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
@@ -2440,4 +2625,5 @@
   
 }
+#endif
 
 Void TEncSbac::codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h	(revision 382)
@@ -92,4 +92,7 @@
   Void  load                   ( TEncSbac* pScr  );
   Void  loadIntraDirModeLuma   ( TEncSbac* pScr  );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+  Void  loadDepthMode          ( TEncSbac* pSrc  );
+#endif
   Void  store                  ( TEncSbac* pDest );
   Void  loadContexts           ( TEncSbac* pScr  );
@@ -137,7 +140,11 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#endif
   Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   Void codeSDCPredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#endif
 #endif
 
@@ -222,6 +229,13 @@
   Void codeQtCbf               ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth );
   Void codeQtRootCbf           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-  
-  Void codeIntraDirLumaAng     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+  Void codeDepthIntraMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
+  Void codeDepthModelingTable  ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bSdcRD = false );
+#endif
+  Void codeIntraDirLumaAng     ( TComDataCU* pcCU, UInt uiAbsPartIdx 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    , Bool bSdcRD = false
+#endif
+    );
   
   Void codeIntraDirChroma      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
@@ -300,6 +314,8 @@
 
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   ContextModel3DBuffer m_cDmmFlagSCModel;
   ContextModel3DBuffer m_cDmmModeSCModel;
+#endif
   ContextModel3DBuffer m_cDmmDataSCModel;
 #endif
@@ -312,5 +328,10 @@
   
 #if RWTH_SDC_DLT_B0036
+#if !PKU_QC_DEPTH_INTRA_UNI_D0195
   ContextModel3DBuffer m_cSDCFlagSCModel;
+#else
+  ContextModel3DBuffer m_cDepthModeModel;
+  ContextModel3DBuffer m_cDmmDeltaFlagModel;
+#endif
   
   ContextModel3DBuffer m_cSDCResidualFlagSCModel;
Index: branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 381)
+++ branches/HTM-6.2-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 382)
@@ -908,5 +908,9 @@
       if( uiAbsPartIdx == 0 )
       {
-        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
+        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+         ,true
+#endif
+          );
       }
     }
@@ -1762,6 +1766,9 @@
   
   // encode pred direction + residual data
-  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
-  
+  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true 
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    ,true
+#endif
+    );
   UInt   uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
   
@@ -5903,4 +5910,7 @@
     // Reload only contexts required for coding intra mode information
     m_pcRDGoOnSbacCoder->loadIntraDirModeLuma( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    m_pcRDGoOnSbacCoder->loadDepthMode( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
+#endif
   }
   
@@ -5908,5 +5918,9 @@
   
   m_pcEntropyCoder->resetBits();
-  m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset);
+  m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset
+#if PKU_QC_DEPTH_INTRA_UNI_D0195
+    ,true
+#endif
+    );
   
   return m_pcEntropyCoder->getNumberOfWrittenBits();
