Commit ed0a0a87 authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'clean_mv_precision' into 'master'

Explicitly change MV precision

See merge request jvet/VVCSoftware_VTM!140
parents 47b610b5 53acbad3
Pipeline #482 passed with stage
......@@ -245,9 +245,12 @@ static const int LOG2_MAX_NUM_ROWS_MINUS1 = 7;
static const int CABAC_INIT_PRESENT_FLAG = 1;
static const int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 4;
static const int CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 8;
static const int VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE = 2; ///< additional precision bit for MV storage
static const int MV_FRACTIONAL_BITS_INTERNAL = 4;
static const int MV_FRACTIONAL_BITS_SIGNAL = 2;
static const int MV_FRACTIONAL_BITS_DIFF = MV_FRACTIONAL_BITS_INTERNAL - MV_FRACTIONAL_BITS_SIGNAL;
static const int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL = 1 << MV_FRACTIONAL_BITS_SIGNAL;
static const int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 1 << MV_FRACTIONAL_BITS_INTERNAL;
static const int CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 1 << (MV_FRACTIONAL_BITS_INTERNAL + 1);
static const int MAX_NUM_LONG_TERM_REF_PICS = 33;
static const int NUM_LONG_TERM_REF_PIC_SPS = 0;
......
......@@ -373,7 +373,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
{
pu.cu->cpr = true;
pu.bv = pu.mv[REF_PIC_LIST_0];
pu.bv >>= (2 + VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE); // used for only integer resolution
pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution
}
#endif
#if JVET_L0646_GBI
......@@ -385,7 +385,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
const Slice &slice = *pu.cs->slice;
const int mvShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
const int mvShift = MV_FRACTIONAL_BITS_DIFF;
const int refMvdCands[8] = { 1 << mvShift , 2 << mvShift , 4 << mvShift , 8 << mvShift , 16 << mvShift , 32 << mvShift, 64 << mvShift , 128 << mvShift };
int fPosGroup = 0;
int fPosBaseIdx = 0;
......
......@@ -76,9 +76,9 @@ InterPrediction::InterPrediction()
for( uint32_t c = 0; c < MAX_NUM_COMPONENT; c++ )
{
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS; i++ )
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; i++ )
{
for( uint32_t j = 0; j < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS; j++ )
for( uint32_t j = 0; j < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; j++ )
{
m_filteredBlock[i][j][c] = nullptr;
}
......@@ -107,9 +107,9 @@ void InterPrediction::destroy()
for( uint32_t c = 0; c < MAX_NUM_COMPONENT; c++ )
{
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS; i++ )
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; i++ )
{
for( uint32_t j = 0; j < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS; j++ )
for( uint32_t j = 0; j < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; j++ )
{
xFree( m_filteredBlock[i][j][c] );
m_filteredBlock[i][j][c] = nullptr;
......@@ -163,11 +163,11 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC )
int extWidth = MAX_CU_SIZE + 16;
int extHeight = MAX_CU_SIZE + 1;
#endif
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS; i++ )
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; i++ )
{
m_filteredBlockTmp[i][c] = ( Pel* ) xMalloc( Pel, ( extWidth + 4 ) * ( extHeight + 7 + 4 ) );
for( uint32_t j = 0; j < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS; j++ )
for( uint32_t j = 0; j < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; j++ )
{
m_filteredBlock[i][j][c] = ( Pel* ) xMalloc( Pel, extWidth * extHeight );
}
......@@ -637,12 +637,8 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
const ChromaFormat chFmt = pu.chromaFormat;
const bool rndRes = !bi;
int iAddPrecShift = 0;
iAddPrecShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
int shiftHor = 2 + iAddPrecShift + ::getComponentScaleX(compID, chFmt);
int shiftVer = 2 + iAddPrecShift + ::getComponentScaleY(compID, chFmt);
int shiftHor = MV_FRACTIONAL_BITS_INTERNAL + ::getComponentScaleX(compID, chFmt);
int shiftVer = MV_FRACTIONAL_BITS_INTERNAL + ::getComponentScaleY(compID, chFmt);
int xFrac = _mv.hor & ((1 << shiftHor) - 1);
int yFrac = _mv.ver & ((1 << shiftVer) - 1);
......@@ -653,8 +649,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
JVET_J0090_SET_CACHE_ENABLE( false );
}
#endif
xFrac <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE - iAddPrecShift;
yFrac <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE - iAddPrecShift;
PelBuf &dstBuf = dstPic.bufs[compID];
unsigned width = dstBuf.width;
......@@ -821,7 +815,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
PelBuf tmpBuf = PelBuf(m_filteredBlockTmp[0][compID], pu.blocks[compID]);
const int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA;
const int shift = iBit - 4 + VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE + 2;
const int shift = iBit - 4 + MV_FRACTIONAL_BITS_INTERNAL;
// get prediction block by block
for ( int h = 0; h < cxHeight; h += blockHeight )
......
......@@ -80,8 +80,8 @@ protected:
InterpolationFilter m_if;
Pel* m_acYuvPred [NUM_REF_PIC_LIST_01][MAX_NUM_COMPONENT];
Pel* m_filteredBlock [LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][MAX_NUM_COMPONENT];
Pel* m_filteredBlockTmp [LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][MAX_NUM_COMPONENT];
Pel* m_filteredBlock [LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL][LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL][MAX_NUM_COMPONENT];
Pel* m_filteredBlockTmp [LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL][MAX_NUM_COMPONENT];
ChromaFormat m_currChromaFormat;
......
......@@ -55,7 +55,7 @@ CacheModel* InterpolationFilter::m_cacheModel;
// Tables
// ====================================================================================================================
const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_LUMA] =
const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
{
{ 0, 0, 0, 64, 0, 0, 0, 0 },
{ 0, 1, -3, 63, 4, -2, 1, 0 },
......@@ -75,7 +75,7 @@ const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_S
{ 0, 1, -2, 4, 63, -3, 1, 0 }
};
const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_CHROMA] =
const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA] =
{
{ 0, 64, 0, 0 },
{ -1, 63, 2, 0 },
......@@ -112,7 +112,7 @@ const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILT
};
#if JVET_L0256_BIO
const TFilterCoeff InterpolationFilter::m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_BILINEAR] =
const TFilterCoeff InterpolationFilter::m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_BILINEAR] =
{
{ 64, 0, },
{ 60, 4, },
......@@ -477,7 +477,7 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
}
else if( isLuma( compID ) )
{
CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
CHECK( frac < 0 || frac >= LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS, "Invalid fraction" );
#if JVET_L0256_BIO
if( nFilterIdx == 1 )
{
......@@ -492,7 +492,7 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
else
{
const uint32_t csx = getComponentScaleX( compID, fmt );
CHECK( frac < 0 || csx >= 2 || ( frac << ( 1 - csx ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
CHECK( frac < 0 || csx >= 2 || ( frac << ( 1 - csx ) ) >= CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS, "Invalid fraction" );
filterHor<NTAPS_CHROMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac << ( 1 - csx )] );
}
}
......@@ -526,7 +526,7 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
}
else if( isLuma( compID ) )
{
CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
CHECK( frac < 0 || frac >= LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS, "Invalid fraction" );
#if JVET_L0256_BIO
if (nFilterIdx == 1)
{
......@@ -541,7 +541,7 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
else
{
const uint32_t csy = getComponentScaleY( compID, fmt );
CHECK( frac < 0 || csy >= 2 || ( frac << ( 1 - csy ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
CHECK( frac < 0 || csy >= 2 || ( frac << ( 1 - csy ) ) >= CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS, "Invalid fraction" );
filterVer<NTAPS_CHROMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac << ( 1 - csy )] );
}
}
......
......@@ -54,10 +54,10 @@
*/
class InterpolationFilter
{
static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_LUMA]; ///< Luma filter taps
static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_CHROMA]; ///< Chroma filter taps
static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps
static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
#if JVET_L0256_BIO
static const TFilterCoeff m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_BILINEAR]; ///< bilinear filter taps
static const TFilterCoeff m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_BILINEAR]; ///< bilinear filter taps
#endif
public:
template<bool isFirst, bool isLast>
......
......@@ -485,8 +485,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
if( 0 <= miQ.refIdx[0] ) { mvQ0 = miQ.mv[0]; }
if( 0 <= miQ.refIdx[1] ) { mvQ1 = miQ.mv[1]; }
int nThreshold = 4;
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
int nThreshold = 1 << MV_FRACTIONAL_BITS_INTERNAL;
unsigned uiBs = 0;
//th can be optimized
......@@ -539,8 +538,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
Mv mvP0 = miP.mv[0];
Mv mvQ0 = miQ.mv[0];
int nThreshold = 4;
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
int nThreshold = 1 << MV_FRACTIONAL_BITS_INTERNAL;
return ( ( abs( mvQ0.getHor() - mvP0.getHor() ) >= nThreshold ) || ( abs( mvQ0.getVer() - mvP0.getVer() ) >= nThreshold ) ) ? 1 : 0;
}
......
......@@ -40,18 +40,7 @@
#include "Common.h"
#include "Slice.h"
void roundMV( Mv & rMV, unsigned imvShift )
{
CHECK( imvShift == 0, "roundMV called for imvShift=0" );
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);
rMV.setVer(rMV.getVer() >= 0 ? ((rMV.getVer() + offset) >> imvShift) << imvShift : -(((-rMV.getVer() + offset) >> imvShift)) << imvShift);
#else
rMV.setHor( ( ( rMV.getHor() + offset ) >> imvShift ) << imvShift );
rMV.setVer( ( ( rMV.getVer() + offset ) >> imvShift ) << imvShift );
#endif
}
const MvPrecision Mv::m_amvrPrecision[3] = { MV_PRECISION_QUARTER, MV_PRECISION_INT, MV_PRECISION_4PEL }; // for cu.imv=0, 1 and 2
void roundAffineMv( int& mvx, int& mvy, int nShift )
{
......@@ -66,8 +55,7 @@ void clipMv( Mv& rcMv, const Position& pos,
#endif
const SPS& sps )
{
int iMvShift = 2;
iMvShift += VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
int iMvShift = MV_FRACTIONAL_BITS_INTERNAL;
int iOffset = 8;
int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - ( int ) pos.x - 1 ) << iMvShift;
int iHorMin = ( -( int ) sps.getMaxCUWidth() - iOffset - ( int ) pos.x + 1 ) << iMvShift;
......
......@@ -47,9 +47,20 @@
// Class definition
// ====================================================================================================================
enum MvPrecision
{
MV_PRECISION_4PEL = 0, // 4-pel
MV_PRECISION_INT = 2, // 1-pel, shift 2 bits from 4-pel
MV_PRECISION_QUARTER = 4, // 1/4-pel (the precision of regular MV difference signaling), shift 4 bits from 4-pel
MV_PRECISION_INTERNAL = 6, // 1/16-pel (the precision of internal MV), shift 6 bits from 4-pel
};
/// basic motion vector class
class Mv
{
private:
static const MvPrecision m_amvrPrecision[3];
public:
int hor; ///< horizontal component of motion vector
int ver; ///< vertical component of motion vector
......@@ -159,16 +170,39 @@ public:
return Mv( mvx, mvy );
}
void roundMV2SignalPrecision()
void changePrecision(const MvPrecision& src, const MvPrecision& dst)
{
const int shift = (int)dst - (int)src;
if (shift >= 0)
{
*this <<= shift;
}
else
{
const int rightShift = -shift;
const int nOffset = 1 << (rightShift - 1);
hor = hor >= 0 ? (hor + nOffset) >> rightShift : -((-hor + nOffset) >> rightShift);
ver = ver >= 0 ? (ver + nOffset) >> rightShift : -((-ver + nOffset) >> rightShift);
}
}
void changePrecisionAmvr(const int amvr, const MvPrecision& dst)
{
changePrecision(m_amvrPrecision[amvr], dst);
}
void roundToPrecision(const MvPrecision& src, const MvPrecision& dst)
{
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);
changePrecision(src, dst);
changePrecision(dst, src);
}
void roundToAmvrSignalPrecision(const MvPrecision& src, const int amvr)
{
roundToPrecision(src, m_amvrPrecision[amvr]);
}
};// END CLASS DEFINITION MV
#if JVET_L0293_CPR
namespace std
{
......@@ -182,7 +216,6 @@ namespace std
};
};
#endif
void roundMV( Mv& rcMv, unsigned imvShift );
void clipMv ( Mv& rcMv, const struct Position& pos,
#if JVET_L0231_WRAPAROUND
const struct Size& size,
......
This diff is collapsed.
......@@ -409,7 +409,7 @@ void getAndStoreBlockStatistics(const CodingStructure& cs, const UnitArea& ctuAr
void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
{
const int maxNumChannelType = cs.pcv->chrFormat != CHROMA_400 && CS::isDualITree( cs ) ? 2 : 1;
const int nShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
const int nShift = MV_FRACTIONAL_BITS_DIFF;
const int nOffset = 1 << (nShift - 1);
for( int ch = 0; ch < maxNumChannelType; ch++ )
{
......@@ -682,7 +682,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
const int nShift = VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
const int nShift = MV_FRACTIONAL_BITS_DIFF;
const int nOffset = 1 << (nShift - 1);
const int maxNumChannelType = cs.pcv->chrFormat != CHROMA_400 && CS::isDualITree(cs) ? 2 : 1;
......
......@@ -656,18 +656,15 @@ 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];
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;
mvLT.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
mvRT.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
Mv mvLB;
if ( cu.affineType == AFFINEMODEL_6PARAM )
{
mvLB = affineAMVPInfo.mvCandLB[mvp_idx] + pu.mvdAffi[eRefList][2];
mvLB += pu.mvdAffi[eRefList][0];
mvLB.hor = mvLB.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvLB.ver = mvLB.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvLB.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
}
PU::setAllAffineMv( pu, mvLT, mvRT, mvLB, eRefList );
}
......@@ -691,15 +688,13 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#if REUSE_CU_RESULTS
if (!cu.cs->pcv->isEncoder)
#endif
mvd <<= 2;
mvd.changePrecision(MV_PRECISION_INT, MV_PRECISION_QUARTER);
}
pu.mv [eRefList] = amvpInfo.mvCand[pu.mvpIdx[eRefList]] + mvd;
#else
pu.mv [eRefList] = amvpInfo.mvCand[pu.mvpIdx [eRefList]] + pu.mvd[eRefList];
#endif
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;
pu.mv[eRefList].changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
}
}
}
......
This diff is collapsed.
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