Interplay AV

From MultimediaWiki
Jump to navigation Jump to search

AV format was used by Interplay in CD version of The Lord of the Rings Volume I RPG for cutscenes (those cutscenes were clips from the animated movie with the same title).

Container structure

 768-byte VGA palette
 14 initial audio frames
 video frame
 audio frame
 video frame
 ...

Video

Video has fixed size of 224x144 and coded by splitting frames into 8x8 tiles and either updating them with new content or reusing this or previous frame data.

Frame data consists of indices (1008 bytes - 2 bytes per each tile) followed by the data for raw tiles. Tile indices FF FF signal this is a raw tile, otherwise those bytes should be treated as a special motion vector.

How to calculate source position:

  • calculate pos = idx0 + idx1 * 8 * 32
  • calculate X offset in pixels as pos % (28 * 8)
  • calculate Y offset in pixels as pos / (28 * 8) / 2
  • get source frame flag as (pos / (28 * 8)) % 2
  • current frame number low bit XOR source frame flag should give you the reference frame (e.g. for frame 0 and flag=0 you should copy data from the same frame, for frame 1 and flag=0 you should copy data from the previous frame, for frame 3 and flag=1 you should copy data from the same frame etc etc)

Audio

Audio is 11025Hz mono 8-bit PCM stored in 732-byte frames.