Index: /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 764)
@@ -378,7 +378,4 @@
 #if H_3D_DIM
   ("DMM",                   m_useDMM,           true,  "Depth intra model modes")
-#if !SEC_DMM3_RBC_F0147
-  ("RBC",                   m_useRBC,           true,  "Region boundary chain mode")
-#endif
   ("SDC",                   m_useSDC,           true,  "Simplified depth coding")
   ("DLT",                   m_useDLT,           true,  "Depth lookup table")
@@ -523,9 +520,5 @@
 
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
   ("IlluCompEnable",           m_abUseIC, true, "Enable illumination compensation")
-#else
-  ("IlluCompEnable",           m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation")
-#endif
 #endif
 #if H_3D_INTER_SDC
@@ -2518,9 +2511,5 @@
 #endif
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
   printf( "IlluCompEnable: %d ", m_abUseIC);
-#else
-  printf( "IlluCompEnable: %d %d ", m_abUseIC[0] ? 1 : 0, m_abUseIC[1] ? 1 : 0 );
-#endif
 #endif
 #if H_3D_NBDV_REF
@@ -2535,7 +2524,4 @@
 #if H_3D_DIM
   printf("DMM:%d ", m_useDMM );
-#if !SEC_DMM3_RBC_F0147
-  printf("RBC:%d ", m_useRBC );
-#endif
   printf("SDC:%d ", m_useSDC );
   printf("DLT:%d ", m_useDLT );
Index: /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.h	(revision 764)
@@ -150,9 +150,5 @@
 #endif
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
   Bool   m_abUseIC;
-#else
-  vector<Bool> m_abUseIC;                                    ///< flag for using illumination compensation for inter-view prediction
-#endif
 #endif
 #if H_3D_NBDV_REF
@@ -497,7 +493,4 @@
 #if H_3D_DIM
   Bool      m_useDMM;                                        ///< flag for using DMM
-#if !SEC_DMM3_RBC_F0147
-  Bool      m_useRBC;                                        ///< flag for using RBC
-#endif
   Bool      m_useSDC;                                        ///< flag for using SDC
   Bool      m_useDLT;                                        ///< flag for using DLT
Index: /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 764)
@@ -198,16 +198,9 @@
 #endif
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
     m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
-#else
-    m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] );
-#endif
 #endif
   //========== Depth intra modes ==========
 #if H_3D_DIM
     m_cTEncTop.setUseDMM                       ( isDepth ? m_useDMM               : false );
-#if !SEC_DMM3_RBC_F0147
-    m_cTEncTop.setUseRBC                       ( isDepth ? m_useRBC               : false );
-#endif
     m_cTEncTop.setUseSDC                       ( isDepth ? m_useSDC               : false );
     m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT               : false );
@@ -1997,9 +1990,5 @@
 
 #if H_3D_DIM
-#if SEC_DMM3_RBC_F0147
     vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useSDC || m_useDLT ) );
-#else
-    vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useRBC || m_useSDC || m_useDLT ) );
-#endif
 #if H_3D_DIM_DLT
 #if !DLT_DIFF_CODING_IN_PPS
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 764)
@@ -109,17 +109,7 @@
 #define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
 #define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
-#if QC_DIM_DELTADC_UNIFY_F0132
 #define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
-#else
-#define NUM_DDC_DATA_CTX              2       ///< number of context models for deltaDC data (DMM or RBC)
-#endif
 #if H_3D_DIM_DMM
 #define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
-#if !SEC_DMM3_RBC_F0147
-#define NUM_DMM3_DATA_CTX             1       ///< number of context models for DMM3 data
-#endif
-#endif
-#if H_3D_DIM_RBC
-#define NUM_RBC_DATA_CTX              1       ///< number of context models for RBC data
 #endif
 #endif
@@ -393,13 +383,7 @@
 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] =  
 {
-#if LGE_IC_CTX_F0160
     { 154,  154,  154, },
     { 154,  154,  154, },
     { 154,  154,  154, },
-#else
-  { CNU,  CNU,  CNU, }, 
-  { 197,  185,  201, }, 
-  { 197,  185,  201, }, 
-#endif
 };
 #endif
@@ -423,13 +407,7 @@
 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 
 {
-#if QC_DIM_DELTADC_UNIFY_F0132
-  { 154 }, 
-  { 154 }, 
-  { 154 }, 
-#else
-  { CNU, CNU }, 
-  { CNU, CNU }, 
-  { CNU, CNU }, 
-#endif
+  { 154 }, 
+  { 154 }, 
+  { 154 }, 
 };
 #if H_3D_DIM_DMM
@@ -441,22 +419,4 @@
   { CNU }, 
 };
-#if !SEC_DMM3_RBC_F0147
-static const UChar
-INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] = 
-{
-  { CNU }, 
-  { CNU }, 
-  { CNU }, 
-};
-#endif
-#endif
-#if H_3D_DIM_RBC
-static const UChar
-INIT_RBC_DATA[3][NUM_RBC_DATA_CTX] = 
-{
-  { CNU }, 
-  { CNU }, 
-  { CNU }, 
-};
 #endif
 #if H_3D_DIM_SDC
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 764)
@@ -120,14 +120,4 @@
     m_dmmWedgeTabIdx[i] = NULL;
   }
-#if !SEC_DMM3_RBC_F0147
-  m_dmm3IntraTabIdx = NULL;
-#endif
-#endif
-#if H_3D_DIM_RBC
-  m_pucEdgeCode     = NULL;
-  m_pucEdgeNumber   = NULL;
-  m_pucEdgeStartPos = NULL;
-  m_pbEdgeLeftFirst = NULL;
-  m_pbEdgePartition = NULL;
 #endif
 #if H_3D_DIM_SDC
@@ -279,14 +269,4 @@
       m_dmmWedgeTabIdx[i]    = (UInt*)xMalloc(UInt, uiNumPartition);
     }
-#if !SEC_DMM3_RBC_F0147
-    m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition);
-#endif
-#endif
-#if H_3D_DIM_RBC
-    m_pucEdgeCode     = (UChar*)xMalloc(UChar, uiNumPartition * RBC_MAX_EDGE_NUM_PER_4x4);
-    m_pucEdgeNumber   = (UChar*)xMalloc(UChar, uiNumPartition);
-    m_pucEdgeStartPos = (UChar*)xMalloc(UChar, uiNumPartition);
-    m_pbEdgeLeftFirst = (Bool*)xMalloc(Bool, uiNumPartition);
-    m_pbEdgePartition = (Bool*)xMalloc(Bool, uiNumPartition * 16);
 #endif
 #if H_3D_DIM_SDC
@@ -417,14 +397,4 @@
       if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; }
     }
-#if !SEC_DMM3_RBC_F0147
-    if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; }
-#endif
-#endif
-#if H_3D_DIM_RBC
-    if ( m_pbEdgeLeftFirst ) { xFree( m_pbEdgeLeftFirst ); m_pbEdgeLeftFirst = NULL; }
-    if ( m_pucEdgeStartPos ) { xFree( m_pucEdgeStartPos ); m_pucEdgeStartPos = NULL; }
-    if ( m_pucEdgeNumber   ) { xFree( m_pucEdgeNumber   ); m_pucEdgeNumber   = NULL; }
-    if ( m_pucEdgeCode     ) { xFree( m_pucEdgeCode     ); m_pucEdgeCode     = NULL; }
-    if ( m_pbEdgePartition ) { xFree( m_pbEdgePartition ); m_pbEdgePartition = NULL; }
 #endif
 #if H_3D_DIM_SDC
@@ -643,14 +613,4 @@
       memset( m_dmmWedgeTabIdx[i] + firstElement, 0,                      numElements * sizeof( *m_dmmWedgeTabIdx[i] ) );
     }
-#if !SEC_DMM3_RBC_F0147
-    memset( m_dmm3IntraTabIdx   + firstElement, 0,                        numElements * sizeof( *m_dmm3IntraTabIdx ) );
-#endif
-#endif
-#if H_3D_DIM_RBC
-    memset( m_pucEdgeCode       + firstElement, 0,                        numElements * sizeof( *m_pucEdgeCode     ) * RBC_MAX_EDGE_NUM_PER_4x4 );
-    memset( m_pucEdgeNumber     + firstElement, 0,                        numElements * sizeof( *m_pucEdgeNumber   ) );
-    memset( m_pucEdgeStartPos   + firstElement, 0,                        numElements * sizeof( *m_pucEdgeStartPos ) );
-    memset( m_pbEdgeLeftFirst   + firstElement, false,                    numElements * sizeof( *m_pbEdgeLeftFirst ) );
-    memset( m_pbEdgePartition   + firstElement, false,                    numElements * sizeof( *m_pbEdgePartition ) * 16 );
 #endif
 #if H_3D_DIM_SDC
@@ -825,7 +785,4 @@
         m_dmmWedgeTabIdx[i] [ui] = 0;
       }
-#if !SEC_DMM3_RBC_F0147
-      m_dmm3IntraTabIdx [ui] = 0;
-#endif
 #endif
 #if H_3D_DIM_SDC
@@ -941,14 +898,4 @@
     memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition );
   }
-#if !SEC_DMM3_RBC_F0147
-  memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  memset( m_pucEdgeCode    , 0, iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
-  memset( m_pucEdgeNumber  , 0, iSizeInUchar );
-  memset( m_pucEdgeStartPos, 0, iSizeInUchar );
-  memset( m_pbEdgeLeftFirst, 0, iSizeInBool );
-  memset( m_pbEdgePartition, 0, iSizeInBool * 16 );
 #endif
 #if H_3D_DIM_SDC
@@ -1028,7 +975,4 @@
         m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui];
       }
-#if !SEC_DMM3_RBC_F0147
-      m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui];
-#endif
 #endif
 #if H_3D_DIM_SDC
@@ -1187,14 +1131,4 @@
     m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart;
   }
-#if !SEC_DMM3_RBC_F0147
-  m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart;
-#endif
-#endif
-#if H_3D_DIM_RBC
-  m_pucEdgeCode     = pcCU->getEdgeCode( uiPart );
-  m_pucEdgeNumber   = pcCU->getEdgeNumber()      + uiPart;
-  m_pucEdgeStartPos = pcCU->getEdgeStartPos()    + uiPart;
-  m_pbEdgeLeftFirst = pcCU->getEdgeLeftFirst()   + uiPart;
-  m_pbEdgePartition = pcCU->getEdgePartition( uiPart );
 #endif
 #if H_3D_DIM_SDC
@@ -1391,14 +1325,4 @@
     memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition );
   }
-#if !SEC_DMM3_RBC_F0147
-  memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  memcpy( getEdgeCode( uiOffset ),       pcCU->getEdgeCode(0),      iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
-  memcpy( getEdgeNumber()    + uiOffset, pcCU->getEdgeNumber(),     iSizeInUchar );
-  memcpy( getEdgeStartPos()  + uiOffset, pcCU->getEdgeStartPos(),   iSizeInUchar );
-  memcpy( getEdgeLeftFirst() + uiOffset, pcCU->getEdgeLeftFirst(),  iSizeInBool );
-  memcpy( getEdgePartition( uiOffset ),  pcCU->getEdgePartition(0), iSizeInBool * 16 );
 #endif
 #if H_3D_DIM_SDC
@@ -1523,14 +1447,4 @@
     memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition );
   }
-#if !SEC_DMM3_RBC_F0147
-  memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  memcpy( rpcCU->getEdgeCode( m_uiAbsIdxInLCU ),         m_pucEdgeCode,     iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
-  memcpy( rpcCU->getEdgeNumber()      + m_uiAbsIdxInLCU, m_pucEdgeNumber,   iSizeInUchar );
-  memcpy( rpcCU->getEdgeStartPos()    + m_uiAbsIdxInLCU, m_pucEdgeStartPos, iSizeInUchar );
-  memcpy( rpcCU->getEdgeLeftFirst()   + m_uiAbsIdxInLCU, m_pbEdgeLeftFirst, iSizeInBool );
-  memcpy( rpcCU->getEdgePartition( m_uiAbsIdxInLCU ),    m_pbEdgePartition, iSizeInBool * 16 );
 #endif
 #if H_3D_DIM_SDC
@@ -1641,14 +1555,4 @@
     memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart );
   }
-#if !SEC_DMM3_RBC_F0147
-  memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  memcpy( rpcCU->getEdgeCode( uiPartOffset ),         m_pucEdgeCode,     iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );
-  memcpy( rpcCU->getEdgeNumber()      + uiPartOffset, m_pucEdgeNumber,   iSizeInUchar );
-  memcpy( rpcCU->getEdgeStartPos()    + uiPartOffset, m_pucEdgeStartPos, iSizeInUchar );
-  memcpy( rpcCU->getEdgeLeftFirst()   + uiPartOffset, m_pbEdgeLeftFirst, iSizeInBool );
-  memcpy( rpcCU->getEdgePartition( uiPartOffset ),    m_pbEdgePartition, iSizeInBool * 16 );
 #endif
 #if H_3D_DIM_SDC
@@ -2375,5 +2279,4 @@
   UInt        uiCtx = 0;
 
-#if LGE_IC_CTX_F0160
   TComDataCU* pcTempCU = NULL;
   UInt        uiTempPartIdx = 0;
@@ -2384,5 +2287,4 @@
   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
   uiCtx    += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
-#endif
 
   return uiCtx;
@@ -3345,12 +3247,7 @@
  *   false: otherwise
  */
-#if ETRIKHU_MERGE_REUSE_F0093
 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
   Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
-#else
-inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
-                                     Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag )
-#endif
-{
+  {
   if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )
   {
@@ -3367,7 +3264,5 @@
   }
 
-#if ETRIKHU_MERGE_REUSE_F0093
   rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
-#endif
   
   Bool  refViewAvailFlag = false;
@@ -3454,11 +3349,6 @@
 
 #if H_3D_IV_MERGE
-#if ETRIKHU_MERGE_REUSE_F0093
 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, 
   Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
-#else
-inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, 
-                                       Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag )
-#endif
 {
   for(Int iLoop = 0; iLoop < 2; iLoop ++ ) 
@@ -3479,7 +3369,5 @@
         clipMv( cMv );
 
-#if ETRIKHU_MERGE_REUSE_F0093
         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
-#endif
 
         abCandIsInter        [ iCount ] = true;
@@ -3502,26 +3390,13 @@
     if(ivCandDir[iLoop + 2])
     {
-#if ETRIKHU_MERGE_REUSE_F0093
       TComMvField tmpMV[2];
       UChar tmpDir = ivCandDir[iLoop + 2];
-#else
-      abCandIsInter        [ iCount ] = true;
-      puhInterDirNeighbours[ iCount ] = ivCandDir[iLoop + 2];
-#endif
       if( ( ivCandDir[iLoop + 2] & 1 ) == 1 )
       {
-#if ETRIKHU_MERGE_REUSE_F0093
         tmpMV[0].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] ); 
-#else
-        pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] ); 
-#endif
       }
       if( ( ivCandDir[iLoop + 2] & 2 ) == 2 )
       {
-#if ETRIKHU_MERGE_REUSE_F0093
         tmpMV[1].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
-#else
-        pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
-#endif
       }
      
@@ -3530,24 +3405,11 @@
       if( !iLoop && ivCandDir[0] > 0)
       {
-#if ETRIKHU_MERGE_REUSE_F0093
         if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1])
-#else
-        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0 ]== pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[1]==pcMvFieldNeighbours[(iCount<<1)+1])
-#endif
         {
             bRemove                         = true;
-#if !ETRIKHU_MERGE_REUSE_F0093
-            abCandIsInter        [ iCount ] = false;  
-            puhInterDirNeighbours[ iCount ] = 0;
-            TComMv  cZeroMv;
-            pcMvFieldNeighbours  [ iCount<<1   ].setMvField( cZeroMv, NOT_VALID );
-            pcMvFieldNeighbours  [(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-#endif
         }
       }
       if(!bRemove)
       {
-
-#if ETRIKHU_MERGE_REUSE_F0093
         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
 
@@ -3562,6 +3424,4 @@
           pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
         }
-#endif
-
 #if H_3D_NBDV
         if(iLoop) // For IvMcShift candidate
@@ -3603,13 +3463,5 @@
 #endif
 
-
-
-
-
-
-
-
-
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
 Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV)
 {
@@ -3999,5 +3851,5 @@
  * \param numValidMergeCand
  */
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
 #else
@@ -4024,5 +3876,5 @@
   Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   TComMvField tmpMV[2];
   UChar tmpDir;
@@ -4046,11 +3898,6 @@
   {
     abCandIsInter[ui] = false;
-#if H_3D_IV_MERGE
-    pcMvFieldNeighbours[ ( ui << 1 )     ].setMvField(cZeroMv, NOT_VALID);
-    pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID);
-#else
     pcMvFieldNeighbours[ ( ui << 1 )     ].setRefIdx(NOT_VALID);
     pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID);
-#endif
   }
 #endif
@@ -4069,20 +3916,14 @@
 
   UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB;
-#if !ETRIKHU_MERGE_REUSE_F0093
+#if !H_3D
   PartSize cCurPS = getPartitionSize( uiAbsPartIdx );
 #endif
   deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
   deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
-#if SEC_MPI_ENABLING_MERGE_F0150
+#if H_3D
   Bool bMPIFlag   = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() );
-#endif
-#if QC_DEPTH_IV_MRG_F0125
   Bool bIsDepth = getSlice()->getIsDepth();
-#if !BUGFIX_F0093
-  Bool bDepthIPMCAvai = false;
-#endif
 #endif 
 
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
   Bool bICFlag = getICFlag(uiAbsPartIdx);
@@ -4091,7 +3932,6 @@
   Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false;
 #endif
-#endif
-
-#if ETRIKHU_MERGE_REUSE_F0093
+
+#if H_3D
   Int  iPosLeftAbove[2] = {-1, -1};
 
@@ -4118,5 +3958,4 @@
 #if H_3D_VSP
     if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       && !bICFlag
@@ -4125,11 +3964,7 @@
       && !bARPFlag
 #endif
-#endif
       )
     {
       vspFlag[numA1B1B0] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);
-#endif
     }
 #endif
@@ -4150,5 +3985,4 @@
     if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1
 #endif
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       && !bICFlag
@@ -4156,5 +3990,4 @@
 #if H_3D_ARP
       && !bARPFlag
-#endif
 #endif
       )
@@ -4177,10 +4010,5 @@
   {
 #if H_3D_VSP
-#if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F0111
     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 
-#else
-    if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1
-#endif
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       && !bICFlag
@@ -4189,11 +4017,7 @@
       && !bARPFlag
 #endif
-#endif
       )
     {
       vspFlag[numA1B1B0] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);
-#endif
     }
 #endif
@@ -4208,5 +4032,4 @@
 #if H_3D_VSP
     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       && !bICFlag
@@ -4215,11 +4038,7 @@
       && !bARPFlag
 #endif
-#endif
       )
     {
       vspFlag[numA1B1B0] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);
-#endif
     }
 #endif
@@ -4235,10 +4054,5 @@
   {
 #if H_3D_VSP
-#if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F0111
     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 
-#else
-    if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1
-#endif
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       && !bICFlag
@@ -4247,11 +4061,7 @@
       && !bARPFlag
 #endif
-#endif
       )
     {
       vspFlag[numA1B1B0+iCountHEVC] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);
-#endif
     }
 #endif
@@ -4265,23 +4075,16 @@
 
 #if H_3D_IV_MERGE
-  
+
   /////////////////////////////////////////////
   //////// TEXTURE MERGE CANDIDATE (T) ////////
   /////////////////////////////////////////////
-  
-#if SEC_MPI_ENABLING_MERGE_F0150
+
   if( bMPIFlag)
-#else
-  if( m_pcSlice->getIsDepth())
-#endif
   {
     UInt uiPartIdxCenter;
     xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );    
-
-#if ETRIKHU_MERGE_REUSE_F0093
     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     Int tRef[2]={-1, -1};
-#endif
 
 #if H_3D_FCO
@@ -4289,9 +4092,9 @@
     TComDataCU *pcTextureCU = 0;
     if ( pcTexturePic )
-        pcTextureCU = pcTexturePic->getCU( getAddr() );
+      pcTextureCU = pcTexturePic->getCU( getAddr() );
 #else
     TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
 #endif
- 
+
 #if H_3D_FCO
     if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
@@ -4300,5 +4103,4 @@
 #endif
     {
-#if ETRIKHU_MERGE_REUSE_F0093
       pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] );
       tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() );
@@ -4414,59 +4216,7 @@
         }
         iCount ++;
-
-#else
-      pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
-      Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() );
-      if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
-      {
-        TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
-        const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-        cMvPred+=cAdd;
-        cMvPred>>=2;
-        clipMv(cMvPred);
-        pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef);
-      }
-      if ( getSlice()->isInterB() )
-      {
-        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
-        iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() );
-        if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) )
-        {
-          TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
-          const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-          cMvPred+=cAdd;
-          cMvPred>>=2;
-          clipMv(cMvPred);
-          pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef);
-        }
-      }
-      puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0;
-      puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0;
-      if( puhInterDirNeighbours[iCount] != 0 )
-      {
-        abCandIsInter[iCount] = true;
-        if ( mrgCandIdx == iCount )
-        {
-          return;
-        }
-        iCount ++;
-      }
-#endif
-      }
-    }
-  }
-
-
-#if !ETRIKHU_MERGE_REUSE_F0093
-  //////////////////////////////////
-  //////// GET DISPARITIES  ////////
-  //////////////////////////////////
-
-  DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
-  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++)
-  {
-    inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo;
-  }
-#endif
+      }
+    }
+  }
 
   /////////////////////////////////////////////////////////////////
@@ -4475,8 +4225,4 @@
 
   Int  posIvDC          = -1;
-#if !ETRIKHU_MERGE_REUSE_F0093
-  Bool bLeftAvai        = false;
-  Int  iPosLeftAbove[2] = {-1, -1};
-#endif
 
   // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift };  
@@ -4489,17 +4235,10 @@
 
   Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
-  
+
   if ( ivMvPredFlag )
   {
-    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir 
-#if QC_DEPTH_IV_MRG_F0125
-    , bIsDepth
-#endif
-#if MTK_SPIVMP_F0110
-    , pcMvFieldSP, puhInterDirSP
-#endif
-    );
+    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
   }  
-  
+
   ///////////////////////////////////////////////
   //////// INTER VIEW MOTION COMP(IvMC) /////////
@@ -4508,5 +4247,4 @@
   if( ivCandDir[0] )
   {
-#if ETRIKHU_MERGE_REUSE_F0093
     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
@@ -4525,8 +4263,6 @@
     Int iCnloop=0;
 
-#if BUGFIX_F0093
     if (!bIsDepth)
     {
-#endif
       for(Int i = 0; i < 2; i ++)
       {
@@ -4542,22 +4278,11 @@
         }      
       }
-#if BUGFIX_F0093
-    }
-#endif
-#if QC_DEPTH_IV_MRG_F0125
-#if BUGFIX_F0093
+    }
     if (bIsDepth)
-#else
-    if ( bIsDepth && !bRemoveSpa)
-#endif
     {
       iCnloop = iCount-1;
       for(; iCnloop >= 0; iCnloop --)
       {
-#if BUGFIX_F0093
         if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1])  // F0125 compatible with F0093
-#else
-        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-#endif
         {
           bRemoveSpa                      = true;
@@ -4565,12 +4290,5 @@
         }
       }
-#if !BUGFIX_F0093
-      if(!bRemoveSpa)
-      {
-        bDepthIPMCAvai = true;
-      }
-#endif
-    }
-#endif
+    }
 
     if (!bRemoveSpa)
@@ -4628,7 +4346,5 @@
     if (bIvMC)
     {
-#if MTK_SPIVMP_F0110
       pbSPIVMPFlag[iCount] = true;
-#endif
       if( ( ivCandDir[0] & 1 ) == 1 )
       {
@@ -4642,59 +4358,4 @@
       puhInterDirNeighbours[ iCount ] = ivCandDir[0];
 
-#if !BUGFIX_F0093
-#if QC_DEPTH_IV_MRG_F0125
-      if ( bDepthIPMCAvai || !bIsDepth )
-      {
-#endif
-#endif
-        if ( mrgCandIdx == iCount )
-        {
-          return;
-        }
-        iCount ++;
-#if !BUGFIX_F0093
-#if QC_DEPTH_IV_MRG_F0125
-      }
-#endif
-#endif
-    }
-#else
-    abCandIsInter        [ iCount ] = true;
-    puhInterDirNeighbours[ iCount ] = ivCandDir[0];    
-
-    if( ( ivCandDir[0] & 1 ) == 1 )
-    {
-      pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );
-    }
-    if( ( ivCandDir[0] & 2 ) == 2 )
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );
-    }
-#if QC_DEPTH_IV_MRG_F0125
-    if ( bIsDepth )
-    {
-      Bool bRemoveSpa = false;
-      Int iCnloop = iCount-1;
-      for(; iCnloop >= 0; iCnloop --)
-      {
-        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-        {
-          bRemoveSpa                      = true;
-          abCandIsInter        [ iCount ] = false;
-
-          puhInterDirNeighbours[iCount]   = 0;
-          pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-          break;
-        }
-      }
-      if(!bRemoveSpa)
-      {
-        bDepthIPMCAvai = true;
-      }
-    }
-    if ( bDepthIPMCAvai || !bIsDepth )
-    {
-#endif
       if ( mrgCandIdx == iCount )
       {
@@ -4702,10 +4363,5 @@
       }
       iCount ++;
-#if QC_DEPTH_IV_MRG_F0125
-    }
-#endif
-
-#endif
-
+    }
   } 
 
@@ -4717,16 +4373,7 @@
 #endif
 
-
-
-
-
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   iCount += numA1B1B0;
 #else
-#if H_3D
-  ////////////////////////////
-  //////// LEFT (A1) /////////
-  ////////////////////////////
-#endif
   //left
   UInt uiLeftPartIdx = 0;
@@ -4748,58 +4395,5 @@
       pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_IV_MERGE 
-    Bool bRemoveSpa = false; //pruning to inter-view candidates
-#if QC_DEPTH_IV_MRG_F0125
-    Int  iCnloop = bDepthIPMCAvai ? (iCount-2): (iCount-1);
-#else
-    Int  iCnloop    = iCount - 1;
-#endif
-    for(; iCnloop >= 0; iCnloop --)
-    {
-      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-      {
-        bRemoveSpa                      = true;
-        abCandIsInter        [ iCount ] = false;
-
-        //reset to the default value for MC
-        puhInterDirNeighbours[iCount]   = 0;
-        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-        break;
-      }
-    }
-    if(!bRemoveSpa)
-    {
-      bLeftAvai = true;
-      iPosLeftAbove[0] = iCount;
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-      if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-      {
-        vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-        xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-      }
-#endif
-      if ( mrgCandIdx == iCount )
-      {
-        return;
-      }
-      iCount ++;
-    }
-#else // H_3D_IV_MERGE 
+
     if ( mrgCandIdx == iCount )
     {
@@ -4807,5 +4401,4 @@
     }
     iCount ++;
-#endif // H_3D_IV_MERGE 
   }
 
@@ -4815,9 +4408,5 @@
     return;
   }
-#if H_3D
-  ////////////////////////////
-  //////// ABOVE (B1) ////////
-  ////////////////////////////
-#endif
+
   // above
   UInt uiAbovePartIdx = 0;
@@ -4839,77 +4428,5 @@
       pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_IV_MERGE 
-    Bool bRemoveSpa = false; //pruning to inter-view candidates
-#if QC_DEPTH_IV_MRG_F0125
-    Int iCnloop;
-    if( bIsDepth )
-      iCnloop = (bLeftAvai && bDepthIPMCAvai) ? (iCount-3) : ((bLeftAvai || bDepthIPMCAvai)  ? (iCount-2): (iCount-1));
-    else
-      iCnloop = bLeftAvai? (iCount-2): (iCount-1);
-#else
-    Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
-#endif
-    for(; iCnloop >= 0; iCnloop --)
-    {
-      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-      {
-        bRemoveSpa                      = true;
-        abCandIsInter        [ iCount ] = false;
-
-        //reset to the default value for MC
-        puhInterDirNeighbours[iCount]   = 0;
-
-        pcMvFieldNeighbours[iCount<<1]    .setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-        break;
-      }
-    }
-
-    if(!bRemoveSpa)
-    {
-      iPosLeftAbove[1] = iCount;
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-#if MTK_VSP_SIMPLIFICATION_F0111
-      if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-#else
-      if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-#endif
-      {
-
-        vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-        xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo);
-#endif
-      }
-#endif
-      if ( mrgCandIdx == iCount )
-      {
-        return;
-      }
-      iCount ++;
-    }
-#else // H_3D_IV_MERGE 
+
     if ( mrgCandIdx == iCount )
     {
@@ -4917,5 +4434,4 @@
     }
     iCount ++;
-#endif // H_3D_IV_MERGE 
   }
   // early termination
@@ -4924,10 +4440,4 @@
     return;
   }
-
-#if H_3D
-  //////////////////////////////////
-  //////// ABOVE RIGHT (B0) ////////
-  //////////////////////////////////
-#endif
 
   // above right
@@ -4949,39 +4459,5 @@
       pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_NBDV
-    pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-    pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-#if MTK_VSP_SIMPLIFICATION_F0111
-    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-      && !bICFlag
-#endif
-#if H_3D_ARP
-      && !bARPFlag
-#endif
-#endif
-      )
-#else
-    if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-      && !bICFlag
-#endif
-#if H_3D_ARP
-      && !bARPFlag
-#endif
-#endif
-      )
-#endif
-    {
-      vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-    }
-#endif
+
     if ( mrgCandIdx == iCount )
     {
@@ -5003,13 +4479,8 @@
   /////////////////////////////////////////////
 
-#if ETRIKHU_MERGE_REUSE_F0093
   if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())
-#else
-  if( ivCandDir[1] )
-#endif
   {
     assert(iCount < getSlice()->getMaxNumMergeCand());
 
-#if ETRIKHU_MERGE_REUSE_F0093
     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
@@ -5022,16 +4493,4 @@
       tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
     }
-#else
-    abCandIsInter        [ iCount ] = true;
-    puhInterDirNeighbours[ iCount ] = ivCandDir[1];
-    if( ( ivCandDir[1] & 1 ) == 1 )
-    {
-      pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );
-    }
-    if( ( ivCandDir[1] & 2 ) == 2 )
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
-    }
-#endif
 
     Bool bRemoveSpa = false; //pruning to A1, B1
@@ -5046,11 +4505,4 @@
       {
         bRemoveSpa                      = true;
-#if !ETRIKHU_MERGE_REUSE_F0093
-        abCandIsInter        [ iCount ] = false;
-        //reset to the default value for MC
-        puhInterDirNeighbours[iCount]   = 0;
-        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-#endif
         break;
       }      
@@ -5058,5 +4510,4 @@
     if(!bRemoveSpa)
     {
-#if ETRIKHU_MERGE_REUSE_F0093
       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
       puhInterDirNeighbours[ iCount ] = ivCandDir[1];
@@ -5069,5 +4520,4 @@
         pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
       }
-#endif
 #if H_3D_NBDV
       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
@@ -5092,11 +4542,8 @@
   //////// VIEW SYNTHESIS PREDICTION (VSP) ////////
   /////////////////////////////////////////////////
-#if ETRIKHU_MERGE_REUSE_F0093
   if (iCount<getSlice()->getMaxNumMergeCand())
   {
-#endif
 
   if (
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       !bICFlag &&
@@ -5105,10 +4552,5 @@
       !bARPFlag &&
 #endif
-#endif
-#if ETRIKHU_MERGE_REUSE_F0093
       xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
-#else
-      xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )
-#endif
   {
     return;
@@ -5121,17 +4563,11 @@
   }
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
-  }
-#endif
-
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
+  }
+#endif
+
+#if H_3D
   iCount += numA0B2;
 #else
-#if H_3D
-  ///////////////////////////////////
-  //////// LEFT BOTTOM (A0) ////////
-  ///////////////////////////////////
-#endif
-
   //left bottom
   UInt uiLeftBottomPartIdx = 0;
@@ -5152,26 +4588,4 @@
       pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_NBDV
-    pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-    pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-    {
-      vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-    }
-#endif
     if ( mrgCandIdx == iCount )
     {
@@ -5185,9 +4599,4 @@
     return;
   }
-#if H_3D
-  ///////////////////////////////////
-  //////// LEFT ABOVE (B2) ////////
-  ///////////////////////////////////
-#endif
 
   // above left 
@@ -5212,39 +4621,4 @@
         pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
       }
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-#if MTK_VSP_SIMPLIFICATION_F0111
-      if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-#else
-      if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-#endif
-      {
-        vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-        xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-      }
-#endif
       if ( mrgCandIdx == iCount )
       {
@@ -5266,13 +4640,7 @@
   //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
   ////////////////////////////////////////////////////
-#if ETRIKHU_MERGE_REUSE_F0093
   if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() ) 
   {
     if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
-#else
-  if(  ivMvPredFlag  ) 
-  {
-    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag))
-#endif
     {
       return;
@@ -5286,5 +4654,5 @@
 #endif
 
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
   {
@@ -5297,9 +4665,4 @@
   numValidMergeCand = iCount;
 #else
-#if H_3D
-  /////////////////////////////////
-  //////// Collocate (COL) ////////
-  /////////////////////////////////
-#endif
   if ( getSlice()->getEnableTMVPFlag())
   {
@@ -5366,7 +4729,4 @@
     if ( getSlice()->isInterB() )
     {
-#if H_3D_TMVP
-      iRefIdx = 0;
-#endif
       bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);
       if( bExistMV == false )
@@ -5385,8 +4745,4 @@
       puhInterDirNeighbours[uiArrayAddr] = dir;
       abCandIsInter[uiArrayAddr] = true;
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
       if ( mrgCandIdx == iCount )
       {
@@ -5406,31 +4762,11 @@
   if ( getSlice()->isInterB())
   {
-#if H_3D_IV_MERGE
-    UInt uiPriorityList0[20] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3,    0, 4, 1, 4, 2, 4, 3, 4 };
-    UInt uiPriorityList1[20] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2,    4, 0, 4, 1, 4, 2, 4, 3 };
-#else
     UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};
     UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};
-#endif
 
     for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++)
     {
       Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];
-#if H_3D_VSP
-      Bool bValid = true;
-      if ( vspFlag[i] == 1 || vspFlag[j] == 1 )
-      {
-        bValid = false;
-      }
-      if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) )
-      {
-        assert(bValid == true);
-      }
-#endif
-#if H_3D_VSP
-      if (abCandIsInter[i] && abCandIsInter[j] && (puhInterDirNeighbours[i]&0x1) && (puhInterDirNeighbours[j]&0x2) && bValid)
-#else
       if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
-#endif
       {
         abCandIsInter[uiArrayAddr] = true;
@@ -5488,8 +4824,4 @@
 #endif
 }
-
-
-
-
 #else
 
@@ -5503,38 +4835,16 @@
  */
 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
-#if H_3D_VSP
-      , Int* vspFlag
-      , InheritedVSPDisInfo*  inheritedVSPDisInfo
-#endif
       , Int& numValidMergeCand, Int mrgCandIdx
 )
 {
   UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx;
-#if H_3D_IV_MERGE
-  ////////////////////////////
-  //////// INIT LISTS ////////
-  ////////////////////////////
-  TComMv cZeroMv;
-  Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
-#else
   Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
-#endif
   for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui )
   {
     abCandIsInter[ui] = false;
-#if H_3D_IV_MERGE
-    pcMvFieldNeighbours[ ( ui << 1 )     ].setMvField(cZeroMv, NOT_VALID);
-    pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID);
-#else
     pcMvFieldNeighbours[ ( ui << 1 )     ].setRefIdx(NOT_VALID);
     pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID);
-#endif
   }
   numValidMergeCand = getSlice()->getMaxNumMergeCand();
-#if H_3D
-  //////////////////////////////////
-  //////// DERIVE LOCATIONS ////////
-  //////////////////////////////////
-#endif
   // compute the location of the current PU
   Int xP, yP, nPSW, nPSH;
@@ -5547,197 +4857,5 @@
   deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
   deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
-#if SEC_MPI_ENABLING_MERGE_F0150
-  Bool bMPIFlag   = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() );
-#endif
-#if QC_DEPTH_IV_MRG_F0125
-  Bool bIsDepth = getSlice()->getIsDepth();
-  Bool bDepthIPMCAvai = false;
-#endif 
-
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-  Bool bICFlag = getICFlag(uiAbsPartIdx);
-#endif
-#if H_3D_ARP
-  Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false;
-#endif
-#endif
-
-#if H_3D_IV_MERGE
-  
-  /////////////////////////////////////////////
-  //////// TEXTURE MERGE CANDIDATE (T) ////////
-  /////////////////////////////////////////////
-
-#if SEC_MPI_ENABLING_MERGE_F0150
-  if( bMPIFlag)
-#else
-  if( m_pcSlice->getIsDepth())
-#endif
-  {
-    UInt uiPartIdxCenter;
-    xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );    
-#if H_3D_FCO
-    TComPic * pcTexturePic = m_pcSlice->getTexturePic();
-    TComDataCU *pcTextureCU = 0;
-    if ( pcTexturePic )
-        pcTextureCU = pcTexturePic->getCU( getAddr() );
-#else
-    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
-#endif
- 
-#if H_3D_FCO
-    if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
-#else
-    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
-#endif
-    {
-      pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
-      Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() );
-      if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
-      {
-        TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
-        const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-        cMvPred+=cAdd;
-        cMvPred>>=2;
-        clipMv(cMvPred);
-        pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef);
-      }
-
-      if ( getSlice()->isInterB() )
-      {
-        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
-        iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() );
-        if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) )
-        {
-          TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
-          const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-          cMvPred+=cAdd;
-          cMvPred>>=2;
-          clipMv(cMvPred);
-          pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef);
-        }
-      }
-
-      puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0;
-      puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0;
-
-      if( puhInterDirNeighbours[iCount] != 0 )
-      {
-        abCandIsInter[iCount] = true;
-        if ( mrgCandIdx == iCount )
-        {
-          return;
-        }
-        iCount ++;
-      }
-    }
-  }
-
-  //////////////////////////////////
-  //////// GET DISPARITIES  ////////
-  //////////////////////////////////
-
-  DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
-
-  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++)
-  {
-    inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo;
-  }
-
-  /////////////////////////////////////////////////////////////////
-  //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC  Candidates /////
-  /////////////////////////////////////////////////////////////////
-
-  Int  posIvDC          = -1;
-  Bool bLeftAvai        = false;
-  Int  iPosLeftAbove[2] = {-1, -1};
-
-
-  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift };  
-  // An enumerator would be appropriate here! 
-  TComMv ivCandMv    [8];
-  Int    ivCandRefIdx[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
-
-  // { IvMC, IvDC, IvMCShift, IvDCShift };  
-  Int    ivCandDir   [4] = {0, 0, 0, 0};
-
-  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
-  
-  if ( ivMvPredFlag )
-  {
-    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir 
-#if QC_DEPTH_IV_MRG_F0125
-    , bIsDepth
-#endif
-    );
-  }  
-  
-  ///////////////////////////////////////////////
-  //////// INTER VIEW MOTION COMP(IvMC) /////////
-  ///////////////////////////////////////////////
-
-  if( ivCandDir[0] )
-  {
-    abCandIsInter        [ iCount ] = true;
-    puhInterDirNeighbours[ iCount ] = ivCandDir[0];    
-
-    if( ( ivCandDir[0] & 1 ) == 1 )
-    {
-      pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );
-    }
-    if( ( ivCandDir[0] & 2 ) == 2 )
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );
-    }
-
-#if QC_DEPTH_IV_MRG_F0125
-    if ( bIsDepth )
-    {
-      Bool bRemoveSpa = false;
-      Int iCnloop = iCount-1;
-      for(; iCnloop >= 0; iCnloop --)
-      {
-        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-        {
-          bRemoveSpa                      = true;
-          abCandIsInter        [ iCount ] = false;
-
-          puhInterDirNeighbours[iCount]   = 0;
-          pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-          break;
-        }
-      }
-      if(!bRemoveSpa)
-      {
-        bDepthIPMCAvai = true;
-      }
-    }
-    if ( bDepthIPMCAvai || !bIsDepth )
-    {
-#endif
-    if ( mrgCandIdx == iCount )
-    {
-      return;
-    }
-    iCount ++;
-#if QC_DEPTH_IV_MRG_F0125
-    }
-#endif
-  } 
-
-  // early termination
-  if (iCount == getSlice()->getMaxNumMergeCand()) 
-  {
-    return;
-  }
-#endif
-
-#if H_3D
-  ////////////////////////////
-  //////// LEFT (A1) /////////
-  ////////////////////////////
-#endif
+
   //left
   UInt uiLeftPartIdx = 0;
@@ -5759,58 +4877,4 @@
       pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_IV_MERGE 
-    Bool bRemoveSpa = false; //pruning to inter-view candidates
-#if QC_DEPTH_IV_MRG_F0125
-    Int  iCnloop = bDepthIPMCAvai ? (iCount-2): (iCount-1);
-#else
-    Int  iCnloop    = iCount - 1;
-#endif
-    for(; iCnloop >= 0; iCnloop --)
-    {
-      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-      {
-        bRemoveSpa                      = true;
-        abCandIsInter        [ iCount ] = false;
-
-        //reset to the default value for MC
-        puhInterDirNeighbours[iCount]   = 0;
-        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-        break;
-      }
-    }
-    if(!bRemoveSpa)
-    {
-      bLeftAvai = true;
-      iPosLeftAbove[0] = iCount;
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-      if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-      {
-        vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-        xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-      }
-#endif
-      if ( mrgCandIdx == iCount )
-      {
-        return;
-      }
-      iCount ++;
-    }
-#else // H_3D_IV_MERGE 
     if ( mrgCandIdx == iCount )
     {
@@ -5818,5 +4882,4 @@
     }
     iCount ++;
-#endif // H_3D_IV_MERGE 
   }
   
@@ -5826,9 +4889,5 @@
     return;
   }
-#if H_3D
-  ////////////////////////////
-  //////// ABOVE (B1) ////////
-  ////////////////////////////
-#endif
+
   // above
   UInt uiAbovePartIdx = 0;
@@ -5850,77 +4909,5 @@
       pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_IV_MERGE 
-    Bool bRemoveSpa = false; //pruning to inter-view candidates
-#if QC_DEPTH_IV_MRG_F0125
-    Int iCnloop;
-    if( bIsDepth )
-      iCnloop = (bLeftAvai && bDepthIPMCAvai) ? (iCount-3) : ((bLeftAvai || bDepthIPMCAvai)  ? (iCount-2): (iCount-1));
-    else
-      iCnloop = bLeftAvai? (iCount-2): (iCount-1);
-#else
-    Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
-#endif
-    for(; iCnloop >= 0; iCnloop --)
-    {
-      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-      {
-        bRemoveSpa                      = true;
-        abCandIsInter        [ iCount ] = false;
-
-        //reset to the default value for MC
-        puhInterDirNeighbours[iCount]   = 0;
-
-        pcMvFieldNeighbours[iCount<<1]    .setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-        break;
-      }
-    }
-
-    if(!bRemoveSpa)
-    {
-      iPosLeftAbove[1] = iCount;
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-#if MTK_VSP_SIMPLIFICATION_F0111
-      if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-#else
-      if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-#endif
-      {
-
-        vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-        xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo);
-#endif
-      }
-#endif
-      if ( mrgCandIdx == iCount )
-      {
-        return;
-      }
-      iCount ++;
-    }
-#else // H_3D_IV_MERGE 
+
     if ( mrgCandIdx == iCount )
     {
@@ -5928,5 +4915,4 @@
     }
     iCount ++;
-#endif // H_3D_IV_MERGE 
   }
   // early termination
@@ -5936,9 +4922,4 @@
   }
 
-#if H_3D
-  //////////////////////////////////
-  //////// ABOVE RIGHT (B0) ////////
-  //////////////////////////////////
-#endif
 
   // above right
@@ -5960,39 +4941,4 @@
       pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_NBDV
-    pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-    pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-#if MTK_VSP_SIMPLIFICATION_F0111
-    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-#else
-    if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-#endif
-    {
-      vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-    }
-#endif
     if ( mrgCandIdx == iCount )
     {
@@ -6006,93 +4952,4 @@
     return;
   }
-
-#if H_3D_IV_MERGE 
-  /////////////////////////////////////////////
-  //////// INTER VIEW DISP COMP (IvDC) ////////
-  /////////////////////////////////////////////
-
-  if( ivCandDir[1] )
-  {
-    assert(iCount < getSlice()->getMaxNumMergeCand());
-    abCandIsInter        [ iCount ] = true;
-    puhInterDirNeighbours[ iCount ] = ivCandDir[1];
-    if( ( ivCandDir[1] & 1 ) == 1 )
-    {
-      pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );
-    }
-    if( ( ivCandDir[1] & 2 ) == 2 )
-    {
-      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
-    }
-
-    Bool bRemoveSpa = false; //pruning to A1, B1
-    for(Int i = 0; i < 2; i ++)
-    {
-      Int iCnloop = iPosLeftAbove[i];
-      if ( iCnloop == -1 ) 
-      {
-        continue;
-      }
-      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
-      {
-        bRemoveSpa                      = true;
-        abCandIsInter        [ iCount ] = false;
-        //reset to the default value for MC
-        puhInterDirNeighbours[iCount]   = 0;
-        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
-        break;
-      }      
-    }
-    if(!bRemoveSpa)
-    {
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-      posIvDC  = iCount;
-      if ( mrgCandIdx == iCount )
-        return;
-      iCount ++;
-
-      // early termination
-      if (iCount == getSlice()->getMaxNumMergeCand()) 
-      {
-        return;
-      }
-    }
-  } 
-#endif // H_3D_IV_MERGE 
-
-#if H_3D_VSP
-  /////////////////////////////////////////////////
-  //////// VIEW SYNTHESIS PREDICTION (VSP) ////////
-  /////////////////////////////////////////////////
-
-  if (
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-      !bICFlag &&
-#endif
-#if H_3D_ARP
-      !bARPFlag &&
-#endif
-#endif
-      xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )
-  {
-    return;
-  }
-
-  // early termination
-  if (iCount == getSlice()->getMaxNumMergeCand())
-  {
-    return;
-  }
-#endif
-#if H_3D
-  ///////////////////////////////////
-  //////// LEFT BOTTOM (A0) ////////
-  ///////////////////////////////////
-#endif
 
   //left bottom
@@ -6114,26 +4971,5 @@
       pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     }
-#if H_3D_NBDV
-    pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-    pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-        && !bICFlag
-#endif
-#if H_3D_ARP
-        && !bARPFlag
-#endif
-#endif
-        )
-    {
-      vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-      xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-    }
-#endif
+
     if ( mrgCandIdx == iCount )
     {
@@ -6147,9 +4983,4 @@
     return;
   }
-#if H_3D
-  ///////////////////////////////////
-  //////// LEFT ABOVE (B2) ////////
-  ///////////////////////////////////
-#endif
 
   // above left 
@@ -6174,39 +5005,4 @@
         pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
       }
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
-#if H_3D_VSP
-#if MTK_VSP_SIMPLIFICATION_F0111
-      if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-#else
-      if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1
-#if LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-          && !bICFlag
-#endif
-#if H_3D_ARP
-          && !bARPFlag
-#endif
-#endif
-          )
-#endif
-      {
-        vspFlag[iCount] = 1;
-#if !MTK_VSP_SIMPLIFICATION_F0111
-        xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);
-#endif
-      }
-#endif
       if ( mrgCandIdx == iCount )
       {
@@ -6221,27 +5017,5 @@
     return;
   }
-#if H_3D_IV_MERGE
-  ////////////////////////////////////////////////////
-  //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
-  ////////////////////////////////////////////////////
-
-  if(  ivMvPredFlag  ) 
-  {
-    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag))
-    {
-      return;
-    }
-    //early termination
-    if (iCount == getSlice()->getMaxNumMergeCand()) 
-    {
-      return;
-    }
-  }
-#endif
-#if H_3D
-  /////////////////////////////////
-  //////// Collocate (COL) ////////
-  /////////////////////////////////
-#endif
+
   if ( getSlice()->getEnableTMVPFlag())
   {
@@ -6308,7 +5082,4 @@
     if ( getSlice()->isInterB() )
     {
-#if H_3D_TMVP
-      iRefIdx = 0;
-#endif
       bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);
       if( bExistMV == false )
@@ -6327,8 +5098,4 @@
       puhInterDirNeighbours[uiArrayAddr] = dir;
       abCandIsInter[uiArrayAddr] = true;
-#if H_3D_NBDV
-      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
-      pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
-#endif
       if ( mrgCandIdx == iCount )
       {
@@ -6348,31 +5115,11 @@
   if ( getSlice()->isInterB())
   {
-#if H_3D_IV_MERGE
-    UInt uiPriorityList0[20] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3,    0, 4, 1, 4, 2, 4, 3, 4 };
-    UInt uiPriorityList1[20] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2,    4, 0, 4, 1, 4, 2, 4, 3 };
-#else
     UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};
     UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};
-#endif
 
     for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++)
     {
       Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];
-#if H_3D_VSP
-      Bool bValid = true;
-      if ( vspFlag[i] == 1 || vspFlag[j] == 1 )
-      {
-        bValid = false;
-      }
-      if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) )
-      {
-        assert(bValid == true);
-      }
-#endif
-#if H_3D_VSP
-      if (abCandIsInter[i] && abCandIsInter[j] && (puhInterDirNeighbours[i]&0x1) && (puhInterDirNeighbours[j]&0x2) && bValid)
-#else
       if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
-#endif
       {
         abCandIsInter[uiArrayAddr] = true;
@@ -6429,6 +5176,4 @@
   numValidMergeCand = uiArrayAddr;
 }
-
-
 #endif
 
@@ -6770,5 +5515,5 @@
 }
 
-#if LGE_IC_CTX_F0160
+#if H_3D_IC
 Bool TComDataCU::isIC( UInt uiPartIdx )
 {
@@ -8639,632 +7384,4 @@
   for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
 }
-#if !SEC_DMM3_RBC_F0147
-Void  TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
-  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm3IntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; }
-}
-#endif
-#endif
-#if H_3D_DIM_RBC
-Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )
-{
-  Int iWidth;
-  Int iHeight;
-  if( uiDepth == 0 )
-  {
-    iWidth = 64;
-    iHeight = 64;
-  }
-  else if( uiDepth == 1 )
-  {
-    iWidth = 32;
-    iHeight = 32;
-  }
-  else if( uiDepth == 2 )
-  {
-    iWidth = 16;
-    iHeight = 16;
-  }
-  else if( uiDepth == 3 )
-  {
-    iWidth = 8;
-    iHeight = 8;
-  }
-  else // uiDepth == 4
-  {
-    iWidth = 4;
-    iHeight = 4;
-  }
-
-  Int iPtr = 0;
-  Int iX, iY;
-  Int iDir = -1;
-  Int iDiffX = 0, iDiffY = 0;
-
-  // 1. Edge Code -> Vert & Horz Edges
-  Bool*  pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight );
-
-  for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ )
-    pbEdge  [ ui ] = false;
-
-  // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7)
-  // Code      : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6)
-  const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 },
-  { 1, 5, 7, 2, 3, 4, 6 },
-  { 2, 4, 5, 0, 1, 6, 7 },
-  { 3, 7, 6, 1, 0, 5, 4 },
-  { 4, 0, 2, 6, 5, 3, 1 },
-  { 5, 2, 1, 4, 7, 0, 3 },
-  { 6, 3, 0, 7, 4, 1, 2 },
-  { 7, 1, 3, 5, 6, 2, 0 }};
-
-  UChar ucCode = pucEdgeCode[iPtr++];
-
-  if( !bLeft )
-  {
-    iX = ucStartPos;
-    iY = 0;
-
-    switch(ucCode)
-    {
-    case 0: // bottom
-      iDir = 3;
-      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-      break;
-    case 2: // left-bottom
-      iDir = 6;
-      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-      break;
-    case 1: // right-bottom
-      iDir = 7;
-      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-      break;
-    case 4: // left
-      iDir = 0;
-      assert(false);
-      break;
-    case 3: // right
-      iDir = 1;
-      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-      break;
-    }
-  }
-  else
-  {
-    iX = 0;
-    iY = ucStartPos;
-
-    switch(ucCode)
-    {
-    case 0: // right
-      iDir = 1;
-      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-      break;
-    case 1: // right-top
-      iDir = 5;
-      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-      if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-      break;
-    case 2: // right-bottom
-      iDir = 7;
-      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-      break;
-    case 3: // top
-      iDir = 2;
-      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-      if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-      break;
-    case 4: // bottom
-      iDir = 3;
-      assert(false);
-      break;
-    }
-  }
-
-  switch( iDir )
-  {
-  case 0: // left
-    iDiffX = -1;
-    iDiffY = 0;
-    break;
-  case 1: // right
-    iDiffX = +1;
-    iDiffY = 0;
-    break;
-  case 2: // top
-    iDiffX = 0;
-    iDiffY = -1;
-    break;
-  case 3: // bottom
-    iDiffX = 0;
-    iDiffY = +1;
-    break;
-  case 4: // left-top
-    iDiffX = -1;
-    iDiffY = -1;
-    break;
-  case 5: // right-top
-    iDiffX = +1;
-    iDiffY = -1;
-    break;
-  case 6: // left-bottom
-    iDiffX = -1;
-    iDiffY = +1;
-    break;
-  case 7: // right-bottom
-    iDiffX = +1;
-    iDiffY = +1;
-    break;
-  }
-
-  iX += iDiffX;
-  iY += iDiffY;
-
-  while( iPtr < ucNumEdge )
-  {
-    ucCode = pucEdgeCode[iPtr++];
-
-    Int iNewDir = tableDir[iDir][ucCode];
-
-    switch( iNewDir )
-    {
-    case 0: // left
-      iDiffX = -1;
-      iDiffY = 0;
-      break;
-    case 1: // right
-      iDiffX = +1;
-      iDiffY = 0;
-      break;
-    case 2: // top
-      iDiffX = 0;
-      iDiffY = -1;
-      break;
-    case 3: // bottom
-      iDiffX = 0;
-      iDiffY = +1;
-      break;
-    case 4: // left-top
-      iDiffX = -1;
-      iDiffY = -1;
-      break;
-    case 5: // right-top
-      iDiffX = +1;
-      iDiffY = -1;
-      break;
-    case 6: // left-bottom
-      iDiffX = -1;
-      iDiffY = +1;
-      break;
-    case 7: // right-bottom
-      iDiffX = +1;
-      iDiffY = +1;
-      break;
-    }
-
-    switch( iDir )
-    {
-    case 0: // left
-      switch( ucCode )
-      {
-      case 0:
-      case 2:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        break;
-      case 1:
-      case 3:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 4:
-      case 6:
-        // no
-        break;
-      case 5:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      }
-      break;
-    case 1: // right
-      switch( ucCode )
-      {
-      case 0:
-      case 2:
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        break;
-      case 1:
-      case 3:
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 4:
-      case 6:
-        // no
-        break;
-      case 5:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      }
-      break;
-    case 2: // top
-      switch( ucCode )
-      {
-      case 0:
-      case 2:
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 1:
-      case 3:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 4:
-      case 6:
-        // no
-        break;
-      case 5:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      }
-      break;
-    case 3: // bottom
-      switch( ucCode )
-      {
-      case 0:
-      case 2:
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 1:
-      case 3:
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        break;
-      case 4:
-      case 6:
-        // no
-        break;
-      case 5:
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        break;
-      }
-      break;
-    case 4: // left-top
-      switch( ucCode )
-      {
-      case 0:
-      case 1:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 2:
-      case 4:
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 3:
-      case 5:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 6:
-        // no
-        break;
-      }
-      break;
-    case 5: // right-top
-      switch( ucCode )
-      {
-      case 0:
-      case 1:
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 2:
-      case 4:
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        break;
-      case 3:
-      case 5:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 6:
-        // no
-        break;
-      }
-      break;
-    case 6: // left-bottom
-      switch( ucCode )
-      {
-      case 0:
-      case 1:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 2:
-      case 4:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        break;
-      case 3:
-      case 5:
-        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        break;
-      case 6:
-        // no
-        break;
-      }
-      break;
-    case 7: // right-bottom
-      switch( ucCode )
-      {
-      case 0:
-      case 1:
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 2:
-      case 4:
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        break;
-      case 3:
-      case 5:
-        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
-        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
-        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
-        break;
-      case 6:
-        // no
-        break;
-      }
-      break;
-    }
-
-    assert( iX >= 0 && iX <= iWidth );
-    assert( iY >= 0 && iY <= iHeight );
-
-    iX += iDiffX;
-    iY += iDiffY;
-    iDir = iNewDir;
-  }
-
-  // finalize edge chain
-  if( iX == iWidth-1 )
-  {
-    if( iY == 0 )
-    {
-      if( iDir == 1 )
-      {
-        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 5 )
-      {
-        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      }
-      else
-      {
-        assert(false);
-      }
-    }
-    else if( iY == iHeight-1 )
-    {
-      if( iDir == 3 )
-      {
-        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-      }
-      else if( iDir == 7 )
-      {
-        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-      }
-      else
-      {
-        assert(false);
-      }
-    }
-    else
-    {
-      if( iDir == 1 )
-      {
-        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 3 )
-      {
-        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 5 )
-      {
-        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 7 )
-      {
-        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      }
-      else
-      {
-        assert(false);
-      }
-    }
-  }
-  else if( iX == 0 )
-  {
-    if( iY == 0 )
-    {
-      if( iDir == 2 )
-      {
-        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-      }
-      else if( iDir == 4 )
-      {
-        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-      }
-      else
-      {
-        assert(false);
-      }
-    }
-    else if( iY == iHeight-1 )
-    {
-      if( iDir == 0 )
-      {
-        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 6 )
-      {
-        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      }
-      else
-      {
-        assert(false);
-      }
-    }
-    else
-    {
-      if( iDir == 0 )
-      {
-        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 2 )
-      {
-        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 4 )
-      {
-        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      }
-      else if( iDir == 6 )
-      {
-        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      }
-      else
-      {
-        assert(false);
-      }
-    }
-  }
-  else if( iY == 0 )
-  {
-    if( iDir == 1 )
-    {
-      pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else if( iDir == 2 )
-    {
-      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else if( iDir == 4 )
-    {
-      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else if( iDir == 5 )
-    {
-      pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
-      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else
-    {
-      assert(false);
-    }
-  }
-  else if( iY == iHeight-1 )
-  {
-    if( iDir == 0 )
-    {
-      pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else if( iDir == 3 )
-    {
-      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else if( iDir == 6 )
-    {
-      pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
-      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else if( iDir == 7 )
-    {
-      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
-    }
-    else
-    {
-      assert(false);
-    }
-  }
-  else
-  {
-    printf("reconPartiton: wrong termination\n");
-    assert(false);
-  }
-
-  // Reconstruct Region from Chain Code
-  Bool* pbVisit  = (Bool*) xMalloc( Bool, iWidth * iHeight );
-  Int*  piStack  = (Int* ) xMalloc( Int,  iWidth * iHeight );
-
-  for( UInt ui = 0; ui < iWidth * iHeight; ui++ )
-  {
-    pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)
-    pbVisit [ ui ] = false;
-  }
-
-  iPtr = 0;
-  piStack[iPtr++] = (0 << 8) | (0);
-  pbRegion[ 0 ] = false;
-
-  while(iPtr > 0)
-  {
-    Int iTmp = piStack[--iPtr];
-    Int iX1, iY1;
-    iX1 = iTmp & 0xff;
-    iY1 = (iTmp >> 8) & 0xff;
-
-    pbVisit[ iX1 + iY1 * iWidth ] = true;
-
-    assert( iX1 >= 0 && iX1 < iWidth );
-    assert( iY1 >= 0 && iY1 < iHeight );
-
-    if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )
-    {
-      piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);
-      pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;
-    }
-    if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )
-    {
-      piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);
-      pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;
-    }
-    if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )
-    {
-      piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;
-      pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;
-    }
-    if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )
-    {
-      piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;
-      pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;
-    }
-  }
-
-  xFree( pbEdge );
-  xFree( pbVisit );
-  xFree( piStack );
-}
 #endif
 
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 764)
@@ -212,14 +212,4 @@
 #if H_3D_DIM_DMM
   UInt*         m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 
-#if !SEC_DMM3_RBC_F0147
-  UInt*         m_dmm3IntraTabIdx;
-#endif
-#endif
-#if H_3D_DIM_RBC
-  UChar*        m_pucEdgeCode;          ///< array of edge code
-  UChar*        m_pucEdgeNumber;        ///< total number of edge
-  UChar*        m_pucEdgeStartPos;      ///< starting point position
-  Bool*         m_pbEdgeLeftFirst;      ///< true if edge should be checked in left boundary first
-  Bool*         m_pbEdgePartition;      ///< true if it belongs to region 1, otherwise, region 0
 #endif
 #if H_3D_DIM_SDC
@@ -233,5 +223,5 @@
   UChar*        m_pucInterSDCMask;
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   Bool          m_bAvailableFlagA1;    ///< A1 available flag
   Bool          m_bAvailableFlagB1;    ///< B1 available flag
@@ -256,5 +246,5 @@
   UInt*         m_sliceSegmentStartCU; ///< Start CU address of current slice
   Char          m_codedQP;
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   DisInfo       m_cDefaultDisInfo;    ///< Default disparity information for initializing
 #endif
@@ -266,20 +256,10 @@
   Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
 #if H_3D_VSP
-#if ETRIKHU_MERGE_REUSE_F0093
   Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
                              Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo);
-#else
-  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
-                             Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag );
-#endif
 #endif
 #if H_3D_IV_MERGE
-#if ETRIKHU_MERGE_REUSE_F0093
   Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv, 
                                Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo   ); 
-#else
-  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv, 
-                               Int* ivCandRefIdx, Int posIvDC, Int* vspFlag ); 
-#endif
   Bool          xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int*  ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand );
 #endif
@@ -519,5 +499,5 @@
    ); 
    
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
 #endif
@@ -584,29 +564,4 @@
   Void  setDmmWedgeTabIdxSubParts     ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth );
 
-#if !SEC_DMM3_RBC_F0147
-  UInt* getDmm3IntraTabIdx            ()                      { return m_dmm3IntraTabIdx;        }
-  UInt  getDmm3IntraTabIdx            ( UInt uiIdx )          { return m_dmm3IntraTabIdx[uiIdx]; }
-  Void  setDmm3IntraTabIdx            ( UInt uiIdx, UInt uh ) { m_dmm3IntraTabIdx[uiIdx] = uh;   }
-  Void  setDmm3IntraTabIdxSubParts    ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  UChar* getEdgeCode( UInt uiIdx )                 { return &m_pucEdgeCode[uiIdx * RBC_MAX_EDGE_NUM_PER_4x4]; }
-
-  UChar* getEdgeNumber( )                          { return m_pucEdgeNumber;           }
-  UChar  getEdgeNumber( UInt uiIdx )               { return m_pucEdgeNumber[uiIdx];    }
-  Void   setEdgeNumber( UInt uiIdx, UChar val )    { m_pucEdgeNumber[uiIdx] = val;     }
-
-  UChar* getEdgeStartPos( )                        { return m_pucEdgeStartPos;         }
-  UChar  getEdgeStartPos( UInt uiIdx )             { return m_pucEdgeStartPos[uiIdx];  }
-  Void   setEdgeStartPos( UInt uiIdx, UChar val )  { m_pucEdgeStartPos[uiIdx] = val;   }
-
-  Bool*  getEdgeLeftFirst( )                       { return m_pbEdgeLeftFirst;         }
-  Bool   getEdgeLeftFirst( UInt uiIdx )            { return m_pbEdgeLeftFirst[uiIdx];  }
-  Void   setEdgeLeftFirst( UInt uiIdx, Bool val )  { m_pbEdgeLeftFirst[uiIdx] = val;   }
-
-  Bool*  getEdgePartition( UInt uiIdx )            { return &m_pbEdgePartition[uiIdx * 16]; }
-
-  Void   reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion );
 #endif
 #if H_3D_DIM_SDC
@@ -704,5 +659,5 @@
   Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
 
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
   Bool          getAvailableFlagA1() { return m_bAvailableFlagA1;}
   Bool          getAvailableFlagB1() { return m_bAvailableFlagB1;}
@@ -753,5 +708,5 @@
   Bool          isBipredRestriction( UInt puIdx );
 
-#if LGE_IC_CTX_F0160
+#if H_3D_IC
   Bool          isIC      ( UInt uiPartIdx );
 #endif
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 764)
@@ -425,7 +425,4 @@
   Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );    
   Bool isDmmMode  = (dimType <  DMM_NUM_TYPE);
-#if !SEC_DMM3_RBC_F0147
-  Bool isRbcMode  = (dimType == RBC_IDX);
-#endif
 
   Bool* biSegPattern  = NULL;
@@ -443,17 +440,4 @@
         dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
       } break;
-#if !SEC_DMM3_RBC_F0147
-    case( DMM3_IDX ): 
-      {
-        UInt uiTabIdx = 0;
-        if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }
-        else
-        {
-          uiTabIdx = xPredWedgeFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm3IntraTabIdx( 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( DMM4_IDX ): 
       {
@@ -468,21 +452,9 @@
   }
 #endif
-#if H_3D_DIM_RBC
-  if( isRbcMode )
-  {
-    biSegPattern  = pcCU->getEdgePartition( uiAbsPartIdx );
-    patternStride = iWidth;
-  }
-#endif
 
   // get predicted partition values
   assert( biSegPattern );
   Int* piMask = NULL;
-#if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171
   piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering
-#else
-  if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM
-  else            piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );
-#endif
   assert( piMask );
   Int maskStride = 2*iWidth + 1;  
@@ -499,31 +471,13 @@
     Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx );
 #if H_3D_DIM_DMM
-#if QC_DIM_DELTADC_UNIFY_F0132 && !SEC_DMM3_RBC_F0147
-    if( isDmmMode || isRbcMode)
-#else
     if( isDmmMode )
-#endif
     {
 #if H_3D_DIM_DLT
-#if DLT_DIFF_CODING_IN_PPS
       segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
       segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
 #else
-      segDC1 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
-      segDC2 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
-#endif
-#else
       segDC1 = ClipY( predDC1 + deltaDC1 );
       segDC2 = ClipY( predDC2 + deltaDC2 );
 #endif
-    }
-#endif
-#if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132
-    if( isRbcMode )
-    {
-      xDeltaDCQuantScaleUp( pcCU, deltaDC1 );
-      xDeltaDCQuantScaleUp( pcCU, deltaDC2 );
-      segDC1 = ClipY( predDC1 + deltaDC1 );
-      segDC2 = ClipY( predDC2 + deltaDC2 );
     }
 #endif
@@ -2564,17 +2518,4 @@
 
 #if H_3D_DIM_DMM
-#if !SEC_DMM3_RBC_F0147
-UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx )
-{
-  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
-  assert( pcPicTex != NULL );
-  TComDataCU*   pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
-  UInt          uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
-  Int           uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
-
-  assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 );
-  return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);
-}
-#endif
 
 Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge )
@@ -2628,31 +2569,5 @@
 #endif
 
-#if H_3D_DIM_RBC
-Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC )
-{
-  Int  iSign  = rDeltaDC < 0 ? -1 : 1;
-  UInt uiAbs  = abs( rDeltaDC );
-
-  Int iQp = pcCU->getQP(0);
-  Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) );
-  Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) );
-
-  rDeltaDC = iSign * roftoi( uiAbs * dStepSize );
-  return;
-}
-
-Void TComPrediction::xDeltaDCQuantScaleDown( TComDataCU*  pcCU, Pel& rDeltaDC )
-{
-  Int  iSign  = rDeltaDC < 0 ? -1 : 1;
-  UInt uiAbs  = abs( rDeltaDC );
-
-  Int iQp = pcCU->getQP(0);
-  Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) );
-  Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) );
-
-  rDeltaDC = iSign * roftoi( uiAbs / dStepSize );
-  return;
-}
-#endif
+
 #if H_3D_DIM_SDC
 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 764)
@@ -155,8 +155,4 @@
   Void xCopyTextureLumaBlock    ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight );
 #endif
-#if H_3D_DIM_RBC
-  Void xDeltaDCQuantScaleUp     ( TComDataCU* pcCU, Pel& rDeltaDC );
-  Void xDeltaDCQuantScaleDown   ( TComDataCU* pcCU, Pel& rDeltaDC );
-#endif
 #endif
 
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 764)
@@ -612,7 +612,4 @@
 std::vector< std::vector<TComWedgeRef>  > g_dmmWedgeRefLists;
 std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists;
-#if !SEC_DMM3_RBC_F0147
-std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
-#endif
 
 Void initWedgeLists( Bool initNodeList )
@@ -733,22 +730,5 @@
   }
 
-#if !SEC_DMM3_RBC_F0147
-  UInt uiThrSz = DMM3_SIMPLIFY_TR;
-  std::vector< std::vector<UInt> > auiWdgListSz;
-  for( Int idxM=2; idxM<=34 ; idxM++)
-  {
-    std::vector<UInt> auiWdgList;
-    for( Int idxW=0; idxW<racWedgeList.size(); idxW++)
-    {
-      UInt uiAbsDiff = abs(idxM-(Int)racWedgeList[idxW].getAng());
-      if( uiAbsDiff <= uiThrSz )
-      {
-        auiWdgList.push_back(idxW);
-      }
-    }
-    auiWdgListSz.push_back(auiWdgList);
-  }
-  g_aauiWdgLstM3.push_back(auiWdgListSz);
-#endif
+
 }
 
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.h	(revision 764)
@@ -172,7 +172,4 @@
 extern       std::vector< std::vector<TComWedgeRef> >        g_dmmWedgeRefLists;
 extern       std::vector< std::vector<TComWedgeNode> >       g_dmmWedgeNodeLists;
-#if !SEC_DMM3_RBC_F0147
-extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
-#endif
 
 Void initWedgeLists( Bool initNodeList = false );
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComWedgelet.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComWedgelet.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComWedgelet.h	(revision 764)
@@ -50,23 +50,10 @@
 enum DIM_IDX
 {
-#if SEC_DMM3_RBC_F0147
   DMM1_IDX = 0,
   DMM4_IDX = 1,
-#else
-  DMM1_IDX = 0,
-  DMM3_IDX = 1,
-  DMM4_IDX = 2,
-  RBC_IDX  = 3
-#endif
 };
 
-#if SEC_DMM3_RBC_F0147
 #define DMM_NUM_TYPE   2
 #define DIM_NUM_TYPE   (DMM_NUM_TYPE)
-#else
-#define DMM_NUM_TYPE   3
-#define RBC_NUM_TYPE   1
-#define DIM_NUM_TYPE   (DMM_NUM_TYPE+RBC_NUM_TYPE)
-#endif
 #define DIM_NO_IDX     MAX_UINT
 
@@ -76,16 +63,7 @@
 #endif
 
-#if H_3D_DIM_RBC
-#define RBC_THRESHOLD              20
-#define RBC_MAX_EDGE_NUM_PER_4x4   8
-#define RBC_MAX_DISTANCE           255
-#endif
-
 #if H_3D_DIM_DMM
 #define DMM_NO_WEDGEINDEX       MAX_UINT
 #define DMM_NUM_WEDGE_REFINES   8
-#if !SEC_DMM3_RBC_F0147
-#define DMM3_SIMPLIFY_TR        1
-#endif
 
 enum WedgeResolution
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 764)
@@ -104,4 +104,6 @@
                                               // SHARP_ILLUCOMP_REFINE_E0046
                                               // MTK_CLIPPING_ALIGN_IC_E0168       // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
+                                              // LGE_IC_CTX_F0160 //JCT3V-F0160
+                                              // SEC_ONLY_TEXTURE_IC_F0151
 
 #if H_3D_NBDV
@@ -134,4 +136,5 @@
                                               // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
                                               // QC_INRIA_MTK_MRG_E0126 
+                                              // ETRIKHU_MERGE_REUSE_F0093
 
 
@@ -160,4 +163,8 @@
                                               // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC
                                               // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   Removal of overlap between DMM3 and DMM1
+                                              // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
+                                              // HHI_DIM_PREDSAMP_FIX_F0171
+                                              // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs
+                                              // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
 
 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
@@ -317,7 +324,5 @@
 
 #define FIX_MISSING_MACRO_R690                  1 // Missing macro in integration to revision 690
-
 #define SEC_MPI_ENABLING_MERGE_F0150            1 // MPI flag in VPS and enabling in Merge mode
-#define ETRIKHU_MERGE_REUSE_F0093               1 // Reuse HEVC merge candidate list construction for base candidates, JCT3V-F0093 
 
 #if H_3D_ARP
@@ -340,18 +345,4 @@
 #define MTK_VSP_SIMPLIFICATION_F0111            1 // 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
 #define LGE_SHARP_VSP_INHERIT_F0104             1
-#endif
-
-#define LGE_BUGFIX_F0158                        1 //JCT3V-F0158
-#define LGE_IC_CTX_F0160                        1 //JCT3V-F0160
-#define SEC_ONLY_TEXTURE_IC_F0151               1
-
-#if H_3D_DIM
-#define SEC_DMM3_RBC_F0147                      1 // Removal of DMM3 and RBC from DMMs
-#if !SEC_DMM3_RBC_F0147
-#define H_3D_DIM_RBC                            1 // Region Boundary Chain mode
-#endif
-#define QC_DIM_DELTADC_UNIFY_F0132              1 // Unify delta DC coding in depth intra modes
-#define HHI_DIM_PREDSAMP_FIX_F0171              1
-#define LGE_PRED_RES_CODING_DLT_DOMAIN_F0159    1 //JCT3V-F0159
 #endif
 #endif
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 764)
@@ -2550,9 +2550,5 @@
     }
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
     else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth())
-#else
-    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) )
-#endif
     {
       UInt uiCodeTmp = 0;
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 764)
@@ -390,5 +390,4 @@
     UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
 
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
     m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
@@ -396,5 +395,4 @@
 #if H_3D_ARP
     m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
-#endif
 #endif
 
@@ -411,5 +409,4 @@
     puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
     m_ppcCU[uiDepth]->initAvailableFlags();
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
@@ -419,10 +416,7 @@
 #endif
       , numValidMergeCand, uiMergeIndex );
-#else
-    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex );
-#endif
     pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
 #else
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
     m_ppcCU[uiDepth]->initAvailableFlags();
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
@@ -496,12 +490,4 @@
 #endif
 #endif
-#if !LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#if H_3D_ARP
-    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
-#endif
-#endif
 
     xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
@@ -534,12 +520,4 @@
   // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
   m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
-#if !LGE_SHARP_VSP_INHERIT_F0104
-#if H_3D_IC
-  m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#if H_3D_ARP
-  m_pcEntropyDecoder->decodeARPW    ( pcCU , uiAbsPartIdx , uiDepth );  
-#endif  
-#endif
 #if H_3D_INTER_SDC
   m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
@@ -780,5 +758,5 @@
     for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     {
-#if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
+#if H_3D
 #if DLT_DIFF_CODING_IN_PPS
       if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
@@ -797,6 +775,4 @@
       pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
         }
-#else
-      pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
 #endif
       pRecIPred[ uiX ] = pReco[ uiX ];
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 764)
@@ -111,9 +111,5 @@
   pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
 
-#if SEC_ONLY_TEXTURE_IC_F0151
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
-#else
-  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )
-#endif
   {
     return;
@@ -245,5 +241,4 @@
       decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
       UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
@@ -251,5 +246,4 @@
 #if H_3D_ARP
       decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
-#endif
 #endif
       if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 
@@ -265,5 +259,4 @@
           memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
           pcSubCU->initAvailableFlags();
           pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
@@ -273,7 +266,4 @@
 #endif
             , numValidMergeCand );
-#else
-          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
-#endif
           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
 
@@ -283,5 +273,5 @@
           }
 #else
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
           pcSubCU->initAvailableFlags();
           pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
@@ -306,5 +296,4 @@
         memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
         pcSubCU->initAvailableFlags();
         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
@@ -314,7 +303,4 @@
 #endif
           ,numValidMergeCand, uiMergeIndex );
-#else
-        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex );
-#endif
         pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
         if(vspFlag[uiMergeIndex])
@@ -323,5 +309,5 @@
         }
 #else
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
         pcSubCU->initAvailableFlags();
         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
@@ -381,5 +367,4 @@
         }
       }
-#if LGE_SHARP_VSP_INHERIT_F0104
 #if H_3D_IC
       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
@@ -387,5 +372,4 @@
 #if H_3D_ARP
       decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
-#endif
 #endif
     }
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 764)
@@ -89,10 +89,4 @@
 #if H_3D_DIM_DMM
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#if !SEC_DMM3_RBC_F0147
-, m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#endif
-#if H_3D_DIM_RBC
-, m_cRbcDataSCModel           ( 1,             1,               NUM_RBC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
 #if H_3D_DIM_SDC
@@ -178,10 +172,4 @@
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
-#if !SEC_DMM3_RBC_F0147
-  m_cDmm3DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM3_DATA );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  m_cRbcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_RBC_DATA );
 #endif
 #if H_3D_DIM_SDC
@@ -253,10 +241,4 @@
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
-#if !SEC_DMM3_RBC_F0147
-  m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
 #endif
 #if H_3D_DIM_SDC
@@ -414,5 +396,4 @@
 }
 
-#if QC_DIM_DELTADC_UNIFY_F0132
 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg )
 {
@@ -431,22 +412,5 @@
   }
 }
-#else
-Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt dimType )
-{
-  UInt absValDeltaDC = 0;
-  xReadExGolombLevel( absValDeltaDC, m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
-  rValDeltaDC = (Pel)absValDeltaDC;
-
-  if( rValDeltaDC != 0 )
-  {
-    UInt uiSign;
-    m_pcTDecBinIf->decodeBinEP( uiSign );
-    if ( uiSign )
-    {
-      rValDeltaDC = -rValDeltaDC;
-    }
-  }
-}
-#endif
+
 
 #if H_3D_DIM_DMM
@@ -461,96 +425,6 @@
   ruiTabIdx = uiIdx;
 }
-#if !SEC_DMM3_RBC_F0147
-Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit )
-{
-  UInt uiSymbol, uiIdx = 0;
-  for( Int i = 0; i < iNumBit; i++ )
-  {
-    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm3DataSCModel.get(0, 0, 0) );
-    uiIdx += uiSymbol << i;
-  }
-  ruiIntraIdx = uiIdx;
-}
-#endif
-#endif
-#if H_3D_DIM_RBC
-Void TDecSbac::xParseRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  UInt uiSymbol = 0;
-
-  // 1. Top(0) or Left(1)
-  UChar ucLeft;
-  m_pcTDecBinIf->decodeBinEP( uiSymbol );
-  ucLeft = uiSymbol;
-
-  // 2. Start position (lowest bit first)
-  UChar ucStart = 0;
-  for( UInt ui = 0; ui < 6 - uiDepth; ui++ )
-  {
-    m_pcTDecBinIf->decodeBinEP( uiSymbol );
-    ucStart |= (uiSymbol << ui);
-  }
-
-  // 3. Number of edges
-  UChar ucMax = 0;
-  for( UInt ui = 0; ui < 7 - uiDepth; ui++ )
-  {
-    m_pcTDecBinIf->decodeBinEP( uiSymbol );
-    ucMax |= (uiSymbol << ui);
-  }
-  ucMax++; // +1
-
-  // 4. Edges
-  UChar* pucSymbolList = (UChar*) xMalloc( UChar, 256 * RBC_MAX_EDGE_NUM_PER_4x4 );
-  for( Int iPtr = 0; iPtr < ucMax; iPtr++ )
-  {
-    UChar ucEdge = 0;
-    UInt  uiReorderEdge = 0;
-    for( UInt ui = 0; ui < 6; ui++ )
-    {
-      m_pcTDecBinIf->decodeBin( uiSymbol, m_cRbcDataSCModel.get( 0, 0, 0 ) );
-      ucEdge <<= 1;
-      ucEdge |= uiSymbol;
-      if( uiSymbol == 0 )
-        break;
-    }
-
-    switch( ucEdge )
-    {
-    case 0 :  // "0"       
-      uiReorderEdge = 0;
-      break;
-    case 2 :  // "10"
-      uiReorderEdge = 1;
-      break;
-    case 6 :  // "110"
-      uiReorderEdge = 2;
-      break;
-    case 14 : // "1110"
-      uiReorderEdge = 3;
-      break;
-    case 30 : // "11110"
-      uiReorderEdge = 4;
-      break;
-    case 62 : // "111110"
-      uiReorderEdge = 5;
-      break;
-    case 63 : // "111111"
-      uiReorderEdge = 6;
-      break;
-    default :
-      printf("parseIntraEdgeChain: error (unknown code %d)\n",ucEdge);
-      assert(false);
-      break;
-    }
-    pucSymbolList[iPtr] = uiReorderEdge;
-  }
-  /////////////////////
-  // Edge Reconstruction
-  Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx );
-  pcCU->reconPartition( uiAbsPartIdx, uiDepth, ucLeft == 1, ucStart, ucMax, pucSymbolList, pbRegion );
-  xFree( pucSymbolList );
-}
-#endif
+#endif
+
 #if H_3D_DIM_SDC
 Void TDecSbac::xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
@@ -1175,99 +1049,48 @@
       pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth );
     } break;
-#if !SEC_DMM3_RBC_F0147
-  case( DMM3_IDX ):
-    {
-      UInt uiIntraIdx = 0;
-      xParseDmm3WedgeIdx( uiIntraIdx, g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
-      pcCU->setDmm3IntraTabIdxSubParts( uiIntraIdx, absPartIdx, depth );
-    } break;
-#endif
   case( DMM4_IDX ): break;
 #endif
-#if H_3D_DIM_RBC
-  case( RBC_IDX ): 
-    {
-      xParseRbcEdge( pcCU, absPartIdx, depth );
-    } break;
-#endif
   default: break;
   }
 
-#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
-  if( pcCU->getSDCFlag(absPartIdx) )
-  {
-    assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
-    pcCU->setTrIdxSubParts(0, absPartIdx, depth);
-    pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
-
-    UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2;
-    for (UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
-    {
-      xParseSDCResidualData(pcCU, absPartIdx, depth, uiSeg);
-    }
-  }
-  else
-  {
-#endif
-#if QC_DIM_DELTADC_UNIFY_F0132
-    if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
-#else
-    if( dimType < DIM_NUM_TYPE )
-#endif
-    {
-      UInt symbol;
-#if QC_DIM_DELTADC_UNIFY_F0132
-      UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
+  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
+  {
+    UInt symbol;
+    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
+
+    if( pcCU->getSDCFlag( absPartIdx ) )
+    {
+      assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
+      pcCU->setTrIdxSubParts(0, absPartIdx, depth);
+      pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
+    }
+
+    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
+
+    if( symbol )
+    {
+      if( !pcCU->getSDCFlag( absPartIdx ) )
+      {
+        dir += symbol;
+      }
+    }
+    for( UInt segment = 0; segment < uiNumSegments; segment++ )
+    {
+      Pel valDeltaDC = 0;
+      if( symbol )
+      {
+        xParseDimDeltaDC( valDeltaDC, uiNumSegments );
+      }
 
       if( pcCU->getSDCFlag( absPartIdx ) )
       {
-        assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
-        pcCU->setTrIdxSubParts(0, absPartIdx, depth);
-        pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
-      }
-
-      m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
-
-      if( symbol )
-      {
-        if( !pcCU->getSDCFlag( absPartIdx ) )
-        {
-          dir += symbol;
-        }
-      }
-      for( UInt segment = 0; segment < uiNumSegments; segment++ )
-      {
-        Pel valDeltaDC = 0;
-        if( symbol )
-        {
-          xParseDimDeltaDC( valDeltaDC, uiNumSegments );
-        }
-
-        if( pcCU->getSDCFlag( absPartIdx ) )
-        {
-          pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
-        }
-        else
-        {
-          pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
-        }
-      }
-#else
-      m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
-      if( symbol )
-      {
-        dir += symbol;
-        for( UInt segment = 0; segment < 2; segment++ )
-        {
-          Pel valDeltaDC = 0;
-          xParseDimDeltaDC( valDeltaDC, dimType );
-          pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
-        }
-      }
-#endif
-    }
-#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
-  }
-#endif
+        pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
+      }
+      else
+      {
+        pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
+      }
+    }
+  }
 
   pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
@@ -1297,9 +1120,5 @@
   else if( puIdx == 0 )
   {
-#if SEC_DMM3_RBC_F0147
     while( binNum < 1 && symbol )
-#else
-    while( binNum < 3 && symbol )
-#endif
     {
       ctxDepthMode = puIdx*3 + ((binNum >= 2) ? 2 : binNum);
@@ -1308,17 +1127,17 @@
       binNum++;
     }
-#if SEC_DMM3_RBC_F0147
-    if( modeCode == 0 ) { dir = 0;                       sdcFlag = 0;}
-    else if( modeCode == 1 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
-#else
-         if( modeCode == 0 ) { dir = 0;                       sdcFlag = 0;}
-    else if( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
-    else if( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
-    else if( modeCode == 7 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
-#endif
+    if( modeCode == 0 ) 
+    { 
+      dir = 0;
+      sdcFlag = 0;
+    }
+    else if ( modeCode == 1 ) 
+    { 
+      dir = (2*DMM1_IDX+DIM_OFFSET); 
+      sdcFlag = 0;
+    }
   }
   else
   {
-#if SEC_DMM3_RBC_F0147
     while( binNum < 4 && symbol )
     {
@@ -1333,37 +1152,5 @@
     else if ( modeCode == 14 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
     else if ( modeCode == 15 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
-#else
-    UInt maxBinNum = 0;
-    m_pcTDecBinIf->decodeBinEP(symbol);
-    if( symbol == 1 )
-    {
-      maxBinNum = 3;
-    }
-    else
-    {
-      maxBinNum = 2;
-      symbol = 1;
-    }
-    while( binNum<maxBinNum && symbol )
-    {
-      ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum );
-      m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode));
-      modeCode = (modeCode<<1)+symbol;
-      binNum++;
-    }
-    if( maxBinNum == 3 )
-    {
-      if ( modeCode == 0 )       { dir =  PLANAR_IDX;             sdcFlag = 1;}
-      else if ( modeCode == 2 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
-      else if ( modeCode == 6 )  { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
-      else if ( modeCode == 7 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
-    }
-    else
-    {
-      if ( modeCode == 0 )       { dir = 5;                       sdcFlag = 0;}
-      else if ( modeCode == 2 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
-      else if ( modeCode == 3 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
-    }
-#endif
+
   }
   pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 764)
@@ -103,17 +103,7 @@
 #if H_3D_DIM
   Void  xReadExGolombLevel   ( UInt& ruiSymbol, ContextModel& rcSCModel  );
-#if QC_DIM_DELTADC_UNIFY_F0132
   Void  xParseDimDeltaDC     ( Pel& rValDeltaDC, UInt uiNumSeg );
-#else
-  Void  xParseDimDeltaDC     ( Pel& rValDeltaDC, UInt dimType );
-#endif
 #if H_3D_DIM_DMM
   Void  xParseDmm1WedgeIdx   ( UInt& ruiTabIdx, Int iNumBit );
-#if !SEC_DMM3_RBC_F0147
-  Void  xParseDmm3WedgeIdx   ( UInt& ruiIntraIdx, Int iNumBit );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  Void  xParseRbcEdge        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
 #if H_3D_DIM_SDC
@@ -223,10 +213,4 @@
 #if H_3D_DIM_DMM
   ContextModel3DBuffer m_cDmm1DataSCModel;
-#if !SEC_DMM3_RBC_F0147
-  ContextModel3DBuffer m_cDmm3DataSCModel;
-#endif
-#endif
-#if H_3D_DIM_RBC
-  ContextModel3DBuffer m_cRbcDataSCModel;
 #endif
 #if H_3D_DIM_SDC  
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 764)
@@ -2124,9 +2124,5 @@
     }
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth())
-#else
-    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) )
-#endif
     {
       WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 764)
@@ -420,7 +420,4 @@
 #if H_3D_DIM
   Bool      m_useDMM;
-#if !SEC_DMM3_RBC_F0147
-  Bool      m_useRBC;
-#endif
   Bool      m_useSDC;
   Bool      m_useDLT;
@@ -1003,8 +1000,4 @@
   Bool      getUseDMM                       ()        { return m_useDMM; }
   Void      setUseDMM                       ( Bool b) { m_useDMM = b;    }
-#if !SEC_DMM3_RBC_F0147
-  Bool      getUseRBC                       ()        { return m_useRBC; }
-  Void      setUseRBC                       ( Bool b) { m_useRBC = b;    }
-#endif
   Bool      getUseSDC                       ()        { return m_useSDC; }
   Void      setUseSDC                       ( Bool b) { m_useSDC = b;    }
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 764)
@@ -497,9 +497,5 @@
 #endif
 #if H_3D_IC
-#if SEC_ONLY_TEXTURE_IC_F0151
   Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth();
-#else
-  Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE );
-#endif
   bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC();
 #endif
@@ -1779,5 +1775,5 @@
 #endif
 
-#if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104 
+#if H_3D_ARP
   DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
 #else
@@ -1787,9 +1783,8 @@
 
 #if H_3D_VSP
-#if !(H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104)
+#if !H_3D_ARP
   Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
   memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
   InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
-#if ETRIKHU_MERGE_REUSE_F0093
   rpcTempCU->m_bAvailableFlagA1 = 0;
   rpcTempCU->m_bAvailableFlagB1 = 0;
@@ -1799,10 +1794,6 @@
   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand );
-#else
-  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
-#endif
-#endif
-#else
-#if ETRIKHU_MERGE_REUSE_F0093
+#endif
+#else
   rpcTempCU->m_bAvailableFlagA1 = 0;
   rpcTempCU->m_bAvailableFlagB1 = 0;
@@ -1812,7 +1803,4 @@
   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
-#else
-  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
-#endif
 #endif
 
@@ -1822,5 +1810,5 @@
   Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
 #endif
-#if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104
+#if H_3D_ARP
 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
 #else
@@ -1856,5 +1844,4 @@
     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) );
 #endif
-#if LGE_SHARP_VSP_INHERIT_F0104
     rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
     rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth );
@@ -1876,5 +1863,5 @@
     puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()]; 
 #endif
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
     rpcTempCU->initAvailableFlags();
     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
@@ -1888,5 +1875,5 @@
     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
 #endif
-#endif
+
 #endif
   for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual )
@@ -1950,27 +1937,4 @@
             rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
 #if MTK_SPIVMP_F0110
-          }
-#endif
-#if H_3D_ARP && !QC_MTK_INTERVIEW_ARP_F0123_F0108
-          if( nARPW )
-          {
-            Bool bSignalflag[2] = { true, true };
-            for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
-            {
-              Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx();
-              RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
-              if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )
-              {
-                bSignalflag[uiRefListIdx] = false;
-              }
-            }
-            if( !bSignalflag[0] && !bSignalflag[1] )
-            {
-#if LGE_SHARP_VSP_INHERIT_F0104
-              continue;
-#else
-              rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
-#endif
-            }
           }
 #endif
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 764)
@@ -160,9 +160,5 @@
 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
-#if SEC_ONLY_TEXTURE_IC_F0151
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
-#else
-  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )
-#endif
   {
     return;
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 764)
@@ -95,10 +95,4 @@
 #if H_3D_DIM_DMM
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#if !SEC_DMM3_RBC_F0147
-, m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#endif
-#if H_3D_DIM_RBC
-, m_cRbcDataSCModel           ( 1,             1,               NUM_RBC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
 #if H_3D_DIM_SDC
@@ -176,10 +170,4 @@
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
-#if !SEC_DMM3_RBC_F0147
-  m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
 #endif
 #if H_3D_DIM_SDC
@@ -266,10 +254,4 @@
 #if H_3D_DIM_DMM
       curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
-#if !SEC_DMM3_RBC_F0147
-      curCost += m_cDmm3DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM3_DATA );
-#endif
-#endif
-#if H_3D_DIM_RBC
-      curCost += m_cRbcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_RBC_DATA );
 #endif
     }
@@ -337,10 +319,4 @@
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
-#if !SEC_DMM3_RBC_F0147
-  m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  m_cRbcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );
 #endif
 #if H_3D_DIM_SDC
@@ -526,5 +502,4 @@
 }
 
-#if QC_DIM_DELTADC_UNIFY_F0132
 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
 {
@@ -536,15 +511,4 @@
   }
 }
-#else
-Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt dimType )
-{
-  xWriteExGolombLevel( UInt( abs( valDeltaDC ) ), m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
-  if( valDeltaDC != 0 )
-  {
-    UInt uiSign = valDeltaDC > 0 ? 0 : 1;
-    m_pcBinIf->encodeBinEP( uiSign );
-  }
-}
-#endif
 
 #if H_3D_DIM_DMM
@@ -557,64 +521,6 @@
 }
 
-#if !SEC_DMM3_RBC_F0147
-Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit )
-{
-  for( Int i = 0; i < iNumBit; i++ )
-  {
-    m_pcBinIf->encodeBin( ( uiIntraIdx >> i ) & 1, m_cDmm3DataSCModel.get(0, 0, 0) );
-  }
-}
-#endif
-#endif
-#if H_3D_DIM_RBC
-Void TEncSbac::xCodeRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx )
-{
-  UInt   uiDepth        = pcCU->getDepth( uiAbsPartIdx ) + (pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 1 : 0);
-  UChar* pucSymbolList  = pcCU->getEdgeCode     ( uiAbsPartIdx );
-  UChar  ucEdgeNumber   = pcCU->getEdgeNumber   ( uiAbsPartIdx );
-  Bool   bLeft          = pcCU->getEdgeLeftFirst( uiAbsPartIdx );
-  UChar  ucStart        = pcCU->getEdgeStartPos ( uiAbsPartIdx );
-  UInt   uiSymbol;
-
-  // 1. Top(0) or Left(1)
-  uiSymbol = (bLeft == false) ? 0 : 1;
-  m_pcBinIf->encodeBinEP( uiSymbol );
-
-  // 2. Start position (lowest bit first)
-  uiSymbol = ucStart;
-  for( UInt ui = 6; ui > uiDepth; ui-- ) // 64(0)->6, 32(1)->5, 16(2)->4, 8(3)->3, 4(4)->2
-  {
-    m_pcBinIf->encodeBinEP( uiSymbol & 0x1 );
-    uiSymbol >>= 1;
-  }
-
-  // 3. Number of edges
-  uiSymbol = ucEdgeNumber > 0 ? ucEdgeNumber - 1 : 0;
-  for( UInt ui = 7; ui > uiDepth; ui-- ) // 64(0)->7, 32(1)->6, 16(2)->5, 8(3)->4, 4(4)->3
-  {
-    m_pcBinIf->encodeBinEP( uiSymbol & 0x1 );
-    uiSymbol >>= 1;
-  }
-
-  if(uiSymbol != 0)
-  {
-    printf(" ucEdgeNumber %d at depth %d\n",ucEdgeNumber, uiDepth);
-    assert(false);
-  }
-
-  // 4. Edges
-  for( Int iPtr2 = 0; iPtr2 < ucEdgeNumber; iPtr2++ )
-  {
-    UInt uiReorderSymbol = pucSymbolList[iPtr2];
-    for( UInt ui = 0; ui < uiReorderSymbol; ui++ )
-    {
-      m_pcBinIf->encodeBin( 1, m_cRbcDataSCModel.get( 0, 0, 0 ) );
-    }
-
-    if( uiReorderSymbol != 6 )
-      m_pcBinIf->encodeBin( 0, m_cRbcDataSCModel.get( 0, 0, 0 ) );
-  }
-}
-#endif
+#endif
+
 #if H_3D_DIM_SDC
 Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
@@ -1239,97 +1145,47 @@
       xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
     } break;
-#if !SEC_DMM3_RBC_F0147
-  case( DMM3_IDX ):
-    {
-      xCodeDmm3WedgeIdx( pcCU->getDmm3IntraTabIdx( absPartIdx ), g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
-    } break;
-#endif
   case( DMM4_IDX ): break;
 #endif
-#if H_3D_DIM_RBC
-  case( RBC_IDX ):
-    {
-      assert( pcCU->getWidth( absPartIdx ) < 64 );
-      xCodeRbcEdge( pcCU, absPartIdx );
-    } break;
-#endif
   default: break;
   }
 
-#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
-  if( pcCU->getSDCFlag( absPartIdx ) )
-  {
-    assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
-    UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2;
-    for(UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++)
-    {
-      xCodeSDCResidualData(pcCU, absPartIdx, uiSeg);
-    }
-  }
-  else
-  {
-#endif
-#if QC_DIM_DELTADC_UNIFY_F0132
-    if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
-#else
-    if( dimType < DIM_NUM_TYPE )
-#endif
-    {
-#if QC_DIM_DELTADC_UNIFY_F0132
-      UInt dimDeltaDC;
-      Pel  deltaDC;
-      UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
-      if( pcCU->getSDCFlag( absPartIdx ) )
-    {
-        if( uiNumSegments==1 )
-        {
-          dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
-        }
-        else
-        {
-          dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
-        }
+  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
+  {
+    UInt dimDeltaDC;
+    Pel  deltaDC;
+    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
+    if( pcCU->getSDCFlag( absPartIdx ) )
+    {
+      if( uiNumSegments==1 )
+      {
+        dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
       }
       else
       {
-        dimDeltaDC = isDimDeltaDC( dir );
-      }
-
-      m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
-
-      if( dimDeltaDC ) 
-      {
-        for( UInt segment = 0; segment < uiNumSegments; segment++ )
-        {
-          deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
-          xCodeDimDeltaDC( deltaDC, uiNumSegments );
-        }
-      }
-#else
-      UInt dimDeltaDC = isDimDeltaDC( dir );
-      m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );
-      if( dimDeltaDC ) 
-      {
-        for( UInt segment = 0; segment < 2; segment++ )
-        {
-          xCodeDimDeltaDC( pcCU->getDimDeltaDC( dimType, segment, absPartIdx ), dimType );
-        }
-      }
-#endif
-    }
-#if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132
-  }
-#endif
+        dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
+      }
+    }
+    else
+    {
+      dimDeltaDC = isDimDeltaDC( dir );
+    }
+
+    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
+
+    if( dimDeltaDC ) 
+    {
+      for( UInt segment = 0; segment < uiNumSegments; segment++ )
+      {
+        deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
+        xCodeDimDeltaDC( deltaDC, uiNumSegments );
+      }
+    }
+  }
 }
 
 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
 {
-#if SEC_DMM3_RBC_F0147
   UInt codeWordTable[3][7] =    {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};
   UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3,  4,  4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};
-#else
-    UInt codeWordTable[3][7] =    {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}};
-    UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}};
-#endif
   UInt dir = pcCU->getLumaIntraDir( absPartIdx );
   UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
@@ -1346,8 +1202,4 @@
     case DMM1_IDX: codeIdx = 3; break;
     case DMM4_IDX: codeIdx = 4; break;
-#if !SEC_DMM3_RBC_F0147
-    case DMM3_IDX: codeIdx = 5; break;
-    case  RBC_IDX: codeIdx = 6; break;
-#endif
     default:                    break;
     }
@@ -1362,17 +1214,4 @@
       default:          codeIdx = 2; break;
     }
-  }
-#endif
-#if !SEC_DMM3_RBC_F0147 
-  if( puIdx==1 )
-  {
-      if( codeIdx==1 || codeIdx==2 || codeIdx==4 )
-      {
-          m_pcBinIf->encodeBinEP( 0 );
-      }
-      else
-      {
-          m_pcBinIf->encodeBinEP( 1 );
-      }
   }
 #endif
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.h	(revision 764)
@@ -116,19 +116,9 @@
   Void  xWriteEpExGolomb     ( UInt uiSymbol, UInt uiCount );
   Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam );
-  #if H_3D_DIM
+#if H_3D_DIM
   Void  xWriteExGolombLevel  ( UInt uiSymbol, ContextModel& rcSCModel  );
-#if QC_DIM_DELTADC_UNIFY_F0132
   Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt uiNumSeg );
-#else
-  Void  xCodeDimDeltaDC      ( Pel valDeltaDC, UInt dimType );
-#endif
 #if H_3D_DIM_DMM
   Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
-#if !SEC_DMM3_RBC_F0147
-  Void  xCodeDmm3WedgeIdx    ( UInt uiIntraIdx, Int iNumBit );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  Void  xCodeRbcEdge         ( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
 #if H_3D_DIM_SDC
@@ -259,10 +249,4 @@
 #if H_3D_DIM_DMM
   ContextModel3DBuffer m_cDmm1DataSCModel;
-#if !SEC_DMM3_RBC_F0147
-  ContextModel3DBuffer m_cDmm3DataSCModel;
-#endif
-#endif
-#if H_3D_DIM_RBC
-  ContextModel3DBuffer m_cRbcDataSCModel;
 #endif
 #if H_3D_DIM_SDC  
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 764)
@@ -1124,30 +1124,22 @@
       {
 #endif
-      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
-      {
-#if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
-#if DLT_DIFF_CODING_IN_PPS
-        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
-#else
-        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
-#endif
+        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
+        {
+#if H_3D_DIM
+          if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
           {
-#if DLT_DIFF_CODING_IN_PPS
             pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
-#else
-            pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
-#endif
           }
           else
           {
-              pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
+            pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
           }
 #else
-        pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
-#endif
-      }
-      pOrg  += uiStride;
-      pResi += uiStride;
-      pPred += uiStride;
+          pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];
+#endif
+        }
+        pOrg  += uiStride;
+        pResi += uiStride;
+        pPred += uiStride;
 #if H_3D_DIM_ENC
       }
@@ -1209,21 +1201,13 @@
       for( UInt uiX = 0; uiX < uiWidth; uiX++ )
       {
-#if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
-#if DLT_DIFF_CODING_IN_PPS
+#if H_3D_DIM
         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
-#else
-        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
-#endif
-          {
-#if DLT_DIFF_CODING_IN_PPS
-            pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
-#else
-            pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
-#endif
-          }
-          else
-          {
-              pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
-          }
+        {
+          pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
+        }
+        else
+        {
+          pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
+        }
 #else
         pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
@@ -2924,23 +2908,5 @@
               biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
             } break;
-#if !SEC_DMM3_RBC_F0147
-          case( DMM3_IDX ):
-            {
-
-              TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
-              TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() );
-              UInt      uiTexPartIdx = pcCU->getZorderIdxInCU() + uiPartOffset;
-              Int   uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
-
-              if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
-              {
-             UInt uiIntraTabIdx = 0;
-              xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir );
-              pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );
-              pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth );
-              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
-              }
-            } break;
-#endif
+
           case( DMM4_IDX ):
             {
@@ -2968,27 +2934,4 @@
       }
 #endif
-#if H_3D_DIM_RBC
-      if( m_pcEncCfg->getUseRBC()
-#if H_3D_FAST_DEPTH_INTRA
-          && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
-#endif
-        )
-      {
-        if( xSearchRbcEdge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ) )
-        {
-          Pel deltaDC1 = 0; Pel deltaDC2 = 0;
-#if QC_DIM_DELTADC_UNIFY_F0132
-          xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
-#else
-          xSearchRbcDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
-#endif
-          pcCU->setDimDeltaDC( RBC_IDX, 0, uiPartOffset, deltaDC1 );
-          pcCU->setDimDeltaDC( RBC_IDX, 1, uiPartOffset, deltaDC2 );
-
-          uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX  +DIM_OFFSET);
-          uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX+1+DIM_OFFSET);
-        }
-      }
-#endif
     }
 #endif
@@ -3029,9 +2972,5 @@
       Bool bTestZeroResi = false;
 #if H_3D_DIM_ENC
-#if LGE_BUGFIX_F0158
       bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP();
-#else
-      bTestZeroResi |= pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->isIRAP();
-#endif
 #endif
 #if H_3D_DIM_SDC
@@ -3660,5 +3599,5 @@
     if ( iPUIdx == 0 )
     {
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
       pcCU->initAvailableFlags();
       pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
@@ -3674,11 +3613,5 @@
         );
 #else
-      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
-#if H_3D_VSP
-                                   , vspFlag
-                                   , inheritedVSPDisInfo
-#endif
-                                   , numValidMergeCand
-                                   );
+      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
 #endif
     }
@@ -3687,5 +3620,5 @@
   else
   {
-#if ETRIKHU_MERGE_REUSE_F0093
+#if H_3D
     pcCU->initAvailableFlags();
     pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
@@ -3701,10 +3634,5 @@
       );
 #else
-    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
-#if H_3D_VSP
-                                 , vspFlag
-                                 , inheritedVSPDisInfo
-#endif
-                                 , numValidMergeCand
+    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
                                  );
 #endif
@@ -7477,1031 +7405,7 @@
 }
 
-#if !SEC_DMM3_RBC_F0147
-Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir )
-{
-  ruiTabIdx       = 0;
-  ruiIntraTabIdx  = 0;
-
-  // local pred buffer
-  TComYuv cPredYuv; 
-  cPredYuv.create( uiWidth, uiHeight ); 
-  cPredYuv.clear();
-  Pel* piPred = cPredYuv.getLumaAddr();
-  UInt uiPredStride = cPredYuv.getStride();
-
-  // wedge search
-  UInt uiBestDist = MAX_UINT;
-  WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
-  Pel refDC1 = 0; Pel refDC2 = 0;
-
-  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
-  std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[colTexIntraDir-2];
-  for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
-  {
-    UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
-    TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx));
-    xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-    xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-
-    UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
-    if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
-    {
-      uiBestDist     = uiActDist;
-      ruiTabIdx      = uiIdx;
-      ruiIntraTabIdx = uiIdxW;
-    }
-  }
-  cPredYuv.destroy();
-}
-#endif
-#endif
-#if H_3D_DIM_RBC
-Void TEncSearch::xSearchRbcDeltaDCs( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 )
-{
-  assert( biSegPattern );
-  Pel origDC1 = 0; Pel origDC2 = 0;
-  xCalcBiSegDCs  ( piOrig,   uiStride, biSegPattern, patternStride, origDC1, origDC2 );
-  xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 );
-
-  Int* piMask = pcCU->getPattern()->getAdiOrgBuf( uiWidth, uiHeight, m_piYuvExt ); // no filtering for DMM
-  Int  maskStride = 2*uiWidth + 1;
-  Int* ptrSrc = piMask+maskStride+1;
-  Pel  predDC1 = 0; Pel predDC2 = 0;
-  xPredBiSegDCs( ptrSrc, maskStride, biSegPattern, patternStride, predDC1, predDC2 );
-
-  rDeltaDC1 = origDC1 - predDC1;
-  rDeltaDC2 = origDC2 - predDC2;
-
-#if H_3D_VSO
-  if( m_pcRdCost->getUseVSO() )
-  {
-    Pel fullDeltaDC1 = rDeltaDC1;
-    Pel fullDeltaDC2 = rDeltaDC2;
-
-    xDeltaDCQuantScaleDown( pcCU, fullDeltaDC1 );
-    xDeltaDCQuantScaleDown( pcCU, fullDeltaDC2 );
-
-    Dist uiBestDist     = RDO_DIST_MAX;
-    UInt uiBestQStepDC1 = 0;
-    UInt uiBestQStepDC2 = 0;
-
-    UInt uiDeltaDC1Max = abs(fullDeltaDC1);
-    UInt uiDeltaDC2Max = abs(fullDeltaDC2);
-
-    //VSO Level delta DC check range extension
-    uiDeltaDC1Max += (uiDeltaDC1Max>>1);
-    uiDeltaDC2Max += (uiDeltaDC2Max>>1);
-
-    for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++  )
-    {
-      Pel iLevelDeltaDC1 = (Pel)(uiQStepDC1) * (Pel)(( fullDeltaDC1 < 0 ) ? -1 : 1);
-      xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 );
-      Pel testDC1 = ClipY( predDC1 + iLevelDeltaDC1 );
-
-      for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++  )
-      {
-        Pel iLevelDeltaDC2 = (Pel)(uiQStepDC2) * (Pel)(( fullDeltaDC2 < 0 ) ? -1 : 1);
-        xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 );
-        Pel testDC2 = ClipY( predDC2 + iLevelDeltaDC2 );
-
-        xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 );
-
-        Dist uiActDist = RDO_DIST_MAX;
-        if( m_pcRdCost->getUseEstimatedVSD() )
-        {
-          uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );
-        }
-        else
-        {
-          uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );
-        }
-
-        if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
-        {
-          uiBestDist     = uiActDist;
-          uiBestQStepDC1 = uiQStepDC1;
-          uiBestQStepDC2 = uiQStepDC2;
-        }
-      }
-    }
-
-    fullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( fullDeltaDC1 < 0 ) ? -1 : 1);
-    fullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( fullDeltaDC2 < 0 ) ? -1 : 1);
-    xDeltaDCQuantScaleUp( pcCU, fullDeltaDC1 );
-    xDeltaDCQuantScaleUp( pcCU, fullDeltaDC2 );
-    rDeltaDC1 = fullDeltaDC1;
-    rDeltaDC2 = fullDeltaDC2;
-  }
-#endif
-
-  xDeltaDCQuantScaleDown( pcCU, rDeltaDC1 );
-  xDeltaDCQuantScaleDown( pcCU, rDeltaDC2 );
-}
-
-Bool TEncSearch::xSearchRbcEdge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, Int iWidth, Int iHeight )
-{
-  Bool* pbEdge  = (Bool*) xMalloc( Bool, iWidth * iHeight * 4 );
-
-  Short* psDiffX = new Short[ iWidth * iHeight ];
-  Short* psDiffY = new Short[ iWidth * iHeight ];
-  Bool*  pbEdgeX = new Bool [ iWidth * iHeight ];
-  Bool*  pbEdgeY = new Bool [ iWidth * iHeight ];
-
-  // Find Horizontal Gradient & Edge Detection ((x+1, y) - (x,y))
-  for( Int y=0; y<iHeight; y++ )
-  {
-    Short* psDiffXPtr = &psDiffX[ y * iHeight ];
-    Bool*  pbEdgeXPtr = &pbEdgeX[ y * iHeight ];
-    for(Int x=0; x<iWidth-1; x++ )
-    {
-      *psDiffXPtr = piRef[ x+1 + y*uiRefStride ] - piRef[ x + y*uiRefStride ];
-      if(*psDiffXPtr >= RBC_THRESHOLD || *psDiffXPtr <= (-1)*RBC_THRESHOLD)
-      {
-        *pbEdgeXPtr = true;
-      }
-      else
-      {
-        *pbEdgeXPtr = false;
-      }
-
-      psDiffXPtr++;
-      pbEdgeXPtr++;
-    }
-  }
-
-  // Find Vertical Gradient & Edge Detection((x,y+1) - (x,y))
-  for( Int y=0; y<iHeight-1; y++ )
-  {
-    Short* psDiffYPtr = &psDiffY[ y * iHeight ];
-    Bool*  pbEdgeYPtr = &pbEdgeY[ y * iHeight ];
-    for(Int x=0; x<iWidth; x++ )
-    {
-      *psDiffYPtr = piRef[ x + (y+1)*uiRefStride ] - piRef[ x + y*uiRefStride ];
-      if(*psDiffYPtr >= RBC_THRESHOLD || *psDiffYPtr <= (-1)*RBC_THRESHOLD)
-      {
-        *pbEdgeYPtr = true;
-      }
-      else
-      {
-        *pbEdgeYPtr = false;
-      }
-
-      psDiffYPtr++;
-      pbEdgeYPtr++;
-    }
-  }
-
-  // Eliminate local maximum
-  for( Int y=0; y<iHeight; y++ )
-  {
-    Short* psDiffXPtr = &psDiffX[ y * iHeight ];
-    Bool*  pbEdgeXPtr = &pbEdgeX[ y * iHeight ];
-    for( Int x=0; x<iWidth-1; x++ )
-    {
-      UShort usAbs0=0, usAbs1=0, usAbs2=0;  // 0 : left, 1 : current, 2 : right
-
-      if( x > 0 && *(pbEdgeXPtr-1) == true )
-      {
-        if( *(psDiffXPtr-1) >= 0)
-        {
-          usAbs0 = *(psDiffXPtr-1);
-
-        }
-        else
-        {
-          usAbs0 = (-1) * *(psDiffXPtr-1);
-        }
-      }
-      if( *pbEdgeXPtr == true )
-      {
-        if( *(psDiffXPtr) >= 0)
-        {
-          usAbs1 = *(psDiffXPtr);
-        }
-        else
-        {
-          usAbs1 = (-1) * *(psDiffXPtr);
-        }
-      }
-      if( x < iWidth-2 && *(pbEdgeXPtr+1) == true )
-      {
-        if( *(psDiffXPtr+1) >= 0)
-        {
-          usAbs2 = *(psDiffXPtr+1);
-          //bSign2 = true;
-        }
-        else
-        {
-          usAbs2 = (-1) * *(psDiffXPtr+1);
-        }
-      }
-
-      if( x == 0 )
-      {
-        if( usAbs1 < usAbs2 )
-        {
-          *pbEdgeXPtr = false;
-        }
-      }
-      else if( x == iWidth-2 )
-      {
-        if( usAbs1 <= usAbs0 )
-          *pbEdgeXPtr = false;
-      }
-      else
-      {
-        if( usAbs2 > usAbs0 )
-        {
-          if( usAbs1 < usAbs2 )
-            *pbEdgeXPtr = false;
-        }
-        else
-        {
-          if( usAbs1 <= usAbs0 )
-            *pbEdgeXPtr = false;
-        }
-      }
-
-      psDiffXPtr++;
-      pbEdgeXPtr++;
-    }
-  }
-
-  for( Int y=0; y<iHeight-1; y++ )
-  {
-    Short* psDiffYPtr = &psDiffY[ y * iWidth ];
-    Bool*  pbEdgeYPtr = &pbEdgeY[ y * iWidth ];
-    for( Int x=0; x<iWidth; x++ )
-    {
-      UShort usAbs0=0, usAbs1=0, usAbs2=0;  // 0 : upper, 1 : current, 2 : bottom
-      if( y > 0 && *(pbEdgeYPtr-iWidth) == true )
-      {
-        if( *(psDiffYPtr-iWidth) >= 0)
-        {
-          usAbs0 = *(psDiffYPtr-iWidth);
-        }
-        else
-        {
-          usAbs0 = (-1) * *(psDiffYPtr-iWidth);          
-        }
-      }
-      if( *pbEdgeYPtr == true )
-      {
-        if( *(psDiffYPtr) >= 0)
-        {
-          usAbs1 = *(psDiffYPtr);
-        }
-        else
-        {
-          usAbs1 = (-1) * *(psDiffYPtr);
-        }
-      }
-      if( y < iHeight-2 && *(pbEdgeYPtr+iWidth) == true )
-      {
-        if( *(psDiffYPtr+iWidth) >= 0)
-        {
-          usAbs2 = *(psDiffYPtr+iWidth);          
-        }
-        else
-        {
-          usAbs2 = (-1) * *(psDiffYPtr+iWidth);
-        }
-      }
-
-      if( y == 0 )
-      {
-        if( usAbs1 < usAbs2 )
-          *pbEdgeYPtr = false;
-      }
-      else if( y == iHeight-2 )
-      {
-        if( usAbs1 <= usAbs0 )
-          *pbEdgeYPtr = false;
-      }
-      else
-      {
-        if( usAbs2 > usAbs0 )
-        {
-          if( usAbs1 < usAbs2 )
-            *pbEdgeYPtr = false;
-        }
-        else
-        {
-          if( usAbs1 <= usAbs0 )
-            *pbEdgeYPtr = false;
-        }
-      }
-
-      psDiffYPtr++;
-      pbEdgeYPtr++;
-    }
-  }
-
-  // Edge Merging
-  for( Int i=0; i< 4 * iWidth * iHeight; i++ )
-    pbEdge[ i ] = false;
-  /// Even Line (0,2,4,6,...) => Vertical Edge
-  for( Int i=0; i<iHeight; i++)
-  {
-    for( Int j=0; j<iWidth-1; j++)
-    {
-      pbEdge[ (2 * j + 1) + (2 * i) * 2 * iWidth ] = pbEdgeX[ j + i * iHeight ];
-    }
-  }
-  /// Odd Line (1,3,5,7,...) => Horizontal Edge
-  for( Int i=0; i<iHeight-1; i++)
-  {
-    for( Int j=0; j<iWidth; j++)
-    {
-      pbEdge[ (2 * j) + (2 * i + 1) * 2 * iWidth ] = pbEdgeY[ j + i * iHeight ]; 
-    }
-  }
-
-  // Intersection Filling
-  /// Vertical Edge between Horizontal Edges
-  for( Int i = 1; i < 2 * iHeight - 3; i += 2)
-  {
-    for( Int j = 0; j < 2 * iWidth - 1; j += 2)
-    {
-      if( pbEdge[ j + i * 2 * iWidth ] )
-      {
-        if( j != 0 && pbEdge[ (j - 2) + ((i + 2) * 2 * iWidth) ] )
-        {
-          if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j - 1) + ((i + 3) * 2 * iWidth) ] )
-            pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] = true;
-        }
-        if( j != 2 * iWidth - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] )
-        {
-          if( !pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 1) + ((i + 3) * 2 * iWidth) ] )
-            pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true;
-        }
-      }
-    }
-  }
-  /// Horizontal Edge between Vertical Edges
-  for( Int j = 1; j < 2 * iWidth - 3; j += 2)
-  {
-    for( Int i = 0; i < 2 * iHeight - 1; i += 2)
-    {
-      if( pbEdge[ j + i * 2 * iWidth ] )
-      {
-        if( i != 0 && pbEdge[ (j + 2) + ((i - 2) * 2 * iWidth) ] )
-        {
-          if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i - 1) * 2 * iWidth) ] )
-            pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] = true;
-        }
-        if( i != 2 * iHeight - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] )
-        {
-          if( !pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i + 1) * 2 * iWidth) ] )
-            pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true;
-        }
-      }
-    }
-  }
-
-  // Static Pruning Unnecessary Edges
-  /// Step1. Stack push the unconnected edges
-  UShort* pusUnconnectedEdgeStack = new UShort[ 4 * iWidth * iHeight ]; // approximate size calculation
-  Int iUnconnectedEdgeStackPtr = 0;
-  //// Vertical Edges
-  for( Int i = 0; i < 2 * iHeight - 1; i += 2 )
-  {
-    for( Int j = 1; j < 2 * iWidth - 2; j += 2 )
-    {
-      if( pbEdge[ j + i * 2 * iWidth ] )
-      {
-        if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) )
-        {
-          pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j);
-          iUnconnectedEdgeStackPtr++;
-        }
-      }
-    }
-  }
-
-  //// Horizontal Edges
-  for( Int i = 1; i < 2 * iHeight - 2; i += 2 )
-  {
-    for( Int j = 0; j < 2 * iWidth - 1; j += 2 )
-    {
-      if( pbEdge[ j + i * 2 * iWidth ] )
-      {
-        if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) )
-        {
-          pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j);
-          iUnconnectedEdgeStackPtr++;
-        }
-      }
-    }
-  }
-
-  /// Step2. Remove the edges from the stack and push the new unconnected edges
-  //// (This step may contain duplicated edges already in the stack)
-  //// (But it doesn't cause any functional problems)
-  while( iUnconnectedEdgeStackPtr != 0 )
-  {
-    iUnconnectedEdgeStackPtr--;
-    Int iX = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] & 0xff;
-    Int iY = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] >> 8;
-
-    pbEdge[ iX + iY * 2 * iWidth ] = false;
-
-    if( iY % 2 == 1 && iX > 0 && pbEdge[ iX - 2 + iY * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX - 2, iY, iWidth, iHeight ) ) // left
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX - 2);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iY % 2 == 1 && iX < 2 * iWidth - 2 && pbEdge[ iX + 2 + iY * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX + 2, iY, iWidth, iHeight ) ) // right
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX + 2);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iY % 2 == 0 && iY > 0 && pbEdge[ iX + (iY - 2) * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX, iY - 2, iWidth, iHeight ) ) // top
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 2) << 8) | (iX + 0);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iY % 2 == 0 && iY < 2 * iHeight - 2 && pbEdge[ iX + (iY + 2) * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX, iY + 2, iWidth, iHeight ) ) // bottom
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 2) << 8) | (iX + 0);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iX > 0 && iY > 0 && pbEdge[ iX - 1 + (iY - 1) * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX - 1, iY - 1, iWidth, iHeight ) ) // left-top
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX - 1);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iX < 2 * iWidth - 1 && iY > 0 && pbEdge[ iX + 1 + (iY - 1) * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX + 1, iY - 1, iWidth, iHeight ) ) // right-top
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX + 1);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iX > 0 && iY < 2 * iHeight - 1 && pbEdge[ iX - 1 + (iY + 1) * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX - 1, iY + 1, iWidth, iHeight ) ) // left-bottom
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX - 1);
-      iUnconnectedEdgeStackPtr++;
-    }
-    if( iX < 2 * iWidth - 1 && iY < 2 * iHeight - 1 && pbEdge[ iX + 1 + (iY + 1) * 2 * iWidth ] &&
-      !xCheckTerminatedEdge( pbEdge, iX + 1, iY + 1, iWidth, iHeight ) ) // right-bottom
-    {
-      pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX + 1);
-      iUnconnectedEdgeStackPtr++;
-    }
-  }
-
-
-  // Region Generation ( edge -> region )
-  Bool* pbRegion = pcCU->getEdgePartition( uiAbsPtIdx );
-  Bool* pbVisit  = new Bool[ iWidth * iHeight ];
-
-  for( UInt ui = 0; ui < iWidth * iHeight; ui++ )
-  {
-    pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)
-    pbVisit [ ui ] = false;
-  }
-
-  Int* piStack = new Int[ iWidth * iHeight ];
-
-  Int iPtr = 0;
-
-  piStack[iPtr++] = (0 << 8) | (0);
-  pbRegion[ 0 ] = false;
-
-  while(iPtr > 0)
-  {
-    Int iTmp = piStack[--iPtr];
-    Int iX1, iY1;
-    iX1 = iTmp & 0xff;
-    iY1 = (iTmp >> 8) & 0xff;
-
-    pbVisit[ iX1 + iY1 * iWidth ] = true;
-
-    assert( iX1 >= 0 && iX1 < iWidth );
-    assert( iY1 >= 0 && iY1 < iHeight );
-
-    if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )
-    {
-      piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);
-      pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;
-    }
-    if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )
-    {
-      piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);
-      pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;
-    }
-    if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )
-    {
-      piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;
-      pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;
-    }
-    if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )
-    {
-      piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;
-      pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;
-    }
-  }
-
-  ///////////
-  iPtr = 0;
-  for( Int i = 0; i < iWidth * iHeight; i++ )
-    pbVisit[ i ] = false;
-  piStack[ iPtr++ ] = (0 << 8) | (0); // initial seed
-  while( iPtr > 0 && iPtr < iWidth * iHeight )
-  {
-    Int iX;
-    Int iY;
-    iPtr--;
-    iX = piStack[ iPtr ] & 0xff;
-    iY = piStack[ iPtr ] >> 8;
-    pbVisit[ iY * iWidth + iX ] = true;
-
-    if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] )
-    {
-      piStack[ iPtr++ ] = ((iY - 1) << 8) | iX;
-    }
-    if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] )
-    {
-      piStack[ iPtr++ ] = ((iY + 1) << 8) | iX;
-    }
-    if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] )
-    {
-      piStack[ iPtr++ ] = (iY << 8) | (iX - 1);
-    }
-    if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] )
-    {
-      piStack[ iPtr++ ] = (iY << 8) | (iX + 1);
-    }
-  }
-  assert( iPtr == 0 || iPtr == iWidth * iHeight );
-
-  Bool bBipartition;
-  if( iPtr == iWidth * iHeight )
-  {
-    bBipartition = false; // single partition
-  }
-  else
-  {
-    for( Int i = 0; i < iWidth * iHeight; i++ )
-    {
-      if( !pbVisit[ i ] )
-      {
-        piStack[ iPtr++ ] = (( i / iWidth ) << 8) | ( i % iWidth );
-        pbVisit[ i ] = true;
-        break;
-      }
-    }
-    while( iPtr > 0 )
-    {
-      Int iX;
-      Int iY;
-      iPtr--;
-      iX = piStack[ iPtr ] & 0xff;
-      iY = piStack[ iPtr ] >> 8;
-      pbVisit[ iY * iWidth + iX ] = true;
-
-      if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] )
-      {
-        piStack[ iPtr++ ] = ((iY - 1) << 8) | iX;
-      }
-      if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] )
-      {
-        piStack[ iPtr++ ] = ((iY + 1) << 8) | iX;
-      }
-      if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] )
-      {
-        piStack[ iPtr++ ] = (iY << 8) | (iX - 1);
-      }
-      if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] )
-      {
-        piStack[ iPtr++ ] = (iY << 8) | (iX + 1);
-      }
-    }
-    bBipartition = true;
-    for( Int i = 0; i < iWidth * iHeight; i++ )
-    {
-      if( !pbVisit[ i ] )
-      {
-        bBipartition = false;
-        break;
-      }
-    }
-  }
-
-  xFree( pbEdge );
-  delete[] pbEdgeX; pbEdgeX = NULL;
-  delete[] pbEdgeY; pbEdgeY = NULL;
-  delete[] psDiffX; psDiffX = NULL;
-  delete[] psDiffY; psDiffY = NULL;
-  delete[] pusUnconnectedEdgeStack; pusUnconnectedEdgeStack = NULL;
-  delete[] pbVisit; pbVisit = NULL;
-  delete[] piStack; piStack = NULL;
-
-  if( bBipartition )
-  {
-    return xConstructChainCode( pcCU, uiAbsPtIdx, (UInt)iWidth, (UInt)iHeight );
-  }
-  else
-  {
-    return false;
-  }
-}
-
-Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight )
-{
-  if( (iY % 2) == 0 ) // vertical edge
-  {
-    Bool bTopConnected = false;
-    Bool bBottomConnected = false;
-
-    if( iY != 0 )
-    {
-      if( pbEdge[ iX + (iY - 2) * 2 * iWidth ] )
-        bTopConnected = true;
-      if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] )
-        bTopConnected = true;
-      if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] )
-        bTopConnected = true;
-    }
-    else
-    {
-      bTopConnected = true;
-    }
-
-
-    if( iY != 2 * iHeight - 2 )
-    {
-      if( pbEdge[ iX + (iY + 2) * 2 * iWidth ] )
-        bBottomConnected = true;
-      if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] )
-        bBottomConnected = true;
-      if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] )
-        bBottomConnected = true;
-    }
-    else
-    {
-      bBottomConnected = true;
-    }
-
-
-    if( bTopConnected && bBottomConnected )
-    {
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-  else
-  {
-    Bool bLeftConnected = false;
-    Bool bRightConnected = false;
-
-    if( iX != 0 )
-    {
-      if( pbEdge[ (iX - 2) + iY * 2 * iWidth ] )
-        bLeftConnected = true;
-      if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] )
-        bLeftConnected = true;
-      if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] )
-        bLeftConnected = true;
-    }
-    else
-    {
-      bLeftConnected = true;
-    }
-
-    if( iX != 2 * iWidth - 2 )
-    {
-      if( pbEdge[ (iX + 2) + iY * 2 * iWidth ] )
-        bRightConnected = true;
-      if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] )
-        bRightConnected = true;
-      if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] )
-        bRightConnected = true;
-    }
-    else
-    {
-      bRightConnected = true;
-    }
-
-
-    if( bLeftConnected && bRightConnected )
-    {
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-  }
-}
-Bool TEncSearch::xConstructChainCode( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight )
-{
-  //UInt   uiWidth    = pcCU->getWidth( uiPartIdx ) >> (bPU4x4 ? 1 : 0);
-  //UInt   uiHeight   = pcCU->getHeight( uiPartIdx ) >> (bPU4x4 ? 1 : 0);
-  Bool*  pbEdge     = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 );
-  Bool*  pbVisit    = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 );
-  UInt   uiMaxEdge  = uiWidth * (RBC_MAX_EDGE_NUM_PER_4x4 / 4);
-  Bool*  pbRegion   = pcCU->getEdgePartition( uiAbsPtIdx );
-  UChar* piEdgeCode = pcCU->getEdgeCode( uiAbsPtIdx );
-  Bool   bStartLeft = false;
-  Bool   bPossible  = false;
-  Bool   bFinish    = false;
-  Int    iStartPosition = -1;
-  Int    iPtr = 0;
-  Int    iDir = -1, iNextDir = -1;
-  Int    iArrow = -1, iNextArrow = -1;
-  Int    iX = -1, iY = -1;
-  Int    iDiffX = 0, iDiffY = 0;
-  UChar  iCode = 255;
-  UInt   uiWidth2 = uiWidth * 2;
-
-  for( Int i = 0; i < uiWidth * uiHeight * 4; i++ )
-    pbEdge[ i ] = false;
-
-  for( Int i = 0; i < uiHeight; i++ )
-  {
-    for( Int j = 0; j < uiWidth - 1; j++ )
-    {
-      if( pbRegion[ i * uiWidth + j ] != pbRegion[ i * uiWidth + j + 1 ] )
-        pbEdge[ i * uiWidth * 4 + j * 2 + 1 ] = true;
-    }
-  }
-
-  for( Int i = 0; i < uiHeight - 1; i++ )
-  {
-    for( Int j = 0; j < uiWidth; j++ )
-    {
-      if( pbRegion[ (i + 0) * uiWidth + j ] != pbRegion[ (i + 1) * uiWidth + j ] )
-        pbEdge[ (2 * i + 1) * 2 * uiWidth + j * 2 ] = true;
-    }
-  }
-
-  for( Int i = 1; i < uiWidth2 - 2; i+=2 )
-  {
-    if(pbEdge[ i ])
-    {
-      bPossible  = true;
-      bStartLeft = false;
-      iStartPosition = iX = i;
-      iY = 0;
-      iDir = 3;
-      iArrow = 3;
-      break;
-    }
-  }
-
-  if( !bPossible )
-  {
-    for( Int i = 1; i < uiWidth2 - 2; i+=2 )
-    {
-      if(pbEdge[ i * uiWidth2 ])
-      {
-        bPossible  = true;
-        bStartLeft = true;
-        iX = 0;
-        iStartPosition = iY = i;
-        iDir = 1;
-        iArrow = 1;
-        break;
-      }
-    }
-  }
-
-  if( bPossible )
-  {
-    for( Int i = 0; i < 4 * uiWidth * uiHeight; i++ )
-      pbVisit[ i ] = false;
-
-    while( !bFinish )
-    {
-      Bool bArrowSkip = false;
-      pbVisit[ iX + iY * uiWidth2 ] = true;
-
-      switch( iDir )
-      {
-      case 0: // left
-        if( iX > 0 && !pbVisit[ (iX - 2) + iY * uiWidth2 ] && pbEdge[ (iX - 2) + iY * uiWidth2 ] ) // left
-        {
-          iDiffX = -2;
-          iDiffY =  0;
-          iNextDir = 0;
-          iNextArrow = 0;
-        }
-        else if( iX > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // top
-        {
-          iDiffX = -1;
-          iDiffY = -1;
-          iNextDir = 2;
-          iNextArrow = 4;
-        }
-        else if( iX > 0 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // bottom
-        {
-          iDiffX = -1;
-          iDiffY = +1;
-          iNextDir = 3;
-          iNextArrow = iArrow;
-          if( !(iPtr == 0 && iX == uiWidth2 - 2 && iY == uiHeight * 2 - 3) )
-            bArrowSkip = true;
-          else
-            iNextArrow = 3;
-        }
-        else if( iX == 0 )
-        {
-          iDiffX = 0;
-          iDiffY = 0;
-          iNextDir = iDir;
-          iNextArrow = iArrow;
-          bFinish = true;
-          continue;
-        }
-        else
-        {
-          iPtr = 0; // edge loop or unwanted case
-          bFinish = true;
-          //continue;
-          assert(false);
-        }
-        break;
-      case 1: // right
-        if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 2) + iY * uiWidth2 ] && pbEdge[ (iX + 2) + iY * uiWidth2 ] ) // right
-        {
-          iDiffX = +2;
-          iDiffY =  0;
-          iNextDir = 1;
-          iNextArrow = 1;
-        }
-        else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // top
-        {
-          iDiffX = +1;
-          iDiffY = -1;
-          iNextDir = 2;
-          iNextArrow = iArrow;
-          if( !(iPtr == 0 && iX == 0 && iY == 1) )
-            bArrowSkip = true;
-          else
-            iNextArrow = 2;
-        }
-        else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // bottom
-        {
-          iDiffX = +1;
-          iDiffY = +1;
-          iNextDir = 3;
-          iNextArrow = 7;
-        }
-        else if( iX == uiWidth2 - 2 )
-        {
-          iDiffX = 0;
-          iDiffY = 0;
-          iNextDir = iDir;
-          iNextArrow = iArrow;
-          bFinish = true;
-          continue;
-        }
-        else
-        {
-          iPtr = 0; // edge loop or unwanted case
-          bFinish = true;
-          //continue;
-          assert(false);
-        }
-        break;
-      case 2: // top
-        if( iY > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // left
-        {
-          iDiffX = -1;
-          iDiffY = -1;
-          iNextDir = 0;
-          iNextArrow = iArrow;
-          if( !(iPtr == 0 && iX == 1 && iY == uiHeight * 2 - 2) )
-            bArrowSkip = true;
-          else
-            iNextArrow = 0;
-        }
-        else if( iY > 0 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // right
-        {
-          iDiffX = +1;
-          iDiffY = -1;
-          iNextDir = 1;
-          iNextArrow = 5;
-        }
-        else if( iY > 0 && !pbVisit[ iX + (iY - 2) * uiWidth2 ] && pbEdge[ iX + (iY - 2) * uiWidth2 ] ) // top
-        {
-          iDiffX =  0;
-          iDiffY = -2;
-          iNextDir = 2;
-          iNextArrow = 2;
-        }
-        else if( iY == 0 )
-        {
-          iDiffX = 0;
-          iDiffY = 0;
-          iNextDir = iDir;
-          iNextArrow = iArrow;
-          bFinish = true;
-          continue;
-        }
-        else
-        {
-          iPtr = 0; // edge loop or unwanted case
-          bFinish = true;
-          //continue;
-          assert(false);
-        }
-        break;
-      case 3: // bottom
-        if( iY < uiWidth2 - 2 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // left
-        {
-          iDiffX = -1;
-          iDiffY = +1;
-          iNextDir = 0;
-          iNextArrow = 6;
-        }
-        else if( iY < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // right
-        {
-          iDiffX = +1;
-          iDiffY = +1;
-          iNextDir = 1;
-          iNextArrow = iArrow;
-          if( !(iPtr == 0 && iX == uiWidth * 2 - 3 && iY == 0) )
-            bArrowSkip = true;
-          else
-            iNextArrow = 1;
-        }
-        else if( iY < uiWidth2 - 2 && !pbVisit[ iX + (iY + 2) * uiWidth2 ] && pbEdge[ iX + (iY + 2) * uiWidth2 ] ) // bottom
-        {
-          iDiffX =  0;
-          iDiffY = +2;
-          iNextDir = 3;
-          iNextArrow = 3;
-        }
-        else if( iY == uiWidth2 - 2 )
-        {
-          iDiffX = 0;
-          iDiffY = 0;
-          iNextDir = iDir;
-          iNextArrow = iArrow;
-          bFinish = true;
-          continue;
-        }
-        else
-        {
-          iPtr = 0; // edge loop or unwanted case
-          bFinish = true;
-          //continue;
-          assert(false);
-        }
-        break;
-      }
-
-      const UChar tableCode[8][8] = { { 0, -1, 4, 3, 2, 6, 1, 5 }, // iArrow(current direction), iNextArrow(next direction)
-      { -1, 0, 3, 4, 5, 1, 6, 2 },
-      { 3, 4, 0, -1, 1, 2, 5, 6 },
-      { 4, 3, -1, 0, 6, 5, 2, 1 },
-      { 1, 6, 2, 5, 0, 4, 3, -1 },
-      { 5, 2, 1, 6, 3, 0, -1, 4 },
-      { 2, 5, 6, 1, 4, -1, 0, 3 },
-      { 6, 1, 5, 2, -1, 3, 4, 0 } };
-
-      iCode = tableCode[iArrow][iNextArrow];
-
-      if(iPtr >= uiMaxEdge)
-      {
-        iPtr = 0; // over the maximum number of edge
-        bPossible = false;
-        break;
-      }
-
-      if( !bArrowSkip )
-      {
-        piEdgeCode[iPtr++] = iCode; // first edge coding
-        //printf("xEdgeCoding: (%d,%d)->(%d,%d) code %d\n",iX,iY, iX+iDiffX, iY+iDiffY, iCode);
-      }
-
-      iX += iDiffX;
-      iY += iDiffY;
-      iDir = iNextDir;
-      iArrow = iNextArrow;
-    }
-  }
-
-  pcCU->setEdgeLeftFirst( uiAbsPtIdx, bStartLeft );
-  pcCU->setEdgeStartPos ( uiAbsPtIdx, bStartLeft ? (iStartPosition - 1) >> 1 : (iStartPosition + 1) >> 1);
-  pcCU->setEdgeNumber   ( uiAbsPtIdx, iPtr );
-
-  xFree( pbEdge );
-  xFree( pbVisit );
-
-  return (iPtr != 0);
-}
-#endif
+
+#endif
+
 #endif
 //! \}
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 763)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.h	(revision 764)
@@ -351,14 +351,4 @@
   Void xSearchDmmDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
   Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
-#if !SEC_DMM3_RBC_F0147
-  Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );
-#endif
-#endif
-#if H_3D_DIM_RBC
-  Void xSearchRbcDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
-  Bool xSearchRbcEdge             ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride,  Int  iWidth,  Int  iHeight );
-  
-  Bool xCheckTerminatedEdge       ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight );
-  Bool xConstructChainCode        ( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight );
 #endif
 #if H_3D_DIM_SDC
