Index: branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1235)
+++ branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1255)
@@ -152,5 +152,5 @@
     setIsChromaQpAdjCoded(true);
   }
-
+  
   // start from the top level CU
   xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment);
@@ -293,7 +293,16 @@
 if(!pcCU->getSlice()->isIntra())
   {
-#if H_3D_ARP && H_3D_IV_MERGE
-    if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() )
+#if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP
+    if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
 #else 
+#if NH_3D_IV_MERGE && NH_3D_VSP
+    if( pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
+#else
+#if NH_3D_ARP && NH_3D_VSP
+    if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
+#else
+#if NH_3D_VSP
+    if( pcCU->getSlice()->getViewSynthesisPredFlag() )
+#else
 #if H_3D_ARP
     if( pcCU->getSlice()->getVPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) )
@@ -303,4 +312,7 @@
 #else
     if (0)
+#endif
+#endif
+#endif
 #endif
 #endif
@@ -408,5 +420,5 @@
 
 
-#if H_3D_VSP
+#if NH_3D_VSP
     Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
     memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
@@ -433,5 +445,5 @@
 
     m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
-#if H_3D_VSP
+#if NH_3D_VSP
       , vspFlag
 #endif
@@ -441,5 +453,5 @@
       , numValidMergeCand );
 #endif
-#if H_3D_VSP
+#if NH_3D_VSP
     pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
 #endif
@@ -456,5 +468,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 H_3D_VSP
+#if NH_3D_VSP
         if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
         {
Index: branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1235)
+++ branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1255)
@@ -318,5 +318,5 @@
         if ( !isMerged )
         {
-#if H_3D_VSP
+#if NH_3D_VSP
           Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
           memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
@@ -337,5 +337,4 @@
             , numValidMergeCand );
           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
-
 #else
 #if H_3D
@@ -355,5 +354,5 @@
       {
         uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
-#if H_3D_VSP
+#if NH_3D_VSP
         Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
         memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
@@ -395,5 +394,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 H_3D_VSP
+#if NH_3D_VSP
 #if H_3D_DBBP
           if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
@@ -486,5 +485,5 @@
 
 #if NH_3D_MLC
-#if H_3D_VSP
+#if NH_3D_VSP
           Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
           memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
@@ -503,5 +502,5 @@
             , numValidMergeCand );
           pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
-#if H_3D_VSP
+#if NH_3D_VSP
             , vspFlag
 #endif
@@ -510,5 +509,5 @@
 #endif
             , numValidMergeCand );
-#if H_3D_VSP
+#if NH_3D_VSP
           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
 #endif
@@ -523,5 +522,5 @@
 
 #if NH_3D_MLC
-#if H_3D_VSP
+#if NH_3D_VSP
         Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
         memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
@@ -540,5 +539,5 @@
           ,numValidMergeCand, uiMergeIndex );
         pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
-#if H_3D_VSP
+#if NH_3D_VSP
           , vspFlag
 #endif
@@ -547,5 +546,5 @@
 #endif
           ,numValidMergeCand );
-#if H_3D_VSP
+#if NH_3D_VSP
         pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
 #endif
@@ -564,5 +563,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 NH_3D_VSP
+          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
         }
       }
