Skip to content

billbird/arith32

Repository files navigation

arith32

A simple C++ arithmetic coder implementation with 8-bit symbols and 32-bit internal precision.

This implementation uses a static placeholder frequency distribution, but could be easily modified to use an adaptive method instead.

Try it out with commands like

./arith_compress < some_input_file > encoded_output
./arith_decompress < encoded_output > reconstructed_input_file
diff some_input_file reconstructed_input_file # Should produce no output since files should match exactly

The algorithms used in this implementation are discussed in more detail in the videos below.

This implementation was based on the pseudocode shown at the end of the second video. There were some minor typos in the pseudocode, but they have been fixed in this implementation.

About

Basic arithmetic coder in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published