Index: trunk/source/Lib/TLibEncoder/NALwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 588)
@@ -91,4 +91,8 @@
   vector<uint8_t>& rbsp   = nalu.m_Bitstream.getFIFO();
 
+#if P0130_EOB
+  if (rbsp.size() == 0) return;
+#endif
+
   for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
   {
Index: trunk/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 588)
@@ -87,6 +87,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;
@@ -99,4 +99,9 @@
     fprintf( g_hTrace, "=========== Inter Layer Constrained Tile Sets SEI message ===========\n");
     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:
@@ -150,7 +155,7 @@
     xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
     break;
-#if M0043_LAYERS_PRESENT_SEI
-  case SEI::LAYERS_PRESENT:
-    xWriteSEILayersPresent(*static_cast<const SEILayersPresent*>(&sei));
+#if LAYERS_NOT_PRESENT_SEI
+  case SEI::LAYERS_NOT_PRESENT:
+    xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
     break;
 #endif
@@ -162,4 +167,9 @@
     xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
     break;
+#endif
+#if SUB_BITSTREAM_PROPERTY_SEI
+   case SEI::SUB_BITSTREAM_PROPERTY:
+     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
+     break;
 #endif
   case SEI::SCALABLE_NESTING:
@@ -536,11 +546,11 @@
 }
 
-#if M0043_LAYERS_PRESENT_SEI
-Void SEIWriter::xWriteSEILayersPresent(const SEILayersPresent& sei)
+#if LAYERS_NOT_PRESENT_SEI
+Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
 {
   WRITE_UVLC( sei.m_activeVpsId,           "lp_sei_active_vps_id" );
   for (UInt i = 0; i < sei.m_vpsMaxLayers; i++)
   {
-    WRITE_FLAG( sei.m_layerPresentFlag[i], "layer_present_flag"   );
+    WRITE_FLAG( sei.m_layerNotPresentFlag[i], "layer_not_present_flag"   );
   }
   xWriteByteAlign();
@@ -606,5 +616,22 @@
 }
 #endif
-
+#if SUB_BITSTREAM_PROPERTY_SEI
+Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
+{
+  WRITE_CODE( sei.m_activeVpsId, 4, "active_vps_id" );
+  assert( sei.m_numAdditionalSubStreams >= 1 );
+  WRITE_UVLC( sei.m_numAdditionalSubStreams - 1, "num_additional_sub_streams_minus1" );
+
+  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
+  {
+    WRITE_CODE( sei.m_subBitstreamMode[i],       2, "sub_bitstream_mode[i]"           );
+    WRITE_UVLC( sei.m_outputLayerSetIdxToVps[i],    "output_layer_set_idx_to_vps[i]"  );
+    WRITE_CODE( sei.m_highestSublayerId[i],      3, "highest_sub_layer_id[i]"         );
+    WRITE_CODE( sei.m_avgBitRate[i],            16, "avg_bit_rate[i]"                 );
+    WRITE_CODE( sei.m_maxBitRate[i],            16, "max_bit_rate[i]"                 );
+  }
+  xWriteByteAlign();
+}
+#endif
 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)
 {
Index: trunk/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 547)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 588)
@@ -64,10 +64,13 @@
   Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei);
   Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei);
-#if M0043_LAYERS_PRESENT_SEI
-  Void xWriteSEILayersPresent(const SEILayersPresent& sei);
+#if LAYERS_NOT_PRESENT_SEI
+  Void xWriteSEILayersNotPresent(const SEILayersNotPresent& sei);
 #endif
   Void xWriteSEISOPDescription(const SEISOPDescription& sei);
 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI
   Void xWriteSEIInterLayerConstrainedTileSets(const SEIInterLayerConstrainedTileSets& sei);
+#endif
+#if SUB_BITSTREAM_PROPERTY_SEI
+  Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
 #endif
   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 588)
@@ -579,12 +579,4 @@
   }
   WRITE_FLAG( pcSPS->getTMVPFlagsPresent()  ? 1 : 0,           "sps_temporal_mvp_enable_flag" );
-#if REF_IDX_MFM
-#if !M0457_COL_PICTURE_SIGNALING
-  if( pcSPS->getLayerId() > 0 )
-  {
-    WRITE_FLAG( pcSPS->getMFMEnabledFlag() ? 1 : 0,          "sps_enh_mfm_enable_flag" );
-  }
-#endif
-#endif
   WRITE_FLAG( pcSPS->getUseStrongIntraSmoothing(),             "sps_strong_intra_smoothing_enable_flag" );
 
@@ -623,8 +615,7 @@
   // more syntax elements to be written here
 
-#if VERT_MV_CONSTRAINT
   // Vertical MV component restriction is not used in SHVC CTC
   WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
-#endif
+
   if( pcSPS->getLayerId() > 0 )
   {
@@ -642,33 +633,17 @@
     }
   }
-#if M0463_VUI_EXT_ILP_REF
-  ////   sps_extension_vui_parameters( )
-  if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
-  {  
-    WRITE_UVLC( pcSPS->getNumIlpRestrictedRefLayers( ),           "num_ilp_restricted_ref_layers" ); 
-    for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 
-    {  
-      WRITE_UVLC( pcSPS->getMinSpatialSegmentOffsetPlus1( i ),    "min_spatial_segment_offset_plus1" ); 
-      if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 
-      {  
-        WRITE_FLAG( pcSPS->getCtuBasedOffsetEnabledFlag( i ),      "ctu_based_offset_enabled_flag[ i ]"); 
-        if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )  
-        {
-          WRITE_UVLC( pcSPS->getMinHorizontalCtuOffsetPlus1( i ), "min_horizontal_ctu_offset_plus1[ i ]"); 
-        }
-      }  
-    }  
-  }  
-  ////   sps_extension_vui_parameters( ) END
-#endif
 }
 #endif
 Void TEncCavlc::codeVPS( TComVPS* pcVPS )
 {
+#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
 #if VPS_EXTN_OFFSET_CALC
   UInt numBytesInVps = this->m_pcBitIf->getNumberOfWrittenBits();
 #endif
+#endif
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
    m_vpsVuiCounter = this->m_pcBitIf->getNumberOfWrittenBits();
+#endif
 #endif
   WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
@@ -682,6 +657,10 @@
   WRITE_FLAG( pcVPS->getTemporalNestingFlag(),                "vps_temporal_id_nesting_flag" );
   assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
+#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
 #if VPS_EXTN_OFFSET
   WRITE_CODE( pcVPS->getExtensionOffset(),         16,        "vps_extension_offset" );
+#else
+  WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
+#endif
 #else
   WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
@@ -775,4 +754,5 @@
       WRITE_FLAG(1,                  "vps_extension_alignment_bit_equal_to_one");
     }
+#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
 #if VPS_EXTN_OFFSET_CALC
     Int vpsExntOffsetValueInBits = this->m_pcBitIf->getNumberOfWrittenBits() - numBytesInVps + 16; // 2 bytes for NUH
@@ -780,4 +760,5 @@
     pcVPS->setExtensionOffset( vpsExntOffsetValueInBits >> 3 );
 #endif
+#endif
     codeVPSExtension(pcVPS);
     WRITE_FLAG( 0,                     "vps_extension2_flag" );   // Flag value of 1 reserved
@@ -798,4 +779,5 @@
 
   WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if O0109_MOVE_VPS_VUI_FLAG
 #if !VPS_VUI
@@ -819,4 +801,6 @@
   WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
 #endif // O0109_MOVE_VPS_VUI_FLAG
+#endif
+  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
 
   for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
@@ -908,5 +892,4 @@
     }
 #endif
-#if JCTVC_M0203_INTERLAYER_PRED_IDC
 #if N0120_MAX_TID_REF_PRESENT_FLAG
    WRITE_FLAG( vps->getMaxTidRefPresentFlag(), "max_tid_ref_present_flag");
@@ -944,5 +927,4 @@
   }
 #endif
-#endif
 #if ILP_SSH_SIG
     WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" );
@@ -950,17 +932,24 @@
 #if VPS_EXTN_PROFILE_INFO
   // Profile-tier-level signalling
+#if !VPS_EXTN_UEV_CODING
   WRITE_CODE( vps->getNumLayerSets() - 1   , 10, "vps_number_layer_sets_minus1" );     
   WRITE_CODE( vps->getNumProfileTierLevel() - 1,  6, "vps_num_profile_tier_level_minus1"); 
+#else
+  WRITE_UVLC( vps->getNumProfileTierLevel() - 1, "vps_num_profile_tier_level_minus1"); 
+#endif
   for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
   {
     WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
+#if !P0048_REMOVE_PROFILE_REF
     if( !vps->getProfilePresentFlag(idx) )
     {
       WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" );
     }
+#endif
     codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
   }
 #endif
 
+#if !VPS_EXTN_UEV_CODING
   Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
   WRITE_FLAG(  (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" ); 
@@ -969,6 +958,14 @@
     WRITE_CODE( numOutputLayerSets - vps->getNumLayerSets(), 10, "num_add_output_layer_sets" );
   }
+#else
+  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
+  assert( numOutputLayerSets - (Int)vps->getNumLayerSets() >= 0 );
+  WRITE_UVLC( numOutputLayerSets - vps->getNumLayerSets(), "num_add_output_layer_sets" );
+#endif
   if( numOutputLayerSets > 1 )
   {
+#if P0295_DEFAULT_OUT_LAYER_IDC
+    WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_target_output_layer_idc" );   
+#else
 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     WRITE_CODE( vps->getDefaultOneTargetOutputLayerIdc(), 2, "default_one_target_output_layer_idc" );   
@@ -976,4 +973,5 @@
     WRITE_FLAG( vps->getDefaultOneTargetOutputLayerFlag(), "default_one_target_output_layer_flag" );   
 #endif
+#endif
   }
 
@@ -987,5 +985,10 @@
         numBits++;
       }
-      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "output_layer_set_idx_minus1");  
+      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "output_layer_set_idx_minus1"); 
+#if P0295_DEFAULT_OUT_LAYER_IDC
+    }
+    if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
+    {
+#endif
       Int lsIdx = vps->getOutputLayerSetIdx(i);
       for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
@@ -1015,5 +1018,9 @@
   {
 #if O0096_REP_FORMAT_INDEX
+#if !VPS_EXTN_UEV_CODING
     WRITE_CODE( vps->getVpsNumRepFormats() - 1, 8, "vps_num_rep_formats_minus1" );
+#else
+    WRITE_UVLC( vps->getVpsNumRepFormats() - 1, "vps_num_rep_formats_minus1" );
+#endif
 #else
     WRITE_CODE( vps->getVpsNumRepFormats() - 1, 4, "vps_num_rep_formats_minus1" );
@@ -1033,6 +1040,15 @@
       {
 #if O0096_REP_FORMAT_INDEX
+#if !VPS_EXTN_UEV_CODING
         WRITE_CODE( vps->getVpsRepFormatIdx(i), 8, "vps_rep_format_idx[i]" );
 #else
+        Int numBits = 1;
+        while ((1 << numBits) < (vps->getVpsNumRepFormats()))
+        {
+          numBits++;
+        }
+        WRITE_CODE( vps->getVpsRepFormatIdx(i), numBits, "vps_rep_format_idx[i]" );
+#endif
+#else
         WRITE_CODE( vps->getVpsRepFormatIdx(i), 4, "vps_rep_format_idx[i]" );
 #endif
@@ -1042,7 +1058,5 @@
 #endif
 
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
-      WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag");
-#endif
+  WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag");
 #if O0062_POC_LSB_NOT_PRESENT_FLAG
   for(i = 1; i< vps->getMaxLayers(); i++)
@@ -1061,26 +1075,7 @@
 #endif 
 #if VPS_DPB_SIZE_TABLE
-  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
-  {
-    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]");  
-    for(j = 0; j < vps->getMaxTLayers(); j++)
-    {
-      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
-      {
-        WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]");  
-      }
-      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
-      {
-        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
-        {
-          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" ); 
-        }
-        WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );              
-        WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );        
-      }
-    }
-  }
-#endif
-#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
+  codeVpsDpbSizeTable(vps);
+#endif
+#if VPS_EXTN_DIRECT_REF_LAYERS
   WRITE_UVLC( vps->getDirectDepTypeLen()-2,                           "direct_dep_type_len_minus2");
 #if O0096_DEFAULT_DEPENDENCY_TYPE
@@ -1126,4 +1121,12 @@
 #endif
 
+#if P0307_VPS_NON_VUI_EXTENSION
+  WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" );
+  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_MOVE_VPS_VUI_FLAG
 #if !VPS_VUI
@@ -1146,4 +1149,8 @@
 #endif 
 #else
+#if P0307_REMOVE_VPS_VUI_OFFSET
+  WRITE_FLAG( 1,                     "vps_vui_present_flag" );
+  vps->setVpsVuiPresentFlag(true);
+#endif
   if(vps->getVpsVuiPresentFlag())   // Should be conditioned on the value of vps_vui_present_flag
   {
@@ -1152,8 +1159,10 @@
       WRITE_FLAG(1,                  "vps_vui_alignment_bit_equal_to_one");
     }
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
     Int vpsVuiOffsetValeInBits = this->m_pcBitIf->getNumberOfWrittenBits() - m_vpsVuiCounter + 16; // 2 bytes for NUH
     assert( vpsVuiOffsetValeInBits % 8 == 0 );
     vps->setVpsVuiOffset( vpsVuiOffsetValeInBits >> 3 );
+#endif
 #endif
     codeVPSVUI(vps);  
@@ -1204,4 +1213,45 @@
 }
 #endif
+#if VPS_DPB_SIZE_TABLE
+Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps)
+{
+  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
+  {
+#if CHANGE_NUMSUBDPB_IDX
+    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
+#endif
+    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]");  
+    for(Int j = 0; j < vps->getMaxTLayers(); j++)
+    {
+      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
+      {
+        WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]");  
+      }
+      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
+      {
+#if CHANGE_NUMSUBDPB_IDX
+        for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
+#else
+        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
+#endif
+        {
+          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" ); 
+        }
+        WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );              
+#if RESOLUTION_BASED_DPB
+        if( vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) != vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ) )  // NumSubDpbs
+        {
+          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
+          {
+            WRITE_UVLC( vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j), "max_vps_layer_dec_pic_buff_minus1[i][k][j]" );
+          }
+        }
+#endif
+        WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );        
+      }
+    }
+  }
+}
+#endif
 #if VPS_VUI
 Void TEncCavlc::codeVPSVUI (TComVPS *vps)
@@ -1251,4 +1301,26 @@
   }
 #endif
+#if VPS_VUI_VIDEO_SIGNAL_MOVE
+  WRITE_FLAG( vps->getVideoSigPresentVpsFlag(), "video_signal_info_idx_present_flag" );
+  if (vps->getVideoSigPresentVpsFlag())
+  {
+    WRITE_CODE(vps->getNumVideoSignalInfo()-1, 4, "vps_num_video_signal_info_minus1" );
+  }
+
+  for(i = 0; i < vps->getNumVideoSignalInfo(); i++)
+  {
+    WRITE_CODE(vps->getVideoVPSFormat(i), 3, "video_vps_format" );
+    WRITE_FLAG(vps->getVideoFullRangeVpsFlag(i), "video_full_range_vps_flag" );
+    WRITE_CODE(vps->getColorPrimaries(i), 8, "color_primaries_vps" );
+    WRITE_CODE(vps->getTransCharacter(i), 8, "transfer_characteristics_vps" );
+    WRITE_CODE(vps->getMaxtrixCoeff(i), 8, "matrix_coeffs_vps" );
+  }
+
+  if (vps->getVideoSigPresentVpsFlag() && vps->getNumVideoSignalInfo() > 1 )
+  {
+    for (i=1; i < vps->getMaxLayers(); i++)
+      WRITE_CODE(vps->getVideoSignalInfoIdx(i), 4, "vps_video_signal_info_idx" );
+  }
+#endif 
 #if VPS_VUI_TILES_NOT_IN_USE__FLAG
   UInt layerIdx;
@@ -1304,6 +1376,6 @@
 #endif
 #if N0160_VUI_EXT_ILP_REF
-  WRITE_FLAG( vps->getNumIlpRestrictedRefLayers() ? 1 : 0 , "num_ilp_restricted_ref_layers" );    
-  if( vps->getNumIlpRestrictedRefLayers())
+  WRITE_FLAG( vps->getIlpRestrictedRefLayersFlag() ? 1 : 0 , "ilp_restricted_ref_layers_flag" );    
+  if( vps->getIlpRestrictedRefLayersFlag())
   {
     for(i = 1; i < vps->getMaxLayers(); i++)
@@ -1327,4 +1399,6 @@
 #endif 
 #if VPS_VUI_VIDEO_SIGNAL
+#if VPS_VUI_VIDEO_SIGNAL_MOVE
+#else 
     WRITE_FLAG( vps->getVideoSigPresentVpsFlag(), "video_signal_info_idx_present_flag" );
     if (vps->getVideoSigPresentVpsFlag())
@@ -1347,4 +1421,5 @@
             WRITE_CODE(vps->getVideoSignalInfoIdx(i), 4, "vps_video_signal_info_idx" );
     }
+#endif 
 #endif
 }
@@ -1611,5 +1686,5 @@
     }
 
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
+#if SVC_EXTENSION
 #if ILP_SSH_SIG
 #if ILP_SSH_SIG_FIX
@@ -1650,11 +1725,5 @@
       }
     }     
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-    if( pcSlice->getNumSamplePredRefLayers() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 )
-    {
-      WRITE_FLAG( pcSlice->getInterLayerSamplePredOnlyFlag(), "inter_layer_sample_pred_only_flag" );
-    }
-#endif
-#endif 
+#endif //SVC_EXTENSION
 
     if(pcSlice->getSPS()->getUseSAO())
@@ -1772,16 +1841,4 @@
     if ( pcSlice->getEnableTMVPFlag() )
     {
-#if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-      if ( !pcSlice->getIdrPicFlag() && pcSlice->getLayerId() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 && pcSlice->getNumMotionPredRefLayers() > 0 )
-      {
-        WRITE_FLAG( pcSlice->getAltColIndicationFlag() ? 1 : 0, "alt_collocated_indication_flag" );
-        if (pcSlice->getAltColIndicationFlag() && pcSlice->getNumMotionPredRefLayers() > 1)
-        {
-          WRITE_UVLC(0, "collocated_ref_layer_idx");
-        }
-      }
-      else
-      {
-#endif
       if ( pcSlice->getSliceType() == B_SLICE )
       {
@@ -1795,7 +1852,4 @@
         WRITE_UVLC( pcSlice->getColRefIdx(), "collocated_ref_idx" );
       }
-#if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-      }
-#endif
     }
     if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) )
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 588)
@@ -68,6 +68,8 @@
   TComSlice*    m_pcSlice;
   UInt          m_uiCoeffCost;
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
   Int m_vpsVuiCounter;
+#endif
 #endif
   Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
@@ -95,4 +97,7 @@
 #if REPN_FORMAT_IN_VPS
   Void  codeRepFormat           ( RepFormat *repFormat );
+#endif
+#if VPS_DPB_SIZE_TABLE
+  Void  codeVpsDpbSizeTable      (TComVPS *vps);
 #endif
   Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
Index: trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 588)
@@ -168,5 +168,4 @@
   Int       m_numActiveRefLayers;
   Int       m_predLayerId[MAX_VPS_LAYER_ID_PLUS1];
-#if M0457_PREDICTION_INDICATIONS
   Int       m_numSamplePredRefLayers;
   Int       m_samplePredRefLayerId[MAX_VPS_LAYER_ID_PLUS1];
@@ -175,5 +174,4 @@
   Bool      m_samplePredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1];
   Bool      m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1];
-#endif
 #endif
 #if N0120_MAX_TID_REF_CFG
@@ -307,6 +305,6 @@
   Int       m_gradualDecodingRefreshInfoEnabled;
   Int       m_decodingUnitInfoSEIEnabled;
-#if M0043_LAYERS_PRESENT_SEI
-  Int       m_layersPresentSEIEnabled;
+#if LAYERS_NOT_PRESENT_SEI
+  Int       m_layersNotPresentSEIEnabled;
 #endif
   Int       m_SOPDescriptionSEIEnabled;
@@ -452,5 +450,4 @@
   Void      setPredLayerId                  (Int i, Int refLayerId)         { m_predLayerId[i] = refLayerId;    }
 
-#if M0457_PREDICTION_INDICATIONS
   Int       getNumSamplePredRefLayers       ()                              { return m_numSamplePredRefLayers;  }
   Void      setNumSamplePredRefLayers       (Int num)                       { m_numSamplePredRefLayers = num;   }
@@ -470,5 +467,4 @@
   Bool      getMotionPredEnabledFlag        (Int i)                         { return m_motionPredEnabledFlag[i];  }
   Void      setMotionPredEnabledFlag        (Int i,Bool flag)               { m_motionPredEnabledFlag[i] = flag;  }
-#endif
 #endif
 #if N0120_MAX_TID_REF_CFG
@@ -752,7 +748,7 @@
   Void  setDecodingUnitInfoSEIEnabled(Int b)                { m_decodingUnitInfoSEIEnabled = b;    }
   Int   getDecodingUnitInfoSEIEnabled()                     { return m_decodingUnitInfoSEIEnabled; }
-#if M0043_LAYERS_PRESENT_SEI
-  Void  setLayersPresentSEIEnabled(Int b)                { m_layersPresentSEIEnabled = b; }
-  Int   getLayersPresentSEIEnabled()                     { return m_layersPresentSEIEnabled; }
+#if LAYERS_NOT_PRESENT_SEI
+  Void  setLayersNotPresentSEIEnabled(Int b)             { m_layersNotPresentSEIEnabled = b; }
+  Int   getLayersNotPresentSEIEnabled()                  { return m_layersNotPresentSEIEnabled; }
 #endif
   Void  setSOPDescriptionSEIEnabled(Int b)                { m_SOPDescriptionSEIEnabled = b; }
Index: trunk/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 588)
@@ -462,10 +462,4 @@
         testInter = false;
       }
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-      if( pcSlice->getInterLayerSamplePredOnlyFlag() )
-      {
-        testInter = false;
-      }
-#endif
     }
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 588)
@@ -167,20 +167,20 @@
 }
 
-#if M0043_LAYERS_PRESENT_SEI
-SEILayersPresent* TEncGOP::xCreateSEILayersPresent ()
+#if LAYERS_NOT_PRESENT_SEI
+SEILayersNotPresent* TEncGOP::xCreateSEILayersNotPresent ()
 {
   UInt i = 0;
-  SEILayersPresent *seiLayersPresent = new SEILayersPresent(); 
-  seiLayersPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId(); 
-  seiLayersPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
-  for ( ; i < seiLayersPresent->m_vpsMaxLayers; i++)
-  {
-    seiLayersPresent->m_layerPresentFlag[i] = true; 
+  SEILayersNotPresent *seiLayersNotPresent = new SEILayersNotPresent(); 
+  seiLayersNotPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId(); 
+  seiLayersNotPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
+  for ( ; i < seiLayersNotPresent->m_vpsMaxLayers; i++)
+  {
+    seiLayersNotPresent->m_layerNotPresentFlag[i] = true; 
   }
   for ( ; i < MAX_LAYERS; i++)
   {
-    seiLayersPresent->m_layerPresentFlag[i] = false; 
-  }
-  return seiLayersPresent;
+    seiLayersNotPresent->m_layerNotPresentFlag[i] = false; 
+  }
+  return seiLayersNotPresent;
 }
 #endif
@@ -363,8 +363,8 @@
   }
 
-#if M0043_LAYERS_PRESENT_SEI
-  if(m_pcCfg->getLayersPresentSEIEnabled())
-  {
-    SEILayersPresent *sei = xCreateSEILayersPresent ();
+#if LAYERS_NOT_PRESENT_SEI
+  if(m_pcCfg->getLayersNotPresentSEIEnabled())
+  {
+    SEILayersNotPresent *sei = xCreateSEILayersNotPresent ();
     m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 
@@ -690,22 +690,5 @@
       pcSlice->setActiveNumILRRefIdx(0);
       pcSlice->setInterLayerPredEnabledFlag(false);
-#if M0457_COL_PICTURE_SIGNALING
       pcSlice->setMFMEnabledFlag(false);
-#if !REMOVE_COL_PICTURE_SIGNALING
-      pcSlice->setAltColIndicationFlag(false);
-#endif
-#endif
-    }
-#endif
-
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-    pcSlice->setNumSamplePredRefLayers( m_pcEncTop->getNumSamplePredRefLayers() );
-    pcSlice->setInterLayerSamplePredOnlyFlag( 0 );
-    if( pcSlice->getNumSamplePredRefLayers() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 )
-    {
-      if( m_pcEncTop->getIlSampleOnlyPred() > 0 )
-      {
-        pcSlice->setInterLayerSamplePredOnlyFlag( true );
-      }
     }
 #endif
@@ -1159,5 +1142,4 @@
     if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
     {
-#if RESTR_CHK
 #if POC_RESET_FLAG
       if ( pocCurr > 0          && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL())
@@ -1166,13 +1148,7 @@
 #endif
       {
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
         pcSlice->setActiveNumILRRefIdx(0);
         pcSlice->setInterLayerPredEnabledFlag(0);
-#else
-        pcSlice->setNumILRRefIdx(0);
-#endif
-      }
-#endif
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
+      }
       if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
       {
@@ -1185,16 +1161,4 @@
         pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getActiveNumILRRefIdx());
       }
-#else
-      if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
-      {
-        pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumILRRefIdx());
-        pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumILRRefIdx());
-      }
-      else
-      {
-        pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumRefIdx(REF_PIC_LIST_0)+pcSlice->getNumILRRefIdx());
-        pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getNumILRRefIdx());
-      }
-#endif
     }
 #endif //SVC_EXTENSION
@@ -1205,9 +1169,5 @@
 
 #if SVC_EXTENSION
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-    if ( pcSlice->getSliceType() == B_SLICE && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
-#else
     if( pcSlice->getSliceType() == B_SLICE )
-#endif
     {
       pcSlice->setColFromL0Flag(1-uiColDir);
@@ -1224,14 +1184,7 @@
       pcSlice->setILRPic( m_pcEncTop->getIlpList() );
 #if REF_IDX_MFM
-#if M0457_COL_PICTURE_SIGNALING
       if( pcSlice->getMFMEnabledFlag() )
-#else
-      if( pcSlice->getSPS()->getMFMEnabledFlag() )
-#endif
       {
         pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-        pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
-#endif
       }
 #else
@@ -1243,13 +1196,5 @@
 
 #if REF_IDX_MFM
-#if M0457_COL_PICTURE_SIGNALING
-#if REMOVE_COL_PICTURE_SIGNALING
       if( pcSlice->getMFMEnabledFlag() )
-#else
-      if( pcSlice->getMFMEnabledFlag() && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
-#endif
-#else
-      if( pcSlice->getSPS()->getMFMEnabledFlag() )
-#endif
       {
         Bool found         = false;
@@ -1308,9 +1253,5 @@
     }
 
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-    if (pcSlice->getSliceType() == B_SLICE && m_pcEncTop->getIlSampleOnlyPred() == 0)
-#else
     if (pcSlice->getSliceType() == B_SLICE)
-#endif
     {
 #if !SVC_EXTENSION
@@ -1617,5 +1558,8 @@
 #if O0194_WEIGHTED_PREDICTION_CGS
       // Calculate for the base layer to be used in EL as Inter layer reference
-      m_pcSliceEncoder->estimateILWpParam( pcSlice );
+      if( m_pcEncTop->getInterLayerWeightedPredFlag() )
+      {
+        m_pcSliceEncoder->estimateILWpParam( pcSlice );
+      }
 #endif
 #if AVC_SYNTAX
@@ -1756,8 +1700,10 @@
       // The following code also calculates the VPS VUI offset
 #endif
+#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
 #if VPS_EXTN_OFFSET_CALC
       OutputNALUnit tempNalu(NAL_UNIT_VPS, 0, 0        ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
       m_pcEntropyCoder->setBitstream(&tempNalu.m_Bitstream);
       m_pcEntropyCoder->encodeVPS(m_pcEncTop->getVPS());  // Use to calculate the VPS extension offset
+#endif
 #endif
       m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
@@ -2068,5 +2014,5 @@
             startCUAddrSliceSegmentIdx++;
           }
-#if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING
+#if SVC_EXTENSION
           pcSlice->setNumMotionPredRefLayers(m_pcEncTop->getNumMotionPredRefLayers());
 #endif
@@ -3111,19 +3057,21 @@
 
 #if SVC_EXTENSION
-#if ADAPTIVE_QP_SELECTION
-  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits",
+#if ADAPTIVE_QP_SELECTION  
+  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, nQP %d QP %d ) %10d bits",
          pcSlice->getPOC(),
          pcSlice->getLayerId(),
          pcSlice->getTLayer(),
          c,
+         NaluToStr( pcSlice->getNalUnitType() ).data(),
          pcSlice->getSliceQpBase(),
          pcSlice->getSliceQp(),
          uibits );
 #else
-  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, QP %d ) %10d bits",
+  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP %d ) %10d bits",
          pcSlice->getPOC()-pcSlice->getLastIDR(),
          pcSlice->getLayerId(),
          pcSlice->getTLayer(),
          c,
+         NaluToStr( pcSlice->getNalUnitType() ).data().
          pcSlice->getSliceQp(),
          uibits );
@@ -3750,33 +3698,3 @@
   free(rowSAD);
 }
-
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-TComPic* TEncGOP::getMotionPredIlp(TComSlice* pcSlice)
-{
-  TComPic* ilpPic = NULL;
-  Int activeMotionPredReflayerIdx = 0;
-
-  for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
-  {
-    UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
-    if( m_pcEncTop->getMotionPredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) ) )
-    {
-      if (activeMotionPredReflayerIdx == pcSlice->getColRefLayerIdx())
-      {
-        ilpPic = m_pcEncTop->getIlpList()[refLayerIdc];
-        break;
-      }
-      else
-      {
-        activeMotionPredReflayerIdx++;
-      }
-    }
-  }
-
-  assert(ilpPic != NULL);
-
-  return ilpPic;
-}
-#endif
-
 //! \}
Index: trunk/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 588)
@@ -181,6 +181,6 @@
 
   SEIActiveParameterSets* xCreateSEIActiveParameterSets (TComSPS *sps);
-#if M0043_LAYERS_PRESENT_SEI
-  SEILayersPresent*       xCreateSEILayersPresent ();
+#if LAYERS_NOT_PRESENT_SEI
+  SEILayersNotPresent*    xCreateSEILayersNotPresent ();
 #endif
   SEIFramePacking*        xCreateSEIFramePacking();
@@ -210,7 +210,4 @@
 #endif
   Void dblMetric( TComPic* pcPic, UInt uiNumSlices );
-#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-  TComPic* getMotionPredIlp(TComSlice* pcSlice);
-#endif
 };// END CLASS DEFINITION TEncGOP
 
Index: trunk/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 588)
@@ -523,5 +523,4 @@
   if( layerId > 0 )
   {
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
     if( rpcSlice->getNumILRRefIdx() > 0 )
     {
@@ -533,13 +532,5 @@
       rpcSlice->setInterLayerPredEnabledFlag(1);
     }
-#else
-    rpcSlice->setNumILRRefIdx( rpcSlice->getVPS()->getNumDirectRefLayers( layerId ) );
-#endif
-#if M0457_COL_PICTURE_SIGNALING
     rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[layerId]->getMFMEnabledFlag());
-#if !REMOVE_COL_PICTURE_SIGNALING
-    rpcSlice->setAltColIndicationFlag(rpcSlice->getMFMEnabledFlag());
-#endif
-#endif
   }
 
@@ -820,5 +811,5 @@
   }
 #if O0194_WEIGHTED_PREDICTION_CGS
-  else
+  else if( m_ppcTEncTop[pcSlice->getLayerId()]->getInterLayerWeightedPredFlag() )
   {
     // Calculate for the base layer to be used in EL as Inter layer reference
Index: trunk/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 588)
@@ -934,9 +934,4 @@
 #if SVC_EXTENSION
   m_cSPS.setLayerId(m_layerId);
-#if REF_IDX_MFM
-#if !M0457_COL_PICTURE_SIGNALING
-  m_cSPS.setMFMEnabledFlag(m_bMFMEnabledFlag);
-#endif
-#endif
   m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
   for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
@@ -1632,5 +1627,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_numLayer; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
       {
         m_cIlpPic[j] = new  TComPic;
@@ -1699,5 +1694,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++)
       {
         m_cIlpPic[j] = new  TComPic;
Index: trunk/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.h	(revision 547)
+++ trunk/source/Lib/TLibEncoder/TEncTop.h	(revision 588)
@@ -137,7 +137,4 @@
   Bool                    m_bMFMEnabledFlag;
 #endif
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-  Int                     m_ilSampleOnlyPred;
-#endif
   UInt                    m_numScaledRefLayerOffsets;
 #if O0098_SCALED_REF_LAYER_ID
@@ -153,4 +150,7 @@
   Bool                    m_firstPicInLayerDecodedFlag;
   Bool                    m_noOutputOfPriorPicsFlags;
+#endif
+#if O0194_WEIGHTED_PREDICTION_CGS
+  Bool                    m_interLayerWeightedPredFlag;
 #endif
 #endif //SVC_EXTENSION
@@ -237,7 +237,7 @@
   Bool      getMFMEnabledFlag()                   {return m_bMFMEnabledFlag;}    
 #endif
-#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
-  Void      setIlSampleOnlyPred( Int i )          { m_ilSampleOnlyPred = i;    }
-  Int       getIlSampleOnlyPred()                 { return m_ilSampleOnlyPred; }
+#if O0194_WEIGHTED_PREDICTION_CGS
+  Void      setInterLayerWeightedPredFlag(Bool flag)   { m_interLayerWeightedPredFlag = flag; }
+  Bool      getInterLayerWeightedPredFlag()            { return m_interLayerWeightedPredFlag; }
 #endif
 #if AVC_SYNTAX
