Changeset 588 in SHVCSoftware for trunk/source/Lib/TLibDecoder


Ignore:
Timestamp:
1 Feb 2014, 23:50:54 (11 years ago)
Author:
seregin
Message:

merge with SHM-5.0-dev

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibDecoder/SEIread.cpp

    r442 r588  
    9393    fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");
    9494    break;
    95 #if M0043_LAYERS_PRESENT_SEI
    96   case SEI::LAYERS_PRESENT:
     95#if LAYERS_NOT_PRESENT_SEI
     96  case SEI::LAYERS_NOT_PRESENT:
    9797    fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
    9898    break;
     
    106106    break;
    107107#endif
     108#if SUB_BITSTREAM_PROPERTY_SEI
     109    case SEI::SUB_BITSTREAM_PROPERTY:
     110      fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
     111      break;
     112#endif
    108113  case SEI::SCALABLE_NESTING:
    109114    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
     
    119124 * unmarshal a single SEI message from bitstream bs
    120125 */
    121 #if M0043_LAYERS_PRESENT_SEI
     126#if LAYERS_NOT_PRESENT_SEI
    122127void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
    123128#else
     
    130135  do
    131136  {
    132 #if M0043_LAYERS_PRESENT_SEI
     137#if LAYERS_NOT_PRESENT_SEI
    133138    xReadSEImessage(seis, nalUnitType, vps, sps);
    134139#else
     
    145150}
    146151
    147 #if M0043_LAYERS_PRESENT_SEI
     152#if LAYERS_NOT_PRESENT_SEI
    148153Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
    149154#else
     
    254259      xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);
    255260      break;
    256 #if M0043_LAYERS_PRESENT_SEI
    257     case SEI::LAYERS_PRESENT:
     261#if LAYERS_NOT_PRESENT_SEI
     262    case SEI::LAYERS_NOT_PRESENT:
    258263      if (!vps)
    259264      {
    260         printf ("Warning: Found Layers present SEI message, but no active VPS is available. Ignoring.");
     265        printf ("Warning: Found Layers not present SEI message, but no active VPS is available. Ignoring.");
    261266      }
    262267      else
    263268      {
    264         sei = new SEILayersPresent;
    265         xParseSEILayersPresent((SEILayersPresent&) *sei, payloadSize, vps);
     269        sei = new SEILayersNotPresent;
     270        xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, vps);
    266271      }
    267272      break;
     
    277282      break;
    278283#endif
     284#if SUB_BITSTREAM_PROPERTY_SEI
     285   case SEI::SUB_BITSTREAM_PROPERTY:
     286     sei = new SEISubBitstreamProperty;
     287     xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei);
     288     break;
     289#endif
    279290    case SEI::SCALABLE_NESTING:
    280291      sei = new SEIScalableNesting;
    281 #if M0043_LAYERS_PRESENT_SEI
     292#if LAYERS_NOT_PRESENT_SEI
    282293      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps);
    283294#else
     
    741752}
    742753
    743 #if M0043_LAYERS_PRESENT_SEI
    744 Void SEIReader::xParseSEILayersPresent(SEILayersPresent &sei, UInt payloadSize, TComVPS *vps)
     754#if LAYERS_NOT_PRESENT_SEI
     755Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps)
    745756{
    746757  UInt uiCode;
     
    752763  for (; i < sei.m_vpsMaxLayers; i++)
    753764  {
    754     READ_FLAG( uiCode,         "layer_present_flag"   ); sei.m_layerPresentFlag[i] = uiCode ? true : false;
     765    READ_FLAG( uiCode,         "layer_not_present_flag"   ); sei.m_layerNotPresentFlag[i] = uiCode ? true : false;
    755766  }
    756767  for (; i < MAX_LAYERS; i++)
    757768  {
    758     sei.m_layerPresentFlag[i] = false;
     769    sei.m_layerNotPresentFlag[i] = false;
    759770  }
    760771  xParseByteAlign();
     
    829840}
    830841#endif
    831 
    832 #if M0043_LAYERS_PRESENT_SEI
     842#if SUB_BITSTREAM_PROPERTY_SEI
     843Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei)
     844{
     845  UInt uiCode;
     846  READ_CODE( 4, uiCode, "active_vps_id" );                      sei.m_activeVpsId = uiCode;
     847  READ_UVLC(    uiCode, "num_additional_sub_streams_minus1" );  sei.m_numAdditionalSubStreams = uiCode + 1;
     848
     849  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
     850  {
     851    READ_CODE(  2, uiCode, "sub_bitstream_mode[i]"           ); sei.m_subBitstreamMode[i] = uiCode;
     852    READ_UVLC(     uiCode, "output_layer_set_idx_to_vps[i]"  ); sei.m_outputLayerSetIdxToVps[i] = uiCode;
     853    READ_CODE(  3, uiCode, "highest_sub_layer_id[i]"         ); sei.m_highestSublayerId[i] = uiCode;
     854    READ_CODE( 16, uiCode, "avg_bit_rate[i]"                 ); sei.m_avgBitRate[i] = uiCode;
     855    READ_CODE( 16, uiCode, "max_bit_rate[i]"                 ); sei.m_maxBitRate[i] = uiCode;
     856  }
     857  xParseByteAlign();
     858}
     859#endif
     860#if LAYERS_NOT_PRESENT_SEI
    833861Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps)
    834862#else
     
    876904  // read nested SEI messages
    877905  do {
    878 #if M0043_LAYERS_PRESENT_SEI
     906#if LAYERS_NOT_PRESENT_SEI
    879907    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps);
    880908#else
  • trunk/source/Lib/TLibDecoder/SEIread.h

    r442 r588  
    5656  SEIReader() {};
    5757  virtual ~SEIReader() {};
    58 #if M0043_LAYERS_PRESENT_SEI
     58#if LAYERS_NOT_PRESENT_SEI
    5959  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
    6060#else
     
    6262#endif
    6363protected:
    64 #if M0043_LAYERS_PRESENT_SEI
     64#if LAYERS_NOT_PRESENT_SEI
    6565  Void xReadSEImessage                (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
    6666#else
     
    8383  Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize);
    8484#endif
    85 #if M0043_LAYERS_PRESENT_SEI
    86   Void xParseSEILayersPresent         (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps);
     85#if SUB_BITSTREAM_PROPERTY_SEI
     86Void   xParseSEISubBitstreamProperty   (SEISubBitstreamProperty &sei);
     87#endif
     88#if LAYERS_NOT_PRESENT_SEI
     89  Void xParseSEILayersNotPresent      (SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps);
    8790  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps);
    8891#else
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r547 r588  
    756756  }
    757757  READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" );            pcSPS->setTMVPFlagsPresent(uiCode);
    758 #if REF_IDX_MFM
    759 #if !M0457_COL_PICTURE_SIGNALING
    760   if(pcSPS->getLayerId() > 0)
    761   {
    762     READ_FLAG( uiCode, "sps_enh_mfm_enable_flag" );
    763     pcSPS->setMFMEnabledFlag( uiCode ? true : false );
    764   }
    765 #endif
    766 #endif
    767758  READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" );  pcSPS->setUseStrongIntraSmoothing(uiCode);
    768759
     
    815806  // more syntax elements to be parsed here
    816807
    817 #if VERT_MV_CONSTRAINT
    818808  READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );
    819809  // Vertical MV component restriction is not used in SHVC CTC
    820810  assert( uiCode == 0 );
    821 #endif
     811
    822812  if( pcSPS->getLayerId() > 0 )
    823813  {
     
    836826    }
    837827  }
    838 #if M0463_VUI_EXT_ILP_REF
    839   ////   sps_extension_vui_parameters( )
    840   if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
    841   {
    842     READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );
    843     for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
    844     {
    845       READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );
    846       if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
    847       {
    848         READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );
    849         if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )
    850         {
    851           READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );
    852         }
    853       }
    854     }
    855   }
    856   ////   sps_extension_vui_parameters( ) END
    857 #endif
    858828}
    859829#endif
     
    877847  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    878848  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
     849#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    879850#if VPS_EXTN_OFFSET
    880851  READ_CODE( 16, uiCode,  "vps_extension_offset" );               pcVPS->setExtensionOffset( uiCode );
     852#else
     853  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     854#endif
    881855#else
    882856  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     
    995969  READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
    996970
     971#if !P0307_REMOVE_VPS_VUI_OFFSET
    997972#if O0109_MOVE_VPS_VUI_FLAG
    998973  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
     
    1005980#if O0109_MOVE_VPS_VUI_FLAG
    1006981  }
     982#endif
    1007983#endif
    1008984  READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
     
    11221098    }
    11231099#endif
    1124 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    11251100#if N0120_MAX_TID_REF_PRESENT_FLAG
    11261101  READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false);
     
    11801155  }
    11811156#endif
    1182 #endif
    11831157#if ILP_SSH_SIG
    11841158    READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false);
     
    11861160#if VPS_EXTN_PROFILE_INFO
    11871161  // Profile-tier-level signalling
     1162#if !VPS_EXTN_UEV_CODING
    11881163  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" );     assert( uiCode == (vps->getNumLayerSets() - 1) );
    11891164  READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
     1165#else
     1166  READ_UVLC(  uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
     1167#endif
    11901168  vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
    11911169  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
     
    11941172    if( !vps->getProfilePresentFlag(idx) )
    11951173    {
     1174#if P0048_REMOVE_PROFILE_REF
     1175      // Copy profile information from previous one
     1176      vps->getPTLForExtn(idx)->copyProfileInfo( (idx==1) ? vps->getPTL() : vps->getPTLForExtn( idx - 1 ) );
     1177#else
    11961178      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
    11971179#if O0109_PROF_REF_MINUS1
     
    12021184      // Copy profile information as indicated
    12031185      vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) );
     1186#endif
    12041187    }
    12051188    parsePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     
    12071190#endif
    12081191
     1192#if !VPS_EXTN_UEV_CODING
    12091193  READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false );
    12101194  Int numOutputLayerSets = 0;
     
    12181202    numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
    12191203  }
     1204#else
     1205  READ_UVLC( uiCode, "num_add_output_layer_sets" );          vps->setNumAddOutputLayerSets( uiCode );
     1206  Int numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
     1207#endif
     1208
     1209#if P0295_DEFAULT_OUT_LAYER_IDC
     1210  if( numOutputLayerSets > 1 )
     1211  {
     1212    READ_CODE( 2, uiCode, "default_target_output_layer_idc" );   vps->setDefaultTargetOutputLayerIdc( uiCode );
     1213  }
     1214  vps->setNumOutputLayerSets( numOutputLayerSets );
     1215
     1216  for(i = 1; i < numOutputLayerSets; i++)
     1217  {
     1218    if( i > (vps->getNumLayerSets() - 1) )
     1219    {
     1220      Int numBits = 1;
     1221      while ((1 << numBits) < (vps->getNumLayerSets() - 1))
     1222      {
     1223        numBits++;
     1224      }
     1225      READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1");   vps->setOutputLayerSetIdx( i, uiCode + 1);
     1226    }
     1227    else
     1228    {
     1229      vps->setOutputLayerSetIdx( i, i );
     1230    }
     1231    if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1232    {
     1233      Int lsIdx = vps->getOutputLayerSetIdx(i);
     1234      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
     1235      {
     1236        READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode);
     1237      }
     1238    }
     1239    else
     1240    {
     1241      // i <= (vps->getNumLayerSets() - 1)
     1242      // Assign OutputLayerFlag depending on default_one_target_output_layer_flag
     1243      Int lsIdx = i;
     1244      if( vps->getDefaultTargetOutputLayerIdc() == 1 )
     1245      {
     1246        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1247        {
     1248          vps->setOutputLayerFlag(i, j, (j == (vps->getNumLayersInIdList(lsIdx)-1)) && (vps->getDimensionId(j,1) == 0) );
     1249        }
     1250      }
     1251      else if ( vps->getDefaultTargetOutputLayerIdc() == 0 )
     1252      {
     1253        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1254        {
     1255          vps->setOutputLayerFlag(i, j, 1);
     1256        }
     1257      }
     1258    }
     1259    Int numBits = 1;
     1260    while ((1 << numBits) < (vps->getNumProfileTierLevel()))
     1261    {
     1262      numBits++;
     1263    }
     1264    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
     1265  }
     1266#else
    12201267  if( numOutputLayerSets > 1 )
    12211268  {
     
    12991346    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
    13001347  }
     1348#endif
    13011349
    13021350#if O0153_ALT_OUTPUT_LAYER_FLAG
     
    13151363  {
    13161364#if O0096_REP_FORMAT_INDEX
     1365#if !VPS_EXTN_UEV_CODING
    13171366    READ_CODE( 8, uiCode, "vps_num_rep_formats_minus1" );
     1367#else
     1368    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" );
     1369#endif
    13181370#else
    13191371    READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" );
     
    13421394      {
    13431395#if O0096_REP_FORMAT_INDEX
     1396#if !VPS_EXTN_UEV_CODING
    13441397        READ_CODE( 8, uiCode, "vps_rep_format_idx[i]" );
     1398#else
     1399        Int numBits = 1;
     1400        while ((1 << numBits) < (vps->getVpsNumRepFormats()))
     1401        {
     1402          numBits++;
     1403        }
     1404        READ_CODE( numBits, uiCode, "vps_rep_format_idx[i]" );
     1405#endif
    13451406#else
    13461407        READ_CODE( 4, uiCode, "vps_rep_format_idx[i]" );
     
    13641425  }
    13651426#endif
    1366 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     1427#if RESOLUTION_BASED_DPB
     1428  vps->assignSubDpbIndices();
     1429#endif
    13671430  READ_FLAG(uiCode, "max_one_active_ref_layer_flag" );
    13681431  vps->setMaxOneActiveRefLayerFlag(uiCode);
    1369 #endif
    13701432#if O0062_POC_LSB_NOT_PRESENT_FLAG
    13711433  for(i = 1; i< vps->getMaxLayers(); i++)
     
    13881450
    13891451#if VPS_DPB_SIZE_TABLE
    1390   vps->deriveNumberOfSubDpbs();
    1391   for(i = 1; i < vps->getNumOutputLayerSets(); i++)
    1392   {
    1393     READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
    1394     for(j = 0; j < vps->getMaxTLayers(); j++)
    1395     {
    1396       if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
    1397       {
    1398         READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
    1399       }
    1400       else
    1401       {
    1402         if( j == 0 )  // Always signal for the first sub-layer
    1403         {
    1404           vps->setSubLayerDpbInfoPresentFlag( i, j, true );
    1405         }
    1406         else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
    1407         {
    1408           vps->setSubLayerDpbInfoPresentFlag( i, j, false );
    1409         }
    1410       }
    1411       if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
    1412       {
    1413         for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
    1414         {
    1415           READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
    1416         }
    1417         READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
    1418         READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
    1419       }
    1420     }
    1421   }
    1422 #endif
    1423 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     1452  parseVpsDpbSizeTable(vps);
     1453#endif
     1454
     1455#if VPS_EXTN_DIRECT_REF_LAYERS
    14241456  READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
    14251457#if O0096_DEFAULT_DEPENDENCY_TYPE
     
    14701502#endif
    14711503
     1504#if P0307_VPS_NON_VUI_EXTENSION
     1505  READ_UVLC( uiCode,           "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode);
     1506  if ( vps->getVpsNonVuiExtLength() > 0 )
     1507  {
     1508    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
     1509  }
     1510#endif
     1511
    14721512#if !O0109_O0199_FLAGS_TO_VUI
    14731513#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     
    14771517  READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
    14781518#endif
     1519#endif
     1520
     1521#if P0307_REMOVE_VPS_VUI_OFFSET
     1522  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
    14791523#endif
    14801524
     
    15401584  READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" );         repFormat->setBitDepthVpsChroma( uiCode + 8 );
    15411585#endif
     1586}
     1587#endif
     1588#if VPS_DPB_SIZE_TABLE
     1589Void TDecCavlc::parseVpsDpbSizeTable( TComVPS *vps )
     1590{
     1591  UInt uiCode;
     1592#if !RESOLUTION_BASED_DPB
     1593  vps->deriveNumberOfSubDpbs();
     1594#endif
     1595  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
     1596  {
     1597#if CHANGE_NUMSUBDPB_IDX
     1598    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
     1599#endif
     1600    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
     1601    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1602    {
     1603      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
     1604      {
     1605        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
     1606      }
     1607      else
     1608      {
     1609        if( j == 0 )  // Always signal for the first sub-layer
     1610        {
     1611          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
     1612        }
     1613        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
     1614        {
     1615          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
     1616        }
     1617      }
     1618      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
     1619      {
     1620#if CHANGE_NUMSUBDPB_IDX
     1621        for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
     1622#else
     1623        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1624#endif
     1625        {
     1626          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     1627        }
     1628        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
     1629#if RESOLUTION_BASED_DPB
     1630        if( vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) != vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ) ) 
     1631        {
     1632          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
     1633          {
     1634            READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1[i][k][j]" ); vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode);
     1635          }
     1636        }
     1637        else  // vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) == vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet )
     1638        {         
     1639          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
     1640          {
     1641            vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j));
     1642          }
     1643        }
     1644#endif
     1645        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
     1646      }
     1647    }
     1648  }
    15421649}
    15431650#endif
     
    16141721  }
    16151722#endif
     1723#if VPS_VUI_VIDEO_SIGNAL_MOVE
     1724  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 );
     1725  if (vps->getVideoSigPresentVpsFlag())
     1726  {
     1727    READ_CODE(4, uiCode, "vps_num_video_signal_info_minus1" ); vps->setNumVideoSignalInfo(uiCode + 1);
     1728  }
     1729  else
     1730  {
     1731    vps->setNumVideoSignalInfo(vps->getMaxLayers());
     1732  }
     1733
     1734
     1735  for(i = 0; i < vps->getNumVideoSignalInfo(); i++)
     1736  {
     1737    READ_CODE(3, uiCode, "video_vps_format" ); vps->setVideoVPSFormat(i,uiCode);
     1738    READ_FLAG(uiCode, "video_full_range_vps_flag" ); vps->setVideoFullRangeVpsFlag(i,uiCode);
     1739    READ_CODE(8, uiCode, "color_primaries_vps" ); vps->setColorPrimaries(i,uiCode);
     1740    READ_CODE(8, uiCode, "transfer_characteristics_vps" ); vps->setTransCharacter(i,uiCode);
     1741    READ_CODE(8, uiCode, "matrix_coeffs_vps" );vps->setMaxtrixCoeff(i,uiCode);
     1742  }
     1743  if(!vps->getVideoSigPresentVpsFlag())
     1744  {
     1745    for (i=0; i < vps->getMaxLayers(); i++)
     1746    {
     1747      vps->setVideoSignalInfoIdx(i,i);
     1748    }
     1749  }
     1750  else {
     1751    vps->setVideoSignalInfoIdx(0,0);
     1752    if (vps->getNumVideoSignalInfo() > 1 )
     1753    {
     1754      for (i=1; i < vps->getMaxLayers(); i++)
     1755        READ_CODE(4, uiCode, "vps_video_signal_info_idx" ); vps->setVideoSignalInfoIdx(i, uiCode);
     1756    }
     1757    else {
     1758      for (i=1; i < vps->getMaxLayers(); i++)
     1759      {
     1760        vps->setVideoSignalInfoIdx(i,0);
     1761      }
     1762    }
     1763  }
     1764#endif
    16161765#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    16171766  UInt layerIdx;
     
    16721821
    16731822#if N0160_VUI_EXT_ILP_REF
    1674     READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 );
    1675   if( vps->getNumIlpRestrictedRefLayers())
     1823  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); vps->setIlpRestrictedRefLayersFlag( uiCode == 1 );
     1824  if( vps->getIlpRestrictedRefLayersFlag())
    16761825  {
    16771826    for(i = 1; i < vps->getMaxLayers(); i++)
     
    16931842#endif
    16941843#if VPS_VUI_VIDEO_SIGNAL
     1844#if VPS_VUI_VIDEO_SIGNAL_MOVE
     1845#else
    16951846    READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 );
    16961847    if (vps->getVideoSigPresentVpsFlag())
     
    17331884        }
    17341885    }
     1886#endif
    17351887#endif
    17361888}
     
    18201972    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
    18211973    {
     1974#if DISCARDABLE_PIC_RPS
     1975      READ_FLAG(uiCode, "discardable_flag"); rpcSlice->setDiscardableFlag( uiCode ? true : false );
     1976#else
    18221977      READ_FLAG(uiCode, "discardable_flag"); // ignored
     1978#endif
    18231979      iBits++;
    18241980    }
     
    20642220
    20652221#if SVC_EXTENSION
    2066 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    20672222    rpcSlice->setActiveNumILRRefIdx(0);
    20682223#if ILP_SSH_SIG
     
    20942249          else
    20952250          {
     2251#if P0079_DERIVE_NUMACTIVE_REF_PICS
     2252            Int   numRefLayerPics = 0;
     2253            Int   i = 0;
     2254            Int   refLayerPicIdc  [MAX_VPS_LAYER_ID_PLUS1];
     2255            for(i = 0, numRefLayerPics = 0;  i < rpcSlice->getNumILRRefIdx(); i++ )
     2256            {
     2257              if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) >  rpcSlice->getTLayer() &&
     2258                (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >=  rpcSlice->getTLayer()) )
     2259              {         
     2260                refLayerPicIdc[ numRefLayerPics++ ] = i;
     2261              }
     2262            }
     2263            if (numRefLayerPics)
     2264              rpcSlice->setActiveNumILRRefIdx(1);
     2265#else
    20962266            rpcSlice->setActiveNumILRRefIdx(1);
     2267#endif
    20972268          }
    20982269#if ILP_NUM_REF_CHK
     
    21662337    }
    21672338#endif
    2168 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    2169     rpcSlice->setInterLayerSamplePredOnlyFlag( false );
    2170     if( rpcSlice->getNumSamplePredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 )
    2171     {
    2172       READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" );
    2173       rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode > 0 );
    2174     }
    2175 #endif
    2176 #else
    2177     if( rpcSlice->getLayerId() > 0 )
    2178     {
    2179       rpcSlice->setNumILRRefIdx( rpcSlice->getVPS()->getNumDirectRefLayers( rpcSlice->getLayerId() ) );
    2180     }
    2181 #endif
    21822339#endif
    21832340
     
    23572514    if ( rpcSlice->getEnableTMVPFlag() )
    23582515    {
    2359 #if M0457_COL_PICTURE_SIGNALING
    2360 #if REMOVE_COL_PICTURE_SIGNALING
     2516#if SVC_EXTENSION && REF_IDX_MFM
     2517      // set motion mapping flag
    23612518      rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() ) ? true : false );
    2362 #else
    2363       rpcSlice->setMFMEnabledFlag( false );
    2364       rpcSlice->setColRefLayerIdx( 0 );
    2365       rpcSlice->setAltColIndicationFlag( false );
    2366       if ( sps->getLayerId() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 && rpcSlice->getNumMotionPredRefLayers() > 0 )
    2367       {
    2368         READ_FLAG( uiCode, "alt_collocated_indication_flag" );
    2369         rpcSlice->setAltColIndicationFlag( uiCode == 1 ? true : false );
    2370         rpcSlice->setMFMEnabledFlag( uiCode == 1 ? true : false );
    2371         if ( rpcSlice->getNumMotionPredRefLayers() > 1 )
    2372         {
    2373           READ_UVLC( uiCode, "collocated_ref_layer_idx" );
    2374           rpcSlice->setColRefLayerIdx( uiCode );
    2375         }
    2376       }
    2377       else
    2378       {
    2379 #endif //REMOVE_COL_PICTURE_SIGNALING
    23802519#endif
    23812520      if ( rpcSlice->getSliceType() == B_SLICE )
     
    24002539        rpcSlice->setColRefIdx(0);
    24012540      }
    2402 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    2403       }
    2404 #endif
    24052541    }
    24062542    if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) )
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r494 r588  
    8383  Void  parseRepFormat      ( RepFormat *repFormat );
    8484#endif
     85#if VPS_DPB_SIZE_TABLE
     86  Void  parseVpsDpbSizeTable( TComVPS *vps );
     87#endif
    8588  Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager );
    8689  Void  parseSPSExtension    ( TComSPS* pcSPS );
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r540 r588  
    234234  //-- For time output for each slice
    235235#if SVC_EXTENSION
    236   printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
     236  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP%3d ) ", pcSlice->getPOC(),
    237237                                                    rpcPic->getLayerId(),
    238238                                                    pcSlice->getTLayer(),
    239239                                                    c,
     240                                                    NaluToStr( pcSlice->getNalUnitType() ).data(),
    240241                                                    pcSlice->getSliceQp() );
    241242#else
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r547 r588  
    8686  m_bRefreshPending            = false;
    8787#endif
     88#if RESOLUTION_BASED_DPB
     89  m_subDpbIdx = -1;
     90#endif
    8891}
    8992
     
    178181    {
    179182#if USE_DPB_SIZE_TABLE
    180       if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
     183      if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    181184      {
    182185        assert( this->getLayerId() == 0 );
     
    187190        TComVPS *vps = slice->getVPS();
    188191        // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
    189         numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
     192        numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
    190193      }
    191194#else
     
    196199    if (m_cIlpPic[0] == NULL)
    197200    {
    198       for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++)  // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
     201      for (Int j=0; j < m_numDirectRefLayers; j++)
    199202      {
    200203
     
    282285  {
    283286#if USE_DPB_SIZE_TABLE
    284     if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
     287    if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    285288    {
    286289      assert( this->getLayerId() == 0 );
     
    291294      TComVPS *vps = pcSlice->getVPS();
    292295      // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
    293       numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
     296      numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
    294297    }
    295298#else
     
    299302
    300303#if USE_DPB_SIZE_TABLE
    301   if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
     304  if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    302305  {
    303306    assert( this->getLayerId() == 0 );
     
    306309  else
    307310  {
    308     m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     311#if RESOLUTION_BASED_DPB
     312    Int layerSetIdxForOutputLayerSet = pcSlice->getVPS()->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
     313    Int layerIdx = pcSlice->getVPS()->findLayerIdxInLayerSet( layerSetIdxForOutputLayerSet, pcSlice->getLayerId() );  assert( layerIdx != -1 );
     314    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), layerIdx, pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     315#else
     316    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     317#endif
    309318  }
    310319#else
     
    815824#if OUTPUT_LAYER_SET_INDEX
    816825  // Following check should go wherever the VPS is activated
    817   checkValueOfOutputLayerSetIdx( m_apcSlicePilot->getVPS());
     826  checkValueOfTargetOutputLayerSetIdx( m_apcSlicePilot->getVPS());
     827#endif
     828#if RESOLUTION_BASED_DPB
     829  // Following assignment should go wherever a new VPS is activated
     830  assignSubDpbs(m_apcSlicePilot->getVPS());
    818831#endif
    819832  m_apcSlicePilot->initSlice( nalu.m_layerId );
     
    845858#if SVC_EXTENSION
    846859  m_apcSlicePilot->setSliceIdx( m_uiSliceIdx ); // it should be removed if HM will reflect it in above
    847 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     860#if VPS_EXTN_DIRECT_REF_LAYERS
    848861  setRefLayerParams(m_apcSlicePilot->getVPS());
    849862#endif
    850 #if M0457_COL_PICTURE_SIGNALING
    851863  m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers);
    852 #endif
    853 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    854   m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() );
    855 #endif
    856864#endif
    857865  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
     
    14781486
    14791487#if REF_IDX_MFM
    1480 #if M0457_COL_PICTURE_SIGNALING
    14811488      if( pcSlice->getMFMEnabledFlag() )
    1482 #else
    1483       if( pcSlice->getSPS()->getMFMEnabledFlag() )
    1484 #endif
    14851489      {
    14861490        pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
    1487 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1488         pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
    1489 #endif
    14901491      }
    14911492      pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic);
     
    16681669    }
    16691670#endif
    1670 #if M0043_LAYERS_PRESENT_SEI
     1671#if LAYERS_NOT_PRESENT_SEI
    16711672    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    16721673#else
     
    16761677  else
    16771678  {
    1678 #if M0043_LAYERS_PRESENT_SEI
     1679#if LAYERS_NOT_PRESENT_SEI
    16791680    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    16801681#else
     
    16961697  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    16971698  {
    1698 #if M0043_LAYERS_PRESENT_SEI
     1699#if LAYERS_NOT_PRESENT_SEI
    16991700    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    17001701#else
     
    17041705  else
    17051706  {
    1706 #if M0043_LAYERS_PRESENT_SEI
     1707#if LAYERS_NOT_PRESENT_SEI
    17071708    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    17081709#else
     
    18651866     
    18661867    case NAL_UNIT_EOB:
     1868#if P0130_EOB
     1869      //Check layer id of the nalu. if it is not 0, give a warning message.
     1870      if (nalu.m_layerId > 0)
     1871      {
     1872        printf( "\n\nThis bitstream is ended with EOB NALU that has layer id greater than 0\n" );
     1873      }
     1874#endif
    18671875      return false;
    18681876     
     
    19591967#endif
    19601968
    1961 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     1969#if VPS_EXTN_DIRECT_REF_LAYERS
    19621970
    19631971Void TDecTop::setRefLayerParams( TComVPS* vps )
     
    20132021#endif
    20142022
    2015 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    2016 TComPic* TDecTop::getMotionPredIlp(TComSlice* pcSlice)
    2017 {
    2018   TComPic* ilpPic = NULL;
    2019   Int activeMotionPredReflayerIdx = 0;
    2020 
    2021   for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    2022   {
    2023     UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    2024     if( getMotionPredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) ) )
    2025     {
    2026       if (activeMotionPredReflayerIdx == pcSlice->getColRefLayerIdx())
    2027       {
    2028         ilpPic = m_cIlpPic[refLayerIdc];
    2029         break;
    2030       }
    2031       else
    2032       {
    2033         activeMotionPredReflayerIdx++;
    2034       }
    2035     }
    2036   }
    2037 
    2038   assert(ilpPic != NULL);
    2039 
    2040   return ilpPic;
    2041 }
    2042 #endif
    20432023#if OUTPUT_LAYER_SET_INDEX
    2044 Void TDecTop::checkValueOfOutputLayerSetIdx(TComVPS *vps)
     2024Void TDecTop::checkValueOfTargetOutputLayerSetIdx(TComVPS *vps)
    20452025{
    20462026  CommonDecoderParams* params = this->getCommonDecoderParams();
     2027
     2028  assert( params->getTargetLayerId() < vps->getMaxLayers() );
     2029
    20472030  if( params->getValueCheckedFlag() )
    20482031  {
    20492032    return; // Already checked
    20502033  }
    2051   if( params->getOutputLayerSetIdx() == -1 )  // Output layer set index not specified
     2034  if( params->getTargetOutputLayerSetIdx() == -1 )  // Output layer set index not specified
    20522035  {
    20532036    Bool layerSetMatchFound = false;
     
    20962079          // Match found
    20972080          layerSetMatchFound = true;
    2098           params->setOutputLayerSetIdx( i );
     2081          params->setTargetOutputLayerSetIdx( i );
    20992082          params->setValueCheckedFlag( true );
    21002083          break;
     
    21072090  {
    21082091    // Check if the target decoded layer is the highest layer in the list
    2109     Int layerSetIdx = vps->getOutputLayerSetIdx( params->getOutputLayerSetIdx() );  // Index to the layer set
     2092    assert( params->getTargetOutputLayerSetIdx() < vps->getNumLayerSets() );
     2093    Int layerSetIdx = vps->getOutputLayerSetIdx( params->getTargetOutputLayerSetIdx() );  // Index to the layer set
    21102094    assert( params->getTargetLayerId() == vps->getNumLayersInIdList( layerSetIdx ) - 1);
    21112095
     
    21382122}
    21392123#endif
     2124#if RESOLUTION_BASED_DPB
     2125Void TDecTop::assignSubDpbs(TComVPS *vps)
     2126{
     2127  if( m_subDpbIdx == -1 ) // Sub-DPB index is not already assigned
     2128  {
     2129    Int lsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
     2130
     2131    Int layerIdx = vps->findLayerIdxInLayerSet( lsIdx, getLayerId() );
     2132    assert( layerIdx != -1 ); // Current layer should be found in the layer set.
     2133
     2134    // Copy from the active VPS based on the layer ID.
     2135    m_subDpbIdx = vps->getSubDpbAssigned( lsIdx, layerIdx );
     2136  }
     2137}
     2138#endif
    21402139//! \}
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r540 r588  
    117117  Int                     m_iBLSourceHeight; 
    118118#endif
    119 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     119#if VPS_EXTN_DIRECT_REF_LAYERS
    120120  Int                     m_numDirectRefLayers;
    121121  Int                     m_refLayerId[MAX_VPS_LAYER_ID_PLUS1];
     
    144144  Bool                   m_bRefreshPending;
    145145#endif
    146 
     146#if RESOLUTION_BASED_DPB
     147  Int                    m_subDpbIdx;     // Index to the sub-DPB that the layer belongs to.
     148                                          // When new VPS is activated, this should be re-initialized to -1
     149#endif
    147150public:
    148151  TDecTop();
     
    177180#if VPS_EXTN_DIRECT_REF_LAYERS
    178181  TDecTop*  getRefLayerDec(UInt refLayerIdc);
    179 #if M0457_PREDICTION_INDICATIONS
    180182  Int       getNumDirectRefLayers           ()                              { return m_numDirectRefLayers;      }
    181183  Void      setNumDirectRefLayers           (Int num)                       { m_numDirectRefLayers = num;       }
     
    206208
    207209  Void      setRefLayerParams( TComVPS* vps );
    208 #endif
    209210#endif
    210211#if AVC_BASE
     
    244245  Void      xDecodePPS();
    245246  Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
    246 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    247   TComPic*  getMotionPredIlp(TComSlice* pcSlice);
    248 #endif
    249247
    250248#if NO_CLRAS_OUTPUT_FLAG
     
    262260  CommonDecoderParams*    getCommonDecoderParams() { return m_commonDecoderParams; }
    263261  Void                    setCommonDecoderParams(CommonDecoderParams* x) { m_commonDecoderParams = x; }
    264   Void      checkValueOfOutputLayerSetIdx(TComVPS *vps);
     262  Void      checkValueOfTargetOutputLayerSetIdx(TComVPS *vps);
    265263#endif
    266264#if SCALINGLIST_INFERRING
    267265  ParameterSetManagerDecoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; }
    268266#endif
     267#if RESOLUTION_BASED_DPB
     268  Void setSubDpbIdx(Int idx)    { m_subDpbIdx = idx; }
     269  Int  getSubDpbIdx()           { return m_subDpbIdx; }
     270  Void assignSubDpbs(TComVPS *vps);
     271#endif
    269272};// END CLASS DEFINITION TDecTop
    270273
Note: See TracChangeset for help on using the changeset viewer.