Index: /branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 647)
@@ -1392,5 +1392,5 @@
      xConfirmPara( allEqual , "Each layer shall have a different position in scalability space." );
 
-#if !H_3D_FCO_E0163
+#if !H_3D_FCO
      if ( numDiff  == 1 ) 
      {
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 647)
@@ -2656,9 +2656,5 @@
   // check prediction mode
   UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx );  
-#if LGE_SDC_REMOVE_DC_E0158
   if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )
-#else
-  if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )
-#endif
     return true;
   
@@ -3536,5 +3532,5 @@
     UInt uiPartIdxCenter;
     xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );    
-#if H_3D_FCO_E0163
+#if H_3D_FCO
     TComPic * pcTexturePic = m_pcSlice->getTexturePic();
     TComDataCU *pcTextureCU = 0;
@@ -3545,5 +3541,5 @@
 #endif
  
-#if H_3D_FCO_E0163
+#if H_3D_FCO
     if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
 #else
@@ -5487,11 +5483,4 @@
     xDeriveCenterIdx(uiPartIdx, uiPartIdxCenter );
 
-    ///*** Derive bottom right neighbour position ***
-#if !SEC_SIMPLIFIED_NBDV_E0142
-    Int iLCUIdxRBNb  = -1;    
-    Int iPartIdxRBNb = -1;
-    xDeriveRightBottomNbIdx(iLCUIdxRBNb, iPartIdxRBNb );
-#endif
-
     ///*** Search temporal candidate pictures for disparity vector ***
     const Int iNumCandPics = getPic()->getNumDdvCandPics();
@@ -5511,60 +5500,37 @@
       }
 
-#if !SEC_SIMPLIFIED_NBDV_E0142
-      // Check BR and Center       
-      for(Int curPosition = 0; curPosition < 2; curPosition++) 
-      {
-#endif
-        Bool bCheck = false; 
-#if !SEC_SIMPLIFIED_NBDV_E0142
-        if ( curPosition == 0 && iLCUIdxRBNb >= 0 )
-#if MTK_NBDV_TN_FIX_E0172
-          bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb,  cColMv, iTargetViewIdx, iTStartViewIdx);
+      Bool bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx,   uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx );
+
+      if( bCheck )
+      {
+        clipMv(cColMv);
+        pDInfo->m_acNBDV = cColMv;
+        pDInfo->m_aVIdxCan  = iTargetViewIdx;
+
+#if H_3D_NBDV_REF
+        TComPic* picDepth = NULL;   
+#if H_3D_FCO_VSP_DONBDV_E0163
+        picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
+        if ( picDepth->getPicYuvRec() != NULL  )  
+        {
+          cColMv.setZero();
+        }
+        else // Go back with virtual depth
+        {
+          picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
+        }
+
+        assert(picDepth != NULL);
 #else
-          bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb,  cColMv, iTargetViewIdx, iTStartViewIdx);
-#endif
-
-        if (curPosition == 1 )
-#endif
-#if MTK_NBDV_TN_FIX_E0172
-          bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx,   uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx );
-#else
-          bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx,   uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx );
-#endif
-
-        if( bCheck )
-        {
-          clipMv(cColMv);
-          pDInfo->m_acNBDV = cColMv;
-          pDInfo->m_aVIdxCan  = iTargetViewIdx;
-
-#if H_3D_NBDV_REF
-          TComPic* picDepth = NULL;   
-#if H_3D_FCO_VSP_DONBDV_E0163
-          picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
-          if ( picDepth->getPicYuvRec() != NULL  )  
-          {
-            cColMv.setZero();
-          }
-          else // Go back with virtual depth
-          {
-            picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
-          }
-
-          assert(picDepth != NULL);
-#else
-          picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
-          assert(picDepth != NULL);
-#endif
-          if (picDepth && bDepthRefine)
-            estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv );
-
-          pDInfo->m_acDoNBDV  = cColMv;
+        picDepth = getSlice()->getIvPic( true, iTargetViewIdx );
+        assert(picDepth != NULL);
+#endif
+        if (picDepth && bDepthRefine)
+          estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv );
+
+        pDInfo->m_acDoNBDV  = cColMv;
 #endif //H_3D_NBDV_REF
-          return true;
-        }
-#if !SEC_SIMPLIFIED_NBDV_E0142
-      } 
-#endif
+        return true;
+      }
     }
   } 
@@ -5579,5 +5545,5 @@
   if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT
 #if H_3D_NBDV_REF
-  , bDepthRefine 
+    , bDepthRefine 
 #endif
     ) )
@@ -5591,52 +5557,9 @@
     if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE
 #if H_3D_NBDV_REF
-  , bDepthRefine 
-#endif
-    ) )
+      , bDepthRefine 
+#endif
+      ) )
       return true;
   }
-
-#if !SEC_SIMPLIFIED_NBDV_E0142
-  //// ******* Get disparity from above right block ******* /////
-  pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true);
-  if(pcTmpCU != NULL )
-  {
-    bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0);
-    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVERIGHT
-#if H_3D_NBDV_REF
-  , bDepthRefine 
-#endif
-    ) )
-      return true;
-  }
-
-  //// ******* Get disparity from below left block ******* /////
-  pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true);
-  if( pcTmpCU != NULL )
-  {
-    bCheckMcpDv = true; 
-    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFTBELOW
-#if H_3D_NBDV_REF
-  , bDepthRefine 
-#endif
-    ) )
-      return true;
-  }
-
-  //// ******* Get disparity from above left block ******* /////
-  pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true);
-  assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));
-
-  if( pcTmpCU != NULL )
-  {
-    bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1); 
-    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVELEFT
-#if H_3D_NBDV_REF
-  , bDepthRefine 
-#endif
-    ) )
-      return true;
-  }
-#endif
 
   //// ******* Search MCP blocks ******* /////
@@ -5747,15 +5670,8 @@
   Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight();
   
-#if NTT_DoNBDV_VECTOR_CLIP_E0141
   Int depthStartPosX = Clip3(0,   iPictureWidth - 1,  iBlkX + ((mv->getHor()+2)>>2));
   Int depthStartPosY = Clip3(0,   iPictureHeight - 1, iBlkY + ((mv->getVer()+2)>>2));
   Int depthEndPosX   = Clip3(0,   iPictureWidth - 1,  iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2));
   Int depthEndPosY   = Clip3(0,   iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2));
-#else
-  Int depthStartPosX = Clip3(0,   iPictureWidth - iBlkWidth,  iBlkX + ((mv->getHor()+2)>>2));
-  Int depthStartPosY = Clip3(0,   iPictureHeight- iBlkHeight,  iBlkY + ((mv->getVer()+2)>>2));
-  Int depthEndPosX   = Clip3(0,   iPictureWidth - 1,  iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2));
-  Int depthEndPosY   = Clip3(0,   iPictureHeight - 1,  iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2));
-#endif
 
   Pel* depthTL  = pcBaseViewDepthPicYuv->getLumaAddr();
@@ -5848,5 +5764,5 @@
           assert( uiMvpDvPos < IDV_CANDS );
           paIDVInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.getIDVHor(), cMvPred.getIDVVer() );
-          //Notes from QC: DvMCP is implemented in a way that doesnE½t carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design.
+          //Notes from QC: DvMCP is implemented in a way that doesnot carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design.
           paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = cMvPred.getIDVVId();
           paIDVInfo->m_bAvailab[iList][ uiMvpDvPos ] = true;
@@ -5920,9 +5836,6 @@
 }
 #endif
-#if MTK_NBDV_TN_FIX_E0172
+
 Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
-#else
-Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
-#endif
 {
 
@@ -5940,5 +5853,5 @@
     if(pColCU->getSlice()->isInterB())
     {
-        eColRefPicList = RefPicList(ilist);
+      eColRefPicList = RefPicList(ilist);
     }
 
@@ -5958,16 +5871,12 @@
     else 
     {
-#if MTK_NBDV_TN_FIX_E0172
       if(getPic()->isTempIVRefValid(currCandPic, ilist,  iColRefIdx))
       {
-#endif
-      rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx);
-      rcMv.setIDVFlag(0);
-      iTargetViewIdx  = iColRefViewIdx ;
-      iStartViewIdx   = iColViewIdx   ;
-      return true;    
-#if MTK_NBDV_TN_FIX_E0172
-      }
-#endif
+        rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx);
+        rcMv.setIDVFlag(0);
+        iTargetViewIdx  = iColRefViewIdx ;
+        iStartViewIdx   = iColViewIdx   ;
+        return true;    
+      }
     }
   }
@@ -5976,5 +5885,5 @@
 }
 #endif 
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
 Void 
 TComDataCU::getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD)
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h	(revision 647)
@@ -486,9 +486,5 @@
 #endif
   );
-#if MTK_NBDV_TN_FIX_E0172
   Bool          xGetColDisMV      ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
-#else
-  Bool          xGetColDisMV      ( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
-#endif
   Bool          getDisMvpCandNBDV ( DisInfo* pDInfo
 #if H_3D_NBDV_REF
@@ -502,5 +498,5 @@
 #endif //H_3D_NBDV_REF
 #endif
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
   Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
 #endif
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp	(revision 647)
@@ -119,5 +119,5 @@
 
   /* initialize the texture to depth reference status */
-#if H_3D_FCO_E0163
+#if H_3D_FCO
   for (int j=0; j<2; j++)
   {
@@ -672,6 +672,5 @@
   return numDdvCandPics;
 }
-#endif
-#if MTK_NBDV_TN_FIX_E0172
+
 Void TComPic::checkTemporalIVRef()
 {
@@ -727,11 +726,10 @@
   return m_abTIVRINCurrRL[currCandPic][iColRefDir][iColRefIdx];
 }
-#endif
-#if MTK_TEXTURE_MRGCAND_BUGFIX_E0182
+
 Void TComPic::checkTextureRef(  )
 {
   TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx());
   TComPic* pcTextPic = pcCurrSlice->getTexturePic();
-#if H_3D_FCO_E0163
+#if H_3D_FCO
   if ( pcTextPic )
   {
@@ -759,5 +757,5 @@
 
   }
-#if H_3D_FCO_E0163
+#if H_3D_FCO
   }
 #endif
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h	(revision 647)
@@ -104,9 +104,5 @@
   RefPicList  m_eRapRefList;
   Int         m_iNumDdvCandPics;
-#endif
-#if MTK_NBDV_TN_FIX_E0172 
   Bool        m_abTIVRINCurrRL  [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists
-#endif
-#if MTK_TEXTURE_MRGCAND_BUGFIX_E0182  
   Int         m_aiTexToDepRef  [2][MAX_NUM_REF];
 #endif
@@ -224,12 +220,8 @@
   UInt          getRapRefIdx()                         {return m_uiRapRefIdx;       }
   RefPicList    getRapRefList()                        {return m_eRapRefList;       }
-#endif
-#if MTK_NBDV_TN_FIX_E0172
-  Void      checkTemporalIVRef();
-  Bool      isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx);
-#endif
-#if MTK_TEXTURE_MRGCAND_BUGFIX_E0182
-  Void      checkTextureRef(  );
-  Int       isTextRefValid(Int iTextRefDir, Int iTextRefIdx);
+  Void          checkTemporalIVRef();
+  Bool          isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx);
+  Void          checkTextureRef(  );
+  Int           isTextRefValid(Int iTextRefDir, Int iTextRefIdx);
 #endif
   /** transfer ownership of seis to this picture */
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp	(revision 647)
@@ -1976,11 +1976,6 @@
   Int           uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
 
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
   assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 );
   return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);
-#else
-  if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) { return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx); }
-  else                                                     { return g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])].at(intraTabIdx).getPatternIdx(); }
-#endif
 }
 
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.cpp	(revision 647)
@@ -484,5 +484,5 @@
 }
 
-#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
+#if H_3D_FAST_DEPTH_INTRA
 
 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth)
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h	(revision 647)
@@ -235,5 +235,5 @@
   UInt    calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight );
   
-#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
+#if H_3D_FAST_DEPTH_INTRA
   UInt    calcVAR(Pel* pi0, Int stride, Int width, Int height, Int cuDepth);
 #endif  
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRom.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRom.cpp	(revision 647)
@@ -347,13 +347,8 @@
 { //2x2   4x4   8x8 16x16 32x32 64x64
      0,    7,   10,   11,   11,   13 };
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+
 const UChar g_dmm3IntraTabIdxBits[6] =
 { //2x2   4x4   8x8 16x16 32x32 64x64
      0,    4,    7,    8,    8,    0 };
-#else
-const UChar g_dmm3IntraTabIdxBits[6] =
-{ //2x2   4x4   8x8 16x16 32x32 64x64
-     0,    6,    9,    9,    9,    0 };
-#endif
 
 extern std::vector< std::vector<TComWedgelet> >   g_dmmWedgeLists;
@@ -614,9 +609,5 @@
 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
 
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
 Void initWedgeLists( Bool initNodeList )
-#else
-Void initWedgeLists( Bool initRefinements )
-#endif
 {
   if( !g_dmmWedgeLists.empty() ) return;
@@ -631,21 +622,15 @@
     g_dmmWedgeRefLists.push_back( acWedgeRefList );
 
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
     if( initNodeList )
     {
-#endif
-    // create WedgeNodeList
-    std::vector<TComWedgeNode> acWedgeNodeList;
-    for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ )
-    {
-      if( acWedgeList[uiPos].getIsCoarse() )
-      {
-        TComWedgeNode cWedgeNode;
-        cWedgeNode.setPatternIdx( uiPos );
-
-#if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
-        if( initRefinements )
+      // create WedgeNodeList
+      std::vector<TComWedgeNode> acWedgeNodeList;
+      for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ )
+      {
+        if( acWedgeList[uiPos].getIsCoarse() )
         {
-#endif
+          TComWedgeNode cWedgeNode;
+          cWedgeNode.setPatternIdx( uiPos );
+
           UInt uiRefPos = 0;
           for( Int iOffS = -1; iOffS <= 1; iOffS++ )
@@ -674,7 +659,7 @@
               {
                 if( iSx == (Int)acWedgeRefList[k].getStartX() && 
-                    iSy == (Int)acWedgeRefList[k].getStartY() && 
-                    iEx == (Int)acWedgeRefList[k].getEndX()   && 
-                    iEy == (Int)acWedgeRefList[k].getEndY()      )
+                  iSy == (Int)acWedgeRefList[k].getStartY() && 
+                  iEx == (Int)acWedgeRefList[k].getEndX()   && 
+                  iEy == (Int)acWedgeRefList[k].getEndY()      )
                 {
                   if( acWedgeRefList[k].getRefIdx() != cWedgeNode.getPatternIdx() )
@@ -694,16 +679,10 @@
             }
           }
-#if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+          acWedgeNodeList.push_back( cWedgeNode );
         }
-#endif
-        acWedgeNodeList.push_back( cWedgeNode );
-      }
-    }
-    g_dmmWedgeNodeLists.push_back( acWedgeNodeList );
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
-  }
-#endif
-  }
-  return;
+      }
+      g_dmmWedgeNodeLists.push_back( acWedgeNodeList );
+    }
+  }
 }
 
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRom.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRom.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRom.h	(revision 647)
@@ -174,9 +174,5 @@
 extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
 
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
 Void initWedgeLists( Bool initNodeList = false );
-#else
-Void initWedgeLists( Bool initRefinements = false );
-#endif
 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes );
 Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList );
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 647)
@@ -92,5 +92,8 @@
                                               // QC_CU_NBDV_D0181
                                               // SEC_DEFAULT_DV_D0112
-                                              // MTK_DVMCP_FIX_E0172               1 // fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172
+                                              // MTK_DVMCP_FIX_E0172       fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172
+                                              // SEC_SIMPLIFIED_NBDV_E0142 Simplified NBDV, JCT3V-E0142 and JCT3V-E0190
+                                              // MTK_NBDV_TN_FIX_E0172     fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172
+                                              // MTK_TEXTURE_MRGCAND_BUGFIX_E0182  Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
 #define H_3D_ARP                          1   // Advanced residual prediction (ARP), JCT3V-D0177
 #define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
@@ -106,4 +109,6 @@
                                               // MERL_C0152: Basic VSP
                                               // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV
+                                              // NTT_DoNBDV_VECTOR_CLIP_E0141 disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209
+
 #endif
 
@@ -149,7 +154,10 @@
                                               // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC
                                               // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal
+                                              // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC
+                                              // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   Removal of overlap between DMM3 and DMM1
+
 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
                                               // LGE_INTER_SDC_E0156  Enable inter SDC for depth coding
-#define H_3D_FCO_E0163                          0   // Flexible coding order for 3D
+#define H_3D_FCO                          0   // Flexible coding order for 3D
 
 
@@ -157,52 +165,24 @@
 // OTHERS
                                               // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170
-
-#define H_3D_REN_MAX_DEV_OUT              0  // Output maximal possible shift deviation 
-
-/////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   HTM-8.0 INTEGRATIONS //////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////
-
-#define MTK_FAST_TEXTURE_ENCODING_E0173   1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
-
-
-#if H_3D_NBDV
-#define MTK_RVS_BUGFIX_E0172              1  // Bug fix for issues caused by reference view selection, JCT3V-E0172
-#define MTK_TEXTURE_MRGCAND_BUGFIX_E0182  1  // Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
-
-#if MTK_RVS_BUGFIX_E0172
-#define MTK_DIVMC_FIX_E0172               1 // fix the issue of derivation of disparity inter-view merge candidate, issue 5 in JCT3V-E0172
-#define MTK_NBDV_TN_FIX_E0172             1 // fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172
-#endif // MTK_RVS_BUGFIX_E0172
-
-#if H_3D_NBDV_REF
-#define NTT_DoNBDV_VECTOR_CLIP_E0141      1   // disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209
-#define SEC_SIMPLIFIED_NBDV_E0142         1   // Simplified NBDV, JCT3V-E0142 and JCT3V-E0190
-#endif
-#endif // H_3D_NBDV
-
+#define H_3D_REN_MAX_DEV_OUT              0   // Output maximal possible shift deviation 
+#define H_3D_FAST_TEXTURE_ENCODING        1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
+                                              // MTK_FAST_TEXTURE_ENCODING_E0173
 #if H_3D_DIM
-#define SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX     1   // Fast DMM and RBC Mode Selection
-#endif
-
-#if H_3D_FCO_E0163
-#define H_3D_FCO_VSP_DONBDV_E0163               1   // Adaptive depth reference for flexible coding order
-#else
-#define H_3D_FCO_VSP_DONBDV_E0163               0   // Adaptive depth reference for flexible coding order
-#endif
+#define H_3D_FAST_DEPTH_INTRA             1   // Fast DMM and RBC Mode Selection
+                                              // SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
+#endif
+
 #endif // H_3D
 
 
-/////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   HTM-8.1 INTEGRATIONS //////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////
-
-// Please put HTM-8.1 Integration defines here, when possible 
+// Rate Control
+#define KWU_FIX_URQ                       1
+#define KWU_RC_VIEWRC_E0227               0  ///< JCT3V-E0227, view-wise target bitrate allocation
+#define KWU_RC_MADPRED_E0227              0  ///< JCT3V-E0227, inter-view MAD prediction
 
 
 /// FIXES
 #if H_MV
-#define H_MV_FIX_LID_PIC_HASH_SEI_T40                      1   // Fix wrong layer_id in decoded picture hash SEI 
-#define H_MV5                                              1   // Update to MV-HEVC 5 HLS
+#define H_MV5                             1   // Update to MV-HEVC 5 HLS
 #endif
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -217,22 +197,12 @@
 #define H_3D_VSO_RM_ASSERTIONS            0   // Output VSO assertions
 #define H_3D_VSO_SYNTH_DIST_OUT           0   // Output of synthesized view distortion instead of depth distortion in encoder output
-
 #define H_3D_VSO_FIX                      0   // This fix should be enabled after verification 
-
-#endif
-////   ****** Neighbouring block-based Disparity Vector  *********
+#endif
+
+////   ****** neighbouring block-based disparity vector  *********
 #if H_3D_NBDV
-#if SEC_SIMPLIFIED_NBDV_E0142
 #define DVFROM_LEFT                       0
 #define DVFROM_ABOVE                      1
 #define IDV_CANDS                         2
-#else
-#define DVFROM_LEFTBELOW                  0
-#define DVFROM_LEFT                       1
-#define DVFROM_ABOVERIGHT                 2
-#define DVFROM_ABOVE                      3
-#define DVFROM_ABOVELEFT                  4
-#define IDV_CANDS                         5
-#endif
 #endif
 
@@ -241,4 +211,5 @@
 #define H_3D_ARP_WFNR                     3
 #endif
+
 ///// ***** DEPTH INTRA MODES *********
 #if H_3D_DIM
@@ -250,12 +221,5 @@
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
                                               // LG_ZEROINTRADEPTHRESI_A0087
-#if H_3D_DIM_SDC
-#define LGE_SDC_REMOVE_DC_E0158           1   // Removal of DC mode from SDC
-#endif
-#if H_3D_DIM_DMM
-#define LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   // Removal of overlap between DMM3 and DMM1
-#endif
-#endif
-
+#endif
 ///// ***** VIEW SYNTHESIS PREDICTION *********
 #if H_3D_VSP
@@ -270,10 +234,15 @@
 
 ///// ***** ILLUMATION COMPENSATION *********
-
-
 #if H_3D_IC
-#define IC_REG_COST_SHIFT 7
-#define IC_CONST_SHIFT 5
-#define IC_SHIFT_DIFF 12
+#define IC_REG_COST_SHIFT                 7
+#define IC_CONST_SHIFT                    5
+#define IC_SHIFT_DIFF                     12
+#endif
+
+///// ***** FCO *********
+#if H_3D_FCO
+#define H_3D_FCO_VSP_DONBDV_E0163               1   // Adaptive depth reference for flexible coding order
+#else
+#define H_3D_FCO_VSP_DONBDV_E0163               0   // Adaptive depth reference for flexible coding order
 #endif
 
@@ -302,22 +271,15 @@
 #define M0036_RC_IMPROVEMENT                        1  ///< JCTVC-M0036, improvement for R-lambda model based rate control
 #define TICKET_1090_FIX                             1
-#define KWU_FIX_URQ                                 1
 
 #if KWU_FIX_URQ
-
 #if RATE_CONTROL_LAMBDA_DOMAIN
 #define RC_FIX                                      1  /// suggested fix for M0036
 #define RATE_CONTROL_INTRA                          1  ///< JCTVC-M0257, rate control for intra 
 #endif
-
-#else
-
+#else
 #define RC_FIX                                      1  /// suggested fix for M0036
 #define RATE_CONTROL_INTRA                          1  ///< JCTVC-M0257, rate control for intra 
-
-#endif
-
-#define KWU_RC_VIEWRC_E0227                         0  ///< JCT3V-E0227, view-wise target bitrate allocation
-#define KWU_RC_MADPRED_E0227                        0  ///< JCT3V-E0227, inter-view MAD prediction
+#endif
+
 
 #define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecGop.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecGop.cpp	(revision 647)
@@ -158,12 +158,10 @@
     rpcPic->setNumDdvCandPics(rpcPic->getDisCandRefPictures(iColPoc));
   }
-#endif
-#if MTK_NBDV_TN_FIX_E0172 
+
   if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
   {
     rpcPic->checkTemporalIVRef();
   }
-#endif
-#if MTK_TEXTURE_MRGCAND_BUGFIX_E0182
+
   if(pcSlice->getIsDepth())
   {
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 647)
@@ -1207,7 +1207,4 @@
   if( puIdx == 2 )
   {
-#if !LGE_SDC_REMOVE_DC_E0158
-    while( binNum < 2 && symbol )
-#endif
     {
       ctxDepthMode = puIdx*3 + binNum;
@@ -1217,10 +1214,5 @@
     }
          if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;}
-#if LGE_SDC_REMOVE_DC_E0158
     else if( modeCode == 1 ) { dir = 0;          sdcFlag = 0;}
-#else
-    else if( modeCode == 2 ) { dir = 0;          sdcFlag = 0;}
-    else if( modeCode == 3 ) { dir =     DC_IDX; sdcFlag = 1;}
-#endif
   }
   else if( puIdx == 0 )
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecTop.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecTop.cpp	(revision 647)
@@ -979,5 +979,5 @@
     pcSlice->setIvPicLists( m_ivPicLists );         
 #if H_3D_IV_MERGE
-#if H_3D_FCO_E0163
+#if H_3D_FCO
     //assert( !getIsDepth() );
 #else
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.cpp	(revision 647)
@@ -517,5 +517,5 @@
   if(!bSliceEnd && !bSliceStart && bInsidePicture )
   {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
     Bool bIVFMerge = false;
     Int  iIVFMaxD = 0;
@@ -588,5 +588,5 @@
         }
       }
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
       if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth())
       {
@@ -612,5 +612,5 @@
           rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
 #endif
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
           xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD );  rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N
 #else
@@ -626,5 +626,5 @@
 #endif
         xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
         bFMD = bIVFMerge && rpcBestCU->isSkipped(0);
 #endif
@@ -652,5 +652,5 @@
             rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
 #endif
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD );  rpcTempCU->initEstData( uiDepth, iQP );
 #else
@@ -760,5 +760,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFMD  );
 #else
@@ -780,5 +780,5 @@
             )
           {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFMD  );
 #else
@@ -800,5 +800,5 @@
             )
           {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
             xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN, bFMD  );
 #else
@@ -839,5 +839,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD );
 #else
@@ -859,5 +859,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD );
 #else
@@ -883,5 +883,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD, true );
 #else
@@ -903,5 +903,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD, true );
 #else
@@ -929,5 +929,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD );
 #else
@@ -949,5 +949,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD );
 #else
@@ -969,5 +969,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD, true );
 #else
@@ -989,5 +989,5 @@
                 )
               {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD, true );
 #else
@@ -1040,5 +1040,5 @@
 #endif
         }
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
         if(!bFMD)
         {
@@ -1122,5 +1122,5 @@
           }
         }
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
         }
 #endif
@@ -1167,5 +1167,5 @@
       bSubBranch = true;
     }
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
     if(rpcBestCU->getSlice()->getViewIndex() && !rpcBestCU->getSlice()->getIsDepth() && (uiDepth >=iIVFMaxD) && rpcBestCU->isSkipped(0))
     {
@@ -2044,5 +2044,5 @@
 
 #if AMP_MRG
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFMD, Bool bUseMRG)
 #else
@@ -2053,5 +2053,5 @@
 #endif
 {
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
   if(!(bFMD && (ePartSize == SIZE_2Nx2N)))  //have  motion estimation or merge check
   {
@@ -2130,5 +2130,5 @@
 #if AMP_MRG
   rpcTempCU->setMergeAMP (true);
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
   m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bFMD, false, bUseMRG );
 #else
@@ -2245,5 +2245,5 @@
   }
 #endif
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
   }
 #endif
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.h	(revision 647)
@@ -160,5 +160,5 @@
 
 #if AMP_MRG
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
   Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize,  Bool bFMD, Bool bUseMRG = false  ) ;
 #else
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 647)
@@ -917,5 +917,5 @@
 
     // SAIT_VSO_EST_A0033
-#if H_3D_FCO_E0163
+#if H_3D_FCO
     Bool flagRec;
     flagRec =  ((m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), true) == NULL) ? false: true);
@@ -1187,16 +1187,16 @@
         pcPic->setNumDdvCandPics(pcPic->getDisCandRefPictures(iColPoc));
       }
+#endif
 #if H_3D
       pcSlice->setDepthToDisparityLUTs(); 
 
 #endif
-#endif
-#if MTK_NBDV_TN_FIX_E0172 
+
+#if H_3D_NBDV
       if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
       {
         pcPic->checkTemporalIVRef();
       }
-#endif
-#if MTK_TEXTURE_MRGCAND_BUGFIX_E0182
+
       if(pcSlice->getIsDepth())
       {
@@ -1930,5 +1930,5 @@
           digestStr = digestToString(sei_recon_picture_digest.digest, 4);
         }
-#if H_MV_FIX_LID_PIC_HASH_SEI_T40
+#if H_MV
         OutputNALUnit nalu(NAL_UNIT_SUFFIX_SEI, pcSlice->getTLayer(), getLayerId() );
 #else
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 647)
@@ -1274,9 +1274,5 @@
     case DMM4_IDX: codeIdx = 4; break;
     case DMM3_IDX: codeIdx = 5; break;
-#if LGE_SDC_REMOVE_DC_E0158
     case  RBC_IDX: codeIdx = 6; break;
-#else
-    case  RBC_IDX: codeIdx = 7; break;
-#endif
     default:                    break;
     }
@@ -1289,7 +1285,4 @@
     {
       case PLANAR_IDX:  codeIdx = 0; break;
-#if !LGE_SDC_REMOVE_DC_E0158
-      case DC_IDX:      codeIdx = 6; break;
-#endif
       default:          codeIdx = 2; break;
     }
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 647)
@@ -2843,5 +2843,5 @@
     {
 
-#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
+#if H_3D_FAST_DEPTH_INTRA
       Int  threshold    = max(((pcCU->getQP(0))>>3)-1,3);
       Int  varThreshold = (Int)( threshold * threshold - 8 );
@@ -2851,5 +2851,5 @@
 #if H_3D_DIM_DMM
       if( m_pcEncCfg->getUseDMM()
-#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
+#if H_3D_FAST_DEPTH_INTRA
          && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
 #endif
@@ -2858,5 +2858,5 @@
         for( UInt dmmType = 0; dmmType < DMM_NUM_TYPE; dmmType++ )
         {
-#if H_3D_FCO_E0163
+#if H_3D_FCO
             TComPic* picTexture  = pcCU->getSlice()->getIvPic(false, pcCU->getSlice()->getViewIndex() );
             if ( !picTexture->getReconMark() && (DMM3_IDX == dmmType || DMM4_IDX == dmmType ) )
@@ -2878,5 +2878,5 @@
           case( DMM3_IDX ):
             {
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+
               TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
               TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() );
@@ -2886,17 +2886,10 @@
               if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
               {
-#endif
-              UInt uiIntraTabIdx = 0;
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
+             UInt uiIntraTabIdx = 0;
               xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir );
-#else
-              xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx );
-#endif
               pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );
               pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth );
               biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
               }
-#endif
             } break;
           case( DMM4_IDX ):
@@ -2927,5 +2920,5 @@
 #if H_3D_DIM_RBC
       if( m_pcEncCfg->getUseRBC()
-#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
+#if H_3D_FAST_DEPTH_INTRA
           && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
 #endif
@@ -3710,5 +3703,5 @@
  */
 #if AMP_MRG
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bFMD, Bool bUseRes, Bool bUseMRG )
 #else
@@ -3822,5 +3815,5 @@
 #if AMP_MRG
     Bool bTestNormalMC = true;
-#if  MTK_FAST_TEXTURE_ENCODING_E0173
+#if  H_3D_FAST_TEXTURE_ENCODIN
     if (bFMD||( bUseMRG && pcCU->getWidth( 0 ) > 8 && iNumPart == 2 ))
 #else            
@@ -7307,5 +7300,4 @@
 }
 
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir )
 {
@@ -7344,73 +7336,5 @@
   cPredYuv.destroy();
 }
-#else
-Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx )
-{
-  ruiTabIdx       = 0;
-  ruiIntraTabIdx  = 0;
-
-  // local pred buffer
-  TComYuv cPredYuv; 
-  cPredYuv.create( uiWidth, uiHeight ); 
-  cPredYuv.clear();
-  Pel* piPred = cPredYuv.getLumaAddr();
-  UInt uiPredStride = cPredYuv.getStride();
-
-  // wedge search
-  UInt uiBestDist = MAX_UINT;
-  WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
-  Pel refDC1 = 0; Pel refDC2 = 0;
-
-  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
-  assert( pcPicTex != NULL );
-  TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
-  UInt      uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPtIdx;
-  Int   uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
-
-  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
-  if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
-  {
-    std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[uiColTexIntraDir-2];
-    for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
-    {
-      UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
-      TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx));
-      xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-      xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-
-      UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
-      if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
-      {
-        uiBestDist     = uiActDist;
-        ruiTabIdx      = uiIdx;
-        ruiIntraTabIdx = uiIdxW;
-      }
-    }
-  }
-  else
-  {
-    WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
-    UInt uiBestNodeDist = MAX_UINT;
-    UInt uiBestNodeId   = 0;
-    for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ )
-    {
-      TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx()));
-      xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-      xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-
-      UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
-      if( uiActDist < uiBestNodeDist || uiBestNodeDist == MAX_UINT )
-      {
-        uiBestNodeDist = uiActDist;
-        uiBestNodeId   = uiNodeId;
-        ruiIntraTabIdx = uiNodeId;
-      }
-    }
-    ruiTabIdx = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx();
-  }
-
-  cPredYuv.destroy();
-}
-#endif
+
 #endif
 #if H_3D_DIM_RBC
Index: /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.h	(revision 646)
+++ /branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.h	(revision 647)
@@ -196,5 +196,5 @@
                                   TComYuv*&   rpcResiYuv,
                                   TComYuv*&   rpcRecoYuv,
-#if MTK_FAST_TEXTURE_ENCODING_E0173
+#if H_3D_FAST_TEXTURE_ENCODIN
                                   Bool        bFMD,
 #endif
@@ -352,9 +352,5 @@
   Void xSearchDmmDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
   Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
-#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
   Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );
-#else
-  Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx );
-#endif
 #endif
 #if H_3D_DIM_RBC
