Unformatted text preview:

ECE160Spring 2008Lecture 9Image Compression Standards1ECE160 / CMPS182MultimediaLecture 9: Spring 2008Image Compression StandardsECE160Spring 2008Lecture 9Image Compression Standards2The JPEG Standard• JPEG is an image compression standard that wasdeveloped by the “Joint Photographic Experts Group".JPEG was formally accepted as an internationalstandard in 1992.• JPEG is a lossy image compression method.It employs a transform coding method using the DCT(Discrete Cosine Transform).• An image is a function of i and j (conventionally x and y)in the spatial domain.• The 2D DCT is used as one step in JPEG in order toyield a frequency response which is a function F(u,v)in the spatial frequency domain,indexed by two integers u and v.ECE160Spring 2008Lecture 9Image Compression Standards3Observations forJPEG Image Compression• Observation 1: Useful image contents change relativelyslowly across the image. It is unusual for intensity to varywidely several times in a small area, for example, within an8x8 pixel block.– Much of the information in an image is repeated, hence “spatialredundancy".• Observation 2: Psychophysical experiments show thathumans are less likely to notice the loss of high spatialfrequency components than the loss of lower frequencycomponents.– The spatial redundancy can be reduced by reducing the highspatial frequency contents.• Observation 3: Visual acuity (accuracy in distinguishingclosely spaced lines) is greater for gray (“black and white")than for color.– chroma subsampling (4:2:0) is used in JPEG.ECE160Spring 2008Lecture 9Image Compression Standards4Main Steps inJPEG Image Compression• Transform RGB to YIQ or YUV andsubsample color.• DCT on image blocks.• Quantization.• Zig-zag ordering and run-length encoding.• Entropy coding.ECE160Spring 2008Lecture 9Image Compression Standards5Block diagram for JPEG encoderECE160Spring 2008Lecture 9Image Compression Standards6Block diagram for JPEG encoderECE160Spring 2008Lecture 9Image Compression Standards7DCT on Image Blocks• Each image is divided into 8 8 blocks.The 2D DCT is applied to each blockimage f(i,j), with output being the DCTcoefficients F(u,v) for each block.• Using blocks has the effect of isolatingeach block from its neighboring context.This is why JPEG images look choppy(“blocky") when a high compression ratiois specified by the user.ECE160Spring 2008Lecture 9Image Compression Standards8Block diagram for JPEG encoderECE160Spring 2008Lecture 9Image Compression Standards9Quantization• F(u,v) represents a DCT coefficient,Q(u,v) is a “quantization matrix" entry, andF(u,v) represents the quantized DCT coefficientswhich JPEG will use in the succeeding entropy coding.– The quantization step is the main source for loss in JPEGcompression.– The entries of Q(u,v) tend to have larger values towards thelower right corner. This introduces more loss at the higher spatialfrequencies - a practice supported by Observations 1 and 2.– The Luminance Quantization Table and The ChrominanceQuantization Table provide the default Q(u,v) values obtainedfrom psychophysical studies to maximize the compression ratiowhile minimizing perceptual losses in JPEG images.ECE160Spring 2008Lecture 9Image Compression Standards10Luminance Quantization TableECE160Spring 2008Lecture 9Image Compression Standards11Chrominance Quantization TableECE160Spring 2008Lecture 9Image Compression Standards12JPEG compressionfor a smooth image blockAn 8x8 block fromthe Y image of `Lena'ECE160Spring 2008Lecture 9Image Compression Standards13JPEG compressionfor a smooth image blockECE160Spring 2008Lecture 9Image Compression Standards14JPEG compressionfor a textured image blockAnother 8x8 block fromthe Y image of `Lena'ECE160Spring 2008Lecture 9Image Compression Standards15JPEG compressionfor a textured image blockECE160Spring 2008Lecture 9Image Compression Standards16Block diagram for JPEG encoderECE160Spring 2008Lecture 9Image Compression Standards17Run-length Coding (RLC)on AC coefficients• RLC aims to turn the F(u,v) values into sets{#-zeros-to-skip , next non-zero value}.• To make a long run of zeros more likely,a zig-zag scan is used on the 8x8 matrix F(u,v)ECE160Spring 2008Lecture 9Image Compression Standards18Block diagram for JPEG encoderECE160Spring 2008Lecture 9Image Compression Standards19DPCM on DC coefficients• The DC coefficients are coded separatelyfrom the AC ones.• Differential Pulse Code Modulation(DPCM) is the coding method.• If the DC coefficients for the first 5 imageblocks are 150, 155, 149, 152, 144, thenthe DPCM would produce 150, 5, -6, 3, -8,assuming di = DCi+1 − DCi, and d0=DC0.ECE160Spring 2008Lecture 9Image Compression Standards20Block diagram for JPEG encoderECE160Spring 2008Lecture 9Image Compression Standards21Entropy Coding• The DC and AC coefficients finally undergo an entropy coding stepto gain a possible further compression.• Use DC as an example: each DPCM coded DC coefficient isrepresented by (SIZE, AMPLITUDE),– SIZE indicates how many bits are used to represent the coefficient,– AMPLITUDE contains the actual bits.• In the example, codes 150, 5, − 6, 3, − 8 will become(8, 10010110), (3, 101), (3, 001), (2, 11), (4, 0111) .– SIZE is Huffman coded since smallerSIZEs occur more often.– AMPLITUDE is not Huffman coded,its value can change widelyso Huffman coding has no benefit.ECE160Spring 2008Lecture 9Image Compression Standards22Four Common JPEG Modes• Sequential Mode - the default JPEG mode,implicitly assumed in the discussions sofar. Each graylevel image or color imagecomponent is encoded in a singleleft-to-right, top-to-bottom scan.• Progressive Mode.• Hierarchical Mode.• Lossless Mode - discussed in Chapter 7, tobe replaced by JPEG-LSECE160Spring 2008Lecture 9Image Compression Standards23Progressive Mode• Progressive JPEG delivers low quality versions of theimage quickly, followed by higher quality passes.1. Spectral selection: Uses “spectral" (spatial frequencyspectrum) characteristics of the DCT coefficients:higher AC components provide detail information.Scan 1: Encode DC and first few AC components,e.g., AC1, AC2.Scan 2: Encode a few more AC components,e.g., AC3, AC4, AC5....Scan k: Encode the last few ACs,e.g., AC61, AC62, AC63.ECE160Spring 2008Lecture 9Image Compression Standards24Progressive Mode2. Successive approximation:Instead of gradually encoding spectral bands,all DCT coefficients are encoded simultaneouslybut


View Full Document

UCSB ECE 160 - Image Compression Standards

Download Image Compression Standards
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Image Compression Standards and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Image Compression Standards 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?