您的位置:首页 > 其它

HEVC – 什么是 CTU, CU, CTB, CB, PB, 和TB?

2018-03-27 01:25 387 查看
HEVC,也有叫H.265,MPEG-H 第二部分(ISO/IEC 23008-2)的,指的都是同一个东西。一个[不错的概论](http://iphome.hhi.de/wiegand/assets/pdfs/2012_12_IEEE-HEVC-Overview.pdf) 出版了(一开始并不容易看懂,译者注)。同时[一个参考的实现](https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/trunk)你也可以看看。一些活跃的讨论可以在[这里](http://phenix.int-evry.fr/jct/) 查看。国际标准终稿将期望在2013年一月制作。

然而,一样,制定标准的作者都喜欢一些像是加密的简写。可能立马会让读者泄气的就是一些块结构编码的属于,比如 CTU,CU,CTB,CB,PB,还有TB。

他们基本上是代替了之前标准里的宏块(Macroblocks )和块(blocks )。不像十年前,现在我们视频的尺寸很大。4K已经变成现实,人们开始谈论8K。甚至移动设备也有如高于 HD 帧尺寸的 2048 x 1530 的尺寸。我们需要更大的宏块来为这些大尺寸的帧进行有效的编码。另一方面,小的细节也很重要,我们有时想在4x4的尺度上进行预测和转换。

我们如何有效地支持各种各样的块大小?这就是HEVC想用那些带缩写名词的东西来解决的。

让我们从高等级的开始。假设我们有一个图像要编码。HEVC将这个图片分成很多CTU(Coding Tree Unit,编码树单元)

![CTUs (Coding Tree Unit)](http://upload-images.jianshu.io/upload_images/28960-c70f07c0db216746.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

一个序列参数集将告诉我们CTU的宽和高,同时也意味着在一个视频序列里有相同的尺寸:64×64, 32×32, 或 16×16。

![CTU](http://upload-images.jianshu.io/upload_images/28960-d13c355f66497570.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

我们需要好好理解一下这里的一个重要的命名习惯。在HEVC标准里,如果一个东西叫 xxx单元,这就表示一个依次编码成HEVC比特流的编码逻辑单元。

CTU--编码树单元就是这样一个逻辑单元。它通常包括三个块,也就是一个亮度块(Y)块两个色度块(Cb and Cr),除此之外它还包括相关的语法元素。这样的一个块就叫做CTB(Coding Tree Block 编码树块)。

![CTU](http://upload-images.jianshu.io/upload_images/28960-4a09b43b308a5bbd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

每个 编码树块(CTB)都有和编码树单元(CTU )一样的大小--64×64, 32×32, 或 16×16。然而,编码树块(CTB)--也取决于视频帧的哪一个部分--可能太大以至于很难决定我们应该施以帧间预测或者帧内预测。因此,每个编码树块(CTB)又可以相应的被分割成很多编码块(Coding Blocks,CB ),这样每个编码块(CB)就成了决定预测类型的决定点。比如,一部分编码树块(CTB)被分成一些16×16的编码块(CB)而另一部分被分割成一些8×8 的编码快(CB)。HEVC支持的编码块(CB)尺寸从编码树块(CTB)的所有尺寸直到小至8×8的尺寸。

下面这这张图片说明了 64×64 的编码树块(CTB)可以被分割成很多编码块(CB)。

![CTBs](http://upload-images.jianshu.io/upload_images/28960-ea85ac8514e23be0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

编码块(CB)是判断执行帧间预测还是帧内预测的决定点。更精确地说,预测类型是被编码在编码单元(Coding Unit,CU)里的,编码单元(CU)包括三个编码块(Y,Cb和Cr)和相关的语法元素。

![CB](http://upload-images.jianshu.io/upload_images/28960-2dfbc92967c8ca58.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

编码块对于预测类型的判定是足够好的了,但是对于存储运动向量(帧间预测时要用到的)或帧内预测的模式来说还是太大了。比如,一个非常小的目标,像是下落的雪,可能总是在8×8的编码块的中间移动--而我们想要的是根据CB的不位置得来的不同的运动向量。

![Snowfall](http://upload-images.jianshu.io/upload_images/28960-704d41e13ed759a9..jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

因此就引入了预测块(Prediction Block , PB)。每个编码块可以以不同的方式分割成多个预测块,而如何分割取决于时域和/或空域的可预测性。

![PB](http://upload-images.jianshu.io/upload_images/28960-0ff226b261375a75.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

一旦做出了预测,我们需要对残差(预测图像和实际图像不一样的地方)经过类似离散余弦变换后进行编码。

![TB](http://upload-images.jianshu.io/upload_images/28960-0aef2e687713104d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

让我们阅读一个跟这些属于相关的标准草案文本。现在它们应该更容易理解了。

下面直接上原文吧:)

> **CTU (coding tree unit)**: A coding tree block of luma samples, two corresponding coding tree blocks of chroma samples of a picture that has three sample arrays, or a coding tree block of samples of a monochrome picture or a picture that is coded using three separate colour planes and syntax structures used to code the samples. The division of a slice into coding tree units is a partitioning.

> **CTB (coding tree block)**: An NxN block of samples for some value of N. The division of one of the arrays that compose a picture that has three sample arrays or of the array that compose a picture in monochrome format or a picture that is coded using three separate colour planes into coding tree blocks is a partitioning.

> **CB (coding block)**: An NxN block of samples for some value of N. The division of a coding tree block into coding blocks is a partitioning.

> **CU (coding unit)**: A coding block of luma samples, two corresponding coding blocks of chroma samples of a picture that has three sample arrays, or a coding block of samples of a monochrome picture or a picture that is coded using three separate colour planes and syntax structures used to code the samples. The division of a coding tree unit into coding units is a partitioning.

> **PB (prediction block)**: A rectangular MxN block of samples on which the same prediction is applied. The division of a coding block into prediction blocks is a partitioning.

> **TB (transform block)**: A rectangular MxN block of samples on which the same transform is applied. The division of a coding block into transform blocks is a partitioning.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: