Part I: Introduction

Download Report

Transcript Part I: Introduction

Lossy Compression
Indiana University Purdue University Fort Wayne
Hongli Luo
Lossy compression
 Lossy Compression Techniques
 Introduction
• Distortion measures
• Rate-distortion theory


Quantization
Transform Coding
• Discrete Cosine Transform (DCT)
Introduction
 Lossless compression algorithms do not deliver
compression ratios that are high enough. Hence, most
multimedia compression algorithms are lossy.
 What is lossy compression ?


The compressed data is not the same as the original data, but a
close approximation of it.
Yields a much higher compression ratio than that of lossless
compression.
Distortion Measures
 The three most commonly used distortion measures in
image compression are:

Mean square error (MSE) σ2
Where xn, yn, and N are the input data sequence, reconstructed data
sequence, and the length of the data sequence respectively.
Distortion Measures
 The three most commonly used distortion measures in
image compression are:

Signal to noise ratio (SNR), in decibel units (dB),
Where
is the average square value of the original data
sequence and
is the MSE.
 Peak signal to noise ratio (PSNR) – measures the size of the
error relative to the peak value of the signal xpeak.
The Rate-Distortion Theory
 Provides a framework for the study of tradeoffs between
Rate and Distortion.
 Rate is the average number of bits required to represent
each source symbol.
 Objective: minimize the distortion for a given bit rates (a
given compression ratio)
 If D is a tolerable amount
of distortion, R(D) specifies the
lowest rate at which the source
can be encoded while keeping
The distortion bounded above
by D.
Quantization
 Compression achieved by reduce the number of
distinct output values to a much smaller set - reduce
the number of bits per sample

E.g. (0, 1023) -> (0, 63) , 10 bits -> 6 bits
 Different quantization methods:
 Uniform scalar quantization
 Nonuniform scalar quantization
 Vector quantization
 As quantization interval size increases, compression
increases.
Transform Coding
 The rationale behind transform coding:
If Y is the result of a linear transform T of the input vector X in such a
way that the components of Y are much less correlated, then Y can
be coded more efficiently than X.
 E.g. T is transform a RGB image to YCrCb image
• Luminance component is little related to CrCb (Chrominance)
• Luminance component can be compressed different from
chrominance component.
• Human eyes are less sensitive to color changes
• Use a larger quantization interval for CbCr components – fewer bits
for the quantization
• Or apply sub-sampling to CbCr components – fewer bits for CbCr
Transform Coding
 The more decorrelated – the less effect one dimension has on
another

The more chances of dealing differently with components storing
relatively minor information without affecting reasonably accurate
reconstruction of the signals from its quantized or truncated transform
coefficients
 Generally, the transform T itself does not compress data. The
compression comes from the processing and quantization of the
components of Y.
 If most information is accurately described by the first few
components of a transformed vector, then the remaining
components can be coarsely quantized, or even set to zero with
little signal distortion.
Discrete Cosine Transform (DCT)
 DCT is a widely used transform coding technique.
 A signal can be expressed as a combination of




multiple sine or cosine waveforms (Fourier Analysis)
The role of the DCT is to decompose the original
signal into its one DC component and several AC
components.
The role of the IDCT is to reconstruct (re-compose)
the signal.
The DCT and IDCT use the same set of cosine
function, which are known as basis functions.
When u = 0, DCT yields the DC coefficient, when u =
1, …, M-1, it yields the first, second, …, (M-1)th AC
coefficients.
Definition of Discrete Cosine Transform (DCT)
An image block is defined to have dimension of M = N = 8.
1D DCT transforms the signal f(i) in time domain to F(u) in frequency
domain.
1D IDCT transforms back F(u) in frequency domain into the original
signal f(i) in time domain.
1D DCT basis functions
1D DCT basis functions
DCT – Example
 If the original signal f1(i) = 100, after DCT
transformation, F1(0) = 283, F1(1)=F1(2)=…=F1(7)=0
DCT – Example
 If the original signal f2(i) has the same frequency and
phase as the second cosine basis function and its
amplitude is 100, after DCT transformation,
F2(0) = 0, F2(1) = 0, F2(2)= 200, F2(3)=…=F2(7)=0
DCT – Example
 If the original signal f3(i) is the sum of previous two
signals, f3(i) = f1(i) + f2(i), after DCT transformation,
F3(0) = 283, F3(1) = 0, F3(2)= 200, F3(3)=…=F3(7)=0
DCT – Example
 An arbitrary input signal f(i) and its DCT output F(u)
Discrete Cosine Transform (DCT)
 The DCT produces the frequency spectrum F(u) corresponding to the
spatial signal f(i)
 The 0th DCT coefficient F(0) is the DC component of f(i). F(0) equals the
average magnitude of the signal.
 The other seven DCT coefficients reflect the various changing (i.e., AC)
components of the signal f(i) at different frequencies. If we denote F(1) as
AC1, F(2) as AC2, …, F(7) as AC7, then AC1 is the first AC component,
which completes half a cycle as a cosine function over [0, 7]; AC2
completes a full cycle,…, and AC7 completes three and a half cycles.
 Use DCT for compression
 Each component is little dependent to each other
 Human eyes are less sensitive to high frequency components
 Apply different quantization interval size to each components
• E.g., more bits for DC component and fewer bits for AC
components