• Advertisement
Sign in to follow this  

LZW algorithm

This topic is 2609 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using the write-up found at: http://www.martinreddy.net/gfx/2d/GIF-comp.txt to figure out how the LZW algorithm works. I've got it mostly working except for when my input size gets above a certain threshold where it then begins to fail. The decoded length appears to be a code word too short, but I can't figure out where it's getting lost.

Does anyone have a different reference for the LZW algorithm? The one I'm using doesn't seem very comprehensive. Something with test vectors more than a few characters in the input stream would help a lot. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You could try analyzing some existing gif decompression library to understand how it works.
For example giflib: dgif_lib.c (function DGifDecompressLine at line 733).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement