Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/ContextTables.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/ContextTables.h	(revision 325)
@@ -434,9 +434,5 @@
 
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
-#if FIX_DMM_CTX_INIT_C0034
 static const UChar
-#else
-static const Short
-#endif
 INIT_DMM_FLAG[3][NUM_DMM_FLAG_CTX] =
 {
@@ -452,9 +448,5 @@
 };
 
-#if FIX_DMM_CTX_INIT_C0034
 static const UChar
-#else
-static const Short
-#endif
 INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] =
 {
@@ -470,9 +462,5 @@
 };
 
-#if FIX_DMM_CTX_INIT_C0034
 static const UChar
-#else
-static const Short
-#endif
 INIT_DMM_DATA[3][NUM_DMM_DATA_CTX] = 
 {
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 325)
@@ -3165,5 +3165,5 @@
 }
 
-#if LG_RESTRICTEDRESPRED_M24766
+#if H3D_IVRP
 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU)
 {
@@ -3250,73 +3250,4 @@
 #endif
 
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Int TComDataCU::getResiPredMode(UInt uiPartAddr)
-{
-  Int iAddResiShift = -1;
-
-  for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
-  {
-    RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
-    Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
-    if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx))
-      iAddResiShift++;
-  }
-
-  return iAddResiShift;
-}
-
-Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex)
-{
-  UInt uiPartSize = getPartitionSize(uiAbsPartIndex);
-  UInt uiPartAddr;
-  Int iWidth, iHeight;
-  Int iAddResiShift;
-
-  if(uiPartSize == SIZE_2Nx2N)
-  {
-    iAddResiShift = getResiPredMode(uiAbsPartIndex);
-    for(UInt i = 0; i < 4; i++)
-      iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
-    return;
-  }
-
-  if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD)
-  {
-    for(UInt i = 0; i < 2; i++)
-    {
-      getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
-      uiPartAddr += uiAbsPartIndex;
-      iAddResiShift = getResiPredMode(uiPartAddr);
-      iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
-    }
-    return;
-  }
-
-  if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N)
-  {
-    for(UInt i = 0; i < 2; i++)
-    {
-      getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
-      uiPartAddr += uiAbsPartIndex;
-      iAddResiShift = getResiPredMode(uiPartAddr);
-      iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
-    }
-    return;
-  }
-
-  if(uiPartSize == SIZE_NxN)
-  {
-    for(UInt i = 0; i < 4; i++)
-    {
-      getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
-      uiPartAddr += uiAbsPartIndex;
-      iAddResiShift = getResiPredMode(uiPartAddr);
-      iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
-    }
-  }
-
-}
-#endif
-
 Void TComDataCU::getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField )
 {
@@ -3653,5 +3584,5 @@
 #endif //H3D_NBDV
 
-#if MTK_MDIVRP_C0138
+#if H3D_IVRP
   Bool bDVAvail = true;
 #endif
@@ -3693,5 +3624,5 @@
     cDisInfo.m_acMvCand[0].setVer(0);
     cDisInfo.m_aVIdxCan[0] = 0;
-#if MTK_MDIVRP_C0138
+#if H3D_IVRP
     bDVAvail = false;
 #endif
@@ -3748,10 +3679,6 @@
 
   Int iPdmDir[2] = {0, 0};
-#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, iPdmDir );
-#endif
 #else // H3D_NBDV
   Int iPdmDir[2] = {0, 0};
@@ -3760,5 +3687,5 @@
   iPdmDir[1] = iPdmInterDir; 
 #endif // H3D_NBDV
-#if MTK_MDIVRP_C0138
+#if H3D_IVRP
   if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail)
   {
@@ -5650,23 +5577,13 @@
         cDisInfo.m_aVIdxCan[0] = 0;
       }
-#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
       Int paiPdmRefIdx[4] = {-1, -1, -1, -1};
       Int iPdmDir[4]      = {-1, -1, -1, -1};
-#if QC_C0051_FIXED_BY_MTK
       TComMv cPdmMvPred[4];
-#else
-      TComMv cPdmMvPred[2];
-#endif
       cPdmMvPred[0].m_bDvMcp = cPdmMvPred[1].m_bDvMcp = false; 
       if(getUnifiedMvPredCan(uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, cPdmMvPred, &cDisInfo, iPdmDir, false))
-#else // QC_AMVP_MRG_UNIFY_IVCAN_C0051
-      TComMv  cPdmMvPred;
-      if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
-#endif // QC_AMVP_MRG_UNIFY_IVCAN_C0051
 #else // H3D_NBDV
       if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
 #endif
 
-#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
       {
         clipMv( cPdmMvPred[0] );
@@ -5677,14 +5594,4 @@
         pInfo->m_acMvCand[0].set(0,0);
       }
-#else
-      {
-        clipMv( cPdmMvPred );
-        pInfo->m_acMvCand[0] = cPdmMvPred;
-      }
-      else
-      {
-        pInfo->m_acMvCand[0].set(0,0);
-      }
-#endif
     }
   }
@@ -7422,5 +7329,4 @@
 }
 #else //H3D_NBDV
-#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
 Bool
 TComDataCU::getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
@@ -7432,22 +7338,4 @@
   return false;
 }
-#else
-Int
-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, iPdm );
-}
-Bool
-TComDataCU::getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge )
-{
-  TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
-  ROFRS( pcDepthMapGenerator, false );
-  if (pDInfo->iN > 0 && pcDepthMapGenerator->getDisCanPdmMvPred(this, uiPartIdx, eRefPicList, iRefIdx, rcMv, pDInfo, bMerge )) //bug fix li
-    return true;
-  return false;
-}
-#endif
 #endif //H3D_NBDV
 
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.h	(revision 325)
@@ -535,10 +535,5 @@
   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 );
-#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, Int* iPdm );
-#endif //QC_AMVP_MRG_UNIFY_IVCAN_C0051
   Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
   Void          getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerg = false
@@ -576,12 +571,6 @@
   // member functions for accessing partition information
   // -------------------------------------------------------------------------------------------------------------------
-#if LG_RESTRICTEDRESPRED_M24766
+#if H3D_IVRP
   Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
-#else
-  Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
-#endif
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  Int           getResiPredMode(UInt uiPartAddr);
-  Void          getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex);
 #endif
   UChar         getNumPartInter       ();
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 325)
@@ -605,5 +605,4 @@
 
 #if H3D_IVMP
-#if QC_AMVP_MRG_UNIFY_IVCAN_C0051
 Bool
 TComDepthMapGenerator::getPdmCandidate(TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
@@ -636,9 +635,6 @@
   for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ )
   {
-#if MTK_C0138_FIXED
+
     UInt        uiBaseId    = uiBId;
-#else
-    UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
-#endif
     TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
     for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ )
@@ -785,326 +781,4 @@
   return false;
 }
-#else // QC_AMVP_MRG_UNIFY_IVCAN_C0051
-#if H3D_NBDV
-Int
-TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm )
-#else
-Int
-TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv )
-#endif 
-{
-  AOF  ( m_bCreated && m_bInit );
-
-#if !H3D_NBDV
-  ROFRS( m_bPDMAvailable, 0 );
-#endif
-
-  TComSlice*    pcSlice     = pcCU->getSlice ();
-  TComSPS*      pcSPS       = pcSlice->getSPS();
-  AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
-  Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
-  ROTRS( !bPdmMerge, 0 );
-
-  Bool abPdmAvailable[4] = {false, false, false, false};
-
-  Int iValid = 0;
-  Int iViewId = 0;
-  for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ )
-  {
-    UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
-    TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
-    for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ )
-    {
-      RefPicList  eRefPicListTest = RefPicList( iRefListId );
-      Int         iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ;
-      for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ )
-      { 
-        if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC() 
-          && pcBasePic->getViewId() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewId())
-        {
-          iValid=1;
-          iViewId = uiBaseId;
-          break;
-        }
-      }
-    }
-  }
-  if (iValid == 0)
-    return 0;
-
-  //--- get base CU/PU and check prediction mode ---
-  TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( iViewId );
-  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
-
-#if H3D_NBDV
-  Int  iCurrPosX, iCurrPosY;
-  UInt          uiPartAddr;
-  Int           iWidth;
-  Int           iHeight;
-
-  pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
-  pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
-  iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
-  iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
-
-  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) );
-  Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 
-  Int         iBaseCUAddr;
-  Int         iBaseAbsPartIdx;
-  pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
-#else
-  Int  iPrdDepth, iCurrPosX, iCurrPosY;
-  Bool bAvailable  = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY );
-  AOF( bAvailable );
-  TComPicYuv* pcBasePdm   = pcBasePic->getPredDepthMap();
-  Int         iDisparity  = xGetDisparityFromVirtDepth( iViewId, iPrdDepth );
-  Int         iShiftX     = m_uiSubSampExpX + 2;
-  Int         iAddX       = ( 1 << iShiftX ) >> 1;
-  Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) );
-  Int         iBasePosY   = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY                               );
-  Int         iBaseCUAddr;
-  Int         iBaseAbsPartIdx;
-  pcBaseRec->getCUAddrAndPartIdx( iBasePosX<< m_uiSubSampExpX , iBasePosY<< m_uiSubSampExpY , iBaseCUAddr, iBaseAbsPartIdx );
-#endif 
-
-  TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
-
-  if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTER || pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_SKIP )
-  {
-    for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ )
-    {
-      RefPicList  eBaseRefPicList = RefPicList( uiBaseRefListId );
-      TComMvField cBaseMvField;
-      pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
-      Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
-
-      if (iBaseRefIdx >= 0)
-      {
-        Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
-        if (iBaseRefPOC != pcSlice->getPOC())    
-        {
-          for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eBaseRefPicList ); iPdmRefIdx++)
-          {
-            if (iBaseRefPOC == pcSlice->getRefPOC(eBaseRefPicList, iPdmRefIdx))
-            {
-              abPdmAvailable[ uiBaseRefListId ] = true;
-              paiPdmRefIdx  [ uiBaseRefListId ] = iPdmRefIdx;
-              TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
-#if H3D_NBDV
-              cMv.m_bDvMcp = true;
-              cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor();
-              cMv.m_iDvMcpDispY = pDInfo->m_acMvCand[0].getVer();
-#endif //H3D_NBDV
-              pcCU->clipMv( cMv );
-              pacPdmMv      [ uiBaseRefListId ] = cMv;
-              break;
-            }
-          }
-        }
-      }
-    }
-  }
-  Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
-
-  iPdm[0] = iPdmInterDir;
-    for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
-    {
-      RefPicList  eRefPicList       = RefPicList( iRefListId );
-      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicList );
-      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
-      {
-        if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
-        {
-          abPdmAvailable[ iRefListId+2 ] = true;
-          paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
-#if H3D_NBDV
-          TComMv cMv = pDInfo->m_acMvCand[0]; 
-          cMv.setVer(0);
-#else
-          TComMv cMv(iDisparity, 0);
-#endif
-          pcCU->clipMv( cMv );
-          pacPdmMv      [ iRefListId + 2] = cMv;
-          break;
-        }
-      }
-    }
-    iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ;
-    iPdm[1] = iPdmInterDir;
-
-  return iPdmInterDir;
-}
-
-#if H3D_NBDV
-Bool
-TComDepthMapGenerator::getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge )
-{
-  rcMv.m_bDvMcp = false;
-  AOF  ( m_bCreated && m_bInit );
-  AOF  ( iRefIdx >= 0 );
-  AOF  ( pcCU );
-  TComSlice*    pcSlice     = pcCU->getSlice ();
-  TComSPS*      pcSPS       = pcSlice->getSPS();
-  AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
-  TComPic*      pcRefPic    = pcSlice->getRefPic( eRefPicList, iRefIdx );
-  UInt          uiRefViewId = pcRefPic->getSPS()->getViewId();
-  Int           iRefPoc     = pcRefPic->getPOC();
-  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
-  AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
-  AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
-  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
-  Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
-  Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
-  ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false );
-  ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false );
-  ROTRS(                  bMerge   && !bPdmMerge, false );
-  Int  iCurrPosX, iCurrPosY;
-  TComMv cDisMv;
-
-  if( bInterview )
-  {
-    rcMv = pDInfo->m_acMvCand[0]; 
-    rcMv.setVer(0);
-    return      true;
-  }
-  for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ )
-  {
-    UInt        uiBaseId    = uiBId; 
-
-    if (m_uiCurrViewId >1 && uiBaseId ==1 ) 
-      continue;
-
-    TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
-    TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
-    UInt          uiPartAddr;
-    Int           iWidth;
-    Int           iHeight;
-
-    pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
-    pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
-    iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
-    iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
-    Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) );
-    Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 ));  
-    Int         iBaseCUAddr;
-    Int         iBaseAbsPartIdx;
-    pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
-    TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
-    if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP )
-    {
-      continue;
-    }
-    for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ )
-    {
-      RefPicList  eBaseRefPicList = RefPicList( uiBaseRefListId );
-      TComMvField cBaseMvField;
-      pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
-      Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
-      Int         iBaseRefPoc     = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) );
-      if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc )
-      {
-        rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() );
-        // save disparity vector when a merge candidate for IVMP is set as DV-MCP
-        if( bMerge ) 
-        {
-          rcMv.m_bDvMcp = true;
-          rcMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 
-          rcMv.m_iDvMcpDispY = pDInfo->m_acMvCand[0].getVer();
-        }
-        else { // AMVP ?
-          rcMv.m_bDvMcp = false;
-        }
-        return true;
-      }
-    }
-  }
-  return false;
-}
-#else // H3D_NBDV
-Bool  
-TComDepthMapGenerator::getPdmMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge )
-{
-  AOF  ( m_bCreated && m_bInit );
-  AOF  ( iRefIdx >= 0 );
-  AOF  ( pcCU );
-  ROFRS( m_bPDMAvailable, false );
-
-  TComSlice*    pcSlice     = pcCU->getSlice ();
-  TComPic*      pcPic       = pcCU->getPic   ();
-  TComSPS*      pcSPS       = pcSlice->getSPS();
-  AOF  ( pcPic->getPredDepthMap() );
-  AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
-  
-  TComPic*      pcRefPic    = pcSlice->getRefPic( eRefPicList, iRefIdx );
-  UInt          uiRefViewId = pcRefPic->getSPS()->getViewId();
-  Int           iRefPoc     = pcRefPic->getPOC();
-  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
-  AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
-  AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
-
-  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
-  Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
-  Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
-  ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false );
-  ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false );
-  ROTRS(                  bMerge   && !bPdmMerge, false );
-
-  //===== get predicted depth for middle position of current PU =====  
-  Int  iPrdDepth, iCurrPosX, iCurrPosY;
-  Bool bAvailable  = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY );
-  AOF( bAvailable );
-  
-  //===== inter-view motion vector prediction =====
-  if( bInterview )
-  {
-    Int         iDisparity  = xGetDisparityFromVirtDepth( uiRefViewId, iPrdDepth );
-    rcMv.set  ( iDisparity, 0 );
-    return      true;
-  }
-  
-  //===== inter motion vector prediction =====
-  for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ )
-  {
-    //--- get base CU/PU and check prediction mode ---
-    UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
-#if PDM_REMOVE_DEPENDENCE
-    if( uiBaseId != 0)
-      continue;
-#endif
-    TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
-    TComPicYuv* pcBasePdm   = pcBasePic->getPredDepthMap();
-    TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
-    Int         iDisparity  = xGetDisparityFromVirtDepth( uiBaseId, iPrdDepth );
-    Int         iShiftX     = m_uiSubSampExpX + 2;
-    Int         iAddX       = ( 1 << iShiftX ) >> 1;
-    Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) );
-    Int         iBasePosY   = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY                               );
-    Int         iBaseCUAddr;
-    Int         iBaseAbsPartIdx;
-    pcBaseRec->getCUAddrAndPartIdx( iBasePosX << m_uiSubSampExpX, iBasePosY << m_uiSubSampExpY, iBaseCUAddr, iBaseAbsPartIdx );
-    TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
-    if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP )
-    {
-      continue;
-    }
-
-    for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ )
-    {
-      RefPicList  eBaseRefPicList = RefPicList( uiBaseRefListId );
-      TComMvField cBaseMvField;
-      pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
-      Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
-      Int         iBaseRefPoc     = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) );
-      if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc )
-      {
-        rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() );
-        return true;
-      }
-    }
-  }
-  return false;
-}
-#endif // H3D_NBDV
-#endif // QC_AMVP_MRG_UNIFY_IVCAN_C0051
 
 
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.h	(revision 325)
@@ -152,11 +152,5 @@
 #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 );
-#else
-  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 );
-#endif
 #else
   Int   getPdmMergeCandidate  ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPic.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPic.cpp	(revision 325)
@@ -85,5 +85,5 @@
   m_aaiCodedScale     = 0;
   m_aaiCodedOffset    = 0;
-#if OL_QTLIMIT_PREDCODING_B0068
+#if H3D_QTL
   m_bReduceBitsQTL    = 0;
 #endif
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPic.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPic.h	(revision 325)
@@ -121,5 +121,5 @@
   Int**                 m_aaiCodedOffset;
 
-#if OL_QTLIMIT_PREDCODING_B0068
+#if H3D_QTL
   Bool                  m_bReduceBitsQTL;
 #endif
@@ -203,5 +203,5 @@
 #endif
 
-#if OL_QTLIMIT_PREDCODING_B0068
+#if H3D_QTL
   Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
   Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp	(revision 325)
@@ -636,5 +636,4 @@
 #endif
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
@@ -642,15 +641,7 @@
         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
-#else
-        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
-#endif
-#endif
       }
       else
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
@@ -658,11 +649,4 @@
         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
-#else
-        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
-#endif
-#endif
       }
 #if LGE_ILLUCOMP_B0045
@@ -677,11 +661,6 @@
     else
     {
-#if DEPTH_MAP_GENERATION
       if( xCheckIdenticalMotion( pcCU, uiPartAddr ) && !bPrdDepthMap )
-#else
-      if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
-#endif
-      {
-#if DEPTH_MAP_GENERATION
+      {
 #if MERL_VSP_C0152
         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
@@ -689,15 +668,7 @@
         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
-#else
-        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
-#endif
-#endif
       }
       else
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
@@ -705,11 +676,4 @@
         xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
-#else
-        xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
-#endif
-#endif
       }
     }
@@ -721,5 +685,4 @@
     pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
 
-#if DEPTH_MAP_GENERATION
     if( bPrdDepthMap )
     {
@@ -727,5 +690,4 @@
       iHeight >>= uiSubSampExpY;
     }
-#endif
 
     if ( eRefPicList != REF_PIC_LIST_X )
@@ -737,5 +699,4 @@
 #endif
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
@@ -743,15 +704,7 @@
         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
 #endif 
-#else
-#if MERL_VSP_C0152
-        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
-#else
-        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
-#endif
-#endif
   }
   else
   {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
@@ -759,13 +712,5 @@
         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
-#else
-        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
-#endif
-#endif
-      }
-#if DEPTH_MAP_GENERATION
+      }
 #if MERL_VSP_C0152
       xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
@@ -773,11 +718,5 @@
       xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
 #endif
-#else
-#if MERL_VSP_C0152
-      xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
-#else
-      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
-#endif
-#endif
+
 #if LGE_ILLUCOMP_B0045
       if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr))
@@ -793,5 +732,4 @@
       if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
@@ -799,15 +737,7 @@
         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
-#else
-        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
-#endif
-#endif   
       }
       else
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
@@ -815,11 +745,4 @@
         xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
 #endif   
-#else
-#if MERL_VSP_C0152
-        xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
-#else
-        xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
-#endif 
-#endif
       }
     }
@@ -828,5 +751,5 @@
 }
 
-#if MTK_MDIVRP_C0138
+#if H3D_IVRP
 Void TComPrediction::residualPrediction(TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred)
 {
@@ -847,16 +770,8 @@
 #endif
 
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi )
 #else
 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi )
-#endif
-#else
-#if MERL_VSP_C0152
-Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi )
-#else
-Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi )
-#endif
 #endif
 {
@@ -887,9 +802,7 @@
   {
     UInt uiRShift = 0;
-#if PDM_REMOVE_DEPENDENCE
     if( pcCU->getPic()->getStoredPDMforV2() == 1 )
       xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMapTemp(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 );
     else
-#endif
       xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 );
 
@@ -1001,5 +914,4 @@
 
 
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
@@ -1007,11 +919,4 @@
 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
 #endif
-#else
-#if MERL_VSP_C0152
-Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx )
-#else
-Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx )
-#endif
-#endif
 {
   TComYuv* pcMbYuv;
@@ -1050,16 +955,8 @@
     if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 )
     {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
       xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
 #else
       xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
-#endif
-#else
-#if MERL_VSP_C0152
-      xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
-#else
-      xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
-#endif
 #endif
     }
@@ -1073,5 +970,4 @@
 #endif
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
@@ -1079,26 +975,11 @@
         xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
 #endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
-#else
-        xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
-#endif
-#endif
       }
       else
       {
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
         xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
 #else
         xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
-#endif
-#else
-#if MERL_VSP_C0152
-        xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, false );
-#else
-        xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, false );
-#endif
 #endif
       }
@@ -1132,5 +1013,4 @@
   else
   {
-#if DEPTH_MAP_GENERATION
     if ( bPrdDepthMap )
     {
@@ -1146,7 +1026,4 @@
       xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
     }
-#else
-    xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
-#endif
   }
 }
@@ -1155,5 +1032,4 @@
 
 Void 
-#if DEPTH_MAP_GENERATION
 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset 
 #if LGE_ILLUCOMP_DEPTH_C0046
@@ -1161,9 +1037,5 @@
 #endif
 )
-#else
-TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset )
-#endif
-{
-#if DEPTH_MAP_GENERATION
+{
   Int     iShiftX     = 2 + uiSubSampExpX;
   Int     iShiftY     = 2 + uiSubSampExpY;
@@ -1182,23 +1054,4 @@
   Int     iDstStride  = rpcYuv->getStride();
   Int     iRefOffset  = iHor + iVer * iRefStride;
-#else
-  Int     iFPelMask   = ~3;
-  Int     iRefStride  = pcPicYuvRef->getStride();
-  Int     iDstStride  = rpcYuv->getStride();
-  Int     iHor        = ( pcMv->getHor() + 2 ) & iFPelMask;
-  Int     iVer        = ( pcMv->getVer() + 2 ) & iFPelMask;
-#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
-  if( pcCU->getSlice()->getSPS()->isDepth() )
-  {
-    iHor = pcMv->getHor() * 4;
-    iVer = pcMv->getVer() * 4;
-}
-#endif
-#if !QC_MVHEVC_B0046
-  Int     ixFrac      = iHor & 0x3;
-  Int     iyFrac      = iVer & 0x3;
-#endif
-  Int     iRefOffset  = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;
-#endif
 
   Pel*    piRefY      = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
@@ -1454,11 +1307,6 @@
   Int dstStride = dstPic->getStride();
   Int depStride =  pPicBaseDepth->getStride();
-#if MTK_DVPREFINE_BVSP_BUG_FIX
   Int depthPosX = Clip3(0,   widthLuma - size_x,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
   Int depthPosY = Clip3(0,   heightLuma- size_y,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
-#else
-  Int depthPosX = Clip3(0,   widthLuma - size_x - 1,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
-  Int depthPosY = Clip3(0,   heightLuma- size_y - 1,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
-#endif
   Pel *ref    = refPic->getLumaAddr() + posX + posY * refStride;
   Pel *dst    = dstPic->getLumaAddr(partAddr);
@@ -1618,9 +1466,5 @@
     depthPosX = posX * nDepthPerTxtX + (mv->getHor()>>2);        //mv denotes the disparity for VSP
   }
-#if MTK_DVPREFINE_BVSP_BUG_FIX
   depthPosX = Clip3(0, widthDepth - (size_x<<1), depthPosX);
-#else
-  depthPosX = Clip3(0, widthDepth - (size_x<<1) - 1, depthPosX);
-#endif
   if ( heightChroma > heightDepth )
   {
@@ -1635,9 +1479,5 @@
     depthPosY = posY * nDepthPerTxtY + (mv->getVer()>>2);     //mv denotes the disparity for VSP
   }
-#if MTK_DVPREFINE_BVSP_BUG_FIX
   depthPosY = Clip3(0, heightDepth - (size_y<<1), depthPosY);
-#else
-  depthPosY = Clip3(0, heightDepth - (size_y<<1) - 1, depthPosY);
-#endif
 
   Pel *refCb  = refPic->getCbAddr() + posX + posY * refStride;
@@ -2384,11 +2224,6 @@
   iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
   iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
-#if FIX_LGE_ILLUCOMP_B0045
   iRefX   = iCUPelX + (pMv->getHor() >> 2);
   iRefY   = iCUPelY + (pMv->getVer() >> 2);
-#else
-  iRefX   = iCUPelX + (pMv->getHor() >> 3);
-  iRefY   = iCUPelY + (pMv->getVer() >> 3);
-#endif
   uiWidth = pcCU->getWidth(0) >> 1;
   uiHeight = pcCU->getHeight(0) >> 1;
@@ -3037,13 +2872,4 @@
   getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
 
-#if HHI_DMM_DELTADC_Q1_C0034
-#else
-  if( bDelta ) 
-  {
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
-  }
-#endif
-
   // assign wedge pred DCs to prediction
   if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
@@ -3064,13 +2890,4 @@
   piMask += iMaskStride+1;
   getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
-
-#if HHI_DMM_DELTADC_Q1_C0034
-#else
-  if( bDelta ) 
-  {
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
-  }
-#endif
 
   // assign wedge pred DCs to prediction
@@ -3249,13 +3066,4 @@
   getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
 
-#if HHI_DMM_DELTADC_Q1_C0034
-#else
-  if( bDelta ) 
-  {
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
-  }
-#endif
-
   // assign wedge pred DCs to prediction
   if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
@@ -3292,13 +3100,4 @@
   piMask += iMaskStride+1;
   getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
-
-#if HHI_DMM_DELTADC_Q1_C0034
-#else
-  if( bDelta ) 
-  {
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
-    xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
-  }
-#endif
 
   // assign wedge pred DCs to prediction
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPrediction.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPrediction.h	(revision 325)
@@ -86,5 +86,4 @@
   
   // motion compensation functions
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,        Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false );
@@ -92,13 +91,5 @@
   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false );
 #endif
-#else
-#if MERL_VSP_C0152
-  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,        Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false          );
-#else
-  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false          );
-#endif
-#endif
-
-#if DEPTH_MAP_GENERATION
+
 #if MERL_VSP_C0152
   Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,   Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );
@@ -111,12 +102,5 @@
 #endif
       );
-#else
-#if MERL_VSP_C0152
-  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,     UInt uiAbsPartIdx,     Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx          );
-#else
-  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx          );
-#endif
-  Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset );
-#endif
+
 #if MERL_VSP_C0152
   Void xPredInterUniBWVSP         ( TComDataCU* pcCU,                          UInt uiPartAddr, UInt uiAbsPartIdx,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi=false );
@@ -179,5 +163,4 @@
   
   // inter
-#if DEPTH_MAP_GENERATION
 #if MERL_VSP_C0152
   Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 );
@@ -185,13 +168,6 @@
   Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 );
 #endif
-#else
-#if MERL_VSP_C0152
-  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx,, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
-#else
-  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
-#endif
-#endif
-
-#if MTK_MDIVRP_C0138
+
+#if H3D_IVRP
   Void residualPrediction         (TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred);
 #endif
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComResidualGenerator.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComResidualGenerator.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComResidualGenerator.cpp	(revision 325)
@@ -184,5 +184,5 @@
   AOF  ( pcPic );
 
-#if MTK_MDIVRP_C0138
+#if H3D_IVRP
   if (pcPic->getSPS()->getViewId() != 0)
   {
@@ -257,9 +257,5 @@
 #endif
 {
-#if MTK_C0138_FIXED
   UInt  uiBaseViewId  = 0;
-#else
-  UInt  uiBaseViewId  = m_pcDepthMapGenerator->getBaseViewId( 0 );
-#endif
   if( !pcYuv )
   {
@@ -272,9 +268,5 @@
   xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, &uiXPosInRefView , &uiYPosInRefView , bRecon    );
 #endif
-#if MTK_MDIVRP_C0138
   return true;
-#else
-  return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight );
-#endif
 }
 
@@ -393,7 +385,4 @@
   Pel*    pRes      = pcCUResidual->getLumaAddr();
   UInt    uiLumaTrMode, uiChromaTrMode;
-#if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
-  Int     iPUPredResiShift[4];
-#endif
   pcCU->convertTransIdx             ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode );
     m_pcTrQuant->setQPforQuant      ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );
@@ -410,19 +399,4 @@
   pRes        = pcCUResidual->getCrAddr();
   m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pRes, 0, pcCUResidual->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );
-
-#if !MTK_MDIVRP_C0138
-  if( pcCU->getResPredFlag( 0 ) )
-  {
-    AOF( pcCU->getResPredAvail( 0 ) );
-    Bool bOK = pcCU->getResidualSamples( 0, true, m_ppcYuvTmp[0] );
-    AOF( bOK );
-#if LG_RESTRICTEDRESPRED_M24766
-    pcCU->getPUResiPredShift(iPUPredResiShift, 0);
-    pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
-#else
-    pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
-#endif
-  }
-#endif
 
   //===== clear inter-view predicted parts =====
@@ -570,15 +544,8 @@
   Int           iDesStrideC = pcYuv    ->getCStride();
 
-#if FIX_CHROMA_RESIDUAL_C0129
   Pel*          pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY0 * iSrcStrideC;
   Pel*          pSrcSamplesU1= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY1 * iSrcStrideC;
   Pel*          pSrcSamplesV0= pcBaseRes->getCrAddr ( 0 ) + iCRefPosY0 * iSrcStrideC;
   Pel*          pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + iCRefPosY1 * iSrcStrideC;
-#else
-  Pel*          pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + ( iCRefPosY0 >> 1 ) * iSrcStrideC;
-  Pel*          pSrcSamplesU1= pcBaseRes->getCbAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC;
-  Pel*          pSrcSamplesV0= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY0 >> 1 ) * iSrcStrideC;
-  Pel*          pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC;
-#endif
   Pel*          pDesSamplesU= pcYuv    ->getCbAddr ();
   Pel*          pDesSamplesV= pcYuv    ->getCrAddr ();
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComRom.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComRom.cpp	(revision 325)
@@ -306,9 +306,5 @@
 
 #if RWTH_SDC_DLT_B0036
-#if SAIT_SDC_C0096
 UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES] = { DC_IDX, DMM_WEDGE_FULL_IDX, PLANAR_IDX };
-#else
-UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES] = { DC_IDX, DMM_WEDGE_FULL_IDX, DMM_WEDGE_PREDDIR_IDX, PLANAR_IDX };
-#endif
 #endif
 
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComRom.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComRom.h	(revision 325)
@@ -194,9 +194,5 @@
 
 #if RWTH_SDC_DLT_B0036
-#if SAIT_SDC_C0096
 #define RWTH_SDC_NUM_PRED_MODES 3
-#else
-#define RWTH_SDC_NUM_PRED_MODES 4
-#endif
 extern      UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES];
 #endif
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComSlice.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComSlice.cpp	(revision 325)
@@ -1546,5 +1546,5 @@
 , m_bUseDMM34                   (false)
 #endif
-#if OL_QTLIMIT_PREDCODING_B0068
+#if H3D_QTL
 , m_bUseQTLPC                 (false)
 #endif
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComSlice.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComSlice.h	(revision 325)
@@ -375,5 +375,5 @@
 #endif
 
-#if OL_QTLIMIT_PREDCODING_B0068
+#if H3D_QTL
   Bool m_bUseQTLPC;
 #endif
@@ -617,5 +617,5 @@
 #endif
 
-#if OL_QTLIMIT_PREDCODING_B0068
+#if H3D_QTL
   Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
   Bool getUseQTLPC()         { return m_bUseQTLPC; }
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComYuv.cpp
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComYuv.cpp	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComYuv.cpp	(revision 325)
@@ -392,12 +392,4 @@
 }
 
-#if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
-Void
-TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize,  TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
-{
-  addLuma   (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth,    iHeight,    bSubtract );
-  addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract );
-}
-#else
 Void
 TComYuv::add( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
@@ -406,40 +398,8 @@
   addChroma ( pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract );
 }
-#endif
-
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Void
-TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset)
-{
-  switch(uhPartitionSize)
-  {    
-  case SIZE_2NxN:
-    iXOffset = iWidth;      iYOffset = iHeight >> 1;   break;
-  case SIZE_2NxnU:
-    iXOffset = iWidth;      iYOffset = iHeight >> 2;   break;
-  case SIZE_2NxnD: 
-    iXOffset = iWidth;      iYOffset = (iHeight >> 1) + (iHeight >> 2);   break;
-  case SIZE_Nx2N:
-    iXOffset = iWidth >> 1; iYOffset = iHeight; break;
-  case SIZE_nLx2N:
-    iXOffset = iWidth >> 2; iYOffset = iHeight; break;
-  case SIZE_nRx2N:
-    iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break;
-  case SIZE_NxN:
-    iXOffset = iWidth >> 1; iYOffset = iHeight >> 1;  break;
-  default:
-    assert(uhPartitionSize == SIZE_2Nx2N);
-    iXOffset = iWidth;     iYOffset = iHeight;    break;
-  }
-}
-#endif
-
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Void 
-TComYuv::addLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
-#else
+
+
 Void
 TComYuv::addLuma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
-#endif
 {
   Int   iScale      = ( bSubtract ? -1 : 1 );
@@ -449,47 +409,4 @@
   Pel*  pDstSamples = getLumaAddr();
 
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  Int iXOffset, iYOffset;
-
-  getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset);
-
-  for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
-  {
-    if(iPUResiPredShift[0] >= 0)
-    {
-      for( Int iX = 0; iX < iXOffset; iX++ )
-      {
-        pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]);
-      }
-    }
-
-    if(iPUResiPredShift[1] >= 0)
-    {
-      for( Int iX = iXOffset; iX < iWidth; iX++ )
-      {
-        pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]);
-      }
-    }
-  }
-
-  for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
-  {
-    if(iPUResiPredShift[2] >= 0)
-    {
-      for( Int iX = 0; iX < iXOffset; iX++ )
-      {
-        pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]);
-      }
-    }
-
-    if(iPUResiPredShift[3] >= 0)
-    {
-      for( Int iX = iXOffset; iX < iWidth; iX++ )
-      {
-        pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]);
-      }
-    }
-  }
-#else
   for( Int iY = 0; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
   {
@@ -499,14 +416,8 @@
     }
   }
-#endif
-}
-
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Void 
-TComYuv::addChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
-#else
+}
+
 Void
 TComYuv::addChroma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
-#endif
 {
   Int   iScale        = ( bSubtract ? -1 : 1 );
@@ -518,53 +429,4 @@
   Pel*  pDstSamplesCr = getCrAddr();
 
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  Int iXOffset, iYOffset;
- 
-  getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset);
-
-  for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
-    pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
-  {
-    if(iPUResiPredShift[0] >= 0)
-    {
-      for( Int iX = 0; iX < iXOffset; iX++ )
-      {
-        pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]);
-        pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]);
-      }
-    }
-
-    if(iPUResiPredShift[1] >= 0)
-    {
-      for( Int iX = iXOffset; iX < iWidth; iX++ )
-      {
-        pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]);
-        pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]);
-      }
-    }
-  }
-
-  for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
-    pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
-  {
-    if(iPUResiPredShift[2] >= 0)
-    {
-      for( Int iX = 0; iX < iXOffset; iX++ )
-      {
-        pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]);
-        pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]);
-      }
-    }
-
-    if(iPUResiPredShift[3] >= 0)
-    {
-      for( Int iX = iXOffset; iX < iWidth; iX++ )
-      {
-        pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]);
-        pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]);
-      }
-    }
-  }
-#else
   for( Int iY = 0; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
                                        pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
@@ -576,5 +438,4 @@
     }
   }
-#endif
 }
 
@@ -676,11 +537,4 @@
 }
 
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
-{
-  subtractLuma  (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize    );
-  subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize>>1 );
-}
-#else
 Void TComYuv::subtract( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
 {
@@ -688,11 +542,6 @@
   subtractChroma( pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize>>1 );
 }
-#endif
-
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Void TComYuv::subtractLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
-#else
+
 Void TComYuv::subtractLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
-#endif
 {
   Int x, y;
@@ -706,26 +555,9 @@
   Int  iDstStride  = getStride();
 
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  Int iXOffset, iYOffset;
-
-  getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset);
-
-#if FIX_LG_RESTRICTEDRESPRED_M24766
-  for ( y = 0; y < iYOffset; y++ )
-  {
-    if(iPUResiPredShift[0] >= 0)
-    {
-      for ( x = 0; x < iXOffset; x++ )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[0]);
-      }
-    }
-
-    if(iPUResiPredShift[1] >= 0)
-    {
-      for ( x = iXOffset; x < uiPartSize; x++ )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[1]);
-      }
+  for ( y = uiPartSize-1; y >= 0; y-- )
+  {
+    for ( x = uiPartSize-1; x >= 0; x-- )
+    {
+      pDst[x] = pSrc0[x] - pSrc1[x];
     }
     pSrc0 += iSrc0Stride;
@@ -733,90 +565,7 @@
     pDst  += iDstStride;
   }
-
-  for ( y = iYOffset; y < uiPartSize; y++ )
-  {
-    if(iPUResiPredShift[2] >= 0)
-    {
-      for ( x = 0; x < iXOffset; x++ )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
-      }
-    }
-
-    if(iPUResiPredShift[3] >= 0)
-    {
-      for ( x = iXOffset; x < uiPartSize; x++ )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
-      }
-    }
-    pSrc0 += iSrc0Stride;
-    pSrc1 += iSrc1Stride;
-    pDst  += iDstStride;
-  }
-#else
-  for ( y = uiPartSize-1; y >= iYOffset; y-- )
-  {
-    if(iPUResiPredShift[3] >= 0)
-    {
-      for ( x = uiPartSize-1; x >= iXOffset; x-- )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
-      }
-    }
-
-    if(iPUResiPredShift[2] >= 0)
-    {
-      for ( x = iXOffset-1; x >= 0; x-- )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
-      }
-    }
-    pSrc0 += iSrc0Stride;
-    pSrc1 += iSrc1Stride;
-    pDst  += iDstStride;
-  }
-
-  for ( y = iYOffset-1; y >= 0; y-- )
-  {
-    if(iPUResiPredShift[1] >= 0)
-    {
-      for ( x = uiPartSize-1; x >= iXOffset; x-- )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
-      }
-    }
-
-    if(iPUResiPredShift[0] >= 0)
-    {
-      for ( x = iXOffset-1; x >= 0; x-- )
-      {
-        pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
-      }
-    }
-    pSrc0 += iSrc0Stride;
-    pSrc1 += iSrc1Stride;
-    pDst  += iDstStride;
-  }
-#endif
-#else
-  for ( y = uiPartSize-1; y >= 0; y-- )
-  {
-    for ( x = uiPartSize-1; x >= 0; x-- )
-    {
-      pDst[x] = pSrc0[x] - pSrc1[x];
-    }
-    pSrc0 += iSrc0Stride;
-    pSrc1 += iSrc1Stride;
-    pDst  += iDstStride;
-  }
-#endif
-}
-
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-Void TComYuv::subtractChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
-#else
+}
+
 Void TComYuv::subtractChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
-#endif
 {
   Int x, y;
@@ -832,28 +581,10 @@
   Int  iSrc1Stride = pcYuvSrc1->getCStride();
   Int  iDstStride  = getCStride();
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  Int iXOffset, iYOffset;
- 
-  getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset);
-
-#if FIX_LG_RESTRICTEDRESPRED_M24766
-  for ( y = 0; y < iYOffset; y++ )
-  {
-    if(iPUResiPredShift[0] >= 0)
-    {
-      for ( x = 0; x < iXOffset; x++ )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]);
-      }
-    }
-
-    if(iPUResiPredShift[1] >= 0)
-    {
-      for ( x = iXOffset; x < uiPartSize; x++ )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]);
-      }
+  for ( y = uiPartSize-1; y >= 0; y-- )
+  {
+    for ( x = uiPartSize-1; x >= 0; x-- )
+    {
+      pDstU[x] = pSrcU0[x] - pSrcU1[x];
+      pDstV[x] = pSrcV0[x] - pSrcV1[x];
     }
     pSrcU0 += iSrc0Stride;
@@ -864,102 +595,4 @@
     pDstV  += iDstStride;
   }
-
-  for ( y = iYOffset; y < uiPartSize; y++ )
-  {
-    if(iPUResiPredShift[2] >= 0)
-    {
-      for ( x = 0; x < iXOffset; x++ )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]);
-      }
-    }
-
-    if(iPUResiPredShift[3] >= 0)
-    {
-      for ( x = iXOffset; x < uiPartSize; x++ )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]);
-      }
-    }
-    pSrcU0 += iSrc0Stride;
-    pSrcU1 += iSrc1Stride;
-    pSrcV0 += iSrc0Stride;
-    pSrcV1 += iSrc1Stride;
-    pDstU  += iDstStride;
-    pDstV  += iDstStride;
-  }
-#else
-  for ( y = uiPartSize-1; y >= iYOffset; y-- )
-  {
-    if(iPUResiPredShift[3] >= 0)
-    {
-      for ( x = uiPartSize-1; x >= iXOffset; x-- )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]);
-      }
-    }
-
-    if(iPUResiPredShift[2] >= 0)
-    {
-      for ( x = iXOffset-1; x >= 0; x-- )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]);
-      }
-    }
-    pSrcU0 += iSrc0Stride;
-    pSrcU1 += iSrc1Stride;
-    pSrcV0 += iSrc0Stride;
-    pSrcV1 += iSrc1Stride;
-    pDstU  += iDstStride;
-    pDstV  += iDstStride;
-  }
-
-  for ( y = iYOffset-1; y >= 0; y-- )
-  {
-    if(iPUResiPredShift[1] >= 0)
-    {
-      for ( x = uiPartSize-1; x >= iXOffset; x-- )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]);
-      }
-    }
-
-    if(iPUResiPredShift[0] >= 0)
-    {
-      for ( x = iXOffset-1; x >= 0; x-- )
-      {
-        pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]);
-        pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]);
-      }
-    }
-    pSrcU0 += iSrc0Stride;
-    pSrcU1 += iSrc1Stride;
-    pSrcV0 += iSrc0Stride;
-    pSrcV1 += iSrc1Stride;
-    pDstU  += iDstStride;
-    pDstV  += iDstStride;
-  }
-#endif
-#else
-  for ( y = uiPartSize-1; y >= 0; y-- )
-  {
-    for ( x = uiPartSize-1; x >= 0; x-- )
-    {
-      pDstU[x] = pSrcU0[x] - pSrcU1[x];
-      pDstV[x] = pSrcV0[x] - pSrcV1[x];
-    }
-    pSrcU0 += iSrc0Stride;
-    pSrcU1 += iSrc1Stride;
-    pSrcV0 += iSrc0Stride;
-    pSrcV1 += iSrc1Stride;
-    pDstU  += iDstStride;
-    pDstV  += iDstStride;
-  }
-#endif
 }
 
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComYuv.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComYuv.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComYuv.h	(revision 325)
@@ -146,14 +146,7 @@
   Void    addClipPartLuma   ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT
 
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  //  pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf
-  Void    subtract          (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
-  Void    subtractLuma      (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
-  Void    subtractChroma    (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
-#else
   Void    subtract          ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
   Void    subtractLuma      ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
   Void    subtractChroma    ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
-#endif
   
   //  (pcYuvSrc0 + pcYuvSrc1)/2 for YUV partition
@@ -166,14 +159,7 @@
   //   Remove High frequency
   Void    removeHighFreq    ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight );
-#if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
-  Void    getPUXYOffset     (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset);
-  Void    add               (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
-  Void    addLuma           (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
-  Void    addChroma         (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
-#else
   Void    add               ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
   Void    addLuma           ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
   Void    addChroma         ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
-#endif
 
   Void    clip              ( Int iWidth, Int iHeight );
Index: branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 322)
+++ branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 325)
@@ -57,19 +57,14 @@
 #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
+                                              // HHI_DMM_DELTADC_Q1_C0034   JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values
+                                              // FIX_DMM_CTX_INIT_C0034 JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short)
 
 #define LGE_EDGE_INTRA_A0070              1   // JCT3V-A0070
-
-#define HHI_DMM_DELTADC_Q1_C0034          1   // JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values
-#if ( HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA ) && HHI_DMM_PRED_TEX
 #define LGE_DMM3_SIMP_C0044               1
-#endif
-#define FIX_DMM_CTX_INIT_C0034            1   // JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short)
 
 ///// ***** SDC *********
 #define RWTH_SDC_DLT_B0036                1   // JCT3V-B0036: Simplified Depth Coding + Depth Lookup Table
-#if RWTH_SDC_DLT_B0036
-#define SAIT_SDC_C0096                    1   // JCT3V-C0096: Improved Simple Depth Coding(removal of DMM2 among four SDC modes(DC, Planar, DMM1 and DMM2))
-#endif
-#define FIX_SDC_ENC_C0143                 1   // JCT3V-C0143 fix for unnecessary encoder checks in case of SDC
+                                              // SAIT_SDC_C0096 JCT3V-C0096: Improved Simple Depth Coding(removal of DMM2 among four SDC modes(DC, Planar, DMM1 and DMM2))
+                                              // FIX_SDC_ENC_C0143, JCT3V-C0143 fix for unnecessary encoder checks in case of SDC
 
 ///// ***** TMVP/AMVP *********
@@ -87,6 +82,6 @@
                                               // OL_DISMV_POS_B0069            , different pos for disparity MV candidate, B0069
                                               // 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
+                                              // QC_C0051_FIXED_BY_MTK             1   // Bug fix for C0051 implementation
+                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051     1
 
 
@@ -95,14 +90,8 @@
                                               // HHI_INTER_VIEW_RESIDUAL_PRED
                                               // QC_SIMPLIFIEDIVRP_M24938 
-#if H3D_IVRP       
-#define LG_RESTRICTEDRESPRED_M24766       1   // Restricted inter-view residual prediction
-#define FIX_LG_RESTRICTEDRESPRED_M24766   1
-#else                                  
-#define LG_RESTRICTEDRESPRED_M24766       0
-#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)
-
+                                              // MTK_C0138_FIXED                   // Fix for IBP coding structure in view direction (not CTC)
+                                              // MTK_MDIVRP_C0138
+                                              // LG_RESTRICTEDRESPRED_M24766       1   // Restricted inter-view residual prediction
+                                              // FIX_LG_RESTRICTEDRESPRED_M24766   1
 
 ///// ***** DISPARITY VECTOR DERIVATION *********
@@ -121,5 +110,5 @@
                                               // MTK_RELEASE_DV_CONSTRAINT_C0129   
                                               // MTK_SIMPLIFY_DVTC_C0135           
-#define FIX_CHROMA_RESIDUAL_C0129         1 
+                                              // FIX_CHROMA_RESIDUAL_C0129         
 
 ///// ***** MOTION PARAMETER INHERITANCE  *********
@@ -145,7 +134,7 @@
 ///// ***** ILLUMINATION COMPENSATON *********
 #define LGE_ILLUCOMP_B0045                1   // JCT2-B0045 Illumination compensation for Luma and Chroma
+                                              // LGE_ILLUCOMP_B0045_ENCSIMP
+                                              // FIX_LGE_ILLUCOMP_B0045            
 #if LGE_ILLUCOMP_B0045
-#define LGE_ILLUCOMP_B0045_ENCSIMP        1
-#define FIX_LGE_ILLUCOMP_B0045            1
 #define LGE_ILLUCOMP_DEPTH_C0046          1   // JCT2-C0046 Apply illumination compensation to depth
 #if LGE_ILLUCOMP_DEPTH_C0046
@@ -158,6 +147,6 @@
 
 ///// ***** QUADTREE LIMITATION *********
-#define OL_QTLIMIT_PREDCODING_B0068       1    //JCT3V-B0068
-#define HHI_QTLPC_RAU_OFF_C0160           1   // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
+#define H3D_QTL                            1 // OL_QTLIMIT_dPREDCODING_B0068 //JCT3V-B0068
+                                             // HHI_QTLPC_RAU_OFF_C0160     // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
 
 ///// ***** OTHERS *********
@@ -211,5 +200,5 @@
 #define MERL_VSP_BLOCKSIZE_C0152             4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4.
 #define VSP_MERGE_POS                        5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5.
-#define MTK_DVPREFINE_BVSP_BUG_FIX               1
+                                               //MTK_DVPREFINE_BVSP_BUG_FIX               1
 
 #else // !MERL_VSP_C0152
