Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Utilities » Downloads
 
Add your own
alternative version

Project Tool

, 23 Sep 2007
Backup your C# solution and projects for archive or source code sharing. Temporary or unused files are excluded.
projecttool.zip
projecttool_0908_.zip
bin
Release
ICSharpCode.SharpZipLib.dll
ProjectTool.exe
CodeLib
Controls
ProjectTool
Items
Project
Propertys
Solution
Icon
cs.png
default.ico
dir.png
diro.png
dll.png
projecttool_20070924.zip
ProjectTool.exe
Checksums
Compress
Deflate
Common
Decode
Encode
Formats
Zip
HuffmanCoding
LempelZivWelch
LempelZiv
Resources
Icon
cs.png
default.ico
dir.png
diro.png
dll.png
projecttool_src.zip
ProjectTool.exe
cs.png
default.ico
dir.png
diro.png
dll.png
release.zip
This improved version of the original LZ78 algorithm is perhaps the most
famous modification. Published by Terry Welch in 1984, it basically
applies the LZSS principle of not explicitly transmitting the next nonmatching
symbol to the LZ78 algorithm. 

The only remaining output of this improved algorithm are fixed-length references 
to the dictionary (indexes).  The dictionary has to be initialized with
all the symbols of the input alphabet and this initial dictionary needs to
be made known to the decoder.

Encode Algorithm:

initialize dictionary;
word <- NIL;

while (there is input)
{
	symbol <- next symbol from input;
	phrase <- word + symbol;
	
	if (phrase exists in the dictionary)
	{
		word <- phrase;
	}
	else
	{
		output (index(word));
		add phrase to the dictionary;
		word <- symbol;
	}
}
output (index(word));

Decode Algorithm:

initialize dictionary;
phrase <- NIL;

while (there is input)
{
	wordIndex <- next code from input;
	
	if (wordIndex exists in the dictionary)
	{
		word <- dictionary[wordIndex];
		phrase <- phrase + head(word);
		if(phrase.Length > 1)
		{
			add phrase to the dictionary;
		}
	}
	else
	{
		phrase <- phrase + head(phrase);
		add phrase to the dictionary;
		word <- phrase; //word <- dictionary[wordIndex];
	}
	phrase <- word;
	output (word);
}

In the original proposal, the pointer size is chosen to be 12 bit, allowing
for up to 4096 dictionary entries. Once this limit has been reached, the
dictionary becomes static.

GIF image compression is originally developed by CompuServe in the late 1980s,
the GIF file format employs the LZW technique for compression.

LZC is the variant of the LZW. It compresses according to the LZW principle
but returns to variable-length pointers like the original LZ78 algorithm.
It first starts with 9-bit indexes for the first 512 dictionary entries, 
then continues with 10-bit codes and so on until the user-specified limit has been
reached. Finally, the algorithm becomes a static encoder, regularly checking
the compression ratio. When it detects a decrease, it throws away the
dictionary and starts building up a new one from scratch.

LZFG uses the dictionary building technique from the original LZ78 algorithm,
but stores the elements in a trie data structure. In addition, a
sliding window like LZ77��s is used to remove the oldest entries from the
dictionary.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Liu Junfeng
Software Developer (Senior) Beyondsoft SH
China China
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 23 Sep 2007
Article Copyright 2006 by Liu Junfeng
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid