Commit e08b6893 authored by Hongbin Liu's avatar Hongbin Liu

JVET-M0247 1. Add early termination and encoder search method. 2. Only enable...

JVET-M0247 1. Add early termination and encoder search method. 2. Only enable it for RA configuration.
parent 50ab2508
......@@ -120,6 +120,9 @@ PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -137,6 +137,9 @@ PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -140,6 +140,9 @@ PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -155,6 +155,9 @@ PBIntraFast : 1
FastMrg : 1
AMaxBT : 1
# Encoder optimization tools
AffineAmvrEncOpt : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -262,6 +262,9 @@ void EncApp::xInitLibCfg()
#endif
#if JVET_M0246_AFFINE_AMVR
m_cEncLib.setUseAffineAmvr ( m_AffineAmvr );
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
m_cEncLib.setUseAffineAmvrEncOpt ( m_AffineAmvrEncOpt );
#endif
m_cEncLib.setIBCMode ( m_IBCMode );
m_cEncLib.setIBCLocalSearchRangeX ( m_IBCLocalSearchRangeX );
......
......@@ -869,6 +869,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#endif
#if JVET_M0246_AFFINE_AMVR
("AffineAmvr", m_AffineAmvr, false, "Eanble AMVR for affine inter mode")
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
("AffineAmvrEncOpt", m_AffineAmvrEncOpt, false, "Enable encoder optimization of affine AMVR")
#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")
......@@ -3155,6 +3158,10 @@ void EncAppCfg::xPrintParameter()
#endif
#if JVET_M0246_AFFINE_AMVR
msg( VERBOSE, "AffineAmvr:%d ", m_AffineAmvr );
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
m_AffineAmvrEncOpt = m_AffineAmvr ? m_AffineAmvrEncOpt : false;
msg( VERBOSE, "AffineAmvrEncOpt:%d ", m_AffineAmvrEncOpt );
#endif
}
msg(VERBOSE, "IBC:%d ", m_IBCMode);
......
......@@ -243,6 +243,9 @@ protected:
#if JVET_M0246_AFFINE_AMVR
bool m_AffineAmvr;
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
bool m_AffineAmvrEncOpt;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
......
......@@ -161,6 +161,9 @@ class GBiMotionParam
bool m_readOnlyAffine[2][2][33];
Mv m_mvAffine[2][2][33][3];
Distortion m_distAffine[2][2][33];
#if JVET_M0247_AFFINE_AMVR_ENCOPT
int m_mvpIdx[2][2][33];
#endif
public:
......@@ -182,6 +185,9 @@ public:
memset(m_dist, -1, 2 * 33 * sizeof(Distortion));
memset(m_readOnlyAffine, false, 2 * 2 * 33 * sizeof(bool));
memset(m_distAffine, -1, 2 * 2 * 33 * sizeof(Distortion));
#if JVET_M0247_AFFINE_AMVR_ENCOPT
memset( m_mvpIdx, 0, 2 * 2 * 33 * sizeof( int ) );
#endif
}
void setReadMode(bool b, uint32_t uiRefList, uint32_t uiRefIdx) { m_readOnly[uiRefList][uiRefIdx] = b; }
......@@ -206,16 +212,30 @@ public:
Mv& getAffineMv(uint32_t uiRefList, uint32_t uiRefIdx, uint32_t uiAffineMvIdx, int bP4) { return m_mvAffine[bP4][uiRefList][uiRefIdx][uiAffineMvIdx]; }
void copyAffineMvFrom(Mv(&racAffineMvs)[3], Distortion uiDist, uint32_t uiRefList, uint32_t uiRefIdx, int bP4)
void copyAffineMvFrom(Mv(&racAffineMvs)[3], Distortion uiDist, uint32_t uiRefList, uint32_t uiRefIdx, int bP4
#if JVET_M0247_AFFINE_AMVR_ENCOPT
, const int mvpIdx
#endif
)
{
memcpy(m_mvAffine[bP4][uiRefList][uiRefIdx], racAffineMvs, 3 * sizeof(Mv));
m_distAffine[bP4][uiRefList][uiRefIdx] = uiDist;
#if JVET_M0247_AFFINE_AMVR_ENCOPT
m_mvpIdx[bP4][uiRefList][uiRefIdx] = mvpIdx;
#endif
}
void copyAffineMvTo(Mv acAffineMvs[3], Distortion& ruiDist, uint32_t uiRefList, uint32_t uiRefIdx, int bP4)
void copyAffineMvTo(Mv acAffineMvs[3], Distortion& ruiDist, uint32_t uiRefList, uint32_t uiRefIdx, int bP4
#if JVET_M0247_AFFINE_AMVR_ENCOPT
, int& mvpIdx
#endif
)
{
memcpy(acAffineMvs, m_mvAffine[bP4][uiRefList][uiRefIdx], 3 * sizeof(Mv));
ruiDist = m_distAffine[bP4][uiRefList][uiRefIdx];
#if JVET_M0247_AFFINE_AMVR_ENCOPT
mvpIdx = m_mvpIdx[bP4][uiRefList][uiRefIdx];
#endif
}
};
struct LutMotionCand
......
......@@ -115,6 +115,9 @@ typedef std::pair<int, int> TrCost;
#endif
#define JVET_M0246_AFFINE_AMVR 1
#if JVET_M0246_AFFINE_AMVR
#define JVET_M0247_AFFINE_AMVR_ENCOPT 1
#endif
#define JVET_M0421_SPLIT_SIG 1
#define JVET_M0173_MOVE_GT2_TO_FIRST_PASS 1 // Moving the gtr2 flag to the first coding pass
......
......@@ -243,6 +243,9 @@ protected:
#endif
#if JVET_M0246_AFFINE_AMVR
bool m_AffineAmvr;
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
bool m_AffineAmvrEncOpt;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
......@@ -767,6 +770,10 @@ public:
void setUseAffineAmvr ( bool b ) { m_AffineAmvr = b; }
bool getUseAffineAmvr () const { return m_AffineAmvr; }
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
void setUseAffineAmvrEncOpt ( bool b ) { m_AffineAmvrEncOpt = b; }
bool getUseAffineAmvrEncOpt () const { return m_AffineAmvrEncOpt; }
#endif
void setIBCMode (unsigned n) { m_IBCMode = n; }
unsigned getIBCMode () const { return m_IBCMode; }
......
This diff is collapsed.
......@@ -404,6 +404,10 @@ protected:
Mv acMv[3],
uint32_t& ruiBits,
Distortion& ruiCost,
#if JVET_M0247_AFFINE_AMVR_ENCOPT
int& mvpIdx,
const AffineAMVPInfo& aamvpi,
#endif
bool bBi = false
);
......@@ -430,7 +434,11 @@ protected:
void xSymmetricMotionEstimation( PredictionUnit& pu, PelUnitBuf& origBuf, Mv& rcMvCurPred, Mv& rcMvTarPred, RefPicList eRefPicList, MvField& rCurMvField, MvField& rTarMvField, Distortion& ruiCost, int gbiIdx );
#endif
bool xReadBufferedAffineUniMv ( PredictionUnit& pu, RefPicList eRefPicList, int32_t iRefIdx, Mv acMvPred[3], Mv acMv[3], uint32_t& ruiBits, Distortion& ruiCost);
bool xReadBufferedAffineUniMv ( PredictionUnit& pu, RefPicList eRefPicList, int32_t iRefIdx, Mv acMvPred[3], Mv acMv[3], uint32_t& ruiBits, Distortion& ruiCost
#if JVET_M0247_AFFINE_AMVR_ENCOPT
, int& mvpIdx, const AffineAMVPInfo& aamvpi
#endif
);
double xGetMEDistortionWeight ( uint8_t gbiIdx, RefPicList eRefPicList);
bool xReadBufferedUniMv ( PredictionUnit& pu, RefPicList eRefPicList, int32_t iRefIdx, Mv& pcMvPred, Mv& rcMv, uint32_t& ruiBits, Distortion& ruiCost);
......@@ -458,7 +466,9 @@ protected:
void xExtDIFUpSamplingH ( CPelBuf* pcPattern );
void xExtDIFUpSamplingQ ( CPelBuf* pcPatternKey, Mv halfPelRef );
#if JVET_M0247_AFFINE_AMVR_ENCOPT
uint32_t xDetermineBestMvp ( PredictionUnit& pu, Mv acMvTemp[3], int& mvpIdx, const AffineAMVPInfo& aamvpi );
#endif
// -------------------------------------------------------------------------------------------------------------------
// compute symbol bits
// -------------------------------------------------------------------------------------------------------------------
......
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