Index: trunk/source/Lib/TLibDecoder/NALread.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/NALread.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/NALread.cpp	(revision 976)
@@ -127,5 +127,5 @@
   else
   {
-#if H_MV_HLS_8_GEN_Q0108_13
+#if H_MV
 
     // If nal_unit_type is in the range of BLA_W_LP to RSV_IRAP_VCL23, inclusive, i.e. the coded 
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 976)
@@ -374,5 +374,4 @@
 
 #if H_MV
-#if H_MV_HLS_8_SPS_NODOC_48
     READ_FLAG( uiCode, "pps_range_extensions_flag" ); pcPPS->setPpsRangeExtensionsFlag( uiCode == 1 );
     READ_FLAG( uiCode, "pps_multilayer_extension_flag" ); pcPPS->setPpsMultilayerExtensionFlag( uiCode == 1 );
@@ -390,8 +389,6 @@
     if ( pcPPS->getPpsMultilayerExtensionFlag() )
     { 
-        READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
-#if H_MV_HLS_8_PPS_NODOC_NN
-        READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
-#endif
+      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
+      READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
     }
 #if !H_3D
@@ -406,31 +403,5 @@
     {
 #endif
-#else
-    for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
-    {
-      READ_FLAG( uiCode, "pps_extension_type_flag" ); pcPPS->setPpsExtensionTypeFlag( i, uiCode == 1 );
-#if H_3D
-      assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_3D || i == PPS_EX_T_ESC ); 
-#else
-      assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_ESC ); 
-#endif
-    }
-    
-
-    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
-    {
-      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
-    }
-
-#if H_3D
-    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC
-    {
-      parsePPSExtension( pcPPS, pcVPS );
-    }
-#endif
-
-    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_ESC ) )
-    {
-#endif
+
 #endif
 
@@ -481,11 +452,8 @@
             READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]"); 
 
-#if  MTK_DLT_CODING_FIX_H0091
             if( uiCode )
             {
                 assert( pcDLT->getUseDLTFlag( 1 ));
             }
-#endif
-
             pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false );
 
@@ -795,15 +763,15 @@
   {
 #endif
-  READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
-  assert(uiCode <= 6);
-  
-  READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
-  if ( pcSPS->getMaxTLayers() == 1 )
-  {
-    // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
-    assert( uiCode == 1 );
-  }
-  
-  parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
+    READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
+    assert(uiCode <= 6);
+
+    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
+    if ( pcSPS->getMaxTLayers() == 1 )
+    {
+      // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
+      assert( uiCode == 1 );
+    }
+
+    parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
 #if H_MV
   }
@@ -823,15 +791,15 @@
   {
 #endif
-  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
-  assert(uiCode <= 3);
-  // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
-  assert (uiCode == 1);
-  if( uiCode == 3 )
-  {
-    READ_FLAG(     uiCode, "separate_colour_plane_flag");        assert(uiCode == 0);
-  }
-
-  READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
-  READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
+    READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
+    assert(uiCode <= 3);
+    // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
+    assert (uiCode == 1);
+    if( uiCode == 3 )
+    {
+      READ_FLAG(     uiCode, "separate_colour_plane_flag");        assert(uiCode == 0);
+    }
+
+    READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
+    READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
 #if H_MV
   }
@@ -860,13 +828,13 @@
   { 
 #endif
-  READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
-  assert(uiCode <= 6);
-  pcSPS->setBitDepthY( uiCode + 8 );
-  pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
-
-  READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
-  assert(uiCode <= 6);
-  pcSPS->setBitDepthC( uiCode + 8 );
-  pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
+    READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
+    assert(uiCode <= 6);
+    pcSPS->setBitDepthY( uiCode + 8 );
+    pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
+
+    READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
+    assert(uiCode <= 6);
+    pcSPS->setBitDepthC( uiCode + 8 );
+    pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
 #if H_MV
   }
@@ -880,27 +848,27 @@
   {  
 #endif
-  UInt subLayerOrderingInfoPresentFlag;
-  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
-  
-  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
-  {
-    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
-    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
-    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
-    pcSPS->setNumReorderPics(uiCode, i);
-    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
-    pcSPS->setMaxLatencyIncrease( uiCode, i );
-
-    if (!subLayerOrderingInfoPresentFlag)
-    {
-      for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
-      {
-        pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
-        pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
-        pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
-      }
-      break;
-    }
-  }
+    UInt subLayerOrderingInfoPresentFlag;
+    READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
+
+    for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
+    {
+      READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
+      pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
+      READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
+      pcSPS->setNumReorderPics(uiCode, i);
+      READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
+      pcSPS->setMaxLatencyIncrease( uiCode, i );
+
+      if (!subLayerOrderingInfoPresentFlag)
+      {
+        for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
+        {
+          pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
+          pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
+          pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
+        }
+        break;
+      }
+    }
 #if H_MV
   }
@@ -912,10 +880,10 @@
   READ_UVLC( uiCode, "log2_diff_max_min_coding_block_size" );
   pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode);
-  
+
   if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
   {
     assert(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() >= 5);
   }
-  
+
   Int maxCUDepthDelta = uiCode;
   pcSPS->setMaxCUWidth  ( 1<<(log2MinCUSize + maxCUDepthDelta) ); 
@@ -948,9 +916,9 @@
     {    
 #endif
-    READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
-    if(pcSPS->getScalingListPresentFlag ())
-    {
-      parseScalingList( pcSPS->getScalingList() );
-    }
+      READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
+      if(pcSPS->getScalingListPresentFlag ())
+      {
+        parseScalingList( pcSPS->getScalingList() );
+      }
 #if H_MV
     }
@@ -1017,5 +985,4 @@
   {
 #if H_MV
-#if H_MV_HLS_8_SPS_NODOC_48
     READ_FLAG( uiCode, "sps_range_extensions_flag" ); pcSPS->setSpsRangeExtensionsFlag( uiCode == 1 );
     READ_FLAG( uiCode, "sps_multilayer_extension_flag" ); pcSPS->setSpsMultilayerExtensionFlag( uiCode == 1 );
@@ -1050,38 +1017,10 @@
   { 
 #endif
-#else
-    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
-    {
-      READ_FLAG( uiCode, "sps_extension_type_flag" ); pcSPS->setSpsExtensionTypeFlag( i, uiCode );
-#if H_3D
-      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D || i == PS_EX_T_ESC ); 
-#else
-      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_ESC ); 
-#endif
-    }  
-
-    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
-    {
-      parseSPSExtension( pcSPS ); 
-    }
-
-#if H_3D
-    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
-    {
-      parseSPSExtension2( pcSPS, viewIndex, depthFlag  ); 
-    }
-#endif
-
-    if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC ))
-    {   
-#endif
-#endif
-        while ( xMoreRbspData() )
-        {
-          READ_FLAG( uiCode, "sps_extension_data_flag");
-        }
-#if H_MV && !H_MV_HLS_8_SPS_NODOC_48
-    }
-#endif
+
+#endif
+    while ( xMoreRbspData() )
+    {
+      READ_FLAG( uiCode, "sps_extension_data_flag");
+    }
   }
 }
@@ -1132,5 +1071,5 @@
   
   READ_CODE( 4,  uiCode,  "vps_video_parameter_set_id" );         pcVPS->setVPSId( uiCode );
-#if H_MV_HLS_8_SYN_Q0041_03
+#if H_MV
   READ_FLAG( uiCode, "vps_base_layer_internal_flag" );            pcVPS->setVpsBaseLayerInternalFlag( uiCode == 1 );
   READ_FLAG( uiCode, "vps_reserved_one_bit" );                    assert( uiCode == 1 ); 
@@ -1221,5 +1160,5 @@
     }
   }
-#if H_MV_HLS_8_RPS_Q0100_36
+#if H_MV
   READ_FLAG( uiCode,  "vps_extension_flag" );                      pcVPS->setVpsExtensionFlag( uiCode == 1 ? true : false );
   if ( pcVPS->getVpsExtensionFlag() )
@@ -1262,7 +1201,4 @@
 {
   UInt uiCode; 
-#if !H_MV_HLS_8_SYN_Q0041_03
-  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
-#endif
 
   READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
@@ -1384,5 +1320,4 @@
   }
 
-#if H_MV_HLS_8_SYN_39_19
   if ( pcVPS->getNumIndependentLayers() > 1 ) 
   {
@@ -1404,12 +1339,4 @@
   pcVPS->initTargetLayerIdLists( ); 
 
-#else
-  READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
-  pcVPS->initTargetLayerIdLists( ); 
-  if( pcVPS->getNumOutputLayerSets() > 1)
-  {
-    READ_CODE( 2, uiCode, "default_output_layer_idc" ); pcVPS->setDefaultOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );    
-  }  
-#endif
 
   pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 )); 
@@ -1420,9 +1347,5 @@
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
-#if H_MV_HLS_8_SYN_39_19
     if( i >= pcVPS->getNumLayerSets( ) )    
-#else
-    if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )    
-#endif
     {        
       READ_UVLC( uiCode,      "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode ); 
@@ -1455,13 +1378,5 @@
   }
 
-#if !H_MV_HLS_8_PMS_Q0195_20
-  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
-  if ( pcVPS->getRepFormatIdxPresentFlag() )
-  {
-    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
-  }
-#else
   READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
-#endif
 
   for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
@@ -1474,41 +1389,22 @@
   }
 
-#if H_MV_HLS_8_PMS_Q0195_20
   if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
   {
     READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
   }
-#endif
   if( pcVPS->getRepFormatIdxPresentFlag() ) 
   {
-#if H_MV_HLS_8_SYN_Q0041_03
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-#else
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-#endif
-    {
-#if !H_MV_HLS_8_PMS_Q0195_20
-      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
-      {
-#endif
+    {
         READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
-#if !H_MV_HLS_8_PMS_Q0195_20
-      }
-#endif
-    }
-  }
-#if H_MV_HLS_8_PMS_Q0195_20
+    }
+  }
   else
   {
-#if H_MV_HLS_8_SYN_Q0041_03
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-#else
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-#endif
     {
       pcVPS->setVpsRepFormatIdx( i, pcVPS->inferVpsRepFormatIdx( i ) );
     }
   }
-#endif
 
   READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 ); 
@@ -1535,13 +1431,7 @@
   }
 
-#if H_MV_HLS_8_SYN_Q0041_03
   for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ?  1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ )
   {
     for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ?  0 : 1; j < i; j++ )
-#else
-  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
-  {
-    for( Int j = 0; j < i; j++ )
-#endif
     {
       if (pcVPS->getDirectDependencyFlag( i, j) )
@@ -1629,15 +1519,7 @@
   if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
   {
-#if H_MV_HLS_8_SYN_Q0041_03
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#else
-    for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#endif
-    {
-#if H_MV_HLS_8_MIS_Q0102_30
+    {
       for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ ) 
-#else        
-      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ ) 
-#endif
       {
         if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
@@ -1699,9 +1581,5 @@
   if( !pcVPSVUI->getTilesNotInUseFlag() ) 
   {      
-#if H_MV_HLS_8_SYN_Q0041_03
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
-#else
-    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
-#endif
     {
       READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 );
@@ -1711,9 +1589,5 @@
       }
     }  
-#if H_MV_HLS_8_SYN_Q0041_03
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i  <=  pcVPS->getMaxLayersMinus1(); i++ )  
-#else
-    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )      
-#endif
     {
       for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
@@ -1746,8 +1620,6 @@
       for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
       {
-#if H_MV_HLS_8_SYN_Q0041_03
         if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
         {        
-#endif
           READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
           if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
@@ -1759,7 +1631,5 @@
             }
           }
-#if H_MV_HLS_8_SYN_Q0041_03
-        }
-#endif
+        }
       }
     }
@@ -1808,20 +1678,7 @@
     for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ )  
     {
-#if H_MV_HLS_8_HRD_Q0101_04
       for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ )  
       {
         READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
-#else
-      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ )  
-      {
-        if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
-        {
-          READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
-        }
-        else
-        {
-          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 
-        }
-#endif
       }
     }
@@ -1831,21 +1688,11 @@
     {  
       READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1" ); vpsVuiBspHrdP->setNumBspSchedCombinationsMinus1( h, uiCode );
-#if H_MV_HLS_8_HRD_Q0182_05
       for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
-#else
-      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
-#endif
       {
         for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
         {  
-#if H_MV_HLS_8_HRD_Q0101_04
           READ_CODE( vpsVuiBspHrdP->getBspCombHrdIdxLen(), uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
-#else
-          READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
-#endif
           READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode );
-#if H_MV_HLS_8_HRD_Q0101_04
           vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j ); 
-#endif
         }  
       }
@@ -1872,13 +1719,7 @@
   for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
   {  
-#if H_MV_HLS_8_MIS_Q0102_30
     Int currLsIdx = vps->olsIdxToLsIdx( i ); 
-#endif
     READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
-#if H_MV_HLS_8_MIS_Q0102_30
     for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
-#else
-    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
-#endif
     {  
       if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  )  
@@ -1888,9 +1729,5 @@
       if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
       {  
-#if H_MV_HLS_8_MIS_Q0102_30
         for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
-#else
-        for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ )   
-#endif
         {
           READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
@@ -1903,9 +1740,5 @@
         if ( j > 0 )
         {
-#if H_MV_HLS_8_DBP_NODOC_42
           for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
-#else
-          for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ )   
-#endif
           {
             dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
@@ -1918,5 +1751,4 @@
   }  
 }
-#endif
 
 #if H_3D
@@ -1939,10 +1771,8 @@
 #if H_3D_IV_MERGE
         READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
-#if QC_IV_PRED_CONSTRAINT_H0137
         if( !pcVPS->getNumDirectRefLayers(i) )
         {
           assert( !uiCode );         
         }
-#endif
 #if H_3D_SPIVMP
         READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3); 
@@ -1951,10 +1781,8 @@
 #if H_3D_ARP
         READ_FLAG( uiCode, "iv_res_pred_flag[i]"  );       pcVPS->setUseAdvRP  ( i, uiCode ); pcVPS->setARPStepNum( i, uiCode ? H_3D_ARP_WFNR : 1 );
-#if QC_IV_PRED_CONSTRAINT_H0137
         if( !pcVPS->getNumDirectRefLayers(i) )
         {
           assert( !uiCode );         
         }
-#endif
 #endif
 #if H_3D_NBDV_REF
@@ -1963,10 +1791,8 @@
 #if H_3D_VSP
         READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false );
-#if QC_IV_PRED_CONSTRAINT_H0137
         if( !pcVPS->getNumDirectRefLayers(i) )
         {
           assert( !uiCode );         
         }
-#endif
 #endif
 #if H_3D_DBBP
@@ -1980,10 +1806,8 @@
         {
           READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
-#if QC_IV_PRED_CONSTRAINT_H0137
           if( !pcVPS->getNumDirectRefLayers(i) )
           {
             assert( !uiCode );         
           }
-#endif
         }
 #endif
@@ -2037,6 +1861,6 @@
 }
 #endif
-
-#if H_MV_HLS_8_HRD_Q0102_08
+#endif
+#if H_MV
 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)
 #else
@@ -2081,10 +1905,6 @@
   sps->inferRepFormat  ( vps , rpcSlice->getLayerId() ); 
   sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
-#if H_MV_HLS_8_HRD_Q0102_08
   sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false ); 
-#endif
-#if H_MV_HLS_8_RPS_Q0100_36
   vps->inferDbpSizeLayerSetZero( sps, false ); 
-#endif
 
   if ( sps->getVuiParametersPresentFlag() )
@@ -2141,5 +1961,5 @@
   }
   
-#if H0044_POC_LSB_NOT_PRESENT
+#if H_MV
     UInt slicePicOrderCntLsb = 0;
 #endif
@@ -2195,7 +2015,4 @@
 
 #if H_MV
-#if !H0044_POC_LSB_NOT_PRESENT
-    UInt slicePicOrderCntLsb = 0;
-#endif
     Int iPOClsb = slicePicOrderCntLsb;  // Needed later
     if ( (rpcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( rpcSlice->getLayerIdInVps())) || !rpcSlice->getIdrPicFlag() )
@@ -2203,7 +2020,5 @@
       READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb");        
     }    
-#if H_MV_HLS_8_POC_Q0142_32
     rpcSlice->setSlicePicOrderCntLsb( slicePicOrderCntLsb ); 
-#endif
 
     Bool picOrderCntMSBZeroFlag = false;     
@@ -2301,5 +2116,5 @@
       {        
         parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
-#if H_MV_HLS_8_RPS_Q0100_36
+#if H_MV
         if ( !rps->getInterRPSPrediction( ) )
         { // check sum of num_positive_pics and num_negative_pics
@@ -2414,5 +2229,5 @@
         rps->setNumberOfPictures(offset);        
       }  
-#if H_MV_HLS_8_RPS_Q0100_36
+#if H_MV
       if ( !rps->getInterRPSPrediction( ) )
       { // check sum of NumPositivePics, NumNegativePics, num_long_term_sps and num_long_term_pics 
@@ -2804,14 +2619,11 @@
       rpcSlice->setPocResetIdc( 0 );
     }
-#if H_MV_HLS_8_POC_Q0142_32
     rpcSlice->checkPocResetIdc(); 
-#endif
-
-#if H0044_POC_LSB_NOT_PRESENT
+
     if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && slicePicOrderCntLsb > 0 )
     {
       assert( rpcSlice->getPocResetIdc() != 2 );
     }
-#endif
+
     if( rpcSlice->getPocResetIdc() !=  0 )
     {
@@ -2828,16 +2640,6 @@
       READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 );
       READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode );
-#if !H_MV_HLS_8_POC_Q0142_32
-#if H0044_POC_LSB_NOT_PRESENT
-      if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() )
-      {
-        assert( rpcSlice->getPocLsbVal() == 0 );
-      }
-#endif
-#endif
     }          
-#if H_MV_HLS_8_POC_Q0142_32
     rpcSlice->checkPocLsbVal(); 
-#endif
 
     // Derive the value of PocMs8bValRequiredFlag
@@ -2852,16 +2654,5 @@
     else
     {
-#if H_MV_HLS_8_POC_Q0146_15
       rpcSlice->setPocMsbValPresentFlag( rpcSlice->inferPocMsbValPresentFlag( ) ); 
-#else
-      if( rpcSlice->getPocMsbValRequiredFlag() )
-      {
-        rpcSlice->setPocMsbValPresentFlag( true );
-      }
-      else
-      {
-        rpcSlice->setPocMsbValPresentFlag( false );
-      }
-#endif
     }
 
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 976)
@@ -109,5 +109,5 @@
   Void  parseProfileTier    (ProfileTierLevel *ptl);
   Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx);
 #else
Index: trunk/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCu.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecCu.cpp	(revision 976)
@@ -432,17 +432,10 @@
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
     m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 
-#if !ETRIKHU_CLEANUP_H0083
-      ,vspFlag
-#endif
       , inheritedVSPDisInfo
 #if H_3D_SPIVMP
-#if !ETRIKHU_CLEANUP_H0083_MISSING
-      , bSPIVMPFlag
-#endif
       , pcMvFieldSP, puhInterDirSP
 #endif
       , numValidMergeCand, uiMergeIndex );
 
-#if ETRIKHU_CLEANUP_H0083
     m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
 #if H_3D_SPIVMP
@@ -450,5 +443,4 @@
 #endif
       , numValidMergeCand );
-#endif
     pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
 #else
@@ -797,13 +789,8 @@
     }
     
-#if RWTH_DBBP_NO_SPU_H0057
     AOF( pcCU->getARPW(uiPartAddr) == 0 );
     AOF( pcCU->getICFlag(uiPartAddr) == false );
     AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false );
     AOF( pcCU->getVSPFlag(uiPartAddr) == 0 );
-#else
-    pDBBPTmpData->ahVSPFlag[uiSegment] = pcCU->getVSPFlag( uiPartAddr );
-    pDBBPTmpData->acDvInfo[uiSegment] = pcCU->getDvInfo( uiPartAddr );
-#endif
   }
   
@@ -814,10 +801,5 @@
   {
     pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth );
-    
-#if !RWTH_DBBP_NO_SPU_H0057
-    pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], 0, 0, uiDepth );
-    pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], 0, 0, uiDepth );
-#endif
-    
+  
     for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     {
@@ -839,10 +821,4 @@
     
     pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth);
-    
-#if !RWTH_DBBP_NO_SPU_H0057
-    pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uiDepth );
-    pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uiDepth );
-#endif
-    
     pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level
     
@@ -946,16 +922,5 @@
     for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     {
-#if H_3D && !SEC_NO_RESI_DLT_H0105
-      if ( useDltFlag )
-      {
-        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 ] );
-#endif
       pRecIPred[ uiX ] = pReco[ uiX ];
     }
@@ -1257,5 +1222,4 @@
   // get DC prediction for each segment
   Pel apDCPredValues[2];
-#if HS_DMM_SDC_PREDICTOR_UNIFY_H0108
   if ( getDimType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )
   {
@@ -1264,6 +1228,7 @@
   }
   else
-#endif
-  m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
+  {
+    m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
+  }
   
   // reconstruct residual based on mask + DC residuals
Index: trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 976)
@@ -140,9 +140,5 @@
 #if H_3D_DBBP
 
-#if MTK_DBBP_SIGNALING_H0094
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
-#else
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE )
-#endif
   {
     decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
@@ -150,7 +146,4 @@
     if( pcCU->getDBBPFlag(uiAbsPartIdx) )
     {
-#if !MTK_DBBP_SIGNALING_H0094
-      AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE );
-#endif
       
       // get collocated depth block
@@ -169,10 +162,8 @@
       pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
       
-#if RWTH_DBBP_NO_SPU_H0057
       // make sure that DBBP flag is set for both segments
       UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
       pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
       pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
-#endif
     }
   }
@@ -210,12 +201,4 @@
     return;
   }
-#if !MTK_SDC_FLAG_FIX_H0095
-#if H_3D_DIM_SDC
-  if( pcCU->getSDCFlag(uiAbsPartIdx) )
-  {
-    return;
-  }
-#endif
-#endif
   
   m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
@@ -309,17 +292,9 @@
           pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
-#if !ETRIKHU_CLEANUP_H0083
-            ,vspFlag
-#endif
             , inheritedVSPDisInfo
 #if H_3D_SPIVMP
-#if !ETRIKHU_CLEANUP_H0083_MISSING
-            , bSPIVMPFlag
-#endif
             , pcMvFieldSP, puhInterDirSP
 #endif
             , numValidMergeCand );
-
-#if ETRIKHU_CLEANUP_H0083
           pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
 #if H_3D_SPIVMP
@@ -327,5 +302,4 @@
 #endif
             , numValidMergeCand );
-#endif
           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
 
@@ -361,17 +335,9 @@
         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
         pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
-#if !ETRIKHU_CLEANUP_H0083
-          , vspFlag
-#endif
           , inheritedVSPDisInfo
 #if H_3D_SPIVMP
-#if !ETRIKHU_CLEANUP_H0083_MISSING
-            , bSPIVMPFlag
-#endif
           , pcMvFieldSP, puhInterDirSP
 #endif
           ,numValidMergeCand, uiMergeIndex );
-
-#if ETRIKHU_CLEANUP_H0083
         pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
 #if H_3D_SPIVMP
@@ -379,5 +345,4 @@
 #endif
           ,numValidMergeCand );
-#endif
         pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
         if(vspFlag[uiMergeIndex])
Index: trunk/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 976)
@@ -77,5 +77,5 @@
 #endif
 
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx )       = 0;
 #else
@@ -164,5 +164,5 @@
   Void    decodePPS                   ( TComPPS* pcPPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS);                    }
 #endif
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, targetOlsIdx );         }
 #else
Index: trunk/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecGop.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecGop.cpp	(revision 976)
@@ -248,13 +248,4 @@
     calcAndPrintHashStatus(*rpcPic->getPicYuvRec(), hash);
   }
-
-#if !H_MV_HLS_7_VPS_P0300_27
-#if SETTING_PIC_OUTPUT_MARK
-  rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false);
-#else
-  rpcPic->setOutputMark(true);
-#endif
-  rpcPic->setReconMark(true);
-#endif
 }
 
Index: trunk/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 976)
@@ -87,7 +87,4 @@
 , m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
-#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
-, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
 #if H_3D_DIM_SDC
 , m_cSDCResidualFlagSCModel     ( 1,             1,             SDC_NUM_RESIDUAL_FLAG_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
@@ -171,7 +168,4 @@
   m_cDdcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_DATA );
   m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
-#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
-  m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
-#endif
 #if H_3D_DIM_SDC
   m_cSDCResidualFlagSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
@@ -241,7 +235,4 @@
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
-  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
-#endif
 #if H_3D_DIM_SDC
   m_cSDCResidualFlagSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
@@ -386,9 +377,5 @@
     uiCount++;
   }
-#if QC_SIMP_DELTADC_CODING_H0131
   while( uiSymbol && ( uiCount != 3 ) );
-#else
-  while( uiSymbol && ( uiCount != 13 ) );
-#endif
   ruiSymbol = uiCount - 1;
 
@@ -426,9 +413,5 @@
   for( Int i = 0; i < iNumBit; i++ )
   {
-#if MTK_DMM_SIMP_CODE_H0092
-      m_pcTDecBinIf->decodeBinEP( uiSymbol );
-#else
-    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm1DataSCModel.get(0, 0, 0) );
-#endif
+    m_pcTDecBinIf->decodeBinEP( uiSymbol );
     uiIdx += uiSymbol << i;
   }
@@ -1137,9 +1120,5 @@
   if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
   {
-#if LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135
     m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
-#else
-    m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
-#endif
   }
   else
@@ -2081,9 +2060,5 @@
     UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
     uiNumSegments = isDimMode( dir ) ? 2 : 1;
-#if MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113
     m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
-#else
-    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) );
-#endif
     if( pcCU->getSDCFlag( absPartIdx ) )
     {
@@ -2156,12 +2131,6 @@
 Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
-#if !MTK_DBBP_SIGNALING_H0094
-  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
-#endif
   AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
   AOF( !pcCU->getSlice()->getIsDepth() );
-#if !MTK_DBBP_SIGNALING_H0094
-  AOF( ePartSize == RWTH_DBBP_PACK_MODE );
-#endif
   
   UInt uiSymbol = 0;
@@ -2172,8 +2141,6 @@
   {
     pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
-#if MTK_DIS_SPBIP8X4_H0205
     UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;
     pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
-#endif
   }
 }
Index: trunk/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 976)
@@ -87,8 +87,8 @@
 #endif
 
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/, Int targetOlsIdx ) {}
 #else
-  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
+  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/ ) {}
 #endif
   Void  parseTerminatingBit       ( UInt& ruiBit );
@@ -218,7 +218,4 @@
   ContextModel3DBuffer m_cDdcDataSCModel;
   ContextModel3DBuffer m_cAngleFlagSCModel;
-#if H_3D_DIM_DMM && !MTK_DMM_SIMP_CODE_H0092
-  ContextModel3DBuffer m_cDmm1DataSCModel;
-#endif
 #if H_3D_DIM_SDC  
   ContextModel3DBuffer m_cSDCResidualFlagSCModel;
Index: trunk/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 976)
@@ -221,5 +221,5 @@
     }
   }
-#if  MTK_DLT_CODING_FIX_H0091
+#if  H_3D
   if( pcSlice->getPPS()->getDLT() != NULL )
   {
Index: trunk/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 976)
@@ -371,8 +371,6 @@
   m_isNoOutputPriorPics = false;
 #endif
-#if H0056_EOS_CHECKS
+#if H_MV
   m_isLastNALWasEos = false;
-#endif
-#if H_MV
   m_layerId = 0;
   m_viewId = 0;
@@ -382,5 +380,5 @@
   m_pcCamParsCollector = 0;
 #endif
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   m_targetOptLayerSetIdx = -1; 
 #endif
@@ -511,5 +509,5 @@
     {
       rpcPic->setOutputMark(false);
-#if H_MV_HLS_7_VPS_P0300_27
+#if H_MV
       rpcPic->setPicOutputFlag(false); 
 #endif
@@ -521,5 +519,5 @@
     {
       rpcPic->setOutputMark(false);
-#if H_MV_HLS_7_VPS_P0300_27
+#if H_MV
       rpcPic->setPicOutputFlag(false); 
 #endif
@@ -568,7 +566,4 @@
   TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );  
   TComSlice::markCurrPic( pcPic ); 
-#if !H_MV_HLS_8_DBP_NODOC_42
-  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc ); 
-#endif
 #endif
   m_bFirstSliceInPicture  = true;
@@ -590,5 +585,5 @@
     {
       pcPicTmp->setOutputMark(false);
-#if H_MV_HLS_7_VPS_P0300_27
+#if H_MV
       pcPicTmp->setPicOutputFlag(false); 
 #endif
@@ -670,13 +665,7 @@
   }
 
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false ); 
-#endif
-
-#if H_MV_HLS_8_RPS_Q0100_36
   vps->inferDbpSizeLayerSetZero( sps, false ); 
-#endif
-
-#if H_MV_HLS_8_PMS_Q0195_21
   // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
   if ( vps->getVpsNumRepFormatsMinus1() == 0 )
@@ -685,11 +674,5 @@
     assert( sps->getUpdateRepFormatFlag() == false ); 
   }
-#endif
-
-#if H_MV_HLS_8_RPS_Q0100_36
   sps->checkRpsMaxNumPics( vps, getLayerId() ); 
-#endif
-
-#if H_MV_HLS_8_MIS_Q0177_22
   if( m_layerId > 0 )
   {
@@ -787,10 +770,5 @@
   m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 
   m_apcSlicePilot->setLayerId( nalu.m_layerId );
-#endif
-
-#if H_MV_HLS_8_HRD_Q0102_08
   m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx );
-#else
-  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
 #endif
   // set POC for dependent slices in skipped pictures
@@ -1340,5 +1318,5 @@
     case NAL_UNIT_VPS:
       xDecodeVPS();
-#if H0056_EOS_CHECKS
+#if H_MV
       m_isLastNALWasEos = false;
 #endif
@@ -1355,5 +1333,5 @@
     case NAL_UNIT_PREFIX_SEI:
     case NAL_UNIT_SUFFIX_SEI:
-#if H0056_EOS_CHECKS
+#if H_MV
       if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI )
       {
@@ -1380,5 +1358,5 @@
     case NAL_UNIT_CODED_SLICE_RASL_N:
     case NAL_UNIT_CODED_SLICE_RASL_R:
-#if H0056_EOS_CHECKS
+#if H_MV
       if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N ||
           nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N ||
@@ -1393,6 +1371,5 @@
         m_isLastNALWasEos = false;
       }
-#endif
-#if H_MV
+
       return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
 #else
@@ -1401,5 +1378,5 @@
       break;
     case NAL_UNIT_EOS:
-#if H0056_EOS_CHECKS
+#if H_MV
       assert( m_isLastNALWasEos == false );
       //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything.
Index: trunk/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 964)
+++ trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 976)
@@ -195,7 +195,5 @@
   Bool*                    m_layerInitilizedFlag; // initialization Layers
   static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets 
-#if  H_MV_HLS_8_HRD_Q0102_08
   Int                      m_targetOptLayerSetIdx; 
-#endif
 #else
   ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets 
@@ -234,5 +232,5 @@
   Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
 #endif
-#if H0056_EOS_CHECKS
+#if H_MV
   Bool                    m_isLastNALWasEos;
 #endif
@@ -271,7 +269,5 @@
   Void  deletePicBuffer();
 #if H_MV
-#if H_MV_HLS_7_VPS_P0300_27
   TComVPS* getActiveVPS() { return m_parameterSetManagerDecoder.getActiveVPS( ); }
-#endif
   TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS( m_layerId ); }
 #else
@@ -296,7 +292,5 @@
   Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
   Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
-#if  H_MV_HLS_8_HRD_Q0102_08
   Void                    setTargetOptLayerSetIdx( Int targetOptLayerSetIdx ) { m_targetOptLayerSetIdx = targetOptLayerSetIdx; }    
-#endif
   TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present. 
   Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
