Jump to content
  • Advertisement
Sign in to follow this  
Mantear

LZW algorithm

This topic is 2734 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!