Golomb coding: Difference between revisions

Content deleted Content added
Line 64:
== Example ==
 
Set {{math|''M'' {{=}} 10}}. Thus <math>b = \lfloor\log_2(10)\rfloor = 3</math>. The cutoff is <math>2^{b+1}-M = 16-10 = 6</math>.
 
{|border="0" cellspacing="8" cellpadding="0"
Line 122:
|}
 
For example, with a Rice–Golomb encoding ofusing parameter {{math|''M'' {{=}} 10}}, the decimal number 42 would first be split into ''q'' = 4,''r'' = 2, and would be encoded as qcode(''q''),rcode(''r'') = qcode(4),rcode(2) = 11110,010 (you don't need to encode the separating comma in the output stream, because the 0 at the end of the ''q'' code is enough to say when ''q'' ends and ''r'' begins ; both the qcode and rcode are self-delimited).
 
== Use for run-length encoding ==