Run Length Encoding Flashcards
All 5 cards in this deck
What is run length encoding (RLE)?
A compression method that replaces each run of consecutive repeated values with a frequency/data pair.
What is a frequency/data pair in RLE?
e.g. 5 0The number of times a value repeats in a row, followed by the value itself.
e.g. 5 0 means five 0s in a row.What kind of data does RLE compress well?
Data with long runs of consecutive repeated values, such as an image with large areas of the same colour.
Why can RLE make some data larger instead of smaller?
If the data has few repeated values in a row, each single value becomes a pair, so the encoded data is longer than the original (eg MISSISSIPPI).
What are the steps to write a row of a bitmap as RLE frequency/data pairs?
e.g. the row 1111000001- Working from the left, count how many times the same value repeats in a row.
- Write that count, then the value.
- Do the same for each run: 4 1 5 0 1 1.