News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

encode /decode lzss

Started by Ar-ras, April 02, 2006, 11:39:57 PM

Previous topic - Next topic

Ar-ras

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

Mark Jones

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
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Ar-ras

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

PBrennick

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
The GeneSys Project is available from:
The Repository or My crappy website

BogdanOntanu

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.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Ar-ras

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

raymond

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
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Human

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

PBrennick

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
The GeneSys Project is available from:
The Repository or My crappy website

Human

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.

Ar-ras

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

PBrennick

Human,
Try eleven downloads and I bet a lot of people have walked away.

Paul
The GeneSys Project is available from:
The Repository or My crappy website