HEVC核心编码技术之五.熵编码

Overview of the High Efficiency Video Coding(HEVC) Standard之四

J. 熵编码 
Entropy Coding

HEVC specifies only one entropy coding method, CABAC
[13] rather than two as in H.264/MPEG-4 AVC. The core algorithm
of CABAC is unchanged, and the following subsections
present several aspects of how it is used in the HEVC design.
相比于H.264/MPEG-4 AVC,HEVC只指定了使用CABAC;
其核心算法并没有改变;

1) 上下文模型
Context Modeling: 

Appropriate selection of context
modeling is known to be a key factor to improve the efficiency
of CABAC coding. In HEVC, the splitting depth of
the coding tree or transform tree is exploited to derive the
context model indices of various syntax elements in addition
to the spatially neighboring ones used in H.264/AVC. For
example, the syntax element skip_flag specifying whether
the CB is coded as interpicture predictively skipped and the
syntax element split_coding_unit_flag specifying whether
the CB is further split are coded by using context models
based on the spatially neighboring information. The syntax
element split_transform_flag specifying whether the TB is
further split and three syntax elements specifying non-zero
transform coefficients for each color component, cbf_luma,
cbf_cb and cbf_cr, are coded based on the splitting depth of
the transform tree. Although the number of contexts used in
HEVC is substantially less than in H.264/MPEG-4 AVC, the
entropy coding design actually provides better compression
than would a straightforward extension of the H.264/MPEG-
4 AVC scheme. Moreover, more extensive use is made in
HEVC of the bypass mode of CABAC operation to increase
throughput by reducing the amount of data that needs to be
coded using CABAC contexts. Dependences between coded
data are also carefully considered to enable further throughput
maximization.
合适的上下文模型选择对于CABAC编码的效率改善是关键因素;
在HEVC中,除了使用H.264/MPEG-4 AVC中使用空域相邻语法因子外,
还使用编码树和变换树的划分深度来推导各种语法元素的上下文模型;
例如,
语法元素skip_flag指示了当前CB是否是帧间预测skip模式编码,
而语法元素split_coding_unit_flag指示了当前CB是否要更一步的划分;,
这些信息都会用作基于空间相邻信息的上下文模型;
语法元素split_transform_flag指示了当前TB是否需要更进一步划分,
并且这三个语法元素指明了每个颜色分量的非零变换系数,
cbf_luma,
cbf_cb,
cbf_cr; 
它们都基于变换树的深度进行编码;
尽管HEVC中,上下文个数少于H.264/MPEG-4 AVC,但它提供了更好的压缩效果;
而且,HEVC使用了更多的CABAC操作中的bypass模式,这增加了数据吞吐量;

2) 自适应系数扫描
Adaptive Coefficient Scanning: 

Coefficient scanning is
performed in 4×4 subblocks for all TB sizes (i.e., using only
one coefficient region for the 4×4 TB size, and using multiple
4×4 coefficient regions within larger transform blocks). Three
coefficient scanning methods, diagonal up-right, horizontal,
and vertical scans as shown in Fig. 9, are selected implicitly
for coding the transform coefficients of 4×4 and 8×8 TB
sizes in intrapicture-predicted regions. The selection of the
coefficient scanning order depends on the directionalities of
the intrapicture prediction. The vertical scan is used when the
prediction direction is close to horizontal and the horizontal
scan is used when the prediction direction is close to vertical.
For other prediction directions, the diagonal up-right scan is used.
对于所有TB尺寸的4x4子块,都要执行系数扫描操作,
HEVC定义了三种系数扫描方法:
朝右上的对角线扫描,
水平扫描,
垂直扫描,
如图9中所示;
对于在帧内预测区域的4×4 and 8×8 TB尺寸的变换系数编码来说 ,这三种扫描方式的选择是隐示的;
这个系数扫描的顺序要依靠帧内预测的方向来选择;
当预测方向接近水平时就使用垂直扫描;
当预测方向接近垂直时就使用水平扫描;
对于其它预测方向,使用朝右上的对角线扫描;

Fig. 9. Three coefficient scanning methods in HEVC. 
(a) Diagonal up-right scan. 
(b) Horizontal scan. 
(c) Vertical scan.

For the transform coefficients in interpicture prediction
modes of all block sizes and for the transform coefficients
of 16×16 or 32×32 intrapicture prediction, the 4×4 diagonal
up-right scan is exclusively applied to subblocks of transform   coefficients.
对于所有块尺寸的帧间预测模式的变换系数,
以及16×16 or 32×32 帧内预测的变换系数,
不能对变换系数的子块使用4x4的朝右上的对角线扫描;

3) 系数编码
Coefficient Coding: 

Similar to H.264/MPEG-4 AVC,
HEVC transmits the position of the last nonzero transform
coefficient, a significance map, sign bits and levels for the
transform coefficients. However, various changes for each
part have been made, especially for better handling of the
significantly increased size of the TBs.
和H.264/MPEG-4 AVC一样,HEVC传输
最后一个非零变换系数的位置,
重要性映射,
符号位,
以及系数的级;
然而,HEVC对这些都做了改善,以更好地适应于TB尺寸的增加;

First, the horizontal and vertical frequency coordinate positions
of the last nonzero coefficient are coded for the TB before
sending the significance maps of 4×4 subblocks that indicate
which other transform coefficients have nonzero values, rather
than sending a series of last-coefficient identification flags
that are interleaved with the significance map as done in H.264/MPEG-4 AVC.
首先,对于当前TB,在发送4x4子块的重要性映射之前,
最后一个非零系数的水平和垂直频率坐标位置被编码;
这一点和H.264/MPEG-4 AVC不一样;

The significance map is derived for significance groups
relating to the fixed size 4×4 subblocks. For all groups having
at least one coefficient preceding the last coefficient position, a
significant group flag specifying a nonzero coefficient group is
transmitted, followed by coefficient significance flags for each
coefficient prior to the indicated position of the last significant
coefficient. The context models for the significant coefficient
flags are dependent on the coefficient position as well as the
values of the right and the bottom significant group flags.

A method known as sign data hiding is used for further compression
improvement. The sign bits are coded conditionally
based on the number and positions of coded coefficients. When
sign data hiding is used and there are at least two nonzero
coefficients in a 4×4 subblock and the difference between the
scan positions of the first and the last nonzero coefficients is
greater than 3, the sign bit of the first nonzero coefficient is inferred
from the parity of the sum of the coefficient amplitudes.
Otherwise, the sign bit is coded normally. At the encoder
side, this can be implemented by selecting one coefficient
with an amplitude close to the boundary of a quantization
interval to be forced to use the adjacent quantization interval
in cases where the parity would not otherwise indicate the
correct sign of the first coefficient. This allows the sign bit to
be encoded at a lower cost (in rate-distortion terms) than if it
were coded separately—by giving the encoder the freedom to
choose which transform coefficient amplitude can be altered
with the lowest rate-distortion cost.

For each position where the corresponding significant coefficient
flag is equal to one, two flags specifying whether the
level value is greater than one or two are coded, and then the
remaining level value is coded depending on those two values.
(这部分没有看很明白,得到具体做这个再说吧)

上六,龙战于野,其血玄黄。
【白话】上六,阴气盛极,与阳气相战郊外,天地混杂,乾坤莫辨,后果是不堪设想的。


《象》曰:“龙战于野”,其道穷也。
【白话】《象辞》说:“阴气盛极,与阳气相战于郊外”,说明阴气已经发展到尽头了。

你可能感兴趣的:(h.265,HEVC,熵编码)