While I have time I’m preparing the next release of na_game_tool, which involves REing formats (of course!). And among the formats I want to add is Knowledge Adventure MOV. So I’ve revisited it and RE’d one of the flavours.
Apparently there are three versions of that MOV: the original format used in DOS games (with magic KAMv), version 2 (starting with LzH2) and version 3 (starting with LzH3) which seem to be used in both DOS games and some Internet applications (and I’ve used Mac binary for Undersea Adventure). So while I’m yet to progress on KAMv (because there’s only 16-bit DOS binary specification for it), I’ve mostly REd LzH2 and it’s rather crazy.
This codec splits image into rows of 4×2 tiles and unless I’m mistaken those rows are coded in scalable way (first just one row, then two, then four, then eight and so on until the whole frame is decoded). Each tile may be coded as motion (with a set of motion vectors selectable in the file header—it gives me flashbacks of DiVX 3 Hi/Lo-motion), raw tiles, or pattern-coded tiles. And those pattern-coded tiles actually may code colours explicitly or use another motion vector to re-use some existing ones, that’s not something I’ve seen before. Afterwards all those kinds of data (tile types, colours, patterns, motion vector indices) are grouped and compressed with their own static Huffman codes; the tree descriptions (just code lengths as the symbols are always the same) are transmitted at the beginning of each frame.
Overall, it reminds me of Smacker if not for the fact it uses per-frame Huffman trees instead of global ones (and raw PCM instead of Huffman-compressed data), smaller tiles and more ingenious use of motion vectors. Now I want to implement a decoder for it even if just to see what I understand wrong.