Arc Developments HUF
- Company: Arc Developments Limited
- Extension: huf
- Game: Johnny Bazookatone
This is a video format employing RLE and static Huffman compression (symbol weights for which are transmitted in the header). Audio format is 8-bit mono 22kHz PCM.
File header:
8 bytes - "[AVF-95]" 2 bytes - width 2 bytes - height 4 bytes - number of frames 9 bytes - unknown 256 bytes - weights 132300 bytes - initial audio data
Frames start with 32-bit size and 8-bit type (0 - intra, 1 - inter) followed by VGA palette for 128 colours and Huffman-compressed data. Last 1470 bytes of the frame are audio data.
After decompressing video data, intra or inter RLE should be applied. Intra RLE is trivial (top bit of the opcode is run flag, bottom 7 bits are pixel value; when run flag is set, next byte tells how many times to repeat the pixel instead of just once with zero value coding end of frame). Inter RLE uses the following opcodes (the number of those opcodes is the first 16 bits of video data): 0x00 -- read 16-bit value and skip that amount of pixels, 0x01..0x7F -- read byte value and skip that many pixels, then read 1..127 pixels, 0x80..0xFF -- read byte value and skip that many pixels, then read colour value and repeat it 128..1 times.