CS 414 Multimedia Systems Design Lecture 9 JPEG

  • Slides: 35
Download presentation
CS 414 – Multimedia Systems Design Lecture 9 – JPEG 2000 Compression (Part 4)

CS 414 – Multimedia Systems Design Lecture 9 – JPEG 2000 Compression (Part 4) Klara Nahrstedt Spring 2010 CS 414 - Spring 2010

Administrative MP 1 deadline today, February 8 n Demonstrations, Monday, February 8, 57 pm

Administrative MP 1 deadline today, February 8 n Demonstrations, Monday, February 8, 57 pm in 0216 SC n MP 2 will be posted tomorrow, February 9 n MP 2 deadline, Monday, March 1 n CS 414 - Spring 2010

Outline n JPEG Compression ¨ Quantization ¨ Zig-Zag ¨ RLE/Huffman Entropy Coding n JPEG-2000

Outline n JPEG Compression ¨ Quantization ¨ Zig-Zag ¨ RLE/Huffman Entropy Coding n JPEG-2000 Compression n Reading: Section 7. 5 in Media Coding book, Steinmetz&Nahrstedt, and http: //en. wikipedia. org/wiki/JPEG_2000 and links in slides CS 414 - Spring 2010

JPEG Steps n Image Preparation ¨ Components Separation ¨ Block Division (8 x 8

JPEG Steps n Image Preparation ¨ Components Separation ¨ Block Division (8 x 8 Blocks) of each Component n Image Processing ¨ Pixel Value Shifting ¨ 2 D DCT Transformation ¨ Creation of DC and AC Coefficients Quantization n Entropy Coding n CS 414 - Spring 2010

Quantization n n Throw out bits Consider example: 1011012 = 45 (6 bits) We

Quantization n n 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) ¨ n n 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 2010

De facto Quantization Table Eye becomes less sensitive 16 11 10 16 24 40

De facto Quantization Table Eye becomes less sensitive 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 55 14 13 16 24 40 57 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 Eye becomes less sensitive CS 414 - Spring 2010

Entropy Encoding n Compress sequence of quantized DC and AC coefficients from quantization step

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

DC Encoding n DC represents average intensity of a block ¨ encode using difference

DC Encoding n DC represents average intensity of a block ¨ encode using difference encoding scheme ¨ use 3 x 3 pattern of blocks n 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 2010

Difference Coding applied to DC Coefficients CS 414 - Spring 2010

Difference Coding applied to DC Coefficients CS 414 - Spring 2010

AC Encoding n Use zig-zag ordering of coefficients ¨ orders frequency components from low->high

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

Huffman Encoding n Sequence of DC difference indices and values along with RLE of

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

Interchange Format of JPEG CS 414 - Spring 2010

Interchange Format of JPEG CS 414 - Spring 2010

Example - One Everyday Photo 2. 76 M CS 414 - Spring 2010

Example - One Everyday Photo 2. 76 M CS 414 - Spring 2010

Example - One Everyday Photo 600 K CS 414 - Spring 2010

Example - One Everyday Photo 600 K CS 414 - Spring 2010

Example - One Everyday Photo 350 K CS 414 - Spring 2010

Example - One Everyday Photo 350 K CS 414 - Spring 2010

Example - One Everyday Photo 240 K CS 414 - Spring 2010

Example - One Everyday Photo 240 K CS 414 - Spring 2010

Example - One Everyday Photo 144 K CS 414 - Spring 2010

Example - One Everyday Photo 144 K CS 414 - Spring 2010

Example - One Everyday Photo 88 K CS 414 - Spring 2010

Example - One Everyday Photo 88 K CS 414 - Spring 2010

JPEG-2000 Original (uncompressed TIF 116 KB JPEG (8: 1, 14 KB) JPEG-2000 (8: 1,

JPEG-2000 Original (uncompressed TIF 116 KB JPEG (8: 1, 14 KB) JPEG-2000 (8: 1, 14 KB) http: //www. photographical. net/jpeg 2000. html CS 414 - Spring 2010

JPEG-2000 Created in 2000 by JPEG committee n File extension: n ¨ jp 2

JPEG-2000 Created in 2000 by JPEG committee n File extension: n ¨ jp 2 for ISO/IEC 15444 -1 conforming files ¨ image/jp 2 for MIME type CS 414 - Spring 2010

JPEG-2000 Features n Low bit rate compression performance ¨ Current standards offer excellent ratedistortion

JPEG-2000 Features n Low bit rate compression performance ¨ Current standards offer excellent ratedistortion performance in mid and high bit rates ¨ Low bit rate distortions become unacceptable n Lossless and lossy compression ¨ Current standard does not provide superior lossless and lossy compression in a single code-stream CS 414 - Spring 2010

JPEG-2000 n Large Images ¨ Current standard does not allow for images larger than

JPEG-2000 n Large Images ¨ Current standard does not allow for images larger than 64 Kx 64 K pixels without quality degradation n Single decompression architecture ¨ Current standard has 44 modes (application specific, and not used by majority JPEG coders) ¨ Single common decompression architecture can provide greater interchange between applications CS 414 - Spring 2010

JPEG-2000 Features n Transmission in noisy environment ¨ Current standard has provision for restart

JPEG-2000 Features n Transmission in noisy environment ¨ Current standard has provision for restart intervals, but image degrades badly when bit errors occur. n Computer generated imagery (Graphics) ¨ Current n standard is optimized only for natural imagery Compound documents ¨ Current standard is not applied to compound documents because of its poor performance when applied to text imagery CS 414 - Spring 2010

JPEG-2000 Criteria n Superior low bit rate performance ¨ Below 0. 25 bits per

JPEG-2000 Criteria n Superior low bit rate performance ¨ Below 0. 25 bits per pixel for highly detailed grey-scale images n Lossless and lossy compression ¨ Lossless compression uses progressive decoding (i. e. , difference image encoding) for medical imaging n Progressive transmission by pixel accuracy and resolution ¨ Reconstruction of images is possible with different resolutions and pixel accuracy for different target devices CS 414 - Spring 2010

JPEG-2000 Criteria n Random code-stream access and processing ¨ Needed in case images have

JPEG-2000 Criteria n Random code-stream access and processing ¨ Needed in case images have parts that are more important than others ¨ User defines “regions-of-interest” in the image to be randomly accessed and/or decompressed with less distortion than the rest of images ¨ random code-stream processing allows operations: rotation, translation, filtering, feature extraction, scaling, … CS 414 - Spring 2010

Methods of Compression n DCT-based coder ¨ New baseline JPEG algorithm required for backward

Methods of Compression n DCT-based coder ¨ New baseline JPEG algorithm required for backward compatibility with existing JPEG n Wavelet-based coder ¨ This method permits coding of still images with high coding efficiency as well as spatial and SNR (signal-to-noise ratio) scalability at fine granularity (see also tutorial – part 1/part 2/part 3 http: //users. rowan. edu/~polikar/WAVELETS/WTpart 1. html) CS 414 - Spring 2010

Wavelet Transform n JPEG-2000 uses two different wavelet transforms: ¨ Irreversible: it introduces quantization

Wavelet Transform n JPEG-2000 uses two different wavelet transforms: ¨ Irreversible: it introduces quantization noise that depends on precision of the decoder ¨ Reversible: it uses only integer coefficients, so the output does not need quantization (used in lossless coding) CS 414 - Spring 2010

2 D Wavelet Transform for Image Progressive Transmission CS 414 - Spring 2010

2 D Wavelet Transform for Image Progressive Transmission CS 414 - Spring 2010

Wavelet Transform n n DWT (Discrete Wavelet Transform) extracts information from the source image

Wavelet Transform n n DWT (Discrete Wavelet Transform) extracts information from the source image at different scales, locations and orientations JPEG-2000 uses 2 D wavelets and multi-scale transforms Wavelet is defined as a set of basic functions, derived from the same prototype function Prototype function is known as “mother wavelet” ¨ Examples: “Mexican Hat” wavelet, Haar wavelet CS 414 - Spring 2010

Wavelet Transform Properties n Wavelet transform coders process high and low frequency parts of

Wavelet Transform Properties n Wavelet transform coders process high and low frequency parts of image independently ¨ DCT methods have difficulties with highfrequency information n Wavelet method transforms image as a whole (not subdivided into pixel blocks) ¨ No blocking artifacts occur ¨ Wavelet coders degrade gracefully CS 414 - Spring 2010

Forward Wavelet Transform - Image is first filtered along the x dimension, resulting in

Forward Wavelet Transform - Image is first filtered along the x dimension, resulting in lowpass and high-pass image - Since bandwidth of both low pass and high pass image is now half that of the original image, both filtered images can be down-sampled by factor 2 without loss of information - Then both filtered images are again filtered and downsampled along the y dimension resulting in four sub-images CS 414 - Spring 2010

Wavelet Transform CS 414 - Spring 2010

Wavelet Transform CS 414 - Spring 2010

JPEG-2000 Performance Gain up to about 20% compression performance to the first JPEG standard

JPEG-2000 Performance Gain up to about 20% compression performance to the first JPEG standard n Applications of JPEG-2000 n ¨ Large images ¨ Images with low-contrast edges (e. g. , medical images ¨ In printers, scanners, facsimile ¨ HD satellite images CS 414 - Spring 2010

Applications of Motion JPEG 2000 Leading digital film standard n Supported by Digital Cinema

Applications of Motion JPEG 2000 Leading digital film standard n Supported by Digital Cinema Initiatives for storage, distribution and exhibition of motion pictures n Considered by Library of Congress to be the digital archival format n CS 414 - Spring 2010

Conclusion Artifacts of JPEG-2000 Compression • Compression 1/20 size is without incurring visible artifacts

Conclusion Artifacts of JPEG-2000 Compression • Compression 1/20 size is without incurring visible artifacts • If artifacts occur they can be seen as Smoothing rather than squares or mosquito noise CS 414 - Spring 2010