Skip to content

A C language implementation of a Canonical Huffman Encoder and Decoder pair

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

gdavidbutler/canonicalHuffman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

canonicalHuffman

A C language implementation of a Canonical Huffman Encoder and Decoder pair

No dependencies. No dynamic memory allocation. No recursion. Small and Fast.

There are two (handled) exceptions to huffman encoding:

  • If the input is "dense", the encoding is a little larger.
  • If the input contains a single value, the encoding is trivially small.

Otherwise, Huffman encoding should be smaller than the input.

On inputs, where Run-Length encoding is effective, Huffman encoding is more effective on Run-Length encoded inputs. For these inputs, an implementation of a Run-Length Encoder and Decoder pair is also provided.

Examples:

  • test/encode.c - encodes file on command line to stdout
  • test/decode.c - decodes file on command line to stdout

About

A C language implementation of a Canonical Huffman Encoder and Decoder pair

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published