Data Compression II: Suppressing Repeating Sequences ==> Redundancy Compression
When the data is represented in a Sparse array, we can use a type of compression called: run-length encoding.
Procedure:
- Read through the array in sequence except where the same value occurs more than once in succession.
- When the same value occurs more than once, substitute the following 3 bytes in order:
- The special run-length code indicator
- The values that is repeated; and
- The number of times that the value is repeated.
No guarantee that space will be saved!!!