Commit 05f8d980 authored by Xiang Li's avatar Xiang Li

Revert "Merge branch 'High_Precision_Motion_Vector_Storage' into 'master'"

This reverts merge request !106
parent 7442802b
Pipeline #104 passed with stage
...@@ -121,6 +121,7 @@ MTT : 1 ...@@ -121,6 +121,7 @@ MTT : 1
EMT : 3 EMT : 3
EMTFast : 3 EMTFast : 3
Affine : 1 Affine : 1
HighPrecMv : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
LMChroma : 1 LMChroma : 1
......
...@@ -121,7 +121,7 @@ MTT : 1 ...@@ -121,7 +121,7 @@ MTT : 1
EMT : 3 EMT : 3
EMTFast : 3 EMTFast : 3
Affine : 1 Affine : 1
HighPrecMv : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
LMChroma : 1 LMChroma : 1
......
...@@ -135,6 +135,7 @@ MTT : 1 ...@@ -135,6 +135,7 @@ MTT : 1
EMT : 3 EMT : 3
EMTFast : 3 EMTFast : 3
Affine : 1 Affine : 1
HighPrecMv : 1
SubPuMvp : 1 SubPuMvp : 1
MaxNumMergeCand : 6 MaxNumMergeCand : 6
LMChroma : 1 LMChroma : 1
...@@ -157,4 +158,3 @@ AMaxBT : 1 ...@@ -157,4 +158,3 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ### ### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ### ### DO NOT DELETE THE EMPTY LINE BELOW ###
...@@ -241,9 +241,7 @@ void EncApp::xInitLibCfg() ...@@ -241,9 +241,7 @@ void EncApp::xInitLibCfg()
#endif #endif
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
m_cEncLib.setHighPrecisionMv ( m_highPrecisionMv ); m_cEncLib.setHighPrecisionMv ( m_highPrecisionMv );
#endif
m_cEncLib.setAffine ( m_Affine ); m_cEncLib.setAffine ( m_Affine );
#if JVET_K0337_AFFINE_6PARA #if JVET_K0337_AFFINE_6PARA
m_cEncLib.setAffineType ( m_AffineType ); m_cEncLib.setAffineType ( m_AffineType );
......
...@@ -833,14 +833,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -833,14 +833,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("SubPuMvp", m_SubPuMvpMode, 0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:on) [default: off]") ("SubPuMvp", m_SubPuMvpMode, 0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:on) [default: off]")
#endif #endif
("SubPuMvpLog2Size", m_SubPuMvpLog2Size, 2u, "Sub-PU TMVP size index: 2^n") ("SubPuMvpLog2Size", m_SubPuMvpLog2Size, 2u, "Sub-PU TMVP size index: 2^n")
#if !REMOVE_MV_ADAPT_PREC ("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
#endif
#endif #endif
#if JEM_TOOLS || JVET_K_AFFINE #if JEM_TOOLS || JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]") ("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]") ("Affine", m_Affine, false, "Enable affine prediction (0:off, 1:on) [default: off]")
#if JVET_K0337_AFFINE_6PARA #if JVET_K0337_AFFINE_6PARA
( "AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" ) ( "AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" )
...@@ -2126,9 +2122,7 @@ bool EncAppCfg::xCheckParameter() ...@@ -2126,9 +2122,7 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( !( m_OBMCBlkSize == 4 || m_OBMCBlkSize == 8 ), "OBMC Block Size must be set to 4 or 8 samples" ); xConfirmPara( !( m_OBMCBlkSize == 4 || m_OBMCBlkSize == 8 ), "OBMC Block Size must be set to 4 or 8 samples" );
#endif #endif
#if JVET_K_AFFINE #if JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC xConfirmPara( m_Affine && !m_highPrecisionMv, "Affine is not yet implemented for HighPrecMv off." );
xConfirmPara(m_Affine && !m_highPrecisionMv, "Affine is not yet implemented for HighPrecMv off.");
#endif
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
xConfirmPara( m_DMVR && !m_QTBT, "DMVR without QTBT results in encoder-decoder mismatch!" ); xConfirmPara( m_DMVR && !m_QTBT, "DMVR without QTBT results in encoder-decoder mismatch!" );
...@@ -3409,15 +3403,11 @@ void EncAppCfg::xPrintParameter() ...@@ -3409,15 +3403,11 @@ void EncAppCfg::xPrintParameter()
#endif #endif
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
msg( VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv ); msg( VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv );
#endif
msg( VERBOSE, "BIO:%d ", m_BIO ); msg( VERBOSE, "BIO:%d ", m_BIO );
#endif #endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE) #if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC msg(VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv);
msg( VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv );
#endif
#endif #endif
msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression ); msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression );
#if JEM_TOOLS #if JEM_TOOLS
......
...@@ -769,11 +769,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx ) ...@@ -769,11 +769,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
{ {
pu.cu->ibc = true; pu.cu->ibc = true;
pu.bv = pu.mv[REF_PIC_LIST_0]; pu.bv = pu.mv[REF_PIC_LIST_0];
#if REMOVE_MV_ADAPT_PREC
pu.bv >>= (2 + VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE);
#else
pu.bv >>= 2; // used for only integer resolution pu.bv >>= 2; // used for only integer resolution
#endif
} }
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
......
This diff is collapsed.
...@@ -324,11 +324,8 @@ protected: ...@@ -324,11 +324,8 @@ protected:
#endif #endif
void xFrucUpdateTemplate (PredictionUnit& pu, int nWidth, int nHeight, RefPicList eCurRefPicList, const MvField& rCurMvField ); void xFrucUpdateTemplate (PredictionUnit& pu, int nWidth, int nHeight, RefPicList eCurRefPicList, const MvField& rCurMvField );
#if REMOVE_MV_ADAPT_PREC
void xFrucInsertMv2StartList (const MvField & rMvField, std::list<MvField> & rList); void xFrucInsertMv2StartList (const MvField & rMvField, std::list<MvField> & rList,bool setHighPrec);
#else
void xFrucInsertMv2StartList (const MvField & rMvField, std::list<MvField> & rList, bool setHighPrec);
#endif
bool xFrucIsInList (const MvField & rMvField, std::list<MvField> & rList); bool xFrucIsInList (const MvField & rMvField, std::list<MvField> & rList);
bool xFrucGetCurBlkTemplate (PredictionUnit& pu, int nCurBlkWidth , int nCurBlkHeight); bool xFrucGetCurBlkTemplate (PredictionUnit& pu, int nCurBlkWidth , int nCurBlkHeight);
......
...@@ -506,18 +506,14 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De ...@@ -506,18 +506,14 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
int nThreshold = 4; int nThreshold = 4;
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC if( cu.cs->sps->getSpsNext().getUseHighPrecMv() )
if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
{ {
mvP0.setHighPrec(); mvP0.setHighPrec();
mvP1.setHighPrec(); mvP1.setHighPrec();
mvQ0.setHighPrec(); mvQ0.setHighPrec();
mvQ1.setHighPrec(); mvQ1.setHighPrec();
#endif
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE; nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
} }
#endif
#endif #endif
unsigned uiBs = 0; unsigned uiBs = 0;
...@@ -573,16 +569,12 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De ...@@ -573,16 +569,12 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
int nThreshold = 4; int nThreshold = 4;
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC if( cu.cs->sps->getSpsNext().getUseHighPrecMv() )
if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
{ {
mvP0.setHighPrec(); mvP0.setHighPrec();
mvQ0.setHighPrec(); mvQ0.setHighPrec();
#endif
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE; nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
} }
#endif
#endif #endif
return ( ( abs( mvQ0.getHor() - mvP0.getHor() ) >= nThreshold ) || ( abs( mvQ0.getVer() - mvP0.getVer() ) >= nThreshold ) ) ? 1 : 0; return ( ( abs( mvQ0.getHor() - mvP0.getHor() ) >= nThreshold ) || ( abs( mvQ0.getVer() - mvP0.getVer() ) >= nThreshold ) ) ? 1 : 0;
} }
......
...@@ -44,9 +44,7 @@ ...@@ -44,9 +44,7 @@
void roundMV( Mv & rMV, unsigned imvShift ) void roundMV( Mv & rMV, unsigned imvShift )
{ {
CHECK( imvShift == 0, "roundMV called for imvShift=0" ); 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;
if (rMV.highPrec) imvShift += VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#endif
int offset = 1 << ( imvShift - 1 ); int offset = 1 << ( imvShift - 1 );
rMV.setHor( ( ( rMV.getHor() + offset ) >> imvShift ) << imvShift ); rMV.setHor( ( ( rMV.getHor() + offset ) >> imvShift ) << imvShift );
...@@ -65,13 +63,10 @@ void roundAffineMv( int& mvx, int& mvy, int nShift ) ...@@ -65,13 +63,10 @@ void roundAffineMv( int& mvx, int& mvy, int nShift )
void clipMv( Mv& rcMv, const Position& pos, const SPS& sps ) void clipMv( Mv& rcMv, const Position& pos, const SPS& sps )
{ {
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
int iMvShift = 2 + (rcMv.highPrec ? VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : 0); int iMvShift = 2 + ( rcMv.highPrec ? VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : 0 );
#else #else
int iMvShift = 2; int iMvShift = 2;
#endif
#if REMOVE_MV_ADAPT_PREC
iMvShift += VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#endif #endif
int iOffset = 8; int iOffset = 8;
int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - ( int ) pos.x - 1 ) << iMvShift; int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - ( int ) pos.x - 1 ) << iMvShift;
......
...@@ -53,7 +53,7 @@ class Mv ...@@ -53,7 +53,7 @@ class Mv
public: public:
int hor; ///< horizontal component of motion vector int hor; ///< horizontal component of motion vector
int ver; ///< vertical component of motion vector int ver; ///< vertical component of motion vector
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
bool highPrec;///< true if the vector is high precision bool highPrec;///< true if the vector is high precision
#endif #endif
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
// constructors // constructors
// ------------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------------
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
Mv( ) : hor( 0 ), ver( 0 ), highPrec( false ) {} Mv( ) : hor( 0 ), ver( 0 ), highPrec( false ) {}
Mv( int iHor, int iVer, bool _highPrec = false ) : hor( iHor ), ver( iVer ), highPrec( _highPrec ) {} Mv( int iHor, int iVer, bool _highPrec = false ) : hor( iHor ), ver( iVer ), highPrec( _highPrec ) {}
#if DMVR_JVET_K0217 #if DMVR_JVET_K0217
...@@ -80,33 +80,9 @@ public: ...@@ -80,33 +80,9 @@ public:
return (hor == 0 && ver == 0); return (hor == 0 && ver == 0);
} }
#endif #endif
#else
#if JEM_TOOLS
#if REMOVE_MV_ADAPT_PREC && DMVR_JVET_K0217
Mv() : hor(0), ver(0) {}
Mv(int iHor, int iVer) : hor(iHor), ver(iVer) {}
// explicit Mv(const Mv &newMv) : hor(newMv.hor), ver(newMv.ver) {} // use default copy constructor
explicit Mv(int iHorAndiVer) : hor(iHorAndiVer), ver(iHorAndiVer) {}
Mv operator << (int i)
{
return Mv(hor << i, ver << i);
}
Mv operator - (void)
{
return Mv(-hor, -ver);
}
bool IsZero(void)
{
return (hor == 0 && ver == 0);
}
#else
Mv() : hor(0), ver(0) {}
Mv(int iHor, int iVer) : hor(iHor), ver(iVer) {}
#endif
#else #else
Mv( ) : hor( 0 ), ver( 0 ) {} Mv( ) : hor( 0 ), ver( 0 ) {}
Mv( int iHor, int iVer ) : hor( iHor ), ver( iVer ) {} Mv( int iHor, int iVer ) : hor( iHor ), ver( iVer ) {}
#endif
#endif #endif
// ------------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------------
...@@ -133,7 +109,7 @@ public: ...@@ -133,7 +109,7 @@ public:
const Mv& operator += (const Mv& _rcMv) const Mv& operator += (const Mv& _rcMv)
{ {
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( highPrec == _rcMv.highPrec ) if( highPrec == _rcMv.highPrec )
{ {
hor += _rcMv.hor; hor += _rcMv.hor;
...@@ -144,7 +120,7 @@ public: ...@@ -144,7 +120,7 @@ public:
{ {
Mv rcMv = _rcMv; Mv rcMv = _rcMv;
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec(); if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
if( !highPrec && rcMv.highPrec ) setHighPrec(); if( !highPrec && rcMv.highPrec ) setHighPrec();
#endif #endif
...@@ -156,7 +132,7 @@ public: ...@@ -156,7 +132,7 @@ public:
const Mv& operator-= (const Mv& _rcMv) const Mv& operator-= (const Mv& _rcMv)
{ {
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( highPrec == _rcMv.highPrec ) if( highPrec == _rcMv.highPrec )
{ {
hor -= _rcMv.hor; hor -= _rcMv.hor;
...@@ -167,7 +143,7 @@ public: ...@@ -167,7 +143,7 @@ public:
{ {
Mv rcMv = _rcMv; Mv rcMv = _rcMv;
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec(); if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
if( !highPrec && rcMv.highPrec ) setHighPrec(); if( !highPrec && rcMv.highPrec ) setHighPrec();
#endif #endif
...@@ -206,7 +182,7 @@ public: ...@@ -206,7 +182,7 @@ public:
const Mv operator - ( const Mv& rcMv ) const const Mv operator - ( const Mv& rcMv ) const
{ {
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( rcMv.highPrec == highPrec ) if( rcMv.highPrec == highPrec )
{ {
return Mv( hor - rcMv.hor, ver - rcMv.ver, highPrec ); return Mv( hor - rcMv.hor, ver - rcMv.ver, highPrec );
...@@ -225,7 +201,7 @@ public: ...@@ -225,7 +201,7 @@ public:
const Mv operator + ( const Mv& rcMv ) const const Mv operator + ( const Mv& rcMv ) const
{ {
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( rcMv.highPrec == highPrec ) if( rcMv.highPrec == highPrec )
{ {
return Mv( hor + rcMv.hor, ver + rcMv.ver, highPrec ); return Mv( hor + rcMv.hor, ver + rcMv.ver, highPrec );
...@@ -244,7 +220,7 @@ public: ...@@ -244,7 +220,7 @@ public:
bool operator== ( const Mv& rcMv ) const bool operator== ( const Mv& rcMv ) const
{ {
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if( rcMv.highPrec == highPrec ) if( rcMv.highPrec == highPrec )
{ {
return ( hor == rcMv.hor && ver == rcMv.ver ); return ( hor == rcMv.hor && ver == rcMv.ver );
...@@ -271,7 +247,7 @@ public: ...@@ -271,7 +247,7 @@ public:
{ {
const int mvx = Clip3( -32768, 32767, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8 ); 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 ); const int mvy = Clip3( -32768, 32767, (iScale * getVer() + 127 + (iScale * getVer() < 0)) >> 8 );
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
return Mv( mvx, mvy, highPrec ); return Mv( mvx, mvy, highPrec );
#else #else
return Mv( mvx, mvy ); return Mv( mvx, mvy );
...@@ -281,40 +257,29 @@ public: ...@@ -281,40 +257,29 @@ public:
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
void roundMV2SignalPrecision() 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; const bool isHP = highPrec;
setLowPrec(); setLowPrec();
if( isHP ) setHighPrec(); if( isHP ) setHighPrec();
#endif
} }
#if !REMOVE_MV_ADAPT_PREC
void setLowPrec() void setLowPrec()
{ {
if (!highPrec) return; if( !highPrec ) return;
const int nShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE; const int nShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
const int nOffset = 1 << ( nShift - 1 ); const int nOffset = 1 << ( nShift - 1 );
hor = hor >= 0 ? ( hor + nOffset ) >> nShift : -( ( -hor + nOffset ) >> nShift ); hor = hor >= 0 ? ( hor + nOffset ) >> nShift : -( ( -hor + nOffset ) >> nShift );
ver = ver >= 0 ? ( ver + nOffset ) >> nShift : -( ( -ver + nOffset ) >> nShift ); ver = ver >= 0 ? ( ver + nOffset ) >> nShift : -( ( -ver + nOffset ) >> nShift );
highPrec = false; highPrec = false;
} }
#endif
#if !REMOVE_MV_ADAPT_PREC
void setHighPrec() void setHighPrec()
{ {
if (highPrec) return; if( highPrec ) return;
hor = hor >= 0 ? ( hor ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : -( ( -hor ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ); 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 ); ver = ver >= 0 ? ( ver ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : -( ( -ver ) << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE );
highPrec = true; highPrec = true;
} }
#endif #endif
#endif
};// END CLASS DEFINITION MV };// END CLASS DEFINITION MV
#if JVET_K0076_CPR #if JVET_K0076_CPR
namespace std namespace std
......
...@@ -187,10 +187,10 @@ public: ...@@ -187,10 +187,10 @@ public:
void setPredictor ( const Mv& rcMv ) void setPredictor ( const Mv& rcMv )
{ {
m_mvPredictor = rcMv; m_mvPredictor = rcMv;
#if (JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC #if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if (m_mvPredictor.highPrec) 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); 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 #endif
} }
......
...@@ -1836,15 +1836,11 @@ SPSNext::SPSNext( SPS& sps ) ...@@ -1836,15 +1836,11 @@ SPSNext::SPSNext( SPS& sps )
#endif #endif
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
, m_highPrecMv ( false ) , m_highPrecMv ( false )
#endif
, m_BIO ( false ) , m_BIO ( false )
#endif #endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE) #if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC
, m_highPrecMv ( false ) , m_highPrecMv ( false )
#endif
#endif #endif
, m_DisableMotionCompression ( false ) , m_DisableMotionCompression ( false )
#if JEM_TOOLS #if JEM_TOOLS
......
...@@ -829,15 +829,11 @@ private: ...@@ -829,15 +829,11 @@ private:
#endif #endif
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecMv; // 11 bool m_highPrecMv; // 11
#endif
bool m_BIO; // 12 bool m_BIO; // 12
#endif #endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE) #if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecMv; bool m_highPrecMv;
#endif
#endif #endif
bool m_DisableMotionCompression; // 13 bool m_DisableMotionCompression; // 13
#if JEM_TOOLS #if JEM_TOOLS
...@@ -1020,18 +1016,14 @@ public: ...@@ -1020,18 +1016,14 @@ public:
#endif #endif
#endif #endif
#if JEM_TOOLS #if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC void setUseHighPrecMv ( bool b ) { m_highPrecMv = b; }
void setUseHighPrecMv (bool b) { m_highPrecMv = b; }
bool getUseHighPrecMv () const { return m_highPrecMv; } bool getUseHighPrecMv () const { return m_highPrecMv; }
#endif
void setUseBIO ( bool b ) { m_BIO = b; } void setUseBIO ( bool b ) { m_BIO = b; }
bool getUseBIO () const { return m_BIO; } bool getUseBIO () const { return m_BIO; }
#endif #endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE) #if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC void setUseHighPrecMv(bool b) { m_highPrecMv = b; }
void setUseHighPrecMv (bool b) { m_highPrecMv = b; } bool getUseHighPrecMv() const { return m_highPrecMv; }
bool getUseHighPrecMv () const { return m_highPrecMv; }
#endif
#endif #endif
void setDisableMotCompress ( bool b ) { m_DisableMotionCompression = b; } void setDisableMotCompress ( bool b ) { m_DisableMotionCompression = b; }
bool getDisableMotCompress () const { return m_DisableMotionCompression; } bool getDisableMotCompress () const { return m_DisableMotionCompression; }
......
...@@ -128,8 +128,6 @@ ...@@ -128,8 +128,6 @@
#define JVET_K0357_AMVR 1 // Adaptive motion vector resolution separated from JEM_TOOLS macro #define JVET_K0357_AMVR 1 // Adaptive motion vector resolution separated from JEM_TOOLS macro
#define REMOVE_MV_ADAPT_PREC 1 // remove the high precision flag in the MV class
#if JVET_K0485_BIO #if JVET_K0485_BIO
#define JVET_K0485_BIO_EXTEND_SIZE 1 #define JVET_K0485_BIO_EXTEND_SIZE 1
#endif #endif
......
This diff is collapsed.
...@@ -189,22 +189,14 @@ namespace PU ...@@ -189,22 +189,14 @@ namespace PU
#if JEM_TOOLS #if JEM_TOOLS
bool isAffineMrgFlagCoded (const PredictionUnit &pu ); bool isAffineMrgFlagCoded (const PredictionUnit &pu );
void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList ); void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList );
#if REMOVE_MV_ADAPT_PREC
, bool setHighPrec = false
#endif
);
bool isBIOLDB (const PredictionUnit &pu); bool isBIOLDB (const PredictionUnit &pu);
#endif #endif
#if !JEM_TOOLS && JVET_K_AFFINE #if !JEM_TOOLS && JVET_K_AFFINE
bool isAffineMrgFlagCoded (const PredictionUnit &pu ); bool isAffineMrgFlagCoded (const PredictionUnit &pu );
void getAffineMergeCand (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand ); void getAffineMergeCand (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand );
void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList ); void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList );
#if REMOVE_MV_ADAPT_PREC
, bool setHighPrec = false
#endif
);
#endif #endif
#if !JEM_TOOLS && JVET_K0346 #if !JEM_TOOLS && JVET_K0346
bool getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count bool getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count
......
...@@ -608,13 +608,9 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -608,13 +608,9 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#if JVET_K0337_AFFINE_MVD_PREDICTION #if JVET_K0337_AFFINE_MVD_PREDICTION
mvRT += pu.mvdAffi[eRefList][0]; mvRT += pu.mvdAffi[eRefList][0];
#endif #endif
#if REMOVE_MV_ADAPT_PREC
mvLT <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE; CHECK( !mvLT.highPrec, "unexpected lp mv" );
mvRT <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE; CHECK( !mvRT.highPrec, "unexpected lp mv" );
#else
CHECK(!mvLT.highPrec, "unexpected lp mv");
CHECK(!mvRT.highPrec, "unexpected lp mv");
#endif
#if JVET_K_AFFINE_BUG_FIXES #if JVET_K_AFFINE_BUG_FIXES
Mv mvLB; Mv mvLB;
...@@ -625,11 +621,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -625,11 +621,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#if JVET_K0337_AFFINE_MVD_PREDICTION #if JVET_K0337_AFFINE_MVD_PREDICTION
mvLB += pu.mvdAffi[eRefList][0]; mvLB += pu.mvdAffi[eRefList][0];
#endif #endif
#if REMOVE_MV_ADAPT_PREC CHECK( !mvLB.highPrec, "unexpected lp mv" );
mvLB <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#else
CHECK(!mvLB.highPrec, "unexpected lp mv");
#endif
} }
#endif #endif
#else #else
...@@ -668,12 +660,10 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) ...@@ -668,12 +660,10 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
if (eRefList == REF_PIC_LIST_0 && pu.cs->slice->getRefPic(eRefList, pu.refIdx[eRefList])->getPOC() == pu.cs->slice->getPOC()) if (eRefList == REF_PIC_LIST_0 && pu.cs->slice->getRefPic(eRefList, pu.refIdx[eRefList])->getPOC() == pu.cs->slice->getPOC())
{ {
pu.cu->ibc = true; pu.cu->ibc = true;
#if !REMOVE_MV_ADAPT_PREC
#if REUSE_CU_RESULTS #if REUSE_CU_RESULTS
if (!cu.cs->pcv->isEncoder) if (!cu.cs->pcv->isEncoder)
#endif #endif
mvd <<= 2; mvd <<= 2;
#endif
} }
pu.mv[eRefList] = amvpInfo.mvCand[pu.mvpIdx[eRefList]] + mvd; pu.mv[eRefList] = amvpInfo.mvCand[pu.mvpIdx[eRefList]] + mvd;
#else