Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Data Compression
Autumn 2007
Wavelet Transform
Wavelet Transform
A family of transformations that filters the data into
low resolution data plus detail data.
low pass filter
image
wavelet
transformed image
Detail
subbands
wavelet
transform
transformed image
(coefficients)
wavelet
coding
bit
stream
Decoder
wavelet
decoding
transformed image
(approx coefficients)
inverse
wavelet
transform
distorted
image
1
2
3
4
.
.
.
00011
00001
01000
10100
.
.
.
Coefficients are normalized between 1 and 1
CSEP 590 - Lecture 9 - Autumn 2007
...
38
36
34
32
30
28
26
24
22
20
0.
02
0.
13
0.
23
0.
33
0.
42
0.
52
0.
65
0.
73
0.
83
0.
92
PSNR
Rate-Fidelity Curve
Wavelet Transform
Encoder
image
(pixels)
wavelet
transform
transformed image
(coefficients)
wavelet
coding
bit
stream
Decoder
wavelet
decoding
transformed image
(approx coefficients)
inverse
wavelet
transform
distorted
image
10
y
x
detail
average
(x+y)/2
y
x
(y-x)/2
How do we represent
two data points at lower resolution?
11
(x+y)/2 = L
low pass filter
(y-x)/2 = H
x=L-H
y=L+H
high pass
filter
H
Transform
detail
Inverse Transform
12
Low
Resolution
Version
H
Note that the low resolution
version and the detail together
have the same number of
values as the original.
Detail
13
1
1
n
B[i] = A[2i] + A[2i + 1], 0 i <
2
2
2
1
1
n
B[n/2 + i] = A[2i] + A[2i + 1], 0 i <
2
2
2
H
L = B[0..n/2-1]
H = B[n/2..n-1]
14
n
2
n
2
15
Transform
each row
vertical
transform
Transform
each column
in L and H
LL
LH
HL
HH
3 detail
subbands
16
LL
HL
LH
HH
horizontal
transform
LLL HLL
HL
Transform
each row in LL
LH
vertical
transform
LH
HLLL HHLL
HH
HL
HH
Transform
each column in
LLL and HLL
17
vertical
transform
negative value
18
19
20
Wavelet Transforms
Technically wavelet transforms are special kinds of
linear transformations. Easiest to think of them as
filters.
The filters depend only on a constant number of values.
(bounded support)
Preserve energy (norm of the pixels = norm of the
coefficients)
Inverse filters also have bounded support.
21
Haar Filters
low pass =
1 1
,
2 2
high pass =
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
-0.2
-0.2
1 1
,
2 2
-0.4
-0.4
-0.6
-0.6
-0.8
-0.8
1
1
n
A[2i] +
A[2i + 1], 0 i <
2
2
2
1
1
n
high pass B[n/2 + i] =
A[2i] +
A[2i + 1], 0 i <
2
2
2
low pass
B[i] =
22
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
-0.2
gj
0.8
hj
0
-4
-3
-2
-1
-0.2
-0.4
-0.4
-0.6
-0.6
-0.8
-0.8
-1
-1
-3
-2
low pass
high pass
-1
n
2
n
2
23
24
Wavelet Transform
Encoder
image
(pixels)
wavelet
transform
transformed image
(coefficients)
wavelet
coding
bit
stream
Decoder
wavelet
decoding
transformed image
(approx coefficients)
inverse
wavelet
transform
distorted
image
25
Bit-Plane Coding
Normalize the coefficients to be between 1
and 1
Transmit one bit-plane at a time
For each bit-plane
Significance pass: Find the newly significant
coefficients, transmit their signs.
Refinement pass: transmit the bits of the known
significant coefficients.
26
Coefficients
...
+0010 -0011
+0001 -1000
+0101 +0111
27
Significant Coefficients
90
80
70
bit-plane 1
threshold
60
50
magnitude
40
30
20
10
0
coefficients
28
Significant Coefficients
90
80
70
60
50
magnitude
40
bit-plane 2
threshold
30
20
10
0
coefficients
29
Main idea:
Coefficient List
#
value
1 010010010110
2 001011011110
3 000001001001
4 000000010110
5 000100111101
6 000000100101
refinement
bits
7 101101110101
8 010010011111
9 001011101101
10 000010100101
:
:
Bit-plane 3
30
Compressed
size
bit plane
1
bpp
.0014
PSNR
15.3
31
Compressed
size
bit planes
12
bpp
.0033
PSNR
16.8
32
Compressed
size
bit planes
13
bpp
.0072
PSNR
18.8
33
Compressed
size
bit planes
14
bpp
.015
533 : 1
PSNR
20.5
34
Compressed
size
bit planes
15
bpp
.035
ratio
229 : 1
PSNR
22.2
35
Compressed
size
bit planes
16
bpp
.118
ratio
68 : 1
PSNR
24.8
36
Compressed
size
bit planes
17
bpp
.303
ratio
26 : 1
PSNR
28.7
37
Compressed
size
bit planes
18
bpp
.619
ratio
13 : 1
PSNR
32.9
38
bit planes
19
bpp
1.116
ratio
7:1
PSNR
37.5
39
PACW
A simple image coder based on
Bit-plane coding
Significance pass
Refinement pass
Arithmetic coding
Careful selection of contexts based on statistical
studies
40
wavelet
transform
transformed
image
(coefficients)
subtract
LL Avg
bit-planes
Decoder
bit plane
decoding
using AC
Bitplanes
Recombine
bit-planes
Interpolate
add
LL Avg
transformed
image
(approx
coefficients)
bit plane
encoding
using AC
inverse
wavelet
transform
bit
stream
distorted
image
41
42
43
Decoding
Emulate the encoder to find the bit planes.
The decoder knows which bit-plane is being
decoded
Whether it is the significant or refinement pass
Which coefficient is being decoded.
44
Refinement contexts
1st refinement bit is always 1 so no context needed
2nd refinement bit has a context
All other refinement bits have a context
45
Subband Level
Image is divided into subbands until LL band
(subband level 0) is less than 16x16
Barbara image has 7 subband levels
0
1
2
3
46
# significant
# insignificant % significant
144
364
28.3%
272
1048
20.6%
848
4592
15.6%
3134
23568
11.7%
12268
113886
9.7%
48282
504633
8.7%
190003
2226904
7.8%
47
p parent
a a a
a
a
a a a
a spatially adjacent
i spatially identical
c child
48
# significant
# insignificant
% significant
4849
2252468
.2%
13319
210695
5.9%
22276
104252
17.6%
30206
78899
27.7%
33244
55841
37.3%
27354
39189
41.1%
36482
44225
45.2%
87566
91760
48.8%
49
1s
% 0s
146,293
100,521
59.3%
Other Refinement
Bits
475,941
433,982
53.3%
Sign Bits
128,145
130,100
49.6%
50
Sign context
1 contexts
2 Refinement contexts
1st refinement bit is always 1 not transmitted
2nd refinement bit has a context
all other refinement bits have a context
51
Priority Queue
Used in significance pass to decide which
coefficient to code next
Goal code coefficients most likely to become
significant
52
Reconstruction of Coefficients
Coefficients are decoded to a certain number of bit
planes
.101110XXXXX What should Xs be?
.101110000 < .101110XXXXX < .101110111
.101110100000 is half-way
+.38
+.5
.A111
.A01100 .A100
53
54
55
56
57
Results
Compression of Barbara
37
36
35
34
PSNR (dB)
33
32
31
30
29
JPEG2000
28
UWIC
27
GTW
SPIHT
26
JPEG
25
24
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
58
Results
Compression of Lena
41
40
39
38
PSNR (dB)
37
36
35
34
PACW
GTW
SPIHT
JPEG2000
JPEG
33
32
31
30
29
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
59
Results
Compression of RoughWall
33
32
31
PSNR (dB)
30
29
28
27
UW IC
GTW
26
SPIHT
JPEG2000
25
JPEG
24
23
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
60
PACW Notes
PACW competitive with JPEG 2000, SPIHTAC, and GTW.
Developed in Java from scratch by two
undergraduates, Dane Barney and Amanda
Askew, in 2 months.
Danes final version is slightly different than
the one described here. See his senior
thesis.
61