Title: Lossy Compression Examples
1Lossy Compression Examples
2JPEG
- Joint Photographic Experts Group
- Defines three different coding systems
- Lossy baseline coding system
- Extended coding system for greater compression
- Lossless independent coding system for reversible
applications - Baseline performed in three sequential steps
- DCT (Discrete Cosine Transform) computation
- Quantization
- Variable-length code assignment
- To start, the image is divided into pixel blocks
of size 8x8 (left to right, top to bottom)
3JPEG (cont.)
- Gray levels are shifted to center L/2 lt gl lt
L/2 - DCT is run on the block producing frequency
components centered on upper left corner. - The DCT 2D block is converted into a 1D string by
using a zig-zag pattern. - The array is quantized.
- A selected number of coordinates is selected
depending on the quality desired. - These values are then encoded using a variable
length coding system. - The binary codes are transmitted.
4JPEG Coding Example
8x8 block of original image
52 55 61 66 70 61 64 73 63 59
66 90 109 85 69 72 62 59 68 113
144 104 66 73 63 58 71 122 154 106
70 69 67 61 68 104 126 88 68 70 79
65 60 70 77 68 58 75 85 71 64
59 55 61 65 83 87 79 69 68 65
76 78 94
5JPEG Coding Example
Level Shifted
-76 -73 -67 -62 -58 -67 -64 -55 -65 -69
-62 -38 -19 -43 -59 -56 -66 -69 -60 -15
16 -24 -62 -55 -65 -70 -57 -6 26 -22
-58 -59 -61 -67 -60 -24 -2 -40 -60
-58 -49 -63 -68 -58 -51 -65 -70 -53 -43
-57 -64 -69 -73 -67 -63 -45 -41 -49 -59
-60 -63 -52 -50 -34
6JPEG Coding Example
DCT
-415 -29 -62 25 55 -20 -1 3 7 -21
-62 9 11 -7 -6 6 -46 8 77 -25
-30 10 7 -5 -50 13 35 -15 -9 6
0 3 11 -8 -13 -2 -1 1 -4
1 -10 1 3 -3 -1 0 2 -1 -4
-1 2 -1 2 -3 1 -2 -1 -1 -1
-2 -1 -1 0 -1
7JPEG Coding Example
DCT Normalized
-26 -3 -6 2 2 0 0 0 1 -2
-4 0 0 0 0 0 -3 1 5 -1
-1 0 0 0 -4 1 2 -1 0 0
0 0 1 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
8JPEG Coding Example
DCT Normalized
-26 -3 -6 2 2 0 0 0 1 -2
-4 0 0 0 0 0 -3 1 5 -1
-1 0 0 0 -4 1 2 -1 0 0
0 0 1 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
EOB indicates remainder are zeros.
-26 -3 1 -3 -2 -6 2 -4 1 -4 1 1 5 0 2 0 0 -1 2 0
0 0 0 0 -1 -1 EOB
9JPEG Coding Example
- Now using a version of Huffman coding categories
and DC differences, you have the sequence - 1010110 0100 001 0100 0101 100001 0110 100011 001
100011 001 001 100101 11100110 110110 0110
11110100 000 1010 - Total number of bits in completely coded
reordered array (and thus the number of bits
necessary to represent the entire 8x8, 8-bit
example sub image) is 92. - The resulting compression ration is 512/92 or
about 5.6 1
10JPEG Dcompression
- Recreate the normalized transform coefficients
using a lookup table. - Denormalize that array.
- Reverse Discrete Cosine Transform.
- Level shift back to normal 0-255 range.
- If you do that, you have something like the
original image, but not exact!
11JPEG 2000
- Extends the initial JPEG standard to provide
increased flexibility in both the compression of
continuous tone still images and access to the
compressed data. - E.g. portions of a JPEG 2000 compressed image can
be extracted for retransmission, storage,
display, and/or editing. - The standard is based on the wavelet coding
techniques.