文章目录

  • CodingUnit
  • PredictionUnit
  • TransformUnit

基本单元的结构体中,只定义了CU、PU、TU的属性信息,其头文件为Unit.h,对基本单元的操作定义在UnitTools.h中。命名空间CU中定义了对CodingUnit的操作,命名空间PUTU分别定义了在预测和量化中用到的方法。

CodingUnit

描述UnitArea定义的区域的压缩方法和方式。

struct CodingUnit : public UnitArea
{CodingStructure *cs;        // 父级CodingStructureSlice *slice;        // 指向CU所属sliceChannelType    chType;       // 颜色通道类型PredMode       predMode;       // 预测模式,帧内还是帧间uint8_t          depth;   // 总深度,为QTBTTT的深度,所有划分类型,一旦划分则+1uint8_t          qtDepth; // 四叉树深度//  btDepth和mtDepth都是描述MT的深度,在只有BT划分时,两者相等;但是CU使用TT划分时,两端的BTdepth将比mtdepth大1uint8_t          btDepth; // 二叉树深度uint8_t          mtDepth; // 多叉树深度int8_t          chromaQpAdj;           // 色度QP偏移值int8_t          qp;       // 实际编码QP值SplitSeries    splitSeries;             // 其二进制数标识生成当前CU尺寸时,CTU划分顺序bool           skip;                // 是否SKIP模式bool           mmvdSkip;         // 是否SKIP with MMVD模式bool           affine;         // 是否是affine 模式int            affineType;                // 仿射运动模型类型(四参数、六参数)bool           triangle;         // 是否三角形运动估计bool           transQuantBypass;         // 是否是transform 和 quantization pass bybool           ipcm;          // 是否 IPCM模式uint8_t          imv;         // 运动适量精度bool           rootCbf;         // coding block flag (三个通道都要为0,则为0)
#if JVET_M0140_SBTuint8_t        sbtInfo;                // sub-block transform 信息
#endif
#if HEVC_TILES_WPPuint32_t           tileIdx;
#endif
#if !JVET_M0464_UNI_MTSuint8_t          emtFlag;                      // 多核变换,变换核信息
#endifuint8_t         GBiIdx;         // generalized bi search?还未完全明白int             refIdxBi[2];         // 两个参考帧的索引// needed for fast imv mode decisionsint8_t          imvNumCand;
#if JVET_M0170_MRG_SHARELISTPosition       shareParentPos;                 // 上层CU的位置信息Size           shareParentSize;                 // 上层CU的尺寸信息
#endif
#if JVET_M0483_IBC ==0bool           ibc;             // 是否为IBC模式
#endif
#if JVET_M0444_SMVDuint8_t          smvdMode;
#endif
#if JVET_M0102_INTRA_SUBPARTITIONSuint8_t        ispMode;                     // 是否为ISP模式,帧内改进的逐行预测模式
#endif// 构造函数CodingUnit() : chType( CH_L ) { }CodingUnit(const UnitArea &unit);CodingUnit(const ChromaFormat _chromaFormat, const Area &area);CodingUnit& operator=( const CodingUnit& other );         // 运算符重载void initData();         // 初始化CU信息unsigned    idx;         // 在上层CU中的索引CodingUnit *next;         // 指向下一个CU,stack中PredictionUnit *firstPU;         // 指向所包含的第一个PUPredictionUnit *lastPU;         // 指向包含的最后一个PUTransformUnit *firstTU;         // 指向所包含的第一个TUTransformUnit *lastTU;         // 指向包含的最后一个TU#if JVET_M0140_SBTconst uint8_t     getSbtIdx() const { assert( ( ( sbtInfo >> 0 ) & 0xf ) < NUMBER_SBT_IDX ); return ( sbtInfo >> 0 ) & 0xf; }const uint8_t     getSbtPos() const { return ( sbtInfo >> 4 ) & 0x3; }void              setSbtIdx( uint8_t idx ) { CHECK( idx >= NUMBER_SBT_IDX, "sbt_idx wrong" ); sbtInfo = ( idx << 0 ) + ( sbtInfo & 0xf0 ); }void              setSbtPos( uint8_t pos ) { CHECK( pos >= 4, "sbt_pos wrong" ); sbtInfo = ( pos << 4 ) + ( sbtInfo & 0xcf ); }uint8_t           getSbtTuSplit() const;const uint8_t     checkAllowedSbt() const;
#endif
};

PredictionUnit

描述UnitArea的区域的预测信号的生成方式。

// IntraPredictionData 定义了帧内预测数据,包括帧内预测模式及相关参考行索引。// InterPredictionData 定义了帧间预测数据,包含所有帧间预测数据(MV,refidx,merge,skip,trangleMerge,MMVD ,BV等)struct PredictionUnit : public UnitArea, public IntraPredictionData, public InterPredictionData
{CodingUnit      *cu;         // 所属cuCodingStructure *cs;         // 所属csChannelType      chType;         // 颜色通道类型// constructors    构造函数PredictionUnit(): chType( CH_L ) { }PredictionUnit(const UnitArea &unit);PredictionUnit(const ChromaFormat _chromaFormat, const Area &area);void initData();                // PU初始化PredictionUnit& operator=(const IntraPredictionData& predData);PredictionUnit& operator=(const InterPredictionData& predData);PredictionUnit& operator=(const PredictionUnit& other);PredictionUnit& operator=(const MotionInfo& mi);unsigned        idx;         // CU中PU索引
#if JVET_M0170_MRG_SHARELISTPosition shareParentPos;      // 上层CU位置和尺寸Size     shareParentSize;
#endifPredictionUnit *next;               // 指向CU中下一个PU// for accessing motion information, which can have higher resolution than PUs (should always be used, when accessing neighboring motion information)// 获取运动信息,MV的获取,可在固定位置const MotionInfo& getMotionInfo() const;const MotionInfo& getMotionInfo( const Position& pos ) const;MotionBuf         getMotionBuf();CMotionBuf        getMotionBuf() const;
};

TransformUnit

描述UnitArea的变换编码是如何进行的。

struct TransformUnit : public UnitArea
{CodingUnit      *cu;CodingStructure *cs;ChannelType      chType;#if JVET_M0427_INLOOP_RESHAPERint              m_chromaResScaleInv;
#endifuint8_t        depth;                         // TU相对深度
#if JVET_M0464_UNI_MTSuint8_t        mtsIdx;         // 变换核索引
#elseuint8_t        emtIdx;
#endif
#if JVET_M0140_SBTbool           noResidual;               // 残差为0标志
#endifuint8_t        cbf        [ MAX_NUM_TBLOCKS ];               // coding block flagRDPCMMode    rdpcm        [ MAX_NUM_TBLOCKS ];
#if !JVET_M0464_UNI_MTSbool         transformSkip[ MAX_NUM_TBLOCKS ];               // 是否transform bypass
#endifint8_t        compAlpha   [ MAX_NUM_TBLOCKS ];TransformUnit() : chType( CH_L ) { }TransformUnit(const UnitArea& unit);TransformUnit(const ChromaFormat _chromaFormat, const Area &area);void initData();unsigned       idx;               // PU在CU中idxTransformUnit *next;               // 下一个PU、
#if JVET_M0102_INTRA_SUBPARTITIONSTransformUnit *prev;               //
#endifvoid init(TCoeff **coeffs, Pel **pcmbuf);TransformUnit& operator=(const TransformUnit& other);void copyComponentFrom  (const TransformUnit& other, const ComponentID compID);
#if JVET_M0140_SBTvoid checkTuNoResidual( unsigned idx );               // 判断残差是否全0
#endifCoeffBuf getCoeffs(const ComponentID id);const CCoeffBuf getCoeffs(const ComponentID id) const;PelBuf   getPcmbuf(const ComponentID id);const CPelBuf   getPcmbuf(const ComponentID id) const;
#if JVET_M0427_INLOOP_RESHAPER                       // inloop reshaper 针对HDR提出的环内滤波技术int       getChromaAdj( )                 const;void      setChromaAdj(int i);
#endifprivate:TCoeff *m_coeffs[ MAX_NUM_TBLOCKS ];Pel    *m_pcmbuf[ MAX_NUM_TBLOCKS ];
};

VVC学习之四:VTM中的数据结构——CodingUnit、PredictionUnit、TransformUnit相关推荐

  1. VVC参考软件VTM数据结构

    一.基本结构 VTM的数据模型图如下所示: 数据结构分三种类型: 1. 导航信息 Size.Position.Area(Position+Size):基本二维信息(位置.尺寸) CompArea:继承 ...

  2. VVC学习之二:VTM中CU划分结构QTMTT(3):打印QTMTT最终划分

    介绍完QTMTT在VTM中的实现,相信很多人包括我也对QTMTT的最终划分结果很感兴趣,于是我尝试将最终的划分结果进行可视化显示. 在xCompressCU中,将对CTU进行递归划分,用RDcost选 ...

  3. VVC学习之五:VTM帧内预测工具详解

    文章目录 简介 1. 扩展角度帧内模式 1.1 MPM构建和模式编码 1.2 帧内广角预测(WAIP) 1.3 基于模式的参考样本平滑(MDIS) 2. 跨分量线性模型预测(CCLM) 3. 位置自适 ...

  4. java中的数据结构之HashMap学习

    java中的数据结构之HashMap学习 equal与hashcode equals与hashcode的源码 为什么hashmap中作为键值的类要重写hashcode和equals方法 Integer ...

  5. 区块链学习笔记2——BTC中的数据结构

    区块链学习笔记2--BTC中的数据结构 学习视频:北京大学肖臻老师<区块链技术与应用> 笔记参考:北京大学肖臻老师<区块链技术与应用>公开课系列笔记--目录导航页 本文主要介绍 ...

  6. Python学习笔记(一):Pandas中的数据结构

    Pandas中的数据结构: Series,序列,大小不可变: DataFrame,数据帧 Panel,面板 这三种数据结构都是基于Numpy数组构建的,除Series外,其他两种大小可变. 创建Ser ...

  7. H.266/VVC测试软件VTM

    VTM简介 JVET于2018年4月10日美国圣地亚哥会议上,为新一代视频编码标准定名为Versatile Video Coding,正式开启了H.266/VVC的标准化进程. 从H.265跟过来的同 ...

  8. VVC学习之五:帧内预测之色度预测——CCLM及代码学习

    文章目录 1. CCLM跨分量线性预测简介 2. CCLM预测步骤 3. 亮度重建参考像素获取 4. CCLM信号预测 关于VVC的帧内预测,也写了好久了,这应该是色度预测的最后一个部分,第一次写博客 ...

  9. Python中的数据结构

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 本文转自:磐创AI 概述 在深入研究数据科学和模型构建之前,Pyt ...

最新文章

  1. SpriteBuilder实际操作中如何确定合适Breaking force的值
  2. 形状相似的物品_我的世界:MC早期物品和现在的对比,差别很大
  3. MySQL INSERT INTO...ON DUPLICATE KEY UPDATE的使用
  4. Async await 异步编程说明
  5. linux安装mysql出错( file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.5.31-2.el6.i6)
  6. 易语言 java支持_开源Java客户端可以连接易语言服务器
  7. Python编程模块里一些小众但是却比较实用的python内置库
  8. AFNetWorking 使用记录
  9. v-html可能导致的问题
  10. 2021-2025年中国船用辅机行业市场供需与战略研究报告
  11. Ubuntu18.04安装Oracle11g
  12. USB、Mini-USB、Micro-USB接口的引脚定义
  13. 将Excel数据导入到MySQL数据库
  14. protocol buffer生成C语言的实现
  15. ubuntu安装中文环境 zh_CN.GB2312 zh_CN.GBK
  16. C# 地理信息系统GIS开源软件
  17. linux有没有右键解压文件夹,压缩解压文件无需右键可以这样操作
  18. 主域名跳转到带www的域名方法,以及对seo有什么影响?
  19. Polar码(1)— 基础理论
  20. 【深度学习入门系列】径向基函数(RBF)神经网络原理介绍及pytorch实现(内含分类、回归任务实例)

热门文章

  1. SOLIDWORKS Routing进阶篇——管道设计技巧分享
  2. sim900芯片—GPRS使用C语言接电话和收短信应用程序
  3. “计算机入门必读:从零开始的基础知识“
  4. 1944 Problem D 八进制
  5. Centos7系统下部署Gitlab+Jenkins+Docker 实现自动化部署项目
  6. 2018年7月18日日报
  7. [Violet]天使玩偶/SJY摆棋子
  8. python启动浏览器编程_python实现打开浏览器的方法
  9. 画数轴的步骤_中考数学知识点复习:画数轴的步骤
  10. python数据分析-常用数据分析库之Pandas(下)