RLE90

From Just Solve the File Format Problem
Revision as of 17:29, 4 September 2019 by Jsummers (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
File Format
Name RLE90
Ontology

RLE90 is a run-length encoding data compression scheme used in several file formats, either by itself, or as part of a more sophisticated compression scheme. It is only occasionally called RLE90, but its other names, such as "Packed" and "RLE", are hopelessly vague.

The format is simple, but is more stateful than most RLE schemes, and has edge cases that can lead to problems. It uses byte value 0x90 (decimal 144) as an escape code.

Format details

To decompress:

Read the next byte(s). Follow the instructions in the first row of this table that matches. Repeat.

Byte pattern Instructions
0x90 0x00 Emit one byte of value 0x90
0x90 N2 Emit N2−1 (additional) copies of the "previous byte"
N1 Emit one byte of value N1

The term "previous byte" needs clarification when the previous bytes were the 0x90 0x00 escape code, or at the beginning of data where there was no previous byte. Some RLE90 variants handle these cases differently than others, by accident or design.

Related formats

Among the formats that may use RLE90 are ARC (and Spark and ArcFS), Stuffit, and BinHex.

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox