Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Arithmetic coding
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Precision and renormalization== The above explanations of arithmetic coding contain some simplification. In particular, they are written as if the encoder first calculated the fractions representing the endpoints of the interval in full, using infinite [[precision (arithmetic)|precision]], and only converted the fraction to its final form at the end of encoding. Rather than try to simulate infinite precision, most arithmetic coders instead operate at a fixed limit of precision which they know the decoder will be able to match, and round the calculated fractions to their nearest equivalents at that precision. An example shows how this would work if the model called for the interval {{math|[0,1)}} to be divided into thirds, and this was approximated with 8 bit precision. Note that since now the precision is known, so are the binary ranges we'll be able to use. {| class="wikitable" ! rowspan="2" | Symbol !Probability ! colspan="2" | Interval reduced to eight-bit precision ! Range |- !(expressed as fraction) !(as fractions) !(in binary) !(in binary) |- align="center" |A |1/3 |{{math|[0, 85/256)}} |<span style="font-family:monospace">[0.00000000, 0.01010101)</span> |<span style="font-family:monospace">00000000 β 01010100</span> |- align="center" |B |1/3 |{{math|[85/256, 171/256)}} |<span style="font-family:monospace">[0.01010101, 0.10101011)</span> |<span style="font-family:monospace">01010101 β 10101010</span> |- align="center" |C |1/3 |{{math|[171/256, 1)}} |<span style="font-family:monospace">[0.10101011, 1.00000000)</span> |<span style="font-family:monospace">10101011 β 11111111</span> |} A process called ''renormalization'' keeps the finite precision from becoming a limit on the total number of symbols that can be encoded. Whenever the range is reduced to the point where all values in the range share certain beginning digits, those digits are sent to the output. For however many digits of precision the computer ''can'' handle, it is now handling fewer than that, so the existing digits are shifted left, and at the right, new digits are added to expand the range as widely as possible. Note that this result occurs in two of the three cases from our previous example. {| class="wikitable" !Symbol !Probability !Range !Digits that can be sent to output !Range after renormalization |- align="center" |A |1/3 |{{mono|'''0'''0000000 β '''0'''1010100}} |'''0''' |{{mono|0000000'''0''' β 1010100'''1'''}} |- align="center" |B |1/3 |{{mono|01010101 β 10101010}} |{{CNone|None}} |{{mono|01010101 β 10101010}} |- align="center" |C |1/3 |{{mono|'''1'''0101011 β '''1'''1111111}} |'''1''' |{{mono|0101011'''0''' β 1111111'''1'''}} |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)