Commit ce58f412 authored by Daniel Luo's avatar Daniel Luo Committed by Xiang Li

JVET-N0235: Added smvd flag in SPS

parent ec4ccbf5
......@@ -144,6 +144,7 @@ AllowDisFracMMVD : 1
AffineAmvr : 1
LumaReshapeEnable : 1 # luma reshaping. 0: disable 1:enable
DMVR : 1
SMVD : 1
# Fast tools
PBIntraFast : 1
......
......@@ -1988,6 +1988,13 @@ Enables optimization of non-linear filters for ALF on Luma channel.
\Default{true} &
Enables optimization of non-linear filters for ALF on Chroma channels.
\\
\Option{SMVD} &
%\ShortOption{\None} &
\Default{false} &
Enables or disables symmetric MVD mode.
\\
\end{OptionTableNoShorthand}
%%
......
......@@ -261,6 +261,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setImplicitMTS ( m_MTSImplicit );
m_cEncLib.setUseSBT ( m_SBT );
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
#if JVET_N0235_SMVD_SPS
m_cEncLib.setUseSMVD ( m_SMVD );
#endif
m_cEncLib.setUseGBi ( m_GBi );
m_cEncLib.setUseGBiFast ( m_GBiFast );
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
......
......@@ -857,6 +857,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("MTSInterMaxCand", m_MTSInterMaxCand, 4, "Number of additional candidates to test in encoder search for MTS in inter slices\n")
("MTSImplicit", m_MTSImplicit, 0, "Enable implicit MTS (when explicit MTS is off)\n")
( "SBT", m_SBT, false, "Enable Sub-Block Transform for inter blocks\n" )
#if JVET_N0235_SMVD_SPS
("SMVD", m_SMVD, false, "Enable Symmetric MVD\n")
#endif
("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame")
("GBi", m_GBi, false, "Enable Generalized Bi-prediction(GBi)")
("GBiFast", m_GBiFast, false, "Fast methods for Generalized Bi-prediction(GBi)\n")
......@@ -1964,6 +1967,9 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_MTS, "MTS only allowed with NEXT profile" );
xConfirmPara( m_MTSIntraMaxCand, "MTS only allowed with NEXT profile" );
xConfirmPara( m_MTSInterMaxCand, "MTS only allowed with NEXT profile" );
#if JVET_N0235_SMVD_SPS
xConfirmPara( m_SMVD, "SMVD is only allowed with NEXT profile" );
#endif
xConfirmPara( m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile" );
xConfirmPara( m_GBi, "GBi is only allowed with NEXT profile" );
xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" );
......@@ -3138,6 +3144,9 @@ void EncAppCfg::xPrintParameter()
}
msg( VERBOSE, "MTS: %1d(intra) %1d(inter) ", m_MTS & 1, ( m_MTS >> 1 ) & 1 );
msg( VERBOSE, "SBT:%d ", m_SBT );
#if JVET_N0235_SMVD_SPS
msg( VERBOSE, "SMVD:%d ", m_SMVD );
#endif
msg( VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
msg( VERBOSE, "GBi:%d ", m_GBi );
msg( VERBOSE, "GBiFast:%d ", m_GBiFast );
......
......@@ -247,6 +247,9 @@ protected:
int m_MTSImplicit;
bool m_SBT; ///< Sub-Block Transform for inter blocks
#if JVET_N0235_SMVD_SPS
bool m_SMVD;
#endif
bool m_compositeRefEnabled;
bool m_GBi;
bool m_GBiFast;
......
......@@ -1109,6 +1109,9 @@ private:
bool m_MTS;
bool m_IntraMTS; // 18
bool m_InterMTS; // 19
#if JVET_N0235_SMVD_SPS
bool m_SMVD;
#endif
bool m_Affine;
bool m_AffineType;
bool m_GBi; //
......@@ -1374,6 +1377,10 @@ public:
bool getUseIntraMTS () const { return m_IntraMTS; }
void setUseInterMTS ( bool b ) { m_InterMTS = b; }
bool getUseInterMTS () const { return m_InterMTS; }
#if JVET_N0235_SMVD_SPS
void setUseSMVD(bool b) { m_SMVD = b; }
bool getUseSMVD() const { return m_SMVD; }
#endif
void setUseGBi ( bool b ) { m_GBi = b; }
bool getUseGBi () const { return m_GBi; }
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_N0235_SMVD_SPS 1
#define JVET_N0843_BVP_SIMPLIFICATION 1
#define JVET_N0448_N0380 1 // When MaxNumMergeCand is 1, MMVD_BASE_MV_NUM is inferred to be 1.
......
......@@ -1115,6 +1115,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG( uiCode, "mts_intra_enabled_flag" ); pcSPS->setUseIntraMTS ( uiCode != 0 );
READ_FLAG( uiCode, "mts_inter_enabled_flag" ); pcSPS->setUseInterMTS ( uiCode != 0 );
}
#if JVET_N0235_SMVD_SPS
READ_FLAG(uiCode, "smvd_flag"); pcSPS->setUseSMVD ( uiCode != 0 );
#endif
// KJS: sps_affine_enabled_flag
READ_FLAG( uiCode, "affine_flag" ); pcSPS->setUseAffine ( uiCode != 0 );
if ( pcSPS->getUseAffine() )
......
......@@ -223,6 +223,9 @@ protected:
bool m_AffineType;
bool m_BIO;
#if JVET_N0235_SMVD_SPS
bool m_SMVD;
#endif
bool m_compositeRefEnabled; //composite reference
bool m_GBi;
bool m_GBiFast;
......@@ -736,6 +739,10 @@ public:
void setUseCompositeRef (bool b) { m_compositeRefEnabled = b; }
bool getUseCompositeRef () const { return m_compositeRefEnabled; }
#if JVET_N0235_SMVD_SPS
void setUseSMVD ( bool b ) { m_SMVD = b; }
bool getUseSMVD () const { return m_SMVD; }
#endif
void setUseGBi ( bool b ) { m_GBi = b; }
bool getUseGBi () const { return m_GBi; }
void setUseGBiFast ( uint32_t b ) { m_GBiFast = b; }
......
......@@ -1934,7 +1934,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
pcPic->slices[pcSlice->getSliceSegmentIdx()]->setMvdL1ZeroFlag(pcSlice->getMvdL1ZeroFlag());
#endif
#if JVET_N0235_SMVD_SPS
if ( pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false && pcSlice->getMvdL1ZeroFlag() == false )
#else
if ( pcSlice->getCheckLDC() == false && pcSlice->getMvdL1ZeroFlag() == false )
#endif
{
int currPOC = pcSlice->getPOC();
......
......@@ -959,6 +959,9 @@ void EncLib::xInitSPS(SPS &sps)
{
sps.setMaxSbtSize ( m_iSourceWidth >= 1920 ? 64 : 32 );
}
#if JVET_N0235_SMVD_SPS
sps.setUseSMVD ( m_SMVD );
#endif
sps.setUseGBi ( m_GBi );
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
sps.setLadfEnabled ( m_LadfEnabled );
......
......@@ -767,6 +767,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_FLAG( pcSPS->getUseIntraMTS() ? 1 : 0, "mts_intra_enabled_flag" );
WRITE_FLAG( pcSPS->getUseInterMTS() ? 1 : 0, "mts_inter_enabled_flag" );
}
#if JVET_N0235_SMVD_SPS
WRITE_FLAG( pcSPS->getUseSMVD() ? 1 : 0, "smvd_flag" );
#endif
// KJS: sps_affine_enabled_flag
WRITE_FLAG( pcSPS->getUseAffine() ? 1 : 0, "affine_flag" );
if ( pcSPS->getUseAffine() )
......
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