Index: branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 549)
+++ branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncCu.cpp	(revision 566)
@@ -1615,5 +1615,11 @@
   Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
   memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
+#if MTK_VSP_FIX_E0172
+  Int vspDir[MRG_MAX_NUM_CANDS_MEM];
+  memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
+  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand );
+#else
   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
+#endif
 #else
   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
@@ -1683,4 +1689,7 @@
 #if H_3D_VSP
           rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
+#if MTK_VSP_FIX_E0172
+          rpcTempCU->setVSPDirSubParts( vspDir[uiMergeCand], 0, 0, uhDepth );
+#endif
 #endif
           rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level
Index: branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 549)
+++ branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 566)
@@ -1078,4 +1078,10 @@
 #endif
 #endif
+#if MTK_NBDV_TN_FIX_E0172 
+      if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
+      {
+        pcPic->checkTemporalIVRef();
+      }
+#endif
     while(nextCUAddr<uiRealEndAddress) // determine slice boundaries
     {
Index: branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 549)
+++ branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 566)
@@ -3550,4 +3550,7 @@
 #if H_3D_VSP
                                  , Int* vspFlag
+#if MTK_VSP_FIX_E0172
+                                 , Int* vspDir
+#endif
 #endif
                                  , Int& numValidMergeCand
@@ -3569,4 +3572,7 @@
 #if H_3D_VSP
                                    , vspFlag
+#if MTK_VSP_FIX_E0172
+                                   , vspDir
+#endif
 #endif
                                    , numValidMergeCand
@@ -3580,9 +3586,16 @@
 #if H_3D_VSP
                                  , vspFlag
+#if MTK_VSP_FIX_E0172
+                                 , vspDir
+#endif
 #endif
                                  , numValidMergeCand
                                  );
   }
+#if MTK_VSP_FIX_E0172
+  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand );
+#else
   xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
+#endif
 
   ruiCost = MAX_UINT;
@@ -3600,4 +3613,7 @@
 #if H_3D_VSP
       pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+#if MTK_VSP_FIX_E0172
+      pcCU->setVSPDirSubParts( vspDir[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+#endif
 #endif
 
@@ -3629,5 +3645,9 @@
  * \returns Void
  */
+#if MTK_VSP_FIX_E0172
+Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand )
+#else
 Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int numValidMergeCand )
+#endif
 {
   if ( pcCU->isBipredRestriction(puIdx) )
@@ -3635,5 +3655,9 @@
     for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand )
     {
+#if MTK_VSP_FIX_E0172
+      if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) )
+#else
       if ( interDirNeighbours[mergeCand] == 3 )
+#endif
       {
         interDirNeighbours[mergeCand] = 1;
@@ -3758,4 +3782,7 @@
 #if H_3D_VSP
     pcCU->setVSPFlagSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
+#if MTK_VSP_FIX_E0172
+    pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
+#endif
 #endif
     
@@ -4250,4 +4277,8 @@
       Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
       memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
+#if MTK_VSP_FIX_E0172
+      Int vspDir[MRG_MAX_NUM_CANDS_MEM];
+      memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
+#endif
 #endif
 
@@ -4255,4 +4286,7 @@
 #if H_3D_VSP
                       , vspFlag
+#if MTK_VSP_FIX_E0172
+                      , vspDir
+#endif
 #endif
                       , numValidMergeCand
@@ -4265,4 +4299,7 @@
 #if H_3D_VSP
         pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+#if MTK_VSP_FIX_E0172
+        pcCU->setVSPDirSubParts( vspDir[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+#endif
 #endif
         pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
@@ -4287,4 +4324,7 @@
 #if H_3D_VSP
         pcCU->setVSPFlagSubParts ( 0,             uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+#if MTK_VSP_FIX_E0172
+        pcCU->setVSPDirSubParts ( 0,             uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+#endif
 #endif
         {
Index: branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.h	(revision 549)
+++ branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.h	(revision 566)
@@ -415,4 +415,7 @@
 #if H_3D_VSP
                                   , Int* vspFlag
+#if MTK_VSP_FIX_E0172
+                                  , Int* vspDir
+#endif
 #endif
                                   , Int& numValidMergeCand
@@ -423,4 +426,7 @@
                                     TComMvField*    mvFieldNeighbours, 
                                     UChar*          interDirNeighbours, 
+#if MTK_VSP_FIX_E0172
+                                    Int* vspFlag,
+#endif
                                     Int             numValidMergeCand );
 
