Klara Nahrstedt Spring 2011

Slides:



Advertisements
Similar presentations
JPEG Compresses real images Standard set by the Joint Photographic Experts Group in 1991.
Advertisements

SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
Department of Computer Engineering University of California at Santa Cruz Data Compression (3) Hai Tao.
JPEG.
SWE 423: Multimedia Systems Chapter 7: Data Compression (4)
Image (and Video) Coding and Processing Lecture: DCT Compression and JPEG Wade Trappe Again: Thanks to Min Wu for allowing me to borrow many of her slides.
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
JPEG Still Image Data Compression Standard
Hao Jiang Computer Science Department Sept. 27, 2007
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
1 JPEG Compression CSC361/661 Burg/Wong. 2 Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg.
Image Compression JPEG. Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg and can be embedded.
Image Compression: JPEG Multimedia Systems (Module 4 Lesson 1)
Image and Video Compression
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
CSE & CSE Multimedia Processing Lecture 7
Introduction to JPEG Alireza Shafaei ( ) Fall 2005.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
JPEG Motivations: Motivations: 1.Uncompressed video and audio data are huge. In HDTV, the bit rate easily exceeds 1 Gbps. --> big problems for.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2011.
Concepts of Multimedia Processing and Transmission IT 481, Lecture 5 Dennis McCaughey, Ph.D. 19 February, 2007.
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Indiana University Purdue University Fort Wayne Hongli Luo
JPEG CIS 658 Fall 2005.
Hardware/Software Codesign Case Study : JPEG Compression.
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
Compression There is need for compression: bandwidth constraints of multimedia applications exceed the capability of communication channels Ex. QCIF bit.
An introduction to audio/video compression Dr. Malcolm Wilson.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4) Klara Nahrstedt Spring 2014.
The JPEG Standard J. D. Huang Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC.
JPEG (Joint Photographic Expert Group)
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.
JPEG.
CS654: Digital Image Analysis
Page 11/28/2016 CSE 40373/60373: Multimedia Systems Quantization  F(u, v) represents a DCT coefficient, Q(u, v) is a “quantization matrix” entry, and.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Introduction to JPEG m Akram Ben Ahmed
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2012.
JPEG. Introduction JPEG (Joint Photographic Experts Group) Basic Concept Data compression is performed in the frequency domain. Low frequency components.
By Dr. Hadi AL Saadi Lossy Compression. Source coding is based on changing of the original image content. Also called semantic-based coding High compression.
An introduction to audio/video compression Prepared by :: Bhatt shivani ( )
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM M ULTIMEDIA OF D ATA C OMPRESSION Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny.
1 Chapter 3 Text and image compression Compression principles u Source encoders and destination decoders u Lossless and lossy compression u Entropy.
JPEG Compression What is JPEG? Motivation
Chapter 9 Image Compression Standards
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
JPEG Image Coding Standard
Discrete Cosine Transform
JPEG.
CMPT 365 Multimedia Systems
Ganbat OIP Lab
JPEG Pasi Fränti
JPEG Still Image Data Compression Standard
The JPEG Standard.
Image Coding and Compression
Presentation transcript:

Klara Nahrstedt Spring 2011 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2011 CS 414 - Spring 2011

Administrative MP1 is posted Extended Deadline of MP1 is February 18 Friday midnight – submit via compass Help-session for MP1 – Wednesday, February 9, 7pm , Room: 1111 SC CS 414 - Spring 2011

Outline Hybrid Coding: JPEG Coding Reading: Section 7.5 out of “Media Coding and Content Processing”, Steinmetz & Nahrstedt, Prentice Hall 2002 CS 414 - Spring 2011

Hybrid Coding (Usage of RLE/Huffman, Arithmetic Coding) CS 414 - Spring 2011

Image Compression and Formats RLE Huffman LZW GIF JPEG / JPEG-2000 (Hybrid Coding) Fractals TIFF, PICT, BMP, etc. CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Ubiquitous use of digital images CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

JPEG (Joint Photographic Experts Group) Requirements: Very good compression ratio and good quality image Independent of image size Applicable to any image and pixel aspect ratio Applicable to any complexity (with any statistical characteristics) CS 414 - Spring 2011

CS 414 - Spring 2011

JPEG Compression Source Image B G R DCT-based encoding 8x8 blocks Source Image Image Preparation B G R DCT-based encoding Compressed image data FDCT Quantizer Entropy Encoder Table Table CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

1. Image Preparation The image preparation is NOT BASED on 9-bit YUV encoding Fixed number of lines and columns Mapping of encoded chrominance Source image consists of components (Ci) and to each component we assign YUV, RGB or TIQ signals. CS 414 - Spring 2011

Division of Source Image into Planes CS 414 - Spring 2011

Components and their Resolutions CS 414 - Spring 2011

Color Transformation (optional) Down-sample chrominance components compress without loss of quality (color space) e.g., YUV 4:2:2 or 4:1:1 Example: 640 x 480 RGB to YUV 4:1:1 Y is 640x480 U is 160x120 V is 160x120 CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Image Preparation (Pixel Allocation) Each pixel is presented by ‘p’ bits, value is in range of (0,2p-1) All pixels of all components within the same image are coded with the same number of bits Lossy modes use precision 8 or 12 bits per pixel Lossless mode uses precision 2 up to 12 bits per pixel CS 414 - Spring 2011

Image Preparation - Blocks Images are divided into data units, called blocks – definition comes from DCT transformation since DCT operates on blocks Lossy mode – blocks of 8x8 pixels; lossless mode – data unit 1 pixel CS 414 - Spring 2011

Data Unit Ordering Non-interleaved: scan from left to right, top to bottom for each color component Interleaved: compute one “unit” from each color component, then repeat full color pixels after each step of decoding but components may have different resolution CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Example of Interleaved Ordering MCU: Minimum Coding Unit CS 414 - Spring 2011 [Wallace, 1991] ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

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 CS 414 - Spring 2011

Forward DCT Convert from spatial to frequency domain convert intensity function into weighted sum of periodic basis (cosine) functions identify bands of spectral information that can be thrown away without loss of quality Intensity values in each color plane often change slowly CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

1D Forward DCT Given a list of n intensity values I(x), where x = 0, …, n-1 Compute the n DCT coefficients: CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Understanding DCT For example, in R3, we can write (5, 2, 9) as the sum of a set of basis vectors Basic functions in R3: [(1,0,0), (0,1,0), (0,0,1)] (5,2,9) = 5*(1,0,0) + 2*(0,1,0) + 9*(0,0,1) DCT is can be also composed as sum of set of basic functions CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

1D DCT Basic Functions Decompose the intensity function into a weighted sum of cosine basis functions CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Visualization of 1D DCT Basic Functions F(0) F(1) F(2) F(3) F(4) F(5) F(6) F(7) CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

1D Inverse DCT Given a list of n DCT coefficients F(u), where u = 0, …, n-1 Compute the n intensity values: CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Extend DCT from 1D to 2D Perform 1D DCT on each row of the block Again for each column of 1D coefficients alternatively, transpose the matrix and perform DCT on the rows Y X ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Equations for 2D DCT Forward DCT: Inverse DCT: ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Visualization of 2D DCT Basis Functions Increasing frequency Increasing frequency CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Coefficient Differentiation 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 2011

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 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

De facto Quantization Table 16 11 10 24 40 51 61 12 14 19 26 58 60 55 13 57 69 56 17 22 29 87 80 62 18 37 68 109 103 77 35 64 81 104 113 92 49 78 121 120 101 72 95 98 112 100 99 Eye becomes less sensitive Eye becomes less sensitive CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

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 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

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 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Difference Coding applied to DC Coefficients CS 414 - Spring 2011

AC Encoding Use zig-zag ordering of coefficients Apply Huffman coding 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 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

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 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Interchange Format of JPEG CS 414 - Spring 2011

Example - One Everyday Photo CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Example - One Everyday Photo 600K CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Example - One Everyday Photo 350K CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Example - One Everyday Photo 240K CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Example - One Everyday Photo 144K CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Example - One Everyday Photo 88K CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign

Discussion What types of image content would JPEG work best (worst) for? Is image compression solved? What’s missing from JPEG? CS 414 - Spring 2011 ORCHID Research Group Department of Computer Science, University of Illinois at Urbana-Champaign