VTM3.0代码阅读:运动补偿MC时xPredInterBlk函数

本文主要探讨了VTM3.0中用于非Affine帧间预测模式的xPredInterBlk函数,该函数负责根据运动信息进行像素预测。通过filterHor和filterVer实现亚像素插值,获取预测像素pred。相比于VTM1,该函数新增了与BIO(Bidirectional Interpolation Offset)相关的代码,但具体BIO机制暂未深入讲解。
摘要由CSDN通过智能技术生成

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值