Compression and Decompression in C

I need to make a program in C that does the following:
Program to implement the run length encoder -- After the data is compressed and saved in a file another module will open the file again, decompress it and recover the original data. Also, the program will calculate
the efficiency of the encoder.

Can anyone give me an idea of how to compress and decompress a .txt file using C programming? what would be the functions used? Any sample code would be appreciated.
Google Lempel-Ziv-Storer-Szymanski, or LZSS. It's a lossless compression scheme with a somewhat good plain text compression ratio (25-50%*) and not too hard to implement.
Haruhiko Okumura wrote an implementation in C in 1989 which was very influential, particularly in Japan. I tried to read his code and gave up halfway through. If you want to try, you can find the source here: http://sprite.phys.ncku.edu.tw/NCKUtech/DCM/pub/DCM_CODE_ASM/lzss.c

*The actual performance depends on two parameters: how far back the algorithm will search backwards (the "window size"), and the size of the longest string that will be searched. The bigger these two values, the better.
Last edited on
Topic archived. No new replies allowed.