Golomb coding: Difference between revisions

Content deleted Content added
Line 73:
!colspan="2"|Encoding of quotient part
|-
!''{{mvar|q''}}||output bits
|-
|0||0
Line 98:
!colspan="4"|Encoding of remainder part
|-
!''{{mvar|r''}}||offset||binary||output bits
|-
|0||0||0000||000
Line 122:
|}
 
For example, with a Rice–Golomb encoding using parameter {{math|''M'' {{=}} 10}}, the decimal number 42 would first be split into ''{{mvar|q''}} = 4,'' and {{mvar|r''}} = 2, and would be encoded as qcode(''{{mvar|q''}}),rcode(''{{mvar|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 ''{{mvar|q''}} code is enough to say when ''{{mvar|q''}} ends and ''{{mvar|r''}} begins ; both the qcode and rcode are self-delimited).
 
== Use for run-length encoding ==