diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index e6e4e35d7a756bb855af0fc6939a1f3c0b10c776..e51683753e30d40da0f42cb27588a54594aee082 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT 1 // JVET-P0578: minimum CU size constraint + #define JVET_P0091_REMOVE_BDOF_OFFSET_SHIFT 1 // JVET-P0091: Align sample offset calculation of BDOF and PROF #define JVET_P0512_SIMD_HIGH_BITDEPTH 1 // JVET-P0512: MC SIMD support for high internal bit-depthf diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 791fafc0c2ac59d51eff7bdf06d6405de8b47429..09c625f2662a33307d7fd68813e92234e789587f 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1268,6 +1268,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) int log2MinCUSize = uiCode + 2; pcSPS->setLog2MinCodingBlockSize(log2MinCUSize); +#if JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT + CHECK(log2MinCUSize > std::min(6, (int)(ctbLog2SizeY)), "log2_min_luma_coding_block_size_minus2 shall be in the range of 0 to min (4, log2_ctu_size - 2)"); +#endif CHECK( ( pcSPS->getMaxPicWidthInLumaSamples() % ( std::max( 8, int( pcSPS->getMaxCUWidth() >> ( pcSPS->getMaxCodingDepth() - 1 ) ) ) ) ) != 0, "Coded frame width must be a multiple of Max(8, the minimum unit size)" ); CHECK( ( pcSPS->getMaxPicHeightInLumaSamples() % ( std::max( 8, int( pcSPS->getMaxCUHeight() >> ( pcSPS->getMaxCodingDepth() - 1 ) ) ) ) ) != 0, "Coded frame height must be a multiple of Max(8, the minimum unit size)" ); diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index b1188a23bc1a7eb23115a88dfe4c54fe710e944a..cfd0e5e35a1ecd6ce2d4a70da830dd78329e5280 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1025,7 +1025,9 @@ void EncLib::xInitSPS(SPS &sps) } sps.setLog2MinCodingBlockSize(log2MinCUSize); - +#if JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT + CHECK(log2MinCUSize > std::min(6, floorLog2(sps.getMaxCUWidth())), "log2_min_luma_coding_block_size_minus2 shall be in the range of 0 to min (4, log2_ctu_size - 2)"); +#endif sps.setTransformSkipEnabledFlag(m_useTransformSkip); sps.setBDPCMEnabledFlag(m_useBDPCM);