lossy compression: math basicscmliu/courses/compression/chap8.pdf · c.m. liu. perceptual signal...
TRANSCRIPT
C.M. LiuPerceptual Signal Processing Lab College of Computer ScienceNational Chiao-Tung University
Lossy Compression: Math Basics
Office: EC538(03)5731877
http://www.csie.nctu.edu.tw/~cmliu/Courses/Compression/
Definitions
Lossless compression: x = x’A.k.a. entropy coding, reversible coding
Lossy compression: x ≠ x’A.k.a. irreversible coding
2
Encoder Decoderx y x’original compressed decompressed
Motivation
Why use lossy compression?Fundamental limits on lossless compressionHuman cognitive apparatus
Fundamental limits on human perceptionIf you can’t see/hear it, why encode it?
Abilities to recover from partial lossE.g. lower frame rate will make movement jerky but perceptible (think video via satellite phone)
Many sources have very high “natural” bit ratesAudio/video/etc.
3
Measures of Difference Distortion
Notation{xn} original source output{yn} reconstructed output
Squared errord(x, y) = (x – y)2
Absolute differenced(x, y) = |x – y|
4
Measures of Difference Distortion (2)
Mean squared error (MSE)
5
( )∑=
−=N
nnn yx
N 1
22 1σ
Signal-to-noise ratio (SNR)
2
2
SNRd
x
σσ
=
Decibel (dBel)
2
2
10log10SNR(dB)d
x
σσ
=
Measures of Difference Distortion (3)
Peak-signal-to-noise ratio (PSNR)
6
Average absolute difference
2
2
10log10PSNR(dB)d
peakxσ
=
∑=
−=N
nnn yx
N 1
2 1σ
Absolute maximum error
nnnyxd −=∞ max
Eye Phyiology
ConeaLensRetina
ConesRods
Outer Synaptic LayerBipolar CellsIner Synaptic LayerGanglion Cell
7
Eye Phyiology (c.1)
Visual Pathways
8
Eye Phyiology (c.2)
Two Types of Photoreceptors in Retina
RodsAbout 100 million in number
Relatively long and thin
Provides scotopic vision or dim-light vision
ConesAbout 6.5 million in number
Shorter and thicker
Provide photopic vision or bright-light vision
Highly sensitive to color
Densely packed in the center of Retina (called forvea)
Spectral Absorption of Three Types of
Cones
9
Visual Phenomena
Contrast SensitivitySensitive to luminance contrast rather than the absolute luminance values.
Weber’s Ratio
Related to surrounding and background luminance
ΔII
cons t d I= =tan [ log{ }]
10
Visual Phenomena-- Contrast Sensitivity
Logarithmic LawPower LawBackground Ratio
11
Visual Phenomena-- Mach Band
OvershootUniform luminance in the strip
The visual appearance is darker at its right side than its left.
12
Visual Phenomena-- MTF of the System
The Frequency ResponseThe peak varies with the viewer and generally lies between 3 and 10 cycles/degree.
The contrast sensitivity also depends on the orientation of the grating, being maximum for horizontal and vertical gratings.
The angular sensitivity variations are within 3 dB ( maximum deviation is at 45o).
The curve fitting procedure has yielded.
ex. A=2.6, α = 0.0192, β=1.1, and ρ0=(0.114)-1 = 8.772
H H A
where cycles ree
p( , ) ( ) [ ( )]exp[ ( ) ]
/ deg
ξ ξ ρ α ρρ
ρρ
ρ ξ ξ
β1 2
0 0
12
22
= = + −
= +
13
Probability Models
Lossless approachBased on empirical probability distributions… we needed an exact match
Lossy compressionWe can afford to approximate the actual distribution using a ‘nice’ analytical modelAdvantages
Use the analytical properties to improveCompressionReconstruction
14
Probability Models (2)
Uniform distributionIgnorance model—all values equally probable
15
⎩⎨⎧ ≤≤−
=otherwise0
for)(1 bxaabf X
Gaussian distributionVery common model
Analytically tractableLimiting distribution turns Gaussian
2
2
2)(
221 σ
μ
πσ
−−
=x
X ef
Probability Models (3)
Laplacian distributionMost of the weight of the pdf is around the mean (=0)
16
σ
πσ
||2
221 x
X ef−
=
Gamma distributionEven more concentrated around the mean (=0)
σ
πσ2
||34
||83 x
X ex
f−
=
Probability Models Comparison17
1,0 2 == σμ
Linear System Models18
∑∑=
−=
− ++=M
jnjnj
N
iinin bxax
11
εε⎩⎨⎧ =
=otherwise0
0for)(
2 kkR ε
εεσ
AutoRegressive Moving Average—ARMA(N,M)
Autoregressive Moving average
AutoRegressive—AR(N) == ARMA(N,0)
n
N
iinin xax ε∑
=− +=
1( ) ( )Nnnnnnnn xxxxPxxxP −−−−− = ,,,|,,| 2121 KK
AR(1) Autocorrelation Function19
Example AR(1) Processes20
a1 = 0.99 a1 = 0.60
Example AR(1) Processes (2)21
a1 = -0.99 a1 = -0.60
Negative Autocorrelation Function22
Homeworks & References23
Problems
ReferencesR. C. Gonzalez and R.E. Woods, “Digital Image Processing: Chapter 2” 3nd Edition, Prentice Hall, 2007