Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Security policy

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages