在HEVC 参考代码中,一个CTU块通过xcompressCU()函数进行CU递归得到最优的CU深度。

递归的过程可如下图(from:Fast CU Splitting and Pruning for Suboptimal CU Partitioning in HEVC Intra Coding)所示。图中每一个方框表示一个CU块,方框内的数字表示xcompressCU()函数的执行顺序。显而易见,如果能在做xcompressCU()函数之前,将CU的递归深度确定下,显然可以减小HEVC编码器的复杂度。

针对帧内编码器,已经有很多文献提出了提前确定CU递归深度的方法。这里介绍了"Fast CU Size Decision and Mode Decision Algorithm for HEVC Intra Coding"中Section II.A部分的具体实现。在这篇文献中,周边块的CTU depth size用来给当前块深度进行预测。具体的细节可以去查看该文献。

Void TEncCu::compressCU( TComDataCU*& rpcCU )
{// initialize CU datam_ppcBestCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );memset( m_preAnalyzeDepth,       0, rpcCU->getTotalNumPart() );memset( m_preAnaDepthDetermined, 0, rpcCU->getTotalNumPart() );memset( m_preAnaDepthRange     , 0, rpcCU->getTotalNumPart() );// Neighboring CTUs.TComDataCU* t_pcCULeft      = rpcCU->getCULeft();TComDataCU* t_pcCUAbove     = rpcCU->getCUAbove();TComDataCU* t_pcCUAboveLeft = rpcCU->getCUAboveLeft();TComDataCU* t_pcCUAboveRight= rpcCU->getCUAboveRight();UInt DepthLeft       = 0;       // Max Depth of LeftCTU.UInt DepthAbove      = 0;       // Max Depth of AboveCTU.UInt DepthAboveLeft  = 0;UInt DepthAboveRight = 0;UInt picWidth  = rpcCU->getSlice()->getSPS()->getPicWidthInLumaSamples();UInt picHeight = rpcCU->getSlice()->getSPS()->getPicHeightInLumaSamples();UInt uiLPelX   = rpcCU->getCUPelX();UInt uiRPelX   = uiLPelX + rpcCU->getWidth(0)  - 1;UInt uiTPelY   = rpcCU->getCUPelY();UInt uiBPelY   = uiTPelY + rpcCU->getHeight(0) - 1;UChar    tDepth;m_insidePicture= (uiRPelX<picWidth) && (uiBPelY<picHeight);// Considering Border CTUs.if ( t_pcCULeft!=NULL ) //获取左边CTU块最大的depth信息{for ( Int i=0; i<256; i++ ){tDepth    = t_pcCULeft->getDepth(i);if ( tDepth>DepthLeft ){DepthLeft = (UInt)tDepth;}}}elseDepthLeft = 2; //如果是NULL,直接赋值2(16X16)if ( t_pcCUAbove!=NULL ){for ( Int i=0; i<256; i++ ){tDepth    = t_pcCUAbove->getDepth(i);if ( tDepth>DepthAbove ){DepthAbove = (UInt)tDepth;}}}elseDepthAbove = 2;if ( t_pcCUAboveLeft!=NULL ){DepthAboveLeft = t_pcCUAboveLeft->getDepth(g_auiRasterToZscan[16*15+15]);}elseDepthAboveLeft = 2;if ( t_pcCUAboveRight!=NULL ){DepthAboveRight = t_pcCUAboveRight->getDepth(g_auiRasterToZscan[16*15]);}elseDepthAboveRight = 2;Double DepthPre = 0.3*DepthLeft+0.3*DepthAbove+0.2*DepthAboveLeft+0.2*DepthAboveRight; // 论文中Prediction Depth Typeif ( DepthPre<=0.5 ) // 依据论文中的公式给出最小的depth level和最大的depth level{memset( m_preAnaDepthDetermined, 1, 256 );memset( m_preAnaDepthRange,      2, 256 );memset( m_preAnalyzeDepth,       0, 256 );}else if ( DepthPre<=1.5 ){memset( m_preAnaDepthDetermined, 1, 256 );memset( m_preAnaDepthRange,      3, 256 );memset( m_preAnalyzeDepth,       0, 256 );}else{memset( m_preAnaDepthDetermined, 1, 256 );memset( m_preAnaDepthRange,      3, 256 );memset( m_preAnalyzeDepth,       1, 256 );}DEBUG_STRING_NEW(sDebug)xCompressCU( m_ppcBestCU[0], m_ppcTempCU[0], 0 DEBUG_STRING_PASS_INTO(sDebug) );DEBUG_STRING_OUTPUT(std::cout, sDebug)// Double Check.UInt MaxDepthSize=0;// UInt CTUPelX, CTUPelY;if ( m_insidePicture ){for ( Int i=0; i<256; i++ ){// Decisioned.tDepth    = m_ppcBestCU[0]->getDepth(i);UChar cuDepth         = m_preAnalyzeDepth[i];UChar cuPreDetermined = m_preAnaDepthDetermined[i];UChar cuRange         = m_preAnaDepthRange[i];if ( tDepth<cuDepth && tDepth>=cuDepth+cuRange ){assert(0);}}}#if ADAPTIVE_QP_SELECTIONif( m_pcEncCfg->getUseAdaptQpSelect() ){if(rpcCU->getSlice()->getSliceType()!=I_SLICE) //IIII{xLcuCollectARLStats( rpcCU);}}
#endif
}

在xcompressCU函数中加入相关条件跳转。

 // If slice start or slice end is within this cu...TComSlice * pcSlice = rpcTempCU->getPic()->getSlice(rpcTempCU->getPic()->getCurrSliceIdx());Bool bSliceStart = pcSlice->getSliceSegmentCurStartCUAddr()>rpcTempCU->getSCUAddr()&&pcSlice->getSliceSegmentCurStartCUAddr()<rpcTempCU->getSCUAddr()+rpcTempCU->getTotalNumPart();Bool bSliceEnd = (pcSlice->getSliceSegmentCurEndCUAddr()>rpcTempCU->getSCUAddr()&&pcSlice->getSliceSegmentCurEndCUAddr()<rpcTempCU->getSCUAddr()+rpcTempCU->getTotalNumPart());Bool bInsidePicture = ( uiRPelX < rpcBestCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < rpcBestCU->getSlice()->getSPS()->getPicHeightInLumaSamples() );// Fast CU decision Process.// When Current depth is not in the PreAnalyzedDepth Range, it just skips the PU/TU Decision process.// Added by xfHuang.Bool t_enCUSkip=false;if ( m_insidePicture ){// Split Analysis For CU32X32 And CU16X16.if ( checkCurDepthInPreAnaRange( rpcBestCU, uiDepth ) == false ) //如果当前的depth level不在预测的depth level之内,后面直接将cost赋值成最大,不进行后面的预测操作。{t_enCUSkip = true;rpcBestCU->getTotalCost() = MAX_DOUBLE/16;rpcBestCU->getTotalDistortion() = MAX_UINT>>3;rpcBestCU->getTotalBits() = MAX_UINT>>3;// avoid assert disable.if ( uiDepth==3 ){rpcBestCU->setPartitionSize ( 0, SIZE_2Nx2N );      rpcBestCU->setPredictionMode( 0, MODE_INTRA );    }}}// We need to split, so don't try these modes.if(!bSliceEnd && !bSliceStart && bInsidePicture ){if( t_enCUSkip==false ){for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++){const Bool bIsLosslessMode = isAddLowestQP && (iQP == iMinQP);if (bIsLosslessMode){iQP = lowestQP;}rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );

其中checkCurDepthInPreAnaRange函数如下:

Bool TEncCu::checkCurDepthInPreAnaRange( TComDataCU*& pCU, UInt uidepth )
{UChar cuDepth         = m_preAnalyzeDepth[pCU->getZorderIdxInCU()];UChar cuPreDetermined = m_preAnaDepthDetermined[pCU->getZorderIdxInCU()];UChar cuRange         = m_preAnaDepthRange[pCU->getZorderIdxInCU()];assert(cuDepth+cuRange<=5);if ( /*cuPreDetermined &&*/ uidepth>=cuDepth && uidepth<cuDepth+cuRange ){return true;}else{return false;}
}

以上是一种基于周边CTU块信息来进行CU深度优化的一种方法。这个方法对于大部分来说只是不做64X64这一层depth,因此性能损失很小,平均大概在0.2%左右。时间可以节省10%左右。

[转载请注明作者和出处]

Fast CU Depth Decision Algorithm for HEVC Intra Coding相关推荐

  1. HM 复现论文 ——《Fast Intra Mode Decision for High Efficiency Video Coding》

    在大致了解了 HEVC 编码标准后,这段时间我也开始尝试在 HM-16.22 中复现一些算法.这篇博客主要用于记录进一个月来的工作情况. 复现的论文标题为 Fast Intra Mode Decisi ...

  2. 【去雾论文阅读】A Novel Fast Single Image Dehazing Algorithm Based on Artificial Multiexposure Image Fusion

    题目:A Novel Fast Single Image Dehazing Algorithm Based on Artificial Multiexposure Image Fusion 作者:Zh ...

  3. HEVC intra MPM

    编码帧内预测模式 大量增加可选择的预测模式可以提供更高的编码效率,同时要求编码预测模式有更加高效的方法降低更多模式带来的负担.与H.264采用一个最可能模式不同的是,对于亮度分量,三个最可能模式用于预 ...

  4. HEVC intra和inter码率控制的不同

    在compressGOP()函数中 compressGOP() {...for (Int iGOPid=0;iGOPid<m_iGopSize;iGOPid++){m_pcSliceEncode ...

  5. 【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》

    ICRA-2019 文章目录 1 Background and Motivation 2 Related Work 3 Advantages / Contributions 4 Method 5 Ex ...

  6. 视觉(5)A Fast Area-Based Stereo Matching Algorithm

    L. Di Stefano, M. Marchionni, S. Mattoccia, G. Neri 1. DEIS-ARCES, University of Bologna 本文主要介绍了基于SA ...

  7. 南华大学计算机学院龚向坚,李跃-计算机科学与技术学院

    李跃,男,1988年出生,教授(校聘),硕士研究生导师,湖南大学计算机科学与技术专业博士,新加坡南洋理工大学访问学生.主要研究方向为人工智能(计算机视觉).视频编码及3D点云压缩.在国内外期刊发表论文 ...

  8. Deep Learning-Based Video Coding: A Review and A Case Study

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! 1.Abstract: 本文主要介绍的是2015年以来关于深度图像/视频编码的代表性工作,主要可以分为两类:深度编码方案以及基于传统编码方 ...

  9. 南京大学计算机学院宋教授,宋云教授

    [1]. 宋云,李雪玉,沈燕飞,杨高波.基于非局部相似块低秩的压缩感知图像重建算法.电子学报, 45(3):695-703, 2017. (中文权威,EI) [2]. 宋云,沈燕飞,龙际珍,朱珍民.基 ...

最新文章

  1. linux 日志文件utmp、wtmp、lastlog、messages介绍
  2. 高端第一后,卡萨帝又将靠场景化引领冰箱行业
  3. OpenResty+lua+GraphicsMagick生成缩略图
  4. 【Pytorch神经网络理论篇】 12 卷积神经网络实现+卷积计算的图解
  5. VS Code前端开发利器-常用快捷键
  6. apicloud代码压缩和全局加密
  7. 《那些年啊,那些事——一个程序员的奋斗史》——54
  8. Java学习系列(十八)Java面向对象之基于UDP协议的网络通信
  9. Windows下杀进程的命令
  10. 电子产品可靠性测试报告
  11. 电脑使用技巧提升篇2:修改电脑桌面固定图标
  12. 大型通用ERP生产管理系统源码
  13. 设计心理学1_日常的设计 读后感
  14. fastboot 常用命令
  15. 录像机人机界面蓝屏怎么处理
  16. 在OPENSTACK中 WIN7和WIN2008 R2实例启动时蓝屏报 STOP:0X0000005DT
  17. 六爻:起卦、装卦、断卦
  18. Python面向对象编程(类编程)中self的含义详解(简单明了直击本质的解释)
  19. 中班音乐活动计算机反思,中班音乐活动教案及反思
  20. 征服变色龙-OpenSUSE

热门文章

  1. c语言函数重用,C语言第10讲--程序重用之函数(修改2).ppt
  2. 电力猫服务器的网页,电力猫性能测试平台、方法和环境
  3. 简七32堂极简理财课——模块二:理财规划,让你不再走弯路
  4. 苹果手机适配手写代码
  5. (C语言)数据结构算法-病毒感染检测(BF算法KMP算法)
  6. 推荐系统模型训练DeepFM算法
  7. 应用在智能手表中的加密设置
  8. 部署DLL和安装windows服务的两个命令
  9. 27-物流管理系统数据库-车队信息数据操作
  10. excel数据导入mysql被截取,从EXCEL导入数据库数值型都被四舍五入了-excel导入mysql数据库...