Home

About PCS

About Us
Outsourcing
Evaluation package

IP cores

JPEG-EC
STD8085

CSC

CSC_S
CSC_P

Education

JPEG
Contact Us

JPEG

 


Quantization

The “Quantization” is a key step in the compression process since less important information has been discarded. The advantage of the representation in the frequency domain is that, unlike in spatial domain before the DCT, not every dimension has the same importance for the visual quality of the image. Removing the higher frequencies components will reduce the level of detail but the overall structure remains, since it has been dominated by the lower frequency components.

The 64 values of a 8x8 block will be divided according to the 64 values of an 8x8 matrix called the quantization table. There is no information lost in the division of the coefficients itself, but then the result is rounded to the next integer afterwards. The higher the divisor is, the more information about the coefficient will be positioned after the decimal point hence lost in the rounding operation.

Quantization may be defined by following formula:

 

where

Sqvu - Coefficients after quantization

                   Svu - Coefficients before quantization (after DCT)

Qvu - values from Quantization table


The JPEG standard provides an example quantization table, which has “been used with good results on 8-bit per sample luminance and chrominance images”.

The quantization table is given as example in JPEG standard:

 

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

Quantization table for luminance component

 

17 18 24 47 99 99 99 99
18 21 26 66 99 99 99 99
24 26 56 99 99 99 99 99
47 66 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99

Quantization table for chrominance components

 

Many encoders simply use example quantization tables, but the values are not claimed to be optimal. An encoder may use any other quantization table, probably optimized by analyzing the image first. The quantization tables are stored in the header of the JPEG file in the “DQT” (Define Quantization Table) marker to be available for decoding. Most JPEG encoders allow the user to choose a compression level or a quality setting. This parameter specifies the tradeoff between the efficiency of the compression and the associated quality loss. By setting this parameter one actually just specifies what quantization table the encoder will use (usually the example quantization table will be multiplied by a factor computed from the chosen parameter).

An example of chrominance quantization using default quantization table is shown below:

 

251 118 -13 6 -2 6 -1 0
279 -68 -8 -7 -1 4 -4 -1
-51 -14 34 -14 5 0 -1 0
27 5 -10 8 -7 4 -5 1
-22 -7 14 -9 4 -2 1 1
-3 15 -18 15 -6 2 -1 2
7 -9 6 -6 4 0 0 2
3 7 -9 3 0 -2 -1 0

8x8 block after DCT

 

17 18 24 47 99 99 99 99
18 21 26 66 99 99 99 99
24 26 56 99 99 99 99 99
47 66 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99
99 99 99 99 99 99 99 99

Quantization table

 

14 6 0 0 0 0 0 0
15 -3 0 0 0 0 0 0
-2  0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

8x8 block after quantization

In result, after quantization most of coefficients are equal to zero.