Unpacking GIF_LZW
ZXNet echo conference «code.zx»
From Alexandr Sinyakov → To All 20 April 2006
Hello, DVS
Now I don’t remember exactly how, but at GFXcon I made do with a 12K table for
unpacking GIFs. I spent 3 bytes per element, the maximum code length was 12
bit (4096 values).
The “new” chain was no closer than 2 bytes, and all the rest were added up according to the principle
"old" chain + one more byte.
That is, for example:
12,32 is a chain with code 258 (stored as #00,#0C,#20)
12,32,48 = (string 258) + byte 48 is code 259 (#01,#02,#30)
12,32,48,56 = (string 259) + byte 56 - code 260 (#01,#03,#38)
etc.
If anyone can figure out how to get by with less than 12K per table, I’ll put it up
monument on the central square of glorious Bobruisk. :)
From DVS → To All 20 April 2006
Hello, All
Has anyone done this?
In my understanding and examples, unpacking requires quite a lot of RAM for
compiling a table of chains.
If the picture size is 98 * 67 and 64 colors per pixel, then maybe it’s possible
save on RAMe?
From DVS → To All 20 April 2006
Hello, SAM style
Yes, I agree about 12Kb. You can save a little just by not doing the alignment
1 byte, taking into account that the code size starts to grow not from 12 bits, but from a maximum of 9, in
in my case with 7.
It’s kind of sad... I thought about programming this in AVR, well, with a maximum of 8Kb without external
memory. Of course, then ARM is needed.
I’ll help you erect a monument if someone tells you how to fit into 3Kb :-) Or better yet, into
1Kb.
From Valery Grigoriev → To All 14 May 2006
Hello, DVS
Take it without GIF and build a monument to yourself (((-;