DCT Image Compression: D. Bhavsingh EC94001 M.Tech, E.I
DCT Image Compression: D. Bhavsingh EC94001 M.Tech, E.I
DCT Image Compression: D. Bhavsingh EC94001 M.Tech, E.I
D. BHAVSINGH
EC94001
M.TECH ,E.I
What is Compression?
• you will see that the pixels are highly correlated (i.e. most of the
time they are very similar)
• this is just a consequence of the fact that surfaces are smooth
Contd..
• the transform eliminates these correlations
• – this is best seen by considering the 2-pt transform
• – note that the first coefficient is always the DC-value
• X[0]= x[0]+ x[1]
• an orthogonal transform can be written in matrix form as
• Inverse
Lossy Image Compression (JPEG)
• the matrix form of Equation (1), we will use the following equation
Lossy
•As we can see here, heavily DCT-
compressed images contain blocking
artefacts. Ringing artefacts can also be
seen around edges.
Rate/Distortion
•As we have seen, quality can fall rapidly a) Original b) DCT : QF 3 : CR 8:1
as shown by the steep slope of rate/
distortion graph.
High frequency
DCT Image Compression
•The DCT method is an example of a transform method.
Rather than simply trying to compress the pixel values
directly, the image is first TRANSFORMED into the frequency
domain. Compression can now be achieved by more coarsely
quantizing the large amount of high-frequency components
usually present.
•It was not designed for graphics or line drawings and is not
suited to these image types.
DCT Image Compression
•The DCT itself does not achieve compression, but
rather prepares the image for compression.
•The pixel values can be calculated as shown in the 2nd line, where
DCT(i,j) values are used to calculate pixel(x,y) values.
1 N 1 N 1
(2 x 1) (2 y 1)
DCT (i, j ) C (i )C ( j ) pixel ( x, y ) cos
2N x 0 y 0 2 N 2 N
1 N 1 N 1
(2 x 1) (2 y 1)
pixel ( x, y )
2N
i 0 j 0
C (i ) C ( j ) DCT ( i , j ) cos 2 N 2 N
1
C ( x) if x is 0, else 1 if x 0
2
The Baseline JPEG Standard Quantization Matrix
- determined by subjective testing -
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
Nelson’s Simpler Linear Quantizer
The Nelson DCT implementation (this is the DCT compressor
used in the laboratory) uses a very simple linear quantization
strategy.
Q = quality or quantization factor
The higher Q the LOWER the image quality.
Where each DCT coefficient (i,j) is quantised as
For (i=0;i<N;i++)
For (j=0;j<N;j++)
quantised[i,j]=1+((1+i+j)*Q);
• For (i=0;i<N;i++) and for (j=0;j<N;j++)
• quantised[i,j]=1+((1+i+j)*Q);
Nelson Quanitizer for Q=2
3 5 7 9 11 13 15 17
5 7 9 11 13 15 17 19
7 9 11 13 15 17 19 21
9 11 13 15 17 19 21 23
11 13 15 17 19 21 23 25
13 15 17 19 21 23 25 27
15 17 19 21 23 25 27 29
17 19 21 23 25 27 29 31
Before and After Quantization
PROPERTIES OF DCT
• Decorrelation
• Energy Compaction
• Separability
• Symmetry
Thank
You