VTM3.0代码阅读:xRecurIntraCodingLumaQT函数

xRecurIntraCodingLumaQT是lumaIntra预测模式中最后进行RDO选最优模式的主要函数,xRecurIntraCodingLumaQT函数的作用就是计算一个具体的lumaIntra模式时的cost。
由于函数中涉及到很多的tu块变换方面的知识,没有太懂,以后对VTM变换量化方面看懂之后补充
本函数和VTM1中没有太大区别:
VTM1.0代码阅读:xRecurIntraCodingLumaQT函数

void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &partitioner )
{
   
  const UnitArea &currArea = partitioner.currArea();		//当前处理区域
  const CodingUnit &cu     = *cs.getCU(currArea.lumaPos(), partitioner.chType);
  uint32_t     currDepth   = partitioner.currTrDepth;		//当前tu的划分深度
  const PPS &pps           = *cs.pps;
  const bool keepResi      = pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() || KEEP_PRED_AND_RESI_SIGNALS;
  bool bCheckFull          = true;		//是否需要进行tu划分
  bool bCheckSplit         = false;
  bCheckFull               = cs.pcv->noRQT && !partitioner.canSplit( TU_MAX_TR_SPLIT, cs );
  bCheckSplit              = cs.pcv->noRQT &&  partitioner.canSplit( TU_MAX_TR_SPLIT, cs );

  uint32_t    numSig           = 0;

  if( !cs.pcv->noRQT )
  {
   
  }

  bool    checkInitTrDepth = false, checkInitTrDepthTransformSkipWinner = false;

  double     dSingleCost                        = MAX_DOUBLE;	//记录最优变换模式的cost等
  Distortion uiSingleDistLuma                   = 0;
  uint64_t     singleFracBits                   = 0;
  bool       checkTransformSkip                 = pps.getUseTransformSkip();	//是否用TS模式
  int        bestModeId[MAX_NUM_COMPONENT]      = {
   0, 0, 0};	//Y/Cb/Cr三个通道的最优变换模式
  uint8_t      nNumTransformCands               = cu.emtFlag ? 4 : 1; //4 is the number of transforms of emt
  bool       isAllIntra                         = m_pcEncCfg->getIntraPeriod() == 1;

  uint8_t numTransformIndexCands                  = nNumTransformCands;

  const TempCtx ctxStart  ( m_CtxCache, m_CABACEstimator->getCtx() );
  TempCtx       ctxBest   ( m_CtxCache );

  CodingStructure *csSplit = nullptr;
  CodingStructure *csFull  = nullptr;

  if( bCheckSplit )
  {
   
    csSplit = &cs;
  }
  else if( bCheckFull )
  {
   
    csFull = &cs;
  }

  if( bCheckFull )					//不进行tu的划分
  {
   
    csFull->cost = 0.0;

    TransformUnit &tu = csFull->addTU( CS::getArea( *csFull, currArea, partitioner.chType ), partitioner.chType );
    tu.depth = currDepth;

    checkTransformSkip &= TU::hasTransformSkipFlag
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值