...
 
Commits (8)
......@@ -618,7 +618,7 @@ void Slice::checkCRA(const ReferencePictureList* pRPL0, const ReferencePictureLi
{
int pocBits = getSPS()->getBitsForPOC();
int pocMask = (1 << pocBits) - 1;
int ltrpPoc = m_pRPL1->getRefPicIdentifier(i) & pocMask;
int ltrpPoc = pRPL1->getRefPicIdentifier(i) & pocMask;
if(pRPL1->getDeltaPocMSBPresentFlag(i))
{
ltrpPoc += getPOC() - pRPL1->getDeltaPocMSBCycleLT(i) * (pocMask + 1) - (getPOC() & pocMask);
......@@ -1123,7 +1123,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
// No RASL pictures shall be present in the bitstream that are associated with
// an IDR picture.
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL && !pps.getMixedNaluTypesInPicFlag())
{
CHECK( this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ||
this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL, "Invalid NAL unit type");
......@@ -1132,7 +1132,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
// No RADL pictures shall be present in the bitstream that are associated with
// a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated
// with an IDR picture having nal_unit_type equal to IDR_N_LP.
if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL && !pps.getMixedNaluTypesInPicFlag())
{
CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP, "Invalid NAL unit type");
}
......@@ -1155,7 +1155,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
if (pcSlice->getPicHeader()->getPicOutputFlag() == 1 && !this->getPicHeader()->getNoOutputOfPriorPicsFlag() && pcPic->layerId == this->m_nuhLayerId)
{
if (nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
if ((nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) && !pps.getMixedNaluTypesInPicFlag())
{
CHECK(pcPic->poc >= this->getPOC(), "Any picture, with nuh_layer_id equal to a particular value layerId, that precedes an IRAP picture with nuh_layer_id "
"equal to layerId in decoding order shall precede the IRAP picture in output order.");
......@@ -1166,7 +1166,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
{
if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
{
if (this->getAssociatedIRAPPOC() > pcSlice->getAssociatedIRAPPOC())
if (this->getAssociatedIRAPPOC() > pcSlice->getAssociatedIRAPPOC() && !pps.getMixedNaluTypesInPicFlag())
{
if (this->getAssociatedIRAPPOC() != pcPic->poc)
{
......@@ -1188,7 +1188,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
}
if ((nalUnitType == NAL_UNIT_CODED_SLICE_RASL || nalUnitType == NAL_UNIT_CODED_SLICE_RADL) &&
(pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL))
(pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL) && !pps.getMixedNaluTypesInPicFlag())
{
if (pcSlice->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC() && pcPic->layerId == this->m_nuhLayerId)
{
......@@ -1206,7 +1206,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
}
}
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL && !pps.getMixedNaluTypesInPicFlag())
{
if ((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
this->getAssociatedIRAPPOC() == pcSlice->getAssociatedIRAPPOC())
......@@ -1218,7 +1218,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic, const PPS& pps)
}
}
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL && !pps.getMixedNaluTypesInPicFlag())
{
if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)
{
......
......@@ -51,6 +51,8 @@
#include <cassert>
//########### place macros to be removed in next cycle below this line ###############
#define JVET_S0076_ASPECT1 1 // JVET-S0076: aspect 1: Move ph_non_ref_pic_flag to earlier position
#define JVET_S0133_PH_SYNTAX_OVERRIDE_ENC_FIX 1 // JVET-S0133: Encoder-only fix on the override of partition constriants in PH
#define JVET_S0179_CONDITIONAL_SIGNAL_GCI 1 // JVET-S0179: Conditional signalling of GCI fields
......@@ -89,6 +91,8 @@
#define JVET_S0186_SPS_CLEANUP 1 // JVET-S0186: Proposal 1, move sps_chroma_format_idc and sps_log2_ctu_size_minus5 to take place sps_reserved_zero_4bits
#define JVET_S0181_PROPOSAL2_BUFFERING_PERIOD_CLEANUP 1 // JVET-S0181 Proposal2: Move signalling of bp_max_sublayers_minus1 and conditionally signal bp_cpb_removal_delay_deltas_present_flag, bp_num_cpb_removal_delay_deltas_minus1, and bp_cpb_removal_delay
//########### place macros to be be kept below this line ###############
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
......
......@@ -1851,7 +1851,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
}
else
{
CHECK(nalu.m_nalUnitType != m_pcPic->slices[m_uiSliceSegmentIdx - 1]->getNalUnitType(), "The value of NAL unit type shall be the same for all coded slice NAL units of a picture");
CHECK(nalu.m_nalUnitType != m_pcPic->slices[m_uiSliceSegmentIdx - 1]->getNalUnitType() && !m_pcPic->cs->pps->getMixedNaluTypesInPicFlag(), "If pps_mixed_nalu_types_in_pic_flag is equal to 0, the value of NAL unit type shall be the same for all coded slice NAL units of a picture");
m_apcSlicePilot->copySliceInfo( m_pcPic->slices[m_uiSliceSegmentIdx-1] );
}
......@@ -2570,7 +2570,7 @@ void DecLib::updatePrevGDRInSameLayer()
{
const NalUnitType pictureType = m_pcPic->getPictureType();
if (pictureType == NAL_UNIT_CODED_SLICE_GDR)
if (pictureType == NAL_UNIT_CODED_SLICE_GDR && !m_pcPic->cs->pps->getMixedNaluTypesInPicFlag())
{
m_prevGDRInSameLayerPOC[m_pcPic->layerId] = m_pcPic->getPOC();
}
......@@ -2580,7 +2580,7 @@ void DecLib::updateAssociatedIRAP()
{
const NalUnitType pictureType = m_pcPic->getPictureType();
if (pictureType == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pictureType == NAL_UNIT_CODED_SLICE_IDR_N_LP || pictureType == NAL_UNIT_CODED_SLICE_CRA)
if ((pictureType == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pictureType == NAL_UNIT_CODED_SLICE_IDR_N_LP || pictureType == NAL_UNIT_CODED_SLICE_CRA) && !m_pcPic->cs->pps->getMixedNaluTypesInPicFlag())
{
m_associatedIRAPDecodingOrderNumber[m_pcPic->layerId] = m_pcPic->getDecodingOrderNumber();
m_pocCRA[m_pcPic->layerId] = m_pcPic->getPOC();
......
......@@ -707,7 +707,21 @@ void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, uint32_t paylo
sei_read_code( pDecodedMessageOutputStream, ( sei.m_cpbRemovalDelayLength ), code, "au_cpb_removal_delay_delta_minus1" );
sei.m_auCpbRemovalDelayDelta = code + 1;
#if JVET_S0181_PROPOSAL2_BUFFERING_PERIOD_CLEANUP
sei_read_code(pDecodedMessageOutputStream, 3, code, "bp_max_sub_layers_minus1");
sei.m_bpMaxSubLayers = code + 1;
if (sei.m_bpMaxSubLayers - 1 > 0)
{
sei_read_flag(pDecodedMessageOutputStream, code, "cpb_removal_delay_deltas_present_flag");
sei.m_cpbRemovalDelayDeltasPresentFlag = code;
}
else
{
sei.m_cpbRemovalDelayDeltasPresentFlag = false;
}
#else
sei_read_flag( pDecodedMessageOutputStream, code, "cpb_removal_delay_deltas_present_flag" ); sei.m_cpbRemovalDelayDeltasPresentFlag = code;
#endif
if (sei.m_cpbRemovalDelayDeltasPresentFlag)
{
sei_read_uvlc( pDecodedMessageOutputStream, code, "num_cpb_removal_delay_deltas_minus1" ); sei.m_numCpbRemovalDelayDeltas = code + 1;
......@@ -717,8 +731,10 @@ void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, uint32_t paylo
sei.m_cpbRemovalDelayDelta[ i ] = code;
}
}
#if !JVET_S0181_PROPOSAL2_BUFFERING_PERIOD_CLEANUP
sei_read_code( pDecodedMessageOutputStream, 3, code, "bp_max_sub_layers_minus1" ); sei.m_bpMaxSubLayers = code + 1;
sei_read_uvlc( pDecodedMessageOutputStream, code, "bp_cpb_cnt_minus1" ); sei.m_bpCpbCnt = code + 1;
#endif
#if JVET_S0181_PROPOSAL1
if (sei.m_bpMaxSubLayers - 1 > 0)
{
......
......@@ -2455,6 +2455,9 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
#endif
READ_FLAG(uiCode, "gdr_or_irap_pic_flag"); picHeader->setGdrOrIrapPicFlag(uiCode != 0);
#if JVET_S0076_ASPECT1
READ_FLAG(uiCode, "ph_non_ref_pic_flag"); picHeader->setNonReferencePictureFlag(uiCode != 0);
#endif
if (picHeader->getGdrOrIrapPicFlag())
{
READ_FLAG(uiCode, "gdr_pic_flag"); picHeader->setGdrPicFlag(uiCode != 0);
......@@ -2473,7 +2476,9 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
picHeader->setPicIntraSliceAllowedFlag(true);
}
CHECK(picHeader->getPicInterSliceAllowedFlag() == 0 && picHeader->getPicIntraSliceAllowedFlag() == 0, "Invalid picture without intra or inter slice");
#if !JVET_S0076_ASPECT1
READ_FLAG(uiCode, "non_reference_picture_flag"); picHeader->setNonReferencePictureFlag( uiCode != 0 );
#endif
// parameter sets
READ_UVLC(uiCode, "ph_pic_parameter_set_id");
picHeader->setPPSId(uiCode);
......
......@@ -296,7 +296,17 @@ void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei)
CHECK (sei.m_auCpbRemovalDelayDelta < 1, "sei.m_auCpbRemovalDelayDelta must be > 0");
WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, sei.m_cpbRemovalDelayLength, "au_cpb_removal_delay_delta_minus1" );
WRITE_FLAG( sei.m_cpbRemovalDelayDeltasPresentFlag, "cpb_removal_delay_deltas_present_flag");
#if JVET_S0181_PROPOSAL2_BUFFERING_PERIOD_CLEANUP
CHECK(sei.m_bpMaxSubLayers < 1, "bp_max_sub_layers_minus1 must be > 0");
WRITE_CODE(sei.m_bpMaxSubLayers - 1, 3, "bp_max_sub_layers_minus1");
if (sei.m_bpMaxSubLayers - 1 > 0)
{
WRITE_FLAG(sei.m_cpbRemovalDelayDeltasPresentFlag, "cpb_removal_delay_deltas_present_flag");
}
#else
WRITE_FLAG(sei.m_cpbRemovalDelayDeltasPresentFlag, "cpb_removal_delay_deltas_present_flag");
#endif
if (sei.m_cpbRemovalDelayDeltasPresentFlag)
{
CHECK (sei.m_numCpbRemovalDelayDeltas < 1, "m_numCpbRemovalDelayDeltas must be > 0");
......@@ -305,8 +315,10 @@ void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei)
{
WRITE_CODE( sei.m_cpbRemovalDelayDelta[i], sei.m_cpbRemovalDelayLength, "cpb_removal_delay_delta[i]" );
}
#if !JVET_S0181_PROPOSAL2_BUFFERING_PERIOD_CLEANUP
CHECK (sei.m_bpMaxSubLayers < 1, "bp_max_sub_layers_minus1 must be > 0");
WRITE_CODE( sei.m_bpMaxSubLayers - 1, 3, "bp_max_sub_layers_minus1" );
#endif
}
CHECK (sei.m_bpCpbCnt < 1, "sei.m_bpCpbCnt must be > 0");
WRITE_UVLC( sei.m_bpCpbCnt - 1, "bp_cpb_cnt_minus1");
......
......@@ -1520,7 +1520,10 @@ void HLSWriter::codePictureHeader( PicHeader* picHeader, bool writeRbspTrailingB
#endif
CodingStructure& cs = *picHeader->getPic()->cs;
WRITE_FLAG(picHeader->getGdrOrIrapPicFlag(), "gdr_or_irap_pic_flag");
WRITE_FLAG(picHeader->getGdrOrIrapPicFlag(), "gdr_or_irap_pic_flag");
#if JVET_S0076_ASPECT1
WRITE_FLAG(picHeader->getNonReferencePictureFlag(), "ph_non_ref_pic_flag");
#endif
if (picHeader->getGdrOrIrapPicFlag())
{
WRITE_FLAG(picHeader->getGdrPicFlag(), "gdr_pic_flag");
......@@ -1531,7 +1534,9 @@ void HLSWriter::codePictureHeader( PicHeader* picHeader, bool writeRbspTrailingB
{
WRITE_FLAG(picHeader->getPicIntraSliceAllowedFlag(), "ph_intra_slice_allowed_flag");
}
#if !JVET_S0076_ASPECT1
WRITE_FLAG(picHeader->getNonReferencePictureFlag(), "non_reference_picture_flag");
#endif
// parameter sets
WRITE_UVLC(picHeader->getPPSId(), "ph_pic_parameter_set_id");
pps = cs.slice->getPPS();
......