diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index ee51cd13e37407f33cf5908822a7fc3fb38c528d..9f293af2c238fa6902f06825222b0a84f39ebebd 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -266,7 +266,9 @@ void EncApp::xInitLibCfg() m_cEncLib.setNoBcwConstraintFlag ( !m_bcw ); m_cEncLib.setNoIbcConstraintFlag ( m_IBCMode ? false : true ); m_cEncLib.setNoCiipConstraintFlag ( !m_ciip ); +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION m_cEncLib.setNoFPelMmvdConstraintFlag ( !(m_MMVD && m_allowDisFracMMVD) ); +#endif m_cEncLib.setNoGeoConstraintFlag ( !m_Geo ); m_cEncLib.setNoLadfConstraintFlag ( !m_LadfEnabed ); m_cEncLib.setNoTransformSkipConstraintFlag ( !m_useTransformSkip ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 3b5e2bac74675eee35a125a402fa609db7ff98f5..497afeedd9b338a3ec71d3721069a45fb46d8349 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -115,7 +115,9 @@ EncAppCfg::EncAppCfg() , m_bNoBcwConstraintFlag(false) , m_noIbcConstraintFlag(false) , m_bNoCiipConstraintFlag(false) +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION , m_noFPelMmvdConstraintFlag(false) +#endif , m_noGeoConstraintFlag(false) , m_bNoLadfConstraintFlag(false) , m_noTransformSkipConstraintFlag(false) diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 0762b6d85bd86daff670ca9dcf6d1ce2328748e0..6bd0a61c2f6e7c1f4852bf52419ae6d4e9160d60 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -167,7 +167,9 @@ protected: bool m_bNoBcwConstraintFlag; bool m_noIbcConstraintFlag; bool m_bNoCiipConstraintFlag; +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION bool m_noFPelMmvdConstraintFlag; +#endif bool m_noGeoConstraintFlag; bool m_bNoLadfConstraintFlag; bool m_noTransformSkipConstraintFlag; diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 475fe71e8c89f06e425958e287cf5f66e535b459..a26c0bd3859176374baeeab1adf49766efbf983f 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -4065,7 +4065,9 @@ bool operator == (const ConstraintInfo& op1, const ConstraintInfo& o if( op1.m_noBcwConstraintFlag != op2.m_noBcwConstraintFlag ) return false; if( op1.m_noIbcConstraintFlag != op2.m_noIbcConstraintFlag ) return false; if( op1.m_noCiipConstraintFlag != op2.m_noCiipConstraintFlag ) return false; +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION if( op1.m_noFPelMmvdConstraintFlag != op2.m_noFPelMmvdConstraintFlag ) return false; +#endif if( op1.m_noLadfConstraintFlag != op2.m_noLadfConstraintFlag ) return false; if( op1.m_noTransformSkipConstraintFlag != op2.m_noTransformSkipConstraintFlag ) return false; if( op1.m_noBDPCMConstraintFlag != op2.m_noBDPCMConstraintFlag ) return false; diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 9f12a3307a9eddae225f2f58000a1ed647adc5dc..89d0c73dfb261f0d93274d705cd01b739a15b16b 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -287,7 +287,9 @@ class ConstraintInfo bool m_noBcwConstraintFlag; bool m_noIbcConstraintFlag; bool m_noCiipConstraintFlag; +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION bool m_noFPelMmvdConstraintFlag; +#endif bool m_noGeoConstraintFlag; bool m_noLadfConstraintFlag; bool m_noTransformSkipConstraintFlag; @@ -360,7 +362,9 @@ public: , m_noBcwConstraintFlag (false) , m_noIbcConstraintFlag (false) , m_noCiipConstraintFlag (false) +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION , m_noFPelMmvdConstraintFlag (false) +#endif , m_noGeoConstraintFlag (false) , m_noLadfConstraintFlag (false) , m_noTransformSkipConstraintFlag(false) @@ -489,8 +493,10 @@ public: void setNoIbcConstraintFlag(bool bVal) { m_noIbcConstraintFlag = bVal; } bool getNoCiipConstraintFlag() const { return m_noCiipConstraintFlag; } void setNoCiipConstraintFlag(bool bVal) { m_noCiipConstraintFlag = bVal; } +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION bool getNoFPelMmvdConstraintFlag() const { return m_noFPelMmvdConstraintFlag; } void setNoFPelMmvdConstraintFlag(bool bVal) { m_noFPelMmvdConstraintFlag = bVal; } +#endif bool getNoGeoConstraintFlag() const { return m_noGeoConstraintFlag; } void setNoGeoConstraintFlag(bool bVal) { m_noGeoConstraintFlag = bVal; } bool getNoLadfConstraintFlag() const { return m_noLadfConstraintFlag; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 31a9638309007bbd6ea5ca4f7282f84811d5a2e5..5be56cc303de943fd4ed8860487d946caf25633d 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -167,6 +167,8 @@ #define JVET_R0413_HRD_TIMING_INFORMATION 1 // JVET-R0413: HRD timing parameters signalling +#define JVET_R0214_MMVD_SYNTAX_MODIFICATION 1 // JVET-R0214: MMVD syntax modifications + //########### place macros to be be kept below this line ############### #define JVET_R0164_MEAN_SCALED_SATD 1 // JVET-R0164: Use a mean scaled version of SATD in encoder decisions diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 5daf1da72123363fe32be28105d9694061543da0..4d3951b9a010673db5607ad6910b733601f20232 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1802,6 +1802,16 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) pcSPS->setDmvrControlPresentFlag( false ); } READ_FLAG(uiCode, "sps_mmvd_enabled_flag"); pcSPS->setUseMMVD(uiCode != 0); +#if JVET_R0214_MMVD_SYNTAX_MODIFICATION + if (pcSPS->getUseMMVD()) + { + READ_FLAG(uiCode, "sps_mmvd_fullpel_only_flag"); pcSPS->setFpelMmvdEnabledFlag(uiCode != 0); + } + else + { + pcSPS->setFpelMmvdEnabledFlag( false ); + } +#endif READ_FLAG(uiCode, "sps_isp_enabled_flag"); pcSPS->setUseISP( uiCode != 0 ); READ_FLAG(uiCode, "sps_mrl_enabled_flag"); pcSPS->setUseMRL( uiCode != 0 ); READ_FLAG(uiCode, "sps_mip_enabled_flag"); pcSPS->setUseMIP( uiCode != 0 ); @@ -1894,12 +1904,12 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) pcSPS->setMaxNumIBCMergeCand(0); // KJS: sps_ciip_enabled_flag READ_FLAG( uiCode, "sps_ciip_enabled_flag" ); pcSPS->setUseCiip ( uiCode != 0 ); - +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION if ( pcSPS->getUseMMVD() ) { READ_FLAG( uiCode, "sps_fpel_mmvd_enabled_flag" ); pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 ); } - +#endif if (pcSPS->getMaxNumMergeCand() >= 2) { READ_FLAG(uiCode, "sps_gpm_enabled_flag"); @@ -4614,7 +4624,9 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo) CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_ciip_constraint_flag shall be equal to 1"); } #endif +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION READ_FLAG(symbol, "no_fpel_mmvd_constraint_flag"); cinfo->setNoFPelMmvdConstraintFlag(symbol > 0 ? true : false); +#endif READ_FLAG(symbol, "no_gpm_constraint_flag"); cinfo->setNoGeoConstraintFlag(symbol > 0 ? true : false); #if JVET_R0286_GCI_CLEANUP if (cinfo->getIntraOnlyConstraintFlag() == 1) diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 0ec6d88d8c8111eabd34e2f3e27b5c2e8c63c2ac..0913fa106adb061543364b16096baeb5a99a9676 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -211,7 +211,9 @@ protected: bool m_bNoBcwConstraintFlag; bool m_noIbcConstraintFlag; bool m_bNoCiipConstraintFlag; +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION bool m_noFPelMmvdConstraintFlag; +#endif bool m_noGeoConstraintFlag; bool m_bNoLadfConstraintFlag; bool m_noTransformSkipConstraintFlag; @@ -844,8 +846,10 @@ public: void setNoIbcConstraintFlag(bool bVal) { m_noIbcConstraintFlag = bVal; } bool getNoCiipConstraintFlag() const { return m_bNoCiipConstraintFlag; } void setNoCiipConstraintFlag(bool bVal) { m_bNoCiipConstraintFlag = bVal; } +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION bool getNoFPelMmvdConstraintFlag() const { return m_noFPelMmvdConstraintFlag; } void setNoFPelMmvdConstraintFlag(bool bVal) { m_noFPelMmvdConstraintFlag = bVal; } +#endif bool getNoGeoConstraintFlag() const { return m_noGeoConstraintFlag; } void setNoGeoConstraintFlag(bool bVal) { m_noGeoConstraintFlag = bVal; } bool getNoLadfConstraintFlag() const { return m_bNoLadfConstraintFlag; } diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index f45be9524f29c52435611b0537e0d062977efc09..730947cc1134dcbfe3686a2a1f576503632b0658 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1100,7 +1100,9 @@ void EncLib::xInitSPS( SPS& sps ) cinfo->setNoBcwConstraintFlag(m_bNoBcwConstraintFlag); cinfo->setNoIbcConstraintFlag(m_noIbcConstraintFlag); cinfo->setNoCiipConstraintFlag(m_bNoCiipConstraintFlag); +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION cinfo->setNoFPelMmvdConstraintFlag(m_noFPelMmvdConstraintFlag); +#endif cinfo->setNoGeoConstraintFlag(m_noGeoConstraintFlag); cinfo->setNoLadfConstraintFlag(m_bNoLadfConstraintFlag); cinfo->setNoTransformSkipConstraintFlag(m_noTransformSkipConstraintFlag); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 4b9e10b6559fff4d3d20fc2c8e58a23a76f3c568..2477707ccf444627ec11427bd0da9f68d8c54434 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1100,6 +1100,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) WRITE_FLAG(pcSPS->getDmvrControlPresentFlag() ? 1 : 0, "sps_dmvr_pic_present_flag"); } WRITE_FLAG(pcSPS->getUseMMVD() ? 1 : 0, "sps_mmvd_enabled_flag"); +#if JVET_R0214_MMVD_SYNTAX_MODIFICATION + if (pcSPS->getUseMMVD()) + { + WRITE_FLAG(pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0, "sps_mmvd_fullpel_only_flag"); + } +#endif WRITE_FLAG( pcSPS->getUseISP() ? 1 : 0, "sps_isp_enabled_flag"); WRITE_FLAG( pcSPS->getUseMRL() ? 1 : 0, "sps_mrl_enabled_flag"); WRITE_FLAG( pcSPS->getUseMIP() ? 1 : 0, "sps_mip_enabled_flag"); @@ -1164,12 +1170,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) } // KJS: sps_ciip_enabled_flag WRITE_FLAG( pcSPS->getUseCiip() ? 1 : 0, "sps_ciip_enabled_flag" ); - +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION if ( pcSPS->getUseMMVD() ) { WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0, "sps_fpel_mmvd_enabled_flag" ); } - +#endif if (pcSPS->getMaxNumMergeCand() >= 2) { WRITE_FLAG(pcSPS->getUseGeo() ? 1 : 0, "sps_gpm_enabled_flag"); @@ -2677,7 +2683,9 @@ void HLSWriter::codeConstraintInfo ( const ConstraintInfo* cinfo ) WRITE_FLAG(cinfo->getNoBcwConstraintFlag() ? 1 : 0, "no_bcw_constraint_flag"); WRITE_FLAG(cinfo->getNoIbcConstraintFlag() ? 1 : 0, "no_ibc_constraint_flag"); WRITE_FLAG(cinfo->getNoCiipConstraintFlag() ? 1 : 0, "no_ciip_constraint_flag"); +#if !JVET_R0214_MMVD_SYNTAX_MODIFICATION WRITE_FLAG(cinfo->getNoFPelMmvdConstraintFlag() ? 1 : 0, "no_fpel_mmvd_constraint_flag"); +#endif WRITE_FLAG(cinfo->getNoGeoConstraintFlag() ? 1 : 0, "no_gpm_constraint_flag"); WRITE_FLAG(cinfo->getNoLadfConstraintFlag() ? 1 : 0, "no_ladf_constraint_flag"); WRITE_FLAG(cinfo->getNoTransformSkipConstraintFlag() ? 1 : 0, "no_transform_skip_constraint_flag");