Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/ContextTables.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/ContextTables.h	(revision 646)
@@ -112,7 +112,4 @@
 #if H_3D_DIM_DMM
 #define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
-#if !SEC_DMM2_E0146_HHIFIX
-#define NUM_DMM2_DATA_CTX             1       ///< number of context models for DMM2 data
-#endif
 #define NUM_DMM3_DATA_CTX             1       ///< number of context models for DMM3 data
 #endif
@@ -127,5 +124,5 @@
 #endif
 
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
 #define NUM_INTER_SDC_FLAG_CTX        1      ///< number of context models for inter SDC flag
 #define NUM_INTER_SDC_SIGN_FLAG_CTX   1      ///< number of context models for sign of inter SDC residual
@@ -390,5 +387,4 @@
 #endif
 #if H_3D_DIM
-#if ZJU_DEPTH_INTRA_MODE_E0204
 static const UChar
 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
@@ -398,13 +394,5 @@
     {64, 0, CNU, CNU, 168, 109,   0, 0}
 };
-#else
-static const UChar 
-INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
-{
-  {0,  0,  64,   0, CNU,   0, CNU, 0},
-  {0, 64,   0, CNU,   0, CNU,   0, 0},
-  {64, 0, CNU,   0, CNU,   0,   0, 0}
-};
-#endif
+
 static const UChar 
 INIT_DDC_FLAG[3][NUM_DDC_FLAG_CTX] =
@@ -429,13 +417,4 @@
   { CNU }, 
 };
-#if !SEC_DMM2_E0146_HHIFIX
-static const UChar
-INIT_DMM2_DATA[3][NUM_DMM2_DATA_CTX] = 
-{
-  { CNU }, 
-  { CNU }, 
-  { CNU }, 
-};
-#endif
 static const UChar
 INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] = 
@@ -473,5 +452,5 @@
 #endif
 
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
 static const UChar 
 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] =
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 646)
@@ -120,7 +120,4 @@
     m_dmmWedgeTabIdx[i] = NULL;
   }
-#if !SEC_DMM2_E0146_HHIFIX
-  m_dmm2DeltaEnd    = NULL;
-#endif
   m_dmm3IntraTabIdx = NULL;
 #endif
@@ -153,5 +150,5 @@
   m_pbICFlag             = NULL;
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   m_pbInterSDCFlag       = NULL;
   for( Int i = 0; i < 4; i++ )
@@ -274,7 +271,4 @@
       m_dmmWedgeTabIdx[i]    = (UInt*)xMalloc(UInt, uiNumPartition);
     }
-#if !SEC_DMM2_E0146_HHIFIX
-    m_dmm2DeltaEnd    = (Int* )xMalloc(Int,  uiNumPartition);
-#endif
     m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition);
 #endif
@@ -292,5 +286,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
     m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
     for( Int i = 0; i < 4; i++ )
@@ -305,5 +299,5 @@
     m_acCUMvField[1].setNumPartition(uiNumPartition );
   }
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   m_pucInterSDCMask     = (UChar*  )xMalloc(UChar,    g_uiMaxCUHeight*g_uiMaxCUWidth);
 #endif
@@ -410,7 +404,4 @@
       if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; }
     }
-#if !SEC_DMM2_E0146_HHIFIX
-    if ( m_dmm2DeltaEnd    ) { xFree( m_dmm2DeltaEnd    ); m_dmm2DeltaEnd    = NULL; }
-#endif
     if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; }
 #endif
@@ -428,5 +419,5 @@
 #endif
 #endif    
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
     if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
     for(Int i = 0; i < 4; i++ )
@@ -436,5 +427,5 @@
 #endif
   }
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if ( m_pucInterSDCMask     ) { xFree(m_pucInterSDCMask);      m_pucInterSDCMask    = NULL; }
 #endif
@@ -575,5 +566,5 @@
     m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
     m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
 #endif
@@ -631,7 +622,4 @@
       memset( m_dmmWedgeTabIdx[i] + firstElement, 0,                      numElements * sizeof( *m_dmmWedgeTabIdx[i] ) );
     }
-#if !SEC_DMM2_E0146_HHIFIX
-    memset( m_dmm2DeltaEnd      + firstElement, 0,                        numElements * sizeof( *m_dmm2DeltaEnd    ) );
-#endif
     memset( m_dmm3IntraTabIdx   + firstElement, 0,                        numElements * sizeof( *m_dmm3IntraTabIdx ) );
 #endif
@@ -649,5 +637,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
     memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
     for( Int i = 0; i < 4; i++ )
@@ -811,7 +799,4 @@
         m_dmmWedgeTabIdx[i] [ui] = 0;
       }
-#if !SEC_DMM2_E0146_HHIFIX
-      m_dmm2DeltaEnd    [ui] = 0;
-#endif
       m_dmm3IntraTabIdx [ui] = 0;
 #endif
@@ -822,5 +807,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
       m_pbInterSDCFlag[ui] = false;
       for( Int i = 0; i < 4; i++ )
@@ -925,7 +910,4 @@
     memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition );
   }
-#if !SEC_DMM2_E0146_HHIFIX
-  memset( m_dmm2DeltaEnd   , 0, sizeof(Int ) * m_uiNumPartition );
-#endif
   memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition );
 #endif
@@ -943,5 +925,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
   for( Int i = 0; i < 4; i++ )
@@ -1010,7 +992,4 @@
         m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui];
       }
-#if !SEC_DMM2_E0146_HHIFIX
-      m_dmm2DeltaEnd    [ui] = pcCU->m_dmm2DeltaEnd   [uiPartOffset+ui];
-#endif
       m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui];
 #endif
@@ -1021,5 +1000,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
       m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
       for( Int i = 0; i < 4; i++ )
@@ -1167,7 +1146,4 @@
     m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart;
   }
-#if !SEC_DMM2_E0146_HHIFIX
-  m_dmm2DeltaEnd    = pcCU->getDmm2DeltaEnd()    + uiPart;
-#endif
   m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart;
 #endif
@@ -1185,5 +1161,5 @@
 #endif
 #endif  
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
   for( Int i = 0; i < 4; i++ )
@@ -1366,7 +1342,4 @@
     memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition );
   }
-#if !SEC_DMM2_E0146_HHIFIX
-  memcpy( m_dmm2DeltaEnd    + uiOffset, pcCU->getDmm2DeltaEnd()   , sizeof(Int ) * uiNumPartition );
-#endif
   memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition );
 #endif
@@ -1384,5 +1357,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
   for( Int i = 0; i < 4; i++ )
@@ -1496,7 +1469,4 @@
     memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition );
   }
-#if !SEC_DMM2_E0146_HHIFIX
-  memcpy( rpcCU->getDmm2DeltaEnd()    + m_uiAbsIdxInLCU, m_dmm2DeltaEnd   , sizeof(Int ) * m_uiNumPartition );
-#endif
   memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition );
 #endif
@@ -1514,5 +1484,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
   for( Int i = 0;i < 4; i++ )
@@ -1612,7 +1582,4 @@
     memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart );
   }
-#if !SEC_DMM2_E0146_HHIFIX
-  memcpy( rpcCU->getDmm2DeltaEnd()    + uiPartOffset, m_dmm2DeltaEnd   , sizeof(Int ) * uiQNumPart );
-#endif
   memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart );
 #endif
@@ -1630,5 +1597,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
   for( Int i = 0; i < 4; i++ )
@@ -2351,5 +2318,5 @@
 #endif
 
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
@@ -5007,11 +4974,11 @@
                                         + ( iPartWidth/m_pcPic->getMinCUWidth()  )/2];
 }
-#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
-Void TComDataCU::compressMV(int scale)
+#if H_3D
+Void TComDataCU::compressMV(Int scale)
 #else
 Void TComDataCU::compressMV()
 #endif
 {
-#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
+#if H_3D
   Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize;
 #else
@@ -5720,5 +5687,5 @@
   TComMv defaultDV(0, 0);
   pDInfo->m_acNBDV = defaultDV;
-#if NBDV_DEFAULT_VIEWIDX_BUGFIX
+
   Int valid = 0;
   Int viewIndex = 0;
@@ -5771,18 +5738,4 @@
 #endif
   }
-#else
-  pDInfo->m_aVIdxCan = 0;
-#if H_3D_NBDV_REF
-  TComPic* picDepth = NULL;
-  picDepth = getSlice()->getIvPic( true, 0 );
-  assert(picDepth!=NULL);
-
-  if (picDepth && bDepthRefine)
-  {
-    estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view
-  }
-  pDInfo->m_acDoNBDV = defaultDV;
-#endif
-#endif
   return false; 
 }
@@ -6308,11 +6261,4 @@
   for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
 }
-#if !SEC_DMM2_E0146_HHIFIX
-Void  TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
-  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; }
-}
-#endif
 Void  TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )
 {
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h	(revision 646)
@@ -208,7 +208,4 @@
 #if H_3D_DIM_DMM
   UInt*         m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 
-#if !SEC_DMM2_E0146_HHIFIX
-  Int*          m_dmm2DeltaEnd;
-#endif
   UInt*         m_dmm3IntraTabIdx;
 #endif
@@ -225,5 +222,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool*         m_pbInterSDCFlag;
   Int*          m_apSegmentInterDCOffset[4];
@@ -545,11 +542,4 @@
   Void  setDmmWedgeTabIdxSubParts     ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth );
 
-#if !SEC_DMM2_E0146_HHIFIX
-  Int*  getDmm2DeltaEnd               ()                      { return m_dmm2DeltaEnd;        }
-  Int   getDmm2DeltaEnd               ( UInt uiIdx )          { return m_dmm2DeltaEnd[uiIdx]; }
-  Void  setDmm2DeltaEnd               ( UInt uiIdx, Int iD )  { m_dmm2DeltaEnd[uiIdx] = iD;   }
-  Void  setDmm2DeltaEndSubParts       ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );
-#endif
-
   UInt* getDmm3IntraTabIdx            ()                      { return m_dmm3IntraTabIdx;        }
   UInt  getDmm3IntraTabIdx            ( UInt uiIdx )          { return m_dmm3IntraTabIdx[uiIdx]; }
@@ -588,5 +578,5 @@
 #endif
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
   Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
@@ -626,6 +616,6 @@
   Void          getMvPredAbove        ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldB.getMv(); }
   Void          getMvPredAboveRight   ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldC.getMv(); }
-#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
-  Void          compressMV            (int scale);
+#if H_3D
+  Void          compressMV            ( Int scale );
 #else            
   Void          compressMV            ();
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPattern.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPattern.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPattern.h	(revision 646)
@@ -102,5 +102,5 @@
   Bool              m_bICFlag;
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool              m_bSDCMRSADFlag;
 #endif
@@ -119,5 +119,5 @@
   Void  setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool  getSDCMRSADFlag()         { return m_bSDCMRSADFlag; }
   Void  setSDCMRSADFlag( Bool bSDCMRSADFlag )    { m_bSDCMRSADFlag = bSDCMRSADFlag; }
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp	(revision 646)
@@ -157,6 +157,6 @@
   deleteSEIs(m_SEIs);
 }
-#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
-Void TComPic::compressMotion(int scale)
+#if H_3D
+Void TComPic::compressMotion(Int scale)
 #else
 Void TComPic::compressMotion()
@@ -167,5 +167,5 @@
   {
     TComDataCU* pcCU = pPicSym->getCU(uiCUAddr);
-#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
+#if H_3D
     pcCU->compressMV(scale); 
 #else
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h	(revision 646)
@@ -186,6 +186,6 @@
   Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
   Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
-#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
-  Void          compressMotion(int scale); 
+#if H_3D
+  Void          compressMotion(Int scale); 
 #else   
   Void          compressMotion(); 
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp	(revision 646)
@@ -39,10 +39,4 @@
 #include "TComPrediction.h"
 
-#if SHARP_ILLUCOMP_REFINE_E0046
-#define IC_REG_COST_SHIFT 7
-#define IC_CONST_SHIFT 5
-#define IC_SHIFT_DIFF 12
-#endif
-
 //! \ingroup TLibCommon
 //! \{
@@ -69,7 +63,5 @@
   if (m_pDepthBlock != NULL)
       free(m_pDepthBlock);
-#if NTT_VSP_COMMON_E0207_E0208
   m_cYuvDepthOnVsp.destroy();
-#endif
 #endif
 
@@ -129,5 +121,5 @@
     m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
 #endif
-#if NTT_VSP_COMMON_E0207_E0208
+#if H_3D_VSP
     m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
 #endif
@@ -143,5 +135,4 @@
   }
 #if H_3D_IC
-#if SHARP_ILLUCOMP_REFINE_E0046
   m_uiaShift[0] = 0;
   for( Int i = 1; i < 64; i++ )
@@ -149,10 +140,4 @@
     m_uiaShift[i] = ( (1 << 15) + i/2 ) / i;
   }
-#else
-  for( Int i = 1; i < 64; i++ )
-  {
-    m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i;
-  }
-#endif
 #endif
 }
@@ -456,17 +441,4 @@
         dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
       } break;
-#if !SEC_DMM2_E0146_HHIFIX
-    case( DMM2_IDX ):
-      {
-        UInt uiTabIdx = 0;
-        if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }
-        else
-        {
-          uiTabIdx = xPredWedgeFromIntra( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm2DeltaEnd( uiAbsPartIdx ) );
-          pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, uiAbsPartIdx, (pcCU->getDepth(0) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1)) );
-        }
-        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);
-      } break;
-#endif
     case( DMM3_IDX ): 
       {
@@ -709,7 +681,5 @@
 #endif
       , bICFlag );
-#if SHARP_ILLUCOMP_REFINE_E0046
     bICFlag = bICFlag && (iWidth > 8);
-#endif
     xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
 #if H_3D_ARP
@@ -772,22 +742,10 @@
   }
 #endif
-
-#if NTT_VSP_COMMON_E0207_E0208
   // fetch virtual depth map
-#if NTT_VSP_VECTOR_CLIP_E0208
   pcBaseViewDepthPicYuv->extendPicBorder();
-#endif
   xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp );
   // sub-PU based compensation
   xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
   xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
-#else
-  UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();
-  Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
-  Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
-  xPredInterLumaBlkFromDM  ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX,    iBlkY,    iWidth,    iHeight,    pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
-  xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
-#endif
-
 }
 #endif
@@ -1005,5 +963,5 @@
   if ( yFrac == 0 )
   {
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac,       !bi || bICFlag
 #else
@@ -1017,5 +975,5 @@
   else if ( xFrac == 0 )
   {
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag
 #else
@@ -1040,5 +998,5 @@
 #endif 
       );
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi || bICFlag
 #else
@@ -1054,14 +1012,8 @@
   if( bICFlag )
   {
-#if SHARP_ILLUCOMP_REFINE_E0046
     Int a, b, i, j;
     const Int iShift = IC_CONST_SHIFT;
 
     xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA );
-#else
-    Int a, b, iShift, i, j;
-
-    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA );
-#endif
 
 
@@ -1070,17 +1022,9 @@
       for ( j = 0; j < width; j++ )
       {
-#if !MTK_CLIPPING_ALIGN_IC_E0168
-        if( bi )
-        {
-          Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;
-          dst[j] = ( ( a*dst[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1 << iIFshift ) - IF_INTERNAL_OFFS;
-        }
-        else
-#endif
           dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b );
       }
       dst += dstStride;
     }
-#if MTK_CLIPPING_ALIGN_IC_E0168
+
     if(bi)
     {
@@ -1097,5 +1041,4 @@
       }
     }
-#endif
   }
 #endif
@@ -1148,5 +1091,5 @@
   if ( yFrac == 0 )
   {
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterHorChroma(refCb, refStride, dstCb,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
 #else
@@ -1157,5 +1100,5 @@
 #endif
     );    
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
 #else
@@ -1169,5 +1112,5 @@
   else if ( xFrac == 0 )
   {
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
 #else
@@ -1178,5 +1121,5 @@
 #endif
     );
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
 #else
@@ -1195,5 +1138,5 @@
 #endif  
       );
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
 #else
@@ -1210,5 +1153,5 @@
 #endif 
       );
-#if MTK_CLIPPING_ALIGN_IC_E0168
+#if H_3D_IC
     m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
 #else
@@ -1224,50 +1167,25 @@
   if( bICFlag )
   {
-#if SHARP_ILLUCOMP_REFINE_E0046
     Int a, b, i, j;
     const Int iShift = IC_CONST_SHIFT;
     xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb
-#else
-    Int a, b, iShift, i, j;
-    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb
-#endif
     for ( i = 0; i < cxHeight; i++ )
     {
       for ( j = 0; j < cxWidth; j++ )
       {
-#if !MTK_CLIPPING_ALIGN_IC_E0168
-        if( bi )
-        {
-          Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;
-          dstCb[j] = ( ( a*dstCb[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;
-        }
-        else
-#endif
           dstCb[j] = Clip3(  0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b );
       }
       dstCb += dstStride;
     }
-#if SHARP_ILLUCOMP_REFINE_E0046
     xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr
-#else
-    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr
-#endif
     for ( i = 0; i < cxHeight; i++ )
     {
       for ( j = 0; j < cxWidth; j++ )
       {
-#if !MTK_CLIPPING_ALIGN_IC_E0168
-        if( bi )
-        {
-          Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;
-          dstCr[j] = ( ( a*dstCr[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;
-        }
-        else
-#endif
           dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b );
       }
       dstCr += dstStride;
     }
-#if MTK_CLIPPING_ALIGN_IC_E0168
+
     if(bi)
     {
@@ -1289,5 +1207,4 @@
       }
     }
-#endif
   }
 #endif
@@ -1438,55 +1355,8 @@
 }
 
-#if !SHARP_ILLUCOMP_REFINE_E0046
-/** Function for counting leading number of zeros/ones
- * \param x input value
- \ This function counts leading number of zeros for positive numbers and
- \ leading number of ones for negative numbers. This can be implemented in
- \ single instructure cycle on many processors.
- */
-
-Short CountLeadingZerosOnes (Short x)
-{
-  Short clz;
-  Short i;
-
-  if(x == 0)
-  {
-    clz = 0;
-  }
-  else
-  {
-    if (x == -1)
-    {
-      clz = 15;
-    }
-    else
-    {
-      if(x < 0)
-      {
-        x = ~x;
-      }
-      clz = 15;
-      for(i = 0;i < 15;++i)
-      {
-        if(x) 
-        {
-          clz --;
-        }
-        x = x >> 1;
-      }
-    }
-  }
-  return clz;
-}
-#endif
 
 /** Function for deriving LM illumination compensation.
  */
-#if SHARP_ILLUCOMP_REFINE_E0046
 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType )
-#else
-Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType )
-#endif
 {
   TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec();
@@ -1516,7 +1386,5 @@
 
   Int x = 0, y = 0, xx = 0, xy = 0;
-#if SHARP_ILLUCOMP_REFINE_E0046
   Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
-#endif
 
   if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 )
@@ -1540,25 +1408,12 @@
     }
 
-#if SHARP_ILLUCOMP_REFINE_E0046
     for( j = 0; j < uiWidth; j+=2 )
-#else
-    for( j = 0; j < uiWidth; j++ )
-#endif
     {
       x += pRef[j];
       y += pRec[j];
-#if SHARP_ILLUCOMP_REFINE_E0046
       xx += (pRef[j] * pRef[j])>>precShift;
       xy += (pRef[j] * pRec[j])>>precShift;
-#else
-      xx += pRef[j] * pRef[j];
-      xy += pRef[j] * pRec[j];
-#endif
-    }
-#if SHARP_ILLUCOMP_REFINE_E0046
+    }
     iCountShift += g_aucConvertToBit[ uiWidth ] + 1;
-#else
-    iCountShift += g_aucConvertToBit[ uiWidth ] + 2;
-#endif
   }
 
@@ -1584,13 +1439,9 @@
     }
 
-#if SHARP_ILLUCOMP_REFINE_E0046
     for( i = 0; i < uiHeight; i+=2 )
-#else
-    for( i = 0; i < uiHeight; i++ )
-#endif
     {
       x += pRef[0];
       y += pRec[0];
-#if SHARP_ILLUCOMP_REFINE_E0046
+
       xx += (pRef[0] * pRef[0])>>precShift;
       xy += (pRef[0] * pRec[0])>>precShift;
@@ -1598,20 +1449,8 @@
       pRef += iRefStride*2;
       pRec += iRecStride*2;
-#else
-      xx += pRef[0] * pRef[0];
-      xy += pRef[0] * pRec[0];
-
-      pRef += iRefStride;
-      pRec += iRecStride;
-#endif
-    }
-#if SHARP_ILLUCOMP_REFINE_E0046
+    }
     iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 );
-#else
-    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 );
-#endif
-  }
-
-#if SHARP_ILLUCOMP_REFINE_E0046
+  }
+
   xy += xx >> IC_REG_COST_SHIFT;
   xx += xx >> IC_REG_COST_SHIFT;
@@ -1620,34 +1459,6 @@
   const Int iShift = IC_CONST_SHIFT;
   {
-#else
-  Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;
-
-  if( iTempShift > 0 )
-  {
-    x  = ( x +  ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
-    y  = ( y +  ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
-    xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
-    xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
-    iCountShift -= iTempShift;
-  }
-
-  iShift = 13;
-
-  if( iCountShift == 0 )
-  {
-    a = 1;
-    b = 0;
-    iShift = 0;
-  }
-  else
-  {
-    Int a1 = ( xy << iCountShift ) - y * x;
-    Int a2 = ( xx << iCountShift ) - x * x;              
-#endif
     {
       const Int iShiftA2 = 6;
-#if !SHARP_ILLUCOMP_REFINE_E0046
-      const Int iShiftA1 = 15;
-#endif
       const Int iAccuracyShift = 15;
 
@@ -1657,12 +1468,7 @@
       Int a2s = a2;
 
-#if SHARP_ILLUCOMP_REFINE_E0046
       a1 = Clip3(0, 2*a2, a1);
       iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
       iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
-#else
-      iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;
-      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;  
-#endif
 
       if( iScaleShiftA1 < 0 )
@@ -1683,41 +1489,6 @@
       a1s = a1 >> iScaleShiftA1;
 
-#if SHARP_ILLUCOMP_REFINE_E0046
       a = a1s * m_uiaShift[ a2s ];
       a = a >> iScaleShiftA;
-#else
-      if (a2s >= 1)
-      {
-        a = a1s * m_uiaShift[ a2s - 1];
-      }
-      else
-      {
-        a = 0;
-      }
-
-      if( iScaleShiftA < 0 )
-      {
-        a = a << -iScaleShiftA;
-      }
-      else
-      {
-        a = a >> iScaleShiftA;
-      }
-
-      a = Clip3( -( 1 << 15 ), ( 1 << 15 ) - 1, a ); 
-
-      Int minA = -(1 << (6));
-      Int maxA = (1 << 6) - 1;
-      if( a <= maxA && a >= minA )
-      {
-        // do nothing
-      }
-      else
-      {
-        Short n = CountLeadingZerosOnes( a );
-        a = a >> (9-n);
-        iShift -= (9-n);
-      }
-#endif
       b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
     }
@@ -1727,6 +1498,4 @@
 
 #if H_3D_VSP
-
-#if NTT_VSP_COMMON_E0207_E0208
 // not fully support iRatioTxtPerDepth* != 1
 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
@@ -1736,6 +1505,4 @@
 
   Int refDepStride = picRefDepth->getStride();
-
-#if NTT_VSP_VECTOR_CLIP_E0208
 
   Int refDepOffset  = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride;
@@ -1757,24 +1524,6 @@
   refDepth += refDepOffset;
 
-#else // NTT_VSP_VECTOR_CLIP_E0208
-
-  Int widthDepth = picRefDepth->getWidth();
-  Int heightDepth = picRefDepth->getHeight();
-  Int posX, posY;
-  cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
-  posX /= ratioTxtPerDepthX; // texture position -> depth postion
-  posY /= ratioTxtPerDepthY;
-  
-  posX = Clip3(0, widthDepth-width,   posX + ((mv->getHor()+2)>>2));
-  posY = Clip3(0, heightDepth-height, posY + ((mv->getVer()+2)>>2));
-  
-  Pel *refDepth  = picRefDepth->getLumaAddr() + posX + posY * refDepStride;
-
-#endif // NTT_VSP_VECTOR_CLIP_E0208
-
   Int depStride = yuvDepth->getStride();
   Pel *depth = yuvDepth->getLumaAddr();
-
-#if NTT_VSP_ADAPTIVE_SPLIT_E0207
 
   if( width<8 || height<8 )
@@ -1915,36 +1664,5 @@
   }
 
-#else // NTT_VSP_ADAPTIVE_SPLIT_E0207
-
-  Int rightOffset = nTxtPerDepthX - 1;
-  Int depStrideBlock = depStride * nTxtPerDepthY;
-  Int refDepStrideBlock = refDepStride * nTxtPerDepthY;
-  Pel *refDepthTop = refDepth;
-  Pel *refDepthBot = refDepthTop + (nTxtPerDepthY-1)*refDepStride;
-
-  for( Int y=0; y<height; y+= nTxtPerDepthY )
-  {
-    for( Int x=0; x<width; x+=nTxtPerDepthX )
-    {
-      Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x]; 
-
-      if( maxDepth < refDepthTop[x+rightOffset] )
-      {
-        maxDepth = refDepthTop[x+rightOffset];
-      }
-      if( maxDepth < refDepthBot[x+rightOffset] )
-      {
-        maxDepth = refDepthBot[x+rightOffset];
-      }
-
-      depth[x] = maxDepth;
-
-    }
-    refDepthTop += refDepStrideBlock;
-    refDepthBot += refDepStrideBlock;
-    depth       += depStrideBlock;
-  }
-
-#endif // NTT_VSP_ADAPTIVE_SPLIT_E0207
+
 }
 
@@ -1964,10 +1682,4 @@
   Pel *dst    = yuvDst->getLumaAddr(partAddr);
   Pel *depth  = yuvDepth->getLumaAddr();
-  
-#if !(NTT_VSP_DC_BUGFIX_E0208)
-  Int widthLuma = picRef->getWidth();
-  Int posX, posY;
-  cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
-#endif
 
 #if H_3D_VSP_BLOCKSIZE == 1
@@ -2042,6 +1754,4 @@
       Int xFrac = disparity & 0x3;
 
-#if NTT_VSP_DC_BUGFIX_E0208
-
       dv.setHor( disparity );
       cu->clipMv( dv );
@@ -2059,36 +1769,4 @@
       assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
       m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-
-#else // NTT_VSP_DC_BUGFIX_E0208
-
-      for( Int j=0; j < nTxtPerDepthX; j++ )
-      {
-        Int refOffset = xTxt+j + (disparity >> 2);
-#if H_3D_VSP_CONSTRAINED
-        if(refOffset<minRelativePos || refOffset>maxRelativePos)
-        {
-          xFrac = 0;
-        }
-        refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-        Int absX  = posX + refOffset;
-
-        if (xFrac == 0)
-        {
-          absX = Clip3(0, widthLuma-1, absX);
-        }
-        else
-        {
-          absX = Clip3(4, widthLuma-5, absX);
-        }
-
-        refOffset = absX - posX;
-        assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 );
-        
-        m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );
-      }
-
-#endif // NTT_VSP_DC_BUGFIX_E0208
-
     }
     ref   += refStrideBlock;
@@ -2122,12 +1800,4 @@
   Pel *depth  = yuvDepth->getLumaAddr();
 
-#if !(NTT_VSP_DC_BUGFIX_E0208)
-  Int widthChroma = picRef->getWidth() >> 1;
-  Int posX, posY;
-  cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
-  posX >>= 1;
-  posY >>= 1;
-#endif
-  
 #if H_3D_VSP_BLOCKSIZE == 1
 #if H_3D_VSP_CONSTRAINED
@@ -2194,6 +1864,4 @@
       Int xFrac = disparity & 0x7;
       
-#if NTT_VSP_DC_BUGFIX_E0208
-
       dv.setHor( disparity );
       cu->clipMv( dv );
@@ -2214,37 +1882,4 @@
       m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
       m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-
-#else // NTT_VSP_DC_BUGFIX_E0208
-      
-      for( Int j=0; j < nTxtPerDepthX; j++ )
-      {
-        Int refOffset = xTxt+j + (disparity >> 3);
-#if H_3D_VSP_CONSTRAINED
-        if(refOffset<minRelativePos || refOffset>maxRelativePos)
-        {
-          xFrac = 0;
-        }
-        refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-        Int absX  = posX + refOffset;
-
-        if (xFrac == 0)
-        {
-          absX = Clip3(0, widthChroma-1, absX);
-        }
-        else
-        {
-          absX = Clip3(4, widthChroma-5, absX);
-        }
-
-        refOffset = absX - posX;
-        assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 );
-        assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 );
-
-        m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );
-        m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );
-      }
-
-#endif // NTT_VSP_DC_BUGFIX_E0208
     }
     refCb += refStrideBlock;
@@ -2254,462 +1889,6 @@
     depth += depStrideBlock;
   }
-
-}
-#else // NTT_VSP_COMMON_E0207_E0208
-
-// Input:
-// refPic: Ref picture. Full picture, with padding
-// posX, posY:     PU position, texture
-// sizeX, sizeY: PU size
-// partAddr: z-order index
-// dv: disparity vector. derived from neighboring blocks
-//
-// Output: dstPic, PU predictor 64x64
-Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr,Int posX, Int posY
-                                            , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi )
-{
-  Int widthLuma;
-  Int heightLuma;
-
-  if (isDepth)
-  {
-    widthLuma   =  pPicBaseDepth->getWidth();
-    heightLuma  =  pPicBaseDepth->getHeight();
-  }
-  else
-  {
-    widthLuma   =  refPic->getWidth();
-    heightLuma  =  refPic->getHeight();
-  }
-
-#if H_3D_VSP_BLOCKSIZE != 1
-  Int widthDepth  = pPicBaseDepth->getWidth();
-  Int heightDepth = pPicBaseDepth->getHeight();
-#endif
-
-#if H_3D_VSP_CONSTRAINED
-  Int widthDepth  = pPicBaseDepth->getWidth();
-  Int heightDepth = pPicBaseDepth->getHeight();
-#endif
-
-  Int nTxtPerDepthX = widthLuma  / ( pPicBaseDepth->getWidth() );  // texture pixel # per depth pixel
-  Int nTxtPerDepthY = heightLuma / ( pPicBaseDepth->getHeight() );
-
-  Int refStride = refPic->getStride();
-  Int dstStride = dstPic->getStride();
-  Int depStride =  pPicBaseDepth->getStride();
-  Int depthPosX = Clip3(0,   widthLuma - sizeX,  (posX/nTxtPerDepthX) + ((dv->getHor()+2)>>2));
-  Int depthPosY = Clip3(0,   heightLuma- sizeY,  (posY/nTxtPerDepthY) + ((dv->getVer()+2)>>2));
-  Pel *ref    = refPic->getLumaAddr() + posX + posY * refStride;
-  Pel *dst    = dstPic->getLumaAddr(partAddr);
-  Pel *depth  = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride;
-
-#if H_3D_VSP_BLOCKSIZE != 1
-#if H_3D_VSP_BLOCKSIZE == 2
-  Int  dW = sizeX>>1;
-  Int  dH = sizeY>>1;
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-  Int  dW = sizeX>>2;
-  Int  dH = sizeY>>2;
-#endif
-  {
-    Pel* depthi = depth;
-    for (Int j = 0; j < dH; j++)
-    {
-      for (Int i = 0; i < dW; i++)
-      {
-        Pel* depthTmp;
-#if H_3D_VSP_BLOCKSIZE == 2
-        if (depthPosX + (i<<1) < widthDepth)
-          depthTmp = depthi + (i << 1);
-        else
-          depthTmp = depthi + (widthDepth - depthPosX - 1);
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-        if (depthPosX + (i<<2) < widthDepth)
-          depthTmp = depthi + (i << 2);
-        else
-          depthTmp = depthi + (widthDepth - depthPosX - 1);
-#endif
-        Int maxV = 0;
-        for (Int blockj = 0; blockj < H_3D_VSP_BLOCKSIZE; blockj+=(H_3D_VSP_BLOCKSIZE-1))
-        {
-          Int iX = 0;
-          for (Int blocki = 0; blocki < H_3D_VSP_BLOCKSIZE; blocki+=(H_3D_VSP_BLOCKSIZE-1))
-          {
-            if (maxV < depthTmp[iX])
-              maxV = depthTmp[iX];
-#if H_3D_VSP_BLOCKSIZE == 2
-            if (depthPosX + (i<<1) + blocki < widthDepth - 1)
-#else // H_3D_VSP_BLOCKSIZE == 4
-            if (depthPosX + (i<<2) + blocki < widthDepth - 1)
-#endif
-              iX = (H_3D_VSP_BLOCKSIZE-1);
-          }
-#if H_3D_VSP_BLOCKSIZE == 2
-          if (depthPosY + (j<<1) + blockj < heightDepth - 1)
-#else // H_3D_VSP_BLOCKSIZE == 4
-          if (depthPosY + (j<<2) + blockj < heightDepth - 1)
-#endif
-            depthTmp += depStride * (H_3D_VSP_BLOCKSIZE-1);
-        }
-        m_pDepthBlock[i+j*dW] = maxV;
-      } // end of i < dW
-#if H_3D_VSP_BLOCKSIZE == 2
-      if (depthPosY + ((j+1)<<1) < heightDepth)
-        depthi += (depStride << 1);
-      else
-        depthi  = depth + (heightDepth-depthPosY-1)*depStride;
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-      if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1
-        depthi += (depStride << 2);
-      else
-        depthi  = depth + (heightDepth-depthPosY-1)*depStride; // the last line
-#endif
-    }
-  }
-#endif // H_3D_VSP_BLOCKSIZE != 1
-
-#if H_3D_VSP_BLOCKSIZE == 1
-#if H_3D_VSP_CONSTRAINED
-  //get LUT based horizontal reference range
-  Int range = xGetConstrainedSize(sizeX, sizeY);
-
-  // The minimum depth value
-  Int minRelativePos = MAX_INT;
-  Int maxRelativePos = MIN_INT;
-
-  Pel* depthTemp, *depthInitial=depth;
-  for (Int yTxt = 0; yTxt < sizeY; yTxt++)
-  {
-    for (Int xTxt = 0; xTxt < sizeX; xTxt++)
-    {
-      if (depthPosX+xTxt < widthDepth)
-        depthTemp = depthInitial + xTxt;
-      else
-        depthTemp = depthInitial + (widthDepth - depthPosX - 1);
-
-      Int disparity = pShiftLUT[ *depthTemp ]; // << iShiftPrec;
-      Int disparityInt = disparity >> 2;
-
-      if( disparity <= 0)
-      {
-        if (minRelativePos > disparityInt+xTxt)
-            minRelativePos = disparityInt+xTxt;
-      }
-      else
-      {
-        if (maxRelativePos < disparityInt+xTxt)
-            maxRelativePos = disparityInt+xTxt;
-      }
-    }
-    if (depthPosY+yTxt < heightDepth)
-      depthInitial = depthInitial + depStride;
-  }
-
-  Int disparity_tmp = pShiftLUT[ *depth ]; // << iShiftPrec;
-  if (disparity_tmp <= 0)
-    maxRelativePos = minRelativePos + range -1 ;
-  else
-    minRelativePos = maxRelativePos - range +1 ;
-#endif
-#endif // H_3D_VSP_BLOCKSIZE == 1
-
-#if H_3D_VSP_BLOCKSIZE != 1
-  Int yDepth = 0;
-#endif
-  for ( Int yTxt = 0; yTxt < sizeY; yTxt += nTxtPerDepthY )
-  {
-    for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth++ )
-    {
-      Pel repDepth = 0; // to store the depth value used for warping
-#if H_3D_VSP_BLOCKSIZE == 1
-      repDepth = depth[xDepth];
-#endif
-#if H_3D_VSP_BLOCKSIZE == 2
-      repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW];
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-      repDepth = m_pDepthBlock[(xTxt>>2) + (yTxt>>2)*dW];
-#endif
-
-      assert( repDepth >= 0 && repDepth <= 255 );
-      Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec ??
-      Int refOffset = xTxt + (disparity >> 2);
-      Int xFrac = disparity & 0x3;
-#if H_3D_VSP_CONSTRAINED
-      if(refOffset<minRelativePos || refOffset>maxRelativePos)
-        xFrac = 0;
-      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-      Int absX  = posX + refOffset;
-
-      if (xFrac == 0)
-        absX = Clip3(0, widthLuma-1, absX);
-      else
-        absX = Clip3(4, widthLuma-5, absX);
-
-      refOffset = absX - posX;
-
-      assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
-      m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi );
-    }
-    ref   += refStride*nTxtPerDepthY;
-    dst   += dstStride*nTxtPerDepthY;
-    depth += depStride;
-#if H_3D_VSP_BLOCKSIZE != 1
-    yDepth++;
-#endif
-
-  }
-}
-
-Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*dv, UInt partAddr, Int posX, Int posY
-                                               , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi)
-{
-  Int refStride = refPic->getCStride();
-  Int dstStride = dstPic->getCStride();
-  Int depStride = pPicBaseDepth->getStride();
-
-  Int widthChroma, heightChroma;
-  if( isDepth)
-  {
-     widthChroma   = pPicBaseDepth->getWidth()>>1;
-     heightChroma  = pPicBaseDepth->getHeight()>>1;
-  }
-  else
-  {
-     widthChroma   = refPic->getWidth()>>1;
-     heightChroma  = refPic->getHeight()>>1;
-  }
-
-  // Below is only for Texture chroma component
-
-  Int widthDepth  = pPicBaseDepth->getWidth();
-  Int heightDepth = pPicBaseDepth->getHeight();
-
-  Int nTxtPerDepthX, nTxtPerDepthY;  // Number of texture samples per one depth sample
-  Int nDepthPerTxtX, nDepthPerTxtY;  // Number of depth samples per one texture sample
-
-  Int depthPosX;  // Starting position in depth image
-  Int depthPosY;
-
-  if ( widthChroma > widthDepth )
-  {
-    nTxtPerDepthX = widthChroma / widthDepth;
-    nDepthPerTxtX = 1;
-    depthPosX = posX / nTxtPerDepthX + ((dv->getHor()+2)>>2);
-  }
-  else
-  {
-    nTxtPerDepthX = 1;
-    nDepthPerTxtX = widthDepth / widthChroma;
-    depthPosX = posX * nDepthPerTxtX + ((dv->getHor()+2)>>2);
-  }
-  depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX);
-  if ( heightChroma > heightDepth )
-  {
-    nTxtPerDepthY = heightChroma / heightDepth;
-    nDepthPerTxtY = 1;
-    depthPosY = posY / nTxtPerDepthY + ((dv->getVer()+2)>>2);
-  }
-  else
-  {
-    nTxtPerDepthY = 1;
-    nDepthPerTxtY = heightDepth / heightChroma;
-    depthPosY = posY * nDepthPerTxtY + ((dv->getVer()+2)>>2);
-  }
-  depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY);
-
-  Pel *refCb  = refPic->getCbAddr() + posX + posY * refStride;
-  Pel *refCr  = refPic->getCrAddr() + posX + posY * refStride;
-  Pel *dstCb  = dstPic->getCbAddr(partAddr);
-  Pel *dstCr  = dstPic->getCrAddr(partAddr);
-  Pel *depth  = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride;  // move the pointer to the current depth pixel position
-
-  Int refStrideBlock = refStride * nTxtPerDepthY;
-  Int dstStrideBlock = dstStride * nTxtPerDepthY;
-  Int depStrideBlock = depStride * nDepthPerTxtY;
-
-  if ( widthChroma > widthDepth ) // We assume
-  {
-    assert( heightChroma > heightDepth );
-    printf("This branch should never been reached.\n");
-    exit(0);
-  }
-  else
-  {
-#if H_3D_VSP_BLOCKSIZE == 1
-  Int  dW = sizeX;
-  Int  dH = sizeY;
-  Int  sW = 2; // search window size
-  Int  sH = 2;
-#endif
-#if H_3D_VSP_BLOCKSIZE == 2
-  Int  dW = sizeX;
-  Int  dH = sizeY;
-  Int  sW = 2; // search window size
-  Int  sH = 2;
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-  Int  dW = sizeX>>1;
-  Int  dH = sizeY>>1;
-  Int  sW = 4; // search window size
-  Int  sH = 4;
-#endif
-
-  {
-    Pel* depthi = depth;
-    for (Int j = 0; j < dH; j++)
-    {
-      for (Int i = 0; i < dW; i++)
-      {
-        Pel* depthTmp;
-#if H_3D_VSP_BLOCKSIZE == 1
-        depthTmp = depthi + (i << 1);
-#endif
-#if H_3D_VSP_BLOCKSIZE == 2
-        if (depthPosX + (i<<1) < widthDepth)
-          depthTmp = depthi + (i << 1);
-        else
-          depthTmp = depthi + (widthDepth - depthPosX - 1);
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-        if (depthPosX + (i<<2) < widthDepth)
-          depthTmp = depthi + (i << 2);
-        else
-          depthTmp = depthi + (widthDepth - depthPosX - 1);
-#endif
-        Int maxV = 0;
-        for (Int blockj = 0; blockj < sH; blockj+=(sH-1))
-        {
-          Int iX = 0;
-          for (Int blocki = 0; blocki < sW; blocki+=(sW-1))
-          {
-            if (maxV < depthTmp[iX])
-              maxV = depthTmp[iX];
-            if (depthPosX + i*sW + blocki < widthDepth - 1)
-                iX = (sW-1);
-          }
-          if (depthPosY + j*sH + blockj < heightDepth - 1)
-                depthTmp += depStride * (sH-1);
-        }
-        m_pDepthBlock[i+j*dW] = maxV;
-      } // end of i < dW
-#if H_3D_VSP_BLOCKSIZE == 1
-      if (depthPosY + ((j+1)<<1) < heightDepth)
-        depthi += (depStride << 1);
-      else
-        depthi  = depth + (heightDepth-1)*depStride;
-#endif
-#if H_3D_VSP_BLOCKSIZE == 2
-      if (depthPosY + ((j+1)<<1) < heightDepth)
-        depthi += (depStride << 1);
-      else
-        depthi  = depth + (heightDepth-depthPosY-1)*depStride;
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-      if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1
-        depthi += (depStride << 2);
-      else
-        depthi  = depth + (heightDepth-depthPosY-1)*depStride; // the last line
-#endif
-    }
-  }
-
-
-#if H_3D_VSP_BLOCKSIZE == 1
-#if H_3D_VSP_CONSTRAINED
-  //get LUT based horizontal reference range
-  Int range = xGetConstrainedSize(sizeX, sizeY, false);
-
-  // The minimum depth value
-  Int minRelativePos = MAX_INT;
-  Int maxRelativePos = MIN_INT;
-
-  Int depthTmp;
-  for (Int yTxt=0; yTxt<sizeY; yTxt++)
-  {
-    for (Int xTxt=0; xTxt<sizeX; xTxt++)
-    {
-      depthTmp = m_pDepthBlock[xTxt+yTxt*dW];
-      Int disparity = pShiftLUT[ depthTmp ]; // << iShiftPrec;
-      Int disparityInt = disparity >> 3;//in chroma resolution
-
-      if (disparityInt < 0)
-      {
-        if (minRelativePos > disparityInt+xTxt)
-            minRelativePos = disparityInt+xTxt;
-      }
-      else
-      {
-        if (maxRelativePos < disparityInt+xTxt)
-            maxRelativePos = disparityInt+xTxt;
-      }
-    }
-  }
-
-  depthTmp = m_pDepthBlock[0];
-  Int disparity_tmp = pShiftLUT[ depthTmp ]; // << iShiftPrec;
-  if ( disparity_tmp < 0 )
-    maxRelativePos = minRelativePos + range - 1;
-  else
-    minRelativePos = maxRelativePos - range + 1;
-
-#endif // H_3D_VSP_CONSTRAINED
-#endif // H_3D_VSP_BLOCKSIZE == 1
-
-    // (sizeX, sizeY) is Chroma block size
-    for ( Int yTxt = 0, yDepth = 0; yTxt < sizeY; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY )
-    {
-      for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX )
-      {
-        Pel repDepth = 0; // to store the depth value used for warping
-#if H_3D_VSP_BLOCKSIZE == 1
-        repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW];
-#endif
-#if H_3D_VSP_BLOCKSIZE == 2
-        repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW];
-#endif
-#if H_3D_VSP_BLOCKSIZE == 4
-        repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW];
-#endif
-
-      // calculate the offset in the reference picture
-        Int disparity = pShiftLUT[ repDepth ]; // Remove << iShiftPrec;
-        Int refOffset = xTxt + (disparity >> 3); // in integer pixel in chroma image
-        Int xFrac = disparity & 0x7;
-#if H_3D_VSP_CONSTRAINED
-        if(refOffset < minRelativePos || refOffset > maxRelativePos)
-          xFrac = 0;
-        refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-        Int absX  = posX + refOffset;
-
-        if (xFrac == 0)
-          absX = Clip3(0, widthChroma-1, absX);
-        else
-          absX = Clip3(4, widthChroma-5, absX);
-
-        refOffset = absX - posX;
-
-        assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );
-        assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );
-        m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt],  dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi);
-        m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt],  dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi);
-      }
-      refCb += refStrideBlock;
-      refCr += refStrideBlock;
-      dstCb += dstStrideBlock;
-      dstCr += dstStrideBlock;
-      depth += depStrideBlock;
-    }
-  }
-
-}
-
-#endif // NTT_VSP_COMMON_E0207_E0208
+}
+
 
 #if H_3D_VSP_CONSTRAINED
@@ -2789,75 +1968,4 @@
 
 #if H_3D_DIM_DMM
-#if !SEC_DMM2_E0146_HHIFIX
-UInt TComPrediction::xPredWedgeFromIntra( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd )
-{
-  UInt uiThisBlockSize = uiWidth;
-
-  TComDataCU* pcTempCU;
-  UInt        uiTempPartIdx;
-  // 1st: try continue above wedgelet
-  pcTempCU = pcCU->getPUAbove( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );
-  if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )
-  {
-    UInt dimType =  getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );
-    if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )
-    {
-      // get offset between current and reference block
-      UInt uiOffsetX = 0, uiOffsetY = 0;
-      xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );
-
-      // get reference wedgelet
-      WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];
-      TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );
-
-      // find wedgelet, if direction is suitable for continue wedge
-      if( pcRefWedgelet->checkPredDirAbovePossible( uiThisBlockSize, uiOffsetX ) )
-      {
-        UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;
-        pcRefWedgelet->getPredDirStartEndAbove( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetX, iDeltaEnd );
-        return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );
-      }
-    }
-  }
-
-  // 2nd: try continue left wedglelet
-  pcTempCU = pcCU->getPULeft( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );
-  if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )
-  {
-    UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );
-    if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )
-    {
-      // get offset between current and reference block
-      UInt uiOffsetX = 0, uiOffsetY = 0;
-      xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );
-
-      // get reference wedgelet
-      WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];
-      TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );
-
-      // find wedgelet, if direction is suitable for continue wedge
-      if( pcRefWedgelet->checkPredDirLeftPossible( uiThisBlockSize, uiOffsetY ) )
-      {
-        UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;
-        pcRefWedgelet->getPredDirStartEndLeft( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetY, iDeltaEnd );
-        return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );
-      }
-    }
-  }
-
-  // 3rd: (default) make wedglet from intra dir and max slope point
-  Int iSlopeX = 0, iSlopeY = 0;
-  UInt uiStartPosX = 0, uiStartPosY = 0;
-  if( xGetWedgeIntraDirPredData( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY ) )
-  {
-    UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;
-    xGetWedgeIntraDirStartEnd( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, iDeltaEnd );
-    return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );
-  }
-
-  return 0;
-}
-#endif
-
 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx )
 {
@@ -2896,10 +2004,7 @@
   }
 
-#if SCU_HS_DMM4_REMOVE_DIV_E0242
-  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;
-  iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;
-#else
-  iDC /= (uiWidth*uiHeight);
-#endif
+  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;   // 
+  iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;        //  iDC /= (uiWidth*uiHeight);
+
   piRefBlkY = cTempYuv.getLumaAddr();
 
@@ -2928,395 +2033,6 @@
   }
 }
-
-#if !SEC_DMM2_E0146_HHIFIX
-Void TComPrediction::xGetBlockOffset( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY )
-{
-  ruiOffsetX = 0;
-  ruiOffsetY = 0;
-
-  // get offset between current and above/left block
-  UInt uiThisOriginX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
-  UInt uiThisOriginY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
-
-  UInt uiNumPartInRefCU = pcRefCU->getTotalNumPart();
-  UInt uiMaxDepthRefCU = 0;
-  while( uiNumPartInRefCU > 1 )
-  {
-    uiNumPartInRefCU >>= 2;
-    uiMaxDepthRefCU++;
-  }
-
-  UInt uiDepthRefPU = (pcRefCU->getDepth(uiRefAbsPartIdx)) + (pcRefCU->getPartitionSize(uiRefAbsPartIdx) == SIZE_2Nx2N ? 0 : 1);
-  UInt uiShifts = (uiMaxDepthRefCU - uiDepthRefPU)*2;
-  UInt uiRefBlockOriginPartIdx = (uiRefAbsPartIdx>>uiShifts)<<uiShifts;
-
-  UInt uiRefOriginX = pcRefCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ];
-  UInt uiRefOriginY = pcRefCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ];
-
-  if( (uiThisOriginX - uiRefOriginX) > 0 ) { ruiOffsetX = (UInt)(uiThisOriginX - uiRefOriginX); }
-  if( (uiThisOriginY - uiRefOriginY) > 0 ) { ruiOffsetY = (UInt)(uiThisOriginY - uiRefOriginY); }
-}
-
-Bool TComPrediction::xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY )
-{
-  riSlopeX = 0, riSlopeY = 0, ruiStartPosX = 0, ruiStartPosY = 0;
-
-  // 1st step: get wedge start point (max. slope)
-  Int* piSource = pcCU->getPattern()->getAdiOrgBuf( uiBlockSize, uiBlockSize, m_piYuvExt );
-  Int iSourceStride = ( uiBlockSize<<1 ) + 1;
-
-  UInt uiSlopeMaxAbove = 0, uiPosSlopeMaxAbove = 0;
-  for( UInt uiPosHor = 0; uiPosHor < (uiBlockSize-1); uiPosHor++ )
-  {
-    if( abs( piSource[uiPosHor+1] - piSource[uiPosHor] ) > uiSlopeMaxAbove )
-    {
-      uiSlopeMaxAbove = abs( piSource[uiPosHor+1] - piSource[uiPosHor] );
-      uiPosSlopeMaxAbove = uiPosHor;
-    }
-  }
-
-  UInt uiSlopeMaxLeft = 0, uiPosSlopeMaxLeft = 0;
-  for( UInt uiPosVer = 0; uiPosVer < (uiBlockSize-1); uiPosVer++ )
-  {
-    if( abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ) > uiSlopeMaxLeft )
-    {
-      uiSlopeMaxLeft = abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] );
-      uiPosSlopeMaxLeft = uiPosVer;
-    }
-  }
-
-  if( uiSlopeMaxAbove == 0 && uiSlopeMaxLeft == 0 ) 
-  { 
-    return false; 
-  }
-
-  ruiStartPosX = ( uiSlopeMaxAbove >  uiSlopeMaxLeft  ) ? uiPosSlopeMaxAbove : 0;
-  ruiStartPosY = ( uiSlopeMaxLeft  >= uiSlopeMaxAbove ) ? uiPosSlopeMaxLeft  : 0;
-
-  // 2nd step: derive wedge direction
-  Int uiPreds[3] = {-1, -1, -1};
-  Int iMode = -1;
-  Int iPredNum = pcCU->getIntraDirLumaPredictor( uiAbsPartIdx, uiPreds, &iMode );  
-
-  UInt uiDirMode = 0;
-  if( iMode >= 0 ) { iPredNum = iMode; }
-  if( iPredNum == 1 ) { uiDirMode = uiPreds[0]; }
-  if( iPredNum == 2 ) { uiDirMode = uiPreds[1]; }
-
-  if( uiDirMode < 2 ) { return false; } // no planar & DC
-
-  Bool modeHor       = (uiDirMode < 18);
-  Bool modeVer       = !modeHor;
-  Int intraPredAngle = modeVer ? (Int)uiDirMode - VER_IDX : modeHor ? -((Int)uiDirMode - HOR_IDX) : 0;
-  Int absAng         = abs(intraPredAngle);
-  Int signAng        = intraPredAngle < 0 ? -1 : 1;
-  Int angTable[9]    = {0,2,5,9,13,17,21,26,32};
-  absAng             = angTable[absAng];
-  intraPredAngle     = signAng * absAng;
-
-  // 3rd step: set slope for direction
-  if( modeHor )
-  {
-    riSlopeX = ( intraPredAngle > 0 ) ?            -32 :              32;
-    riSlopeY = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle;
-  }
-  else if( modeVer )
-  {
-    riSlopeX = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle;
-    riSlopeY = ( intraPredAngle > 0 ) ?            -32 :              32;
-  }
-
-  return true;
-}
-
-Void TComPrediction::xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd )
-{
-  ruhXs = 0;
-  ruhYs = 0;
-  ruhXe = 0;
-  ruhYe = 0;
-
-  // scaling of start pos and block size to wedge resolution
-  UInt uiScaledStartPosX = 0;
-  UInt uiScaledStartPosY = 0;
-  UInt uiScaledBlockSize = 0;
-  WedgeResolution eWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiBlockSize]];
-  switch( eWedgeRes )
-  {
-  case( DOUBLE_PEL ): { uiScaledStartPosX = (uiPMSPosX>>1); uiScaledStartPosY = (uiPMSPosY>>1); uiScaledBlockSize = (uiBlockSize>>1); break; }
-  case(   FULL_PEL ): { uiScaledStartPosX =  uiPMSPosX;     uiScaledStartPosY =  uiPMSPosY;     uiScaledBlockSize =  uiBlockSize;     break; }
-  case(   HALF_PEL ): { uiScaledStartPosX = (uiPMSPosX<<1); uiScaledStartPosY = (uiPMSPosY<<1); uiScaledBlockSize = (uiBlockSize<<1); break; }
-  }
-  Int iMaxPos = (Int)uiScaledBlockSize - 1;
-
-  // case above
-  if( uiScaledStartPosX > 0 && uiScaledStartPosY == 0 )
-  {
-    ruhXs = (UChar)uiScaledStartPosX;
-    ruhYs = 0;
-
-    if( iDeltaY == 0 )
-    {
-      if( iDeltaX < 0 )
-      {
-        ruhXe = 0;
-        ruhYe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)iMaxPos;
-        ruhYe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-    }
-
-    // regular case
-    Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) );
-
-    if( iVirtualEndX < 0 )
-    {
-      Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) + iDeltaEnd;
-      if( iYe < (Int)uiScaledBlockSize )
-      {
-        ruhXe = 0;
-        ruhYe = (UChar)std::max( iYe, 0 );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)std::min( (iYe - iMaxPos), iMaxPos );
-        ruhYe = (UChar)iMaxPos;
-        return;
-      }
-    }
-    else if( iVirtualEndX > iMaxPos )
-    {
-      Int iYe = roftoi( (Double)(iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd;
-      if( iYe < (Int)uiScaledBlockSize )
-      {
-        ruhXe = (UChar)iMaxPos;
-        ruhYe = (UChar)std::max( iYe, 0 );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 );
-        ruhYe = (UChar)iMaxPos;
-        return;
-      }
-    }
-    else
-    {
-      Int iXe = iVirtualEndX + iDeltaEnd;
-      if( iXe < 0 )
-      {
-        ruhXe = 0;
-        ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 );
-        return;
-      }
-      else if( iXe > iMaxPos )
-      {
-        ruhXe = (UChar)iMaxPos;
-        ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)iXe;
-        ruhYe = (UChar)iMaxPos;
-        return;
-      }
-    }
-  }
-
-  // case left
-  if( uiScaledStartPosY > 0 && uiScaledStartPosX == 0 )
-  {
-    ruhXs = 0;
-    ruhYs = (UChar)uiScaledStartPosY;
-
-    if( iDeltaX == 0 )
-    {
-      if( iDeltaY < 0 )
-      {
-        ruhXe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos );
-        ruhYe = 0;
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos );
-        ruhYe = (UChar)iMaxPos;
-        return; 
-      }
-    }
-
-    // regular case
-    Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iMaxPos * ((Double)iDeltaY / (Double)iDeltaX) );
-
-    if( iVirtualEndY < 0 )
-    {
-      Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) - iDeltaEnd;
-      if( iXe < (Int)uiScaledBlockSize )
-      {
-        ruhXe = (UChar)std::max( iXe, 0 );
-        ruhYe = 0;
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)iMaxPos;
-        ruhYe = (UChar)std::min( (iXe - iMaxPos), iMaxPos );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-    }
-    else if( iVirtualEndY > (uiScaledBlockSize-1) )
-    {
-      Int iXe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) + iDeltaEnd;
-      if( iXe < (Int)uiScaledBlockSize )
-      {
-        ruhXe = (UChar)std::max( iXe, 0 );
-        ruhYe = (UChar)(uiScaledBlockSize-1);
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)iMaxPos;
-        ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-    }
-    else
-    {
-      Int iYe = iVirtualEndY - iDeltaEnd;
-      if( iYe < 0 )
-      {
-        ruhXe = (UChar)std::max( (iMaxPos + iYe), 0 );
-        ruhYe = 0;
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else if( iYe > iMaxPos )
-      {
-        ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 );
-        ruhYe = (UChar)iMaxPos;
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)iMaxPos;
-        ruhYe = (UChar)iYe;
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-    }
-  }
-
-  // case origin
-  if( uiScaledStartPosX == 0 && uiScaledStartPosY == 0 )
-  {
-    if( iDeltaX*iDeltaY < 0 )
-    {
-      return;
-    }
-
-    ruhXs = 0;
-    ruhYs = 0;
-
-    if( iDeltaY == 0 )
-    {
-      ruhXe = (UChar)iMaxPos;
-      ruhYe = 0;
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-
-    if( iDeltaX == 0 )
-    {
-      ruhXe = 0;
-      ruhYe = (UChar)iMaxPos;
-      return;
-    }
-
-    Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) );
-
-    if( iVirtualEndX > iMaxPos )
-    {
-      Int iYe = roftoi( (Double)((Int)iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd;
-      if( iYe < (Int)uiScaledBlockSize )
-      {
-        ruhXe = (UChar)(uiScaledBlockSize-1);
-        ruhYe = (UChar)std::max( iYe, 0 );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 );
-        ruhYe = (UChar)(uiScaledBlockSize-1);
-        return;
-      }
-    }
-    else
-    {
-      Int iXe = iVirtualEndX + iDeltaEnd;
-      if( iXe < 0 )
-      {
-        ruhXe = 0;
-        ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 );
-        return;
-      }
-      else if( iXe > iMaxPos )
-      {
-        ruhXe = (UChar)(uiScaledBlockSize-1);
-        ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 );
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-      else
-      {
-        ruhXe = (UChar)iXe;
-        ruhYe = (UChar)(uiScaledBlockSize-1);
-        return;
-      }
-    }
-  }
-}
-
-UInt TComPrediction::xGetWedgePatternIdx( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe )
-{
-  WedgeRefList* pcWedgeRefList = &g_dmmWedgeRefLists[(g_aucConvertToBit[uiBlockSize])];
-  for( UInt uiIdx = 0; uiIdx < pcWedgeRefList->size(); uiIdx++ )
-  {
-    TComWedgeRef* pcTestWedgeRef = &(pcWedgeRefList->at(uiIdx));
-    if( pcTestWedgeRef->getStartX() == uhXs && pcTestWedgeRef->getStartY() == uhYs && pcTestWedgeRef->getEndX() == uhXe && pcTestWedgeRef->getEndY() == uhYe )
-    {
-      return pcTestWedgeRef->getRefIdx();
-    }
-  }
-  return 0;
-}
-#endif
-#endif
+#endif
+
 #if H_3D_DIM_RBC
 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC )
@@ -3348,8 +2064,6 @@
 #if H_3D_DIM_SDC
 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
-#if KWU_SDC_SIMPLE_DC_E0117
                                          ,UInt uiIntraMode
                                          ,Bool orgDC
-#endif
                                         )
 {
@@ -3359,5 +2073,4 @@
   memset(iSumPix, 0, sizeof(Int)*2);
   
-#if KWU_SDC_SIMPLE_DC_E0117
   if (orgDC == false)
   {
@@ -3385,5 +2098,4 @@
     return;
   }
-#endif
 
   Int subSamplePix;
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.h	(revision 646)
@@ -76,9 +76,5 @@
   Int    m_iLumaRecStride;       ///< stride of #m_pLumaRecBuffer array
 #if H_3D_IC
-#if SHARP_ILLUCOMP_REFINE_E0046
   UInt   m_uiaShift[ 64 ];       // Table for multiplication to substitue of division operation
-#else
-  UInt   m_uiaShift[ 63 ];       // Table for multiplication to substitue of division operation
-#endif
 #endif
 
@@ -88,7 +84,5 @@
   Int  xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true);
 #endif
-#if NTT_VSP_COMMON_E0207_E0208
   TComYuv   m_cYuvDepthOnVsp;
-#endif
 #endif
 
@@ -126,12 +120,7 @@
 
 #if H_3D_VSP
-#if NTT_VSP_COMMON_E0207_E0208
   Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int txtPerDepthX=1, Int txtPerDepthY=1 );
   Void xPredInterLumaBlkFromDM    ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi );
   Void xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi );
-#else
-  Void xPredInterLumaBlkFromDM  ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi );
-  Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi );
-#endif
 #endif
 
@@ -140,9 +129,5 @@
   Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
 #if H_3D_IC
-#if SHARP_ILLUCOMP_REFINE_E0046
   Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType );
-#else
-  Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType );
-#endif
 #endif
   Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight );
@@ -154,18 +139,7 @@
   Void xAssignBiSegDCs          ( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel   valDC1, Pel   valDC2 );
 #if H_3D_DIM_DMM
-#if !SEC_DMM2_E0146_HHIFIX
-  UInt xPredWedgeFromIntra      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 );
-#endif
   UInt xPredWedgeFromTex        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx );
   Void xPredContourFromTex      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge );
-
   Void xCopyTextureLumaBlock    ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight );
-
-#if !SEC_DMM2_E0146_HHIFIX
-  Void xGetBlockOffset          ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY );
-  Bool xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY );
-  Void xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd = 0 );
-  UInt xGetWedgePatternIdx      ( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe );
-#endif
 #endif
 #if H_3D_DIM_RBC
@@ -196,8 +170,6 @@
 #if H_3D_DIM_SDC
   Void analyzeSegmentsSDC         ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
-#if KWU_SDC_SIMPLE_DC_E0117
                                     ,UInt uiIntraMode 
                                     ,Bool orgDC=false
-#endif
     );
 #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 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.cpp	(revision 646)
@@ -542,5 +542,5 @@
   cDtParam.bUseIC       = false;
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   cDtParam.bUseSDCMRSAD = false;
 #endif
@@ -605,10 +605,6 @@
     dist = (Dist) (iDWeight * distDepth + iVSOWeight * dist ) / ( iDWeight + iVSOWeight);
   }
-#if H_3D_FIX_UINT_WARNING
+
   return (UInt) dist; 
-#else
-  return dist; 
-#endif
-
 }
 #endif
@@ -652,5 +648,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -692,5 +688,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -735,5 +731,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -782,5 +778,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -838,5 +834,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -886,5 +882,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -944,5 +940,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -1016,5 +1012,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -1081,5 +1077,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -1185,5 +1181,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -1261,5 +1257,5 @@
 #endif
 
-#if H_3D_IC || LGE_INTER_SDC_E0156
+#if H_3D_IC || H_3D_INTER_SDC
 UInt TComRdCost::xGetSADic( DistParam* pcDtParam )
 {
@@ -3513,5 +3509,5 @@
   }
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   if( pcDtParam->bUseSDCMRSAD )
   {
@@ -3616,5 +3612,5 @@
 }
 
-#if H_3D_IC || LGE_INTER_SDC_E0156
+#if H_3D_IC || H_3D_INTER_SDC
 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam )
 {
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h	(revision 646)
@@ -94,5 +94,5 @@
   Bool  bUseIC;
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool  bUseSDCMRSAD;
 #endif
@@ -136,5 +136,5 @@
     iStrideVir = 0;
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
     bUseSDCMRSAD = false;
 #endif
@@ -283,5 +283,5 @@
   static UInt xGetSSE64         ( DistParam* pcDtParam );
   static UInt xGetSSE16N        ( DistParam* pcDtParam );
-#if H_3D_IC || LGE_INTER_SDC_E0156
+#if H_3D_IC || H_3D_INTER_SDC
   static UInt xGetSADic         ( DistParam* pcDtParam );
   static UInt xGetSAD4ic        ( DistParam* pcDtParam );
@@ -311,5 +311,5 @@
 
 #if AMP_SAD
-#if H_3D_IC || LGE_INTER_SDC_E0156
+#if H_3D_IC || H_3D_INTER_SDC
   static UInt xGetSAD12ic       ( DistParam* pcDtParam );
   static UInt xGetSAD24ic       ( DistParam* pcDtParam );
@@ -322,5 +322,5 @@
 #endif
 
-#if H_3D_IC || LGE_INTER_SDC_E0156
+#if H_3D_IC || H_3D_INTER_SDC
   static UInt xGetHADsic          ( DistParam* pcDtParam );
 #endif
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp	(revision 646)
@@ -1950,5 +1950,5 @@
     m_depthRefinementFlag  [ i ] = false;
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
     m_bInterSDCFlag        [ i ] = false;
 #endif
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h	(revision 646)
@@ -653,5 +653,5 @@
   Bool        m_ivMvScalingFlag; 
 #endif
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool        m_bInterSDCFlag[MAX_NUM_LAYERS   ];
 #endif
@@ -943,5 +943,5 @@
   Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
   Void    setIvMvScalingFlag   ( Bool b )                 { m_ivMvScalingFlag = b;    }  
-#if LGE_INTER_SDC_E0156
+#if H_3D_INTER_SDC
   Bool    getInterSDCFlag      ( Int layerIdInVps )           { return m_bInterSDCFlag[layerIdInVps]; }
   Void    setInterSDCFlag      ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; }
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 646)
@@ -175,474 +175,4 @@
 }
 
-#if !SEC_DMM2_E0146_HHIFIX
-Bool TComWedgelet::checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset )
-{
-  WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];
-  UInt uiContDStartEndMax = 0;
-  UInt uiContDStartEndOffset = 0;
-  switch( eContDWedgeRes )
-  {
-  case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }
-  case(   FULL_PEL ): { uiContDStartEndMax =  uiPredDirBlockSize;     uiContDStartEndOffset =  uiPredDirBlockOffset;     break; }
-  case(   HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }
-  }
-
-  if( m_uhOri == 2 || m_uhOri == 3 || m_uhOri == 4 )
-  {
-    UInt uiThisStartEndMax = 0;
-    switch( m_eWedgeRes )
-    {
-    case( DOUBLE_PEL ): { uiThisStartEndMax = (m_uiWidth>>1); break; }
-    case(   FULL_PEL ): { uiThisStartEndMax =  m_uiWidth;     break; }
-    case(   HALF_PEL ): { uiThisStartEndMax = (m_uiWidth<<1); break; }
-    }
-
-    UChar uhStartX = m_uhXs;
-    UChar uhStartY = m_uhYs;
-    UChar uhEndX   = m_uhXe;
-    UChar uhEndY   = m_uhYe;
-
-    if( 2 == m_uhOri )
-    {
-      std::swap( uhStartX, uhEndX );
-      std::swap( uhStartY, uhEndY );
-    }
-
-    UInt uiScaledEndX = (UInt)uhEndX;
-    Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;
-    if( iDeltaRes > 0 ) { uiScaledEndX <<=  iDeltaRes; }
-    if( iDeltaRes < 0 ) { uiScaledEndX >>= -iDeltaRes; }
-
-    if( ((UInt)uhEndY == (uiThisStartEndMax-1)) && ((uiScaledEndX-uiContDStartEndOffset) > 0 && (uiScaledEndX-uiContDStartEndOffset) < (uiContDStartEndMax-1)) )
-    {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-Bool TComWedgelet::checkPredDirLeftPossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset )
-{
-  WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];
-  UInt uiContDStartEndMax = 0;
-  UInt uiContDStartEndOffset = 0;
-  switch( eContDWedgeRes )
-  {
-  case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }
-  case(   FULL_PEL ): { uiContDStartEndMax =  uiPredDirBlockSize;     uiContDStartEndOffset =  uiPredDirBlockOffset;     break; }
-  case(   HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }
-  }
-
-  if( m_uhOri == 1 || m_uhOri == 2 || m_uhOri == 5 )
-  {
-    UInt uiThisStartEndMax = 0;
-    switch( m_eWedgeRes )
-    {
-    case( DOUBLE_PEL ): { uiThisStartEndMax = (m_uiHeight>>1); break; }
-    case(   FULL_PEL ): { uiThisStartEndMax =  m_uiHeight;     break; }
-    case(   HALF_PEL ): { uiThisStartEndMax = (m_uiHeight<<1); break; }
-    }
-
-    UChar uhStartX = m_uhXs;
-    UChar uhStartY = m_uhYs;
-    UChar uhEndX   = m_uhXe;
-    UChar uhEndY   = m_uhYe;
-
-    if( 1 == m_uhOri || 5 == m_uhOri )
-    {
-      std::swap( uhStartX, uhEndX );
-      std::swap( uhStartY, uhEndY );
-    }
-
-    UInt uiScaledEndY = (UInt)uhEndY;
-    Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;
-    if( iDeltaRes > 0 ) { uiScaledEndY <<=  iDeltaRes; }
-    if( iDeltaRes < 0 ) { uiScaledEndY >>= -iDeltaRes; }
-
-    if( ((UInt)uhEndX == (uiThisStartEndMax-1)) && ((uiScaledEndY-uiContDStartEndOffset) > 0 && (uiScaledEndY-uiContDStartEndOffset) < (uiContDStartEndMax-1)) )
-    {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-Void TComWedgelet::getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd )
-{
-  ruhXs = 0;
-  ruhYs = 0;
-  ruhXe = 0;
-  ruhYe = 0;
-
-  // get start/end of reference (=this) wedgelet
-  UInt uiRefStartX = (UInt)getStartX();
-  UInt uiRefStartY = (UInt)getStartY();
-  UInt uiRefEndX   = (UInt)getEndX();
-  UInt uiRefEndY   = (UInt)getEndY();
-
-  WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];
-  UInt uiContDStartEndMax = 0;
-  UInt uiContDStartEndOffset = 0;
-  switch( eContDWedgeRes )
-  {
-  case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }
-  case(   FULL_PEL ): { uiContDStartEndMax =  uiPredDirBlockSize;     uiContDStartEndOffset =  uiPredDirBlockOffset;     break; }
-  case(   HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }
-  }
-  Int iContDMaxPos = (Int)uiContDStartEndMax - 1;
-
-  // swap if start/end if line orientation is not from top to bottom
-  if( 2 == (UInt)getOri() )
-  {
-    std::swap( uiRefStartX, uiRefEndX );
-    std::swap( uiRefStartY, uiRefEndY );
-  }
-
-  // calc slopes
-  Int iA_DeltaX = (Int)uiRefEndX - (Int)uiRefStartX;
-  Int iA_DeltaY = (Int)uiRefEndY - (Int)uiRefStartY;
-
-  // get aligned end x value of ref wedge
-  UInt uiScaledRefEndX = uiRefEndX;
-  Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;
-  if( iDeltaRes > 0 ) { uiScaledRefEndX <<=  iDeltaRes; }
-  if( iDeltaRes < 0 ) { uiScaledRefEndX >>= -iDeltaRes; }
-
-  assert( uiScaledRefEndX >= uiContDStartEndOffset );
-  Int iAlignedRefEndX = (Int)uiScaledRefEndX - (Int)uiContDStartEndOffset;
-
-  // special for straight vertical wedge
-  if( iA_DeltaX == 0 )
-  {
-    ruhXs = (UChar)iAlignedRefEndX;
-    ruhYs = 0;
-
-    Int iXe = iAlignedRefEndX + iDeltaEnd;
-    if( iXe < 0 )
-    {
-      ruhXe = 0;
-      ruhYe = (UChar)min( max( (iContDMaxPos + iXe), 0 ), iContDMaxPos );
-
-      return;
-    }
-    else if( iXe > iContDMaxPos )
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)min( max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 ), iContDMaxPos );
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)iXe;
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-  }
-
-  // special for straight horizontal short bottom line
-  if( iA_DeltaY == 0 )
-  {
-    switch( (UInt)getOri() )
-    {
-    case( 2 ):
-      {
-        ruhXs = (UChar)(iAlignedRefEndX-1);
-        ruhYs = 0;
-        ruhXe = 0;
-        ruhYe = (UChar)min( max( iDeltaEnd, 0 ), iContDMaxPos );
-
-        return;
-      }
-    case( 3 ):
-      {
-        ruhXs = (UChar)(iAlignedRefEndX+1);
-        ruhYs = 0;
-        ruhXe = (UChar)iContDMaxPos;
-        ruhYe = (UChar)min( max( -iDeltaEnd, 0 ), iContDMaxPos );
-
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-    default:
-      {
-        assert( 0 );
-        return;
-      }
-    }
-  }
-
-  // set start point depending on slope
-  if( abs( iA_DeltaX ) >= abs( iA_DeltaY ) ) { if( iA_DeltaX < 0 ) { ruhXs = (UChar)(iAlignedRefEndX-1); ruhYs = 0; }
-                                                if( iA_DeltaX > 0 ) { ruhXs = (UChar)(iAlignedRefEndX+1); ruhYs = 0; } }
-  else                                                             { ruhXs = (UChar)(iAlignedRefEndX);   ruhYs = 0;   }
-
-  // calc end point and determine orientation
-  Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iContDMaxPos * ((Double)iA_DeltaX / (Double)iA_DeltaY) );
-
-  if( iVirtualEndX < 0 )
-  {
-    Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iA_DeltaY / (Double)iA_DeltaX) ) + iDeltaEnd;
-    if( iYe < (Int)uiContDStartEndMax )
-    {
-      ruhXe = 0;
-      ruhYe = (UChar)max( iYe, 0 );
-
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)min( (iYe - iContDMaxPos), iContDMaxPos );
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-  }
-  else if( iVirtualEndX > iContDMaxPos )
-  {
-    Int iYe = roftoi( (Double)(iContDMaxPos - (Int)ruhXs) * ((Double)iA_DeltaY / (Double)iA_DeltaX) ) - iDeltaEnd;
-    if( iYe < (Int)uiContDStartEndMax )
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)max( iYe, 0 );
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 );
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-  }
-  else
-  {
-    Int iXe = iVirtualEndX + iDeltaEnd;
-    if( iXe < 0 )
-    {
-      ruhXe = 0;
-      ruhYe = (UChar)max( (iContDMaxPos + iXe), 0 );
-
-      return;
-    }
-    else if( iXe > iContDMaxPos )
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 );
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)iXe;
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-  }
-}
-
-Void TComWedgelet::getPredDirStartEndLeft( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd )
-{
-  ruhXs = 0;
-  ruhYs = 0;
-  ruhXe = 0;
-  ruhYe = 0;
-
-  // get start/end of reference (=this) wedgelet
-  UInt uiRefStartX = (UInt)getStartX();
-  UInt uiRefStartY = (UInt)getStartY();
-  UInt uiRefEndX   = (UInt)getEndX();
-  UInt uiRefEndY   = (UInt)getEndY();
-
-  WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];
-  UInt uiContDStartEndMax = 0;
-  UInt uiContDStartEndOffset = 0;
-  switch( eContDWedgeRes )
-  {
-  case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }
-  case(   FULL_PEL ): { uiContDStartEndMax =  uiPredDirBlockSize;     uiContDStartEndOffset =  uiPredDirBlockOffset;     break; }
-  case(   HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }
-  }
-  Int iContDMaxPos = (Int)uiContDStartEndMax - 1;
-
-  // swap if start/end if line orientation is not from left to right
-  if( 1 == (UInt)getOri() || 5 == (UInt)getOri() )
-  {
-    std::swap( uiRefStartX, uiRefEndX );
-    std::swap( uiRefStartY, uiRefEndY );
-  }
-
-  Int iL_DeltaX = (Int)uiRefEndX - (Int)uiRefStartX;
-  Int iL_DeltaY = (Int)uiRefEndY - (Int)uiRefStartY;
-
-  UInt uiScaledRefEndY = uiRefEndY;
-  Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;
-  if( iDeltaRes > 0 ) { uiScaledRefEndY <<=  iDeltaRes; }
-  if( iDeltaRes < 0 ) { uiScaledRefEndY >>= -iDeltaRes; }
-
-  assert( uiScaledRefEndY >= uiContDStartEndOffset );
-  Int iAlignedRefEndY = (Int)uiScaledRefEndY - (Int)uiContDStartEndOffset;
-
-  // special for straight horizontal wedge
-  if( iL_DeltaY == 0 )
-  {
-    ruhXs = 0;
-    ruhYs = (UChar)iAlignedRefEndY;
-
-    Int iYe = iAlignedRefEndY - iDeltaEnd;
-    if( iYe < 0 )
-    {
-      ruhXe = (UChar)min( max( (iContDMaxPos + iYe), 0 ), iContDMaxPos );
-      ruhYe = 0;
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-    else if( iYe > iContDMaxPos )
-    {
-      ruhXe = (UChar)min( max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 ), iContDMaxPos );
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)iYe;
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-  }
-
-  // special for straight vertical short right line
-  if( iL_DeltaX == 0 )
-  {
-    switch( (UInt)getOri() )
-    {
-    case( 1 ):
-      {
-        ruhXs = 0;
-        ruhYs = (UChar)(iAlignedRefEndY+1);
-        ruhXe = (UChar)min( max( iDeltaEnd, 0 ), iContDMaxPos );
-        ruhYe = (UChar)iContDMaxPos;
-
-        return;
-      }
-    case( 2 ):
-      {
-        ruhXs = 0;
-        ruhYs = (UChar)(iAlignedRefEndY-1);
-        ruhXe = (UChar)min( max( -iDeltaEnd, 0 ), iContDMaxPos );
-        ruhYe = 0;
-
-        std::swap( ruhXs, ruhXe );
-        std::swap( ruhYs, ruhYe );
-        return;
-      }
-    default:
-      {
-        assert( 0 );
-        return;
-      }
-    }
-  }
-
-  // set start point depending on slope
-  if( abs( iL_DeltaY ) >= abs( iL_DeltaX ) ) { if( iL_DeltaY < 0 ) { ruhYs = (UChar)(iAlignedRefEndY-1); ruhXs = 0; }
-                                               if( iL_DeltaY > 0 ) { ruhYs = (UChar)(iAlignedRefEndY+1); ruhXs = 0; } }
-  else                                       {                       ruhYs = (UChar)(iAlignedRefEndY);   ruhXs = 0;   }
-
-  // calc end point and determine orientation
-  Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iContDMaxPos * ((Double)iL_DeltaY / (Double)iL_DeltaX) );
-
-  if( iVirtualEndY < 0 )
-  {
-    Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iL_DeltaX / (Double)iL_DeltaY) ) - iDeltaEnd;
-    if( iXe < (Int)uiContDStartEndMax )
-    {
-      ruhXe = (UChar)max( iXe, 0 );
-      ruhYe = 0;
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)min( (iXe - iContDMaxPos), iContDMaxPos );
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-  }
-  else if( iVirtualEndY > iContDMaxPos )
-  {
-    Int iXe = roftoi( (Double)(iContDMaxPos - (Int)ruhYs ) * ((Double)iL_DeltaX / (Double)iL_DeltaY) ) + iDeltaEnd;
-    if( iXe < (Int)uiContDStartEndMax )
-    {
-      ruhXe = (UChar)max( iXe, 0 );
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 );
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-  }
-  else
-  {
-    Int iYe = iVirtualEndY - iDeltaEnd;
-    if( iYe < 0 )
-    {
-      ruhXe = (UChar)max( (iContDMaxPos + iYe), 0 );
-      ruhYe = 0;
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-    else if( iYe > iContDMaxPos )
-    {
-      ruhXe = (UChar)max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 );
-      ruhYe = (UChar)iContDMaxPos;
-
-      return;
-    }
-    else
-    {
-      ruhXe = (UChar)iContDMaxPos;
-      ruhYe = (UChar)iYe;
-
-      std::swap( ruhXs, ruhXe );
-      std::swap( ruhYs, ruhYe );
-      return;
-    }
-  }
-}
-#endif
-
 Void TComWedgelet::xGenerateWedgePattern()
 {
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.h	(revision 646)
@@ -50,22 +50,11 @@
 enum DIM_IDX
 {
-#if SEC_DMM2_E0146_HHIFIX
   DMM1_IDX = 0,
   DMM3_IDX = 1,
   DMM4_IDX = 2,
   RBC_IDX  = 3
-#else
-  DMM1_IDX = 0,
-  DMM2_IDX = 3,
-  DMM3_IDX = 1,
-  DMM4_IDX = 2,
-  RBC_IDX  = 4
-#endif
 };
-#if SEC_DMM2_E0146_HHIFIX
+
 #define DMM_NUM_TYPE   3
-#else
-#define DMM_NUM_TYPE   4
-#endif
 #define RBC_NUM_TYPE   1
 #define DIM_NUM_TYPE   (DMM_NUM_TYPE+RBC_NUM_TYPE)
@@ -86,7 +75,4 @@
 #define DMM_NO_WEDGEINDEX       MAX_UINT
 #define DMM_NUM_WEDGE_REFINES   8
-#if !SEC_DMM2_E0146_HHIFIX
-#define DMM2_DELTAEND_MAX       4
-#endif
 #define DMM3_SIMPLIFY_TR        1
 
@@ -151,11 +137,4 @@
   Bool  checkInvIdentical( Bool* pbRefPattern );
 
-#if !SEC_DMM2_E0146_HHIFIX
-  // functions for DMM2 prediction
-  Bool  checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );
-  Bool  checkPredDirLeftPossible ( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );
-  Void  getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );
-  Void  getPredDirStartEndLeft ( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );
-#endif
 };  // END CLASS DEFINITION TComWedgelet
 
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 645)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 646)
@@ -97,4 +97,6 @@
                                               // Unifying rounding offset, for IC part, JCT3V-D0135
                                               // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
+                                              // SHARP_ILLUCOMP_REFINE_E0046
+                                              // MTK_CLIPPING_ALIGN_IC_E0168       // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
 
 #if H_3D_NBDV
@@ -103,4 +105,5 @@
                                               // MERL_D0166: Reference view selection in NBDV & Bi-VSP
                                               // MERL_C0152: Basic VSP
+                                              // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV
 #endif
 
@@ -112,4 +115,7 @@
                                               // LG_D0092: Multiple VSP candidate allowed
                                               // MTK_VSP_FIX_ALIGN_WD_E0172
+                                              // NTT_VSP_ADAPTIVE_SPLIT_E0207 adaptive sub-PU partitioning in VSP, JCT3V-E0207
+                                              // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208
+                                              // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208
 #define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
                                               // HHI_INTER_VIEW_MOTION_PRED 
@@ -139,22 +145,27 @@
                                               // FIX_SDC_ENC_RD_WVSO_D0163
                                               // MTK_SAMPLE_BASED_SDC_D0110
+                                              // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs
+                                              // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode
+                                              // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC
+                                              // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal
+#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
 
 
+
+// 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 SHARP_ILLUCOMP_REFINE_E0046       1
 #define MTK_FAST_TEXTURE_ENCODING_E0173   1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
-#define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170            1   // Progressive MV Compression, JCT3V-E0170
-#define LGE_INTER_SDC_E0156               1   // Enable inter SDC for depth coding
-
-#if H_3D_IC
-#define MTK_CLIPPING_ALIGN_IC_E0168       1   // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
-#endif
+
 
 #if H_3D_NBDV
-#define NBDV_DEFAULT_VIEWIDX_BUGFIX       1  // Bug fix for invalid default view index for 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
@@ -172,18 +183,5 @@
 
 #if H_3D_DIM
-#define SEC_DMM2_E0146_HHIFIX             1   // Removal of DMM2 from DMMs
-#define ZJU_DEPTH_INTRA_MODE_E0204        1   // Simplified Binarization for depth_intra_mode
-#define KWU_SDC_SIMPLE_DC_E0117           1   // Simplified DC calculation for SDC
-#define SCU_HS_DMM4_REMOVE_DIV_E0242      1   // DMM4 Division Removal
 #define SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX     1   // Fast DMM and RBC Mode Selection
-#endif
-
-#if H_3D_VSP
-#define NTT_VSP_COMMON_E0207_E0208        1 // common part of JCT3V-E0207 and JCT3V-E0208
-#if NTT_VSP_COMMON_E0207_E0208
-#define NTT_VSP_DC_BUGFIX_E0208           1 // bugfix for sub-PU based DC in VSP, JCT3V-E0208
-#define NTT_VSP_VECTOR_CLIP_E0208         1 // disparity vector clipping on fetching depth map in VSP, JCT3V-E0208
-#define NTT_VSP_ADAPTIVE_SPLIT_E0207      1 // adaptive sub-PU partitioning in VSP, JCT3V-E0207
-#endif
 #endif
 
@@ -193,14 +191,4 @@
 #define H_3D_FCO_VSP_DONBDV_E0163               0   // Adaptive depth reference for flexible coding order
 #endif
-
-#define H_3D_REN_MAX_DEV_OUT              0  // Output maximal possible shift deviation 
-
-/// FIXES
-#define H_3D_FIX_BVSP                     1  // DV from NBDV instead of DoNBDV should be used
-#define H_3D_FIX_TICKET_036               1  // fix for ticket #36
-#define H_3D_FIX_REN                      1  // fix of erroneous inpainting for renderer
-#define H_3D_FIX_REN_WARNING              1  // fix of warning related to camera parameter precision
-
-#define H_3D_FIX_UINT_WARNING             1  // explicit in VSD
 #endif // H_3D
 
@@ -281,4 +269,13 @@
 #endif
 
+///// ***** ILLUMATION COMPENSATION *********
+
+
+#if H_3D_IC
+#define IC_REG_COST_SHIFT 7
+#define IC_CONST_SHIFT 5
+#define IC_SHIFT_DIFF 12
+#endif
+
 /////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////   HM RELATED DEFINES ////////////////////////////////
@@ -505,9 +502,5 @@
 
 #if H_3D_VSO_DIST_INT
-#if H_3D_FIX_TICKET_036
 typedef       Int64            Dist;       ///< RDO distortion
-#else
-typedef       Int              Dist;       ///< RDO distortion
-#endif
 typedef       Int64            Dist64; 
 #define       RDO_DIST_MIN     MIN_INT
