Index: trunk/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/SEIread.cpp	(revision 547)
+++ trunk/source/Lib/TLibDecoder/SEIread.cpp	(revision 588)
@@ -93,6 +93,6 @@
     fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");
     break;
-#if M0043_LAYERS_PRESENT_SEI
-  case SEI::LAYERS_PRESENT:
+#if LAYERS_NOT_PRESENT_SEI
+  case SEI::LAYERS_NOT_PRESENT:
     fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
     break;
@@ -106,4 +106,9 @@
     break;
 #endif
+#if SUB_BITSTREAM_PROPERTY_SEI
+    case SEI::SUB_BITSTREAM_PROPERTY:
+      fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
+      break;
+#endif
   case SEI::SCALABLE_NESTING:
     fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
@@ -119,5 +124,5 @@
  * unmarshal a single SEI message from bitstream bs
  */
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
 #else
@@ -130,5 +135,5 @@
   do
   {
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
     xReadSEImessage(seis, nalUnitType, vps, sps);
 #else
@@ -145,5 +150,5 @@
 }
 
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
 #else
@@ -254,14 +259,14 @@
       xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);
       break;
-#if M0043_LAYERS_PRESENT_SEI
-    case SEI::LAYERS_PRESENT:
+#if LAYERS_NOT_PRESENT_SEI
+    case SEI::LAYERS_NOT_PRESENT:
       if (!vps)
       {
-        printf ("Warning: Found Layers present SEI message, but no active VPS is available. Ignoring.");
+        printf ("Warning: Found Layers not present SEI message, but no active VPS is available. Ignoring.");
       }
       else
       {
-        sei = new SEILayersPresent;
-        xParseSEILayersPresent((SEILayersPresent&) *sei, payloadSize, vps);
+        sei = new SEILayersNotPresent;
+        xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, vps);
       }
       break;
@@ -277,7 +282,13 @@
       break;
 #endif
+#if SUB_BITSTREAM_PROPERTY_SEI
+   case SEI::SUB_BITSTREAM_PROPERTY:
+     sei = new SEISubBitstreamProperty;
+     xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei);
+     break;
+#endif
     case SEI::SCALABLE_NESTING:
       sei = new SEIScalableNesting;
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
       xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps);
 #else
@@ -741,6 +752,6 @@
 }
 
-#if M0043_LAYERS_PRESENT_SEI
-Void SEIReader::xParseSEILayersPresent(SEILayersPresent &sei, UInt payloadSize, TComVPS *vps)
+#if LAYERS_NOT_PRESENT_SEI
+Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps)
 {
   UInt uiCode;
@@ -752,9 +763,9 @@
   for (; i < sei.m_vpsMaxLayers; i++)
   {
-    READ_FLAG( uiCode,         "layer_present_flag"   ); sei.m_layerPresentFlag[i] = uiCode ? true : false;
+    READ_FLAG( uiCode,         "layer_not_present_flag"   ); sei.m_layerNotPresentFlag[i] = uiCode ? true : false;
   }
   for (; i < MAX_LAYERS; i++)
   {
-    sei.m_layerPresentFlag[i] = false;
+    sei.m_layerNotPresentFlag[i] = false;
   }
   xParseByteAlign();
@@ -829,6 +840,23 @@
 }
 #endif
-
-#if M0043_LAYERS_PRESENT_SEI
+#if SUB_BITSTREAM_PROPERTY_SEI
+Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei)
+{
+  UInt uiCode;
+  READ_CODE( 4, uiCode, "active_vps_id" );                      sei.m_activeVpsId = uiCode;
+  READ_UVLC(    uiCode, "num_additional_sub_streams_minus1" );  sei.m_numAdditionalSubStreams = uiCode + 1;
+
+  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
+  {
+    READ_CODE(  2, uiCode, "sub_bitstream_mode[i]"           ); sei.m_subBitstreamMode[i] = uiCode;
+    READ_UVLC(     uiCode, "output_layer_set_idx_to_vps[i]"  ); sei.m_outputLayerSetIdxToVps[i] = uiCode;
+    READ_CODE(  3, uiCode, "highest_sub_layer_id[i]"         ); sei.m_highestSublayerId[i] = uiCode;
+    READ_CODE( 16, uiCode, "avg_bit_rate[i]"                 ); sei.m_avgBitRate[i] = uiCode;
+    READ_CODE( 16, uiCode, "max_bit_rate[i]"                 ); sei.m_maxBitRate[i] = uiCode;
+  }
+  xParseByteAlign();
+}
+#endif
+#if LAYERS_NOT_PRESENT_SEI
 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps)
 #else
@@ -876,5 +904,5 @@
   // read nested SEI messages
   do {
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
     xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps);
 #else
Index: trunk/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- trunk/source/Lib/TLibDecoder/SEIread.h	(revision 547)
+++ trunk/source/Lib/TLibDecoder/SEIread.h	(revision 588)
@@ -56,5 +56,5 @@
   SEIReader() {};
   virtual ~SEIReader() {};
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
   Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
 #else
@@ -62,5 +62,5 @@
 #endif
 protected:
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
   Void xReadSEImessage                (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
 #else
@@ -83,6 +83,9 @@
   Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize);
 #endif
-#if M0043_LAYERS_PRESENT_SEI
-  Void xParseSEILayersPresent         (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps);
+#if SUB_BITSTREAM_PROPERTY_SEI
+Void   xParseSEISubBitstreamProperty   (SEISubBitstreamProperty &sei);
+#endif
+#if LAYERS_NOT_PRESENT_SEI
+  Void xParseSEILayersNotPresent      (SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps);
   Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps);
 #else
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 547)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 588)
@@ -756,13 +756,4 @@
   }
   READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" );            pcSPS->setTMVPFlagsPresent(uiCode);
-#if REF_IDX_MFM
-#if !M0457_COL_PICTURE_SIGNALING
-  if(pcSPS->getLayerId() > 0)
-  {
-    READ_FLAG( uiCode, "sps_enh_mfm_enable_flag" );
-    pcSPS->setMFMEnabledFlag( uiCode ? true : false );
-  }
-#endif
-#endif
   READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" );  pcSPS->setUseStrongIntraSmoothing(uiCode);
 
@@ -815,9 +806,8 @@
   // more syntax elements to be parsed here
 
-#if VERT_MV_CONSTRAINT
   READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );
   // Vertical MV component restriction is not used in SHVC CTC
   assert( uiCode == 0 );
-#endif
+
   if( pcSPS->getLayerId() > 0 )
   {
@@ -836,24 +826,4 @@
     }
   }
-#if M0463_VUI_EXT_ILP_REF
-  ////   sps_extension_vui_parameters( )
-  if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
-  {
-    READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );
-    for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
-    {
-      READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );
-      if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
-      {
-        READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );
-        if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )
-        {
-          READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );
-        }
-      }
-    }
-  }
-  ////   sps_extension_vui_parameters( ) END
-#endif
 }
 #endif
@@ -877,6 +847,10 @@
   READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
   assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
+#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
 #if VPS_EXTN_OFFSET
   READ_CODE( 16, uiCode,  "vps_extension_offset" );               pcVPS->setExtensionOffset( uiCode );
+#else
+  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
+#endif
 #else
   READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
@@ -995,4 +969,5 @@
   READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
 
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if O0109_MOVE_VPS_VUI_FLAG
   READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
@@ -1005,4 +980,5 @@
 #if O0109_MOVE_VPS_VUI_FLAG
   }
+#endif
 #endif
   READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
@@ -1122,5 +1098,4 @@
     }
 #endif
-#if JCTVC_M0203_INTERLAYER_PRED_IDC
 #if N0120_MAX_TID_REF_PRESENT_FLAG
   READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false);
@@ -1180,5 +1155,4 @@
   }
 #endif
-#endif
 #if ILP_SSH_SIG
     READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false);
@@ -1186,6 +1160,10 @@
 #if VPS_EXTN_PROFILE_INFO
   // Profile-tier-level signalling
+#if !VPS_EXTN_UEV_CODING
   READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" );     assert( uiCode == (vps->getNumLayerSets() - 1) );
   READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
+#else
+  READ_UVLC(  uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
+#endif
   vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
   for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
@@ -1194,4 +1172,8 @@
     if( !vps->getProfilePresentFlag(idx) )
     {
+#if P0048_REMOVE_PROFILE_REF
+      // Copy profile information from previous one
+      vps->getPTLForExtn(idx)->copyProfileInfo( (idx==1) ? vps->getPTL() : vps->getPTLForExtn( idx - 1 ) );
+#else
       READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
 #if O0109_PROF_REF_MINUS1
@@ -1202,4 +1184,5 @@
       // Copy profile information as indicated
       vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) );
+#endif
     }
     parsePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
@@ -1207,4 +1190,5 @@
 #endif
 
+#if !VPS_EXTN_UEV_CODING
   READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false );
   Int numOutputLayerSets = 0;
@@ -1218,4 +1202,67 @@
     numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
   }
+#else
+  READ_UVLC( uiCode, "num_add_output_layer_sets" );          vps->setNumAddOutputLayerSets( uiCode );
+  Int numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
+#endif
+
+#if P0295_DEFAULT_OUT_LAYER_IDC
+  if( numOutputLayerSets > 1 )
+  {
+    READ_CODE( 2, uiCode, "default_target_output_layer_idc" );   vps->setDefaultTargetOutputLayerIdc( uiCode );
+  }
+  vps->setNumOutputLayerSets( numOutputLayerSets );
+
+  for(i = 1; i < numOutputLayerSets; i++)
+  {
+    if( i > (vps->getNumLayerSets() - 1) )
+    {
+      Int numBits = 1;
+      while ((1 << numBits) < (vps->getNumLayerSets() - 1))
+      {
+        numBits++;
+      }
+      READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1");   vps->setOutputLayerSetIdx( i, uiCode + 1);
+    }
+    else
+    {
+      vps->setOutputLayerSetIdx( i, i );
+    }
+    if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
+    {
+      Int lsIdx = vps->getOutputLayerSetIdx(i);
+      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
+      {
+        READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode);
+      }
+    }
+    else
+    {
+      // i <= (vps->getNumLayerSets() - 1)
+      // Assign OutputLayerFlag depending on default_one_target_output_layer_flag
+      Int lsIdx = i;
+      if( vps->getDefaultTargetOutputLayerIdc() == 1 )
+      {
+        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
+        {
+          vps->setOutputLayerFlag(i, j, (j == (vps->getNumLayersInIdList(lsIdx)-1)) && (vps->getDimensionId(j,1) == 0) );
+        }
+      }
+      else if ( vps->getDefaultTargetOutputLayerIdc() == 0 )
+      {
+        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
+        {
+          vps->setOutputLayerFlag(i, j, 1);
+        }
+      }
+    }
+    Int numBits = 1;
+    while ((1 << numBits) < (vps->getNumProfileTierLevel()))
+    {
+      numBits++;
+    }
+    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
+  }
+#else
   if( numOutputLayerSets > 1 )
   {
@@ -1299,4 +1346,5 @@
     READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
   }
+#endif
 
 #if O0153_ALT_OUTPUT_LAYER_FLAG
@@ -1315,5 +1363,9 @@
   {
 #if O0096_REP_FORMAT_INDEX
+#if !VPS_EXTN_UEV_CODING
     READ_CODE( 8, uiCode, "vps_num_rep_formats_minus1" );
+#else
+    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" );
+#endif
 #else
     READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" );
@@ -1342,5 +1394,14 @@
       {
 #if O0096_REP_FORMAT_INDEX
+#if !VPS_EXTN_UEV_CODING
         READ_CODE( 8, uiCode, "vps_rep_format_idx[i]" );
+#else
+        Int numBits = 1;
+        while ((1 << numBits) < (vps->getVpsNumRepFormats()))
+        {
+          numBits++;
+        }
+        READ_CODE( numBits, uiCode, "vps_rep_format_idx[i]" );
+#endif
 #else
         READ_CODE( 4, uiCode, "vps_rep_format_idx[i]" );
@@ -1364,8 +1425,9 @@
   }
 #endif
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
+#if RESOLUTION_BASED_DPB
+  vps->assignSubDpbIndices();
+#endif
   READ_FLAG(uiCode, "max_one_active_ref_layer_flag" );
   vps->setMaxOneActiveRefLayerFlag(uiCode);
-#endif
 #if O0062_POC_LSB_NOT_PRESENT_FLAG
   for(i = 1; i< vps->getMaxLayers(); i++)
@@ -1388,38 +1450,8 @@
 
 #if VPS_DPB_SIZE_TABLE
-  vps->deriveNumberOfSubDpbs();
-  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
-  {
-    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
-    for(j = 0; j < vps->getMaxTLayers(); j++)
-    {
-      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
-      {
-        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
-      }
-      else
-      {
-        if( j == 0 )  // Always signal for the first sub-layer
-        {
-          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
-        }
-        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
-        {
-          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
-        }
-      }
-      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
-      {
-        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
-        {
-          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
-        }
-        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
-        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
-      }
-    }
-  }
-#endif
-#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
+  parseVpsDpbSizeTable(vps);
+#endif
+
+#if VPS_EXTN_DIRECT_REF_LAYERS
   READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
 #if O0096_DEFAULT_DEPENDENCY_TYPE
@@ -1470,4 +1502,12 @@
 #endif
 
+#if P0307_VPS_NON_VUI_EXTENSION
+  READ_UVLC( uiCode,           "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode);
+  if ( vps->getVpsNonVuiExtLength() > 0 )
+  {
+    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
+  }
+#endif
+
 #if !O0109_O0199_FLAGS_TO_VUI
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
@@ -1477,4 +1517,8 @@
   READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
 #endif
+#endif
+
+#if P0307_REMOVE_VPS_VUI_OFFSET
+  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
 #endif
 
@@ -1540,4 +1584,67 @@
   READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" );         repFormat->setBitDepthVpsChroma( uiCode + 8 );
 #endif 
+}
+#endif
+#if VPS_DPB_SIZE_TABLE
+Void TDecCavlc::parseVpsDpbSizeTable( TComVPS *vps )
+{
+  UInt uiCode;
+#if !RESOLUTION_BASED_DPB
+  vps->deriveNumberOfSubDpbs();
+#endif
+  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
+  {
+#if CHANGE_NUMSUBDPB_IDX
+    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
+#endif
+    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
+    for(Int j = 0; j < vps->getMaxTLayers(); j++)
+    {
+      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
+      {
+        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
+      }
+      else
+      {
+        if( j == 0 )  // Always signal for the first sub-layer
+        {
+          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
+        }
+        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
+        {
+          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
+        }
+      }
+      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
+      {
+#if CHANGE_NUMSUBDPB_IDX
+        for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
+#else
+        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
+#endif
+        {
+          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
+        }
+        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
+#if RESOLUTION_BASED_DPB
+        if( vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) != vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ) )  
+        {
+          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
+          {
+            READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1[i][k][j]" ); vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode);
+          }
+        }
+        else  // vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) == vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet )
+        {          
+          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
+          {
+            vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j));
+          }
+        }
+#endif
+        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
+      }
+    }
+  }
 }
 #endif
@@ -1614,4 +1721,46 @@
   }
 #endif
+#if VPS_VUI_VIDEO_SIGNAL_MOVE
+  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 );
+  if (vps->getVideoSigPresentVpsFlag())
+  {
+    READ_CODE(4, uiCode, "vps_num_video_signal_info_minus1" ); vps->setNumVideoSignalInfo(uiCode + 1);
+  }
+  else
+  {
+    vps->setNumVideoSignalInfo(vps->getMaxLayers());
+  }
+
+
+  for(i = 0; i < vps->getNumVideoSignalInfo(); i++)
+  {
+    READ_CODE(3, uiCode, "video_vps_format" ); vps->setVideoVPSFormat(i,uiCode);
+    READ_FLAG(uiCode, "video_full_range_vps_flag" ); vps->setVideoFullRangeVpsFlag(i,uiCode);
+    READ_CODE(8, uiCode, "color_primaries_vps" ); vps->setColorPrimaries(i,uiCode);
+    READ_CODE(8, uiCode, "transfer_characteristics_vps" ); vps->setTransCharacter(i,uiCode);
+    READ_CODE(8, uiCode, "matrix_coeffs_vps" );vps->setMaxtrixCoeff(i,uiCode);
+  }
+  if(!vps->getVideoSigPresentVpsFlag())
+  {
+    for (i=0; i < vps->getMaxLayers(); i++)
+    {
+      vps->setVideoSignalInfoIdx(i,i);
+    }
+  }
+  else {
+    vps->setVideoSignalInfoIdx(0,0);
+    if (vps->getNumVideoSignalInfo() > 1 )
+    {
+      for (i=1; i < vps->getMaxLayers(); i++)
+        READ_CODE(4, uiCode, "vps_video_signal_info_idx" ); vps->setVideoSignalInfoIdx(i, uiCode);
+    }
+    else {
+      for (i=1; i < vps->getMaxLayers(); i++)
+      {
+        vps->setVideoSignalInfoIdx(i,0);
+      }
+    }
+  }
+#endif 
 #if VPS_VUI_TILES_NOT_IN_USE__FLAG
   UInt layerIdx;
@@ -1672,6 +1821,6 @@
 
 #if N0160_VUI_EXT_ILP_REF
-    READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 );
-  if( vps->getNumIlpRestrictedRefLayers())
+  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); vps->setIlpRestrictedRefLayersFlag( uiCode == 1 );
+  if( vps->getIlpRestrictedRefLayersFlag())
   {
     for(i = 1; i < vps->getMaxLayers(); i++)
@@ -1693,4 +1842,6 @@
 #endif
 #if VPS_VUI_VIDEO_SIGNAL
+#if VPS_VUI_VIDEO_SIGNAL_MOVE
+#else
     READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 );
     if (vps->getVideoSigPresentVpsFlag())
@@ -1733,4 +1884,5 @@
         }
     }
+#endif 
 #endif
 }
@@ -1820,5 +1972,9 @@
     if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
     {
+#if DISCARDABLE_PIC_RPS
+      READ_FLAG(uiCode, "discardable_flag"); rpcSlice->setDiscardableFlag( uiCode ? true : false );
+#else
       READ_FLAG(uiCode, "discardable_flag"); // ignored
+#endif
       iBits++;
     }
@@ -2064,5 +2220,4 @@
 
 #if SVC_EXTENSION
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
     rpcSlice->setActiveNumILRRefIdx(0);
 #if ILP_SSH_SIG
@@ -2094,5 +2249,21 @@
           else
           {
+#if P0079_DERIVE_NUMACTIVE_REF_PICS
+            Int   numRefLayerPics = 0;
+            Int   i = 0;
+            Int   refLayerPicIdc  [MAX_VPS_LAYER_ID_PLUS1];
+            for(i = 0, numRefLayerPics = 0;  i < rpcSlice->getNumILRRefIdx(); i++ ) 
+            {
+              if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) >  rpcSlice->getTLayer() &&
+                (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >=  rpcSlice->getTLayer()) )
+              {          
+                refLayerPicIdc[ numRefLayerPics++ ] = i;
+              }
+            }
+            if (numRefLayerPics)
+              rpcSlice->setActiveNumILRRefIdx(1);
+#else
             rpcSlice->setActiveNumILRRefIdx(1);
+#endif 
           }
 #if ILP_NUM_REF_CHK
@@ -2166,18 +2337,4 @@
     }
 #endif
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-    rpcSlice->setInterLayerSamplePredOnlyFlag( false );
-    if( rpcSlice->getNumSamplePredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 )
-    {
-      READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" );
-      rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode > 0 );
-    }
-#endif
-#else
-    if( rpcSlice->getLayerId() > 0 )
-    {
-      rpcSlice->setNumILRRefIdx( rpcSlice->getVPS()->getNumDirectRefLayers( rpcSlice->getLayerId() ) );
-    }
-#endif
 #endif
 
@@ -2357,25 +2514,7 @@
     if ( rpcSlice->getEnableTMVPFlag() )
     {
-#if M0457_COL_PICTURE_SIGNALING
-#if REMOVE_COL_PICTURE_SIGNALING
+#if SVC_EXTENSION && REF_IDX_MFM
+      // set motion mapping flag
       rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() ) ? true : false );
-#else
-      rpcSlice->setMFMEnabledFlag( false );
-      rpcSlice->setColRefLayerIdx( 0 );
-      rpcSlice->setAltColIndicationFlag( false );
-      if ( sps->getLayerId() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 && rpcSlice->getNumMotionPredRefLayers() > 0 )
-      {
-        READ_FLAG( uiCode, "alt_collocated_indication_flag" );
-        rpcSlice->setAltColIndicationFlag( uiCode == 1 ? true : false );
-        rpcSlice->setMFMEnabledFlag( uiCode == 1 ? true : false );
-        if ( rpcSlice->getNumMotionPredRefLayers() > 1 )
-        {
-          READ_UVLC( uiCode, "collocated_ref_layer_idx" );
-          rpcSlice->setColRefLayerIdx( uiCode );
-        }
-      }
-      else
-      {
-#endif //REMOVE_COL_PICTURE_SIGNALING
 #endif
       if ( rpcSlice->getSliceType() == B_SLICE )
@@ -2400,7 +2539,4 @@
         rpcSlice->setColRefIdx(0);
       }
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-      }
-#endif
     }
     if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) )
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 547)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 588)
@@ -83,4 +83,7 @@
   Void  parseRepFormat      ( RepFormat *repFormat );
 #endif
+#if VPS_DPB_SIZE_TABLE
+  Void  parseVpsDpbSizeTable( TComVPS *vps );
+#endif
   Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager );
   Void  parseSPSExtension    ( TComSPS* pcSPS );
Index: trunk/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecGop.cpp	(revision 547)
+++ trunk/source/Lib/TLibDecoder/TDecGop.cpp	(revision 588)
@@ -234,8 +234,9 @@
   //-- For time output for each slice
 #if SVC_EXTENSION
-  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
+  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP%3d ) ", pcSlice->getPOC(),
                                                     rpcPic->getLayerId(),
                                                     pcSlice->getTLayer(),
                                                     c,
+                                                    NaluToStr( pcSlice->getNalUnitType() ).data(),
                                                     pcSlice->getSliceQp() );
 #else
Index: trunk/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 547)
+++ trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 588)
@@ -86,4 +86,7 @@
   m_bRefreshPending            = false;
 #endif
+#if RESOLUTION_BASED_DPB
+  m_subDpbIdx = -1;
+#endif
 }
 
@@ -178,5 +181,5 @@
     {
 #if USE_DPB_SIZE_TABLE
-      if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
+      if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
       {
         assert( this->getLayerId() == 0 );
@@ -187,5 +190,5 @@
         TComVPS *vps = slice->getVPS();
         // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
-        numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
+        numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
       }
 #else
@@ -196,5 +199,5 @@
     if (m_cIlpPic[0] == NULL)
     {
-      for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++)  // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
+      for (Int j=0; j < m_numDirectRefLayers; j++)
       {
 
@@ -282,5 +285,5 @@
   {
 #if USE_DPB_SIZE_TABLE
-    if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
+    if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
     {
       assert( this->getLayerId() == 0 );
@@ -291,5 +294,5 @@
       TComVPS *vps = pcSlice->getVPS();
       // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
-      numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
+      numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
     }
 #else
@@ -299,5 +302,5 @@
 
 #if USE_DPB_SIZE_TABLE
-  if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
+  if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
   {
     assert( this->getLayerId() == 0 );
@@ -306,5 +309,11 @@
   else
   {
-    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+#if RESOLUTION_BASED_DPB
+    Int layerSetIdxForOutputLayerSet = pcSlice->getVPS()->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
+    Int layerIdx = pcSlice->getVPS()->findLayerIdxInLayerSet( layerSetIdxForOutputLayerSet, pcSlice->getLayerId() );  assert( layerIdx != -1 );
+    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), layerIdx, pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+#else
+    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+#endif
   }
 #else
@@ -815,5 +824,9 @@
 #if OUTPUT_LAYER_SET_INDEX
   // Following check should go wherever the VPS is activated
-  checkValueOfOutputLayerSetIdx( m_apcSlicePilot->getVPS());
+  checkValueOfTargetOutputLayerSetIdx( m_apcSlicePilot->getVPS());
+#endif
+#if RESOLUTION_BASED_DPB
+  // Following assignment should go wherever a new VPS is activated
+  assignSubDpbs(m_apcSlicePilot->getVPS());
 #endif
   m_apcSlicePilot->initSlice( nalu.m_layerId );
@@ -845,13 +858,8 @@
 #if SVC_EXTENSION
   m_apcSlicePilot->setSliceIdx( m_uiSliceIdx ); // it should be removed if HM will reflect it in above
-#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
+#if VPS_EXTN_DIRECT_REF_LAYERS
   setRefLayerParams(m_apcSlicePilot->getVPS());
 #endif
-#if M0457_COL_PICTURE_SIGNALING
   m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers);
-#endif
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-  m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() );
-#endif
 #endif
   m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
@@ -1478,14 +1486,7 @@
 
 #if REF_IDX_MFM
-#if M0457_COL_PICTURE_SIGNALING
       if( pcSlice->getMFMEnabledFlag() )
-#else
-      if( pcSlice->getSPS()->getMFMEnabledFlag() )
-#endif
       {
         pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-        pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
-#endif
       }
       pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic);
@@ -1668,5 +1669,5 @@
     }
 #endif
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
 #else
@@ -1676,5 +1677,5 @@
   else
   {
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
 #else
@@ -1696,5 +1697,5 @@
   if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
   {
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
 #else
@@ -1704,5 +1705,5 @@
   else
   {
-#if M0043_LAYERS_PRESENT_SEI
+#if LAYERS_NOT_PRESENT_SEI
     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
 #else
@@ -1865,4 +1866,11 @@
       
     case NAL_UNIT_EOB:
+#if P0130_EOB
+      //Check layer id of the nalu. if it is not 0, give a warning message.
+      if (nalu.m_layerId > 0)
+      {
+        printf( "\n\nThis bitstream is ended with EOB NALU that has layer id greater than 0\n" );
+      }
+#endif
       return false;
       
@@ -1959,5 +1967,5 @@
 #endif
 
-#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
+#if VPS_EXTN_DIRECT_REF_LAYERS
 
 Void TDecTop::setRefLayerParams( TComVPS* vps )
@@ -2013,41 +2021,16 @@
 #endif
 
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-TComPic* TDecTop::getMotionPredIlp(TComSlice* pcSlice)
-{
-  TComPic* ilpPic = NULL;
-  Int activeMotionPredReflayerIdx = 0;
-
-  for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
-  {
-    UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
-    if( getMotionPredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) ) )
-    {
-      if (activeMotionPredReflayerIdx == pcSlice->getColRefLayerIdx())
-      {
-        ilpPic = m_cIlpPic[refLayerIdc];
-        break;
-      }
-      else
-      {
-        activeMotionPredReflayerIdx++;
-      }
-    }
-  }
-
-  assert(ilpPic != NULL);
-
-  return ilpPic;
-}
-#endif
 #if OUTPUT_LAYER_SET_INDEX
-Void TDecTop::checkValueOfOutputLayerSetIdx(TComVPS *vps)
+Void TDecTop::checkValueOfTargetOutputLayerSetIdx(TComVPS *vps)
 {
   CommonDecoderParams* params = this->getCommonDecoderParams();
+
+  assert( params->getTargetLayerId() < vps->getMaxLayers() );
+
   if( params->getValueCheckedFlag() )
   {
     return; // Already checked
   }
-  if( params->getOutputLayerSetIdx() == -1 )  // Output layer set index not specified
+  if( params->getTargetOutputLayerSetIdx() == -1 )  // Output layer set index not specified
   {
     Bool layerSetMatchFound = false;
@@ -2096,5 +2079,5 @@
           // Match found
           layerSetMatchFound = true;
-          params->setOutputLayerSetIdx( i );
+          params->setTargetOutputLayerSetIdx( i );
           params->setValueCheckedFlag( true );
           break;
@@ -2107,5 +2090,6 @@
   {
     // Check if the target decoded layer is the highest layer in the list
-    Int layerSetIdx = vps->getOutputLayerSetIdx( params->getOutputLayerSetIdx() );  // Index to the layer set
+    assert( params->getTargetOutputLayerSetIdx() < vps->getNumLayerSets() );
+    Int layerSetIdx = vps->getOutputLayerSetIdx( params->getTargetOutputLayerSetIdx() );  // Index to the layer set
     assert( params->getTargetLayerId() == vps->getNumLayersInIdList( layerSetIdx ) - 1);
 
@@ -2138,3 +2122,18 @@
 }
 #endif
+#if RESOLUTION_BASED_DPB
+Void TDecTop::assignSubDpbs(TComVPS *vps)
+{
+  if( m_subDpbIdx == -1 ) // Sub-DPB index is not already assigned
+  {
+    Int lsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
+
+    Int layerIdx = vps->findLayerIdxInLayerSet( lsIdx, getLayerId() );
+    assert( layerIdx != -1 ); // Current layer should be found in the layer set.
+
+    // Copy from the active VPS based on the layer ID.
+    m_subDpbIdx = vps->getSubDpbAssigned( lsIdx, layerIdx );
+  }
+}
+#endif
 //! \}
Index: trunk/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 547)
+++ trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 588)
@@ -117,5 +117,5 @@
   Int                     m_iBLSourceHeight;  
 #endif
-#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
+#if VPS_EXTN_DIRECT_REF_LAYERS
   Int                     m_numDirectRefLayers;
   Int                     m_refLayerId[MAX_VPS_LAYER_ID_PLUS1];
@@ -144,5 +144,8 @@
   Bool                   m_bRefreshPending;
 #endif
-
+#if RESOLUTION_BASED_DPB
+  Int                    m_subDpbIdx;     // Index to the sub-DPB that the layer belongs to.
+                                          // When new VPS is activated, this should be re-initialized to -1
+#endif
 public:
   TDecTop();
@@ -177,5 +180,4 @@
 #if VPS_EXTN_DIRECT_REF_LAYERS
   TDecTop*  getRefLayerDec(UInt refLayerIdc);
-#if M0457_PREDICTION_INDICATIONS
   Int       getNumDirectRefLayers           ()                              { return m_numDirectRefLayers;      }
   Void      setNumDirectRefLayers           (Int num)                       { m_numDirectRefLayers = num;       }
@@ -206,5 +208,4 @@
 
   Void      setRefLayerParams( TComVPS* vps );
-#endif
 #endif
 #if AVC_BASE
@@ -244,7 +245,4 @@
   Void      xDecodePPS();
   Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-  TComPic*  getMotionPredIlp(TComSlice* pcSlice);
-#endif
 
 #if NO_CLRAS_OUTPUT_FLAG
@@ -262,9 +260,14 @@
   CommonDecoderParams*    getCommonDecoderParams() { return m_commonDecoderParams; }
   Void                    setCommonDecoderParams(CommonDecoderParams* x) { m_commonDecoderParams = x; }
-  Void      checkValueOfOutputLayerSetIdx(TComVPS *vps);
+  Void      checkValueOfTargetOutputLayerSetIdx(TComVPS *vps);
 #endif
 #if SCALINGLIST_INFERRING
   ParameterSetManagerDecoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; }
 #endif
+#if RESOLUTION_BASED_DPB
+  Void setSubDpbIdx(Int idx)    { m_subDpbIdx = idx; }
+  Int  getSubDpbIdx()           { return m_subDpbIdx; }
+  Void assignSubDpbs(TComVPS *vps);
+#endif
 };// END CLASS DEFINITION TDecTop
 
