Index: branches/HTM-6.2-dev2-Mediatek/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-6.2-dev2-Mediatek/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 389)
+++ branches/HTM-6.2-dev2-Mediatek/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 390)
@@ -922,5 +922,9 @@
 #if H3D_IVRP
 #if QC_ARP_D0177
-  xConfirmPara     ( m_nUseAdvResPred < 0 || m_nUseAdvResPred > 1 , "0<=ARP<=1" );
+#if QC_ARP_WARNING_FIX
+  xConfirmPara    ( m_nUseAdvResPred > 1 , "0<=ARP<=1" );
+#else
+  xConfirmPara    ( m_nUseAdvResPred < 0 || m_nUseAdvResPred > 1 , "0<=ARP<=1" );
+#endif
 #else
   xConfirmPara    ( m_uiMultiviewResPredMode > 1,                                     "MultiviewResPred must be less than or equal to 1" );
Index: branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 389)
+++ branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp	(revision 390)
@@ -69,8 +69,16 @@
     if (vspIdx < 4)
     {
+#if MTK_VSP_USING_NBDV_D0105
+      pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCandNoRef[0],  NOT_VALID );
+#else
       pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCand[0],  NOT_VALID );
+#endif
       if ( pcCURef->getSlice()->isInterB() )
       {
+#if MTK_VSP_USING_NBDV_D0105
+        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCandNoRef[0],  NOT_VALID );
+#else
          pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCand[0],  NOT_VALID );
+#endif
       }
     }
@@ -81,4 +89,11 @@
                                           UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo )
 {
+#if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139
+  if (getSlice()->getSPS()->isDepth())
+  {
+    return true;
+  }
+#endif
+
 #if MERL_VSP_C0152_BugFix_ForNoDepthCase
   TComPic* pRefPicBaseDepth = NULL;
@@ -105,8 +120,16 @@
           if (vspIdx < 4) // spatial
           {
+#if MTK_VSP_USING_NBDV_D0105
+            pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], NOT_VALID );
+#else
             pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID );
+#endif
             if ( getSlice()->isInterB() )
             {
+#if MTK_VSP_USING_NBDV_D0105
+              pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], NOT_VALID );
+#else
               pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], NOT_VALID );
+#endif
             }
           }
@@ -3715,4 +3738,7 @@
       cDisInfo.m_acMvCand[0] = getDvInfo(uiAbsPartIdx).m_acMvCand[0];
       cDisInfo.m_aVIdxCan[0] = getDvInfo(uiAbsPartIdx).m_aVIdxCan[0];
+#if MTK_VSP_USING_NBDV_D0105
+      cDisInfo.m_acMvCandNoRef[0] = getDvInfo(uiAbsPartIdx).m_acMvCandNoRef[0];
+#endif
     }
 #else
@@ -3780,4 +3806,18 @@
         clipMv(cMvPred);
         pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx());
+#if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139
+        if (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0)
+        {
+          assert(pcTextureCU->getVSPIndex(uiPartIdxCenter)!=0);  
+          for (Int i=0; i<getSlice()->getNumRefIdx(REF_PIC_LIST_0); i++)
+          {
+            if (getSlice()->getRefPOC(REF_PIC_LIST_0, i) == getSlice()->getPOC())
+            {
+              pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,i);
+              break;
+            }
+          }
+        }
+#endif
       }
       if ( getSlice()->isInterB() )
@@ -3792,14 +3832,42 @@
           clipMv(cMvPred);
           pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx());
+#if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139
+          if (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0)
+          {
+            assert(pcTextureCU->getVSPIndex(uiPartIdxCenter)!=0);  
+            for (Int i=0; i<getSlice()->getNumRefIdx(REF_PIC_LIST_1); i++)
+            {
+              if (getSlice()->getRefPOC(REF_PIC_LIST_1, i) == getSlice()->getPOC())
+              {
+                pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,i);
+                break;
+              }
+            }
+          }
+#endif
         }
       }
 #if MERL_VSP_C0152
+#if !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139
       xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
 #endif
-      if ( mrgCandIdx == iCount )
-      {
-        return;
-      }
-      iCount ++;
+#endif
+#if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139
+      if (!((pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && !getSlice()->isInterB())
+        || (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0 && getSlice()->isInterB())))
+      {
+#endif
+        if ( mrgCandIdx == iCount )
+        {
+          return;
+        }
+        iCount ++;
+#if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139
+      }
+      else
+      {
+        assert(0);
+      }
+#endif
     }
   }
@@ -5043,6 +5111,8 @@
     Int depthEndPosX   = Clip3(0,   iPictureWidth - 1,  iBlkX + iBlkWidth - 1 + (mv->getHor()>>2));
     Int depthEndPosY   = Clip3(0,   iPictureHeight - 1,  iBlkY + iBlkHeight - 1 + (mv->getVer()>>2));
+#if !MTK_DEPTH_TO_DISP_D0138
     Int iCenterX = (depthStartPosX + depthEndPosX) >> 1;
     Int iCenterY = (depthStartPosY + depthEndPosY) >> 1;
+#endif
 
     Pel *depthTL  = pcBaseViewDepthPicYuv->getLumaAddr();
@@ -5052,6 +5122,10 @@
     aiDepth[2] = depthTL[ (depthStartPosY) * depStride + depthEndPosX   ];      // Right Top
     aiDepth[3] = depthTL[ (depthEndPosY)   * depStride + depthEndPosX   ];      // Right Bottom
+#if MTK_DEPTH_TO_DISP_D0138
+    for (Int i = 0; i < 4; i++)
+#else
     aiDepth[4] = depthTL[ (iCenterY)       * depStride + iCenterX       ];      // Center
     for (Int i = 0; i < 5; i++)
+#endif
     {
       if (maxDepthVal < aiDepth[i])
Index: branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp	(revision 389)
+++ branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp	(revision 390)
@@ -1563,8 +1563,16 @@
 #endif
         Int maxV = 0;
+#if MTK_DEPTH_TO_DISP_D0138
+        for (Int blockj = 0; blockj < MERL_VSP_BLOCKSIZE_C0152; blockj+=(MERL_VSP_BLOCKSIZE_C0152-1))
+#else
         for (Int blockj = 0; blockj < MERL_VSP_BLOCKSIZE_C0152; blockj++)
+#endif
         {
           Int iX = 0;
+#if MTK_DEPTH_TO_DISP_D0138
+          for (Int blocki = 0; blocki < MERL_VSP_BLOCKSIZE_C0152; blocki+=(MERL_VSP_BLOCKSIZE_C0152-1))
+#else
           for (Int blocki = 0; blocki < MERL_VSP_BLOCKSIZE_C0152; blocki++)
+#endif
           {
             if (maxV < depthTmp[iX])
Index: branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TypeDef.h	(revision 389)
+++ branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibCommon/TypeDef.h	(revision 390)
@@ -95,7 +95,8 @@
                                               // FIX_LG_RESTRICTEDRESPRED_M24766   1
 
-#define QC_ARP_D0177            1      ////< advanced residual prediction
+#define QC_ARP_D0177            1             ////< advanced residual prediction
 #if QC_ARP_D0177
-#define QC_ARP_WFNR       3
+#define QC_ARP_WFNR                       3 
+#define QC_ARP_WARNING_FIX                1   // Fix warning message for ARP
 #endif
 ///// ***** DISPARITY VECTOR DERIVATION *********
@@ -205,4 +206,5 @@
 #define VSP_MERGE_POS                        5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5.
                                                //MTK_DVPREFINE_BVSP_BUG_FIX               1
+#define MTK_DEPTH_TO_DISP_D0138              0 // JCT3V-D0138: Use max among four corners for DoNBDV and BVSP
 
 #else // !MERL_VSP_C0152
@@ -211,4 +213,6 @@
 #endif
 
+#define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139             0  // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map
+#define MTK_VSP_USING_NBDV_D0105                      0  // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP
 
 ///// ***** DERIVED PARAMETERS *********
Index: branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 389)
+++ branches/HTM-6.2-dev2-Mediatek/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 390)
@@ -2248,10 +2248,14 @@
 {
   UInt nMaxW = pcCU->getSlice()->getARPStepNum() - 1;
+#if !QC_ARP_WARNING_FIX
   assert (nMaxW >= 0);
+#endif
   UInt nW = 0;
   if( nMaxW > 0 )
   {
     UInt nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
+#if !QC_ARP_WARNING_FIX
     assert( 0 <= nOffset && nOffset <= 2 );
+#endif
     UInt uiCode = 0;
     m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 0 + nOffset ) );
