xPredInterBlk函数在pu块的运动补偿的时候被调用,处理非Affine帧间预测模式时的运动补偿任务,根据运动信息获取预测像素pred。
xPredInterBlk调用了filterHor和filterVer进行pu参考块位置的亚像素插值,得到pu预测像素。
与VTM1相比,函数中多了一些BIO的一些代码,BIO代码以后理解。
运动补偿函数见: VTM3.0代码阅读:motionCompensation函数
void InterPrediction::xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng
#if JVET_L0256_BIO
, const bool& bioApplied
#endif
#if JVET_L0293_CPR
, bool isCPR
#endif
)
{
JVET_J0090_SET_REF_PICTURE( refPic, compID );
const ChromaFormat chFmt = pu.chromaFormat;
const bool rndRes = !bi; //bi表示xPredInterBlk之后是否还需要进行加权预测
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);
int xFrac = _mv.hor & ((1 << shiftHor) - 1);
int yFrac = _mv.ver & ((1 << shiftVer) - 1