1 / 9

Digital Image Processing Lecture 21: Lossy Compression May 18, 2005

Digital Image Processing Lecture 21: Lossy Compression May 18, 2005. Prof. Charlene Tsai. JPEG Algorithm. Lossy compression trades some acceptable data loss for greater rate of compression. There are many available, but the most popular is the one developed by JPEG – transform coding.

Download Presentation

Digital Image Processing Lecture 21: Lossy Compression May 18, 2005

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital Image Processing Lecture 21: Lossy CompressionMay 18, 2005 Prof. Charlene Tsai

  2. JPEG Algorithm • Lossy compression trades some acceptable data loss for greater rate of compression. • There are many available, but the most popular is the one developed by JPEG – transform coding. • Coding not done on pixel values, but on a transform.

  3. Transform • Discrete Cosine Transform (DCT) • Applying to 8x8 blocks, the forward and inverse DCT are • DCT are real-valued, high information-packing capability, and separable.

  4. Comparison with FFT • Given the following sequence 10 25 40 55 70 85 100 115 • If using FFT, the inverse of the first 4 FFT coefficients gives 49 41 56 57 71 70 85 90 • If using DCT, the result is 11 23 41 56 69 84 102 114

  5. JPEG Compression • For each 8x8 image block, perform the compression • Subtracting 128 from each value • Apply DCT • Normalization by dividing by matrix Q (the lossy part) • Turning most of the elements zero • Change the matrix into a vector by reading the nonzero element in a zigzag fashion.

  6. (con’d) • The first element (DC coefficient) of the vector is encoded as the difference between itself and the DC of previous block. • Keeps all values (except the very first one) small • Compressed using RLE • Other values (AC coefficients) are compressed using Huffman coding • Rate of compression is controlled by scaling Q => more scaling, more compression (see page 413~415 for an example)

  7. Decompression • Inverse the operations: • Decode Huffman encoding and RLE • Put the vector back to 8x8 matrix • Multiply by Q • Inverse DCT • Shift back by 128

  8. The Lossless Parts • Huffman Coding and RLE for AC and DC terms, respectively. • We’ll focus the discussion on the AC terms • Each nonzero value x is assigned a category k • The number of preceding 0s (run). • Values: 7 -1 10 0 2 1 0 0 2 4 0 1 0 -1 • Category: 1 4 2 1 2 3 1 1 • Run: 0 0 1 0 2 0 1 1

  9. Huffman Code Table • Part of JPEG baseline standard • See page 417 and 418 for the code table, and the application.

More Related