Index: /branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 326)
+++ /branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 327)
@@ -3599,5 +3599,5 @@
 #if MERL_VSP_C0152
             , true
-#endif
+#endif      
 );
   }
@@ -5005,6 +5005,7 @@
         else if ( bSearchForMvpDv && cMvPred.m_bDvMcp && bTmpIsSkipped )
         {
-          paMvpDvInfo->m_acMvCand[iList][ uiMvpDvPos ] = cMvPred;
-          paMvpDvInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = refViewIdx;
+          assert( uiMvpDvPos < MCP_DIS_CANS );
+          paMvpDvInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.m_iDvMcpDispX, cMvPred.m_iDvMcpDispY );
+          paMvpDvInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = 0; // works only for CTC
           paMvpDvInfo->m_bAvailab[iList][ uiMvpDvPos ] = true;
           paMvpDvInfo->m_bFound                        = true; 
@@ -5034,44 +5035,45 @@
 {
   UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();  
-    Int uiLCUIdx = getAddr();
-  
+  Int uiLCUIdx = getAddr();
+
   UInt uiPartIdxRB;
-    deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB );  
-    UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
-
-    if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
-    {
+  deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB );  
+  UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
+
+  if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
+  {
     riLCUIdxRBNb  = -1;
     riPartIdxRBNb = -1;
-    }
-    else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
-    {
+  }
+  else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
+  {
     riLCUIdxRBNb  = -1;
     riPartIdxRBNb = -1;
-    }
-    else
-    {
-      if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU 
+  }
+  else
+  {
+    if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU 
       ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
-      {
+    {
       riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
-      }
-      else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
-      {
+      riLCUIdxRBNb  = uiLCUIdx; 
+    }
+    else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
+    {
       riPartIdxRBNb = -1;
       riLCUIdxRBNb  = -1;
-      }
-      else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
-      {
+    }
+    else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
+    {
       riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
       riLCUIdxRBNb = uiLCUIdx + 1;
-      }
-      else //is the right bottom corner of LCU                       
-      {
+    }
+    else //is the right bottom corner of LCU                       
+    {
       riPartIdxRBNb = -1;
       riLCUIdxRBNb  = -1;
-      }
-    }
-      }
+    }
+  }
+}
 
 
@@ -5084,5 +5086,5 @@
   //// ******* Init variables ******* /////
   // Init disparity struct for results
-  pDInfo->iN = 0;  
+  pDInfo->iN = 0;    
 
   // Init struct for disparities from MCP neighboring blocks
@@ -5288,5 +5290,5 @@
   if( cMvpDvInfo.m_bFound ) 
   {
-    for( Int curPos = 1 ; curPos < MCP_DIS_CANS - 1 ; curPos++ ) 
+    for( Int curPos = 0 ; curPos < MCP_DIS_CANS ; curPos++ ) 
     {
       for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
@@ -7181,5 +7183,5 @@
   else
 #endif
-  getDisMvpCandNBDV( 0, 0,  &cDisInfo, false );
+  getDisMvpCandNBDV( 0, 0,  &cDisInfo, false );  
   if( cDisInfo.iN == 0)
   {
Index: /branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 326)
+++ /branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 327)
@@ -211,5 +211,5 @@
 #if H3D_NBDV                    
 #define DIS_CANS                          1
-#define MCP_DIS_CANS                      1
+#define MCP_DIS_CANS                      7
 #endif                                  
 
