|
This program and its source code are Public Domain. This program should be portable to any machine with 2 byte short ints and 8 bit bytes, if you patch the filename stuff, which is ms-dos specific. What is run length encoding?Run Length Encoding, also known as RLE, is a method of compressing data that has a lot of "runs" of bytes (or bits) in it. A "run" is a series of bytes that are all the same. For instance, the string "THIS IS A VEEEEEEEEEEEEEEEEEEEEEEEERY INTERESTING SENTENCE" has a run of 23 'E's in it. This could be compressed in the following manner: THIS IS A V23ERY INTERESTING SENTENCE resulting in a savings of 20 characters. A further savings of one character can be realized if the sequence "23" is replaced by a single byte with the value 23. However, if the text to be encoded is arbitrary, then it may contain numbers as well as letters, and bytes of all possible values. For this reason, there must be some way to let the decoder know when a compressed run is encountered, and when a sequence to be passed straight through is encountered. For this reason, the following file format was used:
bugs: Nasty features :
Author: atman%ecst.csuchico.edu@RELAY.CS.NET (internet)
1@9651 (WWIVnet)
atman of 1:119/666.0 (fidonet)
Tell me hi if you use this program! Discuss this article in the forums
See Also: © 1999-2011 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
|