Index: /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 384)
@@ -384,4 +384,9 @@
 #if H3D_IVRP
   ("MultiviewResPred", m_uiMultiviewResPredMode,   (UInt)0, "usage of inter-view residual prediction" )
+#endif
+
+#if MTK_D0156
+  ("UseVSPCompensation", m_bUseVSPCompensation,   true, "Depth dependent tools: BVSP" )
+  ("UseDVPRefine", m_bUseDVPRefine,   true, "Depth dependent tools: DoNBDV" )
 #endif
 
@@ -1708,8 +1713,15 @@
   printf("DLT:%d ", m_bUseDLT ? 1 : 0 );
 #endif
+
+#if MTK_D0156
+  printf("BVSP:%d ", m_bUseVSPCompensation ? 1 : 0 );
+  printf("DoNBDV:%d ",  m_bUseDVPRefine ? 1 : 0 );
+#endif
+
 #if LGE_WVSO_A0119
   if ( m_bUseWVSO )
     printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight );
 #endif
+
   printf("\n\n");
   
Index: /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncCfg.h	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncCfg.h	(revision 384)
@@ -317,4 +317,13 @@
 #endif
 
+#if MTK_D0156
+
+#if MERL_VSP_COMPENSATION_C0152
+  Bool      m_bUseVSPCompensation;
+#endif
+
+  Bool      m_bUseDVPRefine;
+#endif
+
   // internal member functions
   Void  xSetGlobal      ();                                   ///< set global variables
Index: /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp	(revision 384)
@@ -226,4 +226,12 @@
 #endif
 
+#if MTK_D0156
+
+#if MERL_VSP_COMPENSATION_C0152
+    m_acTEncTopList[iViewIdx]->setUseVSPCompensation           ( iViewIdx ? m_bUseVSPCompensation : 0 );
+#endif
+    m_acTEncTopList[iViewIdx]->setUseDVPRefine                  ( iViewIdx ? m_bUseDVPRefine : 0 );
+#endif
+
   //====== Tool list ========
     m_acTEncTopList[iViewIdx]->setUseSBACRD                    ( m_bUseSBACRD   );
@@ -564,4 +572,13 @@
 #endif
 
+#if MTK_D0156
+
+#if MERL_VSP_COMPENSATION_C0152
+      m_acTEncDepthTopList[iViewIdx]->setUseVSPCompensation           ( iViewIdx ? true : false );
+#endif
+
+      m_acTEncDepthTopList[iViewIdx]->setUseDVPRefine                 ( iViewIdx ? true : false );
+#endif
+
       //====== Weighted Prediction ========
       m_acTEncDepthTopList[iViewIdx]->setUseWP                        ( m_bUseWeightPred      );
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 384)
@@ -53,5 +53,9 @@
 #if MERL_VSP_C0152
 
+#if MTK_D0156
+#define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && ( (!m_pcSlice->getSPS()->getUseVSPCompensation()) || (!( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] )))
+#else
 #define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && !( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] )
+#endif
 
 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo
@@ -61,4 +65,11 @@
 )
 {
+#if MTK_D0156
+    if( !m_pcSlice->getSPS()->getUseVSPCompensation() )
+    {
+        return;
+    }
+#endif
+
   Int vspIdx = (Int) pcCURef->getVSPIndex(uiIdx);
   if( vspIdx != 0 )
@@ -88,4 +99,11 @@
                                           UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo )
 {
+#if MTK_D0156
+    if( !m_pcSlice->getSPS()->getUseVSPCompensation() )
+    {
+        return true;
+    }
+#endif
+
 #if MERL_VSP_C0152_BugFix_ForNoDepthCase
   TComPic* pRefPicBaseDepth = NULL;
@@ -4347,4 +4365,12 @@
         bValid = false;
 #endif
+
+#if MTK_D0156
+      if( !m_pcSlice->getSPS()->getUseVSPCompensation())
+      {
+          bValid = true;
+      }
+#endif
+
       if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)
 #if MERL_VSP_C0152
@@ -5170,4 +5196,11 @@
   }
 
+#if MTK_D0156
+  if( !m_pcSlice->getSPS()->getUseDVPRefine() )
+  {
+      bDepthRefine = false;
+  }
+#endif
+
   // Get Positions  
   PartSize eCUMode    = getPartitionSize( uiPartAddr );    
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TComSlice.h	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TComSlice.h	(revision 384)
@@ -180,4 +180,12 @@
   Bool          m_bIVScalingFlag;
 #endif
+
+#if MTK_D0156
+#if MERL_VSP_COMPENSATION_C0152
+  Bool      m_abUseVSPCompensation[ MAX_TLAYER ];
+#endif
+  Bool      m_abUseDVPRefine[ MAX_TLAYER ];
+#endif
+
 public:
   TComVPS();
@@ -245,4 +253,13 @@
   
 #endif 
+
+#if MTK_D0156
+#if MERL_VSP_COMPENSATION_C0152
+  Bool    getUseVSPCompensation( UInt tLayer ){  return m_abUseVSPCompensation[ tLayer ];}
+  Void    setUseVSPCompensation( Bool bValue, UInt tLayer ){ m_abUseVSPCompensation[ tLayer ] = bValue;}
+#endif
+  Bool    getUseDVPRefine( UInt tLayer ){  return m_abUseDVPRefine[ tLayer ];}
+  Void    setUseDVPRefine( Bool bValue, UInt tLayer ){ m_abUseDVPRefine[ tLayer ] = bValue;}
+#endif
 };
 
@@ -398,4 +415,11 @@
 #if H3D_IVRP
   TComResidualGenerator* m_pcResidualGenerator;
+#endif
+
+#if MTK_D0156
+#if MERL_VSP_COMPENSATION_C0152
+  Bool      m_bUseVSPCompensation;
+#endif
+  Bool      m_bUseDVPRefine;
 #endif
 
@@ -669,4 +693,16 @@
   TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
 #endif
+
+#if MTK_D0156
+
+#if MERL_VSP_COMPENSATION_C0152
+  Bool    getUseVSPCompensation( ){  return m_bUseVSPCompensation;}
+  Void    setUseVSPCompensation( Bool bValue ){ m_bUseVSPCompensation = bValue;}
+#endif
+
+  Bool    getUseDVPRefine( ){  return m_bUseDVPRefine;}
+  Void    setUseDVPRefine( Bool bValue ){ m_bUseDVPRefine = bValue;}
+
+#endif
 };
 
@@ -1121,4 +1157,5 @@
   Int          m_iShiftPrec;
 #endif
+
 
 public:
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibCommon/TypeDef.h	(revision 384)
@@ -176,4 +176,5 @@
 #endif
 
+
 ///// ***** VSP *********
 #define MERL_VSP_C0152                    1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools
@@ -183,4 +184,6 @@
 #define MERL_VSP_C0152_BugFix_ForNoDepthCase     1// MERL bugfix for test condition of no depth
 #define QC_BVSP_CleanUP_D0191                    1
+
+#define MTK_D0156                 1
 /*
  * Two macros are used to configure combinations of JCT3V-C0152 and JCT3V-C0131
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 384)
@@ -1602,4 +1602,16 @@
 #endif
       }
+
+#if MTK_D0156
+
+      pcSPS->setUseVSPCompensation( false );
+      pcSPS->setUseDVPRefine( false );
+
+      //Comments: Currently, BVSP and DoNBDV are not used for depth coding
+#if MERL_VSP_COMPENSATION_C0152
+      READ_FLAG( uiCode, "view_synthesis_pred_flag" );pcSPS->setUseVSPCompensation( uiCode ? true : false );
+#endif
+      READ_FLAG( uiCode, "dv_refine_flag" );          pcSPS->setUseDVPRefine( uiCode ? true : false );
+#endif
     }
     READ_FLAG( uiCode, "sps_extension2_flag");
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp	(revision 384)
@@ -373,4 +373,12 @@
     Int iVSPIndexTrue[3] = {-1, -1, -1};
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
+    
+#if MTK_D0156
+    if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
+    {
+        pcCU->setVSPIndexSubParts( 0, uiAbsPartIdx, 0, uiDepth ); 
+    }
+    else
+#endif
     {
       Int iVSPIdx = 0;
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 384)
@@ -317,4 +317,11 @@
       else // MPI not used
 #endif
+#if MTK_D0156
+          if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
+          {
+              pcCU->setVSPIndexSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth ); 
+          }
+          else
+#endif
       {
         Int iVSPIdx = 0;
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 384)
@@ -716,5 +716,14 @@
       }
 #endif
-    }
+
+    }
+
+#if MTK_D0156
+#if MERL_VSP_COMPENSATION_C0152
+    WRITE_FLAG( pcSPS->getUseVSPCompensation() ? 1 : 0,              "view_synthesis_pred_flag" );
+#endif
+
+    WRITE_FLAG( pcSPS->getUseDVPRefine() ? 1 : 0,                    "dv_refine_flag" );
+#endif
   }
   else
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCfg.h	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCfg.h	(revision 384)
@@ -336,4 +336,12 @@
 #endif
 
+#if MTK_D0156
+
+#if MERL_VSP_COMPENSATION_C0152
+  Bool      m_bUseVSPCompensation;
+#endif
+  Bool      m_bUseDVPRefine;
+#endif
+
 public:
   TEncCfg()          {}
@@ -809,4 +817,17 @@
   Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }    // will be changed to view_id
 #endif
+
+#if MTK_D0156
+
+#if MERL_VSP_COMPENSATION_C0152
+  Bool    getUseVSPCompensation( ){  return m_bUseVSPCompensation;}
+  Void    setUseVSPCompensation( Bool bValue ){ m_bUseVSPCompensation = bValue;}
+#endif
+
+
+  Bool    getUseDVPRefine( ){  return m_bUseDVPRefine;}
+  Void    setUseDVPRefine( Bool bValue ){ m_bUseDVPRefine = bValue;}
+#endif
+
 };
 
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 384)
@@ -1926,4 +1926,12 @@
           rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level
 #if MERL_VSP_C0152
+
+#if MTK_D0156
+          if( !rpcTempCU->getSlice()->getSPS()->getUseVSPCompensation() )
+          {
+              rpcTempCU->setVSPIndexSubParts( 0, 0, 0, uhDepth );
+          }
+          else
+#endif
           {
             Int iVSPIdx = 0;
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 384)
@@ -2989,4 +2989,11 @@
       pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
 #if MERL_VSP_C0152
+#if MTK_D0156
+      if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
+      {
+          pcCU->setVSPIndexSubParts( 0, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+      }
+      else
+#endif
       {
         Int iVSPIdx = 0;
@@ -3718,4 +3725,12 @@
         pcCU->setMergeIndexSubParts( uiMRGIndex,    uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
 #if MERL_VSP_C0152
+
+#if MTK_D0156
+        if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
+        {
+            pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+        }
+        else
+#endif
         {
           Int iVSPIdx = 0;
Index: /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncTop.cpp	(revision 383)
+++ /branches/HTM-6.2-dev1-MediaTek/source/Lib/TLibEncoder/TEncTop.cpp	(revision 384)
@@ -710,4 +710,12 @@
 #endif
 
+
+#if MTK_D0156
+#if MERL_VSP_COMPENSATION_C0152
+  m_cSPS.setUseVSPCompensation           ( m_bUseVSPCompensation );
+#endif
+  m_cSPS.setUseDVPRefine                 ( m_bUseDVPRefine       );
+#endif
+
   if( m_isDepth )
   {
@@ -744,4 +752,5 @@
       m_cSPS.setMultiviewResPredMode  ( m_uiMultiviewResPredMode );
 #endif
+
     }
     else
