0% found this document useful (0 votes)
101 views1 page

Lempel Ziv Coding Explained

LZ compression algorithms use repeating patterns in data to compress it. LZ-78 adds each new character to a dictionary with a prefix of repeating characters already in the dictionary. LZ-77 improves on LZ-78 by using a sliding window to find repeating character sequences appearing anywhere in the data, not just as a prefix. LZW is similar but operates on a per-character basis, assuming all possible characters are initially in the dictionary and sending codes based on the index of strings in the dictionary.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views1 page

Lempel Ziv Coding Explained

LZ compression algorithms use repeating patterns in data to compress it. LZ-78 adds each new character to a dictionary with a prefix of repeating characters already in the dictionary. LZ-77 improves on LZ-78 by using a sliding window to find repeating character sequences appearing anywhere in the data, not just as a prefix. LZW is similar but operates on a per-character basis, assuming all possible characters are initially in the dictionary and sending codes based on the index of strings in the dictionary.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

.

A discrete memoryless source (DMS) has the property that its output at a certa
in time does not depend on its output at any earlier time.
. Entropy = average code length required to encode a message.
. Lossless compression = Huffman, Run Length, LZ.
. Huffman coding is not universal but LZ coding is.
. LZ-78 (Dictionary): Adds each new character to the dictionary with a prefix. T
he prefix is supposed to be a repeating character. These repeating characters ar
e characters appearing in the dictionary before.
- Variant: LZ-Welch, LZ-Compress.
- Application GIF, CCITT, ARC etc.
. LZ-77 (Sliding Window): Improvement on LZ-78. Adds new characters to the dicti
onary with a prefix. The prefix is supposed to be repeating characters and infor
mation about their last known location. The repeating characters in question are
character sequences that appear in the data source. We are talking about the mo
st recent appearance here. But these repeating characters do not need to be part
of one unique string. The algorithm requires you to count a string as a repitit
ion even if you have the same set of characters making an appearance in the over
all dictionary in general.
- Variant: LZ-Storer-Szymanski or LZSS.
- Application Squeeze, LHA, PKZIP etc.
. LZW:
- Assume every possible character in your message is already in the dictionary.
Assign index numbers alphabetically.
- The prefix is empty initially and will remain empty until you've added all the
possible unique single characters in your dictionary.
- The last single character is now your prefix.
- Add it to the dictionary + the next bunch of characters like LZ78.
- Your prefix is now the last character of the previous string or entry in the d
ictionary.
- If your prefix repeats itself, which it will, make sure the string you make is
not already in the dictionary and what you are doing follows all the rules of L
Z78.
P = 0; //P = prefix and C = character.
while(1)
{
String = P + C;
C = P;
}
- What makes it different from LZ78 is the fact that it does things on a per cha
racter basis as opposed to a per string basis.
- You also need to remember what the last character of the most-recently added s
tring to the dictionary is.
- You send your code in terms of the index only i.e. 1 2 5 etc.
. LZ77 vs LZ78

You might also like