<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Network compression: arithmetic encoding</title><link>http://blogs.msdn.com/shawnhar/archive/2007/12/30/network-compression-arithmetic-encoding.aspx</link><description>Arithmetic encoding is one of those obscure tools that is rarely used, but every now and then is the only thing that can do the job. It's the oddly sized Allen-key of network data compression. Arithmetic encoding is cool because not many people have heard</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Network compression: arithmetic encoding</title><link>http://blogs.msdn.com/shawnhar/archive/2007/12/30/network-compression-arithmetic-encoding.aspx#9901727</link><pubDate>Thu, 01 Oct 2009 11:50:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9901727</guid><dc:creator>Silvermax</dc:creator><description>&lt;p&gt;Is the order right? i mean, if you write AnimalA, AnimalB, bool, should it be read as Bool, AnimalB and AnimalA? Thnx&lt;/p&gt;</description></item><item><title>re: Network compression: arithmetic encoding</title><link>http://blogs.msdn.com/shawnhar/archive/2007/12/30/network-compression-arithmetic-encoding.aspx#9901729</link><pubDate>Thu, 01 Oct 2009 11:53:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9901729</guid><dc:creator>Silvermax</dc:creator><description>&lt;p&gt;The value have to be subtracted from the bitfield, isnt it? &lt;/p&gt;
&lt;p&gt;int ArithmeticDecode(ref int bitfield, int valueRange)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int value = bitfield % valueRange;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bitfield -= value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bitfield /= valueRange;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;</description></item><item><title>re: Network compression: arithmetic encoding</title><link>http://blogs.msdn.com/shawnhar/archive/2007/12/30/network-compression-arithmetic-encoding.aspx#9901882</link><pubDate>Thu, 01 Oct 2009 18:42:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9901882</guid><dc:creator>ShawnHargreaves</dc:creator><description>&lt;p&gt;You don't need a subtraction, although it won't hurt: this is effectively a no-op. The division operator takes care of removing the unwanted fractional bits. Remember that integer division rounds down...&lt;/p&gt;
</description></item></channel></rss>