Gunmetal SBV

From MultimediaWiki
Jump to navigation Jump to search

This is an animation format used in Gunmenal and it employs wavelet compression.

File header:

 4 bytes - "SBV0"
 4 bytes - width
 4 bytes - height
 4 bytes - number of frames
 frame records {
   4 bytes - frame show time (in milliseconds)
   4 bytes - frame data offset
 }

Frame is encoded as an independent image split into three planes with 4:2:0 subsampling with the following formula for RGB reconstruction:

 R = (Y + Cr      + 8) >> 4
 G = (Y - Cr - Cb + 8) >> 4
 B = (Y + Cb      + 8) >> 4

Each plane is split into three levels, level 0 data normalised to 0-255 range and transmitted as bytes (with two 32-bit values before it signalling the range), the rest is split into 4x4 (for level 1) or 8x8 blocks (for other levels) and coded using simple zero-run and 1-15 bits quantisation). Wavelet transform is the conventional LGT 5/3.