Sango Fighter RLC Compression

From ModdingWiki
Jump to: navigation, search
Sango Fighter RLC Compression
Format typeCompression algorithm
TypeStream
I/O unit size1-byte
Games

Some Sango Fighter files are compressed using a simple run-length encoding scheme. The files typically have the .rlc ("Run Length Coded") extension.

To decode the files, perform the following procedure:

  1. Read a byte
  2. If the byte is < 128, output the byte and go back to step 1
  3. Otherwise (i.e. the byte is >= 128)
    • Take the lower 7 bits (val & 0x7F) and store this as count
    • Read the next byte, and repeat it count times
  4. Go back to step 1

Example:

01 02 82 03 81 82

Becomes:

01 02 03 03 82