VTM3.0代码阅读:xCompressCU函数

xCompressCU函数通过递归实现CU(Coding Unit)压缩,内部调用xCheckModeSplit进行更细粒度划分。tempCS保存不同模式处理结果,若其成本低于bestCS,则替换bestCS;否则舍弃。bestCS始终记录当前找到的最佳划分和模式。

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

xCompressCU函数会进行递归调用,其中的xCheckModeSplit函数会调用xCompressCU试着把当前cu进行更进一步的划分。
tempCS用来存储当前compress区域的各种模式下处理得到的数据,如果tempCS的cost小于bestCS,那么swap给bestCS;如果差于bestCS,那么丢弃tempCS中数据。
bestCS在xCompressCU函数中的任何位置,都用来存储到目前为止所得到的最优划分和最优模式数据。

//传入的tempLUT和bestLUT表示编码当前块之前所维护的HMVP列表信息
void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner
#if JVET_L0266_HMVP
  , LutMotionCand *&tempMotCandLUTs
  , LutMotionCand *&bestMotCandLUTs
#endif
)
{
   

  Slice&   slice      = *tempCS->slice;
  const PPS &pps      = *tempCS->pps;
  const SPS &sps      = *tempCS->sps;
  const uint32_t uiLPelX  = tempCS->area.Y().lumaPos().x;
  const uint32_t uiTPelY  = tempCS->area.Y().lumaPos().y;

  const unsigned wIdx = gp_sizeIdxInfo->idxFrom( partitioner.currArea().lwidth()  );
																//当前compress的cu的区域
  const UnitArea currCsArea = clipArea( CS::getArea( *bestCS, bestCS->area, partitioner.chType ), *tempCS->picture );
  if( m_pImvTempCS && !slice.isIntra() )
  {
   
    const unsigned maxMEPart = tempCS->pcv->only2Nx2N ? 1 : NUMBER_OF_PART_SIZES;
    for( unsigned p = 0; p < maxMEPart; p++ )
    {
   
      tempCS->initSubStructure( *m_pImvTempCS[wIdx][p], partitioner.chType, partitioner.currArea(), false );
    }
  }

#if JVET_L0293_CPR
  tempCS->chType = partitioner.chType;
  bestCS->chType = partitioner.chType;
#endif
  m_modeCtrl->initCULevel( partitioner, *tempCS );		//该函数对m_modeCtrl进行初始化,对需要test的各种模式进行压栈等操作

  m_CurrCtx->start = m_CABACEstimator->getCtx();

  m_cuChromaQpOffsetIdxPlus1 = 0;

  if( slice.getUseChromaQpAdj() 
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值