Académique Documents
Professionnel Documents
Culture Documents
Group 820
System Architecture
Haar Transform
EZW
Arithmetic Coding
Haar Wavelet Transform Haar Transform
EZW
1. 1+3 / 2 = 2
Signal 1 3 5 7 2. 1 - 2 = -1
1. Iteration 3. Insert
2 6 -1 -1
4. Normalize
2. Iteration 4 -2 -1 -1 5. Insert
6. Recurse
Haar Wavelet Transform Haar Transform
EZW
Arithmetic Coding
Signal 1
3
5
Signal
7
[1 3 5 7 ]
-1
-1
Haar Basis Haar Transform
EZW
Arithmetic Coding
Haar Transform
EZW
Arithmetic Coding
Encoding the Coefficients Haar Transform
EZW
• How do you encode the coefficients effectively?
Arithmetic Coding
•Various ad hoc methods
•Store 0 if coefficient is below some threshold
•Store coefficient if > threshold as (x,y,c)
•Suboptimal approach. Bad compression.
EZW – Embedded Zerotree of Wavelet Coefficients
Haar Transform
• Developed by Shapiro in 93
• Enabled wavelet compression to compete with JPEG EZW
EZW
Arithmetic Coding
How it works Haar Transform
threshold = 2^(floor(lg(max(c)))
EZW
do {
dominant pass (encode PS,NS,ZT,IZ) Arithmetic Coding
Haar Transform
EZW
Arithmetic Coding
Arithmetic Coding Haar Transform
EZW
• A symbol with the probability of 0.4 should ideally be
encoded with 1.32 bits. Arithmetic Coding
EZW
• Divide the interval of [0;1) into subintervals based on the
probabilities of the individual symbols
Arithmetic Coding
•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 –
Example of the encoding Haar Transform
EZW
• Input: ABAABB
Arithmetic Coding
•p(A)=0.5 and p(B) = 0.5
•A’s interval [0;0.5)
•B’s interval [0.5;1)
•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 –
Example of the encoding Haar Transform
EZW
•Final interval: [0.34375;0.375)
Arithmetic Coding
•We choose 0.36 and throw away 0. -> 36 is a code for the
string ABAABB
• =6 bit
Arithmetic Coding –
Decoding Haar Transform
EZW
• From the code the initial interval is determined
Arithmetic Coding
• For next symbol (Repeat until done):
• Subtract lower limit of previous
• Divide by width of subinterval
Result
13 48
5