Arithmetic Coding Algorithm
P(a1), P(a2), … , P(am)
C(ai) = P(a1) + P(a2) + … + P(ai-1)
Encode x1x2...xn
Initialize l := 0 and r := 1;
for i = 1 to n do
w := r - l;
l := l + wC(xi);
r := l + wP(xi);
t := (l+r)/2;
choose code for the tag
Previous slide
Next slide
Back to first slide
View graphic version