Game Development Reference
In-Depth Information
Fig. 6.2
The algorithm block diagram of C2DVLC
symbol, named
EOB
, represented by
(
0
,
0
)
pair, is coded to indicate that there are
no more nonzero coefficients in the block.
Figure
6.2
illustrates the block diagram of C2DVLC encoder to highlight how
(
L
i
,
R
i
) is entropy coded. During the process of (
L
i
,
R
i
) encoding, three steps
are performed in turn. First, the table index should be calculated. Here, the adopted
multiple VLC tables are two-dimensional to utilize the correlation between
Level
and
Run
. For high coding efficiency, these VLC tables are designed for switch in order
to adapt to the varying statistical distributions of (
Level
,
Run
) pairs. Table switch is
based on the maximal magnitude of prior coded
Levels
before the current (
L
i
,
R
i
)
pair, denoted as
L
max. Therefore, the table index selected for current (
L
i
,
R
i
) pair can
be represented by
C
(
L
,
R
)
(
L
i
−
1
(
L
i
−
1
denotes the past symbols of
L
i
). For the first
)
pair (
L
0
,
R
0
) to be coded in one block, the table index is fixed to be zero. Second,
with the table index selected in the first step, the mapping between (
L
i
,
R
i
) and
one
CodeNumber
has to be done through a table look-up operation.
CodeNumber
in different VLC tables reflect different estimated conditional probabilities of the
current (
L
i
,
R
i
) pair. Finally, the corresponding unique Exponential-Golomb (E-G)
codeword of
CodeNumber
is output (Lam and Goodman
2000
), and one pair coding
is done. E-G codes are used in C2DVLC for simplicity and efficiency. Note that if the
current (
L
i
,
R
i
) pair is out of the VLC table,
Level
and
Run
will be coded separately
by escape coding. At the same time, the update of
L
max should be performed. For
detailed information about escape coding, please refer to J et al. (
2003
).
6.2.2 Context Modeling in C2DVLC
This subsection provides detailed information for the context modeling of (
L
i
,
R
i
)
pairs, i.e., how to adaptively switch 2D-VLC tables in one DCT block.