Professional Documents
Culture Documents
x = 0, , n-1
Compute then n
1 DCT coefficients:
2
(2 x 1)
F (u )
where
C (u ) I ( x) cos
x 0
C (u )
2n
1
for u 0,
2
1 otherwise
, u 0...n 1
Visualization of 1D DCT
BasisFunctions
F(0)
F(1)
F(2)
F(3 )
F(7)
Extend DCT from 1D to 2D
F(4)
F(5)
F(6)
Perform 1D DCT on each row of the block and again for each
column of 1D coefficients
Equations for 2D
DCT
m 1 n 1
2
(2 x 1)u
F (u , v)
C (u )C (v) I ( x, y ) * cos
2n
nm
y 0 x 0
(2 y 1)v
*
cos
2
m
F(0,0)
includes the lowest frequency in both directions is called DC
coefficient
Determines fundamental color of the block
F(0,1) . F(7,7)
are called AC coefficients
Their frequency is non-zero in one or both directions
Huffman Coding
MISSISSIPPIRIVER
16 alphabets
M:1, I:5, S:4, P:2, R:2, V:1, E:1
alp probabili
hab
ty
et
I
5/16 =
0.31
0.31
0.31
0.31
0.44
0.66 (0)
4/16=0.2
5
0.25
0.25
0.25
0.31(01)
0.44(1)
2/16=0.1
25
0.125
0.190
0.25
(10)
0.25(00)
2/16=0.1
25
0.125
0.125(10
1)
1/16=0.0
64
0.126
(110)
0.125(10
0)
1/16=0.0
63
0.064
(111)
01
0.19(1 S 00
1)
R 101
P
100
M 110
1101
1100
Uncompressed Image
Let us first consider how much
memory an uncompressed
bitmap raster image uses.
Using adesktop 1280 x 1024
pixel imagefor example. Each
pixel requires 3 memory
locations to store the RGB
colours.
So 3 Blocks ( arrays-grids) of 1280 x 1024 memory are used =
3932160 memory locations.
With larger images the huge file sizes create a problem for data
storage and transmission over networks.
To overcome these problems data compression is used to reduce
the file size.
JPEG
In 1987
STEPS
Convert RGB to YCbCr format (luminance &
chroma)
Y = 0.299 R + 0.587 G + 0.114 B
Cb = - 0.1687 R - 0.3313 G + 0.5 B + 128
Cr = 0.5 R - 0.4187 G - 0.0813 B + 128
Jpeg Chroma sampling
The luminance channel is retained at full resolution.
Both chrominance channels are typically down
sampled by 2:1 horizontally and either 1:1 or 2:1
vertically
Each
Camera
Jpeg Huffman
After quantization the 63 DCT AC terms are