Arithmetic Coding Example
P(a) = 1/4, P(b) = 1/2, P(c) = 1/4
C(a) = 0, C(b) = 1/4, C(c) = 3/4
abca
symbol w l r
0 1
a 1 0 1/4
b 1/4 1/16 3/16
c 1/8 5/32 6/32
a 1/32 5/32 21/128
tag = (5/32 + 21/128)/2 = 41/256 = .001010010...
l = .001010000...
r = .001010100...
code = 00101
prefix code = 00101001
w := r - l;
l := l + w C(x);
r := l + w P(x)
Previous slide
Next slide
Back to first slide
View graphic version