Title: Wavelet Transform
1Wavelet Transform
2System Architecture
Haar Transform
EZW
Arithmetic Coding
3Haar Wavelet Transform
Haar Transform
EZW
To calculate the Haar transform of an array of
samples 1. Find the average of each pair of
samples. 2. Find the difference between the
average and the samples. 3. Fill the first
half of the array with averages. 4. Normalize
5. Fill the second half of the array with
differences. 6. Recurse - repeat the process
on the first half of the array. (Note The
array length should be a power of two)
Arithmetic Coding
- 13 / 2 2
- 1 - 2 -1
- Insert
- Normalize
- Insert
- Recurse
1 3 5 7
Signal
1. Iteration 2. Iteration
-1
-1
6
2
-1
-1
-2
4
4Haar Wavelet Transform
Haar Transform
EZW
Arithmetic Coding
Signal
1 3 5 7
Signal
1 3 5 7
Signal recreated from 2 coefficients
2. Iteration
4 -2 -1 -1
2 2 6 6
5Haar Basis
Haar Transform
EZW
Arithmetic Coding
Lisa
Haar Basis
6System Architecture
Haar Transform
EZW
Arithmetic Coding
7Encoding the Coefficients
Haar Transform
EZW
- How do you encode the coefficients effectively?
- Various ad hoc methods
- Store 0 if coefficient is below some threshold
- Store coefficient if gt threshold as (x,y,c)
- Suboptimal approach. Bad compression.
Arithmetic Coding
8EZW Embedded Zerotree of Wavelet Coefficients
Haar Transform
- Developed by Shapiro in 93
- Enabled wavelet compression to compete with JPEG
- Builds on two observations
- Large coefficients are most important (contains
most information) and should be stored first. - Magnitude of coefficients decrease as one moves
from lower frequency subbands to higher
frequencies. - E Embedded. Progressive algorithm
- Z Zerotree. Quadtree data structure central to
algorithm - W Wavelet. Designet specifically for wavelet
compression
EZW
Arithmetic Coding
9Why it works
Haar Transform
EZW
Arithmetic Coding
10How it works
Haar Transform
threshold 2(floor(lg(max(c))) do dominant
pass (encode PS,NS,ZT,IZ) subordinate pass
(refinement of PS and NS) t / 2 while (PSNR lt
T1 BITRATE lt T2)
EZW
Arithmetic Coding
- Decode algorithm similar
- EBCOT used in JPEG2000 uses similar algorithm
11System Architecture
Haar Transform
EZW
Arithmetic Coding
12Arithmetic Coding
Haar Transform
EZW
- A symbol with the probability of 0.4 should
ideally be encoded with 1.32 bits. - Arithmetic Coding assigns one long code to
entire stream!
Arithmetic Coding
13Arithmetic Coding Encoding step
Haar Transform
EZW
- Divide the interval of 01) into subintervals
based on the probabilities of the individual
symbols - Based on the symbol read from the input stream,
select the corresponding interval - Divide this interval further into subinterval
still based on probabilities of the symbols - Repeat the last two steps until the end of input
stream
Arithmetic Coding
14Arithmetic Coding Example of the encoding
Haar Transform
EZW
- Input ABAABB
- p(A)0.5 and p(B) 0.5
- As interval 00.5)
- Bs interval 0.51)
- Upper and lower determines current interval
- A1 lower 0, upper 0.5
- B1 lower 0.25, upper 0.5
- ..
- B3 lower 0.34375, upper 0.375
Arithmetic Coding
15Arithmetic Coding Example of the encoding
Haar Transform
EZW
- Final interval 0.343750.375)
- We choose 0.36 and throw away 0. -gt 36 is a code
for the string ABAABB - 6 bit
Arithmetic Coding
16Arithmetic Coding Decoding
Haar Transform
EZW
- From the code the initial interval is determined
- For next symbol (Repeat until done)
- Subtract lower limit of previous
- Divide by width of subinterval
Arithmetic Coding
17Result
48
13
5