This is an implementation of An Algorithm for Online Data Compression.
I could find two existing implementations of this code on the Internet:
- The J2K Library project, which appears to be the original implementation
- This implementation, which looks like part of a Windows tool
I forked the second one, and made the following changes:
- Got everything compiling with g++ and clang, on both Mac OSX and Linux
- Removed a bunch of non-portable Windows-isms
- Fixed a buffer overrun (read past end of array)
- Fixed some type mismatch warnings
- Fixed case-sensitivity trouble in the #includes
- Cleaned up the C API
- Added a rudimentary test program
- Re-indented a few messy spots
One day, I may get around to fixing up all the nasty int-long casts and re-doing this in more modern C++ style, but for now I'm just hoping that providing the existing code as a standalone project is useful to someone.
make
Only a basic test program is supplied:
make test
./test
A collection of helpful links
- An Algorithm for Online Data Compression
- Dr.Dobb's link
- J2K Library (original code)
- Another derived implementation
liblzhl is released under the GNU LGPL as required by http://j2k.sourceforge.net/faq.shtml