Index: /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 880)
@@ -3279,8 +3279,4 @@
   Bool  refViewAvailFlag = false;
   UChar predFlag[2]      = {0, 0};
-#if !MTK_RBIP_VSP_G0069
-  Int   refListIdY       = 0;    
-  Int   viewIdInRefListX = -1;
-#endif
 
   for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
@@ -3294,8 +3290,4 @@
         refViewAvailFlag      = true;
         predFlag[iRefListIdX] = 1;
-#if !MTK_RBIP_VSP_G0069
-        viewIdInRefListX      = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId();
-        refListIdY            = 1 - iRefListIdX;
-#endif
         pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
 #if H_3D_NBDV
@@ -3305,46 +3297,4 @@
     }
   }
-
-#if !MTK_RBIP_VSP_G0069
-  if (m_pcSlice->isInterB() && refViewAvailFlag)
-  {
-    RefPicList eRefPicListY = RefPicList( refListIdY );
-    refViewAvailFlag = false;
-    for ( Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicListY) && !refViewAvailFlag; i++ )
-    {
-      Int viewIdxRefInListY = m_pcSlice->getRefPic(eRefPicListY, i)->getViewIndex();
-      if ( viewIdxRefInListY != refViewIdx && viewIdxRefInListY != m_pcSlice->getViewIndex() )
-      {
-        refViewAvailFlag = true;
-        predFlag[refListIdY] = 1;
-        TComMv  cMv = pDInfo->m_acNBDV;
-
-        Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId();
-        Int currViewId       = m_pcSlice->getViewId();
-
-        //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed): 
-        // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx  ); 
-
-        Int iScale      = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX );
-
-        // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX.
-        if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) 
-        {
-          cMv = cMv.scaleMv( iScale );
-        }
-        else
-        {
-
-          cMv = cMv;
-        }
-        clipMv( cMv );
-        pcMvFieldNeighbours[(iCount<<1)+refListIdY].setMvField( cMv, i );
-#if H_3D_NBDV
-        pcMvFieldNeighbours[(iCount<<1)+refListIdY].getMv().setIDVFlag (false);
-#endif
-      }
-    }
-  }
-#endif
 
   // Set values to be returned
@@ -3465,9 +3415,5 @@
   for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
   {
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
-#else
-    if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )
-#endif
     {
       continue;
@@ -3985,9 +3931,5 @@
     iPosLeftAbove[0] = numA1B1B0;
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
-#else
-    if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4012,9 +3954,5 @@
     iPosLeftAbove[1] = numA1B1B0;
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0) 
-#else
-    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4039,9 +3977,5 @@
   {
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0) 
-#else
-    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4064,9 +3998,5 @@
   {
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
-#else
-    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4091,9 +4021,5 @@
   {
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0) 
-#else
-    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -7247,5 +7173,5 @@
 #endif
 
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
 {
@@ -7381,5 +7307,5 @@
 
 }
-#endif // NTT_STORE_SPDV_VSP_G0148
+#endif
 
 //! \}
Index: /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 880)
@@ -267,5 +267,5 @@
   Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter );
 
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
   Void xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
 #endif
@@ -665,7 +665,5 @@
   Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;      }
   Void          setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
-#if NTT_STORE_SPDV_VSP_G0148
   Void          setMvFieldPUForVSP    ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize );
-#endif
 #endif
   Void          deriveLeftRightTopIdxGeneral  ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
Index: /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h	(revision 880)
@@ -176,5 +176,5 @@
   Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
   Void    setMv         ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; }
   Void    setRefIdx     ( Int iIdx, Int iRefIdx )         { m_piRefIdx[iIdx] = iRefIdx; }
Index: /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 880)
@@ -1169,5 +1169,4 @@
 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
 {
-#if NTT_STORE_SPDV_VSP_G0148
   Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1;
 
@@ -1184,61 +1183,6 @@
   }
   xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU );
-
-#else // NTT_STORE_SPDV_VSP_G0148
-  // Get depth reference
-  Int       depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan;
-#if H_3D_FCO_VSP_DONBDV_E0163
-  TComPic* pRefPicBaseDepth = 0;
-  Bool     bIsCurrDepthCoded = false;
-  pRefPicBaseDepth  = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );
-  if ( pRefPicBaseDepth->getPicYuvRec() != NULL  ) 
-  {
-    bIsCurrDepthCoded = true;
-  }
-  else 
-  {
-    pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
-  }
-#else
-  TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
-#endif
-  assert(pRefPicBaseDepth != NULL);
-  TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
-  assert(pcBaseViewDepthPicYuv != NULL);
-
-  // Get texture reference
-  Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );
-  assert(iRefIdx >= 0);
-  TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx );
-  TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec();
-  assert(pcBaseViewTxtPicYuv != NULL);
-
-  // Initialize LUT according to the reference viewIdx
-  Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex();
-  Int* pShiftLUT    = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx );
-  assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() );
-
-  // Do compensation
-  TComMv cDv  = pcCU->getDvInfo(uiPartAddr).m_acNBDV;
-  pcCU->clipMv(cDv);
-
-#if H_3D_FCO_VSP_DONBDV_E0163
-  if ( bIsCurrDepthCoded )
-  {
-      cDv.setZero();
-  }
-#endif
-  // fetch virtual depth map
-  pcBaseViewDepthPicYuv->extendPicBorder();
-
-  Int vspSize=0;
-  xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize );
-  // sub-PU based compensation
-  xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
-  xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
-#endif // NTT_STORE_SPDV_VSP_G0148
-}
-
-#if NTT_STORE_SPDV_VSP_G0148
+}
+
 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU )
 {
@@ -1265,5 +1209,4 @@
   }
 }
-#endif // NTT_STORE_SPDV_VSP_G0148
 
 #endif
@@ -2120,342 +2063,4 @@
 #endif
 
-#if H_3D_VSP
-#if !(NTT_STORE_SPDV_VSP_G0148)
-// not fully support iRatioTxtPerDepth* != 1
-Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
-{
-  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
-  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
-
-  Int refDepStride = picRefDepth->getStride();
-
-  Int refDepOffset  = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride;
-  Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-
-  if( ratioTxtPerDepthX!=1 || ratioTxtPerDepthY!=1 )
-  {
-    Int posX, posY;
-    refDepth    = picRefDepth->getLumaAddr( );
-    cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
-    posX /= ratioTxtPerDepthX; // texture position -> depth postion
-    posY /= ratioTxtPerDepthY;
-    refDepOffset += posX + posY * refDepStride;
-
-    width  /= ratioTxtPerDepthX; // texture size -> depth size
-    height /= ratioTxtPerDepthY;
-  }
-
-  refDepth += refDepOffset;
-
-  Int depStride = yuvDepth->getStride();
-  Pel *depth = yuvDepth->getLumaAddr();
-
-  if ((height % 8))
-  {
-    vspSize = 1; // 8x4
-  }
-  else if ((width % 8))
-  {
-    vspSize = 0; // 4x8
-  }
-  else
-  {
-    Bool ULvsBR, URvsBL;
-    ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
-    URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
-    vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
-  }
-  Int subBlockW, subBlockH;
-  Int depStrideTmp = depStride * nTxtPerDepthY;
-  if (vspSize)
-  {
-    subBlockW = 8;
-    subBlockH = 4;
-  }
-  else
-  {
-    subBlockW = 4;
-    subBlockH = 8;
-  }
-  for( Int y=0; y<height; y+=subBlockH )
-  {
-    Pel *refDepthTmp[4];
-    refDepthTmp[0] = refDepth + refDepStride * y;
-    refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
-    refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
-    refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
-    for( Int x=0; x<width; x+=subBlockW )
-    {
-      Pel  maxDepthVal;
-      maxDepthVal = refDepthTmp[0][x];
-      maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
-      maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
-      maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
-      Pel *depthTmp = &depth[x+y*depStride];
-      for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
-      {
-        for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
-        {
-          depthTmp[sX] = maxDepthVal;
-        }
-        depthTmp += depStrideTmp;
-      }
-    }
-  }    
-}
-
-Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)
-{
-  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
-  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
-  
-  nTxtPerDepthX = nTxtPerDepthX << vspSize;
-  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
-
-  Int refStride = picRef->getStride();
-  Int dstStride = yuvDst->getStride();
-  Int depStride = yuvDepth->getStride();
-  Int refStrideBlock = refStride  * nTxtPerDepthY;
-  Int dstStrideBlock = dstStride * nTxtPerDepthY;
-  Int depStrideBlock = depStride * nTxtPerDepthY;
-
-  Pel *ref    = picRef->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-  Pel *dst    = yuvDst->getLumaAddr(partAddr);
-  Pel *depth  = yuvDepth->getLumaAddr();
-
-#if H_3D_VSP_BLOCKSIZE == 1
-#if H_3D_VSP_CONSTRAINED
-  //get LUT based horizontal reference range
-  Int range = xGetConstrainedSize(width, height);
-
-  // The minimum depth value
-  Int minRelativePos = MAX_INT;
-  Int maxRelativePos = MIN_INT;
-
-  Pel* depthTemp, *depthInitial=depth;
-  for (Int yTxt = 0; yTxt < height; yTxt++)
-  {
-    for (Int xTxt = 0; xTxt < width; xTxt++)
-    {
-      if (depthPosX+xTxt < widthDepth)
-      {
-        depthTemp = depthInitial + xTxt;
-      }
-      else
-      {
-        depthTemp = depthInitial + (widthDepth - depthPosX - 1);
-      }
-
-      Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec;
-      Int disparityInt = disparity >> 2;
-
-      if( disparity <= 0)
-      {
-        if (minRelativePos > disparityInt+xTxt)
-        {
-          minRelativePos = disparityInt+xTxt;
-        }
-      }
-      else
-      {
-        if (maxRelativePos < disparityInt+xTxt)
-        {
-          maxRelativePos = disparityInt+xTxt;
-        }
-      }
-    }
-    if (depthPosY+yTxt < heightDepth)
-    {
-      depthInitial = depthInitial + depStride;
-    }
-  }
-
-  Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec;
-  if (disparity_tmp <= 0)
-  {
-    maxRelativePos = minRelativePos + range -1 ;
-  }
-  else
-  {
-    minRelativePos = maxRelativePos - range +1 ;
-  }
-#endif
-#endif // H_3D_VSP_BLOCKSIZE == 1
-
-  TComMv dv(0, 0);
-
-  for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
-  {
-    for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
-    {
-      Pel repDepth = depth[ xTxt ];
-      assert( repDepth >= 0 && repDepth <= 255 );
-
-      Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ??
-      Int xFrac = disparity & 0x3;
-
-      dv.setHor( disparity );
-      cu->clipMv( dv );
-
-      Int refOffset = xTxt + (dv.getHor() >> 2);
-      
-#if H_3D_VSP_CONSTRAINED
-      if(refOffset<minRelativePos || refOffset>maxRelativePos)
-      {
-        xFrac = 0;
-      }
-      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-
-      assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
-      m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-    }
-    ref   += refStrideBlock;
-    dst   += dstStrideBlock;
-    depth += depStrideBlock;
-  }
-
-}
-
-Void TComPrediction::xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)
-{
-#if (H_3D_VSP_BLOCKSIZE==1)
-  Int nTxtPerDepthX = 1;
-  Int nTxtPerDepthY = 1;
-#else
-  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;
-  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;
-#endif
-
-  nTxtPerDepthX = nTxtPerDepthX << vspSize;
-  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
-
-  Int refStride = picRef->getCStride();
-  Int dstStride = yuvDst->getCStride();
-  Int depStride = yuvDepth->getStride();
-  Int refStrideBlock = refStride * nTxtPerDepthY;
-  Int dstStrideBlock = dstStride * nTxtPerDepthY;
-  Int depStrideBlock = depStride * (nTxtPerDepthY<<1);
-
-  Pel *refCb  = picRef->getCbAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-  Pel *refCr  = picRef->getCrAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-  Pel *dstCb  = yuvDst->getCbAddr(partAddr);
-  Pel *dstCr  = yuvDst->getCrAddr(partAddr);
-  Pel *depth  = yuvDepth->getLumaAddr();
-
-#if H_3D_VSP_BLOCKSIZE == 1
-#if H_3D_VSP_CONSTRAINED
-  //get LUT based horizontal reference range
-  Int range = xGetConstrainedSize(width, height, false);
-
-  // The minimum depth value
-  Int minRelativePos = MAX_INT;
-  Int maxRelativePos = MIN_INT;
-
-  Int depthTmp;
-  for (Int yTxt=0; yTxt<height; yTxt++)
-  {
-    for (Int xTxt=0; xTxt<width; xTxt++)
-    {
-      depthTmp = m_pDepthBlock[xTxt+yTxt*width];
-      Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec;
-      Int disparityInt = disparity >> 3;//in chroma resolution
-
-      if (disparityInt < 0)
-      {
-        if (minRelativePos > disparityInt+xTxt)
-        {
-          minRelativePos = disparityInt+xTxt;
-        }
-      }
-      else
-      {
-        if (maxRelativePos < disparityInt+xTxt)
-        {
-          maxRelativePos = disparityInt+xTxt;
-        }
-      }
-    }
-  }
-
-  depthTmp = m_pDepthBlock[0];
-  Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec;
-  if ( disparity_tmp < 0 )
-  {
-    maxRelativePos = minRelativePos + range - 1;
-  }
-  else
-  {
-    minRelativePos = maxRelativePos - range + 1;
-  }
-
-#endif // H_3D_VSP_CONSTRAINED
-#endif // H_3D_VSP_BLOCKSIZE == 1
-
-  TComMv dv(0, 0);
-  // luma size -> chroma size
-  height >>= 1;
-  width  >>= 1;
-
-  for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
-  {
-    for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
-    {
-      Pel repDepth = depth[ xTxt<<1 ];
-      assert( repDepth >= 0 && repDepth <= 255 );
-
-      Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec;
-      Int xFrac = disparity & 0x7;
-      
-      dv.setHor( disparity );
-      cu->clipMv( dv );
-
-      Int refOffset = xTxt + (dv.getHor() >> 3);
-
-#if H_3D_VSP_CONSTRAINED
-      if(refOffset<minRelativePos || refOffset>maxRelativePos)
-      {
-        xFrac = 0;
-      }
-      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-
-      assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );
-      assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );
-
-      m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-      m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-    }
-    refCb += refStrideBlock;
-    refCr += refStrideBlock;
-    dstCb += dstStrideBlock;
-    dstCr += dstStrideBlock;
-    depth += depStrideBlock;
-  }
-}
-#endif
-
-#if H_3D_VSP_CONSTRAINED
-Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma)
-{
-  Int iSize = 0;
-  if (bLuma)
-  {
-    Int iArea = (nPbW+7) * (nPbH+7);
-    Int iAlpha = iArea / nPbH - nPbW - 7;
-    iSize = iAlpha + nPbW;
-  }
-  else // chroma
-  {
-    Int iArea = (nPbW+2) * (nPbH+2);
-    Int iAlpha = iArea / nPbH - nPbW - 4;
-    iSize = iAlpha + nPbW;
-  }
-  return iSize;
-}
-#endif // H_3D_VSP_CONSTRAINED
-
-#endif // H_3D_VSP
-
 #if H_3D_DIM
 Void TComPrediction::xPredBiSegDCs( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 )
Index: /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 880)
@@ -80,9 +80,6 @@
 
 #if H_3D_VSP
-  Int*   m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
-#if H_3D_VSP_CONSTRAINED
-  Int  xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true);
-#endif
-  TComYuv   m_cYuvDepthOnVsp;
+  Int*    m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
+  TComYuv m_cYuvDepthOnVsp;
 #endif
 
@@ -121,11 +118,5 @@
 
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
   Void xPredInterUniSubPU        ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 );
-#else
-  Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 );
-  Void xPredInterLumaBlkFromDM    ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
-  Void xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
-#endif
 #endif
 
Index: /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 880)
@@ -139,4 +139,6 @@
                                               // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
                                               // LGE_SHARP_VSP_INHERIT_F0104 
+                                              // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP
+                                              // Restricted bi-prediction for VSP
 
 #define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
@@ -314,13 +316,4 @@
 #define MTK_DDD_G0063                     1   // Disparity derived depth coding
 #define HTM10RC1_FIX                      1   // Fix of DDD
-
-
-#if H_3D_VSP
-#define MTK_RBIP_VSP_G0069                1   // Restricted bi-prediction for VSP
-#define NTT_STORE_SPDV_VSP_G0148          1   // Storing Sub-PU based DV for VSP
-#endif
-
-
-
 #endif
 
Index: /branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 880)
@@ -472,5 +472,5 @@
         pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
         pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
         if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
         {
Index: /branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 880)
@@ -373,5 +373,5 @@
           pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
           pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 #if H_3D_DBBP
           if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
@@ -437,9 +437,5 @@
     }
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
-#else
-    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
-#endif
 #else
     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
Index: /branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 880)
@@ -1900,6 +1900,6 @@
           else
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
-            {
+#if H_3D_VSP
+          {
           if ( vspFlag[uiMergeCand] )
           {
@@ -1934,5 +1934,5 @@
             rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
             rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
           }
         }
@@ -1967,5 +1967,5 @@
 
           rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
-#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+#if H_3D_VSP // possible bug fix
           if( rpcTempCU->getSkipFlag(0) )
           {
@@ -2197,5 +2197,5 @@
 #endif
   m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
-#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+#if H_3D_VSP // possible bug fix
   if( rpcTempCU->getQtRootCbf(0)==0 )
   {
Index: /branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 879)
+++ /branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 880)
@@ -3756,34 +3756,34 @@
   for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
   {
-      UInt uiCostCand = MAX_UINT;
-      UInt uiBitsCand = 0;
-      
-      PartSize ePartSize = pcCU->getPartitionSize( 0 );
-      
-#if H_3D_VSP && NTT_STORE_SPDV_VSP_G0148
-      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+    UInt uiCostCand = MAX_UINT;
+    UInt uiBitsCand = 0;
+
+    PartSize ePartSize = pcCU->getPartitionSize( 0 );
+
+#if H_3D_VSP
+    pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+    pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
 #endif
 
 #if H_3D_SPIVMP
-      pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 
-      if (pbSPIVMPFlag[uiMergeCand])
-      {
-        UInt uiSPAddr;
-
-        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
-
-        pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
-
-        for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
-        {
-          pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
-          pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
-          pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
-        }
-      }
-      else
-#endif
-#if NTT_STORE_SPDV_VSP_G0148
+    pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 
+    if (pbSPIVMPFlag[uiMergeCand])
+    {
+      UInt uiSPAddr;
+
+      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
+
+      pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
+
+      for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
+      {
+        pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
+        pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
+        pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
+      }
+    }
+    else
+#endif
+#if H_3D_VSP
 #if H_3D_DBBP
       if ( vspFlag[uiMergeCand] && !pcCU->getDBBPFlag(0) )
@@ -3821,11 +3821,6 @@
         pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
         pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
-
-#if NTT_STORE_SPDV_VSP_G0148
-      }
-#endif
-#if H_3D_VSP && !NTT_STORE_SPDV_VSP_G0148
-      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+#if H_3D_VSP
+      }
 #endif
 
@@ -3833,10 +3828,10 @@
       if( uiMergeCand == pcCU->getUseDDDCandIdx() )
       {
-          pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-          pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
       else
       {
-          pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
 #endif
@@ -3846,5 +3841,5 @@
       if (uiMergeCand == m_pcEncCfg->getMaxNumMergeCand() -1)
       {
-         uiBitsCand--;
+        uiBitsCand--;
       }
       uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand );
@@ -3857,5 +3852,5 @@
         uiMergeIndex = uiMergeCand;
       }
-    }
+  }
   }
 
@@ -4448,10 +4443,10 @@
     {
       uiLastMode = 1;
-          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
-          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
-        TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
-            pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
+      TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
       pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
-      
+
       pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
       pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
@@ -4574,5 +4569,5 @@
         else
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 #if H_3D_DBBP
         if ( vspFlag[uiMRGIndex] && !pcCU->getDBBPFlag(uiPartAddr) )
