Commit 0783ed2d authored by Xiang Li's avatar Xiang Li

Use coan to remove REMOVE_MV_ADAPT_PREC

parent 10a973eb
......@@ -225,9 +225,6 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setAffine ( m_Affine );
m_cEncLib.setAffineType ( m_AffineType );
#if !REMOVE_MV_ADAPT_PREC
m_cEncLib.setHighPrecisionMv (m_highPrecisionMv);
#endif
#if JVET_L0256_BIO
m_cEncLib.setBIO (m_BIO);
#endif
......
......@@ -817,12 +817,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("SubPuMvp", m_SubPuMvpMode, 0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:ATMVP, 2:STMVP, 3:ATMVP+STMVP) [default: off]")
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
("SubPuMvpLog2Size", m_SubPuMvpLog2Size, 2u, "Sub-PU TMVP size index: 2^n")
#endif
#if !REMOVE_MV_ADAPT_PREC
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
#endif
#if !REMOVE_MV_ADAPT_PREC
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
#endif
("Affine", m_Affine, false, "Enable affine prediction (0:off, 1:on) [default: off]")
("AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" )
......@@ -1941,10 +1935,6 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_LMChroma, "LMChroma only allowed with NEXT profile" );
xConfirmPara( m_LargeCTU, "Large CTU is only allowed with NEXT profile" );
xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" );
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara( m_highPrecisionMv, "High precision MV for temporal merging can only be used with NEXT profile" );
xConfirmPara( m_Affine, "Affine is only allowed with NEXT profile" );
#endif
#if JVET_L0256_BIO
xConfirmPara( m_BIO, "BIO only allowed with NEXT profile" );
#endif
......@@ -1984,9 +1974,6 @@ bool EncAppCfg::xCheckParameter()
#endif
}
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara(m_Affine && !m_highPrecisionMv, "Affine is not yet implemented for HighPrecMv off.");
#endif
}
#if JVET_L0231_WRAPAROUND
......@@ -3147,9 +3134,6 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "DualITree:%d ", m_dualTree );
msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU );
msg( VERBOSE, "IMV:%d ", m_ImvMode );
#if !REMOVE_MV_ADAPT_PREC
msg(VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv);
#endif
#if JVET_L0256_BIO
msg( VERBOSE, "BIO:%d ", m_BIO );
#endif
......
......@@ -212,9 +212,6 @@ protected:
#endif
bool m_Affine;
bool m_AffineType;
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecisionMv;
#endif
#if JVET_L0256_BIO
bool m_BIO;
#endif
......
......@@ -403,10 +403,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
fPosPosition = tempIdx - fPosStep * (4);
const int offset = refMvdCands[fPosStep];
#if !REMOVE_MV_ADAPT_PREC
const int highPrecList0 = mmvdBaseMv[fPosBaseIdx][0].mv.highPrec;
const int highPrecList1 = mmvdBaseMv[fPosBaseIdx][1].mv.highPrec;
#endif
const int refList0 = mmvdBaseMv[fPosBaseIdx][0].refIdx;
const int refList1 = mmvdBaseMv[fPosBaseIdx][1].refIdx;
......@@ -421,7 +417,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
refSign = -1;
}
#if REMOVE_MV_ADAPT_PREC
if (fPosPosition == 0)
{
tempMv[0] = Mv(offset, 0);
......@@ -442,28 +437,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
tempMv[0] = Mv(0, -offset);
tempMv[1] = Mv(0, -offset * refSign);
}
#else
if (fPosPosition == 0)
{
tempMv[0] = Mv(offset, 0, highPrecList0);
tempMv[1] = Mv(offset * refSign, 0, highPrecList1);
}
else if (fPosPosition == 1)
{
tempMv[0] = Mv(-offset, 0, highPrecList0);
tempMv[1] = Mv(-offset * refSign, 0, highPrecList1);
}
else if (fPosPosition == 2)
{
tempMv[0] = Mv(0, offset, highPrecList0);
tempMv[1] = Mv(0, offset * refSign, highPrecList1);
}
else
{
tempMv[0] = Mv(0, -offset, highPrecList0);
tempMv[1] = Mv(0, -offset * refSign, highPrecList1);
}
#endif
if (abs(poc1 - currPoc) > abs(poc0 - currPoc))
{
const int scale = PU::getDistScaleFactor(currPoc, poc0, currPoc, poc1);
......@@ -489,7 +462,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
}
else if (refList0 != -1)
{
#if REMOVE_MV_ADAPT_PREC
if (fPosPosition == 0)
{
tempMv[0] = Mv(offset, 0);
......@@ -506,24 +478,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
tempMv[0] = Mv(0, -offset);
}
#else
if (fPosPosition == 0)
{
tempMv[0] = Mv(offset, 0, highPrecList0);
}
else if (fPosPosition == 1)
{
tempMv[0] = Mv(-offset, 0, highPrecList0);
}
else if (fPosPosition == 2)
{
tempMv[0] = Mv(0, offset, highPrecList0);
}
else
{
tempMv[0] = Mv(0, -offset, highPrecList0);
}
#endif
pu.interDir = 1;
pu.mv[REF_PIC_LIST_0] = mmvdBaseMv[fPosBaseIdx][0].mv + tempMv[0];
pu.refIdx[REF_PIC_LIST_0] = refList0;
......@@ -532,7 +486,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
}
else if (refList1 != -1)
{
#if REMOVE_MV_ADAPT_PREC
if (fPosPosition == 0)
{
tempMv[1] = Mv(offset, 0);
......@@ -549,24 +502,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
tempMv[1] = Mv(0, -offset);
}
#else
if (fPosPosition == 0)
{
tempMv[1] = Mv(offset, 0, highPrecList1);
}
else if (fPosPosition == 1)
{
tempMv[1] = Mv(-offset, 0, highPrecList1);
}
else if (fPosPosition == 2)
{
tempMv[1] = Mv(0, offset, highPrecList1);
}
else
{
tempMv[1] = Mv(0, -offset, highPrecList1);
}
#endif
pu.interDir = 2;
pu.mv[REF_PIC_LIST_0] = Mv(0, 0);
pu.refIdx[REF_PIC_LIST_0] = -1;
......
......@@ -639,15 +639,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
int iAddPrecShift = 0;
#if !REMOVE_MV_ADAPT_PREC
if (_mv.highPrec)
{
CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv(), "Found a high-precision motion vector, but the high-precision MV extension is disabled!");
#endif
iAddPrecShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
int shiftHor = 2 + iAddPrecShift + ::getComponentScaleX(compID, chFmt);
int shiftVer = 2 + iAddPrecShift + ::getComponentScaleY(compID, chFmt);
......@@ -663,10 +655,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
#endif
xFrac <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE - iAddPrecShift;
yFrac <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE - iAddPrecShift;
#if !REMOVE_MV_ADAPT_PREC
CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv() && ((xFrac & 3) != 0), "Invalid fraction");
CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv() && ((yFrac & 3) != 0), "Invalid fraction");
#endif
PelBuf &dstBuf = dstPic.bufs[compID];
unsigned width = dstBuf.width;
......@@ -781,11 +769,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
Mv mvRT =_mv[1];
Mv mvLB =_mv[2];
#if !REMOVE_MV_ADAPT_PREC
mvLT.setHighPrec();
mvRT.setHighPrec();
mvLB.setHighPrec();
#endif
// get affine sub-block width and height
const int width = pu.Y().width;
......
......@@ -486,18 +486,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
if( 0 <= miQ.refIdx[1] ) { mvQ1 = miQ.mv[1]; }
int nThreshold = 4;
#if !REMOVE_MV_ADAPT_PREC
if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
{
mvP0.setHighPrec();
mvP1.setHighPrec();
mvQ0.setHighPrec();
mvQ1.setHighPrec();
#endif
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
unsigned uiBs = 0;
//th can be optimized
......@@ -551,16 +540,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
Mv mvQ0 = miQ.mv[0];
int nThreshold = 4;
#if !REMOVE_MV_ADAPT_PREC
if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
{
mvP0.setHighPrec();
mvQ0.setHighPrec();
#endif
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
return ( ( abs( mvQ0.getHor() - mvP0.getHor() ) >= nThreshold ) || ( abs( mvQ0.getVer() - mvP0.getVer() ) >= nThreshold ) ) ? 1 : 0;
}
......
......@@ -43,9 +43,6 @@
void roundMV( Mv & rMV, unsigned imvShift )
{
CHECK( imvShift == 0, "roundMV called for imvShift=0" );
#if !REMOVE_MV_ADAPT_PREC
if (rMV.highPrec) imvShift += VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#endif
int offset = 1 << ( imvShift - 1 );
#if JVET_L0377_AMVR_ROUNDING_ALIGN
rMV.setHor(rMV.getHor() >= 0 ? ((rMV.getHor() + offset) >> imvShift) << imvShift : -(((-rMV.getHor() + offset) >> imvShift)) << imvShift);
......@@ -69,14 +66,8 @@ void clipMv( Mv& rcMv, const Position& pos,
#endif
const SPS& sps )
{
#if !REMOVE_MV_ADAPT_PREC
int iMvShift = 2 + (rcMv.highPrec ? VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : 0);
#else
int iMvShift = 2;
#endif
#if REMOVE_MV_ADAPT_PREC
iMvShift += VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#endif
int iOffset = 8;
int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - ( int ) pos.x - 1 ) << iMvShift;
int iHorMin = ( -( int ) sps.getMaxCUWidth() - iOffset - ( int ) pos.x + 1 ) << iMvShift;
......
......@@ -53,21 +53,13 @@ class Mv
public:
int hor; ///< horizontal component of motion vector
int ver; ///< vertical component of motion vector
#if !REMOVE_MV_ADAPT_PREC
bool highPrec;///< true if the vector is high precision
#endif
// ------------------------------------------------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------------------------------------------------
#if !REMOVE_MV_ADAPT_PREC
Mv( ) : hor( 0 ), ver( 0 ), highPrec( false ) {}
Mv( int iHor, int iVer, bool _highPrec = false ) : hor( iHor ), ver( iVer ), highPrec( _highPrec ) {}
#else
Mv( ) : hor( 0 ), ver( 0 ) {}
Mv( int iHor, int iVer ) : hor( iHor ), ver( iVer ) {}
#endif
// ------------------------------------------------------------------------------------------------------------------
// set
......@@ -93,21 +85,9 @@ public:
const Mv& operator += (const Mv& _rcMv)
{
#if !REMOVE_MV_ADAPT_PREC
if( highPrec == _rcMv.highPrec )
{
hor += _rcMv.hor;
ver += _rcMv.ver;
}
else
#endif
{
Mv rcMv = _rcMv;
#if !REMOVE_MV_ADAPT_PREC
if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
if( !highPrec && rcMv.highPrec ) setHighPrec();
#endif
hor += rcMv.hor;
ver += rcMv.ver;
}
......@@ -116,21 +96,9 @@ public:
const Mv& operator-= (const Mv& _rcMv)
{
#if !REMOVE_MV_ADAPT_PREC
if( highPrec == _rcMv.highPrec )
{
hor -= _rcMv.hor;
ver -= _rcMv.ver;
}
else
#endif
{
Mv rcMv = _rcMv;
#if !REMOVE_MV_ADAPT_PREC
if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
if( !highPrec && rcMv.highPrec ) setHighPrec();
#endif
hor -= rcMv.hor;
ver -= rcMv.ver;
}
......@@ -166,60 +134,17 @@ public:
const Mv operator - ( const Mv& rcMv ) const
{
#if !REMOVE_MV_ADAPT_PREC
if( rcMv.highPrec == highPrec )
{
return Mv( hor - rcMv.hor, ver - rcMv.ver, highPrec );
}
else
{
Mv self = *this; self.setHighPrec();
Mv other = rcMv; other.setHighPrec();
return self - other;
}
#else
return Mv( hor - rcMv.hor, ver - rcMv.ver );
#endif
}
const Mv operator + ( const Mv& rcMv ) const
{
#if !REMOVE_MV_ADAPT_PREC
if( rcMv.highPrec == highPrec )
{
return Mv( hor + rcMv.hor, ver + rcMv.ver, highPrec );
}
else
{
Mv self = *this; self.setHighPrec();
Mv other = rcMv; other.setHighPrec();
return self + other;
}
#else
return Mv( hor + rcMv.hor, ver + rcMv.ver );
#endif
}
bool operator== ( const Mv& rcMv ) const
{
#if !REMOVE_MV_ADAPT_PREC
if( rcMv.highPrec == highPrec )
{
return ( hor == rcMv.hor && ver == rcMv.ver );
}
else if( rcMv.highPrec )
{
return ( ( hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ) == rcMv.hor && ( ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ) == rcMv.ver );
}
else
{
return ( ( rcMv.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ) == hor && ( rcMv.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ) == ver );
}
#else
return ( hor == rcMv.hor && ver == rcMv.ver );
#endif
}
bool operator!= ( const Mv& rcMv ) const
......@@ -231,47 +156,18 @@ public:
{
const int mvx = Clip3( -32768, 32767, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8 );
const int mvy = Clip3( -32768, 32767, (iScale * getVer() + 127 + (iScale * getVer() < 0)) >> 8 );
#if !REMOVE_MV_ADAPT_PREC
return Mv( mvx, mvy, highPrec );
#else
return Mv( mvx, mvy );
#endif
}
void roundMV2SignalPrecision()
{
#if REMOVE_MV_ADAPT_PREC
const int nShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
const int nOffset = 1 << (nShift - 1);
hor = hor >= 0 ? (hor + nOffset) >> nShift : -((-hor + nOffset) >> nShift);
ver = ver >= 0 ? (ver + nOffset) >> nShift : -((-ver + nOffset) >> nShift);
hor = hor >= 0 ? (hor) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : -((-hor) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE);
ver = ver >= 0 ? (ver) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : -((-ver) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE);
#else
const bool isHP = highPrec;
setLowPrec();
if( isHP ) setHighPrec();
#endif
}
#if !REMOVE_MV_ADAPT_PREC
void setLowPrec()
{
if( !highPrec ) return;
const int nShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
const int nOffset = 1 << ( nShift - 1 );
hor = hor >= 0 ? ( hor + nOffset ) >> nShift : -( ( -hor + nOffset ) >> nShift );
ver = ver >= 0 ? ( ver + nOffset ) >> nShift : -( ( -ver + nOffset ) >> nShift );
highPrec = false;
}
void setHighPrec()
{
if( highPrec ) return;
hor = hor >= 0 ? ( hor ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : -( ( -hor ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE );
ver = ver >= 0 ? ( ver ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : -( ( -ver ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE );
highPrec = true;
}
#endif
};// END CLASS DEFINITION MV
#if JVET_L0293_CPR
namespace std
......
......@@ -167,12 +167,6 @@ public:
void setPredictor ( const Mv& rcMv )
{
m_mvPredictor = rcMv;
#if !REMOVE_MV_ADAPT_PREC
if( m_mvPredictor.highPrec )
{
m_mvPredictor = Mv( m_mvPredictor.hor >> VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, m_mvPredictor.ver >> VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false );
}
#endif
}
void setCostScale ( int iCostScale ) { m_iCostScale = iCostScale; }
Distortion getCost ( uint32_t b ) { return Distortion( m_motionLambda * b ); }
......
......@@ -1779,9 +1779,6 @@ SPSNext::SPSNext( SPS& sps )
, m_LargeCTU ( false )
, m_SubPuMvp ( false )
, m_IMV ( false )
#if !REMOVE_MV_ADAPT_PREC
, m_highPrecMv ( false )
#endif
#if JVET_L0256_BIO
, m_BIO ( false )
#endif
......
......@@ -803,9 +803,6 @@ private:
bool m_LargeCTU; // 5
bool m_SubPuMvp;
bool m_IMV; // 9
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecMv;
#endif
#if JVET_L0256_BIO
bool m_BIO;
#endif
......@@ -892,10 +889,6 @@ public:
bool getUseAffine () const { return m_Affine; }
void setUseAffineType ( bool b ) { m_AffineType = b; }
bool getUseAffineType () const { return m_AffineType; }
#if !REMOVE_MV_ADAPT_PREC
void setUseHighPrecMv(bool b) { m_highPrecMv = b; }
bool getUseHighPrecMv() const { return m_highPrecMv; }
#endif
#if JVET_L0256_BIO
void setUseBIO(bool b) { m_BIO = b; }
bool getUseBIO() const { return m_BIO; }
......
......@@ -130,7 +130,6 @@
#define REUSE_CU_RESULTS 1
#define REMOVE_MV_ADAPT_PREC 1 // remove the high precision flag in the MV class
#define JVET_L0093_SIMP_PRUNE 1
......
This diff is collapsed.
......@@ -162,9 +162,7 @@ namespace PU
#endif
void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList
#if REMOVE_MV_ADAPT_PREC
, bool setHighPrec = false
#endif
);
bool getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count
#if JVET_L0054_MMVD
......
......@@ -656,27 +656,18 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
Mv mvLT = affineAMVPInfo.mvCandLT[mvp_idx] + pu.mvdAffi[eRefList][0];
Mv mvRT = affineAMVPInfo.mvCandRT[mvp_idx] + pu.mvdAffi[eRefList][1];
mvRT += pu.mvdAffi[eRefList][0];
#if REMOVE_MV_ADAPT_PREC
mvLT.hor = mvLT.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvLT.ver = mvLT.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvRT.hor = mvRT.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvRT.ver = mvRT.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#else
CHECK(!mvLT.highPrec, "unexpected lp mv");
CHECK(!mvRT.highPrec, "unexpected lp mv");
#endif
Mv mvLB;
if ( cu.affineType == AFFINEMODEL_6PARAM )
{
mvLB = affineAMVPInfo.mvCandLB[mvp_idx] + pu.mvdAffi[eRefList][2];
mvLB += pu.mvdAffi[eRefList][0];
#if REMOVE_MV_ADAPT_PREC
mvLB.hor = mvLB.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvLB.ver = mvLB.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#else
CHECK(!mvLB.highPrec, "unexpected lp mv");
#endif
}
PU::setAllAffineMv( pu, mvLT, mvRT, mvLB, eRefList );
}
......@@ -707,15 +698,8 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
pu.mv [eRefList] = amvpInfo.mvCand[pu.mvpIdx [eRefList]] + pu.mvd[eRefList];
#endif
#if REMOVE_MV_ADAPT_PREC
pu.mv[eRefList].hor = pu.mv[eRefList].hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
pu.mv[eRefList].ver = pu.mv[eRefList].ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#else
if( pu.cs->sps->getSpsNext().getUseAffine() )
{
pu.mv[eRefList].setHighPrec();
}
#endif
}
}
}
......
......@@ -791,9 +791,6 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_FLAG( symbol, "large_ctu_flag" ); spsNext.setUseLargeCTU ( symbol != 0 );
READ_FLAG( symbol, "subpu_tmvp_flag" ); spsNext.setSubPuMvpMode (symbol);
READ_FLAG( symbol, "imv_enable_flag" ); spsNext.setUseIMV ( symbol != 0 );
#if !REMOVE_MV_ADAPT_PREC
READ_FLAG( symbol, "high_precision_motion_vectors" ); spsNext.setUseHighPrecMv(symbol != 0);
#endif
#if JVET_L0256_BIO
READ_FLAG( symbol, "bio_enable_flag" ); spsNext.setUseBIO ( symbol != 0 );
#endif
......
......@@ -1996,15 +1996,6 @@ void CABACWriter::mvd_coding( const Mv &rMvd, uint8_t imv )
unsigned horAbs = unsigned( horMvd < 0 ? -horMvd : horMvd );
unsigned verAbs = unsigned( verMvd < 0 ? -verMvd : verMvd );
#if !REMOVE_MV_ADAPT_PREC
if (rMvd.highPrec)
{
CHECK(horAbs & ((1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE) - 1), "mvd-x has high precision fractional part.");
CHECK(verAbs & ((1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE) - 1), "mvd-y has high precision fractional part.");
horAbs >>= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
verAbs >>= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
}
#endif
// abs_mvd_greater0_flag[ 0 | 1 ]
m_BinEncoder.encodeBin( (horAbs > 0), Ctx::Mvd() );
......
......@@ -217,9 +217,6 @@ protected:
#endif
bool m_Affine;
bool m_AffineType;
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecMv;
#endif
#if JVET_L0256_BIO
bool m_BIO;
#endif
......@@ -714,10 +711,6 @@ public:
bool getAffine () const { return m_Affine; }
void setAffineType( bool b ) { m_AffineType = b; }
bool getAffineType() const { return m_AffineType; }
#if !REMOVE_MV_ADAPT_PREC
void setHighPrecisionMv ( bool b ) { m_highPrecMv = b; }
bool getHighPrecisionMv () { return m_highPrecMv; }
#endif
#if JVET_L0256_BIO
void setBIO(bool b) { m_BIO = b; }
bool getBIO() const { return m_BIO; }
......
......@@ -868,9 +868,6 @@ void EncLib::xInitSPS(SPS &sps)
#endif
sps.getSpsNext().setImvMode ( ImvMode(m_ImvMode) );
sps.getSpsNext().setUseIMV ( m_ImvMode != IMV_OFF );
#if !REMOVE_MV_ADAPT_PREC
sps.getSpsNext().setUseHighPrecMv ( m_highPrecMv );
#endif
#if JVET_L0256_BIO
sps.getSpsNext().setUseBIO ( m_BIO );
#endif
......
This diff is collapsed.
......@@ -531,9 +531,6 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_FLAG( spsNext.getUseLargeCTU() ? 1 : 0, "large_ctu_flag" );
WRITE_FLAG(spsNext.getUseSubPuMvp() ? 1 : 0, "subpu_tmvp_flag");
WRITE_FLAG( spsNext.getUseIMV() ? 1 : 0, "imv_enable_flag" );
#if !REMOVE_MV_ADAPT_PREC
WRITE_FLAG( spsNext.getUseHighPrecMv() ? 1 : 0, "high_precision_motion_vectors");
#endif
#if JVET_L0256_BIO
WRITE_FLAG( spsNext.getUseBIO() ? 1 : 0, "bio_enable_flag" );
#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