Data Compression


Criteria

Survey Formats

Basics

Compression Methods

Data Formats


Run Length Encoding

General Principle

Control Characters

8 Bit Control Character

in Original Data

alternating

by Repetitions

1 Bit RLE

7 Bit RLE

RLE for Image Data

Implementations


Glossary

Index


Download


www.BinaryEssence.com

8 Bit Control Character


In the example below the value 255 (FFh) is selected as a control character. Thus the range of values is reduced by this character to 255 symbols.


Example: Coding Scheme with 8 Bit Control Character



Each repetition requires a 3 byte code in this scheme. A compression is only achieved if a number of 3 succeeding symbols would be exceeded. Therefore an offset can be defined for the counter, so that its range of values is extended up to 259 symbols (0 to 255 -> 4 to 259 repetitions).


In the following the control character will be presented by the number sign (#). According to the minimum sequence length providing compression an offset of 4 is used.


   original data:   abcdddddefg
      coded data:   abc#1defg

   original data:   1.002000300004
      coded data:   1.0020003#004

Sequences being longer than 259 symbols can be split into several runs.


The original data may not contain the control character. Algorithms to handle those symbols has to be defined as well.


 <   ^   > 

Versions using Control Characters Versions using Control Characters Control Characters within Original Data