Intelligent Games MOV
Jump to navigation
Jump to search
- Company: Intelligent Games Ltd.
- Extension: MOV
- Game used: Azrael's Tear
This is a rather simple container for paletted video cutscenes.
The file starts with the following header (all values are little-endian):
4 bytes - always 90 EF 12 AB 2 bytes - total number of frames in the file 2 bytes - frames per second? (in reality it seems to be 10 instead of declared 12) 2 bytes - video width 2 bytes - video height 18 bytes - seems to be random garbage
Each frame starts with 16-byte header:
4 bytes - always CF 01 99 EE 2 bytes - frame type? (seems to be 3 for the first frame and 2 for the following ones) 4 bytes - unpacked frame size 4 bytes - packed frame size (or 0 for raw frames) 2 bytes - padding?
Frame consists of one or more chunks:
4 bytes - always DC FE 23 01 2 bytes - chunk type 4 bytes - chunk size 6 bytes - junk
Chunk types:
- 1 - raw frame data
- 2 and 3 - empty/skip frame
- 4 - VGA palette
- 5 - inter frame
- 6 - audio data (8-bit PCM, 22050Hz mono)
Frame data unpacking
Frame data may be compressed with Huffman codes. In that case it consists of four blocks: 32-bit unpacked data size (the same as in frame header), 32-bit Huffman tree root index, Huffman tree nodes (an array of 1024 16-bit numbers), packed data.
Data decoding is trivial:
- set
index
to the tree root index - while
index
≥ 256- read bit (LSB first) from packed data part
index = nodes[index * 2 + bit]
- output
index
Inter frame compression
Inter frames are split in 4x4 blocks and may be coded using one of four modes and modes for four tiles are packed in one byte (LSB first) e.g. modes 0, 1, 2, 3 will be transmitted as 0xE4
.
- mode 0 is long motion compensation. It requires two additional bytes, first one is X coordinate displacement plus 127 (i.e. value 0 mean -127 and value 255 means +128), second one is Y coordinate displacement plus 63 in low 7 bits and the top bit is used to signal data source (not set - copy data from the previous frame, set - copy data from the current frame).
- mode 1 is a skip run. Next byte in the stream tells how many blocks need to be left unchanged from the previous frame (value 0 signals 256 blocks to copy).
- mode 2 is short motion compensation. Next byte contains displacement for the previous frame. Top nibble - X coordinate plus 7, low nibble - Y coordinate plus 7.
- mode 3 is for raw block. Following 16 bytes are the new block contents.