Simple/efficient text compression Simple/efficient text compression c c

Simple/efficient text compression


It sounds like LZO was designed to meet your requirements:

  • Decompression is simple and very fast.
  • Requires no memory for decompression.
  • Compression is pretty fast.


Something BWT-based would be probably good for this case.http://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform
It compresses text much better than LZs, and is easy to implement from scratch,and there're good libraries.
http://libbsc.com
http://encode.ru/threads/104-libBWT?p=22903&viewfull=1#post22903
http://code.google.com/p/libdivsufsort/

Or, alternatively, there's ppmd which is used for text compression inrar/winzip/7-zip etc, but its more complicated.
http://www.compression.ru/ds/ppmdj1.rar
http://www.compression.ru/ds/ppmsj.rar (faster/small memory usage)
http://www.ctxmodel.net/files/PPMd/ppmd_Jr1_sh8.rar (alternative port)