Image Compression
Objective: Reduction of data redundancy Coding redundancy Interpixel redundancy Psychovisual redundancy 20-Fall LIST 2
Method: Coding Redundancy Variable-Length Coding Interpixel Redundancy Run-Length Coding Predictive Coding Psychovisual Redundancy Lossly Coding 20-Fall LIST 3
Compression Ratio C R n n img cod n img : image sie n cod : code sie 20-Fall LIST 4
JPEG Joint Photographic Experts Group Image Compression Standard JPEG Lossy JPEG Lossless JPEG 2000 20-Fall LIST 5
Transformed Image Coding f Transform F Quantiation F q Lossless Coding Bit Allocation Lossless Decoding a Encoder Dequantiation F q Inverse Transform g b Decoder 20-Fall LIST 6
Linear Transform Energy compaction Optimal transformation Data independent basis 20-Fall LIST 7
Quantiation Quantiation is used only in lossy compression. Progressive quantiation Bit plane coding 20-Fall LIST 8
Bit Plane Coding 3-7 0 0 + + 0-4 -5 2 + - 0 0 0 + 0 0 6-2 + 0 0 0-0 + 0 MSB LSB 20-Fall LIST 9
Variable-Length Coding Higher-Probability Value Lower-Bit Code Gray Histogram Probability 20-Fall LIST 0
Entropy Coding Huffman code 00 0 0 0 0 0 0 Gray 0 2 3 4 5 6 7 Prob 0.9 0.25 0.2 0.6 0.08 0.06 0.03 0.02 0 0.05 0 0.40 0 0.60 0 0.35 0 0.9 0 0. 0.00 n cod =2*0.9+2*0.25+2*0.2+3*0.6 + 4*0.08+5*0.06+6*0.03+6*0.02 = 2.7 20-Fall LIST --
Code 00 0 0 0 0 0 0 Gray 0 2 3 4 5 6 7 Pixels:, 0,, 2,, 0, 2, 4, 3, 7, 6, 2, 0,... Codes : 0, 00, 0, 0, 0, 00, 0, 0, 0,, 0, 0, 00,... Code stream: 000000000000000... Decoding: 0,00,0,0,0,00,0,0,0,, 0,0,00... 20-Fall LIST -2-
Huffman Shift Coding p r r prefix symbol 20-Fall LIST 3
Arithmetic Coding Huffman coding : Symbol Code Symbol Sequence Code Stream Arithmetic Coding : Symbol Interval Symbol Sequence Subdivided real interval *0, 20-Fall LIST 4
Symbol Probability Subinterval a 0.2 [0.0, 0.2 a 2 0.2 [0.2, 0.4 a 3 0.4 [0.4, 0.8 a 4 0.2 [0.8,.0 a a 2 a 3 a 3 a 4 a 4 0.2 a 4 0.08 a 4 0.072 a 4 0.0688 a 4 0.0028 0.0688 a 4 a 3 a 2 a 3 a 2 0.04 a 3 a 2 0.06 a 3 a 2 0.0064 a 3 a 2 a 3 a 2 a 0.2 a a a a a 0 0 0.04 0.056 0.0624 0.06752 0.2 0.04 0.06 0.0064 0.0028 20-Fall LIST 5
Constant Area Coding a, a, a,..., a a, n n a : Symbol block of symbols Run-Length Coding 20-Fall LIST 6
D Run-Length Coding Symbol: 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 27, 27, 62, 62, 62, 62, 62, 62, 62, 62, Code: 0, 4, 5, 9, 27, 2, 62, 8 2D Run-Length Coding: 05 05 05 0 2 2 2 2 05 05 05 0 2 2 2 2 0 0 0 0 2 2 2 2 0 0 0 0 2 2 2 2 0 0 0 0 2 2 3 3 0 0 0 0 2 2 3 3 0 0 0 0 5 3 3 3 0 0 0 0 5 3 3 3 05 02 05 0 0 0 2 04 05 0 0 0 0 04 2 02 3 02 0 02 0 02 5 0 3 0 3 02 5 0 3 0 20-Fall LIST -7-
JPEG Encoding and Decoding Encoding 8x8 block DCT Quantiation Matrix DC Q DPCM DC Huffman AC Zig Zag Scan AC Huffman Decoding Code books DC Huffman AC Huffman IDPCM DC AC Q - IDCT 8x8 block 20-Fall LIST 8
JPEG Coding Example 0 20 30 40 50 60 20 40 60 64x64 0 20 30 40 50 60 20 40 60 Block DCT coefficients Decoded image 200 80 60 40 20 00 80 60 40 20 0-0 -8-6 -4-2 0 2 4 6 Histogram of AC coefficients 20-Fall LIST 9
JPEG Compression Standard DCT-based lossy compression
Sampling Y C C b r 0.299 0.47 0.65 0.587 0.289 0.55 0.4 0.436 0.00 R G B R,G,B Y, C r, C b 20-Fall LIST 2
Color Image 20-Fall LIST 22
Red Green Blue 4000 3500 3000 2500 2000 500 000 500 0 4000 3500 3000 2500 2000 500 000 500 0 4500 4000 3500 3000 2500 2000 500 000 500 0 0 50 00 50 200 250 0 50 00 50 200 250 0 50 00 50 200 250 20-Fall LIST 23
4000 3500 Y 5000 4500 C b 5000 C r 3000 2500 2000 4000 3500 3000 2500 4000 3000 500 2000 2000 000 500 500 000 500 000 0 0 0 0 50 00 50 200 250 0 50 00 50 200 250 0 50 00 50 200 250 20-Fall LIST 24
Original image RGB down-sampled image 20-Fall LIST 25
original Cb Down-sampled Cb 20-Fall LIST 26
Original Cr Down-sampled Cr 20-Fall LIST 27
Original Image Down-sampled Cb,Cr 20-Fall LIST 28
Down-sampled RGB Down-sampled Cb,Cr 20-Fall LIST 29
YUV YCbCr Subsampling 4:4:4 4:2:2 [Y0dc, Y0ac], [Cbdc, Cbac], [Crdc, Crac] [Y0dc, Y0ac] [Ydc, Yac], [Cbdc, Cbac], [Crdc, Crac] 20-Fall LIST 30
Digital Cosine Transform 20-Fall LIST 3 DC Coefficient / AC Coefficients 0 2 2 cos N x N u x x f u u C 0 2 2 cos N u N u x u C u x f 0 2 0 u N u N u 0 0 0 N x x f C
MCU: Minimum coded unit 20-Fall LIST 32
DCT Basic Functions 20-Fall LIST 33
8x8 2D DCT Basic Functions 20-Fall LIST 34
Quantiation F q u,v = Fu,v/Q uv Quantiation Table scale factor % 5000 Q 200 2* Q Q 50 50 Q 99 Q 00 20-Fall LIST 35
Encoding DC Difference Coding AC RLE, Huffman Encoding 20-Fall LIST 36
DC Y, Cb, Cr: difference encoding SIZE, AMPLITUDE SSSS DIFF 20-Fall LIST 37
20-Fall LIST 38
20-Fall LIST 39
20-Fall LIST 40
AC Y, C b, C r : Run-Length Encoding Cnt of 0 Bits Value 4 4 RRRR SSSS 20-Fall LIST 4
20-Fall LIST 42
20-Fall LIST 43
... 20-Fall LIST 44
... 20-Fall LIST 45
20-Fall LIST 46
20-Fall LIST 47
DCT DWT 20-Fall LIST 48
Crochiere et al in 976 Subband Coding Simple and powerful technique Subband Coding Signal Subband 2 Coding Subband n Coding 20-Fall LIST 49
Fourier basis functions exact frequency spatially no precise Subband basis frequency concentration spacially compact 20-Fall LIST 50
Band Splitting octave bands 20-Fall LIST 5
Aliasing distortion 20-Fall LIST 52
2-band encoder/decoder 20-Fall LIST 53
Lowpass subband 20-Fall LIST 54
Highpass subband 20-Fall LIST 55
Cancellation of aliasing Y G Y G Y 0 0 20-Fall LIST 56
20-Fall LIST 57 2 0 0 0 X H X H Y 2 X H X H Y 0 0 Y G Y G Y 2 2 0 0 0 0 X G H G H X G H G H Y
20-Fall LIST 58 0 0 0 G H G H 0 H G 0 H G 2 0 0 X H H H H Y 0 H H P 2 X P P Y
20-Fall LIST 59 m P P 2 if X Y m m n x n y e.g. 6 4 3 2 9 6 9 6 P
20-Fall LIST 60 3 2 3 2 0 3 3 4 3 3 4 H H 6 4 3 2 9 6 9 6 P 3 2 3 2 0 3 3 4 3 3 4 H H 2 4 3 2 0 2 2 2 6 2 8 H H
decomposition Wavelet transform X w a, b x t a, b t dt basis function: mother wavelet a, b t a, b t a t b a 20-Fall LIST 6
a, b t a t b a,0, b 2,0 0.5, 0 20-Fall LIST 62
20-Fall LIST 63
Scaling Wavelet Small scale -Rapidly changing details, -Like high frequency Large scale -Slowly changing details -Like low frequency 20-Fall LIST 64
Discrete wavelet transform DWT discretiation: x t X a, b m a a0 w a 0, m :integer a bandwidth bsampling for a 0 2, b 0 b nb a m 0 0 t m, nm, n m n x t m, n x t m, n t 20-Fall LIST 65
Multiresolution representation orthonormal set t n multireslution expansion n x t c t n n m/ 2 m m x t 2 c 2 t n m n n 20-Fall LIST 66
Harr wavelet: t 0 n c n n t 22t n 0 t scaling function: t otherwise c n 2 0 n 0, otherwise t 2t 2t t 0 2 t 2 t 20-Fall LIST 67
Harr scaling function Harr wavelet A x t 0 A x A j x t : approximationof x t at D j x t A x t j A j x t : detail t resolution of x t at j resolution j 20-Fall LIST 68
Wavelet transform and filter banks 20-Fall LIST 69 n n n n n t c t function synthesis scaling n t c t function analysisscaling 2 2 : 2 2 : n n n n n t d t synthesis wavelet n t d t analysiswavelet 2 2 : 2 2 :
analysis synthesis 20-Fall LIST 70
Wavelet filter design 20-Fall LIST 7 2 Q P n e.g. 2 4 2, Q n 4 2 4 P 2 4 3 2 0 2 2 2 6 2 8 H H
Multidimensional wavelet transform 20-Fall LIST 72
2-D Example LIST Lec4 Wavelet Coding [73]
JPEG 2000
20-Fall LIST 75
20-Fall LIST 76
20-Fall LIST 77
20-Fall LIST 78
20-Fall LIST 79
20-Fall LIST 80
20-Fall LIST 8
20-Fall LIST 82
20-Fall LIST 83
20-Fall LIST 84
20-Fall LIST 85
20-Fall LIST 86
20-Fall LIST 87
Quantiation: 20-Fall LIST 88
64x64, 32x32 20-Fall LIST 89
Embedded Block Coding encoding at bit-plane level context-based adaptive binary arithmetic coder significance propagation magnitude refinement clean-up 20-Fall LIST 90