Arithmetic coding/As a generalized change of radix: Difference between revisions

m
(simplified the encoding loop a little bit)
Line 519:
enc *= radix**pow;
 
base = 0sum(freq.values())
for v in freq.values():
base += v
 
# Create the cumulative frequency table
Anonymous user