Bernd Girod: EE398A Image and Video Compression Quantization no. 1 Quantization Q q Q -1 Sometimes, this convention is used: M represen- tative levels Q Input-output characteristic of a scalar quantizer M-1 decision thresholds input signal x Output t q+1 t q+2 t q x ˆ x ˆ x 2 ˆ q x 1 ˆ q x ˆ q x x q ˆ x
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Bernd Girod: EE398A Image and Video Compression Quantization no. 1
Quantization
Q q
Q -1
Sometimes, this
convention is used:
M represen-
tative levels
Q
Input-output characteristic of a scalar quantizer
M-1 decision thresholds
input signal x
Output
t q+1 t q+2 t q
x x̂
x̂2
ˆqx
1ˆ
qx
ˆqx
x
q x̂
Bernd Girod: EE398A Image and Video Compression Quantization no. 2
Example of a quantized waveform
Original and Quantized Signal
Quantization Error
Bernd Girod: EE398A Image and Video Compression Quantization no. 3
Lloyd-Max scalar quantizer
Problem : For a signal x with given PDF find a quantizer with
M representative levels such that
( )Xf x
Solution : Lloyd-Max quantizer
[Lloyd,1957] [Max,1960]
M-1 decision thresholds exactly
half-way between representative
levels.
M representative levels in the
centroid of the PDF between two
successive decision thresholds.
Necessary (but not sufficient)
conditions
1
1
1
1ˆ ˆ 1, 2, , -1
2
( )
ˆ 0,1, , -1
( )
q
q
q
q
q q q
t
X
t
q t
X
t
t x x q M
x f x dx
x q M
f x dx
2
ˆ min.d MSE E X X
Bernd Girod: EE398A Image and Video Compression Quantization no. 4
Iterative Lloyd-Max quantizer design
1. Guess initial set of representative levels
2. Calculate decision thresholds
3. Calculate new representative levels
4. Repeat 2. and 3. until no further distortion reduction
ˆ 0,1,2, , -1qx q M
1
1
( )
ˆ 0,1, , -1
( )
q
q
q
q
t
X
t
q t
X
t
x f x dx
x q M
f x dx
1
1ˆ ˆ 1,2, , -1
2q q qt x x q M
Bernd Girod: EE398A Image and Video Compression Quantization no. 5
Example of use of the Lloyd algorithm (I)
X zero-mean, unit-variance Gaussian r.v.
Design scalar quantizer with 4 quantization indices with
minimum expected distortion D*
Optimum quantizer, obtained with the Lloyd algorithm Decision thresholds -0.98, 0, 0.98
Representative levels –1.51, -0.45, 0.45, 1.51
D*=0.12=9.30 dB
Boundary
Reconstruction
Bernd Girod: EE398A Image and Video Compression Quantization no. 6
Example of use of the Lloyd algorithm (II)
Convergence
Initial quantizer A:
decision thresholds –3, 0 3
Initial quantizer B:
decision thresholds –½, 0, ½
After 6 iterations, in both cases, (D-D*)/D*<1%
5 10 15-6
-4
-2
0
2
4
6
Qu
an
tizati
on
Fu
ncti
on
Iteration Number
0 5 10 150
0.2
0.4
D
0 5 10 150
5
10
SN
RO
UT
[dB
]
Iteration Number
SNROUT
final
= 9.2978
5 10 15-6
-4
-2
0
2
4
6
Qu
an
tizati
on
Fu
ncti
on
Iteration Number
0 5 10 150.1
0.15
0.2
D
0 5 10 156
8
10
SN
RO
UT
[dB
]
Iteration Number
SNROUT
final
= 9.298
Bernd Girod: EE398A Image and Video Compression Quantization no. 7
Example of use of the Lloyd algorithm (III)
X zero-mean, unit-variance Laplacian r.v.
Design scalar quantizer with 4 quantization indices with
minimum expected distortion D*
Optimum quantizer, obtained with the Lloyd algorithm Decision thresholds -1.13, 0, 1.13
Representative levels -1.83, -0.42, 0.42, 1.83
D*=0.18=7.54 dB
Threshold
Representative
Bernd Girod: EE398A Image and Video Compression Quantization no. 8
Example of use of the Lloyd algorithm (IV)
Convergence
Initial quantizer A,
decision thresholds –3, 0 3
Initial quantizer B,
decision thresholds –½, 0, ½
After 6 iterations, in both cases, (D-D*)/D*<1%
0 5 10 150
0.2
0.4
D
0 5 10 154
6
8
SN
R [
dB
]
Iteration Number
SNRfinal
= 7.5415
2 4 6 8 10 12 14 16-10
-5
0
5
10
Qu
an
tizati
on
Fu
ncti
on
Iteration Number2 4 6 8 10 12 14 16
-10
-5
0
5
10
Qu
an
tizati
on
Fu
ncti
on
Iteration Number
0 5 10 150
0.2
0.4
D
0 5 10 154
6
8
SN
R [
dB
]
Iteration Number
SNRfinal
= 7.5415
Bernd Girod: EE398A Image and Video Compression Quantization no. 9
Lloyd algorithm with training data
1. Guess initial set of representative levels
2. Assign each sample xi in training set T to closest representative
3. Calculate new representative levels
4. Repeat 2. and 3. until no further distortion reduction
ˆ ; 0,1,2, , -1qx q M
x
1ˆ 0,1, , -1
q
q
Bq
x x q MB
ˆqx
B
q x T :Q x q q 0,1,2,, M -1
Bernd Girod: EE398A Image and Video Compression Quantization no. 10
Lloyd-Max quantizer properties
Zero-mean quantization error
Quantization error and reconstruction decorrelated
Variance subtraction property
ˆ 0E X X
ˆ ˆ 0E X X X
2
2 2
ˆˆ
XXE X X
Bernd Girod: EE398A Image and Video Compression Quantization no. 11
High rate approximation
Approximate solution of the "Max quantization problem,"
assuming high rate and smooth PDF [Panter, Dite, 1951]
Approximation for the quantization error variance:
3
1( )
( )X
x x constf x
Distance between two
successive quantizer
representative levels
Probability density
function of x
3
23
2
1ˆ ( )12
X
x
d E X X f x dxM
Number of representative levels
Bernd Girod: EE398A Image and Video Compression Quantization no. 12
High rate approximation (cont.)
High-rate distortion-rate function for scalar Lloyd-Max quantizer
Some example values for
2 2 2
3
2 2 3
2
1with ( )
12
R
X
X X
x
d R
f x dx
2
92
uniform 1
Laplacian 4.5
3Gaussian 2.721
2
Bernd Girod: EE398A Image and Video Compression Quantization no. 13
High rate approximation (cont.)
Partial distortion theorem: each interval makes an (approximately)