Index: branches/HTM-4.1-dev1-Intel/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-4.1-dev1-Intel/source/Lib/TLibCommon/TypeDef.h	(revision 170)
+++ branches/HTM-4.1-dev1-Intel/source/Lib/TLibCommon/TypeDef.h	(revision 171)
@@ -131,4 +131,7 @@
 
 #define HHI_MPI                           1   // motion parameter inheritance from texture picture for depth map coding
+#if HHI_MPI
+#define FIX_MPI_B0065                     1   //JCT3V-B0065, fix the MPI bug when RQT is off
+#endif
 #define HHI_MPI_MERGE_POS                 0
 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
Index: branches/HTM-4.1-dev1-Intel/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-4.1-dev1-Intel/source/Lib/TLibDecoder/TDecCu.cpp	(revision 170)
+++ branches/HTM-4.1-dev1-Intel/source/Lib/TLibDecoder/TDecCu.cpp	(revision 171)
@@ -620,6 +620,22 @@
 {
 #if HHI_MPI
+#if FIX_MPI_B0065
+  if( pcCU->getTextureModeDepth( 0 ) != -1 )
+  {
+    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
+    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
+    {
+      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
+      pcCU->setPartSizeSubParts( partSize, 0, uiDepth );
+    }
+    else
+    {
+      pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth );
+    }
+  }
+#else
   if( pcCU->getTextureModeDepth( 0 ) != -1 )
     pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth );
+#endif
 #endif
   
Index: branches/HTM-4.1-dev1-Intel/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-4.1-dev1-Intel/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 170)
+++ branches/HTM-4.1-dev1-Intel/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 171)
@@ -934,4 +934,21 @@
 #endif // !UNIFIED_TRANSFORM_TREE
   }
+
+#if FIX_MPI_B0065
+  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1  )
+  {
+    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
+    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
+    {
+      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
+      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
+    }
+    else
+    {
+      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
+    }
+  }
+#endif
+
 #if UNIFIED_TRANSFORM_TREE
   xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP );
@@ -939,4 +956,11 @@
   xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );
 #endif // UNIFIED_TRANSFORM_TREE
+
+#if FIX_MPI_B0065
+  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
+  {
+    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );  
+  }
+#endif
 }
 
Index: branches/HTM-4.1-dev1-Intel/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-4.1-dev1-Intel/source/Lib/TLibEncoder/TEncCu.cpp	(revision 170)
+++ branches/HTM-4.1-dev1-Intel/source/Lib/TLibEncoder/TEncCu.cpp	(revision 171)
@@ -3059,5 +3059,18 @@
     rpcTempCU->setTextureModeDepthSubParts( uhTextureModeDepth, 0, uhDepth );
     rpcTempCU->copyTextureMotionDataFrom( pcTextureCU, uhDepth, rpcTempCU->getZorderIdxInCU() );
+#if FIX_MPI_B0065
+    UInt uiAbsPartIdx = rpcTempCU->getZorderIdxInCU();
+    if( rpcTempCU->getDepth(0) > pcTextureCU->getDepth(uiAbsPartIdx))
+    {
+      rpcTempCU->setPartSizeSubParts( SIZE_NxN, 0, uhDepth );
+    }
+    else
+    {
+      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
+      rpcTempCU->setPartSizeSubParts( partSize, 0, uhDepth );
+    }
+#else
     rpcTempCU->setPartSizeSubParts( SIZE_NxN, 0, uhDepth );
+#endif
     for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ )
     {
Index: branches/HTM-4.1-dev1-Intel/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-4.1-dev1-Intel/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 170)
+++ branches/HTM-4.1-dev1-Intel/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 171)
@@ -1655,5 +1655,21 @@
 #endif
   }
-  
+
+#if FIX_MPI_B0065
+  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
+  {
+    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
+    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
+    {
+      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
+      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
+    }
+    else
+    {
+      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
+    }
+  }
+#endif
+
 #if UNIFIED_TRANSFORM_TREE
   UInt temp = 0;
@@ -1664,4 +1680,11 @@
   xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );
 #endif // UNIFIED_TRANSFORM_TREE
+
+#if FIX_MPI_B0065
+  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
+  {
+    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );  
+  }
+#endif
 }
 
