Let the data at the output of the variable length decoder be denoted by QFS[n]. n is in the range 0 to 63.
This clause specifies the way in which the one-dimensional data, QFS[n], is converted into a two-dimensional array of coefficients denoted by QF[v][u]. u and v both lie in the range 0 to 7.
Two scan patterns are defined. The scan that shall be used shall be determined by alternate_scan which is encoded in the picture coding extension.
Figure 7-2 defines scan[alternate_scan][v][u] for the case that alternate_scan is zero. Figure 7-3 defines scan[alternate_scan][v][u] for the case that alternate_scan is one.
|
|
|
|
|
|
|
|
|
u
|
|
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
|
0
|
0
|
1
|
5
|
6
|
14
|
15
|
27
|
28
|
|
1
|
2
|
4
|
7
|
13
|
16
|
26
|
29
|
42
|
v
|
7
|
35
|
36
|
48
|
49
|
57
|
58
|
62
|
63
|
Figure 7-2. Definition of scan[0][v][u]
|
|
|
|
|
|
|
|
|
u
|
|
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
|
0
|
0
|
4
|
6
|
20
|
22
|
36
|
38
|
52
|
|
1
|
1
|
5
|
7
|
21
|
23
|
37
|
39
|
53
|
v
|
7
|
13
|
14
|
29
|
33
|
45
|
49
|
59
|
63
|
Figure 7-3. Definition of scan[1][v][u]
The inverse scan shall be any process equivalent to the following:
for (v=0; v<8; v++)
for (u=0; u<8; u++)
QF[v][u] = QFS[scan[alternate_scan][v][u]]
NOTE - The scan patterns defined here are often referred to as “zigzag scanning order”.
When the quantisation matrices are downloaded they are encoded in the bitstream in a scan order that is converted into the two-dimensional matrix used in the inverse quantiser in an identical manner to that used for coefficients.
For matrix download the scan defined by Figure 7-2 (i.e. scan[0][v][u]) shall always be used.
Let W[w][v][u] denote the weighting matrix in the inverse quantiser (see 7.4.2.1), and W’[w][n] denote the matrix as it is encoded in the bitstream. The matrix download shall then be equivalent to the following:
for (v=0; v<8; v++)
for (u=0; u<8; u++)
W[w][v][u] = W’[w][scan[0][v][u]]
|