diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 1f9d4e6efd8dcc1ac4e1e505a71c7422e776208d..f36ed7fa7e6edcc75ec5ae09527a19be20f9dca4 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -52,6 +52,8 @@ #define JVET_N0278_FIXES 1 +#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 62cea7c3569ddfda1608ba7ae681e56f10289990..09248813a88b251dfdf33119f7292f00a6ba53c9 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1347,7 +1347,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);