Title: Lossy Compression
1Chapter 21
2Introduction
- Some applications can tolerate losses of original
data (e.g. voice, video, image) - Compression algorithms offer tradeoffs between
fidelity and compression ratio - typically greater compression lower fidelity
- Chapter Overview
- Discrete Cosine Transform (DCT)
- Wavelet compression
- JPEG compression
- MPEG compression
3Discrete Cosine Transform (DCT)
- Provides one-to-one mapping of an array of pixel
values into an array in the spatial frequency
domain - DCT does not provide any compression, but puts
image information in a form more suitable for
compression - One-dimensional DCT of p(x) (0 ? x ? N)
C(f)
4One-Dimensional DCT - Example
0 white, 255 black
grayscale function is shifted to obtain symmetry
around 0, p(x)
one-dimensional DCT of p(x)
inverse DCT of S(f)
5Discrete Cosine Basic Functions
cos(0)
cos(2x1)4?/16
cos(2x1)?/16
cos(2x1)5?/16
cos(2x1)6?/16
cos(2x1)2?/16
cos(2x1)3?/16
cos(2x1)7?/16
General form cos(2x1)?f/2N
6Properties of One-Dimensional DCT Basic Functions
- Complete a weighted sum of N cosine functions
can be found for any N pixel sample values - Minimal none of the N waveforms can be
represented by any weighted combination of the
other N-1 waveforms, and all N are required for
completeness - Unique no other set of cosine waveforms, other
than scaled versions of the original N waveforms,
can be used to represent all possible sequences
of N pixel values
7Two-Dimensional DCT - Example
Similarly, a matrix of N x N pixels can be
uniquely represented by a weighted sum of N x N
cosine functions.
8Wavelet Compression
- Wavelet
- a function that is non-zero only over a short
region, and zero elsewhere - a wavelet function is represented by summing
wavelets expansions and contractions of a single
wavelet, knowas the mother wavelet - Simplest form of wavelet used in wavelet analysis
is the Haar wavelet
9Haar Wavelets
Mother wavelet
10Compression Using Haar Wavelets
11Matrix Formed from Haar Mother Wavelet
12JPEG Image Compression
- Sequential DCT-based
- Single Left to Right, Top to Bottom scan
- uses quantization to reduce matrix before
compression - Progressive DCT-based
- multiple scans, increasing clarity (resolution)
- precision of coefficients increased in each scan
- Lossless
- uses predictor matrix, followed by Huffman or
arithmetic coding of ordered matrix - Hierarchical
- encodes a set of progressively lower resolution
images - compress each image, form low to high resolution
using one of above methods
13JPEG Modes of Operation
14JPEG Sequential DCT
15Quantization Effects
Quantization Matrix Q (u, v)
Quantized DCT Matrix K (u, v)
16Zig-Zag Scan
17Image Reconstruction
18JPEG Scheme
19Progressive DCT Compression
20Progressive DCT Compression (continued)
21JPEG Lossless Mode
22JPEG 2000
23MPEG Structure
24Block Motion Compensation
25Temporal Picture Structure -Example