Apack (aka aPACK) is a compression algorithm designed by Jørgen Ibsen of Ibsen Softawre. Designed to work in 16-bit DOS, Apack has the advantageous properties of offering a small decompressor footprint along with a quite good compression ratio. However, Apack does suffer from having a slower decompression rate than LZO. While this is the case, it is also the case that this is an acceptable trade-off for many, especially in situations where there is very little avaiable space.
For this reason, my projects like PocketNES...k and Pogoshell include support for apack decompression. However, for quite a long time there existed no apack ccompression except the official version. But after a good bit of effort at reverse engineering unapack.s (as created by Dwedit), a Python apack compressor was born. Unfortunately, all current versions apack compressors I've written have suffered from being both slower and creating worse compression that the official version. Still, average compression of my compressor seems to beat out LZO.
Having said that, there are current two major groups of Apack software.
- Python Based
- apack.py - One of the first version. Quite slow.
- apack.hash.py - An "improved" version, using hashes (ie, classdict) to improve searches. Still rather slow.
- apack.merdian.py - A much faster version, using Python's built-in string matcher.
- apack.merdian.py - A simple reordering of what compression choice to use, averaging in a slight increase in compression ratio.
- apack.hash-new.py - A modified hash version, attempting to use many lessons learned from a C implementation to improve compression. This version is well commented.
- C Based
- repeat.tree.c - Much like the name suggests, uses a tree structure to find repeating strings of data. This is the first version to attempt to find the longest match for every position and then try to chose the smallest number of long matches. Development on this was mostly given up as the complexity of trying to effectively clamp range usage optimally was turning out to be a nightmare to manage. However, this version turned out to be much faster than most of the Python versions, considering.
- Python Based
- unapack.py - A very direct port of unapack.c.
- unapack-verbose.py - A verbose version of unapack, offering some information on the decompression stream.
- unapack-verbose2.py - A much more verbose version of unapack, offering enough information to be rather useful in attempting to optimize the compression output.
- C Based
- unapack.c - A rather useful and portable version of unapack. It would be well advised if using GCC to use -O3 when compiling to inline most functions (or use the comparable function in other compilers).
I would greatly encourage those who are interested in compression who would like a challenge to try out my version of apack and help improve upon it. Everyone would benefit, and I would gladly take the help.
Kuwanger.net - Sort of like stag beetles in tubes.