|
RLE (Run Length Encoding) RLE is the basic compression algorithm, it is the first compression ever invented (even though I have no prove nor document about it), as far as my research goes, RLE is patent free, which mean anyone can use it freely. This compression method is so simple it just removing repetition of the
same byte IN A ROW (continuously). This method is very important and all
the compression utility should have this compression method built-in,
I know that most of the compression utility have this method, this method
is the first priority, it should be done before applying other compression
method.
Result: A1B1C3B2A3B3 Decoding:
Result: ABCCCBBAAABBB Note: this example shows every byte value followed by a number indicating how many repetition of the same byte value. This is a basic idea of RLE compression, it is not going to have a good result and instead of making the file smaller this method will make the file bigger, so this is not good but the example below shows the proper implementation, set minimum repeatition to 2 and it will compress only if two or more bytes are the same: Encoding: search two byte of the same value and put a value of how many byte of the same value occur again, even no more is found it is still required to put zero value indicating no more is found.
Result: ABCC(1)BB(0)AA(1)BB(1). Decoding: whenever we found two same charactera in a row it means the next byte value is the value of how many more repeatition occur.
Result: ABCCCBBAAABBB My implemetation and source for RLE can be found in tools section, please download it and play with it, but remember in my RLE program I used the value of 4 instead of 2 (example above) as the minimum repeatition, I do this because the minimum value of 4 have a better result (normally). Pros: simple, easy to coding and fast. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author
Site Map Disclaimer
HMaxF Ultimate Recursive Lossless Compression Research 2001 - 2002 (c) All Rights Reserved. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||