Skip to content

daniel2643/LZSS-Compression

Repository files navigation

LZSS-Compression

An efficient lossless data compression algorithm implementation

Description

Lempel-Ziv-Storer-Szymanski (LZSS) algorithm is the variation of Lempel-Ziv (LZ77) algorithm, which optimizes space storage for binary numbers. LZSS algorithm is a prefix-free algorithm which means there're no common prefix for all code words.

LZSS algorithm is a sliding window based algorithm. It includes the lookup buffer size (the size after current cursor) and dictionary size (the size before current cursor)

LZSS algorithm can be used in many applications, such as gzip, PKZIP etc.

The project is the implementation includes:

  1. encoder : encode(compress) data into binary number
  2. decoder : decode(unzip) binary number to data

Compliation

Encoder

python3 lzss_encoder.py <inputfile> <D> <B>

D is the dictionary size, B is the buffer size. For example, assuming the Sliding window size is 10, and D = 6, B = 4.

The input file can be tested from the file generated by decoder output_lzss_decoder.txt

Decoder

pyhton3 lzss_decoder.py <inputfile>

The input file can be tested by the file generated from encoder output_lzss_encoder.txt

About

An efficient lossless data compression algorithm implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages