PlanetMath (more info)
 Math for the people, by the people.
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: Very low
run-length encoding (Definition)

Run-length encoding (RLE) is a lossless compression algorithm which counts how many times a symbol or group of symbols is repeated consecutively in the input.

For example, the values of the prime counting function $ \pi(n)$ up to 72 are: 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 21. These can be run-length encoded as: one 0, one 1, two 2s, two 3s, four 4s, two 5s, four 6s, two 7s, four 8s, six 9s, two 10s, six 11s, four 12s, two 13s, four 14ws, five 15s, etc.

Run-length encoding is obviously most effective for inputs containing many repetitions of a symbol or group of symbols, such as flat-color drawings with straight line boundaries. For example, the first line of a run-length encoding of a 720 by 481 drawing of the American flag stretched flat could look something like this: 240 BLUE, 480 RED. Below the blue field, a line-by-line second pass would result in even greater compression: 37 lines of 720 WHITE, followed by 37 lines of 720 RED, then 37 lines of 720 RED, etc. But for a more photorealistic drawing, run-length encoding would result in the opposite of compression.



"run-length encoding" is owned by PrimeFan.
(view preamble)

View style:

Other names:  RLE, run length encoding
Log in to rate this entry.
(view current ratings)

Cross-references: opposite, even, field, flat, flag, boundaries, line, straight, effective, prime counting function, group, algorithm
There are 2 references to this entry.

This is version 1 of run-length encoding, born on 2008-04-03.
Object id is 10473, canonical name is RunLengthEncoding.
Accessed 391 times total.

Classification:
AMS MSC68P30 (Computer science :: Theory of data :: Coding and information theory )

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add derivation | add example | add (any)