Commit dc921d63 authored by Johannes Sauer's avatar Johannes Sauer

added REMOVE_MV_ADAPT_PREC for CPR/IBC

parent c180eab1
......@@ -942,7 +942,12 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
const CompArea lumaArea = CompArea(COMPONENT_Y, pu.chromaFormat, pu.Cb().lumaPos(), recalcSize(pu.chromaFormat, CHANNEL_TYPE_CHROMA, CHANNEL_TYPE_LUMA, pu.Cb().size()));
const MotionInfo &curMi = pu.cs->picture->cs->getMotionInfo(Position{ lumaArea.x, lumaArea.y });
Mv bv = curMi.mv[0];
bv.setLowPrec();
#if REMOVE_MV_ADAPT_PREC
bv.hor = bv.hor >= 0 ? (bv.hor + nOffset) >> nShift : -((-bv.hor + nOffset) >> nShift);
bv.ver = bv.ver >= 0 ? (bv.ver + nOffset) >> nShift : -((-bv.ver + nOffset) >> nShift);
#else
bv.setLowPrec();
#endif
bv.hor = bv.hor >> ::getChannelTypeScaleX( ChannelType( chType ), cu.chromaFormat );
bv.ver = bv.ver >> ::getChannelTypeScaleY( ChannelType( chType ), cu.chromaFormat );
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::IBC_BV_Chroma), bv.hor, bv.ver);
......
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