Commit fa8b7fa0 authored by Jonatan Samuelsson's avatar Jonatan Samuelsson
Browse files

syntax modification and inference from JVET-P0217

parent d8f67be5
......@@ -49,6 +49,9 @@
#include <cstring>
#include <assert.h>
#include <cassert>
#define JVET_P0217_PTL_SYNTAX_CLEANUP 1 // JVET-P0217: On Profile, tier, and level syntax structure
#define JVET_P01034_PRED_1D_SCALING_LIST 1 // JVET-P1034: 1D Scaling list index and add predictor mode
#define JVET_P0345_LD_GOP_8 1 // JVET-P0345: low-delay gop size 8
......
......@@ -2652,6 +2652,12 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubL
READ_CODE(7 , symbol, "general_profile_idc" ); ptl->setProfileIdc (Profile::Name(symbol));
READ_FLAG( symbol, "general_tier_flag" ); ptl->setTierFlag (symbol ? Level::HIGH : Level::MAIN);
#if JVET_P0217_PTL_SYNTAX_CLEANUP
parseConstraintInfo( ptl->getConstraintInfo() );
READ_CODE( 8, symbol, "general_level_idc" ); ptl->setLevelIdc( Level::Name( symbol ) );
#endif
READ_CODE(8, symbol, "num_sub_profiles");
uint8_t numSubProfiles = symbol;
ptl->setNumSubProfile( numSubProfiles );
......@@ -2660,9 +2666,11 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubL
READ_CODE(32, symbol, "general_sub_profile_idc[i]"); ptl->setSubProfileIdc(i, symbol);
}
#if !JVET_P0217_PTL_SYNTAX_CLEANUP
parseConstraintInfo( ptl->getConstraintInfo() );
READ_CODE(8 , symbol, "general_level_idc" ); ptl->setLevelIdc (Level::Name(symbol));
#endif
for (int i = 0; i < maxNumSubLayersMinus1; i++)
{
......@@ -2681,6 +2689,20 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubL
READ_CODE(8 , symbol, "sub_layer_level_idc" ); ptl->setSubLayerLevelIdc (i, Level::Name(symbol));
}
}
#if JVET_P0217_PTL_SYNTAX_CLEANUP
Level::Name levelOfHigherSublayer = ptl->getLevelIdc();
for( int i = maxNumSubLayersMinus1 - 1; i >= 0; i-- )
{
if( ptl->getSubLayerLevelPresentFlag( i ) )
{
levelOfHigherSublayer = ptl->getSubLayerLevelIdc( i );
}
else
{
ptl->setSubLayerLevelIdc( i, levelOfHigherSublayer );
}
}
#endif
}
......
......@@ -1639,15 +1639,23 @@ void HLSWriter::codeProfileTierLevel ( const ProfileTierLevel* ptl, int maxN
WRITE_CODE( int(ptl->getProfileIdc()), 7 , "general_profile_idc" );
WRITE_FLAG( ptl->getTierFlag()==Level::HIGH, "general_tier_flag" );
#if JVET_P0217_PTL_SYNTAX_CLEANUP
codeConstraintInfo( ptl->getConstraintInfo() );
WRITE_CODE( int( ptl->getLevelIdc() ), 8, "general_level_idc" );
#endif
WRITE_CODE(ptl->getNumSubProfile(), 8, "num_sub_profiles");
for (int i = 0; i < ptl->getNumSubProfile(); i++)
{
WRITE_CODE(ptl->getSubProfileIdc(i) , 32, "general_sub_profile_idc[i]");
}
#if !JVET_P0217_PTL_SYNTAX_CLEANUP
codeConstraintInfo(ptl->getConstraintInfo());
WRITE_CODE( int(ptl->getLevelIdc()), 8 , "general_level_idc" );
#endif
for (int i = 0; i < maxNumSubLayersMinus1; i++)
{
......
Supports Markdown
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