Game Development Reference
In-Depth Information
5.1.2 Transform and Quantization
As an integrated part of the whole video coding system, the transformmodule decor-
relates the samples of the input residual block, and the output transform coefficients
are further quantized and fed into the entropy coding process. As we know, transform
is a lossless process since the original input source can be exactly reconstructed by
applying inverse transform to the transform coefficients directly. To achieve substan-
tial compression ratio by lossy coding method, quantization is applied to reduce the
levels of transform coefficients. Due to the excellent tradeoff between simplicity and
efficiency, in video coding, a dead-zone plus uniform threshold scalar quantization
(DZ+UTSQ) scheme is usually applied. A typical DZ+UTSQ used in video coding
is formulated as below:
)
·
|
x
|+
f
·
x
ˆ
=
sign
(
x
,
(5.4)
where
x
indicates the input transform coefficient to be quantized,
denotes the
quantization step size,
f
is an offset value controlling the size of the dead-zone, and
sign
is a function returning the sign of
x
. The above quantization process shown
in Eq.
5.4
can also be illustrated in Fig.
5.1
.
AsshowninFig.
5.1
, the reconstruction values are uniformly distributed as
multiples of
(
·
)
. Moreover, for input transform coefficient within the range of
[−
(
, which is called dead-zone, the quantization value
will be 0, and the larger value of
f
will results in less zero quantized coefficients.
It is noted that offset value settings have large impact on the coding efficiency, and
in video coding, a typical value of
f
is set to 1/3 for intra residuals or 1/6 for inter
residuals.
Furthermore, in practical video coding schemes, division operations are usually
avoided. Instead, an identical reformulation using multiplication and right shift is
always applied, as shown below
1
−
f
)
·
,
+
(
1
−
f
)
· ]
2
q
x
ˆ
=
sign
(
x
)
·
(
|
x
|·
Q
+
f
·
)
q
,
(5.5)
where
indicates the right shift operation,
Q
and
q
controls the quantization step
size. Compared with Eq.
5.4
, it can be noted that the quantization step size
is
Fig. 5.1
Illustration of a typical DZ+UTSQ quantizer applied in video coding