Professional Documents
Culture Documents
Ip07 08
Ip07 08
150:
150
2005 Nicolas Tsapatsoulis
150:
150:
-
uffman
(lossless compression)
Huffman
[1999]: 9, 9.1-9.6
150:
150:
-
uffman
(
, , , )
-
.
(
.
bits
pixel .
bits
2005 Nicolas Tsapatsoulis
150:
150:
-
uffman
CD-ROM;
:
(.. )
;
150:
150:
-
uffman
(II);
animation ;
150:
150:
-
uffman
4800 =>
500 =>
(2 x 10 bits),
(2 x 10 bits) 8 bits
150:
150:
-
uffman
()
CD-ROM :
74 , CD
... 20
(HDTV) ( ,
aspect ratio 16:9 4:3)=>
625 lines x 840 pixel /line x 3 bytes /pixel x 25 frames () /sec => 39
Mbyte / sec
120 GB 60
150:
150:
-
uffman
bandwidth
( )
bits (.. ,
)
g di
mi g(di) = mi
150:
150:
-
uffman
(II)
gr mi
dr gr(mi) = dr
Trade-off: vs.
150:
150:
-
uffman
/
150
msecs (end-to-end delay)
50 msecs
face-to-face
end-to-end
, ,
/ .
2005 Nicolas Tsapatsoulis
150:
150:
-
uffman
()
(Retrieval Mode)
(forward and backward)
,
0,5 sec
(
)
150:
150:
-
uffman
.
:
pixel
pixel
bits
pixels (
). H pixel
.
pixel
.
(texture - pattern)
, .
- :
150:
150:
-
uffman
- BPP = log2(K) = B:
K = (. 256 [0
255].
B = log2(256) = 8.
bits pixel
(Variable Length
Coding VLC).
B(x, y) = bits
pixel f(x,y).
: BPP =
1
MxN
M 1 N 1
B( x, y)
x =0 y =0
, f
2005 Nicolas Tsapatsoulis
150:
150:
-
uffman
O Btotal bits
f pixel
. (header)
:
(, ,
)
BPP :
BPP =
(II)
1
Btotal
MxN
CR (Compression Ratio) (
bits per pixel ):
CR =
B
BPP
2005 Nicolas Tsapatsoulis
150:
150:
-
uffman
150:
150:
-
uffman
bits per pixel
=1 (binary images), =8
(indexed)
=24 (full color RGB).
150:
150:
-
uffman
(8) rk (k=0..7)
.
B
bits per pixel ..: 2 8. =3.
pr(rk)
( ;)
bits
BPP<B.
.
o BPP ;
150:
150:
-
uffman
pixel
pixel
.
(
)
pixel
pixel
bits.
150:
150:
-
uffman
(Psychvisual redundancy)
.
JPEG ,
,
150:
150:
-
uffman
=>
.
/
(.. ).
( ,
).
.
2005 Nicolas Tsapatsoulis
10
150:
150:
-
uffman
()
(entropy encoding):
.
.
(source encoding):
.
pixel .
(hybrid encoding):
,
(
2005 Nicolas Tsapatsoulis
)
150:
150:
-
uffman
Zero Suppression
Huffman
11
150:
150:
-
uffman
DM (Difference Modulation)
(Layered)
Subband Coding
Quadtree
Fractals
150:
150:
-
uffman
(coding standards)
(DCT) (RLC)
H263 ( ):
(DCT), (
MC: motion compensation) (RLC)
(DCT), (
MC: motion compensation), (RLC)
(Subband Coding) (MP3).
12
150:
150:
;
;
-
uffman
.
:
(Mapping)
(.. ,
pixel )
(Quantization)
(Encoder)
()
150:
150:
;
;
;
-
uffman
2:1 CR 3:1
2005 Nicolas Tsapatsoulis
.
13
150:
150:
;
;
;
-
uffman
(entropy)
() bits pixel ( )
.
;
K
Shannon:
E=
P log
k
Pk
k =1
K o ()
Pk k.
Pk;
Pk=HI(k) = n/(xN),
k = 0, ... K-1,
k () n I,
( xN pixels) K .
2005 Nicolas Tsapatsoulis
150:
150:
;
;
;
-
uffman
(II)
( ),
,
.
bits
pixel (BPP).
H BPP (
) :
K 1
BPP =
N H
k
I (k )
k =0
o
, I(k) k k bits
k.
14
150:
150:
;
;
;
-
uffman
Pk = H I ( k ) =
1
K
K = 2B
K 1
E{ I } =
K log { K } = B
2
k =0
I .
I ;
( )
2005 Nicolas Tsapatsoulis
150:
150:
;
;
;
-
uffman
()
: 0 {}
: BPP {}
.. E{} = B
.
, (;)
( ) ..
pixels
Pk
,
2005 Nicolas Tsapatsoulis
15
150:
150:
;
;
;
-
uffman
5 = 32,
= 68, C =145, D =190, E = 225
P(A)=0.4, P(B)=0.08, P(C)=0.16,
P(D)=0.16, P(E)=0.2.
150:
150:
;
;
;
;
-
uffman
Huffman
(
)
16
150:
150:
;
;
;
;
-
uffman
Huffman ()
Huffman:
ki Pki
(0) ki Pki = 0
(2) pij = pi + pj ( , )
(3) :
ki '1' kj '0'
4) 1 ()
(1)
150:
150:
;
;
;
;
-
uffman
Huffman ()
P(ADCEB)=1.00
P(A)=0.16
011
P(B)=0.51
P(C)=0.09
000
P(D)=0.13
010
P(E)=0.11
001
P(ADCE)=0.49
0
P(CE)=0.20
0
P(C)=0.09
1
P(E)=0.11
P(B)=0.51
1
P(AD)=0.29
0
P(D)=0.13
1
P(A)=0.16
17
150:
150:
;
;
;
;
-
uffman
Huffman ()
K = 8 {0 ,.., 7}
. :
p(0) = 1/2
p (4) = 1/16
p(1) = 1/8
p (5) = 1/32
p(2) = 1/8
p (6) = 1/32
p (3) = 1/8
p (7) = 0
Huffman
bit pixel BPP
150:
150:
;
;
;
;
-
uffman
Huffman
Huffman .
bits
bits:
00010110101110000010000100010110111010
:
CBADBBBCECDEAABD
P(A)=0.16
011
P(B)=0.51
P(C)=0.09
000
P(D)=0.13
010
P(E)=0.11
001
18
150:
150:
;
;
;
;
-
uffman
Huffman
Huffman
2:1 CR 3:1
Huffman (
)
bit
:
00010110100110000010000100010110111010
;
. .
Huffman,
, Huffman.
Huffman.
2005 Nicolas Tsapatsoulis
150:
150:
;
;
;
;
-
uffman
Huffman
A,B,C,D,E
0.4
0.08
0.16
0.16
0.2
19
150:
150:
;
;
;
;
;
-
uffman
,
uffman, .
a1a2..an ai
Huffman
150:
150:
;
;
;
;
;
-
uffman
()
f
pixel ([0 1 2 3 4 5 6 7]) :
1 : =2.4912 bit/pixel
Huffman :
0 => 01, 1 => 10, 2 => 001, 3 => 111, 4 => 000, 5 => 110
pixel (4,1), (3,5), , (1,5):
Hi sto g ra m of Ima g e f
0 .25
4
0
f =
0
1 3 5 5 0 1 0
2 4 2 3 1 0 5
5 4 0 2 1 1 3
5 3 1 0 3 1 5
Probability of Occurence
0 .2
0 .15
0 .1
0 .05
3
4
V a lu e o f Pi xe l
20
150:
150:
;
;
;
;
;
-
uffman
(I)
[0,1]
:
4 [0.75 0.8438]
4
, .. 0.1101 =>
0.8125, 1101 4.
1 8 ,
41
[0.7705 0.794]
150:
150:
-
uffman
(V)
pixel
f :
1
(=2.4912 bit/pixel). ;
1 bits/pixel
pixel
Hi sto g ra m of Ima g e f
0 .25
4
0
f =
0
1 3 5 5 0
2 4 2 3 1
5 4 0 2 1
5 3 1 0 3
1
0
1
1
0
5
0 .2
Probability of Occurence
;
;
;
;
;
0 .15
0 .1
0 .05
3
4
V a lu e o f Pi xe l
21
150:
150:
;
;
;
;
;
-
uffman
(Huffman,
)
:
( <2)
(.. )
pixel
( pixel)
- (binary images)
pixel
0 1.
pixels
2005 Nicolas Tsapatsoulis
150:
150:
;
;
;
;
;
-
uffman
(II)
22
150:
150:
;
;
;
;
;
-
uffman
()
pixel
pixels
pixels
pixels
,
....
:
[1111111111000000000000000000111111111111111111000000000000
0001111111111]
: 10 18 19 15 10
150:
150:
;
;
;
;
;
-
uffman
(V)
1 byte
5 bytes:
() 72 pixels
: CR = 9 / 5 = 1.8
(.. Huffman)
Huffman
2 CR 3
Huffman
FAX.
2005 Nicolas Tsapatsoulis
23
150:
150:
;
;
;
;
;
-
uffman
(V)
(
RGB );
(flag):
[255 255 255 255 123 123 122 122 122 122 122 88 77 76]
: 255!4 123 123 122!5 88 77 66
pixel
bit pixels:
[0 255]
pixel 8 bits
150:
150:
;
;
;
;
;
-
uffman
Bit Planes
24
150:
150:
;
;
;
;
;
-
uffman
(packbits encoding)
pixel
(codewords)
,
( ):
E , T , TH, A, S , RE, IN, HE
150:
150:
;
;
;
;
;
-
uffman
()
(.. ):
123 145 201 4 119 89 243 245 59 11 206 145 201 4 243 245 ...
:
123 256 119 89 257 59 11 206 256 257 ...
:
145 201 4 => 256
243 245 => 257
25
150:
150:
;
;
;
;
;
-
uffman
LZW
LZW
( 255
pixel
[0 255])
pixel
2005 Nicolas Tsapatsoulis
150:
150:
;
;
;
;
;
;
-
uffman
pixel pixel
:
pixel
pixel pixel
Histogram of pixel differ ences of the Cameraman Image
10000
1800
9000
1600
8000
1400
Probability of Occurence
Probability of Occurence
7000
1200
1000
800
600
6000
5000
4000
3000
400
2000
200
1000
50
100
150
Value of Pixel
200
250
0
-100
-80
-60
-40
-20
0
20
Value of Pixel difference
40
60
80
100
26
150:
150:
;
;
;
;
;
;
-
uffman
(II)
( pixel)
(
pixel)
f ( x, y ) = 0.75 ( f ( x, y 1) + f ( x 1, y ) )
2
2
)
f ( x, y ) = f ( x, y 1)
150:
150:
;
;
;
;
;
;
-
uffman
()
8
8
f =
8
8
8
8
8
9
8
8
8
8
8
8
9
9
8
9
9
9 9
8 8
9 9
9 10
)
f ( x, y ) = f ( x , y 1)
10
9
11
13
8
) 8
f =
8
9
8
8 8 8 8 9 9 9
8 8 8 9 9 9 10
8 8 9 8 9 9
8 8 8 8 8 8
( )
:
)
d ( x, y ) = f ( x, y ) f ( x , y )
8
8
d =
8
0 1 1 1 0 0 1
0 0 0 0 1
0 0 0 1 0 0 2
0 0 1 0 0 1 3
0 0
27
150:
150:
;
;
;
;
;
;
-
uffman
(V)
pixel
=>
( )
2005 Nicolas Tsapatsoulis
150:
150:
;
;
;
;
;
;
;
-
uffman
(, , )
Huffman
28