Commit 76e6c346 authored by Yan Zhang's avatar Yan Zhang

High precision mv straoge fix

Fix the GCC version mismatch by replacing the overpoaded operators with
default operators
parent f3c52a4a
......@@ -110,7 +110,7 @@ RCForceIntraQP : 0 # Rate control: force int
#============ JEM settings ======================
LoopFilterTcOffset_div2 : 0
SEIDecodedPictureHash : 0
SEIDecodedPictureHash : 1
CbQpOffset : 0
CrQpOffset : 0
......
......@@ -770,7 +770,9 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.cu->ibc = true;
pu.bv = pu.mv[REF_PIC_LIST_0];
#if REMOVE_MV_ADAPT_PREC
pu.bv >>= (2 + VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE);
const int shift = 2 + VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
pu.bv.hor = pu.bv.hor >> shift;
pu.bv.ver = pu.bv.ver >> shift;
#else
pu.bv >>= 2; // used for only integer resolution
#endif
......
......@@ -4421,7 +4421,9 @@ void InterPrediction::xBIPMVRefine(PredictionUnit& pu, uint32_t nSearchStepShift
for (SAD_POINT_INDEX nIdx = SAD_POINT_INDEX::BOTTOM; nIdx <= SAD_POINT_INDEX::TOP_LEFT; ++nIdx)
{
#if REMOVE_MV_ADAPT_PREC
Mv cMvDL0(m_pSearchOffset[nIdx]);
Mv cMvDL0;
cMvDL0.hor = m_pSearchOffset[nIdx].hor;
cMvDL0.ver = m_pSearchOffset[nIdx].ver;
#else
Mv cMvDL0(m_pSearchOffset[nIdx], cMvOrgL0.highPrec);
#endif
......@@ -4537,7 +4539,9 @@ void InterPrediction::xBIPMVRefine(PredictionUnit& pu, uint32_t nSearchStepShift
for (SAD_POINT_INDEX nIdx = SAD_POINT_INDEX::BOTTOM; nIdx <= SAD_POINT_INDEX::LEFT; ++nIdx)
{
#if REMOVE_MV_ADAPT_PREC
Mv cMvDL0(m_pSearchOffset[nIdx]);
Mv cMvDL0;
cMvDL0.hor = m_pSearchOffset[nIdx].hor;
cMvDL0.ver = m_pSearchOffset[nIdx].ver;
#else
Mv cMvDL0(m_pSearchOffset[nIdx], cMvOrgL0.highPrec);
#endif
......@@ -4629,7 +4633,9 @@ void InterPrediction::xGenerateFracPixel(PredictionUnit& pu, uint32_t nSearchSte
const uint32_t bufferHeight = cuHeight + 1;
//(0,-/+1)
#if REMOVE_MV_ADAPT_PREC
Mv cMvL0(cMvOrgL0 + Mv(0, -1 << nSearchStepShift));
Mv cMvL0;
cMvL0.hor = cMvOrgL0.hor;
cMvL0.ver = cMvOrgL0.ver + (-1 << nSearchStepShift);
#else
Mv cMvL0(cMvOrgL0 + Mv(0, -1 << nSearchStepShift, cMvOrgL0.highPrec));
#endif
......@@ -4643,7 +4649,9 @@ void InterPrediction::xGenerateFracPixel(PredictionUnit& pu, uint32_t nSearchSte
, cuHeight + 1
);
#if REMOVE_MV_ADAPT_PREC
Mv cMvL1(cMvOrgL1 + Mv(0, -1 << nSearchStepShift));
Mv cMvL1;
cMvL1.hor = cMvOrgL1.hor;
cMvL1.ver = cMvOrgL1.ver + (-1 << nSearchStepShift);
#else
Mv cMvL1(cMvOrgL1 + Mv(0, -1 << nSearchStepShift, cMvOrgL1.highPrec));
#endif
......@@ -4658,7 +4666,8 @@ void InterPrediction::xGenerateFracPixel(PredictionUnit& pu, uint32_t nSearchSte
);
//(-/+1,0)
#if REMOVE_MV_ADAPT_PREC
cMvL0 = cMvOrgL0 + Mv(-1 << nSearchStepShift, 0);
cMvL0.ver = cMvOrgL0.ver;
cMvL0.hor = cMvOrgL0.hor + (-1 << nSearchStepShift);
#else
cMvL0 = cMvOrgL0 + Mv(-1 << nSearchStepShift, 0, cMvOrgL0.highPrec);
#endif
......@@ -4672,7 +4681,8 @@ void InterPrediction::xGenerateFracPixel(PredictionUnit& pu, uint32_t nSearchSte
, cuHeight
);
#if REMOVE_MV_ADAPT_PREC
cMvL1 = cMvOrgL1 + Mv(-1 << nSearchStepShift, 0);
cMvL1.ver = cMvOrgL1.ver;
cMvL1.hor = cMvOrgL1.hor + (-1 << nSearchStepShift);
#else
cMvL1 = cMvOrgL1 + Mv(-1 << nSearchStepShift, 0, cMvOrgL1.highPrec);
#endif
......@@ -4787,13 +4797,17 @@ void InterPrediction::xProcessDMVR( PredictionUnit& pu, PelUnitBuf &pcYuvDst, co
DistParam cDistParam;
MRSADtype minCost = std::numeric_limits<MRSADtype>::max();
#if REMOVE_MV_ADAPT_PREC
const Mv mvBlkExt(m_searchRange << searchStepShift);
Mv mvBlkExt;
mvBlkExt.hor = m_searchRange << searchStepShift;
mvBlkExt.ver = m_searchRange << searchStepShift;
#else
const Mv mvBlkExt(m_searchRange << searchStepShift, pu.mv[REF_PIC_LIST_0].highPrec);
#endif
const SizeType MC_extension = m_searchRange << 1;
#if REMOVE_MV_ADAPT_PREC
const Mv searchOffsetMv(-(int32_t)(m_searchRange << searchStepShift));
Mv searchOffsetMv;
searchOffsetMv.hor = -(int32_t)(m_searchRange << searchStepShift);
searchOffsetMv.ver = -(int32_t)(m_searchRange << searchStepShift);
#else
const Mv searchOffsetMv(-(int32_t)(m_searchRange << searchStepShift), pu.mv[REF_PIC_LIST_0].highPrec);
#endif
......
......@@ -2473,7 +2473,8 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
verTmp = iMvScaleVer + iDMvHorY * (posCurX - posNeiX) + iDMvVerY * (posCurY - posNeiY);
roundAffineMv( horTmp, verTmp, shift );
#if REMOVE_MV_ADAPT_PREC
rcMv[0] = Mv(horTmp, verTmp);
rcMv[0].hor = horTmp;
rcMv[0].ver = verTmp;
#else
rcMv[0] = Mv(horTmp, verTmp, true);
#endif
......@@ -2483,7 +2484,8 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
verTmp = iMvScaleVer + iDMvHorY * (posCurX + curW - posNeiX) + iDMvVerY * (posCurY - posNeiY);
roundAffineMv( horTmp, verTmp, shift );
#if REMOVE_MV_ADAPT_PREC
rcMv[1] = Mv(horTmp, verTmp);
rcMv[1].hor = horTmp;
rcMv[1].ver = verTmp;
#else
rcMv[1] = Mv(horTmp, verTmp, true);
#endif
......@@ -2496,7 +2498,8 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
verTmp = iMvScaleVer + iDMvHorY * (posCurX - posNeiX) + iDMvVerY * (posCurY + curH - posNeiY);
roundAffineMv( horTmp, verTmp, shift );
#if REMOVE_MV_ADAPT_PREC
rcMv[2] = Mv(horTmp, verTmp);
rcMv[2].hor = horTmp;
rcMv[2].ver = verTmp;
#else
rcMv[2] = Mv(horTmp, verTmp, true);
#endif
......@@ -4223,9 +4226,12 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
#if REMOVE_MV_ADAPT_PREC
if (setHighPrec)
{
affLT <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affRT <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affLB <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affLT.hor = affLT.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affLT.ver = affLT.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affRT.hor = affRT.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affRT.ver = affRT.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affLB.hor = affLB.hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
affLB.ver = affLB.ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
}
#else
affLT.setHighPrec();
......@@ -4280,7 +4286,8 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
for ( int x = (w >> MIN_CU_LOG2); x < ((w + blockHeight) >> MIN_CU_LOG2); x++ )
{
#if REMOVE_MV_ADAPT_PREC
mb.at(x, y).mv[eRefList] = Mv(mvScaleTmpHor, mvScaleTmpVer);
mb.at(x, y).mv[eRefList].hor = mvScaleTmpHor;
mb.at(x, y).mv[eRefList].ver = mvScaleTmpVer;
#else
mb.at(x, y).mv[eRefList] = Mv(mvScaleTmpHor, mvScaleTmpVer, true);
#endif
......@@ -4897,7 +4904,8 @@ void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interP
pu.mvpIdx[0] = mvp_idx;
pu.mv [0] = amvpInfo.mvCand[mvp_idx] + pu.mvd[0];
#if REMOVE_MV_ADAPT_PREC
pu.mv[0] <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
pu.mv[0].hor = pu.mv[0].hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
pu.mv[0].ver = pu.mv[0].ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#endif
#if JVET_K0076_CPR
if (pu.interDir == 1 && pu.cs->slice->getRefPic(REF_PIC_LIST_0, pu.refIdx[REF_PIC_LIST_0])->getPOC() == pu.cs->slice->getPOC())
......@@ -4927,7 +4935,8 @@ void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interP
pu.mvpIdx[1] = mvp_idx;
pu.mv [1] = amvpInfo.mvCand[mvp_idx] + pu.mvd[1];
#if REMOVE_MV_ADAPT_PREC
pu.mv[1] <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
pu.mv[1].hor = pu.mv[1].hor << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
pu.mv[1].ver = pu.mv[1].ver << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#endif
}
}
......
......@@ -609,8 +609,10 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
mvRT += pu.mvdAffi[eRefList][0];
#endif
#if REMOVE_MV_ADAPT_PREC
mvLT <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
mvRT <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
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");
......@@ -626,7 +628,8 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
mvLB += pu.mvdAffi[eRefList][0];
#endif
#if REMOVE_MV_ADAPT_PREC
mvLB <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
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
......@@ -684,7 +687,8 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
if( pu.cs->sps->getSpsNext().getUseAffine() )
{
#if REMOVE_MV_ADAPT_PREC
pu.mv[eRefList] <<= VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
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
pu.mv[eRefList].setHighPrec();
#endif
......
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