Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:1909.06794

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Information Theory

arXiv:1909.06794 (cs)
[Submitted on 15 Sep 2019 (v1), last revised 1 Oct 2019 (this version, v2)]

Title:Run-Length Encoding in a Finite Universe

Authors:N. Jesper Larsson
View a PDF of the paper titled Run-Length Encoding in a Finite Universe, by N. Jesper Larsson
View PDF
Abstract:Text compression schemes and compact data structures usually combine sophisticated probability models with basic coding methods whose average codeword length closely match the entropy of known distributions. In the frequent case where basic coding represents run-lengths of outcomes that have probability $p$, i.e. the geometric distribution $\Pr(i)=p^i(1-p)$, a \emph{Golomb code} is an optimal instantaneous code, which has the additional advantage that codewords can be computed using only an integer parameter calculated from $p$, without need for a large or sophisticated data structure. Golomb coding does not, however, gracefully handle the case where run-lengths are bounded by a known integer~$n$. In this case, codewords allocated for the case $i>n$ are wasted. While negligible for large $n$, this makes Golomb coding unattractive in situations where $n$ is recurrently small, e.g., when representing many short lists of integers drawn from limited ranges, or when the range of $n$ is narrowed down by a recursive algorithm. We address the problem of choosing a code for this case, considering efficiency from both information-theoretic and computational perspectives, and arrive at a simple code that allows computing a codeword using only $O(1)$ simple computer operations and $O(1)$ machine words. We demonstrate experimentally that the resulting representation length is very close (equal in a majority of tested cases) to the optimal Huffman code, to the extent that the expected difference is practically negligible. We describe efficient branch-free implementation of encoding and decoding.
Comments: SPIRE 2019
Subjects: Information Theory (cs.IT); Data Structures and Algorithms (cs.DS)
Cite as: arXiv:1909.06794 [cs.IT]
  (or arXiv:1909.06794v2 [cs.IT] for this version)
  https://doi.org/10.48550/arXiv.1909.06794
arXiv-issued DOI via DataCite

Submission history

From: N. Jesper Larsson [view email]
[v1] Sun, 15 Sep 2019 12:48:00 UTC (347 KB)
[v2] Tue, 1 Oct 2019 05:13:05 UTC (347 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Run-Length Encoding in a Finite Universe, by N. Jesper Larsson
  • View PDF
  • TeX Source
  • Other Formats
view license
Current browse context:
cs.IT
< prev   |   next >
new | recent | 2019-09
Change to browse by:
cs
cs.DS
math
math.IT

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
N. Jesper Larsson
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack