diff --git a/doc/software-manual.tex b/doc/software-manual.tex index 5c87a7dde72502b968cd18b7b5ecb07f1f7ac2e0..e463001801d7de0c79aaa310da3eb62eab53d294 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -954,7 +954,8 @@ multiple matches. \Default{none} & Specifies the profile to which the encoded bitstream complies. -Valid VVC Ver. 1 values are: none, main_10, main_10_still_picture, main_444_10, main_444_10_still_picture. +Valid VVC Ver. 1 values are: none, main_10, main_10_still_picture, main_10_444, main_10_444_still_picture, +multilayer_main_10, multilayer_main_10_still_picture, multilayer_main_10_444, multilayer_main_10_444_still_picture. When one of the still picture profiles are selected, the OnePictureOnlyConstraintFlag setting will be forced to 1. \\ diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 491690593fd8ce2fc50c48f787801ae10605e230..d0bfaf9aa0e82321661f65342ba675745c43408b 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -204,7 +204,14 @@ void EncApp::xInitLibCfg() #if JVET_S0138_GCI_PTL ptls[0].setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlag); ptls[0].setMultiLayerEnabledFlag ( m_multiLayerEnabledFlag); +#if JVET_S_PROFILES + CHECK((m_profile == Profile::MAIN_10 || m_profile == Profile::MAIN_10_444 + || m_profile == Profile::MAIN_10_STILL_PICTURE || m_profile == Profile::MAIN_10_444_STILL_PICTURE) + && m_multiLayerEnabledFlag, + "ptl_multilayer_enabled_flag shall be equal to 0 for non-multilayer profiles"); +#else CHECK( (m_profile == Profile::MAIN_10 || m_profile == Profile::MAIN_444_10) && m_multiLayerEnabledFlag, "ptl_multilayer_enabled_flag shall be equal to 0 for Main 10 and Main 10 4:4:4 profiles"); +#endif CHECK( !m_multiLayerEnabledFlag && m_maxLayers > 1, "There is only one layer in the CVS when ptl_multilayer_enabled_flag equal to 0"); #endif ptls[0].setNumSubProfile ( m_numSubProfile ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 62e0f18181d945a45471555e84214bcf893f1e82..13c8b4cbb91e89398d62733ae19b1d05b42db59c 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -49,6 +49,9 @@ #include "EncoderLib/RateCtrl.h" #include "CommonLib/dtrace_next.h" +#if JVET_S_PROFILES +#include "CommonLib/ProfileLevelTier.h" +#endif #define MACRO_TO_STRING_HELPER(val) #val #define MACRO_TO_STRING(val) MACRO_TO_STRING_HELPER(val) @@ -56,19 +59,28 @@ using namespace std; namespace po = df::program_options_lite; - - -enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations +enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single + // profile idc with various constraint flag combinations { NONE, +#if JVET_S_PROFILES + MAIN_10, + MAIN_10_STILL_PICTURE, + MAIN_10_444, + MAIN_10_444_STILL_PICTURE, + MULTILAYER_MAIN_10, + MULTILAYER_MAIN_10_STILL_PICTURE, + MULTILAYER_MAIN_10_444, + MULTILAYER_MAIN_10_444_STILL_PICTURE, +#else MAIN_10, MAIN_10_STILL_PICTURE, MAIN_444_10, MAIN_444_10_STILL_PICTURE, +#endif AUTO = -1 }; - //! \ingroup EncoderApp //! \{ @@ -165,30 +177,47 @@ static const struct MapStrToProfile { const char* str; Profile::Name value; -} -strToProfile[] = -{ - {"none", Profile::NONE }, - {"main_10", Profile::MAIN_10 }, - {"main_444_10", Profile::MAIN_444_10 } +} strToProfile[] = { + { "none", Profile::NONE }, +#if JVET_S_PROFILES + { "main_10", Profile::MAIN_10 }, + { "main_10_444", Profile::MAIN_10_444 }, + { "main_10_still_picture", Profile::MAIN_10_STILL_PICTURE }, + { "main_10_444_still_picture", Profile::MAIN_10_444_STILL_PICTURE }, + { "multilayer_main_10", Profile::MULTILAYER_MAIN_10 }, + { "multilayer_main_10_444", Profile::MULTILAYER_MAIN_10_444 }, + { "multilayer_main_10_still_picture", Profile::MULTILAYER_MAIN_10_STILL_PICTURE }, + { "multilayer_main_10_444_still_picture", Profile::MULTILAYER_MAIN_10_444_STILL_PICTURE }, +#else + { "main_10", Profile::MAIN_10 }, + { "main_444_10", Profile::MAIN_444_10 }, +#endif }; static const struct MapStrToExtendedProfile { const char* str; ExtendedProfileName value; -} -strToExtendedProfile[] = -{ - {"none", NONE }, - {"main_10", MAIN_10 }, - {"main_444_10", MAIN_444_10 }, - {"main_10_still_picture", MAIN_10_STILL_PICTURE }, - {"main_444_10_still_picture", MAIN_444_10_STILL_PICTURE }, - {"auto", AUTO } +} strToExtendedProfile[] = { + { "none", NONE }, +#if JVET_S_PROFILES + { "main_10", MAIN_10 }, + { "main_10_444", MAIN_10_444 }, + { "main_10_still_picture", MAIN_10_STILL_PICTURE }, + { "main_10_444_still_picture", MAIN_10_444_STILL_PICTURE }, + { "multilayer_main_10", MULTILAYER_MAIN_10 }, + { "multilayer_main_10_444", MULTILAYER_MAIN_10_444 }, + { "multilayer_main_10_still_picture", MULTILAYER_MAIN_10_STILL_PICTURE }, + { "multilayer_main_10_444_still_picture", MULTILAYER_MAIN_10_444_STILL_PICTURE }, +#else + { "main_10", MAIN_10 }, + { "main_444_10", MAIN_444_10 }, + { "main_10_still_picture", MAIN_10_STILL_PICTURE }, + { "main_444_10_still_picture", MAIN_444_10_STILL_PICTURE }, +#endif + { "auto", AUTO }, }; - static const struct MapStrToTier { const char* str; @@ -773,7 +802,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("HarmonizeGopFirstFieldCoupleEnabled", m_bHarmonizeGopFirstFieldCoupleEnabled, true, "Enables harmonization of Gop first field couple") // Profile and level +#if JVET_S_PROFILES + ("Profile", extendedProfile, ExtendedProfileName::NONE, "Profile name to use for encoding. Use [multilayer_]main_10[_444][_still_picture], auto, or none") +#else ("Profile", extendedProfile, ExtendedProfileName::NONE, "Profile name to use for encoding. Use main_10, main_10_still_picture, main_444_10, main_444_10_still_picture, auto, or none") +#endif ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1, or none") ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)") #if JVET_S0138_GCI_PTL @@ -789,7 +822,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("IntraOnlyConstraintFlag", m_intraOnlyConstraintFlag, false, "Value of intra_only_constraint_flag") ("AllLayersIndependentConstraintFlag", m_allLayersIndependentConstraintFlag, false, "Indicate that all layers are independent") ("OnePictureOnlyConstraintFlag", m_onePictureOnlyConstraintFlag, false, "Value of general_intra_constraint_flag. Can only be used for single frame encodings. Will be set to true for still picture profiles") - ("MaxBitDepthConstraintIdc", m_maxBitDepthConstraintIdc, 16u, "Indicate that bit_depth_minus8 plus 8 shall be in the range of 0 to m_maxBitDepthConstraintIdc") + ("MaxBitDepthConstraintIdc", m_maxBitDepthConstraintIdc, 16u, "Indicate that sps_bitdepth_minus8 plus 8 shall be in the range of 0 to m_maxBitDepthConstraintIdc") ("MaxChromaFormatConstraintIdc", m_maxChromaFormatConstraintIdc, 3, "Indicate that chroma_format_idc shall be in the range of 0 to m_maxChromaFormatConstraintIdc") ("TrailConstraintFlag", m_noTrailConstraintFlag, false, "Indicate that TRAIL is deactivated") ("StsaConstraintFlag", m_noStsaConstraintFlag, false, "Indicate that STSA is deactivated") @@ -1893,14 +1926,34 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) { switch (extendedProfile) { - case ExtendedProfileName::NONE: m_profile = Profile::NONE; break; - case ExtendedProfileName::MAIN_10: m_profile = Profile::MAIN_10; break; - case ExtendedProfileName::MAIN_444_10: m_profile = Profile::MAIN_444_10; break; - case ExtendedProfileName::MAIN_10_STILL_PICTURE: m_profile = Profile::MAIN_10; m_onePictureOnlyConstraintFlag = true; break; - case ExtendedProfileName::MAIN_444_10_STILL_PICTURE: m_profile = Profile::MAIN_444_10; m_onePictureOnlyConstraintFlag = true; break; - default: - EXIT( "Unable to determine profile from configured settings"); - break; +#if JVET_S_PROFILES + case ExtendedProfileName::NONE: m_profile = Profile::NONE; break; + case ExtendedProfileName::MAIN_10: m_profile = Profile::MAIN_10; break; + case ExtendedProfileName::MAIN_10_444: m_profile = Profile::MAIN_10_444; break; + case ExtendedProfileName::MAIN_10_STILL_PICTURE: m_profile = Profile::MAIN_10_STILL_PICTURE; break; + case ExtendedProfileName::MAIN_10_444_STILL_PICTURE: m_profile = Profile::MAIN_10_444_STILL_PICTURE; break; + case ExtendedProfileName::MULTILAYER_MAIN_10: m_profile = Profile::MULTILAYER_MAIN_10; break; + case ExtendedProfileName::MULTILAYER_MAIN_10_444: m_profile = Profile::MULTILAYER_MAIN_10_444; break; + case ExtendedProfileName::MULTILAYER_MAIN_10_STILL_PICTURE: + m_profile = Profile::MULTILAYER_MAIN_10_STILL_PICTURE; + break; + case ExtendedProfileName::MULTILAYER_MAIN_10_444_STILL_PICTURE: + m_profile = Profile::MULTILAYER_MAIN_10_444_STILL_PICTURE; + break; +#else + case ExtendedProfileName::NONE: m_profile = Profile::NONE; break; + case ExtendedProfileName::MAIN_10: m_profile = Profile::MAIN_10; break; + case ExtendedProfileName::MAIN_444_10: m_profile = Profile::MAIN_444_10; break; + case ExtendedProfileName::MAIN_10_STILL_PICTURE: + m_profile = Profile::MAIN_10; + m_onePictureOnlyConstraintFlag = true; + break; + case ExtendedProfileName::MAIN_444_10_STILL_PICTURE: + m_profile = Profile::MAIN_444_10; + m_onePictureOnlyConstraintFlag = true; + break; +#endif + default: EXIT("Unable to determine profile from configured settings"); break; } } @@ -1908,10 +1961,19 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? m_chromaFormatIDC : numberToChromaFormat(tmpConstraintChromaFormat); if (m_bitDepthConstraint == 0) { +#if JVET_S_PROFILES + if (m_profile != Profile::NONE) + { + const ProfileFeatures *features = ProfileFeatures::getProfileFeatures(m_profile); + CHECK(features->profile != m_profile, "Profile not found"); + m_bitDepthConstraint = features->maxBitDepth; + } +#else if (m_profile == Profile::MAIN_10 || m_profile == Profile::MAIN_444_10) { m_bitDepthConstraint = 10; } +#endif else // m_profile == Profile::NONE { #if JVET_S0094_CHROMAFORMAT_BITDEPTH_CONSTRAINT @@ -2506,6 +2568,29 @@ int EncAppCfg::xAutoDetermineProfile() const int maxBitDepth= std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[m_chromaFormatIDC==ChromaFormat::CHROMA_400 ? CHANNEL_TYPE_LUMA : CHANNEL_TYPE_CHROMA]); m_profile=Profile::NONE; +#if JVET_S_PROFILES + switch (m_chromaFormatIDC) + { + case ChromaFormat::CHROMA_400: + case ChromaFormat::CHROMA_420: + if (maxBitDepth <= 10) + { + m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10 : Profile::MAIN_10; + } + break; + + case ChromaFormat::CHROMA_422: + case ChromaFormat::CHROMA_444: + if (maxBitDepth <= 10) + { + m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10_444 : Profile::MAIN_10_444; + } + break; + + default: return 1; + } + +#else if (m_chromaFormatIDC==ChromaFormat::CHROMA_400 || m_chromaFormatIDC==ChromaFormat::CHROMA_420) { if (maxBitDepth<=10) @@ -2524,6 +2609,7 @@ int EncAppCfg::xAutoDetermineProfile() { return 1; // unknown chroma format } +#endif return 0; } @@ -2598,7 +2684,11 @@ bool EncAppCfg::xCheckParameter() xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)"); xConfirmPara(m_internalBitDepth[CHANNEL_TYPE_CHROMA] != m_internalBitDepth[CHANNEL_TYPE_LUMA], "The internalBitDepth must be the same for luma and chroma"); +#if JVET_S_PROFILES + if (m_profile != Profile::NONE) +#else if (m_profile==Profile::MAIN_10 || m_profile==Profile::MAIN_444_10) +#endif { xConfirmPara(m_log2MaxTransformSkipBlockSize>=6, "Transform Skip Log2 Max Size must be less or equal to 5 for given profile."); xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for given profile."); @@ -2680,10 +2770,19 @@ bool EncAppCfg::xCheckParameter() xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)"); xConfirmPara ( m_onePictureOnlyConstraintFlag && m_framesToBeEncoded!=1, "When onePictureOnlyConstraintFlag is true, the number of frames to be encoded must be 1" ); +#if JVET_S_PROFILES + if (m_profile != Profile::NONE) + { + const ProfileFeatures *features = ProfileFeatures::getProfileFeatures(m_profile); + CHECK(features->profile != m_profile, "Profile not found"); + xConfirmPara(m_level == Level::LEVEL15_5 && !features->canUseLevel15p5, "Profile does not support level 15.5"); + } +#else if (m_profile == Profile::MAIN_10 || m_profile==Profile::MAIN_444_10) { xConfirmPara ( m_level==Level::LEVEL15_5 && !m_onePictureOnlyConstraintFlag, "Currently the only profiles that support level 15.5 are still pictures, which require onePictureOnlyConstraintFlag to be 1" ); } +#endif xConfirmPara( m_iQP < -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > MAX_QP, "QP exceeds supported range (-QpBDOffsety to 63)" ); #if W0038_DB_OPT diff --git a/source/Lib/CommonLib/ProfileLevelTier.cpp b/source/Lib/CommonLib/ProfileLevelTier.cpp index de2cc87ca3020e09bc5145414259a0a8901d5ef3..c759ff22886832f0904876d62e5efe349a78ba77 100644 --- a/source/Lib/CommonLib/ProfileLevelTier.cpp +++ b/source/Lib/CommonLib/ProfileLevelTier.cpp @@ -93,16 +93,50 @@ static const LevelTierFeatures mainLevelTierInfo[] = #endif }; -static const ProfileFeatures validProfiles[] = -{ // profile, pNameString, maxBitDepth, maxChrFmt, lvl15.5, cpbvcl, cpbnal, fcf*1000, mincr*100, levelInfo - // most constrained profiles must appear first. - { Profile::MAIN_10, "Main_10_Still_Picture", 10, CHROMA_420, true, 1000, 1100, 1875, 100 , mainLevelTierInfo, true }, - { Profile::MAIN_444_10, "Main_444_10_Still_Picture", 10, CHROMA_444, true, 2500, 2750, 3750, 75 , mainLevelTierInfo, true }, - { Profile::MAIN_10, "Main_10", 10, CHROMA_420, false, 1000, 1100, 1875, 100 , mainLevelTierInfo, false }, - { Profile::MAIN_444_10, "Main_444_10", 10, CHROMA_444, false, 2500, 2750, 3750, 75 , mainLevelTierInfo, false }, - { Profile::NONE, 0 } +static const ProfileFeatures validProfiles[] = { +// profile, pNameString, maxBitDepth, maxChrFmt, lvl15.5, cpbvcl, cpbnal, fcf*1000, mincr*100, levelInfo +// most constrained profiles must appear first. +#if JVET_S_PROFILES + { Profile::MAIN_10_STILL_PICTURE, "Main_10_Still_Picture", 10, CHROMA_420, true, 1000, 1100, 1875, 100, + mainLevelTierInfo, true }, + { Profile::MULTILAYER_MAIN_10_STILL_PICTURE, "Multilayer_Main_10_Still_Picture", 10, CHROMA_420, true, 1000, 1100, + 1875, 100, mainLevelTierInfo, true }, + { Profile::MAIN_10_444_STILL_PICTURE, "Main_444_10_Still_Picture", 10, CHROMA_444, true, 2500, 2750, 3750, 75, + mainLevelTierInfo, true }, + { Profile::MULTILAYER_MAIN_10_444_STILL_PICTURE, "Multilayer_Main_444_10_Still_Picture", 10, CHROMA_444, true, 2500, + 2750, 3750, 75, mainLevelTierInfo, true }, + { Profile::MAIN_10, "Main_10", 10, CHROMA_420, false, 1000, 1100, 1875, 100, mainLevelTierInfo, false }, + { Profile::MULTILAYER_MAIN_10, "Multilayer_Main_10", 10, CHROMA_420, false, 1000, 1100, 1875, 100, mainLevelTierInfo, + false }, + { 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 }, +#else + { Profile::MAIN_10, "Main_10_Still_Picture", 10, CHROMA_420, true, 1000, 1100, 1875, 100, mainLevelTierInfo, true }, + { Profile::MAIN_444_10, "Main_444_10_Still_Picture", 10, CHROMA_444, true, 2500, 2750, 3750, 75, mainLevelTierInfo, + true }, + { Profile::MAIN_10, "Main_10", 10, CHROMA_420, false, 1000, 1100, 1875, 100, mainLevelTierInfo, false }, + { Profile::MAIN_444_10, "Main_444_10", 10, CHROMA_444, false, 2500, 2750, 3750, 75, mainLevelTierInfo, false }, +#endif + { Profile::NONE, 0 }, }; +#if JVET_S_PROFILES +const ProfileFeatures *ProfileFeatures::getProfileFeatures(const Profile::Name p) +{ + int i; + for (i = 0; validProfiles[i].profile != Profile::NONE; i++) + { + if (validProfiles[i].profile == p) + { + return &validProfiles[i]; + } + } + + return &validProfiles[i]; +} +#endif + void ProfileLevelTierFeatures::extractPTLInformation(const SPS &sps) { diff --git a/source/Lib/CommonLib/ProfileLevelTier.h b/source/Lib/CommonLib/ProfileLevelTier.h index 869efca873d0005798407b4d6e35454e9263dca8..a7ca27730c9eb82bb2aaf283c7a908c884186940 100644 --- a/source/Lib/CommonLib/ProfileLevelTier.h +++ b/source/Lib/CommonLib/ProfileLevelTier.h @@ -82,6 +82,10 @@ struct ProfileFeatures uint32_t minCrScaleFactorx100; const LevelTierFeatures *pLevelTiersListInfo; bool onePictureOnlyFlagMustBe1; + +#if JVET_S_PROFILES + static const ProfileFeatures *getProfileFeatures(const Profile::Name p); +#endif }; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 41cd53d20bdaee4f436528606173a81a7021cc28..ecd14902c0c714e463a572178c94407460d76bb8 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,12 +50,15 @@ #include <assert.h> #include <cassert> +// clang-format off //########### place macros to be removed in next cycle below this line ############### #define JVET_S0203 1 // JVET-S0203 (aspects 1 & 2): change the signalling of sublayer_level_idc[ i ] and ptl_sublayer_level_present_flag[ i ] to be in descending order #define JVET_S0066_GCI 1 // JVET-S0066: Signal new GCI flags gci_three_minus_max_log2_ctu_size_constraint_idc and gci_no_luma_transform_size_64_constraint_flag (no_explicit_scaling_list_constraint_flag already included as part of JVET-S0050) -#define JVET_S0193_NO_OUTPUT_PRIOR_PIC 1 // JVET-S0193: Move ph_no_output_of_prior_pics_flag to SH +#define JVET_S0193_NO_OUTPUT_PRIOR_PIC 1 // JVET-S0193: Move ph_no_output_of_prior_pics_flag to SH + +#define JVET_S_PROFILES 1 // Profile definitions #define JVET_S0219_ASPECT2_CHANGE_ORDER_APS_PARAMS_TYPE 1 // JVET-S0219 aspect2: change the order to put the aps_params_type before the aps_adaptation_parameter_set_id. @@ -168,12 +171,10 @@ typedef std::pair<int, bool> TrMode; typedef std::pair<int, int> TrCost; -// clang-format off #define REUSE_CU_RESULTS 1 #if REUSE_CU_RESULTS #define REUSE_CU_RESULTS_WITH_MULTIPLE_TUS 1 #endif -// clang-format on #ifndef JVET_J0090_MEMORY_BANDWITH_MEASURE #define JVET_J0090_MEMORY_BANDWITH_MEASURE 0 @@ -203,6 +204,7 @@ typedef std::pair<int, int> TrCost; #endif +// clang-format on // ==================================================================================================================== // General settings @@ -772,9 +774,22 @@ namespace Profile { enum Name { +#if JVET_S_PROFILES + NONE = 0, + STILL_PICTURE = 64, + MAIN_10 = 1, + MAIN_10_STILL_PICTURE = MAIN_10 | STILL_PICTURE, + MULTILAYER_MAIN_10 = 17, + MULTILAYER_MAIN_10_STILL_PICTURE = MULTILAYER_MAIN_10 | STILL_PICTURE, + MAIN_10_444 = 33, + MAIN_10_444_STILL_PICTURE = MAIN_10_444 | STILL_PICTURE, + MULTILAYER_MAIN_10_444 = 49, + MULTILAYER_MAIN_10_444_STILL_PICTURE = MULTILAYER_MAIN_10_444 | STILL_PICTURE, +#else NONE = 0, MAIN_10 = 1, MAIN_444_10 = 2 +#endif }; } diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 0cbd35ebf690466aa5b65eb41304e97e8a812bdc..af37a0dcb6f7ecb2e6c0742996ea6925eb2f602e 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -1806,7 +1806,8 @@ void DecLib::xCheckParameterSetConstraints(const int layerId) CHECK( sps->getMaxPicWidthInLumaSamples() > vps->getOlsDpbPicSize( vps->m_targetOlsIdx ).width, "pic_width_max_in_luma_samples shall be less than or equal to the value of ols_dpb_pic_width[ i ]" ); CHECK( sps->getMaxPicHeightInLumaSamples() > vps->getOlsDpbPicSize( vps->m_targetOlsIdx ).height, "pic_height_max_in_luma_samples shall be less than or equal to the value of ols_dpb_pic_height[ i ]" ); CHECK( sps->getChromaFormatIdc() > vps->getOlsDpbChromaFormatIdc( vps->m_targetOlsIdx ), "sps_chroma_format_idc shall be less than or equal to the value of ols_dpb_chroma_format[ i ]"); - CHECK((sps->getBitDepth(CHANNEL_TYPE_LUMA) - 8) > vps->getOlsDpbBitDepthMinus8( vps->m_targetOlsIdx ), "sps_bit_depth_minus8 shall be less than or equal to the value of ols_dpb_bitdepth_minus8[ i ]"); + CHECK((sps->getBitDepth(CHANNEL_TYPE_LUMA) - 8) > vps->getOlsDpbBitDepthMinus8(vps->m_targetOlsIdx), + "sps_bitdepth_minus8 shall be less than or equal to the value of ols_dpb_bitdepth_minus8[ i ]"); } static std::unordered_map<int, int> m_layerChromaFormat; @@ -1911,6 +1912,12 @@ void DecLib::xCheckParameterSetConstraints(const int layerId) ptlFeature.extractPTLInformation(*sps); CHECK(pps->getNumTileColumns() > ptlFeature.getLevelTierFeatures()->maxTileCols, "Num tile columns signaled in PPS exceed level limits"); CHECK(pps->getNumTiles() > ptlFeature.getLevelTierFeatures()->maxTilesPerAu, "Num tiles signaled in PPS exceed level limits"); +#if JVET_S_PROFILES + CHECK(sps->getBitDepth(CHANNEL_TYPE_LUMA) > ptlFeature.getProfileFeatures()->maxBitDepth, + "Bit depth exceed profile limit"); + CHECK(sps->getChromaFormatIdc() > ptlFeature.getProfileFeatures()->maxChromaFormat, + "Chroma format exceed profile limit"); +#endif #endif } diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 8e0ab8fab092c73ff2fe35e75eba233acda6e7e4..a0e33aca4d4ccadca9f8f965fb48737b61dd14c6 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1678,7 +1678,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) } } - READ_UVLC( uiCode, "bit_depth_minus8" ); + READ_UVLC(uiCode, "sps_bitdepth_minus8"); CHECK(uiCode > 8, "Invalid bit depth signalled"); pcSPS->setBitDepth(CHANNEL_TYPE_LUMA, 8 + uiCode); pcSPS->setBitDepth(CHANNEL_TYPE_CHROMA, 8 + uiCode); @@ -4831,7 +4831,15 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, bool profileTi #if JVET_S0138_GCI_PTL READ_FLAG( symbol, "ptl_frame_only_constraint_flag" ); ptl->setFrameOnlyConstraintFlag(symbol); READ_FLAG( symbol, "ptl_multilayer_enabled_flag" ); ptl->setMultiLayerEnabledFlag(symbol); +#if JVET_S_PROFILES + CHECK((ptl->getProfileIdc() == Profile::MAIN_10 || ptl->getProfileIdc() == Profile::MAIN_10_444 + || ptl->getProfileIdc() == Profile::MAIN_10_STILL_PICTURE + || ptl->getProfileIdc() == Profile::MAIN_10_444_STILL_PICTURE) + && symbol, + "ptl_multilayer_enabled_flag shall be equal to 0 for non-multilayer profiles"); +#else CHECK( (ptl->getProfileIdc() == Profile::MAIN_10 || ptl->getProfileIdc() == Profile::MAIN_444_10) && symbol, "ptl_multilayer_enabled_flag shall be equal to 0 for Main 10 and Main 10 4:4:4 profiles"); +#endif #endif if(profileTierPresentFlag) diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index ea4f5e06a40edec37b6577722e11ef2564432e79..fcf448d8db98156a7fb80aee3d82932e01c21023 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -978,7 +978,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) } } - WRITE_UVLC( pcSPS->getBitDepth(CHANNEL_TYPE_LUMA) - 8, "bit_depth_minus8" ); + WRITE_UVLC(pcSPS->getBitDepth(CHANNEL_TYPE_LUMA) - 8, "sps_bitdepth_minus8"); WRITE_FLAG( pcSPS->getEntropyCodingSyncEnabledFlag() ? 1 : 0, "sps_entropy_coding_sync_enabled_flag" ); WRITE_FLAG( pcSPS->getEntryPointsPresentFlag() ? 1 : 0, "sps_entry_point_offsets_present_flag" ); WRITE_CODE(pcSPS->getBitsForPOC()-4, 4, "log2_max_pic_order_cnt_lsb_minus4");