Commit 9485eec2 authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'ptl1' into 'master'

Update profile definitions

See merge request !1816
parents d39bee33 5a137e87
Pipeline #5558 passed with stage
in 28 minutes and 37 seconds
......@@ -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.
\\
......
......@@ -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 );
......
This diff is collapsed.
......@@ -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)
{
......
......@@ -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
};
......
......@@ -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
};
}
......
......@@ -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
}
......
......@@ -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)
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment