Index: branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/ContextTables.h	(revision 980)
+++ branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/ContextTables.h	(revision 983)
@@ -51,5 +51,8 @@
 #define NUM_SPLIT_FLAG_CTX            3       ///< number of context models for split flag
 #define NUM_SKIP_FLAG_CTX             3       ///< number of context models for skip flag
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+#define NUM_SINGLEDEPTH_FLAG_CTX                     1
+#define NUM_SINGLE_DEPTH_VALUE_DATA_CTX              1       
+#endif
 #define NUM_MERGE_FLAG_EXT_CTX        1       ///< number of context models for merge flag of merge extended
 #define NUM_MERGE_IDX_EXT_CTX         1       ///< number of context models for merge index of merge extended
@@ -150,5 +153,20 @@
   { CNU,  CNU,  CNU, }, 
 };
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+static const UChar 
+INIT_SINGLEDEPTH_FLAG[3][NUM_SINGLEDEPTH_FLAG_CTX] =  
+{
+  { 185 }, 
+  { 185 }, 
+  { 185 }, 
+};
+static const UChar
+INIT_SINGLE_DEPTH_VALUE_DATA[3][NUM_SINGLE_DEPTH_VALUE_DATA_CTX] = 
+{
+  { 137 }, 
+  { 137 }, 
+  { 137 }, 
+};
+#endif
 static const UChar
 INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = 
Index: branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 980)
+++ branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 983)
@@ -60,5 +60,8 @@
   
   m_skipFlag           = NULL;
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  m_singleDepthFlag     = NULL;
+  m_apSingleDepthValue  = NULL;
+#endif  
   m_pePartSize         = NULL;
   m_pePredMode         = NULL;
@@ -182,5 +185,8 @@
 
     m_skipFlag           = new Bool[ uiNumPartition ];
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+    m_singleDepthFlag     = new Bool[ uiNumPartition ];
+    m_apSingleDepthValue  = (Pel*)xMalloc(Pel, uiNumPartition);
+#endif
     m_pePartSize         = new Char[ uiNumPartition ];
     memset( m_pePartSize, SIZE_NONE,uiNumPartition * sizeof( *m_pePartSize ) );
@@ -329,5 +335,8 @@
 
     if ( m_skipFlag           ) { delete[] m_skipFlag;          m_skipFlag          = NULL; }
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+    if ( m_singleDepthFlag    ) { delete[] m_singleDepthFlag;   m_singleDepthFlag     = NULL; }
+    if ( m_apSingleDepthValue ) { xFree(m_apSingleDepthValue);  m_apSingleDepthValue  = NULL; }
+#endif
     if ( m_pePartSize         ) { delete[] m_pePartSize;        m_pePartSize        = NULL; }
     if ( m_pePredMode         ) { delete[] m_pePredMode;        m_pePredMode        = NULL; }
@@ -494,4 +503,8 @@
     TComDataCU * pcFrom = pcPic->getCU(getAddr());
     m_skipFlag[ui]   = pcFrom->getSkipFlag(ui);
+#if MTK_SINGLE_DEPTH_MODE_I0095
+    m_singleDepthFlag[ui]    = pcFrom->getSingleDepthFlag(ui);
+    m_apSingleDepthValue[ui] = pcFrom->getSingleDepthValue(ui);
+#endif
     m_pePartSize[ui] = pcFrom->getPartitionSize(ui);
     m_pePredMode[ui] = pcFrom->getPredictionMode(ui);
@@ -550,5 +563,8 @@
   {
     memset( m_skipFlag          + firstElement, false,                    numElements * sizeof( *m_skipFlag ) );
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+    memset( m_singleDepthFlag     + firstElement, false,                  numElements * sizeof( *m_singleDepthFlag ) );
+    memset( m_apSingleDepthValue  + firstElement,     0,                  numElements * sizeof( *m_apSingleDepthValue ) );
+#endif
     memset( m_pePartSize        + firstElement, SIZE_NONE,                numElements * sizeof( *m_pePartSize ) );
     memset( m_pePredMode        + firstElement, MODE_NONE,                numElements * sizeof( *m_pePredMode ) );
@@ -738,4 +754,8 @@
       m_puhTransformSkip[2][ui] = 0;
       m_skipFlag[ui]   = false;
+#if MTK_SINGLE_DEPTH_MODE_I0095
+      m_singleDepthFlag[ui]     = false;
+      m_apSingleDepthValue[ui]  = 0;
+#endif
       m_pePartSize[ui] = SIZE_NONE;
       m_pePredMode[ui] = MODE_NONE;
@@ -913,4 +933,8 @@
   {
     m_skipFlag[ui]   = false;
+#if MTK_SINGLE_DEPTH_MODE_I0095
+    m_singleDepthFlag[ui]   = false;
+    m_apSingleDepthValue[ui]= 0;
+#endif
     m_pePartSize[ui] = SIZE_NONE;
     m_pePredMode[ui] = MODE_NONE;
@@ -934,4 +958,8 @@
       m_puhTransformSkip[2][ui] = pcCU->getTransformSkip(uiPartOffset+ui,TEXT_CHROMA_V);
       m_skipFlag[ui]   = pcCU->getSkipFlag(uiPartOffset+ui);
+#if MTK_SINGLE_DEPTH_MODE_I0095
+      m_singleDepthFlag[ui]    = pcCU->getSingleDepthFlag(uiPartOffset+ui);
+      m_apSingleDepthValue[ui] = pcCU->getSingleDepthValue(uiPartOffset+ui);
+#endif
       m_pePartSize[ui] = pcCU->getPartitionSize(uiPartOffset+ui);
       m_pePredMode[ui] = pcCU->getPredictionMode(uiPartOffset+ui);
@@ -1083,5 +1111,8 @@
   
   m_skipFlag=pcCU->getSkipFlag()          + uiPart;
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  m_singleDepthFlag     = pcCU->getSingleDepthFlag()   + uiPart;
+  m_apSingleDepthValue  = pcCU->getSingleDepthValue()  + uiPart;
+#endif  
   m_phQP=pcCU->getQP()                    + uiPart;
   m_pePartSize = pcCU->getPartitionSize() + uiPart;
@@ -1221,5 +1252,8 @@
   
   m_skipFlag           = pcCU->getSkipFlag ()             + uiAbsPartIdx;
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  m_singleDepthFlag     = pcCU->getSingleDepthFlag ()             + uiAbsPartIdx;
+  m_apSingleDepthValue  = pcCU->getSingleDepthValue ()            + uiAbsPartIdx;
+#endif  
   m_pePartSize         = pcCU->getPartitionSize ()        + uiAbsPartIdx;
 #if H_3D_NBDV
@@ -1297,4 +1331,8 @@
   Int sizeInChar  = sizeof( Char ) * uiNumPartition;
   memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  memcpy( m_singleDepthFlag     + uiOffset, pcCU->getSingleDepthFlag(),       sizeof( *m_singleDepthFlag )   * uiNumPartition );
+  memcpy( m_apSingleDepthValue  + uiOffset, pcCU->getSingleDepthValue(),      sizeof( *m_apSingleDepthValue ) * uiNumPartition);
+#endif
   memcpy( m_phQP       + uiOffset, pcCU->getQP(),             sizeInChar                        );
   memcpy( m_pePartSize + uiOffset, pcCU->getPartitionSize(),  sizeof( *m_pePartSize ) * uiNumPartition );
@@ -1417,5 +1455,8 @@
 
   memcpy( rpcCU->getSkipFlag() + m_uiAbsIdxInLCU, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  memcpy( rpcCU->getSingleDepthFlag()  + m_uiAbsIdxInLCU, m_singleDepthFlag,    sizeof( *m_singleDepthFlag ) * m_uiNumPartition );
+  memcpy( rpcCU->getSingleDepthValue() + m_uiAbsIdxInLCU, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * m_uiNumPartition);
+#endif
   memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar  );
 #if H_3D_NBDV
@@ -1533,5 +1574,8 @@
   Int sizeInChar  = sizeof( Char ) * uiQNumPart;
   memcpy( rpcCU->getSkipFlag()       + uiPartOffset, m_skipFlag,   sizeof( *m_skipFlag )   * uiQNumPart );
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  memcpy( rpcCU->getSingleDepthFlag()  + uiPartOffset, m_singleDepthFlag,    sizeof( *m_singleDepthFlag )   * uiQNumPart );
+  memcpy( rpcCU->getSingleDepthValue() + uiPartOffset, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * uiQNumPart);
+#endif
   memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar );
   memcpy( rpcCU->getPartitionSize()  + uiPartOffset, m_pePartSize, sizeof( *m_pePartSize ) * uiQNumPart );
@@ -2453,5 +2497,16 @@
   memset( m_skipFlag + absPartIdx, skip, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
 }
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+Void TComDataCU::setSingleDepthFlagSubParts( Bool singleDepth, UInt absPartIdx, UInt depth )
+{
+  assert( sizeof( *m_singleDepthFlag) == 1 );
+  memset( m_singleDepthFlag + absPartIdx, singleDepth, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
+}
+
+Void TComDataCU::setSingleDepthValueSubParts(Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth )
+{
+  setSubPartT<Pel>( singleDepthValue, m_apSingleDepthValue, uiAbsPartIdx, uiDepth, uiPUIdx );
+}
+#endif
 Void TComDataCU::setPredModeSubParts( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -6092,4 +6147,61 @@
 }
 #endif
+
+#if MTK_SINGLE_DEPTH_MODE_I0095
+Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index)
+{
+
+  Bool bDepAvail = false;
+  Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
+  Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
+
+  Int xP, yP, nPSW, nPSH;
+  this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
+  UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight();
+  UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth();
+  switch(index)
+  {
+  case 0: // Mid Left
+    if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) )
+    {
+      *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ];
+      bDepAvail = true;
+    }
+    break;
+  case 1: // Mid Above
+    if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) )
+    {
+      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ];
+      bDepAvail = true;
+    }
+    break;
+  case 2: // Above
+    if(yP != 0)
+    {
+      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP) ];
+      bDepAvail = true;
+    }
+    break;
+  case 3: // Left
+    if(xP != 0)
+    {
+      *pNeighDepth = pDepth[ (yP) * iDepStride + (xP-1) ];
+      bDepAvail = true;
+    }
+    break;
+  case 4: // Above_Left
+    if(xP != 0 && yP != 0)
+    {
+      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP-1) ];
+      bDepAvail = true;
+    }
+    break;
+  default:
+      break;
+  }
+  return bDepAvail;
+}
+
+#endif
 #if H_3D_NBDV 
 //Notes from QC:
Index: branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h	(revision 980)
+++ branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h	(revision 983)
@@ -110,4 +110,8 @@
   // -------------------------------------------------------------------------------------------------------------------
   Bool*         m_skipFlag;           ///< array of skip flags
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  Bool*         m_singleDepthFlag;           ///< array of single depth flags
+  Pel*          m_apSingleDepthValue;
+#endif
   Char*         m_pePartSize;         ///< array of partition sizes
   Char*         m_pePredMode;         ///< array of prediction modes
@@ -347,5 +351,15 @@
   Void         setSkipFlag           ( UInt idx, Bool skip)     { m_skipFlag[idx] = skip;   }
   Void         setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  Bool*        getSingleDepthFlag            ()                        { return m_singleDepthFlag;          }
+  Bool         getSingleDepthFlag            (UInt idx)                { return m_singleDepthFlag[idx];     }
+  Void         setSingleDepthFlag           ( UInt idx, Bool singleDepth)     { m_singleDepthFlag[idx] = singleDepth;   }
+  Void         setSingleDepthFlagSubParts   ( Bool singleDepth, UInt absPartIdx, UInt depth );
+
+  Pel*         getSingleDepthValue( ) { return m_apSingleDepthValue; }
+  Pel          getSingleDepthValue            (UInt idx)                { return m_apSingleDepthValue[idx];     }
+  Void         setSingleDepthValue           ( UInt idx, Pel pDepthValue)     { m_apSingleDepthValue[idx] = pDepthValue;   }
+  Void         setSingleDepthValueSubParts   (Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth );
+#endif  
   Char*         getPredictionMode     ()                        { return m_pePredMode;        }
   PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
@@ -489,5 +503,7 @@
   Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
 #endif
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+   Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
+#endif
 #if H_3D_NBDV_REF
   Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
Index: branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp	(revision 980)
+++ branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp	(revision 983)
@@ -139,4 +139,7 @@
 , m_depthToDisparityF             ( NULL )
 #endif
+#if MTK_SINGLE_DEPTH_MODE_I0095
+, m_bApplySingleDepthMode         (false)
+#endif
 #endif
 {
@@ -1091,4 +1094,7 @@
     m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 
   }
+#endif
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode;
 #endif
 #if H_3D_IC
Index: branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h	(revision 980)
+++ branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h	(revision 983)
@@ -2205,5 +2205,7 @@
   UInt         m_aiDDDShift    [MAX_NUM_LAYERS];
 #endif
-
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  Bool      m_bApplySingleDepthMode;
+#endif
 public:
   TComSlice();
@@ -2275,4 +2277,8 @@
 #if H_3D
   TComPic*  getTexturePic       ()                              { return  m_ivPicsCurrPoc[0][ m_viewIndex ]; }
+#endif
+#if MTK_SINGLE_DEPTH_MODE_I0095
+  Void      setApplySingleDepthMode( Bool b )                                { m_bApplySingleDepthMode = b; }
+  Bool      getApplySingleDepthMode()                                        { return m_bApplySingleDepthMode; }
 #endif
 #if H_3D_IC
Index: branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 980)
+++ branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 983)
@@ -215,4 +215,8 @@
                                               // MTK_DLT_CODING_FIX_H0091 
 
+#define MTK_SINGLE_DEPTH_MODE_I0095       1   // Single depth mode proposed in JCT3V-I0095
+#if MTK_SINGLE_DEPTH_MODE_I0095
+#define MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE            2 // size of the sample candidate list
+#endif
 
 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
@@ -381,6 +385,5 @@
 
 // OTHERS
-//#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows 
-:// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution 
+//#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows ?// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution 
 //#define H_MV_HLS_8_MIS_Q0078_24  0 // #24 (MISC   /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.
 //#define H_MV_HLS_7_HRD_P0138_6   0 //     (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections. 
