The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: Ar-ras on April 02, 2006, 11:39:57 PM

Title: encode /decode lzss
Post by: Ar-ras on April 02, 2006, 11:39:57 PM
Hello

I wanted to write a server. winsock and stúff are working perfectly
Then I thought, It would be great to write a subroutine, for compressing and decompressing files
I found http://www.programmersheaven.com/zone5/cat858/2204.htm which is a great lzss packer/unpacker
it packs better then other lzss programms
I wanted to port the source to masm32 so that I can just call a procedure which just needs the source and the target file

The Problem is that this is a very hard understandable source code and i am not a professional

Can you help to translate the sourcecode?
Do you have other compress/decompress algos ready?(full masm32 source)
Please Help me with my little problem

thnx
Ar-ras
Title: Re: encode /decode lzss
Post by: Mark Jones on April 03, 2006, 01:40:20 AM
Hello and welcome to the forum.

Curious, are you aware of how old the code is that you linked to? Most of the files are date-stamped 1986... :eek

If you don't require LZss encoding, included with MASM32 is the APLib library which is a LZ77 algorithm. This is a very nice library for compressing and decompressing data of any length (and it's 32-bits, not DOS 16-bits code.)

APLib can be found in \MASM32\examples\exampl03\appack. Study the appack.asm file for an example of its use. Have fun! :bg
Title: Re: encode /decode lzss
Post by: Ar-ras on April 03, 2006, 02:41:17 AM
hehehe
I know
The source is older then me :D

I used tried appack from the example folder with a screenshot of my screen (~3,90 mb "random" data)
with appack it is about 150 kb big
but with the lzss it is just approx 50 kb big

So the lzss is better then appack... :D
Thats the problem...
If appack would be just 10 kb bigger it would be no problem but 100 kb is a "feature"

I look now again the appack routine ,maybe it has a compression level setting...


edit:
strange
now it is the opposite
appack is now better rofl

in this forum a source for lzw exists
i look how good it is compressing
Title: Re: encode /decode lzss
Post by: PBrennick on April 03, 2006, 04:38:24 AM
There is also the source for unrar (creating rar archives which are very small.  The LZW you found on the forum, is it the one written by the Dude of Dudes?

Paul
Title: Re: encode /decode lzss
Post by: BogdanOntanu on April 03, 2006, 06:43:24 AM
Do not be fooled by a specific data test. You do need to test on multiple files.
IF i recall corectly there is a Calgary file corpus designed for this compression tests that covers many practical situations.

Curently (2006) LZMA is the best compression (free) algorithm and it is based on LZ77 not LZSS.

It is true that LZSS / LZW is a little better suited for some image data compression but unless you will only compress images I guess LZ77 is better.
Title: Re: encode /decode lzss
Post by: Ar-ras on April 03, 2006, 12:40:42 PM
So tried lzw
problem: sometimes it creates error
So I need a good packer which works stable
source in assembler is needed...
I keep trying :D
Title: Re: encode /decode lzss
Post by: raymond on April 04, 2006, 04:54:20 AM
I'm almost sure that the LZW is still covered by patents. However, it would not apply for strictly personal use.

That encoding is the one used for GIF image files. Search for the GIFLIB package. It contains a GIFdoc subfolder which has a lzwexp.txt file explaining in simple terms the algo.

It's relatively easy to decode but encoding may be a lot more difficult.

Raymond
Title: Re: encode /decode lzss
Post by: Human on April 04, 2006, 05:47:04 AM
lzw i think patent is gone in 2000, also even unix in compress uses lzw16 and no big deal.
you can try my asm sources lzw hlz(lzss modified)
http://sourceforge.net/projects/humantools
as long your projects are free
Title: Re: encode /decode lzss
Post by: PBrennick on April 04, 2006, 07:33:51 AM
Human,
It probably would have been nice to look at some of your work but the insanity of all the windows a person must go through to download each archive, one at a time, is hardly worth the effort!  Sorry, not into self-inflicted torture.

Paul
Title: Re: encode /decode lzss
Post by: Human on April 04, 2006, 08:19:51 AM
i dont see a problem, there are just 4 projects, no 5th jpgdecoder yet. also show me place where today there isnt all in php sql and you have to click 100 times. sourceforge isnt worst place, just click version you want and mirror so 2 clicks isnt too much. im coder not html sql web programmer, thats why i dont have webpage. also sourceforge protects my rights and from stealing my work. if author of that topic wants to sell his server he has to buy or write own compressor. due its free for free of charge usage only.
Title: Re: encode /decode lzss
Post by: Ar-ras on April 04, 2006, 05:29:19 PM
I don't want to sell my server
I am just a little coder for my own usage

So thank you all
:D

I think that i can go on with my project
Title: Re: encode /decode lzss
Post by: PBrennick on April 05, 2006, 03:51:17 AM
Human,
Try eleven downloads and I bet a lot of people have walked away.

Paul