Top Banner
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary
33

JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Jan 08, 2018

Download

Documents

Buddy Hunt

Multimedia Storage/Bandwidth Requirements GB. ~922 GB. 221 Mbits/sec.60 mins. Video NTSC HDTV ~307KB. ~922KB. 640  480 Image Gray scale (8-bit) Color (24-bit)‏ 635MB. 28.8MB Mbits/lsec. 64Kbits/sec. 60 mins Audio CD-DA quality Speech quality StorageBandwidthDuration/SizeMedia type
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

JPEG Image Compression Standard

Introduction Lossless and Lossy Coding

Schemes JPEG Standard Details Summary

Page 2: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Need for Compression

Multimedia data need Huge storage space Large Bandwidth for transmission

Storage, Bandwidth Requirements are usually much greater than availability

Compression is viable technique

Page 3: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Multimedia Storage/Bandwidth Requirements

99.45 GB.~922 GB.

221 Mbits/sec.60 mins.VideoNTSCHDTV

~307KB.~922KB.

640 480Image

Gray scale (8-bit) Color (24-bit)

635MB. 28.8MB.

1.412 Mbits/lsec. 64Kbits/sec.

60 minsAudio

CD-DA quality Speech quality

StorageBandwidthDuration/SizeMedia type

Page 4: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

JPEG Image Compression Standard

• JPEG : Joint Photographic Experts Group

• Standard for continuous tone still images

• Widely used standard

• New Standard : JPEG 2000 (being worked out)

Page 5: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Hybrid Technique: User Several Coding Techniques

•DCT Coding

•Run Length Encoding(RLE)

•Huffman Coding

JPEG Components

Page 6: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

JPEG Modes

Four Modes:

• Lossless JPEG

• Sequential (Baseline) JPEG

• Progressive JPEG

• Hierarchical JPEG

Page 7: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Lossless JPEG

• Uses Linear Predictive Technique

• Provides 8 prediction schemes

• Residual Image derived from original and predicted images

• Residual Image encoded using Entropy coding

Page 8: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Predication Kernel and Modes

2

2

2

0

bay

caby

cbay

cbaycybyay

y

Lossless JPEG prediction kernel

c

a x

b

Page 9: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Baseline JPEG

• Level-shift the image is by subtracting 2n-1 from each pixel value, where n is the number of bits used to represent each pixel

• Divide the image into non-overlapping blocks of size 8 x 8

• Apply DCT to each of the blocks to obtain the transform coefficients

• Quantize the coefficients using a table specified by the standard, which contains the quantizer step sizes

• Order the quantized coefficients using the zigzag ordering

• Encode the ordered quantized values using a variable bit length entropy coder (Huffman coding tables)

Page 10: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Baseline JPEG encoding and decoding

Page 11: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Conventional and zig-zag ordering in an 8x8 matrix

Page 12: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Baseline JPEG

• DC Coefficient :

• First coefficient in every 8 x 8 block

• Represents the average value of pixels in block

• AC Coefficients : Remaining 63 coefficients in every 8 x 8 block

• DC Coefficients: treated separately from the AC Coefficients

• Differential values of DC coeffs. of all blocks are derived and encoded

Page 13: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

DC Coefficient Encoding

• 8 bit/pixel DC Coefficient range : 11 bits

• Differential DC value range : 12 bits

• Category Table for differential DC values available

• 12 entries in category Table

• SSSS : index to category table for differential DC values

• Huffman Table available for SSSS

Page 14: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Category Table for DC coefficients

0-1,1

-3,-2,2,3-7...-4,4...7

15...-8,8...15-31...-16,16...31-63...-32,32...63

-127...-33,33...127-255...-128,128...255-511...-256,256...511

-1023...-512,512...1023-2047...-1024,1024...2047

0123456789

1011

Differential DC coefficient valuesSSSS

Page 15: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

DC Coefficient Encoding

• Form Differential DC coefficients, Di

• For each Di determine SSSS

• Relative Magnitude of Gi within the category : Mi

• Determine Sign : Gi =1 if Di 0; Gi = 0 if Di<0

• Lookup code for SSSS in the Huffman Table, (say Vi)

• Form Vi . Gi . Mi ( ‘.’ : concatenation)

• Encoding of Di : Vi . Gi . Mi

Page 16: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

AC Coefficient Encoding

• Category Table for AC coefficients available

• Huffman Table for category numbers available

• Express non-zero AC coefficients as : NNNNSSSS

• NNNN : Runlength, R

• NNNN : Number of zeroes between previous and current non-zero AC coefficients

• Runlength 16 : 11110000

• Runlength >16 : qr , where q = Rdiv16 ; r=Rmod16

• SSSS : Index into Category Table

Page 17: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

-1,1-3,-2,2,3

-7...-4,4...715...-8,8...15

-31...-16,16...31-63...-32,32...63

-127...-33,33...127-255...-128,128...255-511...-256,256...511

-1023...-512,512...1023

123456789

10

AC coefficient valuesSSSS

Category Table for AC Coefficients

Page 18: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

AC Coefficient Encoding

•16 possible Run Lengths (0-15) : NNNN

•10 categories for AC values : SSSS

• Two special codes:

• Runlength of 16 : 11110000

• End of Block (EOB) : 00000000

• Huffman Table Size : 16 * 10 + 2 = 162

Page 19: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

AC Coefficient Encoding

• Express AC coefficients Ai as NNNNSSSS

• Determine Vi the Huffman code corresponding to NNNNSSSS

• Determine Mi : relative magnitude of Ai within the category

• Mi = (k-1) bits of the 1’s complement of Ai

• k : category number

• Sign Gi : 1 if Ai 0; 0 if Ai<0

• Encoding of Ai : Vi . Gi . Mi ( ‘.’ : concatenation)

Page 20: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Example

X =

Y =

Apply 2-D DCT

Quantize

Page 21: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Example (Contd.)

Z =

ZigZag Ordering

(39 –3 2 1 –1 1 0 0 0 0 0 –1 EOB)

(100101/0100/0110/001/000/001/11110100/1010)

Huffman Encode

Page 22: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Progressive JPEG

• Formation of coefficients and Quantization similar to Baseline JPEG

• Each coefficient coded in mulitple scans

• Each succesive scan refines Image

• Two types:

• Spectral Selection

• Successive Approximation

Page 23: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Progressive: Spectral Selection

Page 24: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Progressive: Successive Approximation

Page 25: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Hierarchical JPEG

• Provides Progressive Representations

• Provides Multiple Resolutions

• Requires more space

Page 26: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Hierarchical JPEG Outline

• Filter and down sample the original image by the desired number of multiples of 2 in each dimension

• Encode reduced-size image using either sequential DCT: progressive DCT , or lossless encoders

• Decode this reduced-size image and then interpolate and upsample it by 2, horizontally and/or vertically, using the identical interpolation filter which the receiver (decoder) will use.

• Use the obtained upsampled image as a prediction of the original, and encode the image difference (error) using one of the encoders

• Go to Step 1 until the full resolution is encoded

Page 27: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Hierarchical Encoder

Page 28: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Handling Color Images

• Consider the R, G and B components

Color Image

Apply

JPEG Compression

R-Component

B-Component

G-Component

Apply

JPEG Compression

Apply

JPEG Compression

Page 29: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Handling Color Images(contd.)

•Transform (RGB) to another representation

Color Image

Apply

JPEG Compression

Y-component(Luminance)

Apply

JPEG Compression

Transform to

Y Cr Cb

or

YUVCr, Cb component

(Chrominance)

Subsample

by 2

in H & V

Page 30: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Summary of JPEG Modes

1. Lossless Mode

• Coding: Predictive, sequential.

• Resolution: From two bits per pixel to 16 bits per pixel

• Huffman coding or arithmetic coding; four DC tables.

• Interleaved and noninterleaved scans.

Page 31: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

1. Baseline Mode

• Coding: DCT-based, sequential, one to four color components.

• Resolution:eight bits per pixel.

• Huffman coding; two AC and two DC tables.

• Interleaved and noninterleaved scans

Summary of JPEG Modes(Contd.)

Page 32: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Summary of JPEG Modes(contd.)

• . Progressive Mode

• Coding: DCT-based, progressive.

• Spectral selection, Successive Approximation.

• Resolution: 8 or 12 bits per pixel.

• Huffman coding or arithmetic coding; four AC and four DC tables.

• Interleaved and noninterleaved scans

Page 33: JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.

Summary of JPEG Modes(contd.)

• Hierarchical Mode

• Coding: DCT-based or lossless process.

• Multiple frames(non differential and differential).

• Interleaved and noninterleaved scans.