Skip to content.
Sections
Personal tools
You are here: Home » Frame Store » Virtual Binary Objects » TLZStoreDecompressor

TLZStoreDecompressor

Document Actions
This document contain description of compression alghorithm used by TLZStoreDecompressor.

Lempel-Ziv encodes stream of data as series of binary tokens. There are two variants of tokens: one does contain literal bytes inside, second is just len-offset pair.

lztkl lztk

This is how example string "package1xxxxABCD000100020003XXXXxxxxpackage0package1" would be compressed:

lzexample

Of course, literal lengths, offsets and copylengths are not stored as plain bytes. Copy lengths are encoded with "fixed" variable length code. Literal length also is fixed variable length code. Offsets are encoded in different way, depending on maximum offset stored in file so far, and actual decompress buffer size.

Copy lengths are between 1 and 12 bits long, and can represent values up to 129. Literal lengths take from 1 to 10 bits, and can represent values between 1 and 63. Offsets can be between 1 and 12 bits long, and can point in maximum 0x1a00 bytes back in decompress buffer.

Decompression library

I have written library in C++ for compression and decompression of LZ compressed data. It's available in Downloads section.

Created by philz
Last modified 2003-09-12 02:46 PM
 

Powered by Plone