Index: trunk/source/Lib/TLibEncoder/NALwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 884)
@@ -91,5 +91,5 @@
   vector<uint8_t>& rbsp   = nalu.m_Bitstream.getFIFO();
 
-#if H_MV_HLS_7_MISC_P0130_EOS  // This will handle situation when writing NAL with zero payload
+#if H_MV  // This will handle situation when writing NAL with zero payload
   if (rbsp.size() == 0) return;
 #endif
Index: trunk/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 884)
@@ -93,5 +93,5 @@
     fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
     break;
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
     case SEI::SUB_BITSTREAM_PROPERTY:
     fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
@@ -151,5 +151,5 @@
     xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps);
     break;
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
    case SEI::SUB_BITSTREAM_PROPERTY:
    xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
@@ -589,5 +589,5 @@
 }
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
 {
Index: trunk/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 884)
@@ -66,5 +66,5 @@
   Void xWriteSEISOPDescription(const SEISOPDescription& sei);
   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 884)
@@ -272,5 +272,4 @@
   WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
 #if !H_MV
   WRITE_FLAG( 0, "pps_extension_flag" );
@@ -290,7 +289,5 @@
   if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
   {
-#if H_MV_HLS_7_POC_P0041
     WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
-#endif
   }
 
@@ -303,13 +300,5 @@
 
 #endif
-#else
-#if !H_3D
-  WRITE_FLAG( 0, "pps_extension_flag" );
-#else
-  WRITE_FLAG( 1, "pps_extension_flag" );
-  codePPSExtension( pcPPS ); 
-  WRITE_FLAG( 0, "pps_extension2_flag" );
-#endif
-#endif
+
 }
 
@@ -725,5 +714,5 @@
 #endif
   WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   if ( pcSPS->getLayerId() == 0 ) 
   {  
@@ -741,5 +730,5 @@
     }
   }
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   }
 #endif
@@ -871,7 +860,5 @@
     WRITE_SVLC( pcSPS->getScaledRefLayerRightOffset( j ), "scaled_ref_layer_right_offset" );
     WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" );
-#if H_MV_HLS_7_RESERVED_FLAGS
     WRITE_FLAG( 0, "sps_multilayer_ext_reserved_zero_flag[ j ]" );
-#endif
   }
 }
@@ -904,13 +891,5 @@
   WRITE_FLAG( pcVPS->getTemporalNestingFlag(),                "vps_temporal_id_nesting_flag" );
   assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
-#if H_MV_HLS_7_VPS_P0125_24
   WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
-#else
-#if H_MV && !H_MV_HLS7_GEN
-  WRITE_CODE( 0xffff,                              16,        "vps_extension_offset" );
-#else
-  WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
-#endif
-#endif
   codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 );
   const Bool subLayerOrderingInfoPresentFlag = 1;
@@ -1010,14 +989,6 @@
 {
   WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
-#if !H_MV_HLS_7_VPS_P0307_23
-  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
-  if ( pcVPS->getVpsVuiPresentFlag() )
-  {  
-  WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16,                 "vps_vui_offset" );  // TBD
-  }
-#endif
-
   WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
-  
+
   for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
   {
@@ -1042,9 +1013,9 @@
     {      
       WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6,          "layer_id_in_nuh[i]");
-  }
+    }
     else
     {
       assert( pcVPS->getLayerIdInNuh( i ) == i ); 
-  }
+    }
 
     assert(  pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i ); 
@@ -1064,20 +1035,20 @@
 
 
-    WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
-    
-    if ( pcVPS->getViewIdLen( ) > 0 )
-    {    
-      for( Int i = 0; i < pcVPS->getNumViews(); i++ )
-      {
-        WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" );
-      }
-    }
-    else
-    {
-      for( Int i = 0; i < pcVPS->getNumViews(); i++ )
-      {
-        assert( pcVPS->getViewIdVal( i ) == 0 ); 
-      }
-    }
+  WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
+
+  if ( pcVPS->getViewIdLen( ) > 0 )
+  {    
+    for( Int i = 0; i < pcVPS->getNumViews(); i++ )
+    {
+      WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" );
+    }
+  }
+  else
+  {
+    for( Int i = 0; i < pcVPS->getNumViews(); i++ )
+    {
+      assert( pcVPS->getViewIdVal( i ) == 0 ); 
+    }
+  }
 
 
@@ -1122,33 +1093,12 @@
 
   WRITE_FLAG( pcVPS->getAllRefLayersActiveFlag( ) ? 1 : 0 , "all_ref_layers_active_flag" );
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( )    , 10,    "vps_number_layer_sets_minus1"      );
-#endif
-
-#if !H_MV_HLS_7_VPS_P0306_22
-  WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6,     "vps_num_profile_tier_level_minus1" );
-#else
   WRITE_UVLC( pcVPS->getVpsNumProfileTierLevelMinus1( ), "vps_num_profile_tier_level_minus1" );
-#endif
 
   for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
   {
     WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
-#if !H_MV_HLS_7_VPS_P0048_14
-    if( !pcVPS->getVpsProfilePresentFlag( i ) )
-    {    
-      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
-      pcVPS->checkProfileRefMinus1( i );      
-    }
-#endif
     codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
   }
 
-
-
-
-
-
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   WRITE_UVLC( pcVPS->getNumAddOutputLayerSets( ), "num_add_output_layer_sets" );
 
@@ -1157,38 +1107,14 @@
     WRITE_CODE( pcVPS->getDefaultTargetOutputLayerIdc( ), 2, "default_target_output_layer_idc" );
   }  
-#else
-  Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 
-
-  WRITE_FLAG( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );
-
-  if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
-  {
-    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
-    numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 ); 
-  }
-
-  if( numOutputLayerSets > 1)
-  {
-    WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" );
-    pcVPS->checkDefaultOneTargetOutputLayerIdc(); 
-  }  
-#endif
+
 
   assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 
   assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
     if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )    
-#else
-  for( Int i = 1; i < numOutputLayerSets; i++ )
-  {
-    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
-#endif
     {      
       WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ),      "output_layer_set_idx_minus1[i]" );
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     }
 
@@ -1208,24 +1134,8 @@
     }        
 
-#else
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1 ; j++ )
-      {
-        WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
-      }      
-    }
-    else
-    { // These inference rules would also be helpful in spec text
-      assert( pcVPS->getOutputLayerSetIdxMinus1(i ) ==  i - 1 ); 
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
-      {              
-        assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 
-      }
-    }
-#endif
     if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     {      
       WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
     }
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
     {
@@ -1233,25 +1143,9 @@
     }
   }
-#else
-  }
-
-  if( pcVPS->getMaxLayersMinus1() > 0 )
-  {
-    WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" );
-  }
-#endif
-
-
-
-
 
   WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
   if ( pcVPS->getRepFormatIdxPresentFlag() )
   {
-#if H_MV_HLS_7_VPS_P0306_22
     WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
-#else
-    WRITE_CODE( pcVPS->getVpsNumRepFormatsMinus1( ), 4, "vps_num_rep_formats_minus1" );
-#endif
   }
 
@@ -1269,9 +1163,5 @@
       if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
       {
-#if H_MV_HLS_7_VPS_P0306_22
         WRITE_CODE( pcVPS->getVpsRepFormatIdx(i), pcVPS->getVpsRepFormatIdxLen(), "vps_rep_format_idx[i]" );
-#else
-        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" );
-#endif
       }
     }
@@ -1289,7 +1179,5 @@
     }
   }
-#if H_MV_HLS_7_RESERVED_FLAGS
   WRITE_FLAG( 0, "vps_reserved_zero_flag" );
-#endif
   codeDpbSize( pcVPS ); 
 
@@ -1321,24 +1209,18 @@
     }
   }  
-#if H_MV_HLS_7_VPS_P0307_23
   WRITE_UVLC( 0, "vps_non_vui_extension_length" );
   WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
-#endif
-#if !H_MV_HLS_7_RESERVED_FLAGS  
-    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" ); 
-#endif
-    if( pcVPS->getVpsVuiPresentFlag() )
-    {
-      m_pcBitIf->writeAlignOne();  // vps_vui_alignment_bit_equal_to_one
-      codeVPSVUI( pcVPS ); 
-    }     
-#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
-    {
-      TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
-      assert( pcVPSVUI ); 
-      pcVPSVUI->inferVpsVui( true ); 
-    }
-#endif
-}
+  if( pcVPS->getVpsVuiPresentFlag() )
+  {
+    m_pcBitIf->writeAlignOne();  // vps_vui_alignment_bit_equal_to_one
+    codeVPSVUI( pcVPS ); 
+  }     
+  {
+    TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
+    assert( pcVPSVUI ); 
+    pcVPSVUI->inferVpsVui( true ); 
+  }
+}
+
 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
 {
@@ -1359,9 +1241,5 @@
   {  
     WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
-#if H_MV_HLS_7_HRD_P0156_7
     for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
-#else
-    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
-#endif
     {  
       if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  )  
@@ -1371,9 +1249,5 @@
       if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
       {  
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
         for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
-#else
-        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   // Preliminary fix does not match with spec
-#endif
         {
           WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
@@ -1395,9 +1269,5 @@
         if ( j > 0 )
         {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
           for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )   
-#else
-          for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
-#endif
           {
             assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
@@ -1451,19 +1321,13 @@
     WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
   }
-#if H_MV_HLS_7_MISC_P0068_21
   if( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) )
   {
     WRITE_FLAG( pcVPSVUI->getAllLayersIdrAlignedFlag( ) ? 1 : 0 , "all_layers_idr_aligned_flag" );
   }
-#endif
   WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
   WRITE_FLAG( pcVPSVUI->getPicRatePresentVpsFlag( ) ? 1 : 0 , "pic_rate_present_vps_flag" );
   if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
   {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#else
-    for( Int i = 0; i  <=  pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
-#endif
     {
       for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ ) 
@@ -1491,5 +1355,4 @@
   }
 
-#if H_MV_HLS_7_VPS_P0076_15
   WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
@@ -1525,5 +1388,4 @@
     }
   }
-#endif
   WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
   if( !pcVPSVUI->getTilesNotInUseFlag() ) 
@@ -1560,7 +1422,5 @@
     }
   }
-#if H_MV_HLS_7_RESERVED_FLAGS
   WRITE_CODE( 0, 3, "vps_vui_reserved_zero_3bits" );
-#endif
   WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
 
@@ -1584,38 +1444,5 @@
   }
 
-#if !H_MV_HLS_7_VPS_P0076_15
-  WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
-  {
-    WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" );
-  }
-  else
-  {
-    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 
-  }
-
-  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
-  {
-    assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL ); 
-    TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i ); 
-    codeVideoSignalInfo( curVideoSignalInfo );     
-  }
-
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
-    }
-}
-  else
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i  ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 
-    }
-  }
-#endif
+
   WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" );
   if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
@@ -1623,5 +1450,4 @@
     codeVpsVuiBspHrdParameters( pcVPS ); 
   }
-#if H_MV_HLS_7_MISC_P0182_13
   for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
   {
@@ -1630,6 +1456,5 @@
       WRITE_FLAG( pcVPSVUI->getBaseLayerParameterSetCompatibilityFlag( i ) ? 1 : 0 , "base_layer_parameter_set_compatibility_flag" );
     }
-}
-#endif
+  }
 }
 
@@ -1705,9 +1530,5 @@
         WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
 #if H_3D_SPIVMP
-#if SEC_SPIVMP_MCP_SIZE_G0077
         WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
-#else
-        WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]");
-#endif
 #endif
 #endif
@@ -1734,9 +1555,5 @@
         if (i!=1)
         {
-#if SEC_SPIVMP_MCP_SIZE_G0077
           WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
-#else
-          WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]");
-#endif
         }
 #endif
@@ -1771,7 +1588,5 @@
     }
   }
-#if QC_SPIVMP_MPI_G0119
   WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3");
-#endif
 #if H_3D_TMVP
   WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
@@ -2235,16 +2050,5 @@
 #endif
 
-#if !H_MV_HLS_7_POC_P0041
-#if PPS_FIX_DEPTH
-  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag() || pcSlice->getIsDepth() )
-#else
-  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
-#endif
-  {
-    WRITE_UVLC(0,"slice_header_extension_length");
-  }
-#endif
-
-#if H_MV_HLS_7_POC_P0041
+
 #if !H_MV
   if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
@@ -2354,5 +2158,4 @@
   }
 #endif 
-#endif
 }
 
@@ -2824,5 +2627,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
@@ -2834,15 +2636,5 @@
   assert(0);
 }
-#else
-Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
-{
-  assert(0);
-}
-
-Void TEncCavlc::codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
-{
-  assert(0);
-}
-#endif
+
 #endif
     
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 884)
@@ -133,11 +133,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#else
-  Void codeInterSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
-#endif
 #endif
 #if H_3D_DBBP
Index: trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 884)
@@ -347,5 +347,5 @@
 
   Bool      m_useStrongIntraSmoothing;                        ///< enable the use of strong intra smoothing (bi_linear interpolation) for 32x32 blocks when reference samples are flat.
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_numAdditionalSubStreams;
@@ -397,6 +397,4 @@
 #if H_3D_SPIVMP
   Int      m_iSubPULog2Size;
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int      m_iSubPUMPILog2Size;
 #endif
@@ -507,6 +505,4 @@
   Int        getSubPULog2Size                   ()                   { return m_iSubPULog2Size;}
   Void       setSubPULog2Size                   (Int u)              { m_iSubPULog2Size = u; }     
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int        getSubPUMPILog2Size            ()               { return m_iSubPUMPILog2Size;}
   Void       setSubPUMPILog2Size            (Int u)          { m_iSubPUMPILog2Size = u;   }     
@@ -789,5 +785,5 @@
   Int   getScalableNestingSEIEnabled()                     { return m_scalableNestingSEIEnabled; }
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Bool   getSubBitstreamPropSEIEnabled()        { return m_subBistreamPropSEIEnabled;}
   Void   setSubBitstreamPropSEIEnabled(Bool x)  { m_subBistreamPropSEIEnabled = x;}
Index: trunk/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 884)
@@ -547,5 +547,4 @@
           bTryNx2N  = false;
           bTry2NxN  = false;
-#if MTK_TEX_DEP_PAR_G0055
           if( pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize(uiCUIdx) != SIZE_2Nx2N)
           {
@@ -555,5 +554,4 @@
               bTryNx2N  = true;
           }
-#endif
         }
       }
@@ -582,9 +580,5 @@
           if (rpcTempCU->getSlice()->getIsDepth() )
           {
-#if SEC_DEPTH_DV_DERIVAITON_G0074
             DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo);
-#else
-            DvInfo.bDV = rpcTempCU->getDispNeighBlocks(0, 0, &DvInfo);
-#endif
           }
           else
@@ -1533,17 +1527,10 @@
 #endif
     m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
 #endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
-#endif
-#endif
     finishCU(pcCU,uiAbsPartIdx,uiDepth);
     return;
@@ -1553,5 +1540,5 @@
   m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
 #endif
@@ -1570,21 +1557,11 @@
   // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
   m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
-#if !SEC_IC_ARP_SIG_G0072
+
+#if H_3D_ARP
+  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
+#endif
 #if H_3D_IC
   m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
 #endif
-#endif
-#if H_3D_ARP
-  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-  m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false );
-#endif
-
   // Encode Coefficients
   Bool bCodeDQP = getdQPFlag();
@@ -1809,9 +1786,5 @@
 #if H_3D_ARP
   Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
-#if SEC_IC_ARP_SIG_G0072
   if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag )
-#else
-  if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV )
-#endif
   {
     nARPWMax = 0;
@@ -1821,7 +1794,4 @@
     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
     rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
-#if !UPDATE_HM13
-    rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth );
-#endif
     rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
 #if H_3D_IC
@@ -1856,5 +1826,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     Int iDDDCand = rpcTempCU->getUseDDDCandIdx(); 
     UChar ucDDDepth = rpcTempCU->getDDTmpDepth();
@@ -1895,5 +1865,5 @@
           rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
           if( rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewIndex() != 0 && iDDDCand == uiMergeCand )
           {
@@ -1925,6 +1895,6 @@
           else
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
-            {
+#if H_3D_VSP
+          {
           if ( vspFlag[uiMergeCand] )
           {
@@ -1959,5 +1929,5 @@
             rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
             rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
           }
         }
@@ -1992,5 +1962,5 @@
 
           rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
-#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+#if H_3D_VSP // possible bug fix
           if( rpcTempCU->getSkipFlag(0) )
           {
@@ -2007,5 +1977,4 @@
           if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual )
           {
-#if SEC_INTER_SDC_G0101
             for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
             {
@@ -2039,33 +2008,4 @@
               xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
             }
-#else
-            if( rpcTempCU != rpcTempCUPre )
-            {
-              rpcTempCU->initEstData( uhDepth, orgQP, bTransquantBypassFlag  );
-              rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
-            }
-            rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-            rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
-            rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
-#if H_3D_VSO //M2
-            if( m_pcRdCost->getUseRenModel() )
-            { //Reset
-              UInt  uiWidth     = m_ppcOrigYuv[uhDepth]->getWidth    ();
-              UInt  uiHeight    = m_ppcOrigYuv[uhDepth]->getHeight   ();
-              Pel*  piSrc       = m_ppcOrigYuv[uhDepth]->getLumaAddr ();
-              UInt  uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride   ();
-              m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
-            }
-#endif
-            m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 
-              m_ppcOrigYuv[uhDepth], 
-              ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 
-              m_ppcResiYuvTemp[uhDepth], 
-              m_ppcRecoYuvTemp[uhDepth], 
-              uhDepth );
-
-            xCheckDQP( rpcTempCU );
-            xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
-#endif
           }
 #endif
@@ -2142,8 +2082,6 @@
 {
 
-#if UPDATE_HM13
 #if H_3D
   const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
-#endif
 #endif
 #if  H_3D_FAST_TEXTURE_ENCODING
@@ -2157,9 +2095,5 @@
   Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
 
-#if SEC_IC_ARP_SIG_G0072
   if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) )
-#else
-  if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV  )
-#endif
   {
     nARPWMax = 0;
@@ -2170,9 +2104,5 @@
     if( bFirstTime == false && rpcTempCU->getSlice()->getVPS()->getUseAdvRP( iLayerId ) )
     {
-#if UPDATE_HM13
       rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0),bTransquantBypassFlag );      
-#else
-      rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) );
-#endif
     }
 #endif
@@ -2194,5 +2124,5 @@
   rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
   rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
-#if MTK_DDD_G0063
+#if H_3D_DDD
   rpcTempCU->setUseDDD( false, 0, uhDepth );
 #endif
@@ -2256,5 +2186,5 @@
 #endif
   m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
-#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+#if H_3D_VSP // possible bug fix
   if( rpcTempCU->getQtRootCbf(0)==0 )
   {
@@ -2276,11 +2206,6 @@
   xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
 #if H_3D_INTER_SDC
-#if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC
   if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N)
-#else
-  if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() )
-#endif
-  {
-#if SEC_INTER_SDC_G0101
+  {
     for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
     {
@@ -2288,9 +2213,5 @@
       {
         Int orgQP = rpcBestCU->getQP( 0 );
-#if UPDATE_HM13
         rpcTempCU->initEstData( uhDepth, orgQP ,bTransquantBypassFlag );      
-#else
-        rpcTempCU->initEstData( uhDepth, orgQP );
-#endif
         rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
       }
@@ -2320,35 +2241,5 @@
       xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
     }
-#else
-    if( rpcTempCU != rpcTempCUPre )
-    {
-      Int orgQP = rpcBestCU->getQP( 0 );
-      rpcTempCU->initEstData( uhDepth, orgQP );
-      rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
-    }
-    rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-    rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
-    rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
-#if H_3D_VSO // M3
-    if( m_pcRdCost->getUseRenModel() )
-    {
-      UInt  uiWidth     = m_ppcOrigYuv[uhDepth]->getWidth ( );
-      UInt  uiHeight    = m_ppcOrigYuv[uhDepth]->getHeight( );
-      Pel*  piSrc       = m_ppcOrigYuv[uhDepth]->getLumaAddr( );
-      UInt  uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();
-      m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
-    }
-#endif
-
-    m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 
-      m_ppcOrigYuv[uhDepth],
-      ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
-      m_ppcResiYuvTemp[uhDepth],
-      m_ppcRecoYuvTemp[uhDepth],
-      uhDepth );
-
-  xCheckDQP( rpcTempCU );
-  xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
-#endif
+
   }
 #endif
@@ -2593,5 +2484,5 @@
   m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
@@ -2650,5 +2541,5 @@
   m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 884)
@@ -151,9 +151,5 @@
 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
-#if SEC_IC_ARP_SIG_G0072
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
-#else
-  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
-#endif
   {
     return;
@@ -670,5 +666,4 @@
   UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
   UInt uiChromaOffset = uiLumaOffset>>2;
-#if QC_SDC_UNIFY_G0130
 #if H_3D_DIM_SDC
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) )
@@ -680,7 +675,5 @@
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
   }
-#endif
-
-#if H_3D_INTER_SDC
+
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
   {
@@ -689,10 +682,6 @@
     assert( pcCU->getSlice()->getIsDepth() );
   }
-#endif
-#if QC_SDC_UNIFY_G0130_FIX
+
   if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) )
-#else
-  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
-#endif
   {
     Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
@@ -715,28 +704,4 @@
     }
   }
-#else
-#if H_3D_DIM_SDC
-  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
-  {
-    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
-    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-    return;
-  }
-#endif
-
-#if H_3D_INTER_SDC
-  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
-  {
-    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
-    assert( !pcCU->isIntra( uiAbsPartIdx) );
-    assert( pcCU->getSlice()->getIsDepth() );
-
-    encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false );
-    return;
-  }
-#endif
 #endif
 
@@ -799,5 +764,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TEncEntropy::encodeDeltaDC  ( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -813,18 +777,10 @@
   }
 
-#if SEC_INTER_SDC_G0101
   if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )
-#else
-  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
-#endif
-  {
-    return;
-  }
-
-#if SEC_INTER_SDC_G0101
+  {
+    return;
+  }
+
   assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-#else
-  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-#endif
 
   if( bRD )
@@ -835,52 +791,5 @@
   m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx );
 }
-#else
-Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
-{
-  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
-  {
-    return;
-  }
-
-  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
-  {
-    return;
-  }
-
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
-
-  m_pcEntropyCoderIf->codeInterSDCFlag( pcCU, uiAbsPartIdx );
-}
-
-Void TEncEntropy::encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
-{
-  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
-  {
-    return;
-  }
-
-  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
-  {
-    return;
-  }
-
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
-
-  // number of segments depends on prediction mode for INTRA
-  UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );
-
-  // encode residual data for each segment
-  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
-  {
-    m_pcEntropyCoderIf->codeInterSDCResidualData( pcCU, uiAbsPartIdx, uiSeg );
-  }
-}
-#endif
+
 #endif
 #if H_3D_DBBP
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 884)
@@ -95,11 +95,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   virtual Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-#else
-  virtual Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-  virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;
-#endif
 #endif
 #if H_3D_DBBP
@@ -190,11 +185,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void encodeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
   Void encodeSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-#else
-  Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-  Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD );
-#endif
 #endif
 #if H_3D_DBBP
Index: trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 884)
@@ -296,5 +296,5 @@
 }
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
 SEISubBitstreamProperty *TEncGOP::xCreateSEISubBitstreamProperty( TComSPS *sps)
 {
@@ -365,5 +365,5 @@
     delete sei;
   }
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   if( m_pcCfg->getSubBitstreamPropSEIEnabled() )
   {
Index: trunk/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 884)
@@ -212,5 +212,5 @@
 
   SEIToneMappingInfo*     xCreateSEIToneMappingInfo();
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   SEISubBitstreamProperty *xCreateSEISubBitstreamProperty( TComSPS *sps);
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 884)
@@ -92,10 +92,5 @@
 , m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
-#if QC_GENERIC_SDC_G0122
 , m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
-#if !QC_SDC_UNIFY_G0130
-, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#endif
 #if H_3D_DIM_DMM
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
@@ -106,10 +101,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
 , m_cSDCFlagSCModel                  ( 1,             1,  NUM_SDC_FLAG_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -178,10 +168,5 @@
   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if !QC_SDC_UNIFY_G0130
-  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
-#endif
-#endif
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
@@ -192,10 +177,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
-  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -240,10 +220,5 @@
       curCost += m_cCUICFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-      curCost += m_cInterSDCFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
-      curCost += m_cInterSDCResidualSCModel.calcCost  ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-      curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
       curCost += m_cSDCFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -279,10 +254,5 @@
       curCost += m_cDdcFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );
       curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
       curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG );  
-#if !QC_SDC_UNIFY_G0130
-      curCost += m_cIntraSdcFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG );  
-#endif
-#endif
 #if H_3D_DIM_DMM
       curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
@@ -348,10 +318,5 @@
   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if !QC_SDC_UNIFY_G0130
-  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
-#endif
-#endif
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
@@ -362,10 +327,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
-  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -672,10 +632,5 @@
   this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel );
   this->m_cDdcFlagSCModel        .copyFrom( &pSrc->m_cDdcFlagSCModel );
-#if QC_GENERIC_SDC_G0122
   this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
-#if !QC_SDC_UNIFY_G0130
-  this->m_cIntraSdcFlagSCModel   .copyFrom( &pSrc->m_cIntraSdcFlagSCModel );
-#endif
-#endif
 }
 #endif
@@ -728,8 +683,6 @@
   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
-#if MTK_TEX_DEP_PAR_G0055
   Bool depthDependent = false;
   UInt uiTexturePart = eSize;
-#endif
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
   {
@@ -737,7 +690,4 @@
     UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
     assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
-#if !MTK_TEX_DEP_PAR_G0055
-    if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) != SIZE_NxN)
-#else
     if(pcTextureCU->getDepth(uiCUIdx) == uiDepth )
     {
@@ -746,5 +696,4 @@
     }
     if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) == SIZE_2Nx2N)
-#endif
     {
       assert( eSize == SIZE_2Nx2N );
@@ -768,5 +717,5 @@
   DTRACE_CU("part_mode", eSize )
 #endif        
-#if MTK_TEX_DEP_PAR_G0055
+#if H_3D_QTLPC
     if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)
     {
@@ -838,5 +787,5 @@
     }
   }
-#if MTK_TEX_DEP_PAR_G0055
+#if H_3D_QTLPC
     }
     else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD)
@@ -1050,9 +999,5 @@
   if( nBinNum > 1 )
   {
-#if MTK_ARP_FLAG_CABAC_SIMP_G0061
      m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 2 ) );
-#else
-     m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 3 ) );
-#endif
   }
 #if H_MV_ENC_DEC_TRAC
@@ -1072,15 +1017,8 @@
   // get context function is here
   UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0;
-#if MTK_IC_FLAG_CABAC_SIMP_G0061
   m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );
-#else
-  UInt uiCtxIC  = pcCU->getCtxICFlag( uiAbsPartIdx ) ;
-  m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
-#endif
 #if !H_MV_ENC_DEC_TRAC
   DTRACE_CABAC_VL( g_nSymbolCounter++ );
   DTRACE_CABAC_T( "\tICFlag" );
-  DTRACE_CABAC_T( "\tuiCtxIC: ");
-  DTRACE_CABAC_V( uiCtxIC );
   DTRACE_CABAC_T( "\tuiSymbol: ");
   DTRACE_CABAC_V( uiSymbol );
@@ -1167,24 +1105,17 @@
     }
     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
-#if H_3D_DIM_SDC
-#if QC_GENERIC_SDC_G0122
-      if( 1 )
-#else
-      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
-#endif
-#endif
-    {
-#endif
-    predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]);  
-    for(UInt i = 0; i < predNum[j]; i++)
-    {
-      if(dir[j] == preds[j][i])
-      {
-        predIdx[j] = i;
-      }
-    }
-    m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
+    {
+#endif
+      predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]);  
+      for(UInt i = 0; i < predNum[j]; i++)
+      {
+        if(dir[j] == preds[j][i])
+        {
+          predIdx[j] = i;
+        }
+      }
+      m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
 #if H_MV_ENC_DEC_TRAC
-    DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 
+      DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 
 #endif
 #if H_3D_DIM
@@ -1197,11 +1128,4 @@
 #if H_3D_DIM
     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
-#if H_3D_DIM_SDC
-#if QC_GENERIC_SDC_G0122
-      if( 1 )
-#else
-      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
-#endif
-#endif
     {
 #endif
@@ -1301,45 +1225,6 @@
   default: break;
   }
-#if !QC_SDC_UNIFY_G0130
-  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
-  {
-    UInt dimDeltaDC;
-    Pel  deltaDC;
-#if QC_GENERIC_SDC_G0122
-    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
-#else
-    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
-#endif
-    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;
-      }
-    }
-    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 );
-      }
-    }
-  }
-#endif
-}
-
-#if QC_GENERIC_SDC_G0122
+}
+
 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -1350,10 +1235,4 @@
     m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
   }
-#if !QC_SDC_UNIFY_G0130
-  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
-  {
-    m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
-}
-#endif
   if( isDimMode( dir ) )
   {
@@ -1370,46 +1249,4 @@
   }
 }
-#else
-Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
-{
-  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}};
-  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
-  UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
-  UInt codeIdx = 0;
-
-  if( dir < NUM_INTRA_MODE )
-  { 
-    codeIdx = 1; 
-  }
-  if( isDimMode( dir ) )
-  {
-    switch( getDimType( dir ) )
-    {
-    case DMM1_IDX: codeIdx = 3; break;
-    case DMM4_IDX: codeIdx = 4; break;
-    default:                    break;
-    }
-  }
-
-#if H_3D_DIM_SDC
-  if( pcCU->getSDCFlag( absPartIdx ) )
-  {
-    switch( dir )
-    {
-      case PLANAR_IDX:  codeIdx = 0; break;
-      default:          codeIdx = 2; break;
-    }
-  }
-#endif
-  //mode coding
-  for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ )
-  {
-    UInt bit = codeWordTable[puIdx][codeIdx] & ( 1<<(codeWordLenTable[puIdx][codeIdx] - i - 1) );
-    UInt ctxDepthMode = puIdx*3 + ( (i >= 2) ? 2 : i );
-    m_pcBinIf->encodeBin( bit!=0 , m_cDepthIntraModeSCModel.get(0, 0, ctxDepthMode) );
-  }
-}
-#endif
 #endif
 
@@ -2446,5 +2283,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -2482,10 +2318,5 @@
   else //all-zero inter SDC is not allowed
   {
-#if SEC_INTER_SDC_G0101
     uiNumSegments = 1;
-#else
-    PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );
-    uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );
-#endif
     dimDeltaDC = 1;
   }
@@ -2519,26 +2350,5 @@
   m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
 }
-#else
-Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
-{
-  UInt uiSymbol = pcCU->getInterSDCFlag( uiAbsPartIdx ) ? 1 : 0;
-  UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx );
-
-  m_pcBinIf->encodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) );
-}
-
-Void TEncSbac::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
-{
-  Pel segmentDCOffset = pcCU->getInterSDCSegmentDCOffset( uiSegment, uiAbsPartIdx );
-
-  UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
-  UInt uiAbsIdx   = abs( segmentDCOffset );
-
-  assert( uiAbsIdx > 0 );
-  uiAbsIdx--;
-  xWriteExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) );
-  m_pcBinIf->encodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) );
-}
-#endif
+
 #endif
 
Index: trunk/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 884)
@@ -162,11 +162,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void codeDeltaDC       ( TComDataCU* pcCU, UInt absPartIdx );
   Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#else
-  Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
-#endif
 #endif
 #if H_3D_DBBP
@@ -262,10 +257,5 @@
   ContextModel3DBuffer m_cDdcFlagSCModel;
   ContextModel3DBuffer m_cDdcDataSCModel;
-#if QC_GENERIC_SDC_G0122
   ContextModel3DBuffer m_cAngleFlagSCModel;
-#if !QC_SDC_UNIFY_G0130
-  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
-#endif
-#endif
 #if H_3D_DIM_DMM
   ContextModel3DBuffer m_cDmm1DataSCModel;
@@ -276,10 +266,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  ContextModel3DBuffer m_cInterSDCFlagSCModel;
-  ContextModel3DBuffer m_cInterSDCResidualSCModel;
-  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   ContextModel3DBuffer m_cSDCFlagSCModel;
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 884)
@@ -920,5 +920,5 @@
       m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
 
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
       m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
@@ -939,5 +939,5 @@
       {
         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
-#if QC_SDC_UNIFY_G0130_FIX
+#if H_3D_DIM_SDC
         if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 
         {
@@ -956,5 +956,5 @@
         {
           m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts );
-#if QC_SDC_UNIFY_G0130_FIX
+#if H_3D_DIM_SDC
           if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 
           {
@@ -967,5 +967,5 @@
       {
         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
-#if QC_SDC_UNIFY_G0130_FIX
+#if H_3D_DIM_SDC
         if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 
         {
@@ -975,19 +975,5 @@
     }
   }
-#if QC_SDC_UNIFY_G0130 && !QC_SDC_UNIFY_G0130_FIX
-    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
-    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
-
-    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
-    {
-      for( Int iPart = 0; iPart < iPartNum; iPart++ )
-      {
-        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 
-        {
-          m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart );
-        }
-      }
-    }
-#endif
+
   }
   if( bChroma )
@@ -1875,29 +1861,11 @@
 
 #if H_3D_DIM_SDC
-Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 
-#if QC_GENERIC_SDC_G0122
-  Bool bZeroResidual, Int iSDCDeltaResi
-#else
-  Bool bResidual
-#endif
-  )
+Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
 {
   UInt    uiLumaPredMode    = pcCU     ->getLumaIntraDir( uiAbsPartIdx );
   UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
   UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
-#if QC_PKU_SDC_SPLIT_G0123
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-#if QC_GENERIC_SDC_G0122
   TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#else
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-#endif
-#if QC_PKU_SDC_SPLIT_G0123
   UInt numParts = 1;
-  UInt i = 0;
   UInt sdcDepth = 0;
   UInt uiStride;         
@@ -1910,5 +1878,4 @@
   UInt uiRecIPredStride; 
 
-#if HS_TSINGHUA_SDC_SPLIT_G0111
   if ( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )
   {
@@ -1917,14 +1884,6 @@
     uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
   }
-#else
-  if (uiWidth == 64)
-  {
-    numParts = 4;
-    sdcDepth = 1;
-    uiWidth = uiHeight = 32;
-  }
-#endif
-
-  for ( i = 0; i < numParts; i++ )
+
+  for ( Int i = 0; i < numParts; i++ )
   {
     uiStride          = pcOrgYuv ->getStride  ();
@@ -1938,83 +1897,40 @@
 
     AOF( uiWidth == uiHeight );
-#else
-  UInt    uiStride          = pcOrgYuv ->getStride  ();
-  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
-  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  Pel*    piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  
-  UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
-  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
-  
-  AOF( uiWidth == uiHeight );
-  AOF( uiAbsPartIdx == 0 );
-  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
-  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
-#endif
-#if !QC_GENERIC_SDC_G0122
-  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) );
-  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64  );
-#endif
-  
-  //===== init availability pattern =====
-  Bool  bAboveAvail = false;
-  Bool  bLeftAvail  = false;
-#if QC_PKU_SDC_SPLIT_G0123
-  pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
-  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
-#else
-  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
-  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
-  
-#endif
-#if !QC_PKU_SDC_SPLIT_G0123
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-  //===== get prediction signal =====
-#if H_3D_DIM
-  if( isDimMode( uiLumaPredMode ) )
-  {
-#if HS_TSINGHUA_SDC_SPLIT_G0111  
-    UInt dimType   = getDimType  ( uiLumaPredMode );
-    UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
-    if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
-    {
-      if (g_aucConvertToBit[uiWidth] == 2)  // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
-        patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
-      else 
-        patternID = patternID >> 1;  // Other cases
-      pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID);
-    }
-#endif
-    predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true 
-#if QC_GENERIC_SDC_G0122
-      , dmm4Segmentation
-#endif
-      );
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-    Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
-    Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
-    for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
-    { 
-      dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
-    }
-#endif
-  }
-  else
-  {
-#endif
-    predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
-#if H_3D_DIM
-  }
-#endif
-#if QC_PKU_SDC_SPLIT_G0123
+
+    //===== init availability pattern =====
+    Bool  bAboveAvail = false;
+    Bool  bLeftAvail  = false;
+    pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
+    pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
+    TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
+    //===== get prediction signal =====
+    if( isDimMode( uiLumaPredMode ) )
+    {
+      UInt dimType   = getDimType  ( uiLumaPredMode );
+      UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
+      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
+      {
+        if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
+        {                                    
+          patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
+        }
+        else
+        {
+          patternID = patternID >> 1;  // Other cases
+        }
+        pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID);
+      }
+      predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true , dmm4Segmentation    );
+      Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
+      Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
+      for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
+      { 
+        dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
+      }
+    }
+    else
+    {
+      predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+    }
     if ( numParts > 1 )
     {
@@ -2031,7 +1947,5 @@
     }
     uiAbsPartIdx += ( ( uiWidth * uiWidth ) >> 4 );
-#if HS_TSINGHUA_SDC_SPLIT_G0111
     dmm4Segmentation->destroy(); delete dmm4Segmentation;
-#endif
   }
   uiAbsPartIdx = 0;
@@ -2040,5 +1954,5 @@
   piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
   piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  
+
   uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
   piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
@@ -2050,51 +1964,39 @@
     uiHeight = pcCU->getHeight( 0 );
   }
-#endif
   // number of segments depends on prediction mode
   UInt uiNumSegments = 1;
   Bool* pbMask = NULL;
   UInt uiMaskStride = 0;
-    
+
   if( getDimType( uiLumaPredMode ) == DMM1_IDX )
   {
     Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
-    
+
     WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
-    
+
     uiNumSegments = 2;
     pbMask = pcWedgelet->getPattern();
     uiMaskStride = pcWedgelet->getStride();
   }
-#if QC_GENERIC_SDC_G0122
   if( getDimType( uiLumaPredMode ) == DMM4_IDX )
   {
     uiNumSegments = 2;
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-    pbMask  = dmm4SegmentationOrg->getPattern();
+    pbMask       = dmm4SegmentationOrg->getPattern();
     uiMaskStride = dmm4SegmentationOrg->getStride();
-#else
-    pbMask  = dmm4Segmentation->getPattern();
-    uiMaskStride = dmm4Segmentation->getStride();
-#endif
-  }
-#endif
-  
+  }
+
   // get DC prediction for each segment
   Pel apDCPredValues[2];
   analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
-  
+
   // get original DC for each segment
   Pel apDCOrigValues[2];
   analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true );
-  
+
   for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
   {
     // remap reconstructed value to valid depth values
-#if QC_GENERIC_SDC_G0122
     Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment];
-#else
-    Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment];
-#endif
     // get residual (idx)
 #if H_3D_DIM_DLT
@@ -2103,5 +2005,4 @@
     Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
 #endif
-#if QC_GENERIC_SDC_G0122
     if( !bZeroResidual )
     {
@@ -2113,9 +2014,8 @@
       }
     }
-#endif
     // save SDC DC offset
     pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx);
   }
-  
+
   // reconstruct residual based on mask + DC residuals
   Pel apDCResiValues[2];
@@ -2132,5 +2032,5 @@
 #endif
   }
-  
+
   //===== reconstruction =====
   Bool* pMask     = pbMask;
@@ -2138,5 +2038,5 @@
   Pel* pReco      = piReco;
   Pel* pRecIPred  = piRecIPred;
-  
+
   for( UInt uiY = 0; uiY < uiHeight; uiY++ )
   {
@@ -2147,5 +2047,5 @@
 
       Pel pResiDC = apDCResiValues[ucSegment];
-      
+
       pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResiDC );
       pRecIPred[ uiX ] = pReco[ uiX ];
@@ -2156,10 +2056,10 @@
     pMask     += uiMaskStride;
   }
-  
+
   // clear UV
   UInt  uiStrideC     = pcPredYuv->getCStride();
   Pel   *pRecCb       = pcPredYuv->getCbAddr();
   Pel   *pRecCr       = pcPredYuv->getCrAddr();
-  
+
   for (Int y=0; y<uiHeight/2; y++)
   {
@@ -2169,9 +2069,9 @@
       pRecCr[x] = 128;
     }
-    
+
     pRecCb += uiStrideC;
     pRecCr += uiStrideC;
   }
-  
+
   //===== determine distortion =====
 #if H_3D_VSO
@@ -2181,10 +2081,9 @@
 #endif
     ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
-  
+
   //===== determine rate and r-d cost =====
   m_pcEntropyCoder->resetBits();
-  
+
   // encode reduced intra header
-#if QC_SDC_UNIFY_G0130
   if( !pcCU->getSlice()->isIntra() )
   {
@@ -2197,22 +2096,13 @@
   }
 
-#if QC_SDC_UNIFY_G0130_FIX2
   m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true );
-#else
-  m_pcEntropyCoder->encodePartSize( pcCU, 0, true );
-#endif
   m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
-#else
-  m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
-#endif
-  
+
   // encode pred direction + DC residual data
   m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
-#if QC_SDC_UNIFY_G0130
   Bool bDummy = false;
   m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
-#endif
   UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
-  
+
 #if H_3D_VSO
   if ( m_pcRdCost->getUseLambdaScaleVSO())
@@ -2221,11 +2111,5 @@
 #endif
     dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
-#if QC_GENERIC_SDC_G0122
-#if HS_TSINGHUA_SDC_SPLIT_G0111
   dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
-#else
-  dmm4Segmentation->destroy(); delete dmm4Segmentation;
-#endif
-#endif
 }
 #endif
@@ -3093,7 +2977,4 @@
           case( DMM4_IDX ):
             {
-#if !QC_GENERIC_SDC_G0122
-              if( uiWidth > 4 )
-#endif
               {
                 biSegmentation = new TComWedgelet( uiWidth, uiHeight );
@@ -3151,5 +3032,4 @@
       {
         pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth );
-#if QC_GENERIC_SDC_G0122
         for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ )
         {
@@ -3158,5 +3038,4 @@
             continue;
           }
-#endif
 #endif
       
@@ -3169,10 +3048,8 @@
       bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);
 #endif
-#if QC_GENERIC_SDC_G0122
       if( uiSDC != 0 && iSDCDeltaResi != 0 )
       {
         bTestZeroResi = false;
       }
-#endif
 #endif
       
@@ -3205,9 +3082,5 @@
 
           // start encoding with SDC
-#if QC_GENERIC_SDC_G0122
           xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
-#else
-          xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0));
-#endif
         }
         else
@@ -3282,6 +3155,4 @@
 #if H_3D_DIM_ENC || H_3D_DIM_SDC
       }
-#endif
-#if QC_GENERIC_SDC_G0122
         } // SDC residual loop
 #endif
@@ -3885,34 +3756,34 @@
   for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
   {
-      UInt uiCostCand = MAX_UINT;
-      UInt uiBitsCand = 0;
-      
-      PartSize ePartSize = pcCU->getPartitionSize( 0 );
-      
-#if H_3D_VSP && NTT_STORE_SPDV_VSP_G0148
-      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+    UInt uiCostCand = MAX_UINT;
+    UInt uiBitsCand = 0;
+
+    PartSize ePartSize = pcCU->getPartitionSize( 0 );
+
+#if H_3D_VSP
+    pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+    pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
 #endif
 
 #if H_3D_SPIVMP
-      pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 
-      if (pbSPIVMPFlag[uiMergeCand])
-      {
-        UInt uiSPAddr;
-
-        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
-
-        pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
-
-        for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
-        {
-          pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
-          pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
-          pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
-        }
-      }
-      else
-#endif
-#if NTT_STORE_SPDV_VSP_G0148
+    pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 
+    if (pbSPIVMPFlag[uiMergeCand])
+    {
+      UInt uiSPAddr;
+
+      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
+
+      pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
+
+      for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
+      {
+        pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
+        pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
+        pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
+      }
+    }
+    else
+#endif
+#if H_3D_VSP
 #if H_3D_DBBP
       if ( vspFlag[uiMergeCand] && !pcCU->getDBBPFlag(0) )
@@ -3950,22 +3821,17 @@
         pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
         pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
-
-#if NTT_STORE_SPDV_VSP_G0148
-      }
-#endif
-#if H_3D_VSP && !NTT_STORE_SPDV_VSP_G0148
-      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-#endif
-
-#if MTK_DDD_G0063
+#if H_3D_VSP
+      }
+#endif
+
+#if H_3D_DDD
       if( uiMergeCand == pcCU->getUseDDDCandIdx() )
       {
-          pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-          pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
       else
       {
-          pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
 #endif
@@ -3975,5 +3841,5 @@
       if (uiMergeCand == m_pcEncCfg->getMaxNumMergeCand() -1)
       {
-         uiBitsCand--;
+        uiBitsCand--;
       }
       uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand );
@@ -3986,5 +3852,5 @@
         uiMergeIndex = uiMergeCand;
       }
-    }
+  }
   }
 
@@ -4577,10 +4443,10 @@
     {
       uiLastMode = 1;
-          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
-          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
-        TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
-            pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
+      TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
       pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
-      
+
       pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
       pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
@@ -4667,5 +4533,5 @@
         pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
         if( uiMRGIndex == pcCU->getUseDDDCandIdx() )
         {
@@ -4703,5 +4569,5 @@
         else
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 #if H_3D_DBBP
         if ( vspFlag[uiMRGIndex] && !pcCU->getDBBPFlag(uiPartAddr) )
@@ -4735,12 +4601,10 @@
         }
         else
-#if H_3D_FIX_G0148_BRACE
           {
-#endif
 #endif
           pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
             pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0], ePartSize, uiPartAddr, 0, iPartIdx );
             pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx );
-#if H_3D_FIX_G0148_BRACE
+#if H_3D
           }
 #endif
@@ -4758,5 +4622,5 @@
         pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
         pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
 #endif
@@ -5616,16 +5480,9 @@
     m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
     m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true );
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
 #endif
     uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
@@ -5882,9 +5739,5 @@
 
 #if H_3D_INTER_SDC
-#if SEC_INTER_SDC_G0101
 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth )
-#else
-Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth )
-#endif
 {
   if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) )
@@ -5892,38 +5745,18 @@
     return;
   }
-#if QC_SDC_UNIFY_G0130
   pcCU->setSDCFlagSubParts( true, 0, uiDepth );
-#else
-  pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth );
-#endif
-
-  UInt  uiWidth      = pcCU->getWidth ( 0 );
-  UInt  uiHeight     = pcCU->getHeight( 0 );
-#if SEC_INTER_SDC_G0101
-  UInt uiSegSize = 0;
-#else
-  UChar* pMask       = pcCU->getInterSDCMask();
-  memset( pMask, 0, uiWidth*uiHeight );
-
-  pcCU->xSetInterSDCCUMask( pcCU, pMask );
-
-  UInt uiSegSize[4] = { 0, 0, 0, 0 };
-#endif
+
+  UInt  uiWidth   = pcCU->getWidth ( 0 );
+  UInt  uiHeight  = pcCU->getHeight( 0 );
+  UInt  uiSegSize = 0;
+
   Pel *pPred, *pOrg;
   UInt uiPredStride = pcPred->getStride();
   UInt uiOrgStride  = pcOrg->getStride();
   UInt uiPelX, uiPelY;
-#if !SEC_INTER_SDC_G0101
-  UInt uiPartitionSize = pcCU->getPartitionSize( 0 );
-  UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 );
-#endif
 
   pPred = pcPred->getLumaAddr( 0 );
   pOrg  = pcOrg->getLumaAddr( 0 );
-#if SEC_INTER_SDC_G0101
   Int pResDC = 0;
-#else
-  Int pResDC[4] = { 0, 0, 0, 0};
-#endif
 
   //calculate dc value for prediction and original signal, and calculate residual and reconstruction
@@ -5932,12 +5765,6 @@
     for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     {
-#if SEC_INTER_SDC_G0101
       pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] );
       uiSegSize++;
-#else
-      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
-      pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] );
-      uiSegSize[uiSeg]++;
-#endif
     }
     pOrg  += uiOrgStride;
@@ -5945,21 +5772,9 @@
   }
 
-#if SEC_INTER_SDC_G0101
   Int iResiOffset = ( pResDC  > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) );
   pResDC          = ( pResDC + iResiOffset ) / (Int) uiSegSize;
 
   pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 );
-#else
-  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
-  {
-    Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) );
-    pResDC [uiSeg]  = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg];
-#if QC_SDC_UNIFY_G0130
-    pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
-#else
-    pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
-#endif
-  }
-#endif
+
 
   Pel *pRec;
@@ -5972,12 +5787,5 @@
     for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     {
-#if SEC_INTER_SDC_G0101
       pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) );
-#else
-      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
-      assert( uiSeg < uiSegmentNum );
-
-      pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] );
-#endif
     }
     pPred     += uiPredStride;
@@ -6019,22 +5827,10 @@
 #endif
 
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   Bool bNonSkip = false;
 #else
   Bool bNonSkip = true;
 #endif
-#if SEC_INTER_SDC_G0101
   bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0;
-#else
-  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
-  {
-#if QC_SDC_UNIFY_G0130
-    bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
-#else
-    bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
-#endif
-  }
-#endif
-
   if( !bNonSkip )
   {
@@ -7176,16 +6972,9 @@
     m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
     m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true);
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
 #endif
     ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
@@ -7201,23 +6990,13 @@
     m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
     m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
     m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-    m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true );
 #endif
     Bool bDummy = false;
Index: trunk/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 884)
@@ -218,7 +218,5 @@
     TComYuv* pcResi, 
     TComYuv* pcRec, 
-#if SEC_INTER_SDC_G0101
     Int      uiOffset,
-#endif
     const UInt uiDepth );
 #endif
@@ -355,11 +353,5 @@
 #endif
 #if H_3D_DIM_SDC
-  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 
-#if QC_GENERIC_SDC_G0122
-    Bool bZeroResidual, Int iSDCDeltaResi
-#else
-    Bool bResidual
-#endif
-    );
+  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi    );
 #endif
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncSlice.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSlice.h	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncSlice.h	(revision 884)
@@ -107,5 +107,5 @@
   UInt                    m_uiSliceIdx;
   std::vector<TEncSbac*> CTXMem;
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Int          m_iDDDScale;
   Int          m_iDDDOffset;
@@ -146,5 +146,5 @@
   Void      setCtxMem( TEncSbac* sb, Int b )   { CTXMem[b] = sb; }
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Void setDDDPar( Int iScale, Int iOffset, UInt uiPrecision ){ m_iDDDScale = iScale; m_iDDDOffset = iOffset; m_uiDDDPrecision = uiPrecision; }
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 872)
+++ trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 884)
@@ -667,6 +667,4 @@
   m_cSPS.setSPSId( getLayerIdInVps() );
   m_cSPS.setLayerId( getLayerId() );
-#endif
-#if H_MV_HLS_7_VPS_P0048_14
  // Code below needs to be moved to VPS
 #endif
@@ -832,11 +830,7 @@
   m_cPPS.setSPSId( getLayerIdInVps() );
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
-#if H_MV  
   m_cPPS.setPpsExtensionTypeFlag          ( PPS_EX_T_MV ,true ); 
 #if H_3D
   m_cPPS.setPpsExtensionTypeFlag          ( PPS_EX_T_3D ,true ); 
-#endif
-#endif
 #endif
 #endif
