Soul Hunt VID
This is a format used in Soul Hunt game for cutscenes, animations and even individual interface screens.
File header:
2 bytes - "DV" 2 bytes - zero 4 bytes - number of chunks 2 bytes - width 2 bytes - height 4 bytes - version 4 bytes - FPS 4 bytes - audio sampling rate 2 bytes - audio bits per sample (8 if present) 2 bytes - audio channels 2 bytes - looped animation 2 bytes - unknown 2 bytes - initial palette is present 2 bytes - header is aligned 2 bytes - audio is compressed 2 bytes - unknown
The header is followed by chunk table consisting of a pair of 32-bit entries, namely chunk type (0 - video, 1 - audio, 2 - palette plus audio) and chunk size.
After chunk table there may be VGA palette in case it's signalled in the header.
In case of compressed audio there is an additional table of sixteen 32-bit deltas.
If the aligned flag is set, data starts at the next position that is a multiple of 2048 bytes, otherwise it start immediately after.
Audio compression
Audio is delta-compressed 8-bit PCM. Stream consists of opcodes split into nibbles with different actions taken depending on nibble values:
- low nibble is 0-14, high nibble is 0-15 -- use nibble values as indices in delta table to update last value and output it (first update and output value using low nibble, then using high nibble)
- low nibble is 0-15, high nibble is 15 -- read next byte from the stream as new sample value
- low nibble is 15, high nibble is 0-7 -- read next byte from the stream as new sample value
- low nibble is 15, high nibble is 8-15 -- next byte is low 8 bits of run value, low 3 bits of high nibble are its top bits, output last sample twice as many times
Video compression for version 2
This version uses simple RLE with top two bits telling the operation: 00
- copy (low 6 bits of opcode) bytes, 01
run of (low 6 bits of opcode) pixels, 1x
- skip (low 7 bits of opcode) pixels.
Video compression for version 3
This one is based on JPEG compression (apparently just macroblocks) with an additional conversion from YUV to paletted format. First 32-bit value in the frame is for frame subtype. Actual bitstream details are not known.