For Programmers: Free Programming Magazines  


Home > Archive > Compression > July 2006 > Q: Arithmetic Coding and Range Coding - The Same?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Q: Arithmetic Coding and Range Coding - The Same?
Simon G Best

2006-07-16, 6:55 pm

Hello!

I'd like to check something.

From my understanding of arithmetic coding and range coding, they're
both the same. It's just that arithmetic coding happens to be one
interpretation of the actual algorithms (and implementations thereof),
while range coding is another interpretation of what are actually
exactly the same algorithms (and implementations).

In arithmetic coding, an arithmetic code is a sequence of symbols
interpreted (by an external observer sing to understand the
algorithm) as representing a rational number in the range [0,1). In
range coding, a range code is a sequence of symbols interpreted as
representing a natural number from a range of natural numbers, that
range being [0,b^N), where N is the number of symbols in the range code
itself, and b is the number base used in interpreting the range code
accordingly.

The thing is, such a range code can equivalently be interpreted as a
corresponding arithmetic code, and vice-versa. After all, if the range
code is taken as representing a natural number, x, the corresponding
arithmetic code - which is exactly the same sequence of symbols - is
taken as representing the rational number x/(b^N). Similarly the other
way round. Consequently, a range encoder/decoder is itself the
corresponding arithmetic encoder/decoder, and - of course - vice-versa.

Stuff about arithmetic coding being bit/binary-based, and range coding
being byte-based, and that sort of thing, seem to be irrelevant
implementation details. We can just as easily have byte-based
arithmetic coders, and bit/binary-based range coders - a byte-based
range coder is itself a byte-based arithmetic coder (and vice-versa, of
course)! Whether it's byte-based, or bit/binary-based, really doesn't
depend on whether we interpret the code as being an arithmetic code
(representing a rational in the range [0,1)) or as a range code
(representing a natural number).

But I'd like to check that I really have understood this correctly. So:
have I understood this correctly?

:-)

Simon G Best
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com