Multimedia Engineering
--------Lecture 4: Lossy Compression
Techniques
Lecturer: Dr. Đỗ Văn Tuấn
Department of Electronics and
Telecommunications
Email:
Lecture contents
1.
2.
3.
4.
Introduction
Distortion measures
Quantization
Transform coding
2
Introduction
Lossless compression algorithms do not deliver compression ratios that are
high enough. Hence, most multimedia compression algorithms are lossy.
In order to achieve higher rate of compression, we give up complete
reconstruction and consider lossy compression technique
So we need a way to measure how good the compression technique is meaning
that how close to the original data the reconstructed data is.
3
Lecture contents
1.
2.
3.
4.
Introduction
Distortion measures
Quantization
Transform coding
4
Distortion Measures
Mean Square Error (MSE)
Signal to Noise Ratio
Peak Signal to Noise Ratio
5
Rate-Distortion Theory
We trade-off rate (number of bits per symbol) versus distortion this is
represented by a rate-distortion function R(D)
6
Lecture contents
1.
2.
3.
4.
Introduction
Distortion measures
Quantization
Transform coding
7
Quantization
Quantization is a heart of any scheme
The source we are compressing contains a large number of distinct output
values (infinite for analog)
We compress the source output by reducing the distinct values to a
smaller set via quantization
Each quantizer can be uniquely described by its partition of the input
range (encoder side) and set of output values (decoder side).
Two types of quantization: Uniform quantization and non-uniform
quantization
8
Uniform Quantization
Uniform Scalar Quantizers: (a) Midrise, (b) Midtread
9
Non-uniform Quantization
Typical one is companded quantization
Companded quantization is nonlinear
As shown above, a compander consists of a compressor function G, a uniform
quantizer, and an expander function G−1.
The two commonly used companders are the μ-law and A-law companders.
10
Lecture contents
1.
2.
3.
4.
Introduction
Distortion measures
Quantization
Transform coding
11
Transform coding
Reason for transform coding
Coding vectors is more efficient than coding scalars so we need to group
blocks of consecutive samples from the source into vectors
If Y is the results of a linear transformation T of an input X such that the
elements of Y are much less correlated than X, then Y can be coded more
efficiently than X
With vectors of high dimensions, if most of the information in the vectors is
carried in the first few components we can roughly quantize the remaining
elements
The more decorrelated the elements are, the more we can compress the less
important elements without affecting the important ones.
12
Discrete Cosine Transform
The DCT is a wildly used transform technique
Spatial frequency: indicates how many times pixel values change across
an image block
The DCT formalizes this notion in terms of how much the image contents
change in correspondence to the number of cycles of a cosine wave per
block
The DCT decomposes the original signal into its DC and AC components
The inverse DCT (Called IDCT) reconstructs the original signal.
13
Discrete Cosine Transform
Given an input function f(i,j) over two integer variables i and j (a piece of
an image), the 2D DCT transforms it into a new function F(u, v), with integer
u and v running over the same range as i and j . The general definition of
the transform is:
Where i , u = 0, 1, . . . ,M − 1; j , v = 0, 1, . . . ,N − 1 and the constants
C(u), C(v) are determined by
14
Discrete Cosine Transform
2D discrete cosine transform (2D DCT) – In JPEG
Where i , j, u , v = 1,2,..,7.
2D inverse discrete cosine transform (2D IDCT)
15
Discrete Cosine Transform
1D discrete cosine transform (1D DCT)
Where i , u = 1,2,..,7.
1D inverse discrete cosine transform (1D IDCT)
16
Basic functions of DCT
17
Basic functions of DCT
18
Example of 1D DCT
19
Example of 1D DCT
20
More things to read
Karhunen-Loeve Transform
Wavelet-based coding
JPEG
21
End of the lecture
--------------
22