[Skip top navbar]

Andrew Gregory's Web Pages

Rocky outcrop at sunset, Approx 27°56'15"S 119°38'17"E


LZSS Data Compression OPX


LZSS OPX Version History
  • Improved error handling and cleanup
  • Propagated I/O error conditions back to Lzss... return values
  • Improved the test OPL program
  • First official release

NOTE: If you downloaded the v1.00 version within 12 hours of my original newsgroup annoucement posting, then you should download LZSSOPX.ZIP again. I forgot to have the main Lzss... procedures return integers instead of floats. If you have already installed it, uninstall the old copy first.


The LZSS OPX allows EPOC OPL developers to use data compression in their programs. The engine uses callbacks to implement all I/O allowing memory-memory compression/decompression as well as perhaps more typical file-file compression/decompression.

This is not an archiver! This OPX implements raw data compression only. What you do with it is up to you! It imposes no structure on the output data. If you want an archiver, you'll have to implement the management yourself. No doubt this would include records for file names, dates, sizes, attributes, etc.

The design of this compression engine is based on streams. A stream of data is supplied via the reader callback. The compression engine provides a stream of data to the writer callback. There are no assumptions that files are involved. For example, you could use this OPX to compress a serial communications stream (I haven't tried this myself, but it would seem to be possible).

The compression/decompression routines require about 30K of working memory. The I/O buffers are user-allocated - make them as big or as small as you like. HOWEVER, they are not optional! See TESTLZSS.TPL to see how they work.

On my MC218 (=5mx) the original Agenda.app file is 317840 bytes long. It compressed to 163564 bytes (51%) in ~20sec (~16K/sec) and decompressed in ~7.5sec (~41K/sec).

Increasing the I/O buffers from 256 bytes each to 4096 bytes each improved the times as follows: ~14.5sec (~21.5K/sec) to compress and ~2.5sec (~120K/sec) to decompress.

Your mileage may vary!

As a comparison, RMRZip compressed Agenda.app to 132606 bytes (41%) in ~30sec (~10K/sec) and decompressed it in ~1.5sec (~207K/sec).

Please note, as for any data compression algorithm, some input data may actually expand. If this is important to you, it is up to you to detect and do something about it.


lzssopx.zip ( 11K) LZSS OPX


This is my first OPX, and my first EPOC C++ program. I've probably done many things incorrectly, and probably don't do half the error checking and such I should be. Please email me if you find any bugs or have any feature requests.