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.

Slides:



Advertisements
Similar presentations
JPEG DCT Quantization FDCT of 8x8 blocks.
Advertisements

SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
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)
Data Compression Basics
JPEG Still Image Data Compression Standard
Hao Jiang Computer Science Department Sept. 27, 2007
Case Study ARM Platform-based JPEG Codec HW/SW Co-design
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
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.
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
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.
CM613 Multimedia storage and retrieval Lecture: Lossy Compression Slide 1 CM613 Multimedia storage and retrieval Lossy Compression D.Miller.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
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.
ENEE631 Digital Image Processing (Spring'04) Transform Coding and JPEG Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park 
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
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
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.
Chapter 9 Image Compression Standards 9.1 The JPEG Standard 9.2 The JPEG2000 Standard 9.3 The JPEG-LS Standard 9.5 Further Exploration Li & Drew1.
Compression There is need for compression: bandwidth constraints of multimedia applications exceed the capability of communication channels Ex. QCIF bit.
Compression video overview 演講者:林崇元. Outline Introduction Fundamentals of video compression Picture type Signal quality measure Video encoder and decoder.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4) Klara Nahrstedt Spring 2014.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
The JPEG Standard J. D. Huang Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC.
M. Wu: ENEE631 Digital Image Processing (Spring'09) Subband and Wavelet Coding Spring ’09 Instructor: Min Wu Electrical and Computer Engineering Department,
JPEG (Joint Photographic Expert Group)
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission ( ) Image Compression Quantization independent samples uniform and optimum correlated.
JPEG.
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.
Block-based coding Multimedia Systems and Standards S2 IF Telkom University.
Introduction to JPEG m Akram Ben Ahmed
Image Processing Architecture, © Oleh TretiakPage 1Lecture 7 ECEC 453 Image Processing Architecture Lecture 8, February 5, 2004 JPEG: A Standard.
JPEG. Introduction JPEG (Joint Photographic Experts Group) Basic Concept Data compression is performed in the frequency domain. Low frequency components.
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission ( ) JPEG block based transform coding.... Why DCT for Image transform? DFT DCT.
1 Chapter 4: Compression (Part 2) Image Compression.
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.
Image Compression-JPEG. Lossless and Lossy Compression Lossless Lossy 144:1.
M. Wu: ENEE631 Digital Image Processing (Spring'09) Transform Coding and JPEG Spring ’09 Instructor: Min Wu Electrical and Computer Engineering Department,
MP3 and AAC Trac D. Tran ECE Department The Johns Hopkins University Baltimore MD
JPEG Compression What is JPEG? Motivation
Chapter 9 Image Compression Standards
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
JPEG Image Coding Standard
Discrete Cosine Transform
JPEG.
Image Compression Standards (JPEG)
CMPT 365 Multimedia Systems
JPEG Still Image Data Compression Standard
The JPEG Standard.
Presentation transcript:

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.

Transform Coding

Lecture Overview We will talk first about the structure of transform coding –Zonal vs. Threshold Coding –Block Size Issues –Why should we Zig-Zag? JPEG –The Steps in the Process –Quantization –Subsampling of chrominance –Lossless part of JPEG

Transform Coding Use transform to pack energy to only a few coeff. How many bits to be allocated for each coeff.? –More bits for coeff. with high variance  k 2 to keep total MSE small –Also determined by perceptual importance From Jain’s Fig.11.15

Zonal Coding and Threshold Coding Zonal coding –Only transmit a small predetermined zone of transformed coeff. Threshold coding –Transmit coeff. that are above certain thresholds Compare – Threshold coding is inherently adaptive u introduce smaller distortion for the same # of coded coeff. – Threshold coding needs overhead in specifying index of coded coeff. u run-length coding helps to reduce overhead

Determining Block Size Why block based? –High transform computation complexity for large block u O( m log m  m ) per block in tranf. for (MN/m 2 ) blocks u complexity in bit allocation –Block transform captures local info. better than global transform Rate & complexity vs. block size –Commonly used block size ~ 8x8 From Jain’s Fig complexity

Block-based Transform Coding Encoder –Step-1 Divide an image into m x m blocks and perfrom transform –Step-2 Determine bit-allocation for coefficients –Step-3 Design quantizer and quantize coefficients (lossy!) –Step-4 Encode quantized coefficients Decoder From Jain’s Fig.11.17

How to Encode Quantized Coeff. in Each Block Basic tools –Entropy coding (Huffman, etc.) and run-length coding –Predictive coding ~ esp. for DC Ordering –zig-zag scan for block-DCT to better achieve run-length coding gain Horizontal frequency Vertical frequency DC AC 01 AC 07 AC 70 AC 77  low-frequency coefficients, then high frequency coefficients

Summary: List of Compression Tools Lossless encoding tools –Entropy coding: Huffman, Lemple-Ziv, and others (Arithmetic coding) –Run-length coding Lossy tools for reducing redundancy –Quantization: scalar quantizer vs. vector quantizer –Truncations: discard unimportant parts of data Facilitating compression via Prediction –Encode prediction parameters and residues with less bits Facilitating compression via Transforms –Transform into a domain with improved energy compaction

Put Basic Tools Together: JPEG Image Compression Standard

JPEG Compression Standard (early 1990s) JPEG - Joint Photographic Experts Group –Compression standard of generic continuous-tone still image –Became an international standard in 1992 Allow for lossy and lossless encoding of still images –Part-1 DCT-based lossy compression u average compression ratio 15:1 –Part-2 Predictive-based lossless compression Sequential, Progressive, Hierarchical modes –Sequential ~ encoded in a single left-to-right, top-to-bottom scan –Progressive ~ encoded in multiple scans to first produce a quick, rough decoded image when the transmission time is long –Hierarchical ~ encoded at multiple resolution to allow accessing low resolution without full decompression

Baseline JPEG Algorithm “Baseline” –Simple, lossy compression u Subset of other DCT-based modes of JPEG standard A few basics –8x8 block-DCT based coding –Shift to zero-mean by subtracting 128  [-128, 127] u Allows using signed integer to represent both DC and AC coeff. –Color ( YCbCr / YUV ) and downsample u Color components can have lower spatial resolution than luminance –Interleaving color components (Based on Wang’s video book Chapt.1)

Block Diagram of JPEG Baseline From Wallace’s JPEG tutorial (1993)

475 x 330 x 3 = 157 KB luminance From Liu’s EE330 (Princeton)

RGB Components From Liu’s EE330 (Princeton)

Y U V (Y Cb Cr) Components Assign more bits to Y, less bits to Cb and Cr From Liu’s EE330 (Princeton)

Lossless Coding Part in JPEG Differentially encode DC –(lossy part: DC differences are then quantized.) AC coefficients in one block – Zig-zag scan after quantization for better run-length u save bits in coding consecutive zeros – Represent each AC run-length using entropy coding u use shorter codes for more likely AC run-length symbols

Lossy Part in JPEG Quantization (adaptive bit allocation) –Different quantization step size for different coeff. bands –Use same quantization matrix for all blocks in one image –Choose quantization matrix to best suit the image –Different quantization matrices for luminance and color components Default quantization table –“Generic” over a variety of images Quality factor “Q” –Scale the quantization table –Medium quality Q = 50% ~ no scaling –High quality Q = 100% ~ unit quantization step size –Poor quality ~ small Q, larger quantization step u visible artifacts like ringing and blockiness

How Quantization is Performed Suppose you have an 8x8 DCT image X(u,v) The quantizer output is: I(u,v)=Round(X(u,v)/Q(u,v)) This rounds to the nearest integer Here, Q(u,v) is a quantization table. The default luminance table for JPEG is presented on the right What to note: –Smaller Q(u,v) means a smaller step size and hence more resolution –Vice-versa –Q(u,v) may be scaled by a quality factor

Uncompressed (100KB) JPEG 75% (18KB) JPEG 50% (12KB)JPEG 30% (9KB)JPEG 10% (5KB)

JPEG Compression (Q=75% & 30%) 45 KB 22 KB From Liu’s EE330 (Princeton)

Y Cb Cr After JPEG (Q=30%) From Liu’s EE330 (Princeton) JPEG Cb JPEG Cr

Lossless Coding Part in JPEG: Details Differentially encode DC –( SIZE, AMPLITUDE ), with amplitude range in [-2048, 2047] AC coefficients in one block – Zig-zag scan for better run-length – Represent each AC with a pair of symbols u Symbol-1: ( RUNLENGTH, SIZE )  Huffman coded u Symbol-2: AMPLITUDE  Variable length coded RUNLENGTH  [0,15] # of consecutive zero-valued AC coefficients preceding the nonzero AC coefficient  [0,15] SIZE  [0 to 10 in unit of bits] # of bits used to encode AMPLITUDE AMPLITUDE  in range of [-1023, 1024]

Table is from slides at Gonzalez/ Woods DIP book website (Chapter 8)