Game Development Reference
In-Depth Information
16
11
10
16
24
40
51
61
17
18
24
47
99
99
99
99
12
12
14
19
26
58
60
55
18
21
26
66
99
99
99
99
14
13
16
24
40
57
69
56
24
26
56
99
99
99
99
99
14
17
22
29
51
87
80
62
47
66
99
99
99
99
99
99
18
22
37
56
68
109
103
77
99
99
99
99
99
99
99
99
24
35
55
64
81
104
113
92
99
99
99
99
99
99
99
99
49
64
78
87
103
121
120
101
99
99
99
99
99
99
99
99
72
92
95
98
112
100
103
99
99
99
99
99
99
99
99
99
(a) Luminance Q 50
(b) Chrominance Q 50
Figure 2.3. Standard quantization tables for (a) luminance and (b) chrominance.
2.1.5
Quantization
Small changes in high-frequency intensity are not perceived by human vision [Pen-
nebaker and Mitchell 93]. Some DCT coecient precision may therefore be dis-
carded without major impact in the perception of a decoded image for a viewer.
Each DCT coe cient is divided by a corresponding factor in a precalculated
quantization table, where each table entry is an integer ranging from 1 to 255.
The resulting value is thereafter rounded to the nearest integer. This quantization
process loses information and will affect the JPEG data size output. Luminance
and chrominance components are quantized using different tables because of the
differences explained in Section 2.1.3. The JPEG standard provides optional
standard quantization tables—see Figure 2.3—for both luminance and chromi-
nance components. In Equation (2.4), standard table Q 50 is used to derive tables
of different quality levels:
(100
quality)
50
Q 50
if quality > 50,
Q quality =
(2.4)
50
quality
Q 50
if quality < 50.
After quantization all coecients are ordered in a zigzag sequence; see Figure 2.4.
The zigzag ordering is used to place low-frequency coecients, which have higher
probability to be nonzero, before high-frequency coecients.
2.1.6
Entropy Coding
After quantization the coecients are entropy-coded to compact coecient infor-
mation into a bit stream. Each nonzero coecient is encoded as the concatenation
of two symbols, wherein the first symbol is Huffman coded. Huffman tables may
be computed per image before compression or predefined and used for all images.
In this chapter two predefined, JPEG standard, Huffman coding tables are used.
There is one DC coecient code table and one AC coecient code table. DC
coecients are coded as deltas from the previous block in that color plane. The
 
 
Search Nedrilad ::




Custom Search