Advertisement

Pack algorithm

Started by February 23, 2000 09:26 AM
15 comments, last by B.o.t.G. 24 years, 8 months ago
I want to write a setup-tool for my programs. Now I search a way to compress the files. Can anyone send me information about packing files? (Only witch C++ source) (Not RLE, I''m able to implement that myself) B.o.t.G. -------- Writer of the VQAtoAVI conversation utility for CC
B.o.t.G.--------Writer of- VQAtoAVI, the conversation utility for C&C- Golden Cow, the BO2K attacher
I don't have any code here, but you could try searching for huffman(n?) coding.

Edited by - alexmoura on 2/23/00 12:40:50 PM
Advertisement
I''d suggest you search for LZ77 or LZSS (Blizzard uses this one) compression.

Take a look at zLib. It implements the same algorithm that zip files use, and is completely free. You can find it at http://www.cdrom.com/pub/infozip/zlib/

Torval
What about LZ78 and LZW? LZSS is great though, fairly fast and works nice on 8 bit images...think I have some source of an implementation of it lying around somewhere (but where?)
I think I forget to tell one thing: I don''t want to compress only images, so LZ88 is not fitting very well

B.o.t.G.
--------

Writer of the VQAtoAVI conversation utility for CC
B.o.t.G.--------Writer of- VQAtoAVI, the conversation utility for C&C- Golden Cow, the BO2K attacher
Advertisement
First, I don''t think there is one such thing as LZ88, LZ78 yes but not 88 . Second LZ77/78 works quite well on all kind of data - not images only. However its performance is quite poor compared to WinZip. Your best shot would probably be zlib, unless you are willing to put _alot_ of effort into making your own implementation.
Ups, you are right Staffan. LZ88 does not exist, my mistake.
I found a 10 line description of huffman coding. The result is that I now have a program named SpaceFiller. (The decompressor works like a compressor, hmmm....)
huffman may be a good choice for files with only few different characters but not for large binary files.
I already implemented a RLE engine and it works fine. I also found source-samples for other algorithms (like LZ78) but I don''t think they are fast enough, they are very complex. These samples are also very old C-Programs so using them in my C++ programs makes trouble.


B.o.t.G.
--------

Writer of the VQAtoAVI conversation utility for CC
B.o.t.G.--------Writer of- VQAtoAVI, the conversation utility for C&C- Golden Cow, the BO2K attacher
Did you try LZH (LZ Huffman)? Or LZW (There are heaps of diffrent implementations on this one...)? I still have to say I suggest zlib, or why not the dll that comes with WinRAR (unrar.dll)?
I found a suitable compression algorithm for my purpose:
LZRW3-A from www.ross.net
It is quite fast in decompression, has a good compression ratio and uses only mem for operation: you tell the (de-)compression function the i/o buffers and the inputlength and everything works.

B.o.t.G.
--------

Writer of
- VQAtoAVI, the conversation utility for C&C
- Golden Cow, the BO2K attacher
B.o.t.G.--------Writer of- VQAtoAVI, the conversation utility for C&C- Golden Cow, the BO2K attacher

This topic is closed to new replies.

Advertisement