Commit e32f3d7a authored by Frank Bossen's avatar Frank Bossen
Browse files

Merge branch 'fix_ticket_1407' into 'master'

Fix #1407: Add missing HRD syntax conditions (JVET-S0175 aspect 6 option 2)

See merge request jvet/VVCSoftware_VTM!1950
parents 09daa046 a54b42fc
......@@ -64,10 +64,11 @@
#define JVET_S0163_ON_TARGETOLS_SUBLAYERS 1 // JVET-S0163: On target OLS and sublayers for decoding (OPI NAL Unit)
#define JVET_R0266_GCI 1 // JVET-R0266 #5: Specify that no_gdr_constraint_flag equal to 1 specifies that sps_gdr_enabled_flag shall be equal to 0
#define JVET_S0084_S0110_RADL 1 // When the current picture is a RADL picture, allow RASL pictures with pps_mixed_nalu_types_in_pic_flag is equal to 1 in active entries in RefPicList[ 0 ] or RefPicList[ 1 ]
#define FIX_TICKET_1405 1 // Add dph_sei_single_component_flag and dph_sei_reserved_zero_7bits syntax to decoded picture hash SEI message
#define FIX_SUBPICS_W_RPR 1 // Fix handling of RPR with subpictures (via scaling windows with no resolution change)
#define JVET_S0175_ASPECT5 1 // use u(8) instead of u(4) for (ffi_)display_elemental_periods_minus1 and pt_display_elemental_periods_minus1
#define JVET_S0175_ASPECT6 1 // The general_nal_hrd_params_present_flag and general_vcl_hrd_params_present_flag are allowed to both be equal to 0
//########### place macros to be be kept below this line ###############
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
......
......@@ -1194,21 +1194,29 @@ void HLSyntaxReader::parseGeneralHrdParameters(GeneralHrdParams *hrd)
READ_CODE(32, symbol, "time_scale"); hrd->setTimeScale(symbol);
READ_FLAG(symbol, "general_nal_hrd_parameters_present_flag"); hrd->setGeneralNalHrdParametersPresentFlag(symbol == 1 ? true : false);
READ_FLAG(symbol, "general_vcl_hrd_parameters_present_flag"); hrd->setGeneralVclHrdParametersPresentFlag(symbol == 1 ? true : false);
CHECK((hrd->getGeneralNalHrdParametersPresentFlag() == 0) && (hrd->getGeneralVclHrdParametersPresentFlag() == 0), "general_nal_hrd_params_present_flag and general_vcl_hrd_params_present_flag in each general_hrd_parameters( ) syntax structure shall not be both equal to 0.");
READ_FLAG(symbol, "general_same_pic_timing_in_all_ols_flag"); hrd->setGeneralSamePicTimingInAllOlsFlag(symbol == 1 ? true : false);
READ_FLAG(symbol, "general_decoding_unit_hrd_params_present_flag"); hrd->setGeneralDecodingUnitHrdParamsPresentFlag(symbol == 1 ? true : false);
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
{
READ_CODE(8, symbol, "tick_divisor_minus2"); hrd->setTickDivisorMinus2(symbol);
}
READ_CODE(4, symbol, "bit_rate_scale"); hrd->setBitRateScale(symbol);
READ_CODE(4, symbol, "cpb_size_scale"); hrd->setCpbSizeScale(symbol);
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
#if JVET_S0175_ASPECT6
if( hrd->getGeneralNalHrdParametersPresentFlag() || hrd->getGeneralVclHrdParametersPresentFlag() )
{
READ_CODE(4, symbol, "cpb_size_du_scale"); hrd->setCpbSizeDuScale(symbol);
#else
CHECK((hrd->getGeneralNalHrdParametersPresentFlag() == 0) && (hrd->getGeneralVclHrdParametersPresentFlag() == 0), "general_nal_hrd_params_present_flag and general_vcl_hrd_params_present_flag in each general_hrd_parameters( ) syntax structure shall not be both equal to 0.");
#endif
READ_FLAG(symbol, "general_same_pic_timing_in_all_ols_flag"); hrd->setGeneralSamePicTimingInAllOlsFlag(symbol == 1 ? true : false);
READ_FLAG(symbol, "general_decoding_unit_hrd_params_present_flag"); hrd->setGeneralDecodingUnitHrdParamsPresentFlag(symbol == 1 ? true : false);
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
{
READ_CODE(8, symbol, "tick_divisor_minus2"); hrd->setTickDivisorMinus2(symbol);
}
READ_CODE(4, symbol, "bit_rate_scale"); hrd->setBitRateScale(symbol);
READ_CODE(4, symbol, "cpb_size_scale"); hrd->setCpbSizeScale(symbol);
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
{
READ_CODE(4, symbol, "cpb_size_du_scale"); hrd->setCpbSizeDuScale(symbol);
}
READ_UVLC(symbol, "hrd_cpb_cnt_minus1"); hrd->setHrdCpbCntMinus1(symbol);
CHECK(symbol > 31,"The value of hrd_cpb_cnt_minus1 shall be in the range of 0 to 31, inclusive");
#if JVET_S0175_ASPECT6
}
READ_UVLC(symbol, "hrd_cpb_cnt_minus1"); hrd->setHrdCpbCntMinus1(symbol);
CHECK(symbol > 31,"The value of hrd_cpb_cnt_minus1 shall be in the range of 0 to 31, inclusive");
#endif
}
void HLSyntaxReader::parseOlsHrdParameters(GeneralHrdParams * generalHrd, OlsHrdParams *olsHrd, uint32_t firstSubLayer, uint32_t maxNumSubLayersMinus1)
{
......@@ -1233,7 +1241,11 @@ void HLSyntaxReader::parseOlsHrdParameters(GeneralHrdParams * generalHrd, OlsHrd
{
READ_UVLC(symbol, "elemental_duration_in_tc_minus1"); hrd->setElementDurationInTcMinus1(symbol);
}
#if JVET_S0175_ASPECT6
else if((generalHrd->getGeneralNalHrdParametersPresentFlag() || generalHrd->getGeneralVclHrdParametersPresentFlag()) && generalHrd->getHrdCpbCntMinus1() == 0)
#else
else if(generalHrd->getHrdCpbCntMinus1() == 0)
#endif
{
READ_FLAG(symbol, "low_delay_hrd_flag"); hrd->setLowDelayHrdFlag(symbol == 1 ? true : false);
}
......
......@@ -715,19 +715,26 @@ void HLSWriter::codeGeneralHrdparameters(const GeneralHrdParams * hrd)
WRITE_CODE(hrd->getTimeScale(), 32, "time_scale");
WRITE_FLAG(hrd->getGeneralNalHrdParametersPresentFlag() ? 1 : 0, "general_nal_hrd_parameters_present_flag");
WRITE_FLAG(hrd->getGeneralVclHrdParametersPresentFlag() ? 1 : 0, "general_vcl_hrd_parameters_present_flag");
WRITE_FLAG(hrd->getGeneralSamePicTimingInAllOlsFlag() ? 1 : 0, "general_same_pic_timing_in_all_ols_flag");
WRITE_FLAG(hrd->getGeneralDecodingUnitHrdParamsPresentFlag() ? 1 : 0, "general_decoding_unit_hrd_params_present_flag");
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
#if JVET_S0175_ASPECT6
if( hrd->getGeneralNalHrdParametersPresentFlag() || hrd->getGeneralVclHrdParametersPresentFlag() )
{
WRITE_CODE(hrd->getTickDivisorMinus2(), 8, "tick_divisor_minus2");
}
WRITE_CODE(hrd->getBitRateScale(), 4, "bit_rate_scale");
WRITE_CODE(hrd->getCpbSizeScale(), 4, "cpb_size_scale");
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
{
WRITE_CODE(hrd->getCpbSizeDuScale(), 4, "cpb_size_du_scale");
#endif
WRITE_FLAG(hrd->getGeneralSamePicTimingInAllOlsFlag() ? 1 : 0, "general_same_pic_timing_in_all_ols_flag");
WRITE_FLAG(hrd->getGeneralDecodingUnitHrdParamsPresentFlag() ? 1 : 0, "general_decoding_unit_hrd_params_present_flag");
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
{
WRITE_CODE(hrd->getTickDivisorMinus2(), 8, "tick_divisor_minus2");
}
WRITE_CODE(hrd->getBitRateScale(), 4, "bit_rate_scale");
WRITE_CODE(hrd->getCpbSizeScale(), 4, "cpb_size_scale");
if (hrd->getGeneralDecodingUnitHrdParamsPresentFlag())
{
WRITE_CODE(hrd->getCpbSizeDuScale(), 4, "cpb_size_du_scale");
}
WRITE_UVLC(hrd->getHrdCpbCntMinus1(), "hrd_cpb_cnt_minus1");
#if JVET_S0175_ASPECT6
}
WRITE_UVLC(hrd->getHrdCpbCntMinus1(), "hrd_cpb_cnt_minus1");
#endif
}
void HLSWriter::codeOlsHrdParameters(const GeneralHrdParams * generalHrd, const OlsHrdParams *olsHrd, const uint32_t firstSubLayer, const uint32_t maxNumSubLayersMinus1)
{
......@@ -745,7 +752,11 @@ void HLSWriter::codeOlsHrdParameters(const GeneralHrdParams * generalHrd, const
{
WRITE_UVLC(hrd->getElementDurationInTcMinus1(), "elemental_duration_in_tc_minus1");
}
#if JVET_S0175_ASPECT6
else if ( (generalHrd->getGeneralNalHrdParametersPresentFlag() || generalHrd->getGeneralVclHrdParametersPresentFlag()) && generalHrd->getHrdCpbCntMinus1() == 0)
#else
else if (generalHrd->getHrdCpbCntMinus1() == 0)
#endif
{
WRITE_FLAG(hrd->getLowDelayHrdFlag() ? 1 : 0, "low_delay_hrd_flag");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment