Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Arithmetic coding
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
===Encoding and decoding: example=== [[Image:Arithmetic encoding.svg|400px|thumb|right|A diagram showing decoding of 0.538 (the round dot) in the example model. The region is divided into subregions proportional to symbol frequencies, then the subregion containing the point is successively subdivided in the same way.]] Consider the process for decoding a message encoded with the given four-symbol model. The message is encoded in the fraction 0.538 (using decimal for clarity, instead of binary; also assuming that there are only as many digits as needed to decode the message.) The process starts with the same interval used by the encoder: <nowiki>[0,1)</nowiki>, and using the same model, dividing it into the same four sub-intervals that the encoder must have. The fraction 0.538 falls into the sub-interval for NEUTRAL, <nowiki>[0, 0.6)</nowiki>; this indicates that the first symbol the encoder read must have been NEUTRAL, so this is the first symbol of the message. Next divide the interval <nowiki>[0, 0.6)</nowiki> into sub-intervals: * the interval for NEUTRAL would be <nowiki>[0, 0.36)</nowiki>, ''60% of <nowiki>[0, 0.6)</nowiki>''. * the interval for POSITIVE would be <nowiki>[0.36, 0.48)</nowiki>, ''20% of <nowiki>[0, 0.6)</nowiki>''. * the interval for NEGATIVE would be <nowiki>[0.48, 0.54)</nowiki>, ''10% of <nowiki>[0, 0.6)</nowiki>''. * the interval for END-OF-DATA would be <nowiki>[0.54, 0.6)</nowiki>, ''10% of <nowiki>[0, 0.6)</nowiki>''. Since 0.538 is within the interval <nowiki>[0.48, 0.54)</nowiki>, the second symbol of the message must have been NEGATIVE. Again divide our current interval into sub-intervals: * the interval for NEUTRAL would be <nowiki>[0.48, 0.516)</nowiki>. * the interval for POSITIVE would be <nowiki>[0.516, 0.528)</nowiki>. * the interval for NEGATIVE would be <nowiki>[0.528, 0.534)</nowiki>. * the interval for END-OF-DATA would be <nowiki>[0.534, 0.540)</nowiki>. Now 0.538 falls within the interval of the END-OF-DATA symbol; therefore, this must be the next symbol. Since it is also the internal termination symbol, it means the decoding is complete. If the stream is not internally terminated, there needs to be some other way to indicate where the stream stops. Otherwise, the decoding process could continue forever, mistakenly reading more symbols from the fraction than were in fact encoded into it.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Arithmetic coding
(section)
Add topic