SBV, an unusual game codec

While I’m still preparing next na_game_tool release (still a couple of codecs to RE and implement!), I’ve finally encountered a very rare beast—wavelet game video codec!

Gunmetal features SBV format with the minimum header (frame table contains just timestamps and start offsets) but each of those frames is coded using fast wavelet coding algorithm. First level is transmitted as byte values, the other levels are coded in 4×4 or 8×8 blocks, one level after another, using fixed-bits non-zero coefficient coding (the number of bits depends on the block coding mode) plus some bit flags to code zero runs. (De)quantisation is done by simple shift operation. Wavelet looks like the traditional LGT 5/3.

One might think the scheme is truly scalable but unfortunately you have to decode data for one plane before you move to another. Speaking of planes it’s a simplified YUV-like scheme with
Y = ( R + G + B) / 3
Cr = (2R - G - B) / 3,
Cb = (2B - R - G) / 3

with the traditional 4:2:0 sub-sampling.

This could’ve been a simple intermediate video codec for the cases where you’re really strapped for CPU power but still want some compression. And yet it’s a game format instead… I’m still delighted to encounter such format in a game (and in general).

Leave a Reply