Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.cpp	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.cpp	(revision 809)
@@ -3539,5 +3539,9 @@
   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;
@@ -4052,5 +4056,9 @@
     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
@@ -4075,5 +4083,9 @@
     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
@@ -4098,5 +4110,9 @@
   {
 #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
@@ -4119,5 +4135,9 @@
   {
 #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
@@ -4142,5 +4162,9 @@
   {
 #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
@@ -7869,4 +7893,139 @@
 #endif
 
+#if NTT_STORE_SPDV_VSP_G0148
+Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
+{
+  // Get depth reference
+  Int depthRefViewIdx = pcCU->getDvInfo(partAddr).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);
+  pcBaseViewDepthPicYuv->extendPicBorder();
+
+  // Get texture reference
+  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() );
+
+  // prepare Dv to access depth map or reference view
+  TComMv cDv  = pcCU->getDvInfo(partAddr).m_acNBDV;
+  pcCU->clipMv(cDv);
+
+#if H_3D_FCO_VSP_DONBDV_E0163
+  if ( bIsCurrDepthCoded )
+  {
+      cDv.setZero();
+  }
+#endif
+
+  // fetch virtual depth map & convert depth to motion vector, which are stored in the motion memory
+  xSetMvFieldForVSP( pcCU, pcBaseViewDepthPicYuv, &cDv, partAddr, width, height, pShiftLUT, eRefPicList, iRefIdx, pcCU->getSlice()->getIsDepth(), vspSize );
+}
+
+Void TComDataCU::xSetMvFieldForVSP( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize )
+{
+  TComCUMvField *cuMvField = cu->getCUMvField( refPicList );
+  Int partAddrRasterSubPULine  = g_auiZscanToRaster[ partAddr ];
+  Int numPartsLine    = cu->getPic()->getNumPartInWidth();
+
+  Int nTxtPerMvInfoX = 4; // cu->getPic()->getMinCUWidth();
+  Int nTxtPerMvInfoY = 4; // cu->getPic()->getMinCUHeight();
+
+  Int refDepStride = picRefDepth->getStride();
+
+  TComMv tmpMv(0, 0);
+  tmpMv.setIDVFlag(false);
+
+  Int refDepOffset  = ( (dv->getHor()+2) >> 2 ) + ( (dv->getVer()+2) >> 2 ) * refDepStride;
+  Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refDepOffset;
+
+  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;
+  if (vspSize)
+  {
+    subBlockW = 8;
+    subBlockH = 4;
+  }
+  else
+  {
+    subBlockW = 4;
+    subBlockH = 8;
+  }
+  
+  Int numPartsInSubPUW = subBlockW / nTxtPerMvInfoX;
+  Int numPartsInSubPUH = subBlockH / nTxtPerMvInfoY * numPartsLine;
+
+  for( Int y=0; y<height; y+=subBlockH, partAddrRasterSubPULine+=numPartsInSubPUH )
+  {
+    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;
+
+    Int partAddrRasterSubPU = partAddrRasterSubPULine;
+    for( Int x=0; x<width; x+=subBlockW, partAddrRasterSubPU+=numPartsInSubPUW )
+    {
+      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]);
+      tmpMv.setHor( (Short) shiftLUT[ maxDepthVal ] );
+
+      Int partAddrRasterPartLine = partAddrRasterSubPU;
+      for( Int sY=0; sY<numPartsInSubPUH; sY+=numPartsLine, partAddrRasterPartLine += numPartsLine )
+      {
+        Int partAddrRasterPart = partAddrRasterPartLine;
+        for( Int sX=0; sX<numPartsInSubPUW; sX+=1, partAddrRasterPart++ )
+        {
+          cuMvField->setMv    ( g_auiRasterToZscan[ partAddrRasterPart ], tmpMv );
+          cuMvField->setRefIdx( g_auiRasterToZscan[ partAddrRasterPart ], refIdx );
+        }
+      }
+    }
+  }
+
+  vspSize = (vspSize<<2)+1;
+
+}
+#endif // NTT_STORE_SPDV_VSP_G0148
 
 //! \}
Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.h	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.h	(revision 809)
@@ -291,4 +291,8 @@
   Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter );
 
+#if NTT_STORE_SPDV_VSP_G0148
+  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
+
 public:
   TComDataCU();
@@ -702,4 +706,7 @@
   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-9.3-dev1-NTT/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComMotionInfo.h	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComMotionInfo.h	(revision 809)
@@ -176,4 +176,8 @@
   Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
 #endif
+#if NTT_STORE_SPDV_VSP_G0148
+  Void    setMv         ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; }
+  Void    setRefIdx     ( Int iIdx, Int iRefIdx )         { m_piRefIdx[iIdx] = iRefIdx; }
+#endif
 
   Void setNumPartition( Int iNumPart )
Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.cpp	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.cpp	(revision 809)
@@ -863,4 +863,21 @@
 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;
+
+  Int widthSubPU, heightSubPU;
+  if (vspSize)
+  {
+    widthSubPU  = 8;
+    heightSubPU = 4;
+  }
+  else
+  {
+    widthSubPU  = 4;
+    heightSubPU = 8;
+  }
+  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;
@@ -914,5 +931,34 @@
   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 )
+{
+  UInt numPartsInLine       = pcCU->getPic()->getNumPartInWidth();
+  UInt horiNumPartsInSubPU  = widthSubPU >> 2;
+  UInt vertNumPartsInSubPU  = (heightSubPU >> 2) * numPartsInLine;
+
+  UInt partAddrRasterLine = g_auiZscanToRaster[ uiPartAddr ];
+
+  for( Int posY=0; posY<iHeight; posY+=heightSubPU, partAddrRasterLine+=vertNumPartsInSubPU )
+  {
+    UInt partAddrRasterSubPU = partAddrRasterLine;
+    for( Int posX=0; posX<iWidth; posX+=widthSubPU, partAddrRasterSubPU+=horiNumPartsInSubPU )
+    {
+      UInt    partAddrSubPU = g_auiRasterToZscan[ partAddrRasterSubPU ];
+      Int     refIdx        = pcCU->getCUMvField( eRefPicList )->getRefIdx( partAddrSubPU );           assert (refIdx >= 0);
+      TComMv  cMv           = pcCU->getCUMvField( eRefPicList )->getMv( partAddrSubPU );
+      pcCU->clipMv(cMv);
+
+      xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi );
+      xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi );
+
+    }
+  }
+}
+#endif // NTT_STORE_SPDV_VSP_G0148
+
 #endif
 
@@ -1769,4 +1815,5 @@
 
 #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 )
@@ -2081,5 +2128,5 @@
   }
 }
-
+#endif
 
 #if H_3D_VSP_CONSTRAINED
Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.h	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.h	(revision 809)
@@ -121,7 +121,11 @@
 
 #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-9.3-dev1-NTT/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TypeDef.h	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TypeDef.h	(revision 809)
@@ -259,4 +259,5 @@
 #endif
 #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
 
Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibDecoder/TDecCu.cpp	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibDecoder/TDecCu.cpp	(revision 809)
@@ -462,4 +462,18 @@
         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( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
+        {
+          if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )
+          {
+            UInt dummy;
+            Int vspSize;
+            Int width, height;
+            m_ppcCU[uiDepth]->getPartIndexAndSize( uiAbsPartIdx, dummy, width, height );
+            m_ppcCU[uiDepth]->setMvFieldPUForVSP( pcCU, uiAbsPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );
+            pcCU->setVSPFlag( uiAbsPartIdx, vspSize );
+          }
+        }
+#endif
 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC   
         if ( g_decTraceMvFromMerge )
Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 809)
@@ -342,4 +342,18 @@
           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( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )
+          {
+            if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) )
+            {
+              UInt dummy;
+              Int vspSize;
+              Int width, height;
+              pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 );
+              pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize );
+              pcCU->setVSPFlag( uiSubPartIdx, vspSize );
+            }
+          }
+#endif
         }
       }
@@ -388,5 +402,9 @@
     }
 #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-9.3-dev1-NTT/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibEncoder/TEncCu.cpp	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibEncoder/TEncCu.cpp	(revision 809)
@@ -1955,12 +1955,41 @@
           }
           else
+#endif
+#if NTT_STORE_SPDV_VSP_G0148
+          if ( vspFlag[uiMergeCand] )
           {
-#endif
+            UInt partAddr;
+            Int vspSize;
+            Int width, height;
+            rpcTempCU->getPartIndexAndSize( 0, partAddr, width, height );
+
+            if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 )
+            {
+              rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_0, cMvFieldNeighbours[ 2*uiMergeCand + 0 ].getRefIdx(), vspSize );
+              rpcTempCU->setVSPFlag( partAddr, vspSize );
+            }
+            else
+            {
+              rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
+            }
+            if( uhInterDirNeighbours[ uiMergeCand ] & 0x02 )
+            {
+              rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_1 , cMvFieldNeighbours[ 2*uiMergeCand + 1 ].getRefIdx(), vspSize );
+              rpcTempCU->setVSPFlag( partAddr, vspSize );
+            }
+            else
+            {
+              rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
+            }
+
+            rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level
+          }
+          else
+#endif
+          {
             rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level
             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 H_3D_SPIVMP
           }
-#endif
        // do MC
        m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
@@ -1992,4 +2021,10 @@
 
           rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
+#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+          if( rpcTempCU->getSkipFlag(0) )
+          {
+            rpcTempCU->setTrIdxSubParts(0, 0, uhDepth);
+          }
+#endif
 #if H_3D_INTER_SDC
           TComDataCU *rpcTempCUPre = rpcTempCU;
@@ -2214,5 +2249,11 @@
 
   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( rpcTempCU->getQtRootCbf(0)==0 )
+  {
+    rpcTempCU->setTrIdxSubParts(0, 0, uhDepth);
+  }
+#endif
 
 #if H_3D_VSO // M4
Index: branches/HTM-9.3-dev1-NTT/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-9.3-dev1-NTT/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 803)
+++ branches/HTM-9.3-dev1-NTT/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 809)
@@ -3643,4 +3643,9 @@
       
       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 ) );
+#endif
 
 #if H_3D_SPIVMP
@@ -3662,13 +3667,40 @@
       }
       else
-      {
-#endif
+#endif
+#if NTT_STORE_SPDV_VSP_G0148
+      if ( vspFlag[uiMergeCand] )
+      {
+        UInt partAddr;
+        Int vspSize;
+        Int width, height;
+        pcCU->getPartIndexAndSize( iPUIdx, partAddr, width, height );
+
+        if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 )
+        {
+          pcCU->setMvFieldPUForVSP( pcCU, partAddr, width, height, REF_PIC_LIST_0, cMvFieldNeighbours[ 2*uiMergeCand + 0 ].getRefIdx(), vspSize );
+          pcCU->setVSPFlag( partAddr, vspSize );
+        }
+        else
+        {
+          pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
+        }
+        if( uhInterDirNeighbours[ uiMergeCand ] & 0x02 )
+        {
+          pcCU->setMvFieldPUForVSP( pcCU, partAddr, width, height, REF_PIC_LIST_1, cMvFieldNeighbours[ 2*uiMergeCand + 1 ].getRefIdx(), vspSize );
+          pcCU->setVSPFlag( partAddr, vspSize );
+        }
+        else
+        {
+          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
+        }
+      }
+      else
+#endif
+      {
         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 H_3D_SPIVMP
-      }
-#endif
-
-#if H_3D_VSP
+      }
+
+#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 ) );
@@ -4426,6 +4458,36 @@
         }
         else
-        {
-#endif
+#endif
+#if NTT_STORE_SPDV_VSP_G0148
+        if ( vspFlag[uiMRGIndex] )
+        {
+          UInt partAddrTemp;
+          Int vspSize;
+          Int width, height;
+          pcCU->getPartIndexAndSize( iPartIdx, partAddrTemp, width, height ); // true or pcCU->getTotalNumPart()==256
+
+          if( uiMRGInterDir & 0x01 )
+          {
+            pcCU->setMvFieldPUForVSP( pcCU, partAddrTemp, width, height, REF_PIC_LIST_0, cMRGMvField[0].getRefIdx(), vspSize );
+            pcCU->setVSPFlag( partAddrTemp, vspSize );
+          }
+          else
+          {
+            pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0], ePartSize, uiPartAddr, 0, iPartIdx );
+          }
+          if( uiMRGInterDir & 0x02 )
+          {
+            pcCU->setMvFieldPUForVSP( pcCU, partAddrTemp, width, height, REF_PIC_LIST_1, cMRGMvField[1].getRefIdx(), vspSize );
+            pcCU->setVSPFlag( partAddrTemp, vspSize );
+          }
+          else
+          {
+            pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx );
+          }
+          pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+        }
+        else
+#endif
+        {
           pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
           {
@@ -4433,7 +4495,5 @@
             pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx );
           }
-#if H_3D_SPIVMP
-        }
-#endif
+        }
 
         pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd    ( cMvZero,            ePartSize, uiPartAddr, 0, iPartIdx );
