diff --git a/doc/software-manual.tex b/doc/software-manual.tex index 278377430089efd63df2927206f8b903e4355a08..c7e5c7f993577271b3760a6aed9fac74062df439 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -1430,6 +1430,12 @@ Specifies the value of gci_no_ladf_constraint_flag Specifies the value of gci_no_virtual_boundaries_constraint_flag \\ +\Option{AllRapPicturesFlag} & +%\ShortOption{\None} & +\Default{false} & +Indicate that all pictures in OlsInScope are IRAP pictures or GDR pictures with ph_recovery_poc_cnt equal to 0 +\\ + \end{OptionTableNoShorthand} diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index e66a7a22281c02b0e1b0684921ee6549bb12042f..7e031f619eabc60f18a9310d4f982d07016c664b 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -452,11 +452,15 @@ void EncApp::xInitLibCfg() CHECK(m_noVirtualBoundaryConstraintFlag && m_virtualBoundariesEnabledFlag, "Virtuall boundaries shall be deactivated when m_noVirtualBoundaryConstraintFlag is equal to 1"); m_cEncLib.setNoChromaQpOffsetConstraintFlag(m_noChromaQpOffsetConstraintFlag); CHECK(m_noChromaQpOffsetConstraintFlag && m_cuChromaQpOffsetSubdiv, "Chroma Qp offset shall be 0 when m_noChromaQpOffsetConstraintFlag is equal to 1"); +#if JVET_X0079_MODIFIED_BITRATE + m_cEncLib.setAllRapPicturesFlag(m_allRapPicturesFlag); +#else m_cEncLib.setGeneralLowerBitRateConstraintFlag(m_generalLowerBitRateConstraintFlag); if (m_profile == Profile::MAIN_12 || m_profile == Profile::MAIN_12_444 || m_profile == Profile::MAIN_16_444) { CHECK(m_generalLowerBitRateConstraintFlag==0, "generalLowerBitRateConstraintFlag shall be 1 when non-Intra/Still Picture operation range extension profiles are used"); } +#endif } else { @@ -522,7 +526,11 @@ void EncApp::xInitLibCfg() m_cEncLib.setNoActConstraintFlag(false); m_cEncLib.setNoLmcsConstraintFlag(false); m_cEncLib.setNoChromaQpOffsetConstraintFlag(false); +#if JVET_X0079_MODIFIED_BITRATE + m_cEncLib.setAllRapPicturesFlag(false); +#else m_cEncLib.setGeneralLowerBitRateConstraintFlag(false); +#endif } //====== Coding Structure ======== diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 0b2d5cf0a83d6e8cb9b102aabac8d06363f9f9c6..1eb35ecd55a0187580051255e3f4218dd4bc11a0 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -262,6 +262,14 @@ strToLevel[] = }; #if U0132_TARGET_BITS_SATURATION +#if JVET_X0079_MODIFIED_BITRATE +uint32_t g_uiMaxCpbSize[2][28] = +{ + // LEVEL1, LEVEL2, LEVEL2_1, LEVEL3, LEVEL3_1, LEVEL4, LEVEL4_1, LEVEL5, LEVEL5_1, LEVEL5_2, LEVEL6, LEVEL6_1, LEVEL6_2 LEVEL6_3 + { 0, 0, 0, 0, 350000, 0, 0, 0, 1500000, 3000000, 0, 0, 6000000, 10000000, 0, 0, 12000000, 20000000, 0, 0, 25000000, 40000000, 60000000, 0, 80000000, 120000000, 240000000, 240000000 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 0, 100000000, 160000000, 240000000, 0, 240000000, 480000000, 800000000, 1600000000 } +}; +#else uint32_t g_uiMaxCpbSize[2][21] = { // LEVEL1, LEVEL2,LEVEL2_1, LEVEL3, LEVEL3_1, LEVEL4, LEVEL4_1, LEVEL5, LEVEL5_1, LEVEL5_2, LEVEL6, LEVEL6_1, LEVEL6_2 @@ -269,6 +277,7 @@ uint32_t g_uiMaxCpbSize[2][21] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 100000000, 160000000, 240000000, 240000000, 480000000, 800000000 } }; #endif +#endif static const struct MapStrToCostMode { @@ -922,7 +931,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("NoLmcsConstraintFlag", m_noLmcsConstraintFlag, false, "Indicate that LMCS is deactivated") ("NoLadfConstraintFlag", m_noLadfConstraintFlag, false, "Indicate that LADF is deactivated") ("NoVirtualBoundaryConstraintFlag", m_noVirtualBoundaryConstraintFlag, false, "Indicate that virtual boundary is deactivated") +#if JVET_X0079_MODIFIED_BITRATE + ("AllRapPicturesFlag", m_allRapPicturesFlag, false, "Indicate that all pictures in OlsInScope are IRAP pictures or GDR pictures with ph_recovery_poc_cnt equal to 0") +#else ("GeneralLowerBitRateConstraintFlag", m_generalLowerBitRateConstraintFlag, false, "Indicate whether lower bitrate constraint is used") +#endif ("CTUSize", m_uiCTUSize, 128u, "CTUSize (specifies the CTU size if QTBT is on) [default: 128]") ("Log2MinCuSize", m_log2MinCuSize, 2u, "Log2 min CU size") @@ -2181,10 +2194,12 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) m_profile == Profile::MAIN_16_444 || m_profile == Profile::MAIN_16_444_INTRA || m_profile == Profile::MAIN_16_444_STILL_PICTURE) { m_gciPresentFlag = true; +#if !JVET_X0079_MODIFIED_BITRATE if (m_profile == Profile::MAIN_12 || m_profile == Profile::MAIN_12_444 || m_profile == Profile::MAIN_16_444) { CHECK(m_generalLowerBitRateConstraintFlag == 0, "GeneralLowerBitRateConstraintFlag setting must be 1 for non-Intra/Still Picture operation range extension profiles.") } +#endif } if (m_profile == Profile::MAIN_12_INTRA || m_profile == Profile::MAIN_12_444_INTRA || m_profile == Profile::MAIN_16_444_INTRA) { @@ -2981,10 +2996,18 @@ int EncAppCfg::xAutoDetermineProfile() default: return 1; } +#if JVET_X0079_MODIFIED_BITRATE + if (m_profile == Profile::MAIN_12_INTRA || m_profile == Profile::MAIN_12_444_INTRA || m_profile == Profile::MAIN_16_444_INTRA || + m_profile == Profile::MAIN_12_STILL_PICTURE || m_profile == Profile::MAIN_12_444_STILL_PICTURE || m_profile == Profile::MAIN_16_444_STILL_PICTURE) + { + m_allRapPicturesFlag = 1; + } +#else if (m_profile == Profile::MAIN_12 || m_profile == Profile::MAIN_12_444 || m_profile == Profile::MAIN_16_444) { m_generalLowerBitRateConstraintFlag = 1; // GeneralLowerBitRateConstraintFlag setting must be 1 for non-Intra/Still Picture operation range extension profiles.") } +#endif return 0; } @@ -4105,7 +4128,11 @@ bool EncAppCfg::xCheckParameter() #if U0132_TARGET_BITS_SATURATION if ((m_RCCpbSaturationEnabled) && (m_level!=Level::NONE) && (m_profile!=Profile::NONE)) { +#if JVET_X0079_MODIFIED_BITRATE + uint32_t uiLevelIdx = (m_level / 16) * 4 + (uint32_t)((m_level % 16) / 3); +#else uint32_t uiLevelIdx = (m_level / 10) + (uint32_t)((m_level % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3); +#endif xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level"); xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1"); } @@ -4318,7 +4345,11 @@ void EncAppCfg::xPrintParameter() { msg( DETAILS, "Profile : %s\n", profileToString(m_profile) ); } +#if JVET_X0079_MODIFIED_BITRATE + msg( DETAILS,"AllRapPicturesFlag : %d\n", m_allRapPicturesFlag ); +#else msg( DETAILS,"GeneralLowerBitRateConstraintFlag : %d\n", m_generalLowerBitRateConstraintFlag ); +#endif msg(DETAILS, "CTU size / min CU size : %d / %d \n", m_uiMaxCUWidth, 1 << m_log2MinCuSize); msg(DETAILS, "subpicture info present flag : %s\n", m_subPicInfoPresentFlag ? "Enabled" : "Disabled"); diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 8236a9d04b8b4fb6725208e27c2bcfe33c2bc243..0ce7304e73af609ea851dcfcf38d1ecf2a7fb72e 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -189,7 +189,11 @@ protected: bool m_noCraConstraintFlag; bool m_noGdrConstraintFlag; bool m_noApsConstraintFlag; +#if JVET_X0079_MODIFIED_BITRATE + bool m_allRapPicturesFlag; +#else bool m_generalLowerBitRateConstraintFlag; +#endif // profile/level Profile::Name m_profile; diff --git a/source/Lib/CommonLib/ProfileLevelTier.cpp b/source/Lib/CommonLib/ProfileLevelTier.cpp index 514ef110224fabb2f6ada14e75839f2e60a10528..087cd4e3999b33c479f3a30873f1b68fbbbe899a 100644 --- a/source/Lib/CommonLib/ProfileLevelTier.cpp +++ b/source/Lib/CommonLib/ProfileLevelTier.cpp @@ -70,7 +70,11 @@ static const LevelTierFeatures mainLevelTierInfo[] = { Level::LEVEL6 , 35651584, { 80000, 240000 }, 600, 440, 20, 1069547520ULL, { 60000, 240000 }, { 8, 4} }, { Level::LEVEL6_1, 35651584, { 120000, 480000 }, 600, 440, 20, 2139095040ULL, { 120000, 480000 }, { 8, 4} }, { Level::LEVEL6_2, 35651584, { 180000, 800000 }, 600, 440, 20, 4278190080ULL, { 240000, 800000 }, { 8, 4} }, +#if JVET_X0079_MODIFIED_BITRATE + { Level::LEVEL6_3, 80216064, { 240000, 1600000 }, 1000, 990, 30, 4812963840ULL, { 320000, 1600000 }, { 8, 4} }, +#else { Level::LEVEL6_3, 80216064, { 240000, 800000 }, 1000, 990, 30, 4812963840ULL, { 320000, 800000 }, { 8, 4} }, +#endif { Level::LEVEL15_5, MAX_UINT,{ MAX_UINT, MAX_UINT }, MAX_UINT, MAX_UINT, MAX_UINT, MAX_CNFUINT64, {MAX_UINT, MAX_UINT }, { 0, 0} }, { Level::NONE } }; @@ -92,6 +96,17 @@ static const ProfileFeatures validProfiles[] = { { Profile::MAIN_10_444, "Main_444_10", 10, CHROMA_444, false, 2500, 2750, 3750, 75, mainLevelTierInfo, false }, { Profile::MULTILAYER_MAIN_10_444, "Multilayer_Main_444_10", 10, CHROMA_444, false, 2500, 2750, 3750, 75, mainLevelTierInfo, false }, +#if JVET_X0079_MODIFIED_BITRATE + { Profile::MAIN_12, "Main_12", 12, CHROMA_420, true, 1200, 1320, 1875, 100, mainLevelTierInfo, false }, + { Profile::MAIN_12_INTRA, "Main_12_Intra", 12, CHROMA_420, true, 2400, 2640, 1875, 100, mainLevelTierInfo, false }, + { Profile::MAIN_12_STILL_PICTURE, "Main_12_Still_Picture", 12, CHROMA_420, true, 2400, 2640, 1875, 100, mainLevelTierInfo, false }, + { Profile::MAIN_12_444, "Main_12_444", 12, CHROMA_444, true, 3000, 3300, 3750, 75, mainLevelTierInfo, false }, + { Profile::MAIN_12_444_INTRA, "Main_12_444_Intra", 12, CHROMA_444, true, 6000, 6600, 3750, 75, mainLevelTierInfo, false }, + { Profile::MAIN_12_444_STILL_PICTURE, "Main_12_444_Still_Picture", 12, CHROMA_444, true, 6000, 6600, 3750, 75, mainLevelTierInfo, false }, + { Profile::MAIN_16_444, "Main_16_444", 16, CHROMA_444, true, 4000, 4400, 6000, 75, mainLevelTierInfo, false }, + { Profile::MAIN_16_444_INTRA, "Main_16_444_Intra", 16, CHROMA_444, true, 8000, 8800, 6000, 75, mainLevelTierInfo, false }, + { Profile::MAIN_16_444_STILL_PICTURE, "Main_16_444_Still_Picture", 16, CHROMA_444, true, 8000, 8800, 6000, 75, mainLevelTierInfo, false }, +#else { Profile::MAIN_12, "Main_12", 12, CHROMA_420, true, 1500, 1650, 2250, 100, mainLevelTierInfo, false }, { Profile::MAIN_12_INTRA, "Main_12_Intra", 12, CHROMA_420, true, 1500, 1650, 2250, 100, mainLevelTierInfo, false }, { Profile::MAIN_12_STILL_PICTURE, "Main_12_Still_Picture", 12, CHROMA_420, true, 1500, 1650, 2250, 100, mainLevelTierInfo, false }, @@ -101,6 +116,7 @@ static const ProfileFeatures validProfiles[] = { { Profile::MAIN_16_444, "Main_16_444", 16, CHROMA_444, true, 4000, 4400, 6000, 50, mainLevelTierInfo, false }, { Profile::MAIN_16_444_INTRA, "Main_16_444_Intra", 16, CHROMA_444, true, 4000, 4400, 6000, 50, mainLevelTierInfo, false }, { Profile::MAIN_16_444_STILL_PICTURE, "Main_16_444_Still_Picture", 16, CHROMA_444, true, 4000, 4400, 6000, 50, mainLevelTierInfo, false }, +#endif { Profile::NONE, 0 }, }; @@ -156,6 +172,17 @@ ProfileLevelTierFeatures::extractPTLInformation(const SPS &sps) if (m_pProfile) { Profile::Name profile = m_pProfile->profile; +#if JVET_X0079_MODIFIED_BITRATE + if (profile == Profile::MAIN_10 || profile == Profile::MAIN_10_444 || + profile == Profile::MULTILAYER_MAIN_10 || profile == Profile::MULTILAYER_MAIN_10_444) + { + m_hbrFactor = 1; + } + else + { + m_hbrFactor = 1 + sps.getProfileTierLevel()->getTierFlag(); + } +#else if (profile == Profile::MAIN_10 || profile == Profile::MAIN_10_444 || profile == Profile::MULTILAYER_MAIN_10 || profile == Profile::MULTILAYER_MAIN_10_444 || profile == Profile::MAIN_12 || profile == Profile::MAIN_12_444 || profile == Profile::MAIN_16_444) @@ -166,6 +193,7 @@ ProfileLevelTierFeatures::extractPTLInformation(const SPS &sps) { m_hbrFactor = 2 - sps.getProfileTierLevel()->getConstraintInfo()->getLowerBitRateConstraintFlag(); } +#endif } } diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 4538be000560a6136a5f5317511efd45e7089eac..01ceb0010988190357416cb27a832263591cf544 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -4574,10 +4574,17 @@ bool operator == (const ConstraintInfo& op1, const ConstraintInfo& o { return false; } +#if JVET_X0079_MODIFIED_BITRATE + if (op1.m_allRapPicturesFlag != op2.m_allRapPicturesFlag) + { + return false; + } +#else if (op1.m_lowerBitRateConstraintFlag != op2.m_lowerBitRateConstraintFlag) { return false; } +#endif if (op1.m_allLayersIndependentConstraintFlag != op2.m_allLayersIndependentConstraintFlag) { return false; diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index d9e3359a65b7930a32352080a0007e40a3a42d4a..b92fc2535365934ce52e027387ca1e5414f237b5 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -249,7 +249,9 @@ class ConstraintInfo uint32_t m_maxBitDepthConstraintIdc; int m_maxChromaFormatConstraintIdc; bool m_onePictureOnlyConstraintFlag; +#if !JVET_X0079_MODIFIED_BITRATE bool m_lowerBitRateConstraintFlag; +#endif bool m_allLayersIndependentConstraintFlag; bool m_noMrlConstraintFlag; bool m_noIspConstraintFlag; @@ -304,6 +306,9 @@ class ConstraintInfo bool m_noCraConstraintFlag; bool m_noGdrConstraintFlag; bool m_noApsConstraintFlag; +#if JVET_X0079_MODIFIED_BITRATE + bool m_allRapPicturesFlag; +#endif public: ConstraintInfo() @@ -321,7 +326,9 @@ public: , m_maxBitDepthConstraintIdc ( 16) , m_maxChromaFormatConstraintIdc(CHROMA_444) , m_onePictureOnlyConstraintFlag (false) +#if !JVET_X0079_MODIFIED_BITRATE , m_lowerBitRateConstraintFlag (false ) +#endif , m_allLayersIndependentConstraintFlag(false) , m_noMrlConstraintFlag(false) , m_noIspConstraintFlag(false) @@ -375,6 +382,9 @@ public: , m_noCraConstraintFlag (false) , m_noGdrConstraintFlag (false) , m_noApsConstraintFlag (false) +#if JVET_X0079_MODIFIED_BITRATE + , m_allRapPicturesFlag (false) +#endif {} @@ -421,8 +431,10 @@ public: bool getOnePictureOnlyConstraintFlag() const { return m_onePictureOnlyConstraintFlag; } void setOnePictureOnlyConstraintFlag(bool b) { m_onePictureOnlyConstraintFlag = b; } +#if !JVET_X0079_MODIFIED_BITRATE bool getLowerBitRateConstraintFlag() const { return m_lowerBitRateConstraintFlag; } void setLowerBitRateConstraintFlag(bool b) { m_lowerBitRateConstraintFlag = b; } +#endif bool getAllLayersIndependentConstraintFlag() const { return m_allLayersIndependentConstraintFlag; } void setAllLayersIndependentConstraintFlag(bool b) { m_allLayersIndependentConstraintFlag = b; } bool getNoMrlConstraintFlag() const { return m_noMrlConstraintFlag; } @@ -529,6 +541,10 @@ public: void setNoGdrConstraintFlag(bool bVal) { m_noGdrConstraintFlag = bVal; } bool getNoApsConstraintFlag() const { return m_noApsConstraintFlag; } void setNoApsConstraintFlag(bool bVal) { m_noApsConstraintFlag = bVal; } +#if JVET_X0079_MODIFIED_BITRATE + bool getAllRapPicturesFlag() const { return m_allRapPicturesFlag; } + void setAllRapPicturesFlag(bool bVal) { m_allRapPicturesFlag = bVal; } +#endif friend bool operator == (const ConstraintInfo& op1, const ConstraintInfo& op2); friend bool operator != (const ConstraintInfo& op1, const ConstraintInfo& op2); diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 65e4f5dec177bab93fac2d8e66b7a5518186d60b..b5fc0c048c827e594f712a1ca0b0ab498a809133 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -53,6 +53,9 @@ // clang-format off //########### place macros to be removed in next cycle below this line ############### +#define JVET_X0079_MODIFIED_BITRATE 1 // JVET-X0079v3 (changes to JVET-W2005) + +#define JVET_X0106_INTRA_CONSTRAINT 1 // JVET-X0106 Constraint on non I=frames in Intra profiles //########### place macros to be be kept below this line ############### #define GDR_ENABLED 1 diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index d26cd25503119a8f17710f1de993ee2861230dc8..0605de35b79dd70ff7f8d2517a3a184e11834c95 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2591,6 +2591,27 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag picHeader->setRecoveryPocCnt( -1 ); } +#if JVET_X0079_MODIFIED_BITRATE || JVET_X0106_INTRA_CONSTRAINT + bool isIrapOrGdrWRecoveryPocCnt0 = (picHeader->getGdrOrIrapPicFlag() && !picHeader->getGdrPicFlag()) || + (picHeader->getGdrPicFlag() && picHeader->getRecoveryPocCnt() == 0); + + if (!isIrapOrGdrWRecoveryPocCnt0) + { +#if JVET_X0106_INTRA_CONSTRAINT + const Profile::Name profile = sps->getProfileTierLevel()->getProfileIdc(); + bool isIntraProfile = profile == Profile::MAIN_12_INTRA || profile == Profile::MAIN_12_444_INTRA || + profile == Profile::MAIN_16_444_INTRA; + + CHECK(isIntraProfile && !isIrapOrGdrWRecoveryPocCnt0, + "Invalid non-irap pictures or gdr pictures with ph_recovery_poc_cnt!=0 for Intra profile"); +#endif +#if JVET_X0079_MODIFIED_BITRATE + CHECK(sps->getProfileTierLevel()->getConstraintInfo()->getAllRapPicturesFlag() == 1 && !isIrapOrGdrWRecoveryPocCnt0, + "gci_all_rap_pictures_flag equal to 1 specifies that all pictures in OlsInScope are IRAP pictures or GDR pictures with ph_recovery_poc_cnt equal to 0"); + } +#endif +#endif + std::vector<bool> phExtraBitsPresent = sps->getExtraPHBitPresentFlags(); for (int i=0; i< sps->getNumExtraPHBytes() * 8; i++) { @@ -4572,6 +4593,21 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo, const ProfileTie READ_FLAG(symbol, "gci_no_lmcs_constraint_flag"); cinfo->setNoLmcsConstraintFlag(symbol > 0 ? true : false); READ_FLAG(symbol, "gci_no_ladf_constraint_flag"); cinfo->setNoLadfConstraintFlag(symbol > 0 ? true : false); READ_FLAG(symbol, "gci_no_virtual_boundaries_constraint_flag"); cinfo->setNoVirtualBoundaryConstraintFlag(symbol > 0 ? true : false); +#if JVET_X0079_MODIFIED_BITRATE + READ_CODE(8, symbol, "gci_num_additional_bits"); + uint32_t const numAdditionalBits = symbol; + int numAdditionalBitsUsed; + if (numAdditionalBits > 0) + { + READ_FLAG(symbol, "gci_all_rap_pictures_flag"); cinfo->setAllRapPicturesFlag(symbol > 0 ? true : false); + numAdditionalBitsUsed = 1; + } + else + { + numAdditionalBitsUsed = 0; + } + for (int i = 0; i < numAdditionalBits - numAdditionalBitsUsed; i++) +#else READ_CODE(8, symbol, "gci_num_reserved_bits"); uint32_t const numReservedBits = symbol; int numReservedBitsUsed; @@ -4588,6 +4624,7 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo, const ProfileTie numReservedBitsUsed = 0; } for (int i = 0; i < numReservedBits - numReservedBitsUsed; i++) +#endif { READ_FLAG(symbol, "gci_reserved_zero_bit"); CHECK(symbol != 0, "gci_reserved_zero_bit not equal to zero"); } diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index fff01c244eee7d1e472a9d2af416725f5b3f42c7..69cadf7bfaa8a3f6ec087c8fe8c8085011682c5f 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -235,7 +235,11 @@ protected: bool m_noCraConstraintFlag; bool m_noGdrConstraintFlag; bool m_noApsConstraintFlag; +#if JVET_X0079_MODIFIED_BITRATE + bool m_allRapPicturesFlag; +#else bool m_generalLowerBitRateConstraintFlag; +#endif /* profile & level */ Profile::Name m_profile; @@ -1010,8 +1014,13 @@ public: void setNoGdrConstraintFlag(bool val) { m_noGdrConstraintFlag = val; } bool getNoApsConstraintFlag() const { return m_noApsConstraintFlag; } void setNoApsConstraintFlag(bool val) { m_noApsConstraintFlag = val; } +#if JVET_X0079_MODIFIED_BITRATE + bool getAllRapPicturesFlag() const { return m_allRapPicturesFlag; } + void setAllRapPicturesFlag(bool val) { m_allRapPicturesFlag = val; } +#else bool getGeneralLowerBitRateConstraintFlag() const { return m_generalLowerBitRateConstraintFlag; } void setGeneralLowerBitRateConstraintFlag(bool val) { m_generalLowerBitRateConstraintFlag = val; } +#endif void setFrameRate ( int i ) { m_iFrameRate = i; } void setFrameSkip ( uint32_t i ) { m_FrameSkip = i; } diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 2c08d77c21b874c67bdeea21054593afd5bab7f4..5f7f1d0a487bac65ed0f28e63398f0670cd54e09 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1118,7 +1118,11 @@ void EncLib::xInitSPS( SPS& sps ) cinfo->setNoCraConstraintFlag(m_noCraConstraintFlag); cinfo->setNoGdrConstraintFlag(m_noGdrConstraintFlag); cinfo->setNoApsConstraintFlag(m_noApsConstraintFlag); +#if JVET_X0079_MODIFIED_BITRATE + cinfo->setAllRapPicturesFlag(m_allRapPicturesFlag); +#else cinfo->setLowerBitRateConstraintFlag(m_generalLowerBitRateConstraintFlag); +#endif profileTierLevel->setLevelIdc (m_level); profileTierLevel->setTierFlag (m_levelTier); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index e6027b3e1c99490ec7e61685d434f6458287c68c..7b963f001511d5702598e7f67febcad9f45beed5 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -2703,13 +2703,23 @@ void HLSWriter::codeConstraintInfo ( const ConstraintInfo* cinfo, const Profil profile == Profile::MAIN_12_444 || profile == Profile::MAIN_12_444_INTRA || profile == Profile::MAIN_12_444_STILL_PICTURE || profile == Profile::MAIN_16_444 || profile == Profile::MAIN_16_444_INTRA || profile == Profile::MAIN_16_444_STILL_PICTURE) { +#if JVET_X0079_MODIFIED_BITRATE + int numAdditionalBits = 1; + WRITE_CODE(numAdditionalBits, 8, "gci_num_additional_bits"); + WRITE_FLAG(cinfo->getAllRapPicturesFlag() ? 1 : 0, "gci_all_rap_pictures_flag"); +#else int numReservedBits = 1; WRITE_CODE(numReservedBits, 8, "gci_num_reserved_bits"); WRITE_FLAG(cinfo->getLowerBitRateConstraintFlag() ? 1 : 0, "general_lower_bit_rate_constraint_flag"); +#endif } else { +#if JVET_X0079_MODIFIED_BITRATE + WRITE_CODE(0, 8, "gci_num_additional_bits"); +#else WRITE_CODE(0, 8, "gci_num_reserved_bits"); +#endif } }