Chapter 3

Huffman Coding

Abstract

In this chapter, we describe a very popular coding algorithm called the Huffman coding algorithm. We first present a procedure for building Huffman codes when the probability model for the source is known, and then we introduce a procedure for building codes when the source statistics are unknown. We also describe a few techniques for code design that are in some sense similar to the Huffman coding approach. Finally, we give some examples of using the Huffman code for image compression, audio compression, and text compression.

Keywords

Huffman codes; Minimum variance Huffman codes; Canonical Huffman codes; Nonbinary Huffman codes; Adaptive Huffman codes; Golomb codes; Rice codes; CCSDS; Tunstall codes ...

Get Introduction to Data Compression, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.