Commit 329dc474 authored by Yan Zhang's avatar Yan Zhang

JVET N0449: Simplification on MMVD distance table

MMVD simplification by removing the two largest distance entries in the
MMVD distance table using encoder only change method.
To make the number of MMVD distance entries configurable by the
software, additionally adding 'MmvdDisNum' as a new option in the cfg files.
parent b6e0728a
......@@ -134,8 +134,9 @@ AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
MmvdDisNum : 6
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......@@ -137,8 +137,9 @@ AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
MmvdDisNum : 6
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......@@ -153,8 +153,9 @@ AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 1
MmvdDisNum : 6
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......@@ -279,6 +279,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseAffineAmvr ( m_AffineAmvr );
m_cEncLib.setUseAffineAmvrEncOpt ( m_AffineAmvrEncOpt );
m_cEncLib.setDMVR ( m_DMVR );
#if JVET_N0449_MMVD_SIMP
m_cEncLib.setMmvdDisNum (m_MmvdDisNum);
#endif
m_cEncLib.setIBCMode ( m_IBCMode );
m_cEncLib.setIBCLocalSearchRangeX ( m_IBCLocalSearchRangeX );
m_cEncLib.setIBCLocalSearchRangeY ( m_IBCLocalSearchRangeY );
......
......@@ -874,6 +874,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("AffineAmvr", m_AffineAmvr, false, "Eanble AMVR for affine inter mode")
("AffineAmvrEncOpt", m_AffineAmvrEncOpt, false, "Enable encoder optimization of affine AMVR")
("DMVR", m_DMVR, false, "Decoder-side Motion Vector Refinement")
#if JVET_N0449_MMVD_SIMP
("MmvdDisNum", m_MmvdDisNum, 8, "Number of MMVD Distance Entries")
#endif
( "IBC", m_IBCMode, 0u, "IBCMode (0x1:enabled, 0x0:disabled) [default: disabled]")
( "IBCLocalSearchRangeX", m_IBCLocalSearchRangeX, 128u, "Search range of IBC local search in x direction")
( "IBCLocalSearchRangeY", m_IBCLocalSearchRangeY, 128u, "Search range of IBC local search in y direction")
......@@ -1973,6 +1976,9 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" );
xConfirmPara( m_Triangle, "Triangle is only allowed with NEXT profile" );
xConfirmPara(m_DMVR, "DMVR only allowed with NEXT profile");
#if JVET_N0449_MMVD_SIMP
xConfirmPara(m_MmvdDisNum, "Number of distance MMVD entry setting only allowed with NEXT profile");
#endif
// ADD_NEW_TOOL : (parameter check) add a check for next tools here
}
else
......@@ -3159,6 +3165,9 @@ void EncAppCfg::xPrintParameter()
m_AffineAmvrEncOpt = m_AffineAmvr ? m_AffineAmvrEncOpt : false;
msg( VERBOSE, "AffineAmvrEncOpt:%d ", m_AffineAmvrEncOpt );
msg(VERBOSE, "DMVR:%d ", m_DMVR);
#if JVET_N0449_MMVD_SIMP
msg(VERBOSE, "MmvdDisNum:%d ", m_MmvdDisNum);
#endif
}
msg(VERBOSE, "IBC:%d ", m_IBCMode);
msg( VERBOSE, "HashME:%d ", m_HashME );
......
......@@ -260,7 +260,9 @@ protected:
bool m_AffineAmvr;
bool m_AffineAmvrEncOpt;
bool m_DMVR;
#if JVET_N0449_MMVD_SIMP
int m_MmvdDisNum;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
unsigned m_IBCLocalSearchRangeY;
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_N0449_MMVD_SIMP 1 // Configurable number of mmvd distance entries used
#define JVET_N0477_LMCS_CLEANUP 1
#define JVET_N0220_LMCS_SIMPLIFICATION 1
......
......@@ -240,6 +240,9 @@ protected:
bool m_HashME;
bool m_AffineAmvrEncOpt;
bool m_DMVR;
#if JVET_N0449_MMVD_SIMP
int m_MmvdDisNum;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
unsigned m_IBCLocalSearchRangeY;
......@@ -762,7 +765,10 @@ public:
bool getUseAffineAmvrEncOpt () const { return m_AffineAmvrEncOpt; }
void setDMVR ( bool b ) { m_DMVR = b; }
bool getDMVR () const { return m_DMVR; }
#if JVET_N0449_MMVD_SIMP
void setMmvdDisNum ( int b ) { m_MmvdDisNum = b; }
int getMmvdDisNum () const { return m_MmvdDisNum; }
#endif
void setIBCMode (unsigned n) { m_IBCMode = n; }
unsigned getIBCMode () const { return m_IBCMode; }
void setIBCLocalSearchRangeX (unsigned n) { m_IBCLocalSearchRangeX = n; }
......
......@@ -1999,6 +1999,10 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
int refineStep;
baseIdx = mmvdMergeCand / MMVD_MAX_REFINE_NUM;
refineStep = (mmvdMergeCand - (baseIdx * MMVD_MAX_REFINE_NUM)) / 4;
#if JVET_N0449_MMVD_SIMP
if (refineStep >= m_pcEncCfg->getMmvdDisNum())
continue;
#endif
bitsBaseIdx = baseIdx + 1;
if (baseIdx == MMVD_BASE_MV_NUM - 1)
{
......
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