Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h	(revision 295)
@@ -128,5 +128,5 @@
 #define MAX_VIEW_NUM                10
 
-#if ( H3D_IVMP || HHI_INTER_VIEW_RESIDUAL_PRED )
+#if ( H3D_IVMP || H3D_IVRP )
 #define DEPTH_MAP_GENERATION        1
 #define PDM_REMOVE_DEPENDENCE       1      //bug-fix for DMDV JCT2-A0095
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 295)
@@ -59,5 +59,5 @@
 #define NUM_MERGE_IDX_EXT_CTX         1       ///< number of context models for merge index of merge extended
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #define NUM_RES_PRED_FLAG_CTX         4       ///< number of context for residual prediction flag
 #endif
@@ -191,5 +191,5 @@
 };
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 static const UChar
 INIT_RES_PRED_FLAG[3][NUM_RES_PRED_FLAG_CTX] =
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 295)
@@ -214,5 +214,5 @@
   m_piContourPredTexDeltaDC2 = NULL;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pbResPredAvailable = NULL;
   m_pbResPredFlag      = NULL;
@@ -285,5 +285,5 @@
     m_piVSPIndex         = (Char*  )xMalloc(Char,   uiNumPartition);
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_pbResPredAvailable = (Bool*  )xMalloc(Bool,   uiNumPartition);
     m_pbResPredFlag      = (Bool*  )xMalloc(Bool,   uiNumPartition);
@@ -443,5 +443,5 @@
 #endif
     if ( m_puhMergeIndex      ) { xFree(m_puhMergeIndex);       m_puhMergeIndex     = NULL; }
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     if ( m_pbResPredAvailable ) { xFree(m_pbResPredAvailable);  m_pbResPredAvailable= NULL; }
     if ( m_pbResPredFlag      ) { xFree(m_pbResPredFlag);       m_pbResPredFlag     = NULL; }
@@ -713,5 +713,5 @@
     memset (m_pbRenderable             + firstElement, false, sizeof( Bool ) * numElements) ;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     memset( m_pbResPredAvailable       + firstElement, 0    , sizeof( Bool ) * numElements );
     memset( m_pbResPredFlag            + firstElement, 0    , sizeof( Bool ) * numElements );
@@ -855,5 +855,5 @@
       m_piVSPIndex[ui] = 0;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_pbResPredAvailable[ui] = 0;
       m_pbResPredFlag[ui]      = 0;
@@ -966,5 +966,5 @@
   memset( m_piVSPIndex,         0, iSizeInChar );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   memset( m_pbResPredAvailable, 0, iSizeInBool  );
   memset( m_pbResPredFlag,      0, iSizeInBool  );
@@ -1080,5 +1080,5 @@
       m_piContourPredTexDeltaDC2[ui]=pcCU->getContourPredTexDeltaDC2(uiPartOffset+ui);
 #endif    
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ];
       m_pbResPredFlag     [ui] = pcCU->m_pbResPredFlag     [ uiPartOffset + ui ];
@@ -1202,5 +1202,5 @@
   m_piVSPIndex          = pcCU->getVSPIndex()         + uiPart;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pbResPredAvailable  = pcCU->getResPredAvail()     + uiPart;
   m_pbResPredFlag       = pcCU->getResPredFlag ()     + uiPart;
@@ -1348,5 +1348,5 @@
   m_piVSPIndex         = pcCU->getVSPIndex()              + uiAbsPartIdx;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pbResPredAvailable = pcCU->getResPredAvail()          + uiAbsPartIdx;
   m_pbResPredFlag      = pcCU->getResPredFlag ()          + uiAbsPartIdx;
@@ -1399,5 +1399,5 @@
   memcpy( m_piVSPIndex          + uiOffset, pcCU->getVSPIndex(),          iSizeInChar );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   memcpy( m_pbResPredAvailable  + uiOffset, pcCU->getResPredAvail(),      iSizeInBool  );
   memcpy( m_pbResPredFlag       + uiOffset, pcCU->getResPredFlag(),       iSizeInBool  );
@@ -1538,5 +1538,5 @@
   memcpy( rpcCU->getVSPIndex()          + m_uiAbsIdxInLCU, m_piVSPIndex,         iSizeInChar );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   memcpy( rpcCU->getResPredAvail()      + m_uiAbsIdxInLCU, m_pbResPredAvailable,  iSizeInBool  );
   memcpy( rpcCU->getResPredFlag()       + m_uiAbsIdxInLCU, m_pbResPredFlag,       iSizeInBool  );
@@ -1669,5 +1669,5 @@
   memcpy( rpcCU->getVSPIndex()          + uiPartOffset, m_piVSPIndex,         iSizeInChar );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   memcpy( rpcCU->getResPredAvail()      + uiPartOffset, m_pbResPredAvailable,  iSizeInBool  );
   memcpy( rpcCU->getResPredFlag()       + uiPartOffset, m_pbResPredFlag,       iSizeInBool  );
@@ -2623,5 +2623,5 @@
 
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 UInt
 TComDataCU::getCtxResPredFlag( UInt uiAbsPartIdx )
@@ -2949,5 +2949,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void TComDataCU::setResPredAvailSubParts( Bool bResPredAvailable, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
@@ -3628,5 +3628,44 @@
   deriveLeftRightTopIdxGeneral( cCurPS, uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
   deriveLeftBottomIdxGeneral( cCurPS, uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
-#if !FIX_TEXTURE_MERGING_CANDIDATE_VSP_C0137_C0152
+
+#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 =====
+  TComMv  acPdmMv       [4];
+  Int     aiPdmRefIdx   [4] = {-1, -1, -1, -1};
+  Bool    bLeftAvai         = false;
+  Int     iPosLeftAbove[2]  = {-1, -1};
+
+#if H3D_NBDV
+  acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 
+#endif //H3D_NBDV
+
+#if MTK_MDIVRP_C0138
+  Bool bDVAvail = true;
+#endif
+
+#if H3D_NBDV
+  DisInfo cDisInfo;
+  cDisInfo.iN = 0;
+  if(!bNoPdmMerge)
+  {
+    getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true
+#if MERL_VSP_C0152
+            , true
+#endif
+);
+  }
+  if(cDisInfo.iN==0)
+  {
+    cDisInfo.iN = 1;
+    cDisInfo.m_acMvCand[0].setHor(0);
+    cDisInfo.m_acMvCand[0].setVer(0);
+    cDisInfo.m_aVIdxCan[0] = 0;
+#if MTK_MDIVRP_C0138
+    bDVAvail = false;
+#endif
+  }
+
 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
   if( m_pcSlice->getIsDepth())
@@ -3662,5 +3701,5 @@
         }
       }
-#if FIX_TEXTURE_MERGING_CANDIDATE_VSP_C0137_C0152
+#if MERL_VSP_C0152
       xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
 #endif
@@ -3673,90 +3712,5 @@
   }
 #endif
-#endif
-
-#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 =====
-  TComMv  acPdmMv       [4];
-  Int     aiPdmRefIdx   [4] = {-1, -1, -1, -1};
-  Bool    bLeftAvai         = false;
-  Int     iPosLeftAbove[2]  = {-1, -1};
-
-#if H3D_NBDV
-  acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 
-#endif //H3D_NBDV
-
-#if MTK_MDIVRP_C0138
-  Bool bDVAvail = true;
-#endif
-
-#if H3D_NBDV
-  DisInfo cDisInfo;
-  cDisInfo.iN = 0;
-  if(!bNoPdmMerge)
-  {
-    getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true
-#if MERL_VSP_C0152
-            , true
-#endif
-);
-  }
-  if(cDisInfo.iN==0)
-  {
-    cDisInfo.iN = 1;
-    cDisInfo.m_acMvCand[0].setHor(0);
-    cDisInfo.m_acMvCand[0].setVer(0);
-    cDisInfo.m_aVIdxCan[0] = 0;
-#if MTK_MDIVRP_C0138
-    bDVAvail = false;
-#endif
-  }
-#if FIX_TEXTURE_MERGING_CANDIDATE_VSP_C0137_C0152
-#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
-  if( m_pcSlice->getIsDepth())
-  {
-    UInt uiPartIdxCenter;
-    xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter );    
-    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
-    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
-    {
-      abCandIsInter[iCount] = true;      
-      puhInterDirNeighbours[iCount] = pcTextureCU->getInterDir( uiPartIdxCenter );
-      if( ( puhInterDirNeighbours[iCount] & 1 ) == 1 )
-      {
-        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
-        TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
-        const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-        cMvPred+=cAdd;
-        cMvPred>>=2;
-        clipMv(cMvPred);
-        pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx());
-      }
-      if ( getSlice()->isInterB() )
-      {
-        if( ( puhInterDirNeighbours[iCount] & 2 ) == 2 )
-        {
-          pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
-          TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
-          const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-          cMvPred+=cAdd;
-          cMvPred>>=2;
-          clipMv(cMvPred);
-          pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx());
-        }
-      }
-#if FIX_TEXTURE_MERGING_CANDIDATE_VSP_C0137_C0152
-      xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
-#endif
-      if ( mrgCandIdx == iCount )
-      {
-        return;
-      }
-      iCount ++;
-    }
-  }
-#endif
-#endif
+
   Int iPdmDir[2] = {0, 0};
 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
@@ -3996,5 +3950,5 @@
 #endif
 #if H3D_IVMP
-    Bool bRemoveSpa = false; //prunign to inter-view candidates
+    Bool bRemoveSpa = false; //pruning to inter-view candidates
     Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
     for(; iCnloop >= 0; iCnloop --)
@@ -7956,5 +7910,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Bool
 TComDataCU::getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv )
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 295)
@@ -49,5 +49,5 @@
 #include "TComPattern.h"
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #include "TComYuv.h"
 #endif
@@ -210,5 +210,5 @@
   Int           m_numSucIPCM;         ///< the number of succesive IPCM blocks associated with the current log2CUSize
   Bool          m_lastCUSucIPCMFlag;  ///< True indicates that the last CU is IPCM and shares the same root as the current CU.  
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Bool*         m_pbResPredAvailable; ///< array of residual prediction available flags
   Bool*         m_pbResPredFlag;      ///< array of residual prediction flags
@@ -560,5 +560,5 @@
   Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
 #endif //  H3D_IVMP 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Bool*         getResPredAvail         ()                        { return m_pbResPredAvailable;        }
   Bool          getResPredAvail         ( UInt uiIdx )            { return m_pbResPredAvailable[uiIdx]; }
@@ -573,5 +573,5 @@
   Void          setResPredIndicator     ( Bool bAv, Bool bRP )    { m_pbResPredAvailable[0] = bAv; m_pbResPredFlag[0] = bRP; }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Bool          getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv = 0 );
 #endif
@@ -699,5 +699,5 @@
   UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   UInt          getCtxResPredFlag               ( UInt   uiAbsPartIdx                                 );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 295)
@@ -80,5 +80,5 @@
 
   UInt      getPdm  ()                            { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getPredDepthMapGeneration(); } return 0; }
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   UInt      getResPrd ()                          { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getMultiviewResPredMode  (); } return 0; }
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.cpp	(revision 295)
@@ -62,5 +62,5 @@
   m_pcOrgDepthMap     = NULL;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pcResidual        = NULL;
 #endif
@@ -165,5 +165,5 @@
   }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   if( m_pcResidual )
   {
@@ -222,5 +222,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TComPic::addResidualBuffer()
@@ -272,5 +272,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TComPic::removeResidualBuffer()
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPic.h	(revision 295)
@@ -86,5 +86,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
 #endif
@@ -173,5 +173,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComPicYuv*   getResidual()         { return  m_pcResidual; }
 #endif
@@ -253,5 +253,5 @@
   Void          addOrgDepthMapBuffer    ();
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void          addResidualBuffer       ();
 #endif
@@ -262,5 +262,5 @@
   Void          removeOrgDepthMapBuffer ();
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void          removeResidualBuffer    ();
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 295)
@@ -2860,5 +2860,4 @@
   ruiIntraTabIdx  = 0;
 #endif
-#if HHIQC_DMMFASTSEARCH_B0039
   TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
   TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
@@ -2949,19 +2948,4 @@
 #endif
   }
-#else
-  for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ )
-  {
-    calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRefBlkY, uiWidth,      iDC1, iDC2 );
-    assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred,    uiPredStride, iDC1, iDC2 );
-
-    UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
-
-    if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
-    {
-      uiBestDist   = uiActDist;
-      uiBestTabIdx = uiIdx;
-    }
-  }
-#endif
 
   cPredYuv.destroy();
@@ -3067,5 +3051,5 @@
   delete pcContourWedge;
 }
-#endif
+#endif // HHI_DMM_PRED_TEX
 
 #if HHI_DMM_WEDGE_INTRA
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp	(revision 295)
@@ -44,5 +44,5 @@
 
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 
 
@@ -743,4 +743,4 @@
 
 
-#endif // HHI_INTER_VIEW_RESIDUAL_PRED
-
+#endif // H3D_IVRP
+
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComResidualGenerator.h	(revision 295)
@@ -50,5 +50,5 @@
 
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 
 class TComResidualGenerator
@@ -121,5 +121,5 @@
 #endif // __TCOM_RESIDUAL_GENERATOR__
 
-#endif // HHI_INTER_VIEW_RESIDUAL_PRED
+#endif // H3D_IVRP
 
 
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 295)
@@ -174,5 +174,5 @@
     g_aacWedgeRefLists.clear();
   }
-#if HHIQC_DMMFASTSEARCH_B0039
+
   if ( !g_aacWedgeNodeLists.empty() )
   {
@@ -183,5 +183,5 @@
     g_aacWedgeNodeLists.clear();
   }
-#endif
+
 #endif
 }
@@ -859,8 +859,6 @@
 std::vector< std::vector<TComWedgeRef> > g_aacWedgeRefLists;
 
-#if HHIQC_DMMFASTSEARCH_B0039
 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
 std::vector< std::vector< TComWedgeNode> >      g_aacWedgeNodeLists;
-#endif
 
 Void initWedgeLists()
@@ -875,5 +873,4 @@
     g_aacWedgeRefLists.push_back( acWedgeRefList );
 
-#if HHIQC_DMMFASTSEARCH_B0039
     // create WedgeNodeList
     std::vector<TComWedgeNode> acWedgeNodeList;
@@ -936,5 +933,5 @@
     }
     g_aacWedgeNodeLists.push_back( acWedgeNodeList );
-#endif
+
   }
   return;
@@ -974,14 +971,9 @@
       for( Int iL = 0; iL < uiBlockSize; iL++ )
       {
-#if HHIQC_DMMFASTSEARCH_B0039
         cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) );
-#else
-        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes );
-#endif
         addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
       }
     }
   }
-#if HHIQC_DMMFASTSEARCH_B0039
   UInt uiThrSz = DMM3_SIMPLIFY_TR;
 
@@ -1001,5 +993,4 @@
   }
   g_aauiWdgLstM3.push_back(auiWdgListSz);
-#endif
 }
 
@@ -1037,7 +1028,5 @@
   if( bValid )
   {
-#if HHIQC_DMMFASTSEARCH_B0039
-  cWedgelet.findClosetAngle();
-#endif
+    cWedgelet.findClosetAngle();
     racWedgeList.push_back( cWedgelet );
     TComWedgeRef cWedgeRef;
@@ -1046,5 +1035,5 @@
   }
 }
-#endif
+#endif //HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
 
 //! \}
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRom.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComRom.h	(revision 295)
@@ -188,5 +188,5 @@
 extern       std::vector< std::vector<TComWedgeRef> >  g_aacWedgeRefLists;
 
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
 extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
 extern       std::vector< std::vector<TComWedgeNode> >       g_aacWedgeNodeLists;
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 295)
@@ -54,5 +54,5 @@
 class TComDepthMapGenerator;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 class TComResidualGenerator;
 #endif
@@ -389,5 +389,5 @@
   UInt  m_uiMultiviewMvPredMode;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   UInt  m_uiMultiviewResPredMode;
 #endif
@@ -396,5 +396,5 @@
   TComDepthMapGenerator* m_pcDepthMapGenerator;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComResidualGenerator* m_pcResidualGenerator;
 #endif
@@ -639,5 +639,5 @@
   Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void  setMultiviewResPredMode  ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; }
 #endif
@@ -653,5 +653,5 @@
   UInt  getMultiviewMvPredMode   ()          { return m_uiMultiviewMvPredMode;    }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   UInt  getMultiviewResPredMode  ()          { return m_uiMultiviewResPredMode;   }
 #endif
@@ -661,5 +661,5 @@
   TComDepthMapGenerator*  getDepthMapGenerator()                                              { return m_pcDepthMapGenerator; }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void                    setResidualGenerator( TComResidualGenerator* pcResidualGenerator )  { m_pcResidualGenerator = pcResidualGenerator; }
   TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComWedgelet.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 295)
@@ -52,5 +52,5 @@
                                                             m_uhOri    ( 0 ),
                                                             m_eWedgeRes( FULL_PEL )
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
                                                             , m_bIsCoarse( false )
 #endif
@@ -65,5 +65,5 @@
                                                             m_uhOri    ( rcWedge.m_uhOri     ),
                                                             m_eWedgeRes( rcWedge.m_eWedgeRes ),
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
                                                             m_bIsCoarse( rcWedge.m_bIsCoarse ),
                                                             m_uiAng    ( rcWedge.m_uiAng     ),
@@ -101,5 +101,5 @@
 }
 
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
 Void TComWedgelet::findClosetAngle()
 {
@@ -142,5 +142,5 @@
   m_uhOri     = uhOri;
   m_eWedgeRes = eWedgeRes;
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
   m_bIsCoarse = bIsCoarse;
 #endif
@@ -687,5 +687,5 @@
   case( 2 ): { for( UInt iX = uiTempBlockSize-1; iX > uhXs;            iX-- ) { UInt iY = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY--; } } } break;
   case( 3 ): { for( UInt iY = uiTempBlockSize-1; iY > uhYs;            iY-- ) { UInt iX = 0;                 while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } } break;
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
   case( 4 ): 
     { 
@@ -721,5 +721,5 @@
       case( 2 ): { uiOffX = 1; uiOffY = 1; } break;
       case( 3 ): { uiOffX = 0; uiOffY = 1; } break;
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
       case( 4 ): 
         { 
@@ -805,5 +805,5 @@
 }
 
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
 TComWedgeNode::TComWedgeNode()
 {
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComWedgelet.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComWedgelet.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComWedgelet.h	(revision 295)
@@ -50,5 +50,5 @@
 };
 
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
 #define NUM_WEDGE_REFINES 8
 #define NO_IDX MAX_UINT
@@ -67,5 +67,5 @@
   UChar           m_uhOri;                      // orientation index
   WedgeResolution m_eWedgeRes;                  // start/end pos resolution
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
   Bool            m_bIsCoarse; 
   UInt            m_uiAng;
@@ -99,5 +99,5 @@
   UChar           getEndY    () { return m_uhYe; }
   UChar           getOri     () { return m_uhOri; }
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
   Bool            getIsCoarse() { return m_bIsCoarse; }
   UInt            getAng     () { return m_uiAng; }
@@ -153,5 +153,5 @@
 typedef std::vector<TComWedgeRef> WedgeRefList;
 
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
 // ====================================================================================================================
 // Class definition TComWedgeNode
Index: branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 295)
@@ -56,10 +56,10 @@
 #define HHI_DMM_WEDGE_INTRA               1   // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)
 #define HHI_DMM_PRED_TEX                  1   // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )
+                                              // HHIQC_DMMFASTSEARCH_B0039, fast Wedgelet search for DMM modes 1 and 3
+
 #define LGE_EDGE_INTRA_A0070              1   // JCT3V-A0070
 
-#define HHIQC_DMMFASTSEARCH_B0039         1   // JCT3V-B0039: fast Wedgelet search for DMM modes 1 and 3 // --> weg 
-
 #define HHI_DMM_DELTADC_Q1_C0034          1   // JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values
-#if HHIQC_DMMFASTSEARCH_B0039 && HHI_DMM_PRED_TEX
+#if ( HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA ) && HHI_DMM_PRED_TEX
 #define LGE_DMM3_SIMP_C0044               1
 #endif
@@ -86,14 +86,15 @@
                                               // 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
+                                              // MTK_INTERVIEW_MERGE_A0049     , second part
 #define QC_AMVP_MRG_UNIFY_IVCAN_C0051     1
-#define QC_C0051_FIXED_BY_MTK             1   // bug fix for C0051 implementation
+#define QC_C0051_FIXED_BY_MTK             1   // Bug fix for C0051 implementation
 
 
 ///// ***** INTERVIEW RESIDUAL PREDICTION *********
-#define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
+#define H3D_IVRP                          1   // Inter-view residual prediction
+                                              // HHI_INTER_VIEW_RESIDUAL_PRED
                                               // QC_SIMPLIFIEDIVRP_M24938 
-#if HHI_INTER_VIEW_RESIDUAL_PRED       
-#define LG_RESTRICTEDRESPRED_M24766       1   // restricted inter-view residual prediction
+#if H3D_IVRP       
+#define LG_RESTRICTEDRESPRED_M24766       1   // Restricted inter-view residual prediction
 #define FIX_LG_RESTRICTEDRESPRED_M24766   1
 #else                                  
@@ -101,6 +102,6 @@
 #endif
 
-#define MTK_MDIVRP_C0138                  1   // mode-dependent inter-view residual prediction
-#define MTK_C0138_FIXED                   1   // fix for IBP coding structure in view direction (not CTC)
+#define MTK_MDIVRP_C0138                  1   // Mode-dependent inter-view residual prediction
+#define MTK_C0138_FIXED                   1   // Fix for IBP coding structure in view direction (not CTC)
 
 
@@ -174,5 +175,4 @@
 ///// ***** VSP *********
 #define MERL_VSP_C0152                    1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools
-#define FIX_TEXTURE_MERGING_CANDIDATE_VSP_C0137_C0152 1 
 #if MERL_VSP_C0152
 
@@ -241,5 +241,5 @@
 
 
-#if HHIQC_DMMFASTSEARCH_B0039
+#if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
 #define DMM3_SIMPLIFY_TR                  1
 #endif
@@ -257,5 +257,5 @@
 ///// ***** HM 6.1 *********
 
-//// REMOVED HM 6.1 Guard macros 
+//// REMOVED HM 6.1 Guard macros (corresponding to macros removed in HM 6.3.1)
 /*
 #define SKIPFRAME_BUGFIX                  1 ///< bug fix to enable skipFrame at decoder
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 295)
@@ -1492,5 +1492,5 @@
       pcSPS->setPredDepthMapGeneration( 0, false );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     pcSPS->setMultiviewResPredMode  ( 0 );
 #endif
@@ -1507,5 +1507,5 @@
         pcSPS->setPredDepthMapGeneration( uiCode, true );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       pcSPS->setMultiviewResPredMode  ( 0 );
 #endif
@@ -1537,5 +1537,5 @@
         UInt uiMultiviewMvPredMode = 0;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       UInt uiMultiviewResPredMode = 0;
 #endif
@@ -1552,5 +1552,5 @@
           READ_UVLC( uiMultiviewMvPredMode, "multi_view_mv_pred_mode" );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
           READ_FLAG( uiMultiviewResPredMode, "multi_view_residual_pred_mode" );
 #endif
@@ -1562,5 +1562,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
 #endif
@@ -2381,5 +2381,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TDecCavlc::parseResPredFlag( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth )
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 295)
@@ -141,5 +141,5 @@
   Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
   Void parseMergeIndex      ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void parseResPredFlag     ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 295)
@@ -54,5 +54,5 @@
   m_ppcYuvResi = NULL;
   m_ppcYuvReco = NULL;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_ppcYuvResPred = NULL;
 #endif
@@ -82,5 +82,5 @@
   m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1];
   m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_ppcYuvResPred = new TComYuv*   [m_uiMaxDepth-1];
 #endif
@@ -96,5 +96,5 @@
     m_ppcYuvResi[ui] = new TComYuv;    m_ppcYuvResi[ui]->create( uiWidth, uiHeight );
     m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
 #endif
@@ -120,5 +120,5 @@
     m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL;
     m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
 #endif
@@ -128,5 +128,5 @@
   delete [] m_ppcYuvResi; m_ppcYuvResi = NULL;
   delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
 #endif
@@ -409,5 +409,5 @@
     }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     m_pcEntropyDecoder->decodeResPredFlag( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 );
 #endif
@@ -460,5 +460,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
   if( !pcCU->isIntra( uiAbsPartIdx ) )
   {
@@ -691,5 +691,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
   if( pcCU->getResPredFlag( 0 ) )
   {
@@ -721,5 +721,5 @@
   else
   {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #if MTK_MDIVRP_C0138
     if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.h	(revision 295)
@@ -61,5 +61,5 @@
   TComYuv**           m_ppcYuvResi;       ///< array of residual buffer
   TComYuv**           m_ppcYuvReco;       ///< array of prediction & reconstruction buffer
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComYuv**           m_ppcYuvResPred;    ///< residual prediction buffer
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 295)
@@ -108,5 +108,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
 Void
 TDecEntropy::decodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h	(revision 295)
@@ -103,5 +103,5 @@
   virtual Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0;
   virtual Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   virtual Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
@@ -198,5 +198,5 @@
   Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
   Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
   Void decodeResPredFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.cpp	(revision 295)
@@ -93,5 +93,5 @@
                    ,TComDepthMapGenerator*  pcDepthMapGenerator
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   ,TComResidualGenerator*  pcResidualGenerator
 #endif
@@ -109,5 +109,5 @@
   m_pcDepthMapGenerator   = pcDepthMapGenerator;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pcResidualGenerator   = pcResidualGenerator;
 #endif
@@ -298,5 +298,5 @@
       m_pcDepthMapGenerator->predictDepthMap  ( rpcPic );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_pcResidualGenerator->initViewComponent( rpcPic );
 #endif
@@ -331,5 +331,5 @@
   else
   {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     // set residual picture
     m_pcResidualGenerator->setRecResidualPic( rpcPic );
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.h	(revision 295)
@@ -90,5 +90,5 @@
   TComDepthMapGenerator*  m_pcDepthMapGenerator;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComResidualGenerator*  m_pcResidualGenerator;
 #endif
@@ -118,5 +118,5 @@
                  ,TComDepthMapGenerator*  pcDepthMapGenerator
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                 ,TComResidualGenerator*  pcResidualGenerator
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 295)
@@ -62,5 +62,5 @@
 , m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 , m_cResPredFlagSCModel       ( 1,             1,               NUM_RES_PRED_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -159,5 +159,5 @@
   m_cCUMergeFlagExtSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT );
   m_cCUMergeIdxExtSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResPredFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_RES_PRED_FLAG );
 #endif
@@ -246,5 +246,5 @@
   m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT );
   m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
 #endif
@@ -670,5 +670,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TDecSbac::parseResPredFlag( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth )
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 295)
@@ -173,5 +173,5 @@
   Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
   Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
@@ -216,5 +216,5 @@
   ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
   ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   ContextModel3DBuffer m_cResPredFlagSCModel;
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp	(revision 295)
@@ -398,5 +398,5 @@
   m_cDepthMapGenerator.destroy();
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResidualGenerator.destroy();
 #endif
@@ -415,5 +415,5 @@
                     , &m_cDepthMapGenerator
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                     , &m_cResidualGenerator
 #endif
@@ -429,5 +429,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
 #endif
@@ -465,5 +465,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TDecTop::deleteExtraPicBuffers( Int iPoc )
@@ -855,5 +855,5 @@
     }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.h	(revision 295)
@@ -213,5 +213,5 @@
   TComDepthMapGenerator   m_cDepthMapGenerator;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComResidualGenerator   m_cResidualGenerator;
 #endif
@@ -249,5 +249,5 @@
   Void      xCopyVPS( TComVPS* pVPSV0);
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void      deleteExtraPicBuffers   ( Int iPoc );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 295)
@@ -694,5 +694,5 @@
         WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
         WRITE_FLAG  ( pcSPS->getMultiviewResPredMode(), "multi_view_residual_pred_mode" );
 #endif
@@ -1293,5 +1293,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TEncCavlc::codeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h	(revision 295)
@@ -157,5 +157,5 @@
   Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 295)
@@ -332,5 +332,5 @@
   Double      m_dMultiviewMvRegLambdaScale;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   UInt        m_uiMultiviewResPredMode;
 #endif
@@ -413,5 +413,5 @@
   Void      setMultiviewMvRegLambdaScale    ( Double d)      { m_dMultiviewMvRegLambdaScale = d; }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void      setMultiviewResPredMode         ( UInt  u )      { m_uiMultiviewResPredMode     = u; }
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 295)
@@ -72,5 +72,5 @@
   m_ppcRecoYuvTemp = new TComYuv*[m_uhTotalDepth-1];
   m_ppcOrigYuv     = new TComYuv*[m_uhTotalDepth-1];
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_ppcResPredTmp  = new TComYuv*[m_uhTotalDepth-1];
 #endif
@@ -101,5 +101,5 @@
     
     m_ppcOrigYuv    [i] = new TComYuv; m_ppcOrigYuv    [i]->create(uiWidth, uiHeight);
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_ppcResPredTmp [i] = new TComYuv; m_ppcResPredTmp [i]->create(uiWidth, uiHeight);
 #endif
@@ -166,5 +166,5 @@
       m_ppcOrigYuv[i]->destroy();     delete m_ppcOrigYuv[i];     m_ppcOrigYuv[i] = NULL;
     }
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     if(m_ppcResPredTmp[i])
     {
@@ -219,5 +219,5 @@
     m_ppcOrigYuv = NULL;
   }
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   if(m_ppcResPredTmp)
   {
@@ -601,5 +601,5 @@
       if( rpcBestCU->getSlice()->getSliceType() != I_SLICE )
       {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #if MTK_MDIVRP_C0138
         Bool  bResPredAvailable   = false;
@@ -627,5 +627,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
           rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -658,5 +658,5 @@
           if ( !bEarlySkip )
           {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -679,5 +679,5 @@
          }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
         } // uiResPrdId
 #endif
@@ -738,5 +738,5 @@
       if( rpcBestCU->getSlice()->getSliceType() != I_SLICE )
       {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #if MTK_MDIVRP_C0138
         Bool  bResPredAvailable   = false;
@@ -776,5 +776,5 @@
                 {
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -799,5 +799,5 @@
               if(doNotBlockPu)
               {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -826,5 +826,5 @@
               if(doNotBlockPu)
               {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -872,5 +872,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -891,5 +891,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -921,5 +921,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -940,5 +940,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -972,5 +972,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -991,5 +991,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1017,5 +1017,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1036,5 +1036,5 @@
                 if(doNotBlockPu)
                 {
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1056,5 +1056,5 @@
 
 #else
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1065,5 +1065,5 @@
 #endif
             rpcTempCU->initEstData( uiDepth, iQP );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1074,5 +1074,5 @@
 #endif
             rpcTempCU->initEstData( uiDepth, iQP );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1083,5 +1083,5 @@
 #endif
             rpcTempCU->initEstData( uiDepth, iQP );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
 #endif
@@ -1099,5 +1099,5 @@
          }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
         } // uiResPrdId
 #endif
@@ -1805,5 +1805,5 @@
         );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
 #endif
@@ -1840,5 +1840,5 @@
         );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     if( !pcCU->isIntra( uiAbsPartIdx ) )
     {
@@ -1880,5 +1880,5 @@
   Int numValidMergeCand = 0;
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
   Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
   Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
@@ -1977,5 +1977,5 @@
           rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #if MTK_MDIVRP_C0138
           rpcTempCU->setResPredAvailSubParts(bResPredAvail, 0, 0, uhDepth);
@@ -2055,5 +2055,5 @@
             m_ppcResiYuvBest[uhDepth],
             m_ppcRecoYuvTemp[uhDepth],
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                                                      m_ppcResPredTmp [uhDepth],
 #endif
@@ -2108,5 +2108,5 @@
   rpcTempCU->setDepthSubParts( uhDepth, 0 );
   
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
   Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
@@ -2115,5 +2115,5 @@
   rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
   rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
@@ -2121,5 +2121,5 @@
   rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
   
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #if !LG_RESTRICTEDRESPRED_M24766
   if( rpcTempCU->getResPredFlag( 0 ) )
@@ -2149,5 +2149,5 @@
 #endif
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 #if !LG_RESTRICTEDRESPRED_M24766
   if( rpcTempCU->getResPredFlag( 0 ) )
@@ -2172,5 +2172,5 @@
                                              m_ppcResiYuvBest[uhDepth],
                                              m_ppcRecoYuvTemp[uhDepth],
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                                              m_ppcResPredTmp [uhDepth],
 #endif
@@ -2183,5 +2183,5 @@
                                              m_ppcResiYuvBest[uhDepth],
                                              m_ppcRecoYuvTemp[uhDepth],
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                                              m_ppcResPredTmp [uhDepth],
 #endif
@@ -2855,5 +2855,5 @@
                                                m_ppcResiYuvBest[uhDepth],
                                                m_ppcRecoYuvTemp[uhDepth],
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
                                                m_ppcResPredTmp [uhDepth],
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.h	(revision 295)
@@ -78,5 +78,5 @@
   TComYuv**               m_ppcRecoYuvTemp; ///< Temporary Reconstruction Yuv for each depth
   TComYuv**               m_ppcOrigYuv;     ///< Original Yuv for each depth
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComYuv**               m_ppcResPredTmp;  ///< Temporary residual prediction for each depth
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 295)
@@ -455,5 +455,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
 Void
 TEncEntropy::encodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD )
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h	(revision 295)
@@ -114,5 +114,5 @@
   virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   virtual Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
@@ -250,5 +250,5 @@
   Void encodeMergeFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx );
   Void encodeMergeIndex   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
   Void encodeResPredFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 295)
@@ -78,5 +78,5 @@
   m_pcDepthMapGenerator = NULL;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pcResidualGenerator = NULL;
 #endif
@@ -131,5 +131,5 @@
   m_pcDepthMapGenerator  = pcTEncTop->getDepthMapGenerator();
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_pcResidualGenerator  = pcTEncTop->getResidualGenerator();
 #endif
@@ -736,5 +736,5 @@
       m_pcDepthMapGenerator->covertOrgDepthMap( pcPic );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_pcResidualGenerator->initViewComponent( pcPic );
 #endif
@@ -800,5 +800,5 @@
       pcSlice = pcPic->getSlice(0);
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       // set residual picture
       m_pcResidualGenerator->setRecResidualPic( pcPic );
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncGOP.h	(revision 295)
@@ -97,5 +97,5 @@
   TComDepthMapGenerator*  m_pcDepthMapGenerator;
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComResidualGenerator*  m_pcResidualGenerator;
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 295)
@@ -70,5 +70,5 @@
 , m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 , m_cResPredFlagSCModel       ( 1,             1,               NUM_RES_PRED_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -155,5 +155,5 @@
   m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
   m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
 #endif
@@ -241,5 +241,5 @@
       curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
       curCost += m_cCUMergeIdxExtSCModel.calcCost     ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT);
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       curCost += m_cResPredFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_RES_PRED_FLAG);
 #endif
@@ -308,5 +308,5 @@
   m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
   m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
 #endif
@@ -835,5 +835,5 @@
 }
 
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void
 TEncSbac::codeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSbac.h	(revision 295)
@@ -206,5 +206,5 @@
   Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
@@ -263,5 +263,5 @@
   ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
   ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   ContextModel3DBuffer m_cResPredFlagSCModel;
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 295)
@@ -4757,5 +4757,5 @@
  * \returns Void
  */
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
 Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, TComYuv*& rpcYuvResPrd, Bool bSkipRes )
 #else
@@ -4791,5 +4791,5 @@
     }
 #else
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     // add residual prediction
     if( pcCU->getResPredFlag( 0 ) )
@@ -4853,5 +4853,5 @@
       );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
 #endif
@@ -4928,5 +4928,5 @@
   rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     // subtract residual prediction
     if( pcCU->getResPredFlag( 0 ) )
@@ -4943,5 +4943,5 @@
 #else
   rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth );
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   // add residual prediction
   if( pcCU->getResPredFlag( 0 ) )
@@ -5134,5 +5134,5 @@
 #endif
   }
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
   // add residual prediction
   if( pcCU->getResPredFlag( 0 ) )
@@ -6170,5 +6170,5 @@
       );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
 #endif
@@ -6197,5 +6197,5 @@
       );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED && !MTK_MDIVRP_C0138
+#if H3D_IVRP && !MTK_MDIVRP_C0138
     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
 #endif
@@ -6792,10 +6792,6 @@
   WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
   Dist iDist = RDO_DIST_MAX;
-#if HHIQC_DMMFASTSEARCH_B0039
   WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
   xSearchWedgeFullMinDistFast( pcCU, uiAbsPtIdx, pacWedgeNodeList, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist );
-#else
-  xSearchWedgeFullMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist );
-#endif
 
   TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
@@ -6908,5 +6904,4 @@
 }
 
-#if HHIQC_DMMFASTSEARCH_B0039
 Void TEncSearch::xSearchWedgeFullMinDistFast( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeNodeList* pacWedgeNodeList, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Dist& riDist )
 {
@@ -7027,5 +7022,4 @@
   return;
 }
-#endif
 
 Void TEncSearch::xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )
@@ -7118,5 +7112,6 @@
   return;
 }
-#endif
+#endif //  HHI_DMM_WEDGE_INTRA
+
 #if HHI_DMM_PRED_TEX
 Void TEncSearch::findWedgeTexMinDist( TComDataCU*  pcCU, 
@@ -7171,5 +7166,5 @@
   delete pcContourWedge;
 }
-#endif
+#endif // HHI_DMM_PRED_TEX
 
 #if LGE_EDGE_INTRA_A0070
@@ -8271,5 +8266,5 @@
     iDeltaDC1 = iFullDeltaDC1;
   }
-#endif
+#endif // HHI_VSO
 
   xDeltaDCQuantScaleDown( pcCU, iDeltaDC0 );
@@ -8279,6 +8274,6 @@
   pcCU->setEdgeDeltaDC1( uiAbsPartIdx, iDeltaDC1 );
 }
-#endif
-#endif
+#endif // LGE_EDGE_INTRA_DELTA_DC
+#endif // LGE_EDGE_INTRA_A0070
   
 #if RWTH_SDC_DLT_B0036
@@ -8313,5 +8308,5 @@
     pMask  += uiMaskStride*subSamplePix;
   }
-#else
+#else //HS_REFERENCE_SUBSAMPLE_C0154
   for (Int y=0; y<uiSize; y++)
   {
@@ -8328,5 +8323,5 @@
     pMask  += uiMaskStride;
   }
-#endif
+#endif // HS_REFERENCE_SUBSAMPLE_C0154
   // compute mean for each segment
   for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )
@@ -8338,5 +8333,5 @@
   }
 }
-#endif
+#endif // RWTH_SDC_DLT_B0036
 
 //! \}
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 295)
@@ -208,5 +208,5 @@
                                 );
   
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   /// encode residual and compute rd-cost for inter mode
   Void encodeResAndCalcRdInterCU( TComDataCU* pcCU,
@@ -401,5 +401,5 @@
                                     UInt&          ruiTabIdx, 
                                     Dist&          riDist );
-#if HHIQC_DMMFASTSEARCH_B0039
+
   Void xSearchWedgeFullMinDistFast( TComDataCU*    pcCU, 
                                     UInt           uiAbsPtIdx, 
@@ -412,5 +412,4 @@
                                     UInt&          ruiTabIdx, 
                                     Dist&          riDist );
-#endif
   Void xSearchWedgePredDirMinDist ( TComDataCU*    pcCU, 
                                     UInt           uiAbsPtIdx, 
@@ -422,5 +421,5 @@
                                     UInt&          ruiTabIdx, 
                                     Int&           riWedgeDeltaEnd );
-#endif
+#endif // HHI_DMM_WEDGE_INTRA
 #if HHI_DMM_PRED_TEX
   Void findWedgeTexMinDist        ( TComDataCU*    pcCU, 
@@ -451,5 +450,5 @@
                                     Bool           bAboveAvail,
                                     Bool           bLeftAvail );
-#endif
+#endif // HHI_DMM_PRED_TEX
 
   // -------------------------------------------------------------------------------------------------------------------
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 295)
@@ -120,5 +120,5 @@
   m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResidualGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
 #endif
@@ -251,5 +251,5 @@
   m_cDepthMapGenerator. destroy();
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResidualGenerator. destroy();
 #endif
@@ -347,5 +347,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
 #endif
@@ -473,5 +473,5 @@
 
 
-#if HHI_INTERVIEW_SKIP || H3D_IVMP || HHI_INTER_VIEW_RESIDUAL_PRED
+#if HHI_INTERVIEW_SKIP || H3D_IVMP || H3D_IVRP
 Void
 TEncTop::deleteExtraPicBuffers( Int iPoc )
@@ -494,5 +494,5 @@
     pcPic->removeOrgDepthMapBuffer();
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     pcPic->removeResidualBuffer   ();
 #endif
@@ -716,5 +716,5 @@
     m_cSPS.setPredDepthMapGeneration( m_viewId, true );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_cSPS.setMultiviewResPredMode  ( 0 );
 #endif
@@ -736,5 +736,5 @@
 #endif
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_cSPS.setMultiviewResPredMode  ( m_uiMultiviewResPredMode );
 #endif
@@ -745,5 +745,5 @@
       m_cSPS.setPredDepthMapGeneration( m_viewId, false );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_cSPS.setMultiviewResPredMode  ( 0 );
 #endif
Index: branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.h	(revision 294)
+++ branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncTop.h	(revision 295)
@@ -103,5 +103,5 @@
   TComDepthMapGenerator   m_cDepthMapGenerator;           ///< depth map generator
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComResidualGenerator   m_cResidualGenerator;           ///< generator for residual pictures
 #endif
@@ -173,5 +173,5 @@
     }
   }
-#if HHI_INTERVIEW_SKIP || H3D_IVMP || HHI_INTER_VIEW_RESIDUAL_PRED
+#if HHI_INTERVIEW_SKIP || H3D_IVMP || H3D_IVRP
   Void      deleteExtraPicBuffers   ( Int iPoc );
 #endif
@@ -234,5 +234,5 @@
   TComDepthMapGenerator*  getDepthMapGenerator  () { return  &m_cDepthMapGenerator;   }
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
   TComResidualGenerator*  getResidualGenerator  () { return  &m_cResidualGenerator;   }
 #endif
