diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 57b5286b51380c7b33b88353ec2db861da641045..7531b345cff586c13a649251e511337e7b3d19bb 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -701,6 +701,30 @@ void Slice::checkRPL(const ReferencePictureList* pRPL0, const ReferencePictureLi CHECK( pcRefPic->temporalId > m_pcPic->temporalId, "The picture referred to by each active entry in RefPicList[ 0 ] or RefPicList[ 1 ] shall be present in the DPB and shall have TemporalId less than or equal to that of the current picture." ); } +#if JVET_R0046_IRAP_ASPECT2 + // Add a constraint on an ILRP being either an IRAP picture or having TemporalId less than or equal to + // Max (0, vps_max_tid_il_ref_pics_plus1[ refPicVpsLayerId ] - 1 ), with refPicVpsLayerId equal to the value of + // the nuh_layer_id of the referenced picture. + if (rpl[refPicList]->isInterLayerRefPic(i)) + { + bool cond1 = (pcRefPic->getPictureType() == NAL_UNIT_CODED_SLICE_GDR); + bool cond2 = (pcRefPic->slices[0]->getPicHeader()->getRecoveryPocCnt() == 0); + bool cond3 = (pcRefPic->cs->slice->isIRAP()); + + const VPS *vps = pcRefPic->cs->vps; + const int maxTidILRefPicsPlus1 = vps->getMaxTidIlRefPicsPlus1(layerIdx, pcRefPic->layerId); + bool cond4 = (pcRefPic->temporalId < maxTidILRefPicsPlus1); + + CHECK((cond1 && cond2) || cond3 || cond4, + "Either of the following conditions shall apply for the picture referred to by each ILRP entry, when " + "present, in RefPicList[ 0 ] or RefPicList[ 1 ] of a slice of the current picture:-The picture is a " + "GDR picture with " + "ph_recovery_poc_cnt equal to 0 or an IRAP picture." + "-The picture has TemporalId less than vps_max_tid_il_ref_pics_plus1[ currLayerIdx ][ refLayerIdx ], " + "where currLayerIdx and refLayerIdx are equal to " + "GeneralLayerIdx[ nuh_layer_id ] and GeneralLayerIdx[ refpicLayerId ], respectively. "); + } +#endif } } } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index f602c9ba995196217be2afe69f75fe969da5feb8..3ed30b28452768c42a88cda873f895a506ae14af 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -68,7 +68,7 @@ #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 - +#define JVET_R0046_IRAP_ASPECT2 1 // Add a constraint on an ILRP being either an IRAP picture or having TemporalId less than or equal to Max (0, vps_max_tid_il_ref_pics_plus1[ refPicVpsLayerId ] - 1 ) //########### place macros to be be kept below this line ############### #define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages