21
Other Lossy Codecs / Re: Quite OK Audio (QOA)... anyone ?
Last post by Porcus -I also just finished a new draft of the file format specification:I see that you follow FLAC's channel order and allocation, where 4 resp. 5 channels are 4.0 and 5.0, and not 3.1 resp. 4.1.
https://qoaformat.org/qoa-specification-draft-02.pdf
I don't know what is actually the best, but you should think twice. The WAVEFORMATEXTENSIBLE channel order has LFE as channel four. And BL as channel five, so deciding that "an N channel signal MUST BE the first N in WAVEFORMATEXTENSIBLE" is not appropriate, at least not unless you can code one as "not present" for each block.
At https://xiph.org/flac/format.html there has "since forever" been a loose mention of SMPTE/ITU-R recommendations that aren't referenced properly - and also, those are superseded over time. Revision 9 of ITU-R BS.2159 is here: https://www.itu.int/dms_pub/itu-r/opb/rep/R-REP-BS.2159-9-2022-PDF-E.pdf . You see channel orders.
I have a hunch that no "standard" ever did prescribe FLAC's allocation - only the order among the channels that are actually included. At least it seems to be that way by now. Apparently, DVD-Audio can accommodate four channels as FL FR + any among the following four: (FC LFE), (LFE BC), (FC BC) or (BL BR).
So ... careful. Which means you might want to consider whether
uint8_t num_channels; // no. of channels
should be something else.