Commit 492fdeb2 authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'L0696-Constraint-Syntax' into 'master'

Added changes for L0696 Proposed starting point for interoperability point syntax

See merge request jvet/VVCSoftware_VTM!136
parents 3a7ada0d 59b7efa0
Pipeline #465 passed with stage
......@@ -1839,6 +1839,25 @@ SPSNext::SPSNext( SPS& sps )
SPS::SPS()
: m_SPSId ( 0)
#if JVET_L0696_CONSTRAINT_SYNTAX
, m_bIntraOnlyConstraintFlag (false)
, m_maxBitDepthConstraintIdc ( 0)
, m_maxChromaFormatConstraintIdc(CHROMA_420)
, m_bFrameConstraintFlag (false)
, m_bNoQtbttDualTreeIntraConstraintFlag(false)
, m_bNoCclmConstraintFlag (false)
, m_bNoSaoConstraintFlag (false)
, m_bNoAlfConstraintFlag (false)
, m_bNoPcmConstraintFlag (false)
, m_bNoTemporalMvpConstraintFlag(false)
, m_bNoSbtmvpConstraintFlag (false)
, m_bNoAmvrConstraintFlag (false)
, m_bNoAffineMotionConstraintFlag(false)
, m_bNoMtsConstraintFlag (false)
, m_bNoLadfConstraintFlag (false)
, m_bNoDepQuantConstraintFlag (false)
, m_bNoSignDataHidingConstraintFlag(false)
#endif
#if HEVC_VPS
, m_VPSId ( 0)
#endif
......
......@@ -1003,6 +1003,26 @@ class SPS
{
private:
int m_SPSId;
#if JVET_L0696_CONSTRAINT_SYNTAX
bool m_bIntraOnlyConstraintFlag;
uint32_t m_maxBitDepthConstraintIdc;
uint32_t m_maxChromaFormatConstraintIdc;
bool m_bFrameConstraintFlag;
bool m_bNoQtbttDualTreeIntraConstraintFlag;
bool m_bNoCclmConstraintFlag;
bool m_bNoSaoConstraintFlag;
bool m_bNoAlfConstraintFlag;
bool m_bNoPcmConstraintFlag;
bool m_bNoTemporalMvpConstraintFlag;
bool m_bNoSbtmvpConstraintFlag;
bool m_bNoAmvrConstraintFlag;
bool m_bNoAffineMotionConstraintFlag;
bool m_bNoMtsConstraintFlag;
bool m_bNoLadfConstraintFlag;
bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag;
#endif
#if HEVC_VPS
int m_VPSId;
#endif
......@@ -1104,6 +1124,42 @@ public:
#if HEVC_VPS
int getVPSId() const { return m_VPSId; }
void setVPSId(int i) { m_VPSId = i; }
#endif
#if JVET_L0696_CONSTRAINT_SYNTAX
bool getIntraOnlyConstraintFlag() const { return m_bIntraOnlyConstraintFlag; }
void setIntraOnlyConstraintFlag(bool bVal) { m_bIntraOnlyConstraintFlag = bVal; }
uint32_t getMaxBitDepthConstraintIdc() const { return m_maxBitDepthConstraintIdc; }
void setMaxBitDepthConstraintIdc(uint32_t u) { m_maxBitDepthConstraintIdc = u; }
uint32_t getMaxChromaFormatConstraintIdc() const { return m_maxChromaFormatConstraintIdc; }
void setMaxChromaFormatConstraintIdc(uint32_t u) { m_maxChromaFormatConstraintIdc = u; }
bool getFrameConstraintFlag() const { return m_bFrameConstraintFlag; }
void setFrameConstraintFlag(bool bVal) { m_bFrameConstraintFlag = bVal; }
bool getNoQtbttDualTreeIntraConstraintFlag() const { return m_bNoQtbttDualTreeIntraConstraintFlag; }
void setNoQtbttDualTreeIntraConstraintFlag(bool bVal) { m_bNoQtbttDualTreeIntraConstraintFlag = bVal; }
bool getNoCclmConstraintFlag() const { return m_bNoCclmConstraintFlag; }
void setNoCclmConstraintFlag(bool bVal) { m_bNoCclmConstraintFlag = bVal; }
bool getNoSaoConstraintFlag() const { return m_bNoSaoConstraintFlag; }
void setNoSaoConstraintFlag(bool bVal) { m_bNoSaoConstraintFlag = bVal; }
bool getNoAlfConstraintFlag() const { return m_bNoAlfConstraintFlag; }
void setNoAlfConstraintFlag(bool bVal) { m_bNoAlfConstraintFlag = bVal; }
bool getNoPcmConstraintFlag() const { return m_bNoPcmConstraintFlag; }
void setNoPcmConstraintFlag(bool bVal) { m_bNoPcmConstraintFlag = bVal; }
bool getNoTemporalMvpConstraintFlag() const { return m_bNoTemporalMvpConstraintFlag; }
void setNoTemporalMvpConstraintFlag(bool bVal) { m_bNoTemporalMvpConstraintFlag = bVal; }
bool getNoSbtmvpConstraintFlag() const { return m_bNoSbtmvpConstraintFlag; }
void setNoSbtmvpConstraintFlag(bool bVal) { m_bNoSbtmvpConstraintFlag = bVal; }
bool getNoAmvrConstraintFlag() const { return m_bNoAmvrConstraintFlag; }
void setNoAmvrConstraintFlag(bool bVal) { m_bNoAmvrConstraintFlag = bVal; }
bool getNoAffineMotionConstraintFlag() const { return m_bNoAffineMotionConstraintFlag; }
void setNoAffineMotionConstraintFlag(bool bVal) { m_bNoAffineMotionConstraintFlag = bVal; }
bool getNoMtsConstraintFlag() const { return m_bNoMtsConstraintFlag; }
void setNoMtsConstraintFlag(bool bVal) { m_bNoMtsConstraintFlag = bVal; }
bool getNoLadfConstraintFlag() const { return m_bNoLadfConstraintFlag; }
void setNoLadfConstraintFlag(bool bVal) { m_bNoLadfConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_bNoDepQuantConstraintFlag; }
void setNoDepQuantConstraintFlag(bool bVal) { m_bNoDepQuantConstraintFlag = bVal; }
bool getNoSignDataHidingConstraintFlag() const { return m_bNoSignDataHidingConstraintFlag; }
void setNoSignDataHidingConstraintFlag(bool bVal) { m_bNoSignDataHidingConstraintFlag = bVal; }
#endif
int getSPSId() const { return m_SPSId; }
void setSPSId(int i) { m_SPSId = i; }
......
......@@ -187,7 +187,7 @@
#define JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK 1 // Fix sub-block size to 8x8 in ATMVP as proposed in L0198, L0468 and L0104
#define JVET_L0198_ATMVP_SCAN_SIMP 1 // Simplification for scan process in ATMVP cTMv derivation
#define JVET_L0696_CONSTRAINT_SYNTAX 1 // Starting point for interoperability point syntax
// ====================================================================================================================
// NEXT software switches
// ====================================================================================================================
......
......@@ -941,6 +941,25 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
#endif
uint32_t uiCode;
#if JVET_L0696_CONSTRAINT_SYNTAX
READ_FLAG(uiCode, "intra_only_constraint_flag"); pcSPS->setIntraOnlyConstraintFlag(uiCode > 0 ? true : false);
READ_CODE(4, uiCode, "max_bitdepth_constraint_idc"); pcSPS->setMaxBitDepthConstraintIdc(uiCode);
READ_CODE(2, uiCode, "max_chroma_format_constraint_idc"); pcSPS->setMaxChromaFormatConstraintIdc(uiCode);
READ_FLAG(uiCode, "frame_constraint_flag"); pcSPS->setFrameConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_qtbtt_dual_tree_intra constraint_flag"); pcSPS->setNoQtbttDualTreeIntraConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_cclm_constraint_flag"); pcSPS->setNoCclmConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_sao_constraint_flag"); pcSPS->setNoSaoConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_alf_constraint_flag"); pcSPS->setNoAlfConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_pcm_constraint_flag"); pcSPS->setNoPcmConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_temporal_mvp_constraint_flag"); pcSPS->setNoTemporalMvpConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_sbtmvp_constraint_flag"); pcSPS->setNoSbtmvpConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_amvr_constraint_flag"); pcSPS->setNoAmvrConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_affine_motion_constraint_flag"); pcSPS->setNoAffineMotionConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_mts_constraint_flag"); pcSPS->setNoMtsConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_ladf_constraint_flag"); pcSPS->setNoLadfConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_dep_quant_constraint_flag"); pcSPS->setNoDepQuantConstraintFlag(uiCode > 0 ? true : false);
READ_FLAG(uiCode, "no_sign_data_hiding_constraint_flag"); pcSPS->setNoSignDataHidingConstraintFlag(uiCode > 0 ? true : false);
#endif
#if HEVC_VPS
READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode );
#endif
......
......@@ -134,6 +134,25 @@ protected:
bool m_printSequenceMSE;
bool m_cabacZeroWordPaddingEnabled;
#if JVET_L0696_CONSTRAINT_SYNTAX
bool m_bIntraOnlyConstraintFlag;
uint32_t m_maxBitDepthConstraintIdc;
uint32_t m_maxChromaFormatConstraintIdc;
bool m_bFrameConstraintFlag;
bool m_bNoQtbttDualTreeIntraConstraintFlag;
bool m_bNoCclmConstraintFlag;
bool m_bNoSaoConstraintFlag;
bool m_bNoAlfConstraintFlag;
bool m_bNoPcmConstraintFlag;
bool m_bNoTemporalMvpConstraintFlag;
bool m_bNoSbtmvpConstraintFlag;
bool m_bNoAmvrConstraintFlag;
bool m_bNoAffineMotionConstraintFlag;
bool m_bNoMtsConstraintFlag;
bool m_bNoLadfConstraintFlag;
bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag;
#endif
/* profile & level */
Profile::Name m_profile;
......@@ -576,6 +595,43 @@ public:
void setProfile(Profile::Name profile) { m_profile = profile; }
void setLevel(Level::Tier tier, Level::Name level) { m_levelTier = tier; m_level = level; }
#if JVET_L0696_CONSTRAINT_SYNTAX
bool getIntraOnlyConstraintFlag() const { return m_bIntraOnlyConstraintFlag; }
void setIntraOnlyConstraintFlag(bool bVal) { m_bIntraOnlyConstraintFlag = bVal; }
uint32_t getMaxBitDepthConstraintIdc() const { return m_maxBitDepthConstraintIdc; }
void setMaxBitDepthConstraintIdc(uint32_t u) { m_maxBitDepthConstraintIdc = u; }
uint32_t getMaxChromaFormatConstraintIdc() const { return m_maxChromaFormatConstraintIdc; }
void setMaxChromaFormatConstraintIdc(uint32_t u) { m_maxChromaFormatConstraintIdc = u; }
bool getFrameConstraintFlag() const { return m_bFrameConstraintFlag; }
void setFrameConstraintFlag(bool bVal) { m_bFrameConstraintFlag = bVal; }
bool getNoQtbttDualTreeIntraConstraintFlag() const { return m_bNoQtbttDualTreeIntraConstraintFlag; }
void setNoQtbttDualTreeIntraConstraintFlag(bool bVal) { m_bNoQtbttDualTreeIntraConstraintFlag = bVal; }
bool getNoCclmConstraintFlag() const { return m_bNoCclmConstraintFlag; }
void setNoCclmConstraintFlag(bool bVal) { m_bNoCclmConstraintFlag = bVal; }
bool getNoSaoConstraintFlag() const { return m_bNoSaoConstraintFlag; }
void setNoSaoConstraintFlag(bool bVal) { m_bNoSaoConstraintFlag = bVal; }
bool getNoAlfConstraintFlag() const { return m_bNoAlfConstraintFlag; }
void setNoAlfConstraintFlag(bool bVal) { m_bNoAlfConstraintFlag = bVal; }
bool getNoPcmConstraintFlag() const { return m_bNoPcmConstraintFlag; }
void setNoPcmConstraintFlag(bool bVal) { m_bNoPcmConstraintFlag = bVal; }
bool getNoTemporalMvpConstraintFlag() const { return m_bNoTemporalMvpConstraintFlag; }
void setNoTemporalMvpConstraintFlag(bool bVal) { m_bNoTemporalMvpConstraintFlag = bVal; }
bool getNoSbtmvpConstraintFlag() const { return m_bNoSbtmvpConstraintFlag; }
void setNoSbtmvpConstraintFlag(bool bVal) { m_bNoSbtmvpConstraintFlag = bVal; }
bool getNoAmvrConstraintFlag() const { return m_bNoAmvrConstraintFlag; }
void setNoAmvrConstraintFlag(bool bVal) { m_bNoAmvrConstraintFlag = bVal; }
bool getNoAffineMotionConstraintFlag() const { return m_bNoAffineMotionConstraintFlag; }
void setNoAffineMotionConstraintFlag(bool bVal) { m_bNoAffineMotionConstraintFlag = bVal; }
bool getNoMtsConstraintFlag() const { return m_bNoMtsConstraintFlag; }
void setNoMtsConstraintFlag(bool bVal) { m_bNoMtsConstraintFlag = bVal; }
bool getNoLadfConstraintFlag() const { return m_bNoLadfConstraintFlag; }
void setNoLadfConstraintFlag(bool bVal) { m_bNoLadfConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_bNoDepQuantConstraintFlag; }
void setNoDepQuantConstraintFlag(bool bVal) { m_bNoDepQuantConstraintFlag = bVal; }
bool getNoSignDataHidingConstraintFlag() const { return m_bNoSignDataHidingConstraintFlag; }
void setNoSignDataHidingConstraintFlag(bool bVal) { m_bNoSignDataHidingConstraintFlag = bVal; }
#endif
void setFrameRate ( int i ) { m_iFrameRate = i; }
void setFrameSkip ( uint32_t i ) { m_FrameSkip = i; }
void setTemporalSubsampleRatio ( uint32_t i ) { m_temporalSubsampleRatio = i; }
......
......@@ -784,6 +784,25 @@ void EncLib::xInitVPS(VPS &vps, const SPS &sps)
void EncLib::xInitSPS(SPS &sps)
{
#if JVET_L0696_CONSTRAINT_SYNTAX
sps.setIntraOnlyConstraintFlag(m_intraConstraintFlag);
sps.setMaxBitDepthConstraintIdc(m_bitDepthConstraintValue - 8);
sps.setMaxChromaFormatConstraintIdc(m_chromaFormatConstraintValue);
sps.setFrameConstraintFlag(m_frameOnlyConstraintFlag);
sps.setNoQtbttDualTreeIntraConstraintFlag(!m_dualITree);
sps.setNoCclmConstraintFlag(m_LMChroma ? false : true);
sps.setNoSaoConstraintFlag(!m_bUseSAO);
sps.setNoAlfConstraintFlag(!m_alf);
sps.setNoPcmConstraintFlag(!m_usePCM);
sps.setNoTemporalMvpConstraintFlag(m_TMVPModeId ? false : true);
sps.setNoSbtmvpConstraintFlag(m_SubPuMvpMode ? false : true);
sps.setNoAmvrConstraintFlag(!m_bNoAmvrConstraintFlag);
sps.setNoAffineMotionConstraintFlag(!m_Affine);
sps.setNoMtsConstraintFlag((m_IntraEMT || m_InterEMT) ? false : true);
sps.setNoLadfConstraintFlag(!m_LadfEnabled);
sps.setNoDepQuantConstraintFlag(!m_DepQuantEnabledFlag);
sps.setNoSignDataHidingConstraintFlag(!m_SignDataHidingEnabledFlag);
#endif
ProfileTierLevel& profileTierLevel = *sps.getPTL()->getGeneralPTL();
profileTierLevel.setLevelIdc (m_level);
profileTierLevel.setTierFlag (m_levelTier);
......
......@@ -649,7 +649,25 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
const ChromaFormat format = pcSPS->getChromaFormatIdc();
const bool chromaEnabled = isChromaEnabled(format);
#if JVET_L0696_CONSTRAINT_SYNTAX
WRITE_FLAG(pcSPS->getIntraOnlyConstraintFlag() ? 1 : 0, "intra_only_constraint_flag");
WRITE_CODE(pcSPS->getMaxBitDepthConstraintIdc(), 4, "max_bitdepth_constraint_idc");
WRITE_CODE(pcSPS->getMaxChromaFormatConstraintIdc(), 2, "max_chroma_format_constraint_idc");
WRITE_FLAG(pcSPS->getFrameConstraintFlag() ? 1 : 0, "frame_constraint_flag");
WRITE_FLAG(pcSPS->getNoQtbttDualTreeIntraConstraintFlag() ? 1 : 0, "no_qtbtt_dual_tree_intra constraint_flag");
WRITE_FLAG(pcSPS->getNoCclmConstraintFlag() ? 1 : 0, "no_cclm_constraint_flag");
WRITE_FLAG(pcSPS->getNoSaoConstraintFlag() ? 1 : 0, "no_sao_constraint_flag");
WRITE_FLAG(pcSPS->getNoAlfConstraintFlag() ? 1 : 0, "no_alf_constraint_flag");
WRITE_FLAG(pcSPS->getNoPcmConstraintFlag() ? 1 : 0, "no_pcm_constraint_flag");
WRITE_FLAG(pcSPS->getNoTemporalMvpConstraintFlag() ? 1 : 0, "no_temporal_mvp_constraint_flag");
WRITE_FLAG(pcSPS->getNoSbtmvpConstraintFlag() ? 1 : 0, "no_sbtmvp_constraint_flag");
WRITE_FLAG(pcSPS->getNoAmvrConstraintFlag() ? 1 : 0, "no_amvr_constraint_flag");
WRITE_FLAG(pcSPS->getNoAffineMotionConstraintFlag() ? 1 : 0, "no_affine_motion_constraint_flag");
WRITE_FLAG(pcSPS->getNoMtsConstraintFlag() ? 1 : 0, "no_mts_constraint_flag");
WRITE_FLAG(pcSPS->getNoLadfConstraintFlag() ? 1 : 0, "no_ladf_constraint_flag");
WRITE_FLAG(pcSPS->getNoDepQuantConstraintFlag() ? 1 : 0, "no_dep_quant_constraint_flag");
WRITE_FLAG(pcSPS->getNoSignDataHidingConstraintFlag() ? 1 : 0, "no_sign_data_hiding_constraint_flag");
#endif
#if ENABLE_TRACING
xTraceSPSHeader ();
#endif
......
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