In my last post I mentioned DVI family of formats and I decided to extend NihAV
support a bit. Previously I implemented YULELOG.AVS
demuxing and decoding and stopped at it, but apparently there are six more samples that can be found with discmaster.textfiles.com
(fun fact: SAMPLE.AVP
is not detected as AVSS and out of four instances three are unknown and one got the embedded JPEG file decoded).
There are certain difficulties extending support beside the original file: a good deal of the samples have AVSS format slightly different from the open specification, AVS2AVI.EXE
convertor refuses to convert all but two files (saying that it does not know the algorithm used to compress them), the other available tools seem to rely on the ActionMedia card so you can’t do much without it.
So here’s the list of all known samples with some notes about them:
AUDM400.AVS
—single audio track that uses “dvaud44” audio compression, which is some variation of DVI ADPCM. I have a suspicion that its audio packets are interleaved by channel (i.e. audio packet 0 is left channel data, packet 1 is right channel data, packet 2 is left channel data gain) but I’m not going to introduce some horrible hacks to assemble audio data in this case;NWSAMP.AVS
—PLV video with each component in its separate stream. Since there’s no specification available at all, I can only speculate that it employs delta compression akin to YVU9C or even something closer to Indeo 3;REEL400.AVS
—RTV2 video with empty audio track;SAMPLE.AVP
—AVSS “image” format (you don’t think WebP was the first case of such formats, do you?) with a stream containing single JPEG frame. In YUV410 format too, so I had to modify my decoder to handle it (along with fixing the case when planes are sent in separate scans);SAMPLE.AVS
—RTV2 video with (silent) DVI ADPCM audio. Initially video stream could not be decoded until I discovered it uses custom codes (that change between frames; and this is apparently the older version of RTV2 too). Now it works;video.avs
—RTV2 video with DVI ADPCM audio;YULELOG.AVS
—single RTV2 stream.
And since I’ve mentioned custom RTV2 codes, here’s how they work: there are codes with certain property and fixed symbol mapping (for all 143 symbols), so there’s a compact way to describe such codes. Each RTV2/Indeo2 frame has eight bytes in the header with the code description. Codes consist of two parts: unary prefix and fixed-size part, with the code descriptor providing the size of fixed part for each prefix. So e.g. code description 2,3,3 will map to 0xx
, 10xxx
, 1110xxx
codes while description 4,1,2 will map to 0xxxx
, 10x
, 110xx
codes. It’s not the most effective coding scheme but it takes little space and easy to implement fast decoding (you can use pre-computed look-up tables and just calculate what range of codes corresponds to which prefix). The scheme got employed again in Indeo 4 and 5.
This concludes my explorations in DVI/Indeo formats (because I don’t expect more information to resurface). There are still more formats to look at though.