1 / 24

CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4)

Explore the basics of JPEG compression, including image preparation, processing, quantization, and entropy encoding. Dive deep into the algorithms and techniques to achieve efficient image compression.

sondrat
Download Presentation

CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4)

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. CS 414 – Multimedia Systems DesignLecture 10 – Compression Basics and JPEG Compression (Part 4) Klara Nahrstedt Spring 2014 CS 414 - Spring 2014

  2. Administrative • MP1 is posted CS 414 - Spring 2014

  3. Today Covered Topics • Hybrid Coding: • JPEG Coding CS 414 - Spring 2014

  4. JPEG Compression (Baseline) 8x8 blocks SourceImage Image Preparation B G R DCT-based encoding Compressedimage data FDCT Quantizer EntropyEncoder Image Processing Table Table CS 414 - Spring 2014

  5. 1. Image Preparation • Image Preparation: • Source image consists of components (Ci) and to each component we assign YUV or RGB signals. • Image Component Preparation: • Each component divided into blocks (8x8 pixels) • Image Block Preparation: • Blocks (data units) need to be ordered • Interleaved or non-interleaved block ordering

  6. 2. Image Processing • Shift values [0, 2P - 1] to [-2P-1, 2P-1 - 1] • e.g. if (P=8), shift [0, 255] to [-127, 127] • DCT requires range be centered around 0 • Values in 8x8 pixel blocks are spatial values and there are 64 samples values in each block • Transform values • From spatial intensity to frequency values via FDCT transformation (encoder) and • From frequency to spatial intensity values (decoder) CS 414 - Spring 2014

  7. Equations for 2D DCT • Forward DCT: • Inverse DCT:

  8. Visualization of 2D DCT Basis Functions Increasing frequency Increasing frequency CS 414 - Spring 2014

  9. Coefficient Differentiation • F(0,0) • includes the lowest frequency in both directions • is called DC coefficient • Determines fundamental color of the block • F(0,1) …. F(7,7) • are called AC coefficients • Their frequency is non-zero in one or both directions CS 414 - Spring 2014

  10. 3. Quantization • Throw out bits • Consider example: 1011012 = 45 (6 bits) • We can truncate this string to 4 bits: 10112 = 11 • We can truncate this string to 3 bits: 1012 = 5 (original value 40) or 1102 = 6 (original value 48) • Uniform quantization is achieved by dividing DCT coefficients by N and round the result (e.g., above we used N=4 or N=8) • In JPEG – use quantization tables • Fq(u,v) = F(u,v)/Quv • Two quantization tables – one for luminance and one for two chrominance components CS 414 - Spring 2014

  11. De facto Quantization Table Eye becomes less sensitive Eye becomes less sensitive CS 414 - Spring 2014

  12. 4. Entropy Encoding • Compress sequence of quantized DC and AC coefficients from quantization step • further increase compression, without loss • Separate DC from AC components • DC components change slowly, thus will be encoded using difference encoding CS 414 - Spring 2014

  13. DC Encoding • DC represents average intensity of a block • encode using difference encoding scheme • Because difference tends to be near zero, can use less bits in the encoding • categorize difference into difference classes • send the index of the difference class, followed by bits representing the difference CS 414 - Spring 2014

  14. Difference Coding applied to DC Coefficients CS 414 - Spring 2014

  15. AC Encoding • Use zig-zag ordering of coefficients • orders frequency components from low->high • produce maximal series of 0s at the end • Ordering helps to apply efficiently entropy encoding • Apply Huffman coding • Apply RLE on AC zero values CS 414 - Spring 2014

  16. Huffman Encoding • Sequence of DC difference indices and values along with RLE of AC coefficients • Apply Huffman encoding to sequence • Attach appropriate headers • Finally have the JPEG image! CS 414 - Spring 2014

  17. Interchange Format of JPEG CS 414 - Spring 2014

  18. Example - One Everyday Photo 2.76M CS 414 - Spring 2014

  19. Example - One Everyday Photo 600K CS 414 - Spring 2014

  20. Example - One Everyday Photo 350K CS 414 - Spring 2014

  21. Example - One Everyday Photo 240K CS 414 - Spring 2014

  22. Example - One Everyday Photo 144K CS 414 - Spring 2014

  23. Example - One Everyday Photo 88K CS 414 - Spring 2014

  24. Discussion • What types of image content would JPEG work best (worst) for? • Is image compression solved? • What’s missing from JPEG? CS 414 - Spring 2014

More Related