<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Variable-length encoding - Page 16 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Variable-length_encoding&amp;p=15">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Variable-length_encoding&amp;p=17">3.Next</a>
</p>
<p>and <a href="page.php?w=variable-length_quantity">variable-length quantity</a> (VLQ) codes.</p>

<p>For example, the mapping  above is not a prefix code because we do not know after reading the bit string  whether it encodes an  source symbol, or if it is the prefix of the encodings of the  or  symbols. An example of a prefix code is shown below.</p>

<p>
:: Example of encoding and decoding:<br/>
:::  ->  ->  -> </p>

<p>For this example, if the probabilities of  were , the expected number of bits used to represent a source symbol using the code</p><p>
<a accesskey="1" href="page.php?w=Variable-length_encoding&amp;p=15">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Variable-length_encoding&amp;p=17">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
