Changeset 964 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp


Ignore:
Timestamp:
5 Jul 2014, 05:16:45 (10 years ago)
Author:
tech
Message:
  • Merged 11.0-dev0@963. (Update to HM 14.0 + MV-HEVC Draft 8 HLS)
  • Added coding results.
  • Changed version number.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r950 r964  
    364364  READ_FLAG( uiCode, "slice_segment_header_extension_present_flag");
    365365  pcPPS->setSliceHeaderExtensionPresentFlag(uiCode);
    366 
     366 
     367#if H_MV
     368  READ_FLAG( uiCode, "pps_extension_present_flag");
     369#else
    367370  READ_FLAG( uiCode, "pps_extension_flag");
     371#endif
    368372  if (uiCode)
    369373  {
     374
    370375#if H_MV
     376#if H_MV_HLS_8_SPS_NODOC_48
     377    READ_FLAG( uiCode, "pps_range_extensions_flag" ); pcPPS->setPpsRangeExtensionsFlag( uiCode == 1 );
     378    READ_FLAG( uiCode, "pps_multilayer_extension_flag" ); pcPPS->setPpsMultilayerExtensionFlag( uiCode == 1 );
     379#if !H_3D
     380    READ_CODE( 6, uiCode, "pps_extension_6bits" ); pcPPS->setPpsExtension6bits( uiCode );
     381#else
     382    READ_FLAG( uiCode, "pps_3d_extension_flag" ); pcPPS->setPps3dExtensionFlag( uiCode == 1 );
     383    READ_CODE( 5, uiCode, "pps_extension_5bits" ); pcPPS->setPpsExtension5bits( uiCode );
     384#endif
     385    if ( pcPPS->getPpsRangeExtensionsFlag() )
     386    {
     387      assert(0);
     388    }
     389
     390    if ( pcPPS->getPpsMultilayerExtensionFlag() )
     391    {
     392        READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
     393#if H_MV_HLS_8_PPS_NODOC_NN
     394        READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
     395#endif
     396    }
     397#if !H_3D
     398    if ( pcPPS->getPpsExtension6bits() )
     399    {
     400#else
     401    if ( pcPPS->getPps3dExtensionFlag() )
     402    {
     403      parsePPSExtension( pcPPS, pcVPS );
     404    }
     405    if ( pcPPS->getPpsExtension5bits() )
     406    {
     407#endif
     408#else
    371409    for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
    372410    {
     
    395433    {
    396434#endif
     435#endif
     436
    397437      while ( xMoreRbspData() )
    398438      {
     
    845885  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    846886  {
    847 #if H_MV
    848887    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    849 #else
    850     READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1");
    851 #endif
    852888    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    853 #if H_MV
    854889    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
    855 #else
    856     READ_UVLC ( uiCode, "sps_num_reorder_pics" );
    857 #endif
    858890    pcSPS->setNumReorderPics(uiCode, i);
    859 #if H_MV
    860891    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    861 #else
    862     READ_UVLC ( uiCode, "sps_max_latency_increase_plus1");
    863 #endif
    864892    pcSPS->setMaxLatencyIncrease( uiCode, i );
    865893
     
    9781006  }
    9791007
     1008
     1009#if H_MV
     1010  READ_FLAG( uiCode, "sps_extension_present_flag");
     1011  pcSPS->setSpsExtensionPresentFlag( uiCode );
     1012  if (pcSPS->getSpsExtensionPresentFlag( ) )
     1013#else
    9801014  READ_FLAG( uiCode, "sps_extension_flag");
     1015  if (uiCode)
     1016#endif
     1017  {
    9811018#if H_MV
    982   pcSPS->setSpsExtensionFlag( uiCode );
    983   if (pcSPS->getSpsExtensionFlag( ) )
    984 #else
    985   if (uiCode)
    986 #endif
    987   {
    988 #if H_MV
     1019#if H_MV_HLS_8_SPS_NODOC_48
     1020    READ_FLAG( uiCode, "sps_range_extensions_flag" ); pcSPS->setSpsRangeExtensionsFlag( uiCode == 1 );
     1021    READ_FLAG( uiCode, "sps_multilayer_extension_flag" ); pcSPS->setSpsMultilayerExtensionFlag( uiCode == 1 );
     1022#if !H_3D
     1023    READ_CODE( 6, uiCode, "sps_extension_6bits" ); pcSPS->setSpsExtension6bits( uiCode );
     1024#else
     1025    READ_FLAG( uiCode, "sps_3d_extension_flag" ); pcSPS->setSps3dExtensionFlag( uiCode == 1 );
     1026    READ_CODE( 5, uiCode, "sps_extension_5bits" ); pcSPS->setSpsExtension5bits( uiCode );
     1027#endif
     1028  }
     1029
     1030  if ( pcSPS->getSpsRangeExtensionsFlag() )
     1031  {
     1032    assert( 0 );
     1033  }
     1034
     1035  if ( pcSPS->getSpsMultilayerExtensionFlag() )
     1036  {
     1037    parseSPSExtension( pcSPS );
     1038  }
     1039
     1040#if H_3D
     1041  if ( pcSPS->getSps3dExtensionFlag() )
     1042  {
     1043    parseSPSExtension2( pcSPS, viewIndex, depthFlag  );
     1044  }
     1045
     1046  if ( pcSPS->getSpsExtension5bits() )
     1047  {
     1048#else
     1049  if ( pcSPS->getSpsExtension6bits() )
     1050  {
     1051#endif
     1052#else
    9891053    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
    9901054    {
     
    10121076    {   
    10131077#endif
     1078#endif
    10141079        while ( xMoreRbspData() )
    10151080        {
    10161081          READ_FLAG( uiCode, "sps_extension_data_flag");
    10171082        }
    1018 #if H_MV
     1083#if H_MV && !H_MV_HLS_8_SPS_NODOC_48
    10191084    }
    10201085#endif
     
    10671132 
    10681133  READ_CODE( 4,  uiCode,  "vps_video_parameter_set_id" );         pcVPS->setVPSId( uiCode );
     1134#if H_MV_HLS_8_SYN_Q0041_03
     1135  READ_FLAG( uiCode, "vps_base_layer_internal_flag" );            pcVPS->setVpsBaseLayerInternalFlag( uiCode == 1 );
     1136  READ_FLAG( uiCode, "vps_reserved_one_bit" );                    assert( uiCode == 1 );
     1137#else
    10691138  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
     1139#endif
    10701140#if H_MV
    10711141  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( std::min( uiCode, (UInt) ( MAX_NUM_LAYER_IDS-1) )  );
     
    10731143  READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
    10741144#endif
    1075   READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 );
     1145  READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 );    assert(uiCode+1 <= MAX_TLAYER);
    10761146  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    10771147  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
     
    11511221    }
    11521222  }
     1223#if H_MV_HLS_8_RPS_Q0100_36
     1224  READ_FLAG( uiCode,  "vps_extension_flag" );                      pcVPS->setVpsExtensionFlag( uiCode == 1 ? true : false );
     1225  if ( pcVPS->getVpsExtensionFlag() )
     1226#else
    11531227  READ_FLAG( uiCode,  "vps_extension_flag" );
    11541228  if (uiCode)
     1229#endif
    11551230  {
    11561231#if H_MV
     
    11871262{
    11881263  UInt uiCode;
     1264#if !H_MV_HLS_8_SYN_Q0041_03
    11891265  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
     1266#endif
    11901267
    11911268  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
     
    12671344      READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode );   
    12681345      pcVPS->checkSubLayersVpsMaxMinus1( i );
    1269 
    12701346    }
    12711347  } 
     
    12941370
    12951371  READ_FLAG( uiCode, "all_ref_layers_active_flag" );             pcVPS->setAllRefLayersActiveFlag( uiCode == 1 );
    1296 
    12971372  READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 
    12981373
     
    13091384  }
    13101385
    1311   READ_UVLC( uiCode, "num_add_output_layer_sets"      ); pcVPS->setNumAddOutputLayerSets( uiCode );
     1386#if H_MV_HLS_8_SYN_39_19
     1387  if ( pcVPS->getNumIndependentLayers() > 1 )
     1388  {
     1389   READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
     1390  }
     1391  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1392  {
     1393    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
     1394    {
     1395      READ_CODE( pcVPS->getHighestLayerIdxPlus1Len( j ) , uiCode, "highest_layer_idx_plus1" ); pcVPS->setHighestLayerIdxPlus1( i, j, uiCode );
     1396    }
     1397  }
     1398  if (pcVPS->getNumLayerSets() > 1)
     1399  {
     1400    READ_UVLC( uiCode, "num_add_olss" ); pcVPS->setNumAddOlss( uiCode );
     1401    READ_CODE( 2, uiCode, "default_output_layer_idc" ); pcVPS->setDefaultOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
     1402  }
     1403
     1404  pcVPS->initTargetLayerIdLists( );
     1405
     1406#else
     1407  READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
    13121408  pcVPS->initTargetLayerIdLists( );
    13131409  if( pcVPS->getNumOutputLayerSets() > 1)
    13141410  {
    1315     READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); pcVPS->setDefaultTargetOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
     1411    READ_CODE( 2, uiCode, "default_output_layer_idc" ); pcVPS->setDefaultOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
    13161412  } 
     1413#endif
    13171414
    13181415  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
    1319   pcVPS->setOutputLayerSetIdxMinus1(0, -1);
     1416  pcVPS->setLayerSetIdxForOlsMinus1(0, -1);
    13201417
    13211418  pcVPS->deriveTargetLayerIdList( 0 );
     1419
    13221420  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
    13231421  {
     1422#if H_MV_HLS_8_SYN_39_19
     1423    if( i >= pcVPS->getNumLayerSets( ) )   
     1424#else
    13241425    if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
     1426#endif
    13251427    {       
    1326       READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );
    1327     }
    1328 
    1329     if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultTargetOutputLayerIdc() == 2 )
     1428      READ_UVLC( uiCode,      "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode );
     1429    }
     1430
     1431    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() == 2 )
    13301432    {       
    1331       for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1433      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
    13321434      {
    13331435        READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );
     
    13361438    else
    13371439    {
    1338       for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1440      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
    13391441      {             
    13401442        pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j ));
     
    13471449      READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode );
    13481450    }
    1349 
    13501451    if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
    13511452    {
     
    13541455  }
    13551456
     1457#if !H_MV_HLS_8_PMS_Q0195_20
    13561458  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    13571459  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    13591461    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
    13601462  }
     1463#else
     1464  READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
     1465#endif
    13611466
    13621467  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
     
    13691474  }
    13701475
     1476#if H_MV_HLS_8_PMS_Q0195_20
     1477  if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
     1478  {
     1479    READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
     1480  }
     1481#endif
    13711482  if( pcVPS->getRepFormatIdxPresentFlag() )
    13721483  {
     1484#if H_MV_HLS_8_SYN_Q0041_03
     1485    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1486#else
    13731487    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1374     {
     1488#endif
     1489    {
     1490#if !H_MV_HLS_8_PMS_Q0195_20
    13751491      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    13761492      {
     1493#endif
    13771494        READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1378       }
    1379     }
    1380   }
     1495#if !H_MV_HLS_8_PMS_Q0195_20
     1496      }
     1497#endif
     1498    }
     1499  }
     1500#if H_MV_HLS_8_PMS_Q0195_20
     1501  else
     1502  {
     1503#if H_MV_HLS_8_SYN_Q0041_03
     1504    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1505#else
     1506    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1507#endif
     1508    {
     1509      pcVPS->setVpsRepFormatIdx( i, pcVPS->inferVpsRepFormatIdx( i ) );
     1510    }
     1511  }
     1512#endif
    13811513
    13821514  READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 );
     
    14031535  }
    14041536
     1537#if H_MV_HLS_8_SYN_Q0041_03
     1538  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ?  1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1539  {
     1540    for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ?  0 : 1; j < i; j++ )
     1541#else
    14051542  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    14061543  {
    14071544    for( Int j = 0; j < i; j++ )
     1545#endif
    14081546    {
    14091547      if (pcVPS->getDirectDependencyFlag( i, j) )
     
    14151553        else
    14161554        {
     1555
    14171556          READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
    14181557        }
     
    14201559    }
    14211560  } 
    1422 
    14231561  READ_UVLC( uiCode, "vps_non_vui_extension_length" ); pcVPS->setVpsNonVuiExtensionLength( uiCode );
    14241562  for ( Int i = 1; i <= pcVPS->getVpsNonVuiExtensionLength(); i++ )
     
    14371575    pcVPSVUI->inferVpsVui( false );
    14381576  }
    1439 
    14401577  pcVPS->checkVPSExtensionSyntax();
    14411578}
     
    14921629  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    14931630  {
     1631#if H_MV_HLS_8_SYN_Q0041_03
     1632    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1633#else
    14941634    for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1495     {
     1635#endif
     1636    {
     1637#if H_MV_HLS_8_MIS_Q0102_30
     1638      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1639#else       
    14961640      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
     1641#endif
    14971642      {
    14981643        if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
     
    15511696    }
    15521697  }
    1553 
    15541698  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
    15551699  if( !pcVPSVUI->getTilesNotInUseFlag() )
    15561700  {     
     1701#if H_MV_HLS_8_SYN_Q0041_03
     1702    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1703#else
    15571704    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1705#endif
    15581706    {
    15591707      READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 );
     
    15631711      }
    15641712    } 
    1565 
    1566     for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1713#if H_MV_HLS_8_SYN_Q0041_03
     1714    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1715#else
     1716    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )     
     1717#endif
    15671718    {
    15681719      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     
    15861737    }
    15871738  }
    1588 
    15891739  READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" );
    15901740  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
     
    15961746      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    15971747      {
    1598         READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
    1599         if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
    1600         {
    1601           READ_FLAG( uiCode, "ctu_based_offset_enabled_flag" ); pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, uiCode == 1 );
    1602           if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1748#if H_MV_HLS_8_SYN_Q0041_03
     1749        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1750        {       
     1751#endif
     1752          READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
     1753          if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
    16031754          {
    1604             READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1" ); pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, uiCode );
     1755            READ_FLAG( uiCode, "ctu_based_offset_enabled_flag" ); pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, uiCode == 1 );
     1756            if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1757            {
     1758              READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1" ); pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, uiCode );
     1759            }
    16051760          }
    1606         }
     1761#if H_MV_HLS_8_SYN_Q0041_03
     1762        }
     1763#endif
    16071764      }
    16081765    }
     
    16131770  {
    16141771    parseVpsVuiBspHrdParameters( pcVPS );
    1615 }
     1772  }
    16161773  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    16171774  {
     
    16511808    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
    16521809    {
     1810#if H_MV_HLS_8_HRD_Q0101_04
     1811      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ ) 
     1812      {
     1813        READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
     1814#else
    16531815      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
    16541816      {
     
    16611823          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
    16621824        }
     1825#endif
    16631826      }
    16641827    }
     
    16671830    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
    16681831    { 
    1669       READ_UVLC( uiCode, "num_bsp_sched_combinations" ); vpsVuiBspHrdP->setNumBspSchedCombinations( h, uiCode );
    1670       for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ )
     1832      READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1" ); vpsVuiBspHrdP->setNumBspSchedCombinationsMinus1( h, uiCode );
     1833#if H_MV_HLS_8_HRD_Q0182_05
     1834      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
     1835#else
     1836      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
     1837#endif
    16711838      {
    16721839        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
    16731840        { 
     1841#if H_MV_HLS_8_HRD_Q0101_04
     1842          READ_CODE( vpsVuiBspHrdP->getBspCombHrdIdxLen(), uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
     1843#else
    16741844          READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
     1845#endif
    16751846          READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode );
     1847#if H_MV_HLS_8_HRD_Q0101_04
     1848          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j );
     1849#endif
    16761850        } 
    16771851      }
     
    16981872  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
    16991873  { 
     1874#if H_MV_HLS_8_MIS_Q0102_30
     1875    Int currLsIdx = vps->olsIdxToLsIdx( i );
     1876#endif
    17001877    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
     1878#if H_MV_HLS_8_MIS_Q0102_30
     1879    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
     1880#else
    17011881    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1882#endif
    17021883    { 
    17031884      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    17071888      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    17081889      { 
    1709         for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
     1890#if H_MV_HLS_8_MIS_Q0102_30
     1891        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
     1892#else
     1893        for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ )   
     1894#endif
    17101895        {
    17111896          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
    17121897        }
    17131898        READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode );
    1714 #if H_MV_HLS7_GEN
    1715         if( vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ) != vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ) )
    1716         {
    1717           for( Int k = 0; k < vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )
    1718           {
    1719             READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1" ); dpbSize->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode );
    1720           }
    1721         }
    1722 #endif
    17231899        READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode );
    17241900      }
     
    17271903        if ( j > 0 )
    17281904        {
    1729           for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1905#if H_MV_HLS_8_DBP_NODOC_42
     1906          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
     1907#else
     1908          for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ )   
     1909#endif
    17301910          {
    17311911            dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     
    18582038#endif
    18592039
     2040#if H_MV_HLS_8_HRD_Q0102_08
     2041Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)
     2042#else
    18602043Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)
     2044#endif
    18612045{
    18622046  UInt  uiCode;
     
    18762060  if( rpcSlice->getRapPicFlag())
    18772061  {
    1878     READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored
    1879   }
     2062    READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored -- updated already
     2063#if SETTING_NO_OUT_PIC_PRIOR
     2064    rpcSlice->setNoOutputPriorPicsFlag(uiCode ? true : false);
     2065#else
     2066    rpcSlice->setNoOutputPicPrior( false );
     2067#endif
     2068  }
     2069
    18802070  READ_UVLC (    uiCode, "slice_pic_parameter_set_id" );  rpcSlice->setPPSId(uiCode);
    18812071  pps = parameterSetManager->getPrefetchedPPS(uiCode);
     
    18912081  sps->inferRepFormat  ( vps , rpcSlice->getLayerId() );
    18922082  sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
     2083#if H_MV_HLS_8_HRD_Q0102_08
     2084  sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false );
     2085#endif
     2086#if H_MV_HLS_8_RPS_Q0100_36
     2087  vps->inferDbpSizeLayerSetZero( sps, false );
     2088#endif
     2089
    18932090  if ( sps->getVuiParametersPresentFlag() )
    18942091  {
     
    19442141  }
    19452142 
     2143#if H0044_POC_LSB_NOT_PRESENT
     2144    UInt slicePicOrderCntLsb = 0;
     2145#endif
     2146
    19462147  if(!rpcSlice->getDependentSliceSegmentFlag())
    19472148  {
     
    19942195
    19952196#if H_MV
     2197#if !H0044_POC_LSB_NOT_PRESENT
    19962198    UInt slicePicOrderCntLsb = 0;
     2199#endif
    19972200    Int iPOClsb = slicePicOrderCntLsb;  // Needed later
    19982201    if ( (rpcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( rpcSlice->getLayerIdInVps())) || !rpcSlice->getIdrPicFlag() )
     
    20002203      READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb");       
    20012204    }   
     2205#if H_MV_HLS_8_POC_Q0142_32
     2206    rpcSlice->setSlicePicOrderCntLsb( slicePicOrderCntLsb );
     2207#endif
    20022208
    20032209    Bool picOrderCntMSBZeroFlag = false;     
     
    20932299      READ_FLAG( uiCode, "short_term_ref_pic_set_sps_flag" );
    20942300      if(uiCode == 0) // use short-term reference picture set explicitly signalled in slice header
    2095       {
     2301      {       
    20962302        parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
     2303#if H_MV_HLS_8_RPS_Q0100_36
     2304        if ( !rps->getInterRPSPrediction( ) )
     2305        { // check sum of num_positive_pics and num_negative_pics
     2306          rps->checkMaxNumPics(
     2307            vps->getVpsExtensionFlag(),
     2308            vps->getMaxNumPics( rpcSlice->getLayerId() ),
     2309            rpcSlice->getLayerId(),
     2310            sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
     2311        }
     2312#endif
    20972313      }
    20982314      else // use reference to short-term reference picture set in PPS
     
    21982414        rps->setNumberOfPictures(offset);       
    21992415      } 
     2416#if H_MV_HLS_8_RPS_Q0100_36
     2417      if ( !rps->getInterRPSPrediction( ) )
     2418      { // check sum of NumPositivePics, NumNegativePics, num_long_term_sps and num_long_term_pics
     2419        rps->checkMaxNumPics(
     2420          vps->getVpsExtensionFlag(),
     2421          vps->getMaxNumPics( rpcSlice->getLayerId() ),
     2422          rpcSlice->getLayerId(),
     2423          sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
     2424      }
     2425#endif
    22002426      if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    22012427        || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     
    25782804      rpcSlice->setPocResetIdc( 0 );
    25792805    }
    2580 
     2806#if H_MV_HLS_8_POC_Q0142_32
     2807    rpcSlice->checkPocResetIdc();
     2808#endif
     2809
     2810#if H0044_POC_LSB_NOT_PRESENT
     2811    if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && slicePicOrderCntLsb > 0 )
     2812    {
     2813      assert( rpcSlice->getPocResetIdc() != 2 );
     2814    }
     2815#endif
    25812816    if( rpcSlice->getPocResetIdc() !=  0 )
    25822817    {
     
    25932828      READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 );
    25942829      READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode );
     2830#if !H_MV_HLS_8_POC_Q0142_32
     2831#if H0044_POC_LSB_NOT_PRESENT
     2832      if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() )
     2833      {
     2834        assert( rpcSlice->getPocLsbVal() == 0 );
     2835      }
     2836#endif
     2837#endif
    25952838    }         
    2596 
    2597     // Derive the value of PocMsbValRequiredFlag
     2839#if H_MV_HLS_8_POC_Q0142_32
     2840    rpcSlice->checkPocLsbVal();
     2841#endif
     2842
     2843    // Derive the value of PocMs8bValRequiredFlag
    25982844    rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag()
    25992845                                          /* || TODO related to vps_poc_lsb_aligned_flag */
     
    26062852    else
    26072853    {
     2854#if H_MV_HLS_8_POC_Q0146_15
     2855      rpcSlice->setPocMsbValPresentFlag( rpcSlice->inferPocMsbValPresentFlag( ) );
     2856#else
    26082857      if( rpcSlice->getPocMsbValRequiredFlag() )
    26092858      {
     
    26142863        rpcSlice->setPocMsbValPresentFlag( false );
    26152864      }
     2865#endif
    26162866    }
    26172867
     
    26332883      UInt ignore;
    26342884      READ_CODE(8,ignore,"slice_header_extension_data_byte");
    2635     }
    2636   }
     2885    } 
    26372886#endif
    26382887  }
Note: See TracChangeset for help on using the changeset viewer.