VTM3.0代码阅读:getIntraMPMs函数

getIntraMPMs在estIntraPredLumaQT函数中被调用,用来获取MPM候选模式,MPM模式存储在mpm中。
流程大致为:获取左侧和上侧的pu帧内预测模式,然后按照left和above模式的情况,给mpm列表赋值。
MPM列表长度为6。由于宏JVET_L0165_6MPM开启,所以删掉了一些无用的代码。

int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType &channelType /*= CHANNEL_TYPE_LUMA*/ )
{
   
  const int numMPMs = NUM_MOST_PROBABLE_MODES;		//6
#if JVET_L0283_MULTI_REF_LINE							//MRL	
  const int extendRefLine = (channelType == CHANNEL_TYPE_LUMA) ? pu.multiRefIdx : 0;
#endif
  {
   
    int numCand      = -1;

    int leftIntraDir = PLANAR_IDX, aboveIntraDir = PLANAR_IDX;

    const CompArea &area = pu.block(getFirstComponentOfChannel(channelType));
    const Position posRT = area.topRight();
    const Position posLB = area.bottomLeft();		//右上、左下坐标

    // Get intra direction of left PU	左侧pu
    const PredictionUnit *puLeft = pu.cs->getPURestricted(posLB.offset(-1, 0), pu, channelType);
    if (puLeft && CU::isIntra(*puLeft->cu))
    {
   
      leftIntraDir = puLeft->intraDir[channelType];		//左侧pu的帧内模式
    }

    // Get intra direction of above PU	上侧pu
    const PredictionUnit *puAbove = pu.cs->getPURestricted(posRT.offset(0, -1), pu, channelType);
    if (puAbove && CU::isIntra(*puAbove->cu) && CU::isSameCtu(*pu.cu, *puAbove->cu))
    {
   
      aboveIntraDir = puAbove->intraDir[channelType];	//上侧pu的帧内模式
    }

    CHECK(2 >= numMPMs, "Invalid number of most probable modes");

    const int offset = (int)NUM_LUMA_MODE - 6;	//67-6
    const int mod = offset + 3;					//61+3
											/然后根据左侧和上侧pu的亮度帧内模式,构建mpm列表
#if JVET_L0283_MULTI_REF_LINE
    if (extendRefLine)				//MRL
    {
   
      int modeIdx = 0;
      int angularMode[2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值