Lecture 4-Arithmetic Coding
Lecture 4-Arithmetic Coding
redundancy p1 0.086
blocking
one symbol, one word
arithmetic
coding
01101010 0.01101010
In order to explain the algorithm, numbers will
be shown as decimal, but obviously they are
always binary
P[b]=2/5
(P[b]=2/4) b
P[c]=2/5
0.416
(P[a]=1/4) 7 a
low 0.333 low = 0.5834
3
(P[a]=1/5) 0.600
1 a
low 0.583 low = 0.6334
4
1/3
0.6667
c 0. 0. 6667
1/4
c 6667
2/5 c 3/6 c
0.666 0.5834
0.6501
0.6334 2/6 b
7
2/4 0.6390
1/3 b 2/5
b b 0.6334 a
chr freq.
space 0.1
A 0.1
B 0.1
E 0.1
G 0.1
I 0.1
L 0.2
S 0.1
T 0.1
and so on...
log Pr[ s]
bits to the output, that is equal to symbol
probability content (uncertainty)!!
s 1
low_bound = i 1 Pr[i]
high_bound = i 1 Pr[i]
s
i 1
Pr[i ]
(high low)
Pr[i]
i 1
Return symbol s
Perform the same range-narrowing step of the encoding step
32
LZ77/78 Coding Example
33