File Compression

Started by
10 comments, last by krakrazor 20 years, 3 months ago
Where can i find a tutorial on file compression? i don''t want no RLE or some other useless method... i would like to be able to compress .wav files atleast 50%
Advertisement
quote:Original post by krakrazor
Where can i find a tutorial on file compression? i don''t want no RLE or some other useless method... i would like to be able to compress .wav files atleast 50%


If you want to use generic file compression to look into huffman encoding, arithmetic compression, or something like LARC (all of the articles section this site has information on). Most of them are fairly simple. However if you want to do audio compression like MP3 or ACC you can quickly find your self dealing with advanced topics like fast fouier transforms and psycho acoustics.

I recommend you look into an already existing open source audio compression system like <a href="www.vorbis.com/">Ogg Vorbis</a> or <a href="http://flac.sourceforge.net/">FLAC</a>, both of which have a Free SDK avaliable.

My compression program isn''t gonna be neccesarilly be used for audio... it''s also gonna be used for video/graphics/executables.... but i''m guessing the chunk of it is gonna be audio and graphics so i would rather optimize for that
I think the java library provides some functionality for interacting with zip and jar (which use zip compression) files. For general-purpose compression it''s hard to do much better.

But it might be that it just has to pretend that it does because of how the reflection API is implemented. I haven''t tried playing around with it.
Why are you asking for only a general purpose compression? Use OGG for audio, some free codec like XVid for video*, JPEG and PNG for images, ZIP or BZ2 for everything else.

*) well, I''m not sure how legal XVid is.
I''m gonna make a little consolidated file system, like "pak" or "pk3" files in quake... but i would like to make compression available to the files that want it.
look at zlib.
and zip/unzip :

http://www.winimage.com/zLibDll/unzip.html

The best solution would be to choose the right compressor for the right object (for example JPG for images, MP3 for musics, ZLIB for other data ).
The hard is to write/read everything to/from a single stream.

See also http://www.gzip.org/zlib/
I would recommend you look at the paper 'It's still loading?' that
Scott Bilas held at gdc 2000. Here's the link
Clickey

[edited by - weddo on January 12, 2004 5:28:14 PM]
Look up 7-Zip. It''s an algorithm that compresses things to zip format, but it does it much more effectively than the regular zip algorithm (about 10% more compression)

This topic is closed to new replies.

Advertisement