Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Golomb coding
(section)
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!
== 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>. {| style="margin:0" |-valign="top" | {| class="wikitable" style="margin:0 1em 0 0" |- !colspan="2"|Encoding of quotient part |- !{{mvar|q}}||output bits |- |0||0 |- |1||10 |- |2||110 |- |3||1110 |- |4||11110 |- |5||111110 |- |6||1111110 |- |<math>\vdots</math>||<math>\vdots</math> |- |N||<math>\underbrace{111\cdots111}_N 0</math> |} | {| class="wikitable" style="margin:0" |- !colspan="4"|Encoding of remainder part |- !{{mvar|r}}||offset||binary||output bits |- |0||0||0000||000 |- |1||1||0001||001 |- |2||2||0010||010 |- |3||3||0011||011 |- |4||4||0100||100 |- |5||5||0101||101 |- |6||12||1100||1100 |- |7||13||1101||1101 |- |8||14||1110||1110 |- |9||15||1111||1111 |} |} 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).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)