HEVC代码学习12:xCheckRDCostInter函数
来源:互联网 发布:三件套女装秋装淘宝 编辑:程序博客网 时间:2024/05/21 04:22
之前的xCompressCU函数学习中,我们知道帧间每一个模式的选择都会调用xCheckRDCostInter函数,下面就来具体学习一下。
xCheckRDCostInter主要的功能是,进行帧间搜索,计算当前CU划分模式的RDcost
这样就找到了帧间搜索的入口函数:predInterSearch,下面将对他进行学习。其中调用的重要函数encodeResAndCalcRdInterCU可见:http://blog.csdn.net/lin453701006/article/details/77249344。
#if AMP_MRGVoid TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize DEBUG_STRING_FN_DECLARE(sDebug), Bool bUseMRG)#elseVoid TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize )#endif{ DEBUG_STRING_NEW(sTest) if(getFastDeltaQp()) //快速deltaQP模式,只有在2Nx2N的帧间模式中使用。 { const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); const UInt fastDeltaQPCuMaxSize = Clip3(sps.getMaxCUHeight()>>(sps.getLog2DiffMaxMinCodingBlockSize()), sps.getMaxCUHeight(), 32u); if(ePartSize != SIZE_2Nx2N || rpcTempCU->getWidth( 0 ) > fastDeltaQPCuMaxSize) { return; // only check necessary 2Nx2N Inter in fast deltaqp mode } } // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); //对rpcTempCU进行初始化 UChar uhDepth = rpcTempCU->getDepth( 0 ); rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); rpcTempCU->setChromaQpAdjSubParts( rpcTempCU->getCUTransquantBypass(0) ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );#if AMP_MRG //进行Inter整像素搜索 rpcTempCU->setMergeAMP (true); m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] DEBUG_STRING_PASS_INTO(sTest), false, bUseMRG );#else m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );#endif#if AMP_MRG if ( !rpcTempCU->getMergeAMP() ) { return; }#endif //计算普通Inter模式残差及RDcost m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false DEBUG_STRING_PASS_INTO(sTest) ); //存储总代价 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );#if DEBUG_STRING DebugInterPredResiReco(sTest, *(m_ppcPredYuvTemp[uhDepth]), *(m_ppcResiYuvBest[uhDepth]), *(m_ppcRecoYuvTemp[uhDepth]), DebugStringGetPredModeMask(rpcTempCU->getPredictionMode(0)));#endif //deltaQP检测 xCheckDQP( rpcTempCU ); //检测并设置最优模式 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest));}
阅读全文
0 0
- HEVC代码学习12:xCheckRDCostInter函数
- HEVC代码追踪(九):帧间->xCheckRDCostInter
- HEVC代码追踪(十一。一):运动估计/补偿之xCheckRDCostInter
- HEVC代码学习2:TAppEncTop::encode函数
- HEVC代码学习3:TEncTop::encode函数
- HEVC代码学习7:xPatternSearchFracDIF函数
- HEVC代码学习8:xMotionEstimation函数
- HEVC代码学习9:getInterMergeCandidates函数
- HEVC代码学习11:xCompressCU函数
- HEVC代码学习13:predInterSearch函数
- HEVC代码学习14:motionCompensation函数
- HEVC代码学习15:AMVP相关函数
- HEVC代码学习20:xPatternSearchFast函数
- HEVC代码学习21:xTZSearch函数
- HEVC代码学习22:xTZSearchHelp函数
- HEVC代码学习23:xTZ8PointDiamondSearch函数
- HEVC代码学习24:encodeResAndCalcRdInterCU函数
- HEVC代码学习25:xDecompressCU函数
- B1019. 数字黑洞 (20')
- Centos一键部署openstack RDO packstack
- 虚幻4相关的一些资料
- 理解tomcat之搭建简易http服务器
- 启动storm遇到的while scanning a simple key in 'reader', line 54, column 2: nimbus.host:"node1"
- HEVC代码学习12:xCheckRDCostInter函数
- Laravel5.4 发送mail邮件
- vim关于窗口分割的命令:
- 手机的web页面调用相机拍照上传
- NAT和代理服务器的原理及应用
- 面向过程和面向对象的理解
- Solr -- 查询语法/参数
- 小米手机-刷机日志
- H5Slides幻灯演示系统