RLF

From MultimediaWiki
Jump to navigation Jump to search

RLF is a movie format used in Zork Grand Inquisitor and Zork Nemesis games.

Container format

RLF consists of a series of chunks starting with 4-byte tag (in reverse order) and 32-bit chunk size.

Container header

FELR chunk:

 4 bytes - version?
 4 bytes - unknown
 4 bytes - number of frames

FNIC chunk:

 4 bytes - version?
 4 bytes - unknown
 4 bytes - unknown
 3x32 bytes - RLE entries:
   4 bytes  - always 2?
   24 bytes - name ("Delta V RLE", "Delta H RLE", "H RLE Key") and some junk in padding
   4 bytes  - compression method tag ("LRVD", "ELHD", "ELRH")

FNIM chunk:

 4 bytes - OEDV (subtype?)
 4 bytes - version?
 4 bytes - unknown
 4 bytes - unknown
 4 bytes - width
 4 bytes - height

EMIT chunk:

 4 bytes - version?
 4 bytes - unknown
 4 bytes - frame time in microseconds

Frame chunks

MARF chunk:

 4 bytes - version?
 4 bytes - unknown
 4 bytes - compression method used
 4 bytes - should be 0x1C
 4 bytes - unknown
 4 bytes - always 1?
 N bytes - frame data

Compression methods are:

  • ELRH - simple RLE (one byte RLE opcode, copy or fill the specified amount of 16-bit pixels)
  • ELHD - masked RLE (one byte RLE opcode, copy or skip the specified amount of 16-bit pixels)
  • LRVD - probably a variation of ELHD compression