Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-nmvwc Total loading time: 0 Render date: 2024-07-07T11:20:43.421Z Has data issue: false hasContentIssue false

24 - Rational arithmetic coding

Published online by Cambridge University Press:  05 March 2013

Richard Bird
Affiliation:
University of Oxford
Get access

Summary

Introduction

This pearl, and the one following, is all about arithmetic coding, a way of doing data compression. Unlike other methods, arithmetic coding does not represent each individual symbol of the text as an integral number of bits; instead, the text as a whole is encoded as a binary fraction in the unit interval. Although the idea can be traced back much earlier, it was not until the publication of an “accessible implementation” by Witten, Neal and Cleary in 1987 that arithmetic coding became a serious competitor in the world of data compression. Over the past two decades the method has been refined and its advantages and disadvantages over rival schemes have been elucidated. Arithmetic coding can be more effective at compression than rivals such as Huffman coding, or Shannon–Fano coding, and is well suited to take account of the statistical properties of the symbols in a text. On the other hand, coding and decoding times are longer than with other methods.

Arithmetic coding has a well-deserved reputation for being tricky to implement; nevertheless, our aim in these two pearls is to give a formal development of the basic algorithms. In the present pearl, coding and decoding are implemented in terms of arbitrary-precision rational arithmetic. This implementation is simple and elegant, though expensive in time and space. In the following pearl, coding and decoding are reimplemented in terms of finite-precision integers. This is where most of the subtleties of the problem reside.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2010

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Rational arithmetic coding
  • Richard Bird, University of Oxford
  • Book: Pearls of Functional Algorithm Design
  • Online publication: 05 March 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9780511763199.025
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Rational arithmetic coding
  • Richard Bird, University of Oxford
  • Book: Pearls of Functional Algorithm Design
  • Online publication: 05 March 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9780511763199.025
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Rational arithmetic coding
  • Richard Bird, University of Oxford
  • Book: Pearls of Functional Algorithm Design
  • Online publication: 05 March 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9780511763199.025
Available formats
×