You are on page 1of 52

ENEE631 Spring09

Lecture 13 (3/11/2009)

Wavelet Coding and Related Issues


Spring 09 Instructor: Min Wu
Electrical and Computer Engineering Department,
University of Maryland, College Park
bb.eng.umd.edu (select ENEE631 S09)
minwu@eng.umd.edu
M. Wu: ENEE631 Digital Image Processing (Spring'09)

UMCP ENEE631 Slides (created by M.Wu 2004)

Overview and Logistics

Last Time:
JPEG Compression
Subband and Wavelet based compression

Subband decomposition; basic ideas of EZW encoding

Today
Continue on Subband and Wavelet based compression

Exploit the structures between coefficients for removing redundancy


More on wavelet transform, and consideration on filters

Assignment#3 is Due Friday noon March 13


JPEG part may be turned in after spring break

Project#1 Posted. Due Monday April 6


M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [2]

UMCP ENEE631 Slides (created by M.Wu 2004)

Review: 2-D Subband/DWT


Decomposition
Separable transform by successively
applying 1-D DWT to rows and columns

From Usevitchs article in


IEEE Sig.Proc. Mag. 9/01
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [3]

UMCP ENEE631 Slides (created by M.Wu 2001)

Review: Key Concepts in EZW

Exploit multi-resolution and self-similarity

Parent-children relation among coeff.


Each parent coeff at level k spatially correlates with
4 coeff at level (k-1) of same orientation
A coeff at lowest band correlates with 3 coeff.

Coding significance map via zero-tree


Encode insignificance map w/ zero-trees

Avoid large overhead by coding only significant


coefficients

Successive approximation quantization


Send most-significant-bits first and gradually
refine coefficient value
Embedded nature of coded bit-stream
get higher fidelity image by adding extra
refining bits
=> Quality Scalability with fine granularity

M. Wu: ENEE631 Digital Image Processing (Spring'09)

From Usevitch (IEEE


Sig.Proc. Mag. 9/01)
Lec13 Wavelet Coding, etc. [4]

Recall: EZW Algorithm and Example


UMCP ENEE631 Slides (created by M.Wu 2001)

Initial threshold ~ 2 ^ floor(log2 xmax)


Put all coeff. in dominant list

Dominant Pass (zig-zag across bands)


Assign symbol to each coeff. and
entropy encode symbols

ps positive significance
ns negative significance
iz isolated zero
ztr zero-tree root

Significant coefficients

Move to subordinate list


Set them to zero in dominant list

Subordinate Pass

Fig. From Usevitch (IEEE Sig. Proc. Mag. 9/01)

Output one bit for subordinate list

According to position in up/low half of quantization interval

Repeat with half threshold, until bit budget achieved


E.g. first look for coeff. above 32; then focus on coeff. between 16 and 32
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [5]

Divide quantization interval of [32,64) by half:


[32,48) => 40 and [48, 64) => 56

UMCP ENEE631 Slides (created by M.Wu 2001)

After 1st Pass

From Usevitch (IEEE Sig.Proc. Mag. 9/01)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [6]

UMCP ENEE631 Slides (created by M.Wu 2001)

After 2nd Pass

From Usevitch (IEEE Sig.Proc. Mag. 9/01)

[16,24) => 20, [24, 32) => 28;


[32,40) => 36, [40,48) => 44;
[48, 56) => 52, [56, 64) => 60
2nd Subordinate Pass:
orig. 53 symbol 0 reconstruct 52
34
0
36

M. Wu: ENEE631 Digital Image Processing (Spring'09)

-22

-20

21

20

Lec13 Wavelet Coding, etc. [7]

UMCP ENEE631 Slides (created by M.Wu 2001/2004)

EZW and Beyond

Can apply DWT to entire images or larger blocks than 8x8

Symbol sequence can be entropy encoded


e.g. arithmetic coding

Cons of EZW
Poor error resilience; Difficult for selective spatial decoding

SPIHT (Set Partitioning in Hierarchal Trees)


Further improvement over EZW to remove redundancy
Achieve equal/better performance than EZW w/o arithmetic coding

EBCOT (Embedded Block Coding with Optimal Truncation)


Used in JPEG 2000
Address the shortcomings of EZW (random access, error resilience, )
Embedded wavelet coding in each block + bit-allocations among blocks
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [8]

UMCP ENEE631 Slides (created by M.Wu 2004)

A Close Look at Wavelet Transform


Haar Transform unitary
Orthonormal Wavelet Filters
Biorthogonal Wavelet Filters

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [9]

UMCP ENEE631 Slides (created by M.Wu 2001/2004)

Construction of Haar Functions

Unique decomposition of integer k (p, q)


k = 0, , N-1 with N = 2n, 0 <= p <= n-1
q = 0, 1 (for p=0); 1 <= q <= 2 p (for p>0)
e.g., k=0
(0,0)

k=1
(0,1)

k=2
(1,1)

k=3
(1,2)

1
for x [0,1]
N
q- 12
1 p/2
q-1
2
for p x p
2
2
N
q- 12
1 p/2
q

2
for p x p
2
2
N

h0 ( x) h0, 0 ( x)

hk ( x) h p ,q ( x)

for other x [0,1]

M. Wu: ENEE631 Digital Image Processing (Spring'09)

k = 2p + q 1
remainder

k=4
(2,1)

hk(x) = h p,q(x) for x [0,1]

power of 2

(0,0)

x
1

(0,1)
(1,1)

(1,2)

(2,1)

Lec13 Wavelet Coding, etc. [10]

UMCP ENEE631 Slides (created by M.Wu 2001)

Haar Transform

Haar transform H
Sample hk(x) at {m/N}

1
1

for m = 0, , N-1

2
2 2 2
0
0
0
0
2 2 0
0
0 0
2 2
0 0
0
0

1
8

Real and orthogonal


Transition at each scale p is
localized according to q

0
2

1
1

0
0
0

2 2 2
0 0 0 0

0 0 0 0

2 2 0 0

2 2

Basis images of 2-D


(separable) Haar transform
Outer product of two basis vectors

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [11]

Compare Basis Images of DCT and Haar

UMCP ENEE631 Slides (created by M.Wu 2001)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

See also: Jains Fig.5.2 pp136


Lec13 Wavelet Coding, etc. [12]

Time-Freq (or Space-Freq) Interpretations


Standard Basis (for data samples); Fourier Basis; Wavelet Basis

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [13]

Recap on Haar Transform


UMCP ENEE631 Slides (created by M.Wu 2001)

Two major sub-operations


Scaling captures info. at different frequencies
Translation captures info. at different locations

Can be represented by filtering and downsampling

Relatively poor energy compaction


Equiv. filter response doesnt have good cutoff & stopband attenuation
x
1

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [14]

UMCP ENEE631 Slides (created by M.Wu 2001)

Orthonormal Filters

Equiv. to projecting input signal to orthonormal basis

Energy preservation property


Convenient for quantizer design

MSE by transform domain quantizer is same as reconstruction MSE


in image domain

Shortcomings: coefficient expansion


Linear filtering with N-element input & M-element filter

(N+M-1)-element output (N+M)/2 after downsample


Length of output per stage grows ~ undesirable for compression

Solutions to coefficient expansion


Symmetrically extended input (circular convolution) &
Symmetric filter
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [15]

Solutions to Coefficient Expansion


UMCP ENEE631 Slides (created by M.Wu 2001)

Circular convolution in place of linear convolution


Periodic extension of input signal
Problem: artifacts by large discontinuity at borders

Symmetric extension of input


Reduce border artifacts (note the signal length doubled with symmetry)
Problem: output at each stage may not be symmetric
From Usevitch (IEEE
Sig.Proc. Mag. 9/01)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [16]

UMCP ENEE631 Slides (created by M.Wu 2001)

Solutions to Coefficient Expansion (contd)

Symmetric extension + symmetric filters


No coefficient expansion and little artifacts
Symmetric filter (or asymmetric filter) => linear phase filters
(no phase distortion except by delays)

Problem
Only one set of linear phase filters for real FIR orthogonal wavelets
Haar filters: (1, 1) & (1,-1)
do not give good energy compaction
Ref: review ENEE630 discussions on FIR perfect reconstruction
Qudrature Mirror Filters (QMF) for 2-channel filter banks.

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [17]

From Usevitch (IEEE Sig.Proc. Mag. 9/01)

Biorthogonal Wavelets
UMCP ENEE631 Slides (created by M.Wu 2001)

Biorthogonal
Basis in forward and inverse transf.
are not the same but give overall
perfect reconstruction (PR)

recall EE630 PR filterbank

No strict orthogonality for transf.


filters so energy is not preserved

But could be close to orthogonal


filters performance

Advantage
Covers a much broader class of filters

including symmetric filters that eliminate coefficient expansion

Commonly used filters for compression


9/7 biorthogonal symmetric filter
Efficient implementation: Lifting approach
M. Wu: ENEE631 Digital Image Processing (Spring'09)

(ref: Sweldens tutorial)


Lec13 Wavelet Coding, etc. [21]

UMCP ENEE631 Slides (created by M.Wu 2004)

Smoothness Conditions on Wavelet Filter


Ensure the low band coefficients obtained by recursive filtering
can provide a smooth approximation of the original signal

From M. Vetterlis wavelet/filter-bank paper


M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [22]

UMCP ENEE631 Slides (created by M.Wu 2004)

JPEG 2000 Image Compression Standard

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [25]

UMCP ENEE631 Slides (created by M.Wu 2001)

From Christopoulos
(IEEE Trans. on CE
11/00)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [26]

UMCP ENEE631 Slides (created by M.Wu 2001/2004)

JPEG 2000: A Wavelet-Based New Standard

Targets and features


Excellent low bit rate performance without sacrifice performance
at higher bit rate
Progressive decoding to allow from lossy to lossless
Region-of-interest (ROI) coding
Error resilience

For details
JPEG2000 Tutorial by Skrodras @ IEEE Sig. Proc Magazine 9/2001
David Taubman: High Performance Scalable Image Compression
with EBCOT, IEEE Trans. On Image Proc, vol.9(7), 7/2000.
Taubmans book on JPEG 2000 (on library reserve)
Links and tutorials @ http://www.jpeg.org/JPEG2000.htm
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [27]

Examples

UMCP ENEE631 Slides (created by M.Wu 2001)

JPEG2K
vs.
JPEG

From Christopoulos
(IEEE Trans. on CE
11/00)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [28]

UMCP ENEE631 Slides (created by M.Wu 2001)

DCT vs. Wavelet: Which is Better?

3dB improvement?
Wavelet compression was claimed to have 3dB improvement over
DCT-based compression
Comparison is done on JPEG Baseline

Improvement not all due to transforms


Main contribution from better rate allocation, advanced entropy
coding, & smarter redundancy reduction via zero-tree
Difference due to DCT vs. Wavelet transform is less than 1dB
DCT coder can be improved to decrease the gap
[Ref] "A comparative study of DCT- and wavelet-based image coding",
Z. Xiong, K. Ramchandran, M. Orchard, Y-Q. Zhang, IEEE Trans. on Circuits and
Systems for Video Technology, v.9, no.5, 8/99, pp692-695.
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [29]

Non-Dyadic Decomposition Wavelet Packets


Figures are from slides at Gonzalez/ Woods
DIP book 2/e website (Chapter 7)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [30]

UMCP ENEE631 Slides (created by M.Wu 2004)

Bit Allocation in Image Coding

Focus on MSE-based optimization;


Can further adjust based on HVS

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [31]

Bit Allocation
UMCP ENEE631 Slides (created by M.Wu 2001)

How many bits to be allocated for each coefficient?


Related to each coeffs variance (and probability distribution)
More bits for high variance k2 to keep total MSE small
1
min D
N

1
subject to
N

E
N 1
k 0

N 1

r
k 0

v ( k ) vq ( k )

N 1

f (r )
k 0

R bits/coeff.

Here k2: variance of k-th coeff. v(k); rk is # bits allocated for v(k)
f(-): a func. relating bit rate to distortion based on a coeffs p.d.f.

Reverse Water-filling
Try to keep same amount of error in each frequency band

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [32]

UMCP ENEE631 Slides (created by M.Wu 2001/2004)

Rate/Distortion Allocation via Reverse Water-filling

Optimal solution for Gaussian distributed coefficients


Idea: try to keep same amount of error in each freq. band; no need to
spend bits to represent coeff. w/ smaller variance than water level
Results based on R-D function and via Lagrange-multiplier optimization
Note the convex shape of R-D function for Gaussian
=> slope becomes milder; require more bits to further reduce distortion
RD

Optimal

Not Optimal

D
2

Given total rate R, determine and then


D; or vice versa given D, determine R
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [34]

Details on Reverse Water-filling Solution


RD

min Di ( Ri ) subj. to Ri R
i 1

Construct func. using


Lagrange multiplier
Necessary condition
Keep the same
marginal gain

J ( R1 ,...RN ) Di ( Ri ) R Ri
i 1
i 1

J dDi
dDi

0 for all i
and
Ri dRi
dRi

R R
i

Equal Slope Condition for bit allocation

1 i2
dRi
d

max ln
,0

dDi dDi
2 Di

dRi
1
1

for Ri 0
dDi
2 Di

Resulting in equal distortions on Gaussian r.vs


as interpreted in reverse water filling
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [35]

UMCP ENEE631 Slides (created by M.Wu 2004)

Key Result in Rate Allocation: Equal R-D Slope


Rate allocation results:
=> Equal slope
(o.w. exist a better
allocation strategy)

Keep the slope in R-D curve the same (not just for Gaussian r.v)
Otherwise some bits can be applied to other r.v. for better return in
reducing the overall distortion

If all r.v. are Gaussian, the same slope in R-D curves for these r.v.
correspond to an identical amount of distortion.
R(D) = [ log 2 log D ] => dR/dD = 1 / (2D)

Use operational/measured rate-distortion information for general r.v.


M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [36]

Summary of Todays Lecture


UMCP ENEE631 Slides (created by M.Wu 2004)

Wavelet transform and coding


Haar basis/transform; considerations for wavelet filters; JPEG 2000

Optimal bit allocation: equal slope in R-D curves


Lead to reverse water filling for Gaussian coefficients

Next lecture
Optimal transform

Readings: see wavelet coding references in Project #1


Gonzalezs 3/e book Section 8.2.10; 7.1, 7.4-7.5; (7.2-7.3 on wavelet)
Transform coding articles in IEEE Sig. Proc. Magazine Sept. 2001
(special issue on transform coding)
To explore more: Tutorial on rate-distortion by Ortega-Ramchandran in IEEE

Sig. Proc. Magazine, Nov. 98, and Jains book Section 2.13;
Wavelets and the lifting scheme: A 5 minute tour by Wim Sweldens [Zeitschrift fr
Angewandte Mathematik und Mechanik, 76 (2), pp. 41-44, 1996]

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [37]

Review: Correlation After a Linear Transform


UMCP ENEE631 Slides (created by M.Wu 2004)

Consider an Nx1 zero-mean random vector x


Covariance (or autocorrelation) matrix Rx = E[ x xH ]

give us ideas of the correlation between elements


Rx is a diagonal matrix for if all N r.v.s are uncorrelated

Apply a linear transform to x: y = A x

What is the autocorrelation matrix for y ?


Ry = E[ y yH ] = E[ (Ax) (Ax)H ] = E[ A x xH AH ]
= A E[ x xH ] AH = A Rx AH

Decorrelation: try to search for A that can produce a


decorrelated y (equiv. a diagonal correlation matrix Ry )
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [38]

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [39]

Optimal Transform
UMCP ENEE631 Slides (created by M.Wu 2004)

Recall: Why use transform in coding/compression?


Decorrelate the correlated data
Pack energy into a small number of coefficients
Interested in unitary/orthogonal or approximate orthogonal transforms

Energy preservation s.t. quantization effects can be better understood and


controlled

Unitary transforms weve dealt so far are data independent


Transform basis/filters are not depending on the signals we are processing

Can hard-wire them in encoder and decoder

What unitary transform gives the best energy compaction


and decorrelation?
Optimal in a statistical sense to allow the codec works well with many
images => Signal statistics would play an important role
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [40]

Review: Correlation After a Linear Transform


UMCP ENEE631 Slides (created by M.Wu 2004)

Consider an Nx1 zero-mean random vector x


Covariance (or autocorrelation) matrix Rx = E[ x xH ]

give ideas of correlation between elements


Rx is a diagonal matrix for if all N r.v.s are uncorrelated

Apply a linear transform to x: y = A x

What is the correlation matrix for y ?


Ry = E[ y yH ] = E[ (Ax) (Ax)H ] = E[ A x xH AH ]
= A E[ x xH ] AH = A Rx AH

Decorrelation: try to search for A that can produce a


decorrelated y (equiv. a diagonal correlation matrix Ry )
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [41]

UMCP ENEE631 Slides (created by M.Wu 2001/2004)

K-L Transform (Principal Component Analysis)

Eigen decomposition of Rx:

Rx uk = k uk

Recall the properties of Rx

Hermitian (conjugate symmetric RH = R);


Nonnegative definite (real non-negative eigen values)

Karhunen-Loeve Transform (KLT)


y = UH x x = U y with U = [ u1, uN ]
KLT is a unitary transform with basis vectors in U being the
orthonormalized eigenvectors of Rx
Rx U = [ 1u1, N uN ] = U diag{1, 2, , N}
=> UH Rx U = diag{1, 2, , N} i.e. KLT performs decorrelation

Often order {ui} so that 1 2 N

Also known as Hotelling transform or Principle Component Analysis (PCA)


M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [42]

UMCP ENEE631 Slides (created by M.Wu 2001/2004)

Properties of K-L Transform

Decorrelation
E[ y yH ]= E[ (UH x) (UH x)H ]= UH E[ x xH ] U = diag{1, 2, , N}

Note: Other matrices (unitary or nonunitary) may also decorrelate


the transformed sequence [Jains e.g.5.7 pp166]

Minimizing MSE under basis restriction


If only allow to keep m coefficients for any 1 m N, whats the
best way to minimize reconstruction error?
Keep the coefficients w.r.t. the eigenvectors of the first m largest
eigen values

Reference: Theorem 5.1 and Proof in Jains Book (pp166)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [44]

KLT Basis Restriction


UMCP ENEE631 Slides (created by M.Wu 2004)

Basis restriction
Keep only a subset of m transform coefficients and then perform
inverse transform (1 m N)
Basis restriction error: MSE between original & new sequences

Goal: to find the forward and backward transform matrices


to minimize the restriction error for each and every m
The minimum is achieved by KLT arranged according to the
decreasing order of the eigenvalues of R

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [45]

UMCP ENEE631 Slides (created by M.Wu 2001)

K-L Transform for Images

Work with 2-D autocorrelation function


R(m,n; m,n)= E[ x(m, n) x(m, n) ] for all 0 m, m, n, n N-1
K-L Basis images is the orthonormalized eigen functions of R

Rewrite images into vector form (N2x1)


Need solve the eigen problem for N2xN2 matrix! ~ O(N 6)

Reduced computation for separable R


R(m,n; m,n)= r1(m,m) r2(n,n)
Only need solve the eigen problem for two NxN matrices ~ O(N3)
KLT can now be performed separably on rows and columns

Reducing the transform complexity from O(N4) to O(N3)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [46]

UMCP ENEE631 Slides (created by M.Wu 2001)

Pros and Cons of K-L Transform

Optimality
Decorrelation and MMSE for the same# of partial transf coeff.

Data dependent
Have to estimate the 2nd-order statistics to determine the transform
Can we get data-independent transform with similar performance?

DCT

Applications
(non-universal) compression
Pattern recognition: e.g., eigen faces
Analyze the principal (dominating) components and reduce
feature dimensions
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [47]

UMCP ENEE631 Slides (created by M.Wu 2004)

Energy Compaction of DCT vs. KLT

DCT has excellent energy compaction


for highly correlated data

DCT is a good replacement for K-L


Close to optimal for highly correlated data
Not depend on specific data like K-L does
Fast algorithm available
[ref and statistics: Jains pp153, 168-175]

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [48]

Energy Compaction of DCT vs. KLT (contd)


UMCP ENEE631 Slides (created by M.Wu 2004)

Preliminaries
The matrices R, R-1, and R-1 share the same set of eigen vectors
DCT basis vectors are eigenvectors of a symmetric tri-diagonal matrix Qc

Covariance matrix R of 1st-order stationary Markov sequence with has an


inverse in the form of symmetric tri-diagonal matrix

DCT is close to KLT on 1st-order stationary Markov


For highly correlated sequence, a scaled version of R-1 approx. Qc
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [49]

UMCP ENEE631 Slides (created by M.Wu 2004)

More on Rate-Distortion Based


Bit Allocation in Image Coding

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [53]

Basic Steps in R-D Optimization

Determine sources statistics


Simplified models: Gaussian, Laplacian, Generalized Gaussian
Obtain from training samples

Obtain operational R-D points/functions/curves


E.g., compute distortion for each candidate quantizer

Determine objective function and constraints

Search for optimal operational R-D points


Lagrange multiplier approach

select only operating points on the convex hull of overall R-D


characteristics (Fig.19 of Ortegas tutorial)
may handle different coding unit independently

Dynamic programming approach

not constrained by convex hull but has larger search space


~ higher complexity => See Ortegas SPM98 tutorial for details

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [57]

Bridging the Theory and the Practice

Operational R-D curves


Directly achievable R-D pairs with practical implementation

Tradeoff!
How close are the R-D operational points to info. theory bounds?
Practical considerations: cost of memory, computation, delay, etc.
Often narrowing down to an optimization problem:
~ optimize an objective function subject to a set of constraints

Problem of model mismatch


How good are our assumptions on source modeling?
How well does a coding algorithm tolerate model mismatch?

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [58]

Ref: convex hull

Formally
Smallest convex set containing all points

For R-D problem, we concerned of the lower boundary of this set that
close to the info. theoretical bound (the upper/right end are open)

Convex set

if X1,..,Xn are in the set, then the linear combinations of them (with
non-negative combination factors) are still in the set

Intuitively
Use a rubber band to wrap the outermost points so that the band
encloses all points

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [59]

Bit Allocation

How many bits to be allocated for each coeff.?


Determined by the variance of coeff.
More bits for high variance k2 to keep total MSE small

1
min D
N

E v(k ) v (k )
N 1

k 0

1
subject to
N

N 1

n
k 0

N 1

k f (nk )
k 0

B bits/coeff.

where k2 -- variance of k-th coeff. v(k); nk -- # bits allocated for v(k)


f(-) quantization distortion func.

Inverse Water-filling (from info. theory)


Try to keep same amount of error in each freq. band
See Jains pp501 for detailed bit-allocation algorithm
M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [60]

Details on Reverse Water-filling Solution (contd)


2

i
min 12 ln
, subj. to Di D
Di
i 1
n

Construct func. using


Lagrange multiplier
Necessary condition
Keep the same
marginal gain

2
n

i
J ( D) 12 ln Di
Di
i 1
i 1
J
1 1

0 for all i Di and Di D


Di
2 Di
n

1 i2
min max ln
,0 , subj. to Di D
i 1
2 Di
n

Necessary condition
for choosing

2
2

0
,
if
D

,
if

i
i
i

s.t. Di D

2
i
2
2
Di 0, if Di i
i , if i

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [61]

Lagrangian Opt. for Indep. Budget Constraint

Previous: fix distortion, minimize total rate

Alternative: fix total rate (bit budget), minimize distortion

(Discrete) Lagrangian optimization on general source

min

d
i 1

i ,q (i )

ri , q ( i )

Constant slope optimization (e.g. in Box 6 Fig. 17 of Ortegas tutorial)


Need to determine the quantizer q(i) for each coding unit i
Lagrangian cost for each coding unit d i ,q ( i ) ri ,q ( i )

use a line with slope - to intersect with each operating point

(Fig.14)

For a given operating quality , the minimum can be computed


independently for each coding unit

min

d
i 1

i ,q (i )

ri , q ( i ) min d i , q ( i ) ri , q ( i )
i 1

=> Find operating quality satisfying the rate constraint


M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [63]

(from Fig. 14 of Ortegas tutorial)


M. Wu: ENEE631 Digital Image Processing (Spring'09)

(from Box 6 Fig. 17 of Ortegas tutorial)


Lec13 Wavelet Coding, etc. [64]

Bridging the Theory and Ad-hoc Practice

Operational R-D curves


Directly achievable with practical implementation

Tradeoff! Tradeoff! Tradeoff!


Rate vs. Distortion

how close are the operational points to info. theory bounds?

Also tradeoff among practical considerations

Cost of memory, computation, delay, etc.

Often narrowing down to an optimization problem:


~ optimize an objective func. subj. to a set of constraints

Model mismatch problem


How good are our assumptions on source modeling?
How well does a coding algorithm tolerate model mismatch?

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [65]

Basic Steps in R-D Optimization

Determine sources statistics


Simplified models: Gaussian, Laplacian, Generalized Gaussian
Obtain from training samples

Obtain operational R-D points/functions/curves


E.g., compute distortion for each candidate quantizer

Determine objective func. and constraints

Search for optimal operational R-D points


Lagrange multiplier approach

select only operating points on the convex hull of overall R-D


characteristics (Fig.19 of Ortegas tutorial)
may handle different coding unit independently

Dynamic programming approach

not constrained by convex hull but has larger search space (higher
complexity)

M. Wu: ENEE631 Digital Image Processing (Spring'09)

Lec13 Wavelet Coding, etc. [66]

You might also like