
4.6. QUANTIZATION
51
0 0.5 1 1.5 2 2.5
x 10
4
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
dmadct(N)
read(N) Q(N) huff(N)
ACC
CPU
clockcycles
Figure 4.3: Timestamps for JPEG compression pipeline. Each color coded patch rep-
resents the processing of an 8 ×8-block. Colorcodes: DMA+DCT red, readout green,
quantization blue and Huffman encoding yellow.
4.6 Quantization
4.6.1 General
The standard JPEG quantization table for the luminance channel is given by
Q
L
[u, v] =
16 11 10 16 24 40 51 61
12 12 14 19 26 58 60 55
14 13 16 24 40 57 69 56
14 17 22 29 51 87 80 62
18 22 37 56 68 109 103 77
24 35 55 64 81 104 113 92
49 64 78 87 103 121 120 101
72 92 95 98 112 100 103 99
. (4.1)
To get higher image quality this table is divided by 2. Reciprocals are then computed
by the formula
R[u, v] =
2
14
Q
L
[u, v]/2
, (4.2)
which is the table in the file jcdctmgr.c.
As an example we use A[u, v] from (3.6). Before quantizing A[u, v] we subtract
64 × 128 = 8192 from the DC value A[0, 0], which corresponds to taking the DCT of
a[x, y] − 128. This procedure is meant to give a smaller value on the average, which
however is false in this particular case.
Finally we compensate for the scale factor 8 introduced in the DCT2 step by right-
Komentarze do niniejszej Instrukcji