Commit 416020d4 authored by Frank Bossen's avatar Frank Bossen

Fix profile handling

In encoder, when automatically selecting profile, choose a still
picture profile when the level is 15.5 and a single picture is to
be encoded.
In decoder, don't check for single picture constraint when looking
up profiles.
parent d72e9c24
......@@ -2575,7 +2575,14 @@ int EncAppCfg::xAutoDetermineProfile()
case ChromaFormat::CHROMA_420:
if (maxBitDepth <= 10)
{
m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10 : Profile::MAIN_10;
if (m_level == Level::LEVEL15_5 && m_framesToBeEncoded == 1)
{
m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10_STILL_PICTURE : Profile::MAIN_10_STILL_PICTURE;
}
else
{
m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10 : Profile::MAIN_10;
}
}
break;
......@@ -2583,7 +2590,15 @@ int EncAppCfg::xAutoDetermineProfile()
case ChromaFormat::CHROMA_444:
if (maxBitDepth <= 10)
{
m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10_444 : Profile::MAIN_10_444;
if (m_level == Level::LEVEL15_5 && m_framesToBeEncoded == 1)
{
m_profile =
m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10_444_STILL_PICTURE : Profile::MAIN_10_444_STILL_PICTURE;
}
else
{
m_profile = m_maxLayers > 1 ? Profile::MULTILAYER_MAIN_10_444 : Profile::MAIN_10_444;
}
}
break;
......
......@@ -145,10 +145,16 @@ ProfileLevelTierFeatures::extractPTLInformation(const SPS &sps)
m_tier = spsPtl.getTierFlag();
// Identify the profile from the profile Idc, and possibly other constraints.
#if !JVET_S_PROFILES
bool onePictureOnlyConstraintFlag=spsPtl.getConstraintInfo()->getOnePictureOnlyConstraintFlag();
#endif
for(int32_t i=0; validProfiles[i].profile != Profile::NONE; i++)
{
#if JVET_S_PROFILES
if (spsPtl.getProfileIdc() == validProfiles[i].profile)
#else
if (spsPtl.getProfileIdc() == validProfiles[i].profile && !(validProfiles[i].onePictureOnlyFlagMustBe1 && !onePictureOnlyConstraintFlag))
#endif
{
m_pProfile = &(validProfiles[i]);
break;
......
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