[A86] Re: compression


[Prev][Next][Index][Thread]

[A86] Re: compression




I'm not going to be around for 2 months as i'm about to go to Florence
Italy, and i'm killing time before I make the 3 hour drive to O hare airport
in Chicago in an hour or so (yes, i'm bragging) ... so what the heck, i'll
give a general explanation of some compression algorithms...

Most (all?) are finding patterns in the data, and representing those
patterns with less data.

Take for example rle, it finds long strips of the same byte, and represents
that long run with 3 bytes, a flag, a byte to tell how many times it
repeats, and the byte that repeats. So a section of data that has 120 of the
byte $34 in a row, becomes $91 (flag), 120, $34. Thus saving 117 bytes. The
decompresser then sees the flag, and decompresses the data to the original.

Other patterns might be if you have the same sequence of bytes that happens
multiple times in the data, the compression routine may replace that strip
of bytes, with something else that takes up less space. Then the
decompression routine restores the data.

---
James Rubingh
http://james.acz.org
http://www.acz.org <-- under development *cough*

> Can someone explain some of the algorithms used for compression of data?





References: