Lossless Compression Multimedia File Formats Lossy Compression IMAGE COMPRESSION 69
Basic Encoding Steps 70
JPEG (Overview) Image preparation and coding (baseline system) 71
JPEG (Enoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding The following example shows an 8x8 pixel image section 8-bit numbers represent greyscales color space greyscale RGB YC b C r 72
JPEG (Encoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding Assuming a given 16x16 block with C b or C r The eye can sense local differences only poorly Averaged values of 2x2 sections 73
JPEG (Encoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding 8x8 block with 8-bit values thus P=8; left shift of all items corresponds to -128 this is the source matrix X DCT 1) normalize values 2) enforce NxN blocks 3) apply 2-D DCT 74
JPEG (Encoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding DCT 1) normalize values 2) enforce NxN blocks 3) apply 2-D DCT 8x8 block contains only values between -128 and 127 Application of the 2-D DCT leads to the transformed matrix D = A X A T 75
JPEG (Encoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding Quantization select table Q quantify DCT-coefficients select a quantization table Q with items q ij according to JPEG recommendation quantify according to stated formula and obtain table L with quantified DCT-coefficients store results in L 76
JPEG (Encoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding Coding DC-coefficient AC-coefficients DC-coefficient coding table: 16 categories with increasing number of entries code difference to preceding DCcoefficient: here: 3 3 is in group 2 and is on position 4 there (thus bitword 11) assuming Huffman-Code for group 2 is 2-bit long (e.g. 01) resulting sequence for DC: 0111 77
JPEG (Encoding) 1) select color space 2) color-subsampling 3) DCT 4) quantization 5) coding AC-coefficients are traversed in zick-zack and coded absolutely Coding DC-coefficient AC-coefficients The (Z,C) table contains Huffman codes for AC-sequences Z: number of preceding zeros C: category of the AC coefficient For the example the results are: 1 -> (0,1) -> 00 1 (2nd position in 1st category) -9 -> (0,4) -> 1011 0110 3 -> (0,2) -> 01 11 0 0 -> (0,0) -> 1010 78
JPEG (Encoding) 8x8 section coded with 23 bit 0111 0011 0110 1100 1111 010 i.e. in average 23/64 instead of 8 bit per pixel the reconstructed block has only small errors [values in %] 79
JPEG (Example, Comparision) Playing with JPEG ImageTrans Comparison JPEG & PNG 3,164 bytes 810 bytes 3,564 bytes 19,047 bytes 80
Wavelets (Introduction) Wavelets in practice JPEG 2000 Preprocessing DWT Quantizer Tier 1 / Tier 2 coding Comparison of JPEG 2000 with JPEG 81
JPEG 2000 (Overview) 82
JPEG 2000 (Example) 83
JPEG 2000 (RGB) 84
JPEG 2000 (YCrCb) 85
JPEG 2000 (Subsampling) 86
JPEG 2000 (Subsampling) 87
JPEG 2000 (Subsampling) 88
JPEG 2000 (Subsampling) 89
JPEG 2000 (Subsampling) 90
JPEG 2000 (Subsampling) 91
JPEG 2000 (DWT) 92
1-D two-band DWT 93
2-D wavelet decomposition 94
Lena original 95
Lena horizontal high-pass 96
Lena horizontal low-pass 97
Lena low + high-pass subsampled 98
1-level 2-D wavelet decomposition 99
2-level 2-D wavelet decomposition 100
3-level 2-D wavelet decomposition 101
JPEG 2000 (Quantization) 102
JPEG 2000 (Quantization) 103
JPEG 2000 (Quantization) Bit-plane coding 104
JPEG 2000 (Tier-1 Coding) 105
Entropy Coding JPEG 2000 (Tier-1 Coding) 106
JPEG 2000 (Tier-1 Coding) Entropy coder blocks 107
JPEG 2000 (Tier-1 Coding) 108
JPEG 2000 (Tier-1 Coding) 109
JPEG 2000 (Tier-1 Coding) 110
JPEG 2000 (Tier-1 Coding) 111
JPEG 2000 (Tier-1 Coding) 112
JPEG 2000 (Tier-1 Coding) 113
JPEG 2000 (Tier-1 Coding) 114
JPEG 2000 (Tier-1 Coding) 115
JPEG 2000 (Tier-1 Coding) 116
JPEG 2000 (Tier-1 Coding) 117
JPEG 2000 (Tier-1 Coding) 118
JPEG 2000 (Tier-2 Coding) 119
JPEG vs. JPEG 2000 original JPEG 2000 (43:1) JPEG (43:1) 120