diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index b3f03e8b34881e611253a29cbdacf472327f7ac4..c3675eef61e62b1cd993d15e895fc9f904a9517e 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -5181,6 +5181,11 @@ bool EncAppCfg::xCheckParameter() "Output picture height numerator cannot be equal to or less than 0"); xConfirmPara(m_nnPostFilterSEICharacteristicsPicHeightDenominator[i] <= 0, "Output picture height denominator cannot be equal to or less than 0"); +#if JVET_AD0091 + xConfirmPara(m_nnPostFilterSEICharacteristicsLumaPadding[i] > (uint32_t) (((uint64_t) 1 << (m_nnPostFilterSEICharacteristicsInpTensorBitDepthLumaMinus8[i] + 8)) - 1), "SEINNPFCLumaPadding must be in the range of 0 to 2^bitDepthLuma - 1"); + xConfirmPara(m_nnPostFilterSEICharacteristicsCbPadding[i] > (uint32_t) (((uint64_t) 1 << (m_nnPostFilterSEICharacteristicsInpTensorBitDepthChromaMinus8[i] + 8)) - 1), "SEINNPFCLumaPadding must be in the range of 0 to 2^bitDepthChroma - 1"); + xConfirmPara(m_nnPostFilterSEICharacteristicsCrPadding[i] > (uint32_t) (((uint64_t) 1 << (m_nnPostFilterSEICharacteristicsInpTensorBitDepthChromaMinus8[i] + 8)) - 1), "SEINNPFCLumaPadding must be in the range of 0 to 2^bitDepthChroma - 1"); +#endif } } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 73f38582e1810cea134595e6a6ed91e741813e97..f77c109716318454d9f476592f5152150fedb495 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -85,6 +85,7 @@ #define JVET_AD0056_MOVE_COLOUR_DESC_FLAG 1 // Move nnpfc_separate_colour_description_present_flag and associated flags and add conformance checks +#define JVET_AD0091 1 //########### place macros to be be kept below this line ############### #define GDR_ENABLED 1 diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index d7d7ae3674e52d029a1e29f3d7a1b07deb5fbcc5..fb6e59eb700ffa7c061b536184f5ba769b5af24d 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -2930,6 +2930,9 @@ void SEIReader::xParseSEINNPostFilterCharacteristics(SEINeuralNetworkPostFilterC sei.m_picWidthInLumaSamples = val; sei_read_flag(pDecodedMessageOutputStream, val, "nnpfc_pic_height_in_luma_samples"); sei.m_picHeightInLumaSamples = val; +#if JVET_AD0091 + CHECK(!(sei->m_picWidthInLumaSamples >= croppedWidth && sei->m_picWidthInLumaSamples <= croppedWidth * 16), "m_picWidthInLumaSamples shall be in the range of croppedWidth to croppedWidth * 16"); + CHECK(!(sei->m_picHeightInLumaSamples >= croppedHeight && sei->m_picHeightInLumaSamples <= croppedHeight * 16), "m_picHeightInLumaSamples shall be in the range of croppedHeight to croppedHeight * 16"); #endif } @@ -3123,6 +3126,9 @@ void SEIReader::xParseSEINNPostFilterCharacteristics(SEINeuralNetworkPostFilterC sei_read_uvlc(pDecodedMessageOutputStream, val, "nnpfc_padding_type"); sei.m_paddingType = val; +#if JVET_AD0091 + CHECK(sei.m_paddingType >= 5 && sei.m_targetId <= 15, "Reserved nnpfc_padding_type value, shall ignore the SEI message"); +#endif if (sei.m_paddingType == NNPC_PaddingType::FIXED_PADDING) {