Index: branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 971)
+++ branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 972)
@@ -1071,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 ); 
@@ -1160,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() )
@@ -1201,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 );
@@ -1323,5 +1320,4 @@
   }
 
-#if H_MV_HLS_8_SYN_39_19
   if ( pcVPS->getNumIndependentLayers() > 1 ) 
   {
@@ -1343,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 )); 
@@ -1359,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 ); 
@@ -1394,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++ )
@@ -1413,36 +1389,18 @@
   }
 
-#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 ) );
@@ -1474,13 +1432,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) )
@@ -1568,15 +1520,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( ) )
@@ -1638,9 +1582,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 );
@@ -1650,9 +1590,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++ )
@@ -1685,8 +1621,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 )
@@ -1698,7 +1632,5 @@
             }
           }
-#if H_MV_HLS_8_SYN_Q0041_03
-        }
-#endif
+        }
       }
     }
@@ -1747,20 +1679,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
       }
     }
@@ -1770,21 +1689,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
         }  
       }
@@ -1811,13 +1720,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 )  )  
@@ -1827,9 +1730,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 );
@@ -1842,9 +1741,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 ) );
@@ -1857,5 +1752,4 @@
   }  
 }
-#endif
 
 #if H_3D
Index: branches/HTM-11.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-11.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 971)
+++ branches/HTM-11.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 972)
@@ -277,9 +277,5 @@
         pcPPS->getLayerId() != 1  )
     {
-#if H_MV_HLS_8_SPS_NODOC_48
       pcPPS->setPps3dExtensionFlag( false ); 
-#else
-      pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false );
-#endif
     }
   #endif
@@ -290,5 +286,4 @@
   WRITE_FLAG( 1, "pps_extension_present_flag" );
 
-#if H_MV_HLS_8_SPS_NODOC_48
     WRITE_FLAG( pcPPS->getPpsRangeExtensionsFlag( ) ? 1 : 0 , "pps_range_extensions_flag" );
     WRITE_FLAG( pcPPS->getPpsMultilayerExtensionFlag( ) ? 1 : 0 , "pps_multilayer_extension_flag" );
@@ -307,7 +302,5 @@
     { 
       WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
-#if H_MV_HLS_8_PPS_NODOC_NN
       WRITE_FLAG( 0, "pps_extension_reserved_zero_flag" );
-#endif
     }
 
@@ -318,28 +311,4 @@
     }
 #endif
-#else
-  for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
-  {
-    WRITE_FLAG( pcPPS->getPpsExtensionTypeFlag( i ) ? 1 : 0 , "pps_extension_type_flag" );
-#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 ) )
-  {
-    WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
-  }
-
-#if H_3D
-  if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC
-  {
-    codePPSExtension( pcPPS ); 
-  }
-#endif
-#endif
-
 #endif
 
@@ -861,5 +830,4 @@
   if ( pcSPS->getSpsExtensionPresentFlag() )
   {
-#if H_MV_HLS_8_SPS_NODOC_48
     WRITE_FLAG( pcSPS->getSpsRangeExtensionsFlag( ) ? 1 : 0 , "sps_range_extensions_flag" );
     WRITE_FLAG( pcSPS->getSpsMultilayerExtensionFlag( ) ? 1 : 0 , "sps_multilayer_extension_flag" );
@@ -869,5 +837,4 @@
     WRITE_FLAG( pcSPS->getSps3dExtensionFlag( ) ? 1 : 0 , "sps_3d_extension_flag" );
     WRITE_CODE( pcSPS->getSpsExtension5bits( ), 5, "sps_extension_5bits" );
-#endif
  }
 
@@ -889,27 +856,4 @@
 
 #endif
-#else
-    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
-    {
-      WRITE_FLAG( pcSPS->getSpsExtensionTypeFlag( i ) ? 1 : 0 , "sps_extension_type_flag" );
-#if H_3D
-      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D ); 
-#else
-      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV ); 
-#endif
-    }  
-
-    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
-    {
-      codeSPSExtension( pcSPS ); 
-    }
-
-#if H_3D
-    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
-    {
-      codeSPSExtension2( pcSPS, viewIndex, depthFlag ); 
-    }
-#endif
-  }
 #endif
 #endif
@@ -955,5 +899,5 @@
 {
   WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
-#if H_MV_HLS_8_SYN_Q0041_03
+#if H_MV
   WRITE_FLAG( pcVPS->getVpsBaseLayerInternalFlag( ) ? 1 : 0 , "vps_base_layer_internal_flag" );
   WRITE_FLAG( 1                                             , "vps_reserved_one_bit" );
@@ -1042,9 +986,5 @@
   }
 #if H_MV
-#if H_MV_HLS_8_RPS_Q0100_36
   WRITE_FLAG( pcVPS->getVpsExtensionFlag(),                     "vps_extension_flag" );
-#else
-  WRITE_FLAG( 1,                     "vps_extension_flag" );
-#endif
   m_pcBitIf->writeAlignOne();
   codeVPSExtension( pcVPS );                           
@@ -1069,10 +1009,5 @@
 #if H_MV
 Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS ) 
-{
-  
-#if !H_MV_HLS_8_SYN_Q0041_03
-  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
-#endif
-
+{  
   WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
 
@@ -1187,5 +1122,4 @@
   }
 
-#if H_MV_HLS_8_SYN_39_19
   if ( pcVPS->getNumIndependentLayers() > 1 ) 
   {
@@ -1204,12 +1138,4 @@
     WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" );
   }
-#else
-  WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
-
-  if( pcVPS->getNumOutputLayerSets() > 1)
-  {
-    WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" );
-  }  
-#endif
 
   assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 
@@ -1221,9 +1147,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
     {      
       WRITE_UVLC( pcVPS->getLayerSetIdxForOlsMinus1( i ),      "layer_set_idx_for_ols_minus1[i]" );
@@ -1256,13 +1178,5 @@
   }
 
-#if !H_MV_HLS_8_PMS_Q0195_20
-  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
-  if ( pcVPS->getRepFormatIdxPresentFlag() )
-  {
-    WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
-  }
-#else
   WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
-#endif
 
   for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
@@ -1275,42 +1189,23 @@
   }
 
-#if H_MV_HLS_8_PMS_Q0195_20
   if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
   {
     WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
   }
-#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
+    {
         WRITE_CODE( pcVPS->getVpsRepFormatIdx(i), pcVPS->getVpsRepFormatIdxLen(), "vps_rep_format_idx[i]" );
-#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
     {
       assert( pcVPS->getVpsRepFormatIdx( i ) ==  pcVPS->inferVpsRepFormatIdx( i ) );
     }
   }
-#endif
-
 
   WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
@@ -1337,13 +1232,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) )
@@ -1366,5 +1255,5 @@
 
 
-WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
+  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
   if( pcVPS->getVpsVuiPresentFlag() )
   {
@@ -1397,13 +1286,7 @@
   for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
   {  
-#if H_MV_HLS_8_MIS_Q0102_30
     Int currLsIdx = vps->olsIdxToLsIdx( i ); 
-#endif
     WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
-#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 )  )  
@@ -1413,9 +1296,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
         {
           WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
@@ -1428,9 +1307,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
           {
             assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
@@ -1493,15 +1368,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( ) )
@@ -1563,9 +1430,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
     {
       WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" );
@@ -1575,9 +1438,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++ )
@@ -1610,20 +1469,16 @@
       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
-        WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
-        if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
-        {
-          WRITE_FLAG( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ? 1 : 0 , "ctu_based_offset_enabled_flag" );
-          if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
+          WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
+          if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
           {
-            WRITE_UVLC( pcVPSVUI->getMinHorizontalCtuOffsetPlus1( i, j ), "min_horizontal_ctu_offset_plus1" );
+            WRITE_FLAG( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ? 1 : 0 , "ctu_based_offset_enabled_flag" );
+            if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
+            {
+              WRITE_UVLC( pcVPSVUI->getMinHorizontalCtuOffsetPlus1( i, j ), "min_horizontal_ctu_offset_plus1" );
+            }
           }
         }
-#if H_MV_HLS_8_SYN_Q0041_03
-        }
-#endif
       }
     }
@@ -1673,20 +1528,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++ )  
       {
         WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
-#else
-      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ )  
-      {
-        if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
-        {
-          WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
-        }
-        else
-        {
-          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 
-        }
-#endif
       }
     }
@@ -1696,22 +1538,12 @@
     { 
       WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ), "num_bsp_sched_combinations_minus1" );
-#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
           WRITE_CODE( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ),  vpsVuiBspHrdP->getBspCombHrdIdxLen(), "bsp_comb_hrd_idx" ); 
-#else
-          WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" );
-#endif
           WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" );
 
-#if H_MV_HLS_8_HRD_Q0101_04
           vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j ); 
-#endif
         }  
       }
@@ -1907,7 +1739,5 @@
       Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
       WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb");
-#if H_MV_HLS_8_POC_Q0142_32
       pcSlice->setSlicePicOrderCntLsb( picOrderCntLSB ); 
-#endif
     }
 
@@ -2341,7 +2171,5 @@
     }
 
-#if H_MV_HLS_8_POC_Q0142_32
     pcSlice->checkPocResetIdc(); 
-#endif
 
     if( pcSlice->getPocResetIdc() !=  0 )
@@ -2355,7 +2183,5 @@
       WRITE_CODE( pcSlice->getPocLsbVal( ), pcSlice->getPocLsbValLen() , "poc_lsb_val" );
     }              
-#if H_MV_HLS_8_POC_Q0142_32
     pcSlice->checkPocLsbVal(); 
-#endif
 
     if( !pcSlice->getPocMsbValRequiredFlag() /* TODO &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
@@ -2363,10 +2189,8 @@
       WRITE_FLAG( pcSlice->getPocMsbValPresentFlag( ) ? 1 : 0 , "poc_msb_val_present_flag" );
     }
-#if H_MV_HLS_8_POC_Q0146_15
     else
     {
       assert( pcSlice->getPocMsbValPresentFlag() ==  pcSlice->inferPocMsbValPresentFlag( ) ); 
     }
-#endif
     
     if( pcSlice->getPocMsbValPresentFlag() )
