VVC/VTM 4.2 帧内编码——亮度预测理解

xCompressCU是VVC/VTM帧内编码的关键,负责CTU的递归划分。通过初始化、遍历帧内模式并调用xCheckModeSplit及xCheckRDCostIntra进行宏块划分和预测,最后记录最优CU信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

xCompressCU()是帧内编码的核心函数,它把从上层函数compressCtu()得到的基本编码单元CTU递归地用函数xCheckModeSplit()进行宏块划分。在此过程中,xCheckModeSplit()会调用xCompressCU ()。

xCompressCU()函数

xCompressCU()函数的主要流程如下:
1、初始化:设置各种可用模式,上下文模型等;
2、遍历各种帧内模式,遍历完成后,调用xCheckModeSplit()函数递归进行宏块划分,调用xCheckRDCostIntra()函数进行帧内模式的遍历,进行帧内预测;
3、结束,设置状态,记录最优CU信息;

代码如下:

void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner )
{
  if (m_shareState == NO_SHARE)
  {
    tempCS->sharedBndPos = tempCS->area.Y().lumaPos();
    tempCS->sharedBndSize.width = tempCS->area.lwidth();
    tempCS->sharedBndSize.height = tempCS->area.lheight();
    bestCS->sharedBndPos = bestCS->area.Y().lumaPos();
    bestCS->sharedBndSize.width = bestCS->area.lwidth();
    bestCS->sharedBndSize.height = bestCS->area.lheight();
  }
#if ENABLE_SPLIT_PARALLELISM
  CHECK( m_dataId != tempCS->picture->scheduler.getDataId(), "Working in the wrong dataId!" );

  if( m_pcEncCfg->getNumSplitThreads() != 1 && tempCS->picture->scheduler.getSplitJobId() == 0 )
  {
    if( m_modeCtrl->isParallelSplit( *tempCS, partitioner ) )
    {
      m_modeCtrl->setParallelSplit( true );
      xCompressCUParallel( tempCS, bestCS, partitioner );
      return;
    }
  }

#endif

  Slice&   slice      = *tempCS->slice;  //当前所处的slice
  const PPS &pps      = *tempCS->pps;   //当前所处的pps
  const SPS &sps      = *tempCS->sps;   //当前所处的sps
  const uint32_t uiLPelX  = tempCS->area.Y().lumaPos().x;//左上x
  const uint32_t uiTPelY  = tempCS->area.Y().lumaPos().y;//左上y

  const UnitArea currCsArea = clipArea( CS::getArea( *bestCS, bestCS->area, partitioner.chType ), *tempCS->picture );

  tempCS->chType = partitioner.chType;
  bestCS->chType = partitioner.chType;
  m_modeCtrl->initCULevel( partitioner, *tempCS );
  if( partitioner.currQtDepth == 0 && partitioner.currMtDepth == 0 && !tempCS->
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值