Lempel and Ziv 1977 (LZ77)

Vicente González Ruiz

December 31, 2019

Contents

1 History
2 Encoder
3 Decoder
4 Lab: LZSS
References

1 History

2 Encoder

  1. Let I the length of the dictionary and J the length of the buffer.
  2. Input the first J symbols in the buffer.
  3. While the input is not exhausted:

    1. Let i the position of the first j symbols of the buffer in the dictionary, and k the symbol that makes that j can not be larger.
    2. Output ijk.
    3. Input the next j + 1 symbols in the buffer.

Example

3 Decoder

  1. While code-words ijk are input:

    1. Output the j symbols extracted from the position i in the dictionary.
    2. Output k.
    3. Put all the decoded symbols in the beginnig of the buffer.

Example

4 Lab: LZSS

IPython notebook

References

[1]   James A Storer and Thomas G Szymanski. Data compression via textual substitution. Journal of the ACM (JACM), 29(4):928–951, 1982.

[2]   Jacob Ziv and Abraham Lempel. A universal algorithm for sequential data compression. IEEE Transactions on information theory, 23(3):337–343, 1977.