Changeset 964 in 3DVCSoftware for trunk/source/Lib/TLibDecoder


Ignore:
Timestamp:
5 Jul 2014, 05:16:45 (11 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.
Location:
trunk/source/Lib/TLibDecoder
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/AnnexBread.h

    r872 r964  
    6565  , m_Input(istream)
    6666  {
    67     istream.exceptions(std::istream::eofbit);
     67    istream.exceptions(std::istream::eofbit | std::istream::badbit);
    6868  }
    6969
  • trunk/source/Lib/TLibDecoder/NALread.cpp

    r872 r964  
    127127  else
    128128  {
     129#if H_MV_HLS_8_GEN_Q0108_13
     130
     131    // If nal_unit_type is in the range of BLA_W_LP to RSV_IRAP_VCL23, inclusive, i.e. the coded
     132    // slice segment belongs to an IRAP picture, TemporalId shall be equal to 0.
     133    // Otherwise, when nal_unit_type is equal to TSA_R, TSA_N, STSA_R, or STSA_N, TemporalId shall not be equal to 0.
     134    // Otherwise, if nal_unit_type is equal to TSA or TSA_N, TemporalId shall not be equal to 0.
     135    // Otherwise, when nuh_layer_id is equal to 0 and nal_unit_type is equal to STSA_R or STSA_N,
     136    // TemporalId shall not be equal to 0.
     137
     138    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
     139         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N    );
     140
     141    assert( nalu.m_layerId > 0
     142      || ( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
     143        && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ) );
     144#else
    129145    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    130146         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    131147         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
    132148         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N );
     149#endif
    133150  }
    134151}
  • trunk/source/Lib/TLibDecoder/SEIread.cpp

    r884 r964  
    399399{
    400400  UInt val;
    401   READ_CODE(4, val, "active_vps_id");      sei.activeVPSId = val;
    402   READ_FLAG( val, "full_random_access_flag");  sei.m_fullRandomAccessFlag = val ? true : false;
    403   READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;
     401  READ_CODE(4, val, "active_video_parameter_set_id");   sei.activeVPSId = val;
     402  READ_FLAG(   val, "self_contained_cvs_flag");         sei.m_selfContainedCvsFlag = val ? true : false;
     403  READ_FLAG(   val, "no_parameter_set_update_flag");    sei.m_noParameterSetUpdateFlag = val ? true : false;
    404404  READ_UVLC(   val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
    405405
    406   sei.activeSeqParamSetId.resize(sei.numSpsIdsMinus1 + 1);
     406  sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1);
    407407  for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++)
    408408  {
    409     READ_UVLC(val, "active_seq_param_set_id");  sei.activeSeqParamSetId[i] = val;
    410   }
    411 
    412   UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned();
    413  
    414   while(uibits--)
    415   {
    416     READ_FLAG(val, "alignment_bit");
    417   }
     409    READ_UVLC(val, "active_seq_parameter_set_id");      sei.activeSeqParameterSetId[i] = val;
     410  }
     411
     412  xParseByteAlign();
    418413}
    419414
     
    681676    case 4:
    682677      {
    683         READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedValue = val;
    684         if( sei.m_cameraIsoSpeedValue == 255) //Extended_ISO
     678        READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedIdc = val;
     679        if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO
    685680        {
    686681          READ_CODE( 32,   val,   "camera_iso_speed_value" );            sei.m_cameraIsoSpeedValue = val;
     682        }
     683        READ_CODE( 8, val, "exposure_index_idc" );                       sei.m_exposureIndexIdc = val;
     684        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     685        {
     686          READ_CODE( 32,   val,   "exposure_index_value" );              sei.m_exposureIndexValue = val;
    687687        }
    688688        READ_FLAG( val, "exposure_compensation_value_sign_flag" );       sei.m_exposureCompensationValueSignFlag = val;
  • 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  }
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r884 r964  
    6767  Int**    m_aaiTempOffset;
    6868#endif
     69
    6970public:
    7071
     
    8081  Void  parseRepFormat      ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
    8182  Void  parseVPSVUI         ( TComVPS* pcVPS );
    82   Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo );
     83  Void  parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo );
    8384  Void  parseDpbSize        ( TComVPS* pcVPS );
    84   Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS );
     85  Void  parseVpsVuiBspHrdParameters( TComVPS* pcVPS );
    8586#endif
    8687
     
    108109  Void  parseProfileTier    (ProfileTierLevel *ptl);
    109110  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
     111#if H_MV_HLS_8_HRD_Q0102_08
     112  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx);
     113#else
    110114  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager);
     115#endif
    111116  Void  parseTerminatingBit ( UInt& ruiBit );
    112117 
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r950 r964  
    11131113{
    11141114  UInt  uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 );
    1115   UInt  uiNumPart     = pcCU->getNumPartInter();
     1115  UInt  uiNumPart     = pcCU->getNumPartitions();
    11161116  UInt  uiNumQParts   = pcCU->getTotalNumPart() >> 2;
    11171117 
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r884 r964  
    6767  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    6868#if H_3D
    69   virtual Void  parseSPS                  ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag  )         = 0;
     69  virtual Void  parseSPS                  ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag  )                    = 0;
    7070#else
    7171  virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
     
    7777#endif
    7878
     79#if H_MV_HLS_8_HRD_Q0102_08
     80  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx )       = 0;
     81#else
    7982  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)       = 0;
     83#endif
    8084
    8185  virtual Void  parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
     
    125129  virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
    126130 
    127   virtual ~TDecEntropyIf() {}
     131  virtual ~TDecEntropyIf() {};
    128132};
    129133
     
    160164  Void    decodePPS                   ( TComPPS* pcPPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS);                    }
    161165#endif
     166#if H_MV_HLS_8_HRD_Q0102_08
     167  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, targetOlsIdx );         }
     168#else
    162169  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager);         }
    163 
     170#endif
    164171  Void    decodeTerminatingBit        ( UInt& ruiIsLast )       { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast);     }
    165172 
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r872 r964  
    249249  }
    250250
     251#if !H_MV_HLS_7_VPS_P0300_27
     252#if SETTING_PIC_OUTPUT_MARK
     253  rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false);
     254#else
    251255  rpcPic->setOutputMark(true);
     256#endif
    252257  rpcPic->setReconMark(true);
     258#endif
    253259}
    254260
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r950 r964  
    957957        assert(0);
    958958      }
     959#endif
    959960#if H_MV_ENC_DEC_TRAC         
    960961      DTRACE_CU("part_mode", eMode )
    961962#endif
     963#if H_3D_QTLPC
    962964    }
    963965#endif
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r950 r964  
    8787#endif
    8888
     89#if H_MV_HLS_8_HRD_Q0102_08
     90  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/, Int targetOlsIdx ) {}
     91#else
    8992  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
     93#endif
    9094  Void  parseTerminatingBit       ( UInt& ruiBit );
    9195  Void  parseMVPIdx               ( Int& riMVPIdx          );
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r884 r964  
    365365  m_prevSliceSkipped = false;
    366366  m_skippedPOC = 0;
     367#if SETTING_NO_OUT_PIC_PRIOR
     368  m_bFirstSliceInBitstream  = true;
     369  m_lastPOCNoOutputPriorPics = -1;
     370  m_craNoRaslOutputFlag = false;
     371  m_isNoOutputPriorPics = false;
     372#endif
     373#if H0056_EOS_CHECKS
     374  m_isLastNALWasEos = false;
     375#endif
    367376#if H_MV
    368377  m_layerId = 0;
     
    372381  m_isDepth = false;
    373382  m_pcCamParsCollector = 0;
     383#endif
     384#if H_MV_HLS_8_HRD_Q0102_08
     385  m_targetOptLayerSetIdx = -1;
    374386#endif
    375387#endif
     
    471483    TComVPS* vps         = pcSlice->getVPS();
    472484    TComDpbSize* dpbSize = vps->getDpbSize();
    473     Int lsIdx            = vps->getLayerSetIdxForOutputLayerSet( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
     485    Int lsIdx            = vps->olsIdxToLsIdx( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
    474486    Int layerIdx         = vps->getIdxInLayerSet     ( lsIdx, getLayerId() );
    475487    Int subDpbIdx        = dpbSize->getSubDpbAssigned( lsIdx, layerIdx );
     
    499511    {
    500512      rpcPic->setOutputMark(false);
     513#if H_MV_HLS_7_VPS_P0300_27
     514      rpcPic->setPicOutputFlag(false);
     515#endif
    501516      bBufferIsAvailable = true;
    502517      break;
     
    506521    {
    507522      rpcPic->setOutputMark(false);
     523#if H_MV_HLS_7_VPS_P0300_27
     524      rpcPic->setPicOutputFlag(false);
     525#endif
    508526      rpcPic->setReconMark( false );
    509527      rpcPic->getPicYuvRec()->setBorderExtension( false );
     
    550568  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    551569  TComSlice::markCurrPic( pcPic );
     570#if !H_MV_HLS_8_DBP_NODOC_42
    552571  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
    553572#endif
     573#endif
    554574  m_bFirstSliceInPicture  = true;
    555575
    556576  return;
    557577}
     578
     579#if SETTING_NO_OUT_PIC_PRIOR
     580Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic)
     581{
     582  if (!rpcListPic || !m_isNoOutputPriorPics) return;
     583
     584  TComList<TComPic*>::iterator  iterPic   = rpcListPic->begin();
     585
     586  while (iterPic != rpcListPic->end())
     587  {
     588    TComPic*& pcPicTmp = *(iterPic++);
     589    if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC())
     590    {
     591      pcPicTmp->setOutputMark(false);
     592#if H_MV_HLS_7_VPS_P0300_27
     593      pcPicTmp->setPicOutputFlag(false);
     594#endif
     595    }
     596  }
     597}
     598#endif
    558599
    559600Void TDecTop::xCreateLostPicture(Int iLostPoc)
     
    620661  TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
    621662  assert (vps != 0);
    622   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )
     663  if (!m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )
    623664#else
    624665  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
     
    628669    assert (0);
    629670  }
     671
     672#if H_MV_HLS_8_HRD_Q0102_08
     673  sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false );
     674#endif
     675
     676#if H_MV_HLS_8_RPS_Q0100_36
     677  vps->inferDbpSizeLayerSetZero( sps, false );
     678#endif
     679
     680#if H_MV_HLS_8_PMS_Q0195_21
     681  // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
     682  if ( vps->getVpsNumRepFormatsMinus1() == 0 )
     683  {
     684    //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0.
     685    assert( sps->getUpdateRepFormatFlag() == false );
     686  }
     687#endif
     688
     689#if H_MV_HLS_8_RPS_Q0100_36
     690  sps->checkRpsMaxNumPics( vps, getLayerId() );
     691#endif
     692
     693#if H_MV_HLS_8_MIS_Q0177_22
     694  if( m_layerId > 0 )
     695  {
     696    sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
     697  }
     698#endif
    630699
    631700  if( pps->getDependentSliceSegmentsEnabledFlag() )
     
    719788  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    720789#endif
     790
     791#if H_MV_HLS_8_HRD_Q0102_08
     792  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx );
     793#else
    721794  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    722 
     795#endif
    723796  // set POC for dependent slices in skipped pictures
    724797  if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped)
     
    741814#endif
    742815
     816#if SETTING_NO_OUT_PIC_PRIOR
     817  //For inference of NoOutputOfPriorPicsFlag
     818  if (m_apcSlicePilot->getRapPicFlag())
     819  {
     820    if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
     821        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
     822        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
     823    {
     824      m_apcSlicePilot->setNoRaslOutputFlag(true);
     825    }
     826    //the inference for NoOutputPriorPicsFlag
     827    if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag())
     828    {
     829      if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     830      {
     831        m_apcSlicePilot->setNoOutputPriorPicsFlag(true);
     832      }
     833    }
     834    else
     835    {
     836      m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
     837    }
     838
     839    if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     840    {
     841      m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag();
     842    }
     843  }
     844  if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag())
     845  {
     846    m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC();
     847    m_isNoOutputPriorPics = true;
     848  }
     849  else
     850  {
     851    m_isNoOutputPriorPics = false;
     852  }
     853
     854  //For inference of PicOutputFlag
     855  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
     856  {
     857    if ( m_craNoRaslOutputFlag )
     858    {
     859      m_apcSlicePilot->setPicOutputFlag(false);
     860    }
     861  }
     862#endif
     863
     864#if FIX_POC_CRA_NORASL_OUTPUT
     865  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
     866  {
     867    Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
     868    m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
     869  }
     870#endif
    743871#if H_MV
    744872    xCeckNoClrasOutput();
     
    769897
    770898  //we should only get a different poc for a new picture (with CTU address==0)
    771   if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0))
     899  if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0))
    772900  {
    773901    printf ("Warning, the first slice of a picture might have been lost!\n");
     
    810938  }
    811939  m_bFirstSliceInSequence = false;
     940#if SETTING_NO_OUT_PIC_PRIOR 
     941  m_bFirstSliceInBitstream  = false;
     942#endif
    812943  //detect lost reference picture and insert copy of earlier frame.
    813944  Int lostPoc;
     
    11271258#endif
    11281259#if H_3D
    1129   // Preliminary fix. assuming that all sps refer to the same SPS.
     1260  // Preliminary fix. assuming that all sps refer to the same VPS.
    11301261  // Parsing dependency should be resolved!
    11311262  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    1132   assert( vps != 0 ); 
     1263  assert( vps != 0 );
    11331264  m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) );
    11341265#else
     
    11821313      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    11831314      m_parameterSetManagerDecoder.applyPrefetchedPS();
    1184       assert(seiAps->activeSeqParamSetId.size()>0);
    1185 #if H_MV
    1186       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId ))
    1187 #else
    1188       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     1315      assert(seiAps->activeSeqParameterSetId.size()>0);
     1316#if H_MV
     1317      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0], m_layerId ))
     1318#else
     1319      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))
    11891320#endif
    11901321      {
     
    12091340    case NAL_UNIT_VPS:
    12101341      xDecodeVPS();
     1342#if H0056_EOS_CHECKS
     1343      m_isLastNALWasEos = false;
     1344#endif
    12111345      return false;
    12121346     
     
    12211355    case NAL_UNIT_PREFIX_SEI:
    12221356    case NAL_UNIT_SUFFIX_SEI:
     1357#if H0056_EOS_CHECKS
     1358      if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI )
     1359      {
     1360        assert( m_isLastNALWasEos == false );
     1361      }
     1362#endif
    12231363      xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType );
    12241364      return false;
     
    12401380    case NAL_UNIT_CODED_SLICE_RASL_N:
    12411381    case NAL_UNIT_CODED_SLICE_RASL_R:
     1382#if H0056_EOS_CHECKS
     1383      if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N ||
     1384          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N ||
     1385          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N ||
     1386          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1387          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N )
     1388      {
     1389        assert( m_isLastNALWasEos == false );
     1390      }
     1391      else
     1392      {
     1393        m_isLastNALWasEos = false;
     1394      }
     1395#endif
    12421396#if H_MV
    12431397      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
     
    12471401      break;
    12481402    case NAL_UNIT_EOS:
     1403#if H0056_EOS_CHECKS
     1404      assert( m_isLastNALWasEos == false );
     1405      //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything.
     1406      if (nalu.m_layerId > 0)
     1407      {
     1408        printf( "\nThis bitstream has EOS with non-zero layer id.\n" );
     1409        return false;
     1410      }
     1411      m_isLastNALWasEos = true;
     1412#endif
    12491413      m_associatedIRAPType = NAL_UNIT_INVALID;
    12501414      m_pocCRA = 0;
     
    12641428      return false;
    12651429     
     1430    case NAL_UNIT_FILLER_DATA:
     1431#if H_MV
     1432      assert( m_isLastNALWasEos == false );
     1433#endif
     1434      return false;
    12661435     
    12671436    case NAL_UNIT_RESERVED_VCL_N10:
     
    12841453    case NAL_UNIT_RESERVED_VCL31:
    12851454     
    1286     case NAL_UNIT_FILLER_DATA:
    12871455    case NAL_UNIT_RESERVED_NVCL41:
    12881456    case NAL_UNIT_RESERVED_NVCL42:
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r884 r964  
    195195  Bool*                    m_layerInitilizedFlag; // initialization Layers
    196196  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     197#if  H_MV_HLS_8_HRD_Q0102_08
     198  Int                      m_targetOptLayerSetIdx;
     199#endif
    197200#else
    198201  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     
    225228  Bool                    m_prevSliceSkipped;
    226229  Int                     m_skippedPOC;
     230#if SETTING_NO_OUT_PIC_PRIOR 
     231  Bool                    m_bFirstSliceInBitstream;
     232  Int                     m_lastPOCNoOutputPriorPics;
     233  Bool                    m_isNoOutputPriorPics;
     234  Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
     235#endif
     236#if H0056_EOS_CHECKS
     237  Bool                    m_isLastNALWasEos;
     238#endif
    227239
    228240#if H_MV
     
    258270 
    259271  Void  deletePicBuffer();
     272#if H_MV
     273#if H_MV_HLS_7_VPS_P0300_27
     274  TComVPS* getActiveVPS() { return m_parameterSetManagerDecoder.getActiveVPS( ); }
     275#endif
     276  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS( m_layerId ); }
     277#else
     278  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }
     279#endif
    260280
    261281#if H_MV
     
    265285#endif
    266286 
     287#if SETTING_NO_OUT_PIC_PRIOR 
     288  Void  checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic);
     289
     290  Bool  getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; }
     291  Void  setNoOutputPriorPicsFlag (bool val) { m_isNoOutputPriorPics = val; }
     292#endif
    267293#if H_MV   
    268294  TComPic*                getPic                ( Int poc );
     
    270296  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    271297  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
     298#if  H_MV_HLS_8_HRD_Q0102_08
     299  Void                    setTargetOptLayerSetIdx( Int targetOptLayerSetIdx ) { m_targetOptLayerSetIdx = targetOptLayerSetIdx; }   
     300#endif
    272301  TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
    273302  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
Note: See TracChangeset for help on using the changeset viewer.