Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h	(revision 292)
@@ -128,5 +128,5 @@
 #define MAX_VIEW_NUM                10
 
-#if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )
+#if ( H3D_IVMP || HHI_INTER_VIEW_RESIDUAL_PRED )
 #define DEPTH_MAP_GENERATION        1
 #define PDM_REMOVE_DEPENDENCE       1      //bug-fix for DMDV JCT2-A0095
@@ -140,13 +140,11 @@
 #define PDM_MERGE_POS                     0         // position of pdm in merge list (0..4)
 
-#if QC_MRG_CANS_B0048
-#if OL_DISMV_POS_B0069
+#if H3D_IVMP
 #define DMV_MERGE_POS                     4
 #else
 #define DMV_MERGE_POS                     1
 #endif
-#endif
-
-#if SAIT_IMPROV_MOTION_PRED_M24829&!H3D_NBDV
+
+#if H3D_IVMP&!H3D_NBDV
 #define PDM_AMVP_POS                      0         // position of pdm in amvp list  (0..3)
 #else
@@ -424,5 +422,5 @@
 // AMVP: advanced motion vector prediction
 #define AMVP_MAX_NUM_CANDS          2           ///< max number of final candidates
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #define AMVP_MAX_NUM_CANDS_MEM      4           ///< max number of candidates
 #else
@@ -431,5 +429,5 @@
 // MERGE
 #define MRG_MAX_NUM_CANDS           5
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #define MRG_MAX_NUM_CANDS_MEM       (MRG_MAX_NUM_CANDS+1) // one extra for inter-view motion prediction
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 292)
@@ -3842,5 +3842,5 @@
 #endif
 {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
   const Int extraMergeCand = ( ( getSlice()->getIsDepth() || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 );
@@ -3852,5 +3852,5 @@
   UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx;
   UInt uiIdx = 1;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
   for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui )
@@ -3927,26 +3927,15 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Bool bNoPdmMerge   = ( m_pcSlice->getSPS()->getViewId() == 0 || ( m_pcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) != PDM_USE_FOR_MERGE );
 
   //===== add merge with predicted depth maps =====
-#if QC_MRG_CANS_B0048
   TComMv  acPdmMv       [4];
   Int     aiPdmRefIdx   [4] = {-1, -1, -1, -1};
   Bool    bLeftAvai         = false;
-#if OL_DISMV_POS_B0069
   Int     iPosLeftAbove[2]  = {-1, -1};
-#endif
-#else
-  TComMv  acPdmMv       [2];
-  Int     aiPdmRefIdx   [2] = {-1, -1};
-#endif
 
 #if H3D_NBDV
-#if QC_MRG_CANS_B0048
   acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 
-#else
-  acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 
-#endif
 #endif //H3D_NBDV
 
@@ -4024,16 +4013,10 @@
 #endif
 #endif
-#if QC_MRG_CANS_B0048
   Int iPdmDir[2] = {0, 0};
-#endif
 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
   getUnifiedMvPredCan(uiPUIdx, REF_PIC_LIST_0, 0, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir, true);
   Int iPdmInterDir;
 #else
-  Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo  
-#if QC_MRG_CANS_B0048
-    , iPdmDir
-#endif
-    );
+  Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir );
 #endif
 #else // H3D_NBDV
@@ -4050,17 +4033,10 @@
 #endif
 
-#if QC_MRG_CANS_B0048
   if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 )
-#else
-  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 )
-#endif
   {
     abCandIsInter        [ iCount ] = true;
-#if QC_MRG_CANS_B0048
     puhInterDirNeighbours[ iCount ] = iPdmDir[0];
     iPdmInterDir                    = iPdmDir[0];
-#else
-    puhInterDirNeighbours[ iCount ] = iPdmInterDir;
-#endif
+
     if( ( iPdmInterDir & 1 ) == 1 )
     {
@@ -4091,7 +4067,5 @@
     iCount ++;
   }
-#endif
-
-#if QC_MRG_CANS_B0048
+
   if(extraMergeCand)
   {
@@ -4120,5 +4094,5 @@
     }    
   }
-#endif
+#endif // HHI_INTER_VIEW_MOTION_PRED
 
 #if MERL_VSP_COMPENSATION_C0152
@@ -4149,18 +4123,152 @@
   if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N)))
   {
-  if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
+    if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
 #if MERL_VSP_C0152
-     CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1)
-#endif
-  )
+      CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1)
+#endif
+      )
+    {
+      abCandIsInter[iCount] = true;
+      // get Inter Dir
+      puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx );
+      // get Mv from Left
+      pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
+      if ( getSlice()->isInterB() )
+      {
+        pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
+      }
+#if FIX_CU_BASED_MRG_CAND_LIST_B0136
+      else
+      {
+        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
+      }
+#endif
+
+#if H3D_IVMP
+      Bool bRemoveSpa = false; //pruning to inter-view candidates
+      Int  iCnloop    = iCount - 1;
+      for(; iCnloop >= 0; iCnloop --)
+      {
+        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
+        {
+          bRemoveSpa                      = true;
+          abCandIsInter        [ iCount ] = false;
+
+          //reset to the default value for IC, MC
+          puhInterDirNeighbours[iCount]   = 0;
+          TComMv  cZeroMv;
+          pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
+          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
+          break;
+        }
+      }
+      if(!bRemoveSpa)
+      {
+        bLeftAvai = true;
+        iPosLeftAbove[0] = iCount;
+#endif  //HHI_INTER_VIEW_MOTION_PRED
+#if H3D_NBDV
+        pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
+        pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
+#endif
+#if MERL_VSP_C0152
+        xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
+#endif
+#if SIMP_MRG_PRUN
+        if ( mrgCandIdx == iCount )
+        {
+          return;
+        }
+#endif
+        iCount ++;
+#if H3D_IVMP
+      }
+#endif 
+    }
+  }
+
+#if H3D_IVMP
+  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 1 )
+  {
+    abCandIsInter        [ iCount ] = true;
+    puhInterDirNeighbours[ iCount ] = iPdmInterDir;
+    if( ( iPdmInterDir & 1 ) == 1 )
+    {
+      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
+    }
+#if FIX_CU_BASED_MRG_CAND_LIST_B0136
+    else
+    {
+      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
+    }
+#endif
+    if( ( iPdmInterDir & 2 ) == 2 )
+    {
+      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
+    }
+#if FIX_CU_BASED_MRG_CAND_LIST_B0136
+    else
+    {
+      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
+    }
+#endif
+#if SIMP_MRG_PRUN
+    if ( mrgCandIdx == iCount )
+    {
+      return;
+    }
+#endif
+    iCount ++;
+  }
+#endif // HHI_INTER_VIEW_MOTION_PRED
+
+#if MERL_VSP_COMPENSATION_C0152
+  //===== vsp 1 =====
+  if( iCount < 4 + extraMergeCand )
+    if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
+      return;
+#endif
+
+  // above
+#if !SIMP_MRG_PRUN
+  partSize = getPartitionSize( uiAbsPartIdx );
+  if (!(uiPUIdx == 1 && (partSize == SIZE_2NxN || partSize == SIZE_2NxnU || partSize == SIZE_2NxnD)))
+  {
+#endif
+  UInt uiAbovePartIdx = 0;
+  TComDataCU* pcCUAbove = 0;
+#if MVP_AT_ENTROPYSLICE_BOUNDARY
+  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, false, true );
+#else
+  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, true, true );
+#endif
+#if PARALLEL_MERGE
+    if (pcCUAbove) 
+    {
+      if (!pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP))
+      {
+        pcCUAbove = NULL;
+      }
+    }
+#endif
+#if SIMP_MRG_PRUN
+  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 
+#if MERL_VSP_C0152
+    CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1)
+#endif
+    && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD))
+    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
+#else
+  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) )
+#endif
   {
     abCandIsInter[iCount] = true;
     // get Inter Dir
-    puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx );
+    puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx );
     // get Mv from Left
-    pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
+    pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
     if ( getSlice()->isInterB() )
     {
-      pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
+      pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
@@ -4170,7 +4278,7 @@
     }
 #endif
-#if QC_MRG_CANS_B0048
+#if H3D_IVMP
     Bool bRemoveSpa = false; //prunign to inter-view candidates
-    Int  iCnloop    = iCount - 1;
+    Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
     for(; iCnloop >= 0; iCnloop --)
     {
@@ -4190,9 +4298,6 @@
     if(!bRemoveSpa)
     {
-      bLeftAvai = true;
-#if OL_DISMV_POS_B0069
-      iPosLeftAbove[0] = iCount;
-#endif
-#endif
+      iPosLeftAbove[1] = iCount;
+#endif // HHI_INTER_VIEW_MOTION_PRED
 #if H3D_NBDV
     pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
@@ -4200,5 +4305,5 @@
 #endif
 #if MERL_VSP_C0152
-     xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
+     xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
 #endif
 #if SIMP_MRG_PRUN
@@ -4209,16 +4314,14 @@
 #endif
     iCount ++;
-#if QC_MRG_CANS_B0048
-      }
-#endif
-  }
-  }
-
-#if HHI_INTER_VIEW_MOTION_PRED
-#if QC_MRG_CANS_B0048
-  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 1 )
-#else
-  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 1 )
-#endif
+#if H3D_IVMP
+    }
+#endif
+  }
+#if !SIMP_MRG_PRUN
+  }
+#endif
+
+#if H3D_IVMP
+  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 2 )
   {
     abCandIsInter        [ iCount ] = true;
@@ -4252,145 +4355,5 @@
     iCount ++;
   }
-#endif
-
-#if MERL_VSP_COMPENSATION_C0152
-  //===== vsp 1 =====
-  if( iCount < 4 + extraMergeCand )
-    if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
-      return;
-#endif
-
-  // above
-#if !SIMP_MRG_PRUN
-  partSize = getPartitionSize( uiAbsPartIdx );
-  if (!(uiPUIdx == 1 && (partSize == SIZE_2NxN || partSize == SIZE_2NxnU || partSize == SIZE_2NxnD)))
-  {
-#endif
-  UInt uiAbovePartIdx = 0;
-  TComDataCU* pcCUAbove = 0;
-#if MVP_AT_ENTROPYSLICE_BOUNDARY
-  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, false, true );
-#else
-  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, true, true );
-#endif
-#if PARALLEL_MERGE
-    if (pcCUAbove) 
-    {
-      if (!pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP))
-      {
-        pcCUAbove = NULL;
-      }
-    }
-#endif
-#if SIMP_MRG_PRUN
-  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 
-#if MERL_VSP_C0152
-    CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1)
-#endif
-    && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD))
-    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
-#else
-  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) )
-#endif
-  {
-    abCandIsInter[iCount] = true;
-    // get Inter Dir
-    puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx );
-    // get Mv from Left
-    pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
-    if ( getSlice()->isInterB() )
-    {
-      pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
-    }
-#if FIX_CU_BASED_MRG_CAND_LIST_B0136
-    else
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
-    }
-#endif
-#if QC_MRG_CANS_B0048
-    Bool bRemoveSpa = false; //prunign to inter-view candidates
-    Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
-    for(; iCnloop >= 0; iCnloop --)
-    {
-      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-      {
-        bRemoveSpa                      = true;
-        abCandIsInter        [ iCount ] = false;
-
-        //reset to the default value for IC, MC
-        puhInterDirNeighbours[iCount]   = 0;
-        TComMv  cZeroMv;
-        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-        break;
-      }
-    }
-    if(!bRemoveSpa)
-    {
-#if OL_DISMV_POS_B0069
-      iPosLeftAbove[1] = iCount;
-#endif
-#endif
-#if H3D_NBDV
-    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
-    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
-#endif
-#if MERL_VSP_C0152
-     xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
-#endif
-#if SIMP_MRG_PRUN
-    if ( mrgCandIdx == iCount )
-    {
-      return;
-    }
-#endif
-    iCount ++;
-#if QC_MRG_CANS_B0048
-    }
-#endif
-  }
-#if !SIMP_MRG_PRUN
-  }
-#endif
-
-#if HHI_INTER_VIEW_MOTION_PRED
-#if QC_MRG_CANS_B0048
-  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 2 )
-#else
-  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 2 )
-#endif
-  {
-    abCandIsInter        [ iCount ] = true;
-    puhInterDirNeighbours[ iCount ] = iPdmInterDir;
-    if( ( iPdmInterDir & 1 ) == 1 )
-    {
-      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
-    }
-#if FIX_CU_BASED_MRG_CAND_LIST_B0136
-    else
-    {
-      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
-    }
-#endif
-    if( ( iPdmInterDir & 2 ) == 2 )
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
-    }
-#if FIX_CU_BASED_MRG_CAND_LIST_B0136
-    else
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
-    }
-#endif
-#if SIMP_MRG_PRUN
-    if ( mrgCandIdx == iCount )
-    {
-      return;
-    }
-#endif
-    iCount ++;
-  }
-#endif
+#endif // HHI_INTER_VIEW_MOTION_PRED
 
 #if MERL_VSP_COMPENSATION_C0152
@@ -4459,10 +4422,6 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED
-#if QC_MRG_CANS_B0048
+#if H3D_IVMP
   if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 3 )
-#else
-  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 3 )
-#endif
   {
     abCandIsInter        [ iCount ] = true;
@@ -4496,7 +4455,5 @@
     iCount ++;
   }
-#endif
-
-#if OL_DISMV_POS_B0069
+
   if(extraMergeCand)
   {
@@ -4546,5 +4503,6 @@
     }    
   }
-#endif
+#endif //HHI_INTER_VIEW_MOTION_PRED
+
 #if MERL_VSP_COMPENSATION_C0152
   //===== vsp 3 =====
@@ -4556,5 +4514,5 @@
 #if MERL_VSP_C0152
 #if VSP_MERGE_POS < 4
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if( iCount < 4 + extraMergeCand )
 #else
@@ -4628,10 +4586,6 @@
 #endif
   
-#if HHI_INTER_VIEW_MOTION_PRED
-#if QC_MRG_CANS_B0048
+#if H3D_IVMP
   if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 4 )
-#else
-  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 4 )
-#endif
   {
     abCandIsInter        [ iCount ] = true;
@@ -4665,5 +4619,5 @@
     iCount ++;
   }
-#endif
+#endif // HHI_INTER_VIEW_MOTION_PRED
 
 #if MERL_VSP_COMPENSATION_C0152
@@ -4675,5 +4629,5 @@
   
   // above left
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if( iCount < 4 + extraMergeCand )
 #else
@@ -4749,5 +4703,5 @@
 
   if ( getSlice()->getPPS()->getEnableTMVPFlag() 
-#if QC_MRG_CANS_B0048
+#if H3D_IVMP
        && iCount < (MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand)
 #endif
@@ -4919,5 +4873,5 @@
   UInt uiArrayAddr = iCount;
 #else
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS_MEM; uiOuter++ )
 #else
@@ -4927,5 +4881,5 @@
     if( abCandIsInter[ uiOuter ] )
     {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS_MEM; uiIter++ )
 #else
@@ -4978,5 +4932,5 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   bool abCandIsInterFlag[MRG_MAX_NUM_CANDS_MEM];
   for (int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
@@ -4992,5 +4946,5 @@
   UInt uiArrayAddr = 0;
     
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   for (int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
 #else
@@ -5008,5 +4962,5 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   for (int i=uiArrayAddr; i<MRG_MAX_NUM_CANDS_MEM; i++)
 #else
@@ -5029,5 +4983,5 @@
   if ( getSlice()->isInterB() )
   {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     Int iCombinedCount = 0;
     Int iMaxCombCount  = ( extraMergeCand ?  6 :  5 );
@@ -5081,5 +5035,5 @@
 #if !REMOVE_NON_SCALED  
     Int iScaledCount = 0;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     for (int i=0; i<uiCutoff && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM && iScaledCount<1; i++)
 #else
@@ -5087,5 +5041,5 @@
 #endif
     {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       for (int j=0; j<2 && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM && iScaledCount<1; j++)
 #else
@@ -5130,5 +5084,5 @@
 
   Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0);
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   for (int r=0; r<iNumRefIdx && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM; r++)
 #else
@@ -5153,5 +5107,5 @@
     uiArrayAddr++;
   }
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if (uiArrayAddr > MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand )
   {
@@ -6677,5 +6631,5 @@
  * \param pInfo
  */
-#if SHARP_INTERVIEW_DECOUPLE_B0111
+#if H3D_IVMP
 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx)
 {
@@ -6721,5 +6675,5 @@
 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
       Int paiPdmRefIdx[4] = {-1, -1, -1, -1};
-      Int iPdmDir[4] = {-1, -1, -1, -1};
+      Int iPdmDir[4]      = {-1, -1, -1, -1};
 #if QC_C0051_FIXED_BY_MTK
       TComMv cPdmMvPred[4];
@@ -6762,7 +6716,7 @@
 
 Void TComDataCU::fillMvpCandBase( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo )
-#else
+#else // HHI_INTER_VIEW_MOTION_PRED 
 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo )
-#endif
+#endif // HHI_INTER_VIEW_MOTION_PRED
 {
   PartSize eCUMode = getPartitionSize( 0 );
@@ -6776,35 +6730,4 @@
     return;
   }
-  
-#if H3D_NBDV && !SHARP_INTERVIEW_DECOUPLE_B0111
-  DisInfo cDisInfo;
-  cDisInfo.iN = 0;
-  if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode())
-  {
-    getDisMvpCandNBDV(uiPartIdx, uiPartAddr, &cDisInfo, false);
-  }
-  if(cDisInfo.iN==0)
-  {
-    cDisInfo.iN = 1;
-    cDisInfo.m_acMvCand[0].setHor(0);
-    cDisInfo.m_acMvCand[0].setVer(0);
-    cDisInfo.m_aVIdxCan[0] = 0;
-  }
-#endif 
-#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
-#if ( PDM_AMVP_POS == 0 )
-  // get inter-view mv predictor (at position 0)
-  TComMv  cPdmMvPred;
-#if H3D_NBDV
-  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
-#else
-  if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
-#endif
-  {
-    clipMv( cPdmMvPred );
-    pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred;
-  }
-#endif
-#endif
 
   //-- Get Spatial MV
@@ -6851,20 +6774,4 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
-#if ( PDM_AMVP_POS == 1 )
-  // get inter-view mv predictor (at position 1)
-  TComMv  cPdmMvPred;
-#if H3D_NBDV
-  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
-#else
-  if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
-#endif
-  {
-    clipMv( cPdmMvPred );
-    pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred;
-  }
-#endif
-#endif
-
   // Above predictor search
   bAdded = xAddMVPCand( pInfo, eRefPicList, iRefIdx, uiPartIdxRT, MD_ABOVE_RIGHT);
@@ -6903,19 +6810,4 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
-#if ( PDM_AMVP_POS == 2 )
-  // get inter-view mv predictor (at position 2)
-  TComMv  cPdmMvPred;
-#if H3D_NBDV
-  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
-#else
-  if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
-#endif
-  {
-    clipMv( cPdmMvPred );
-    pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred;
-  } 
-#endif
-#endif
 
 #if AMVP_PRUNING_SIMPLIFICATION
@@ -6930,27 +6822,4 @@
     }
   }
-#if H3D_NBDV && !SHARP_INTERVIEW_DECOUPLE_B0111
-  if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 )
-  {
-    if ( pInfo->m_acMvCand[ 1 ] == pInfo->m_acMvCand[ 2 ] )
-    {
-      pInfo->iN = 2;
-      if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] )
-        pInfo->iN = 1;
-    }
-    else
-    {
-      if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] )
-      {
-        pInfo->m_acMvCand[1 ] = pInfo->m_acMvCand[ 2 ];
-        pInfo->iN = 2;
-      }
-      else if (pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 2 ])
-      {
-         pInfo->iN = 2;
-      }
-    }
-  }
-#endif
 #endif
 
@@ -7025,20 +6894,4 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
-#if ( PDM_AMVP_POS == 3 )
-  // get inter-view mv predictor (at position 3)
-  TComMv  cPdmMvPred;
-#if H3D_NBDV
-  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
-#else
-  if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
-#endif
-  {
-    clipMv( cPdmMvPred );
-    pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred;
-  }
-#endif
-#endif
-
 #if !AMVP_PRUNING_SIMPLIFICATION
   // Check No MV Candidate
@@ -7046,12 +6899,4 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
-  const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
-  if (pInfo->iN > iNumAMVPCands)
-  {
-    pInfo->iN = iNumAMVPCands;
-  }
-  else if (pInfo->iN < iNumAMVPCands)
-#else
   if (pInfo->iN > AMVP_MAX_NUM_CANDS)
   {
@@ -7059,5 +6904,4 @@
   }
   else if (pInfo->iN < AMVP_MAX_NUM_CANDS)
-#endif
   {
 #if !AMVP_ZERO_CHECKING_REMOVAL
@@ -8726,5 +8570,5 @@
 // public functions for Multi-view tools
 // -------------------------------------------------------------------------------------------------------------------
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #if !H3D_NBDV
 Int
@@ -8757,17 +8601,9 @@
 #else
 Int
-TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
-#if QC_MRG_CANS_B0048
-  , Int* iPdm
-#endif
-)
+TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm )
 {
   TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
   ROFRS( pcDepthMapGenerator, 0 );
-  return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo 
-#if QC_MRG_CANS_B0048
-    , iPdm
-#endif
-    );
+  return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo, iPdm );
 }
 Bool
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 292)
@@ -563,18 +563,14 @@
                                           ,Bool bIndependentTileBoundaryEnabled );
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #if !H3D_NBDV
-  Int           getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
-  Bool          getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
+  Int           getPdmMergeCandidate      ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
+  Bool          getPdmMvPred              ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
 #else //!H3D_NBDV
 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
-  Bool getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
+  Bool          getUnifiedMvPredCan       ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
 #else //QC_AMVP_MRG_UNIFY_IVCAN_C0051
-  Bool          getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false );
-  Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
-#if QC_MRG_CANS_B0048
-    , Int* iPdm
-#endif //QC_MRG_CANS_B0048
-  );
+  Bool          getPdmMvPredDisCan        ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false );
+  Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm );
 #endif //QC_AMVP_MRG_UNIFY_IVCAN_C0051
   Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
@@ -598,5 +594,5 @@
 #endif
   Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
-#endif
+#endif // HHI_INTER_VIEW_MOTION_PRED
 #if HHI_INTER_VIEW_RESIDUAL_PRED
   Bool*         getResPredAvail         ()                        { return m_pbResPredAvailable;        }
@@ -637,9 +633,7 @@
   
   AMVP_MODE     getAMVPMode           ( UInt uiIdx );
-#if SHARP_INTERVIEW_DECOUPLE_B0111
+#if H3D_IVMP
   Void          fillMvpCandBase       ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
   Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1);
-#else
-  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
 #endif
 #if PARALLEL_MERGE 
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 292)
@@ -46,5 +46,4 @@
 #if DEPTH_MAP_GENERATION
 
-
 TComDepthMapGenerator::TComDepthMapGenerator()
 {
@@ -565,5 +564,5 @@
 #endif //!H3D_NBDV
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void  
 TComDepthMapGenerator::covertOrgDepthMap( TComPic* pcPic )
@@ -605,5 +604,5 @@
 
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
 Bool
@@ -630,9 +629,6 @@
     ROTRS( !bPdmMerge, 0 );
 
-#if QC_MRG_CANS_B0048
+
   Bool abPdmAvailable[4] = {false, false, false, false};
-#else
-  Bool abPdmAvailable[2] = {false,false};
-#endif
 
   Int iValid = 0;
@@ -765,11 +761,6 @@
         if( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC())
         {
-#if QC_MRG_CANS_B0048
           abPdmAvailable[ iRefListId+2 ] = true;
           paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
-#else
-          abPdmAvailable[ iRefListId ] = true;
-          paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
-#endif
 #if H3D_NBDV
           TComMv cMv = pDInfo->m_acMvCand[0]; 
@@ -779,9 +770,5 @@
 #endif
           pcCU->clipMv( cMv );
-#if QC_MRG_CANS_B0048
           pacPdmMv      [ iRefListId + 2] = cMv;
-#else
-          pacPdmMv      [ iRefListId ] = cMv;
-#endif
           if(bMerge)
             break;
@@ -794,21 +781,12 @@
       }
     }
-#if QC_MRG_CANS_B0048
     iPdm[1] = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 );
-#else
-    iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ;
-   }
-#endif
   }
   return false;
 }
-#else
+#else // QC_AMVP_MRG_UNIFY_IVCAN_C0051
 #if H3D_NBDV
 Int
-TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
-#if QC_MRG_CANS_B0048
-  , Int* iPdm
-#endif
-)
+TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm )
 #else
 Int
@@ -816,5 +794,4 @@
 #endif 
 {
-#if MTK_INTERVIEW_MERGE_A0049
   AOF  ( m_bCreated && m_bInit );
 
@@ -829,9 +806,5 @@
   ROTRS( !bPdmMerge, 0 );
 
-#if QC_MRG_CANS_B0048
   Bool abPdmAvailable[4] = {false, false, false, false};
-#else
-  Bool abPdmAvailable[2] = {false,false};
-#endif
 
   Int iValid = 0;
@@ -935,10 +908,6 @@
   }
   Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
-#if QC_MRG_CANS_B0048
+
   iPdm[0] = iPdmInterDir;
-#else
-  if (iPdmInterDir == 0)
-  {
-#endif
     for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
     {
@@ -949,11 +918,6 @@
         if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
         {
-#if QC_MRG_CANS_B0048
           abPdmAvailable[ iRefListId+2 ] = true;
           paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
-#else
-          abPdmAvailable[ iRefListId ] = true;
-          paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
-#endif
 #if H3D_NBDV
           TComMv cMv = pDInfo->m_acMvCand[0]; 
@@ -963,82 +927,13 @@
 #endif
           pcCU->clipMv( cMv );
-#if QC_MRG_CANS_B0048
           pacPdmMv      [ iRefListId + 2] = cMv;
-#else
-          pacPdmMv      [ iRefListId ] = cMv;
-#endif
           break;
         }
       }
     }
-#if QC_MRG_CANS_B0048
     iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ;
     iPdm[1] = iPdmInterDir;
-#else
-    iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ;
-  }
-#endif
 
   return iPdmInterDir;
-
-#else
-  Int  iMaxNumInterPics  = 1;
-  Int  iMaxNumAllPics    = 2;
-
-  // inter-only
-  Bool abPdmAvailable[2] = {false,false};
-  for( Int iRefListId = 0; iRefListId < 2; iRefListId++ )
-  {
-    RefPicList  eRefPicList       = RefPicList( iRefListId );
-    Int         iNumRefPics       = pcCU->getSlice()->getNumRefIdx( eRefPicList );
-    TComMv      cMv;
-    for( Int iPdmRefIdx = 0, iInterPics = 0; iPdmRefIdx < iNumRefPics && iInterPics < iMaxNumInterPics; iPdmRefIdx++ )
-    {
-      if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() )
-      {
-#if H3D_NBDV
-        if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) )       
-#else 
-        if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) )
-#endif
-        {
-          pcCU->clipMv( cMv );
-          abPdmAvailable[ iRefListId ] = true;
-          paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
-          pacPdmMv      [ iRefListId ] = cMv;
-          break;
-        }
-        iInterPics++;
-      }
-    }
-  }
-  Int    iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
-  if( 0==iPdmInterDir )
-  { // check all, including inter view references
-    for( Int iRefListId = 0; iRefListId < 2; iRefListId++ )
-    {
-      RefPicList  eRefPicList = RefPicList( iRefListId );
-      Int         iNumRefPics = Min( iMaxNumAllPics, pcCU->getSlice()->getNumRefIdx( eRefPicList ) );
-      TComMv      cMv;
-      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
-      {
-#if H3D_NBDV
-        if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 
-#else 
-        if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) )
-#endif
-        {
-          pcCU->clipMv( cMv );
-          abPdmAvailable[ iRefListId ] = true;
-          paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
-          pacPdmMv      [ iRefListId ] = cMv;
-          break;
-        }
-      }
-    }
-    iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
-  }
-  return iPdmInterDir;
-#endif
 }
 
@@ -1215,5 +1110,5 @@
 }
 #endif // H3D_NBDV
-#endif
+#endif // QC_AMVP_MRG_UNIFY_IVCAN_C0051
 
 
@@ -1257,5 +1152,5 @@
   return        true;
 }
-#endif
+#endif // HHI_INTER_VIEW_MOTION_PRED
 
 
@@ -2057,5 +1952,5 @@
   Int           iCurrPosY;
   pcPredDepthMap->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
-#if SAIT_IMPROV_MOTION_PRED_M24829 // max disparity within PU
+#if H3D_IVMP // max disparity within PU
   Int DiWidth  = iCurrPosX+(iWidth  >> m_uiSubSampExpX);
   Int DiHeight = iCurrPosY+(iHeight >> m_uiSubSampExpY);
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 292)
@@ -142,5 +142,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void  covertOrgDepthMap     ( TComPic*      pcPic );
 #endif
@@ -150,15 +150,10 @@
   UInt  getSubSampExpY        ()                      { return m_uiSubSampExpY; }
   Int   getDisparity          ( TComPic*      pcPic, Int iPosX, Int iPosY, UInt uiRefViewId );
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #if H3D_NBDV
 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
-  Bool getPdmCandidate ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
+  Bool  getPdmCandidate       ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
 #else
-  Int   getPdmMergeCandidate ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 
-#if QC_MRG_CANS_B0048
-    , Int* iPdm
-#endif
-    );
-
+  Int   getPdmMergeCandidate  ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm );
   Bool  getPdmMvPredDisCan    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
   Bool  getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h	(revision 292)
@@ -94,5 +94,5 @@
   Int getHor   () const { return  m_acMv.getHor(); }
   Int getVer   () const { return  m_acMv.getVer(); }
-#if QC_MRG_CANS_B0048
+#if H3D_IVMP
   Bool operator== ( const TComMvField& rcMv ) const
   {
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp	(revision 292)
@@ -59,5 +59,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   m_pcOrgDepthMap     = NULL;
 #endif
@@ -157,5 +157,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if( m_pcOrgDepthMap )
   {
@@ -206,5 +206,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void
 TComPic::addOrgDepthMapBuffer()
@@ -259,5 +259,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void
 TComPic::removeOrgDepthMapBuffer()
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h	(revision 292)
@@ -77,5 +77,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
 #if H3D_NBDV
@@ -165,5 +165,5 @@
 
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
 #if H3D_NBDV
@@ -250,5 +250,5 @@
   Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void          addOrgDepthMapBuffer    ();
 #endif
@@ -259,5 +259,5 @@
   Void          removePrdDepthMapBuffer ();
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void          removeOrgDepthMapBuffer ();
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRdCost.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRdCost.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRdCost.cpp	(revision 292)
@@ -181,5 +181,5 @@
 }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void
 TComRdCost::setLambdaMVReg( Double dLambda )
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRdCost.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRdCost.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRdCost.h	(revision 292)
@@ -203,5 +203,5 @@
 #endif
   Void    setLambda      ( Double dLambda );
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void    setLambdaMVReg ( Double dLambda );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 292)
@@ -1656,5 +1656,5 @@
   ::memset( m_aiPdmOffset,        0x00, sizeof( m_aiPdmOffset         ) );
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   m_uiMultiviewMvPredMode    = 0;
 #endif
@@ -1890,5 +1890,5 @@
 
   m_uiPredDepthMapGeneration = uiPdmGenMode;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   m_uiMultiviewMvPredMode    = uiPdmMvPredMode;
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 292)
@@ -415,5 +415,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   UInt  m_uiMultiviewMvPredMode;
 #endif
@@ -722,5 +722,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   UInt  getMultiviewMvPredMode   ()          { return m_uiMultiviewMvPredMode;    }
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 292)
@@ -79,18 +79,12 @@
 #define INTER_VIEW_VECTOR_SCALING_C0116   1 // JCT3V-C0116 Inter-view vector scaling for AMVP
 
-///// ***** INTERVIEW MOTION VECTOR PREDICTION *********
-#define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
-#if HHI_INTER_VIEW_MOTION_PRED         
-#define SAIT_IMPROV_MOTION_PRED_M24829    1   // improved inter-view motion vector prediction
-#else                                  
-#define SAIT_IMPROV_MOTION_PRED_M24829    0   
-#endif                                 
-
-#define SHARP_INTERVIEW_DECOUPLE_B0111    1   // JCT3V-B0111 decoupling inter-view candidate
-#define QC_MRG_CANS_B0048                 1   // JCT3V-B0048, B0086, B0069
-#if     QC_MRG_CANS_B0048
-#define OL_DISMV_POS_B0069                1   // different pos for disparity MV candidate, B0069
-#endif
-#define MTK_INTERVIEW_MERGE_A0049         1   // JCT3V-A0049 second part
+///// ***** INTERVIEW MOTION PARAMETER PREDICTION *********
+#define H3D_IVMP                          1   // inter-view motion parameter prediction
+                                              // HHI_INTER_VIEW_MOTION_PRED
+                                              // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
+                                              // SHARP_INTERVIEW_DECOUPLE_B0111, decoupling inter-view candidate
+                                              // QC_MRG_CANS_B0048             , JCT3V-B0048, B0086, B0069
+                                              // OL_DISMV_POS_B0069            , different pos for disparity MV candidate, B0069
+                                              // MTK_INTERVIEW_MERGE_A0049     ,// JCT3V-A0049 second part
 #define QC_AMVP_MRG_UNIFY_IVCAN_C0051     1
 #define QC_C0051_FIXED_BY_MTK             1   // bug fix for C0051 implementation
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 292)
@@ -1844,5 +1844,5 @@
 #if DEPTH_MAP_GENERATION
         UInt uiPredDepthMapGeneration = 0, uiPdmPrecision = 0;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         UInt uiMultiviewMvPredMode = 0;
 #endif
@@ -1859,5 +1859,5 @@
             READ_SVLC( iCode, "Pdm_offset" );   m_aaiTempPdmOffset       [ uiViewId ][ uiBaseId ] = iCode;
           }
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
           READ_UVLC( uiMultiviewMvPredMode, "multi_view_mv_pred_mode" );
 #endif
@@ -1866,5 +1866,5 @@
 #endif
         }
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         pcSPS->setPredDepthMapGeneration( uiViewId, false, uiPredDepthMapGeneration, uiMultiviewMvPredMode, uiPdmPrecision, m_aaiTempPdmScaleNomDelta, m_aaiTempPdmOffset );
 #else
@@ -2501,6 +2501,6 @@
   }
 
-#if ( HHI_MPI || HHI_INTER_VIEW_MOTION_PRED )
-  #if ( HHI_MPI && HHI_INTER_VIEW_MOTION_PRED )
+#if ( HHI_MPI || H3D_IVMP )
+  #if ( HHI_MPI && H3D_IVMP )
   const int iExtraMergeCandidates = ( sps->getUseMVI() || sps->getMultiviewMvPredMode() ) ? 1 : 0;
   #elif HHI_MPI
@@ -2780,5 +2780,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void TDecCavlc::parseMVPIdx( Int& riMVPIdx, Int iAMVPCands )
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 292)
@@ -141,5 +141,5 @@
   Void  parseTerminatingBit ( UInt& ruiBit );
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void  parseMVPIdx         ( Int& riMVPIdx, Int iAMVPCands );
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 292)
@@ -339,5 +339,5 @@
     m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
     m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
     UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 292)
@@ -276,5 +276,5 @@
 
 #if CU_BASED_MRG_CAND_LIST
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
   UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
@@ -297,5 +297,5 @@
   {
 #if !CU_BASED_MRG_CAND_LIST
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
     UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
@@ -523,5 +523,5 @@
   if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )
   {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands );
@@ -530,5 +530,5 @@
 #endif
   }
-#if SHARP_INTERVIEW_DECOUPLE_B0111
+#if H3D_IVMP
   pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx);
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h	(revision 292)
@@ -99,5 +99,5 @@
   virtual Void  parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   virtual Void parseMVPIdx        ( Int& riMVPIdx, Int iNumAMVPCands ) = 0;
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 292)
@@ -728,5 +728,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void TDecSbac::parseMVPIdx      ( Int& riMVPIdx, Int iNumAMVPCands )
 {
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 292)
@@ -114,5 +114,5 @@
 
   Void  parseTerminatingBit       ( UInt& ruiBit );
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void  parseMVPIdx               ( Int& riMVPIdx, Int iNumAMVPCands );
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 292)
@@ -795,5 +795,5 @@
           WRITE_SVLC( pcSPS->getPdmOffset       ()[ uiId ], "Pdm_offset" );
         }
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" );
 #endif
@@ -1306,6 +1306,6 @@
   }
   
-#if ( HHI_MPI || HHI_INTER_VIEW_MOTION_PRED )
-  #if ( HHI_MPI && HHI_INTER_VIEW_MOTION_PRED )
+#if ( HHI_MPI || H3D_IVMP )
+  #if ( HHI_MPI && H3D_IVMP )
   const int iExtraMergeCandidates = ( pcSlice->getSPS()->getUseMVI() || pcSlice->getSPS()->getMultiviewMvPredMode() ) ? 1 : 0;
   #elif HHI_MPI
@@ -1490,5 +1490,5 @@
 }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void TEncCavlc::codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum )
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h	(revision 292)
@@ -139,5 +139,5 @@
   Void  encodeStart             () {}
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum );
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 292)
@@ -352,5 +352,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   UInt        m_uiMultiviewMvPredMode;
   UInt        m_uiMultiviewMvRegMode;
@@ -447,5 +447,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void      setMultiviewMvPredMode          ( UInt  u )      { m_uiMultiviewMvPredMode      = u; }
   Void      setMultiviewMvRegMode           ( UInt  u )      { m_uiMultiviewMvRegMode       = u; }
@@ -482,5 +482,5 @@
   Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   UInt      getMultiviewMvRegMode           ()      { return  m_uiMultiviewMvRegMode; }
   Double    getMultiviewMvRegLambdaScale    ()      { return  m_dMultiviewMvRegLambdaScale; }
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 292)
@@ -1942,5 +1942,5 @@
 {
   assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE );
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
   UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
@@ -1959,5 +1959,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui )
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 292)
@@ -1508,5 +1508,5 @@
   if ( (pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList )) && (pcCU->getAMVPMode(uiAbsPartIdx) == AM_EXPL) )
   {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     const Int iNumCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     m_pcEntropyCoderIf->codeMVPIdx( pcCU, uiAbsPartIdx, eRefList, iNumCands );
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h	(revision 292)
@@ -103,5 +103,5 @@
   
   virtual Void codeAlfCtrlDepth() = 0;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum ) = 0;
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 292)
@@ -758,5 +758,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       m_pcDepthMapGenerator->covertOrgDepthMap( pcPic );
 #endif
@@ -1582,5 +1582,5 @@
         pcPic->removeUsedPelsMapBuffer() ;
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       pcPic->removeOrgDepthMapBuffer();
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 292)
@@ -600,5 +600,5 @@
 }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 Void TEncSbac::codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum )
 #else
@@ -607,5 +607,5 @@
 {
   Int iSymbol = pcCU->getMVPIdx(eRefList, uiAbsPartIdx);
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
 #else
   Int iNum = AMVP_MAX_NUM_CANDS;
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h	(revision 292)
@@ -220,5 +220,5 @@
 #endif
   Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Void codeMVPIdx        ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum );
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 292)
@@ -205,5 +205,5 @@
 #endif
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + 1;
   for( Int iNum = 0; iNum < iNumAMVPCands+1; iNum++)
@@ -2963,5 +2963,5 @@
 {
 #if !CU_BASED_MRG_CAND_LIST
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
   UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
@@ -3009,5 +3009,5 @@
 
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
 #endif
@@ -3074,5 +3074,5 @@
       xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() );
       uiBitsCand = uiMergeCand + 1;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       if (uiMergeCand == maxNumMergeCand - 1 )
 #else
@@ -3182,5 +3182,5 @@
 
 #if CU_BASED_MRG_CAND_LIST
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
   UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
@@ -3193,5 +3193,5 @@
 #endif 
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
 #endif
@@ -3299,5 +3299,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][iNumAMVPCands];
 #else
@@ -3486,5 +3486,5 @@
         }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][iNumAMVPCands];
 #else
@@ -3551,5 +3551,5 @@
             if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
           }
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
           uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][iNumAMVPCands];
 #else
@@ -4032,5 +4032,5 @@
     if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefPicList==REF_PIC_LIST_1)
     {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
 #if ZERO_MVD_EST
@@ -4068,5 +4068,5 @@
     {
       UInt uiTmpCost;
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
 #if ZERO_MVD_EST
@@ -4203,5 +4203,5 @@
   Int iBestMVPIdx = riMVPIdx;
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
 #endif
@@ -4209,5 +4209,5 @@
   m_pcRdCost->setPredictor( rcMvPred );
   Int iOrgMvBits  = m_pcRdCost->getBits(cMv.getHor(), cMv.getVer());
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   iOrgMvBits += m_auiMVPIdxCost[riMVPIdx][iNumAMVPCands];
 #else
@@ -4223,5 +4223,5 @@
     
     Int iMvBits = m_pcRdCost->getBits(cMv.getHor(), cMv.getVer());
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     iMvBits += m_auiMVPIdxCost[iMVPIdx][iNumAMVPCands];
 #else
@@ -4408,5 +4408,5 @@
   m_pcRdCost->setCostScale  ( 2 );
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   { // init inter-view regularization
     TComMv  cOrgDepthMapMv;
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 292)
@@ -121,5 +121,5 @@
   
   // AMVP cost computation
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   UInt            m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+2][AMVP_MAX_NUM_CANDS+2]; //th array bounds
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 292)
@@ -409,5 +409,5 @@
 #endif
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   m_pcRdCost ->setLambdaMVReg ( dLambda * m_pcCfg->getMultiviewMvRegLambdaScale() );
 #endif
@@ -469,6 +469,6 @@
   rpcSlice->setEntropySliceArgument ( m_pcCfg->getEntropySliceArgument() );
 
-#if ( HHI_MPI || HHI_INTER_VIEW_MOTION_PRED )
-  #if ( HHI_MPI && HHI_INTER_VIEW_MOTION_PRED )
+#if ( HHI_MPI || H3D_IVMP )
+  #if ( HHI_MPI && H3D_IVMP )
   const int iExtraMergeCandidates = ( pSPS->getUseMVI() || pSPS->getMultiviewMvPredMode() ) ? 1 : 0;
   #elif HHI_MPI
@@ -582,5 +582,5 @@
     pcSlice       ->setLambda              ( m_pdRdPicLambda[uiQpIdx] );
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     m_pcRdCost    ->setLambdaMVReg         ( m_pdRdPicLambda[uiQpIdx] * m_pcCfg->getMultiviewMvRegLambdaScale() );
 #endif
@@ -638,5 +638,5 @@
   pcSlice       ->setLambda              ( m_pdRdPicLambda[uiQpIdxBest] );
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   m_pcRdCost    ->setLambdaMVReg         ( m_pdRdPicLambda[uiQpIdxBest] * m_pcCfg->getMultiviewMvRegLambdaScale() );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 292)
@@ -409,5 +409,5 @@
   pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if( m_uiMultiviewMvRegMode )
   {
@@ -486,5 +486,5 @@
 
 
-#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
+#if HHI_INTERVIEW_SKIP || H3D_IVMP || HHI_INTER_VIEW_RESIDUAL_PRED
 Void
 TEncTop::deleteExtraPicBuffers( Int iPoc )
@@ -504,5 +504,5 @@
   if ( pcPic )
   {
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     pcPic->removeOrgDepthMapBuffer();
 #endif
@@ -594,5 +594,5 @@
   m_iNumPicRcvd++;
   
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if( m_uiMultiviewMvRegMode )
   {
@@ -801,5 +801,5 @@
     {
 #if DEPTH_MAP_GENERATION
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       m_cSPS.setPredDepthMapGeneration( m_viewId, false, m_uiPredDepthMapGeneration, m_uiMultiviewMvPredMode, m_uiPdmPrecision, m_aaiPdmScaleNomDelta, m_aaiPdmOffset );
 #else
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.h	(revision 291)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.h	(revision 292)
@@ -173,5 +173,5 @@
     }
   }
-#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
+#if HHI_INTERVIEW_SKIP || H3D_IVMP || HHI_INTER_VIEW_RESIDUAL_PRED
   Void      deleteExtraPicBuffers   ( Int iPoc );
 #endif
