Download presentation
Presentation is loading. Please wait.
Published byJason Powers Modified over 9 years ago
1
The JPEG Standard J. D. Huang Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC
2
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 2 1. Introduction JPEG standard is a collaboration among : –International Telecommunication Union (ITU) –International Organization for Standardization (ISO) –International Electrotechnical Commission (IEC) The official names of JPEG : –Joint Photographic Experts Group –ISO/IEC 10918-1 Digital compression and coding of continuous-tone still image –ITU-T Recommendation T.81
3
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 3 1. Introduction JPEG have the following mods : –Lossless mode, predictive coding –Sequential mode, DCT-based coding –Progressive mode, DCT-based coding –Hierarchical mode Baseline system –Sequential mode, DCT-based coding, Huffman coding for entropy encoding –The most widely used mode in practice
4
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 4 1. Introduction Color components (Y, C b, or C r ) 8 8 FDCT Quantizer Quantization Table Zig-zag reordering Difference Encoding Huffman coding JPEG bit-stream Huffman Table Figure 1. Baseline JPEG encoder AC DC
5
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 5 2. Color Space Conversion (a) translate from RGB to YC b C r (b) translate from YC b C r to RGB
6
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 6 3. Downsampling Y W H CbCb W H CrCr W H Y W H Y W H CbCb W CrCr W H H (a) 4:4:4(b) 4:2:2(c) 4:2:0 CbCb W H CrCr W H Figure 2. Three color format in the baseline system
7
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 7 4. Discrete Cosine Transform Forward DCT: Inverse DCT:
8
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 8 4. Discrete Cosine Transform 0 1 2 3 4 5 6 7 u v The 8x8 DCT basis
9
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 9 4. Discrete Cosine Transform Example : Y the luminance of an image W H 8x8 values of luminance 48394068603850121 14982791011131062762 5863776912410774125 8097745459719166 1834334664613237 14910880106116617392 21123315988107158161109 21210440447113611366 8x8 DCT coefficiences DCT 699.2543.1855.2572.1124.00-25.5111.21-4.14 -129.78-71.50-70.26-73.3559.43-24.0222.61-2.05 85.7130.3261.7844.8714.8417.3515.51-13.19 -40.8110.17-17.53-55.8130.50-2.28-21.00-1.26 -157.50-49.3913.27-1.78-8.7522.47-8.47-9.23 92.49-9.0345.72-48.13-58.51-9.01-28.5410.38 -53.09-62.97-3.49-19.6256.09-2.25-3.2811.91 -20.54-55.90-20.59-18.19-26.58-27.078.470.31
10
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 10 5. Quantization 1611101624405161 12 141926586055 1413162440576956 1417222951878062 182237566810910377 243555648110411392 49647887103121120101 7292959811210010399 1718244799 1821266699 24265699 476699 Figure 3. Luminance and Chrominance quantization matrix
11
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 11 5. Quantization Example : F(u,v) 8x8 DCT coefficiences 1611101624405161 12 141926586055 1413162440576956 1417222951878062 182237566810910377 243555648110411392 49647887103121120101 7292959811210010399 Q(u,v) Quantization matrix 699.2543.1855.2572.1124.00-25.5111.21-4.14 -129.78-71.50-70.26-73.3559.43-24.0222.61-2.05 85.7130.3261.7844.8714.8417.3515.51-13.19 -40.8110.17-17.53-55.8130.50-2.28-21.00-1.26 -157.50-49.3913.27-1.78-8.7522.47-8.47-9.23 92.49-9.0345.72-48.13-58.51-9.01-28.5410.38 -53.09-62.97-3.49-19.6256.09-2.25-3.2811.91 -20.54-55.90-20.59-18.19-26.58-27.078.470.31
12
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 12 5. Quantization Example : 43.703.935.524.511.00-0.640.22-0.07 -10.82-5.96-5.02-3.862.29-0.410.38-0.04 6.122.333.861.870.370.300.22-0.24 -2.910.60-0.80-1.920.60-0.03-0.26-0.02 -8.75-2.250.36-0.03-0.130.21-0.08-0.12 3.85-0.260.83-0.75-0.72-0.09-0.250.11 -1.08-0.98-0.04-0.230.54-0.02-0.030.12 -0.29-0.61-0.22-0.19-0.24-0.270.080.00 44465100 -11-6-5-42000 62420000 -31-21000 -9-2000000 401 000 001000 0 000000
13
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 13 6. Zig-Zag Reordering 015614152728 2471316262942 38121725304143 911182431404453 1019233239455254 2022333846515560 2134374750565961 3536484957586263 Figure 4. Zig-Zag reordering matrix
14
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 14 6. Zig-Zag Reordering 44465100 -11-6-5-42000 62420000 -31-21000 -9-2000000 401 000 001000 0 000000 Example : Zig-Zag Reordering : 44, 4,-11, 6,-6,6, 5,-5,2,-3, -9,1,4,-4,1, -1,2,2,-1,-2,4, -1,0,0,-2,0,0,0, 0,0,0,1,0,1,-1,0, -1,0,-1,0,0,0,0, 0,0,0,-1,0,0, 0,1,0,0,0, 0,0,0,0, 0,0,0, 0,0, 0
15
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 15 7. Zero Run Length Coding Example 1 63 AC coefficience: 57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,..., 0 Run Length Coding : (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; EOB Example 2 63 AC coefficience: 57, 0, 0,..., 0, 3, 0, 0, 0, 0, 2, 0, 0,..., 0, 895, EOB Run Length Coding : (0,57) ; (15,0) ; (2,3) ; (4,2) ; (15,0) ; (15,0) ; (1,895) ; (0,0) 50 zeros 18 zeros33 zeros (0,0)
16
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 16 8. Difference Coding DC i 1 DC i … … DC 1 DC 0 0 … … Encode : Diff i = DC i DC i 1 Decode : DC i = DC i 1 + Diff i Figure 5. DCs of 8 8 blocks block 1 block i 1 block i Diff 1 =DC 1 Diff i 1 = DC i 1 DC i 2 Diff i = DC i DC i 1
17
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 17 9. Huffman Coding CategoryValuesBits for the value 1-1,10,1 2-3,-2,2,300,01,10,11 3-7,-6,-5,-4,4,5,6,7000,001,010,011,100,101,110,111 4-15,...,-8,8,...,150000,...,0111,1000,...,1111 5-31,...,-16,16,...3100000,...,01111,10000,...,11111 6-63,...,-32,32,...63000000,...,011111,100000,...,111111 7-127,...,-64,64,...,1270000000,...,0111111,1000000,...,1111111 8-255,..,-128,128,..,255... 9-511,..,-256,256,..,511... 10-1023,..,-512,512,..,1023... 11-2047,..,-1024,1024,..,2047... Figure 6. Table of values and bits for the value
18
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 18 9. Huffman Coding Example Run lenth coding of 63 AC coefficiences : (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-8) ; (2,1) ; (0,0) Encode the right value of these pair as category and bits for the value, except the special markers like (0,0) or (15,0) : (0,6,111001) ; (0,6,101101) ; (4,5,10111); (1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0) The difference of DC coefficience : -511 Encode the value as category and bits for the value : 9, 000000000
19
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 19 9. Huffman Coding run/categorycode lengthcode word 0/041010... 0/671111000... 0/10161111111110000011 1/141100... 1/51111111110110... 4/5161111111110011000... 15/10161111111111111110 Figure 7. Huffman table of luminance AC coefficience
20
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 20 9. Huffman Coding categorycode lengthcode word 0200 13010 23011 33100 43101 53110 641110 7511110 86111110 971111110 10811111110 119111111110 Figure 8. Huffman table of luminance DC coefficience
21
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 21 9. Huffman Coding Example The AC coefficiences : (0,6,111001) ; (0,6,101101) ; (4,5,10111); (1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0) Encode the left two value in () using Huffman encoding : 1111000 111001, 1111000 101101, 1111111110011000 10111, 11111110110 00001, 1011 0111, 11100 1, 1010 The DC coefficience : 9, 000000000 Encode the category using Huffman encoding : 1111110 000000000
22
Graduate Institute of Communication Engineering, National Taiwan University, Taipei, Taiwan, ROC 22 End
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.