Home > Archive > Compression > April 2005 > Lzw dictionnary implementation
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Lzw dictionnary implementation
|
|
| Flaway 2005-04-25, 3:55 pm |
| Hello!
I read that the Lzw algorithm doesn't add his dictionnary to the compressed
file.
If it's true, i wonder how he could decompress the file!
If it reads the chain "AA" and that it put it in the dictionnary with the
value "259", he can't guess that "259" = "AA"...
So how does it work?
thanks for your answers!
| |
| John_H 2005-04-25, 3:55 pm |
| "Flaway" <iwantutospamme@thx.com> wrote in message
news:426d14a4$0$14392$626a14ce@news.free.fr...
> Hello!
>
> I read that the Lzw algorithm doesn't add his dictionnary to the
compressed
> file.
> If it's true, i wonder how he could decompress the file!
>
> If it reads the chain "AA" and that it put it in the dictionnary with the
> value "259", he can't guess that "259" = "AA"...
> So how does it work?
>
> thanks for your answers!
If the first open dictionary entry is 259, the compressor knows the first
new string "AA" is entry 259. The decompressor gets the "A" (single
characters aren't encoded) followed by another "A" or a string that starts
with that letter and IT knows the first open dictionary entry - 259 - gets
to be "AA". Pretty succinct.
| |
| Flaway 2005-04-25, 3:55 pm |
| sorry for my english and thanks for your explanation =)
|
|
|
|
|