Index: branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComDataCU.cpp	(revision 418)
+++ branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComDataCU.cpp	(revision 419)
@@ -5873,6 +5873,8 @@
 #endif
 
-#if QC_CU_NBDV_D0181 && MERL_VSP_C0152 // TODO: CHECK if the macro is right
+#if MERL_General_Fix
+#if QC_CU_NBDV_D0181 && MERL_VSP_C0152
     pDInfo->m_acMvCandNoRef[pDInfo->iN] = defaultDV;
+#endif
 #endif
 
Index: branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.cpp	(revision 418)
+++ branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.cpp	(revision 419)
@@ -788,4 +788,5 @@
 #endif
 
+#if MERL_General_Fix
 #if MERL_VSP_C0152
 // Function to perform VSP block compensation 
@@ -860,5 +861,5 @@
 }
 
-
+#endif
 
 #if MERL_Bi_VSP_D0166
@@ -950,6 +951,8 @@
 #if QC_ARP_D0177
   if(
-#if MERL_VSP_C0152       
-       vspIdx == 0 &&   // TODO: Maybe logically redundant, but easier to read. Need verification before being removed
+#if MERL_General_Fix // TODO: Maybe logically redundant, but easier to read. Need verification before being removed
+#if MERL_VSP_C0152
+       vspIdx == 0 &&
+#endif
 #endif
        pcCU->getSlice()->getSPS()->isDepth() == false
@@ -972,5 +975,24 @@
     if (vspIdx != 0)
     { // depth, vsp compensation 
+#if !MERL_General_Fix
+      // get depth estimator here
+      TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth();
+      TComPicYuv* pcBaseViewDepthPicYuv = NULL;
+      if (vspIdx < 4) // spatial
+      {
+        pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
+      }
+      Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
+      Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
+      Int* pShiftLUT;
+      Int iShiftPrec;
+      pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec);
+      //using disparity to find the depth block of the base view as the depth block estimator of the current block
+      //using depth block estimator and base view texture to get Backward warping
+      xPredInterLumaBlkFromDM  ( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX,    iBlkY,    iWidth,    iHeight,     pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred );
+      xPredInterChromaBlkFromDM( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1,  pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred );
+#else
       xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi );
+#endif
     }
     else
@@ -1001,5 +1023,26 @@
     if ( vspIdx != 0 )
     { // texture, vsp compensation
+#if !MERL_General_Fix
+      TComPic*    pRefPicBaseTxt        = pcCU->getSlice()->getRefPicBaseTxt();
+      TComPicYuv* pcBaseViewTxtPicYuv   = pRefPicBaseTxt->getPicYuvRec();
+      TComPicYuv* pcBaseViewDepthPicYuv = NULL;
+      if (vspIdx < 4) // spatial
+      {
+        TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth();
+        pcBaseViewDepthPicYuv     = pRefPicBaseDepth->getPicYuvRec();
+      }
+      Int iBlkX = ( pcCU->getAddr() % pRefPicBaseTxt->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
+      Int iBlkY = ( pcCU->getAddr() / pRefPicBaseTxt->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
+      Int* pShiftLUT;
+      Int iShiftPrec;
+      pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec);
+
+      //using disparity to find the depth block of the base view as the depth block estimator of the current block
+      //using depth block estimator and base view texture to get Backward warping
+      xPredInterLumaBlkFromDM  ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX,    iBlkY,    iWidth,    iHeight,    pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred );
+      xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred );
+#else
       xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi );
+#endif
     }
     else//texture not VSP
@@ -1686,5 +1729,9 @@
 //
 // Output: dstPic, PU predictor 64x64
-Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic
+Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth
+#if !MERL_Bi_VSP_D0166
+                                            , Int vspIdx
+#endif
+                                            , TComYuv *&dstPic
 #if MERL_Bi_VSP_D0166
                                             , Bool bi
@@ -1929,5 +1976,9 @@
 }
 
-Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic
+Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth
+#if !MERL_Bi_VSP_D0166
+                                               , Int vspIdx
+#endif
+                                               , TComYuv *&dstPic
 #if MERL_Bi_VSP_D0166
                                                , Bool bi
Index: branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.h	(revision 418)
+++ branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.h	(revision 419)
@@ -161,7 +161,7 @@
     TComYuv *&dstPic, Bool bi);
 #else
-  Void xPredInterLumaBlkFromDM    ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, 
+  Void xPredInterLumaBlkFromDM    ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, Int vspIdx,
                                   TComYuv *&dstPic );
-  Void xPredInterChromaBlkFromDM  ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, 
+  Void xPredInterChromaBlkFromDM  ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, Int vspIdx,
                                   TComYuv *&dstPic );
 #endif
Index: branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TypeDef.h	(revision 418)
+++ branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TypeDef.h	(revision 419)
@@ -187,4 +187,6 @@
 #if MERL_VSP_C0152
 
+#define MERL_General_Fix                     1 // General fix by MERL
+
 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 1 // MERL bugfix for test condition of no depth
 #define MERL_VSP_COMPENSATION_C0152          1 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add (nocand).
@@ -201,10 +203,19 @@
 #define MTK_DEPTH_TO_DISP_D0138              1 // JCT3V-D0138: Use max among four corners for DoNBDV and BVSP
 
+#if MERL_General_Fix
 #define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139    1 // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map
 #define MTK_VSP_USING_NBDV_D0105             1 // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP
-
+#endif
+
+#if MERL_General_Fix
 #define MERL_VSP_NBDV_RefVId_Fix_D0166       1 // JCT3V-D0166: 1: fix the NBDV with ref view selectioin; 0: always use base view with refViewIdx=0
+#else
+#define MERL_VSP_NBDV_RefVId_Fix_D0166       0
+#endif
+
 #if MERL_VSP_NBDV_RefVId_Fix_D0166
 #define MERL_Bi_VSP_D0166                    1 // JCT3V-D0166: 1: add supporting for Bi-VSP, the code under the macro can also handle uni-direction VSP
+#else
+#define MERL_Bi_VSP_D0166                    0 
 #endif
 
@@ -217,4 +228,10 @@
 #define MERL_Bi_VSP_D0166                    0 // JCT3V-D0166: 1: add supporting for Bi-VSP, the code under the macro can also handle uni-direction VSP
 #define MTK_VSP_USING_NBDV_D0105             0
+#define MERL_General_Fix                     0
+#endif
+
+#if !MERL_General_Fix
+#define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139    1 // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map
+#define MTK_VSP_USING_NBDV_D0105             1 // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP
 #endif
 
Index: branches/HTM-6.2-dev2-MERL/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-6.2-dev2-MERL/source/Lib/TLibDecoder/TDecCu.cpp	(revision 418)
+++ branches/HTM-6.2-dev2-MERL/source/Lib/TLibDecoder/TDecCu.cpp	(revision 419)
@@ -1107,5 +1107,7 @@
   // reconstruct residual based on mask + DC residuals
   Pel apDCResiValues[2];
-  //Pel apDCRecoValues[2];
+#if !MERL_General_Fix
+  Pel apDCRecoValues[2];
+#endif
   for( UInt ui = 0; ui < uiNumSegments; ui++ )
   {
@@ -1114,5 +1116,7 @@
     Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
     
-    //apDCRecoValues[ui]  = pRecoValue;
+#if !MERL_General_Fix
+    apDCRecoValues[ui]  = pRecoValue;
+#endif
     apDCResiValues[ui]  = pRecoValue - apDCPredValues[ui];
   }
