Hi all,

Does anybody know of a LZ77 (or LZ-alike) algorithm implementation in ASM? I know how the algorithm works (this is very helpful) and I have made some attempts at it several times :) I just need some explanation or even better source that clearly shows how such an algorithm could be done..

Any help will be appreciated!!
Posted on 2001-12-26 17:06:17 by Eagle17
My GIF Libary (download at exagone.cjb.net, source is included) decompresses LZW compression that GIF uses.
I found two documents at wotsit.org (search for LZW) that helped me much, but my lib only does decompression and I think compression will be a bit harder to implement. But maybe the source is of some use to you.

Thomas
Posted on 2001-12-26 17:11:00 by Thomas
Thank you Thomas!! This LZW document that I found inside your source ZIP seems to explain the algorithm very well! I may write an LZW algorithm besides LZ-77, and from what I hear LZW has better ratios anyway. If I have any problems I'll post a reply. Thanks again :tongue:
Posted on 2001-12-26 18:20:47 by Eagle17
I'm interested in anything that is produced in asm. LWZ seems to be one of those things that I'll have to study for 15 hours straight to understand (Like the point of using C++ :) ). Eventually I would like to code an advanced bmp2png program that is free and allow a) single transparent color, and b) second grayscale bmp as an alpha channel.

Currently, the only was to get a single transparency color is to insert the tRNS chunk (I coded a CRC sub in asm) with edit. The drawing programs I've downloaded so far all suck ( My idea of layers is multiple instances of paint).
Posted on 2001-12-27 03:08:04 by eet_1024
Attachment (LZW in 16 bit asm)
Posted on 2001-12-27 06:09:10 by jmp $FCE2
Attachment (LZ78 in 32bit asm)
Posted on 2001-12-27 06:09:42 by jmp $FCE2
Oops, and of course the absolutely best page on the entire net addressing compression, Mark Nelson author of the "Data Compression Book"

http://dogma.net/DataCompression/
Posted on 2001-12-27 06:20:21 by jmp $FCE2
OK I know the LZW algorithm pretty well now and I'm going to code it. All it took was about an hour of re-reading all of my material before it finally clicked in my head :). I'll post the code up here when I finish it (if anybody cares ;)
Posted on 2001-12-27 17:45:04 by Eagle17
What do the numbers represent (lz13 lz77 lz78 lzw )?

I'll be implementing zlib (RFC-195[0-2], LZ77 derivative).


Edit2: After web leaping LZ77 and Static Huffman trees finally clicked in my head. Now I just have to figure out how zlib uses them.
Posted on 2001-12-27 22:04:38 by eet_1024
I am pretty sure the numbers in LZ stand for the year. W in LZW is for Welch, because he made it better later on in the 80s
Posted on 2001-12-28 22:13:23 by Eagle17
Don't you just love the web, got a question, search the web.

Man I am tired, been trying to find some stuff, to fix someones system.


Call me a Geek, and wrap me in tinfoil( Damn, flashback) I really was that crazy at one time. Must have been really "BAD" Acid..:)



Anunitu
Posted on 2001-12-29 18:55:36 by Anunitu
Hehe I use the web whenever I have the simplest question :grin: I have a working LZW compression/decompression system right now.. It just has some drawbacks: #1 it is very slow (no hashing algorithm) #2 it can only compress small files because I use a fixed size string table. This working version is just to get me started, so that I see that my idea works, and it did! Now I'm going to insert hashing algorithm (to make it faster) and I'm going to change the format of the Dictionary to allow variable string table size. If you want the test version that I have now I can send it to you, just email me at kornbizkit536@hotmail.com :alright:
Posted on 2001-12-29 19:15:46 by Eagle17