Live data from Hacker News

QOA, the Quite OK Audio Format

phoboslab.org

21–30 of 83 posts

Re: QOA, the Quite OK Audio Format

#21
post #16
post #5

> Most GameCube games used their own 8-bit ADPCM format Minor quibble but, at least for music, most GC games used a native 4-bit ADPCM ("DSP", decoded by the DSP, or the ADP/DTK format, like CD-XA ADPCM and also handled in hardware), and the most common cross-console audio middleware (CRI) also generally used 4-bit ADX ADPCM. In this old list, everything marked ADP, ADX, DSP is using 4-bit (and others are usually jus…

Yeah, I don't understand the disparaging of 4-bit ADPCM as being terrible quality when this is effectively a 3-bit ADPCM. Most ADPCM codecs I've seen shipped have a similar table based system with a frame header with coefficients for your two history samples rather than the weight update scheme here, and it works quite well.

Traditional ADPCM is not terrible, it's just "meh". Compare:

- Original, 4039kb: https://phoboslab.org/files/qoa-samples/adpcm_comp/orig.wav

- MS ADPCM, 1022kb: https://phoboslab.org/files/qoa-samples/adpcm_comp/ms_adpcm....

- QOA, 812kb: https://phoboslab.org/files/qoa-samples/adpcm_comp/qoa.wav

IMA ADPCM is in the same ballpark as MS ADPCM. ADX (not listed) comes close to QOA, but at 1136kb is also larger than those traditional ADPCM flavors.

Re: QOA, the Quite OK Audio Format

#22
post #11

Earlier quoted context omitted.

QOI is only 8-bit depth (per channel) so it's a no-go for me. But interesting, yes.

Out of curiosity, what for?

I render accumulation fractals like the Buddhabrot at 32 bits per channel. So far I have only used about 27 bits but it's nice to have a bit of headroom.

Re: QOA, the Quite OK Audio Format

#23
post #16
post #5

> Most GameCube games used their own 8-bit ADPCM format Minor quibble but, at least for music, most GC games used a native 4-bit ADPCM ("DSP", decoded by the DSP, or the ADP/DTK format, like CD-XA ADPCM and also handled in hardware), and the most common cross-console audio middleware (CRI) also generally used 4-bit ADX ADPCM. In this old list, everything marked ADP, ADX, DSP is using 4-bit (and others are usually jus…

Yeah, I don't understand the disparaging of 4-bit ADPCM as being terrible quality when this is effectively a 3-bit ADPCM. Most ADPCM codecs I've seen shipped have a similar table based system with a frame header with coefficients for your two history samples rather than the weight update scheme here, and it works quite well.

This bit

> What makes QOA work is 1) a reasonably good predictor and 2) storing the scalefactor for a bunch of samples explicitly instead of guessing the right one from context, like ADPCM does.

suggests a comparison with DVI/IMA ADPCM [1] or derivatives, which go out of their way not to have too much state or use multiplies, and they also tend to be used at really low bitrates, so they have a somewhat deserved bad reputation. "Guessing" the scalefactor is overstating it, the scale does dynamically adjust but that's all considered from the encoder.

The 2-history-samples style ADPCMs in the BRR [2] family usually have very short frames (at most dozens of samples) and headers specifying scale and predictor/filter index.

I know a lot more about what's used on consoles than about the math of audio encoding, though, so I can't say whether QOA is making the wrong tradeoffs.

[1] https://wiki.multimedia.cx/index.php/IMA_ADPCM [2] https://en.wikipedia.org/wiki/Bit_Rate_Reduction

Re: QOA, the Quite OK Audio Format

#24
post #3

Quite OK article :) A few years ago, a guy made his own video compression format, but I can't find it anymore, is it still available online?

Are you looking for this series of articles? The author makes his own video codec for a video chat app, and has a lot of test videos of faces.

https://bengarney.com/2016/06/25/video-conference-part-1-the...

Re: QOA, the Quite OK Audio Format

#25
post #18

It's not clear to me why Opus doesn't meet their needs. They write it off for not being simple, but is the problem that it's too slow for their application? Are they doing something where they need a very small compiled size [1]? Aesthetically prefer things that are simpler? [1] I ship an Opus encoder and decoder to the browser to support https://www.jefftk.com/p/bucket-brigade-singing and it's just 310KB for compres…

This looks interesting! Do you have a link to the source code of the opus encoder and decoder? The code in the github repo (html/opusjs/decoder.js) looks generated and is hard to understand.

Re: QOA, the Quite OK Audio Format

#26
post #18

It's not clear to me why Opus doesn't meet their needs. They write it off for not being simple, but is the problem that it's too slow for their application? Are they doing something where they need a very small compiled size [1]? Aesthetically prefer things that are simpler? [1] I ship an Opus encoder and decoder to the browser to support https://www.jefftk.com/p/bucket-brigade-singing and it's just 310KB for compres…

Curiosity mostly. As stated in the article, Opus is excellent and better than QOA in every way except in complexity (and as a result, performance). A possible application for QOA is games, where you need to play dozens of audio files immediately.

I haven't done any formal benchmarks, but with a simple `time` on the command line QOA encodes 10x faster and decodes 7x faster than Opus.

QOA should be quite suitable for SIMD optimizations, which would improve performance even more. Still on my todo list.

Re: QOA, the Quite OK Audio Format

#27
"There still remains a huge gap between lossless codecs at ~800kb/s and MP3 at 128kb/s with seemingly little interest to fill it."

Not only does mp3 go to 320kbps, 192kbps was considered the 'standard' for ripping audio CDs, with the V0 variable bit rate being another common choice. if this only does 277, what am I getting aside from. another audio codec?

Re: QOA, the Quite OK Audio Format

#28
post #18

It's not clear to me why Opus doesn't meet their needs. They write it off for not being simple, but is the problem that it's too slow for their application? Are they doing something where they need a very small compiled size [1]? Aesthetically prefer things that are simpler? [1] I ship an Opus encoder and decoder to the browser to support https://www.jefftk.com/p/bucket-brigade-singing and it's just 310KB for compres…

One fairly significant advantage is seek-ability. I can see it being really useful for a game to just dump all of their audio into a single file and specify which clip with just a start and end frame.

Re: QOA, the Quite OK Audio Format

#29
Lately I have been collecting MiniDisc hardware, one of those things that progresses from "I'll buy a deck from Japan" to seeing a deck at the thrift store and taking it home right away.

The ATRAC codec used in Minidisc is similar in bitrate to the QOA although it is transform-based. I had a music technology prof ask me "How do you stand listening to something compressed?" I also have a monster CD changer

https://www.crutchfield.com/S-sTSOm8D5jfj/p_158CDPX355/Sony-...

which I am filling up with 5.1 DTS disks that play on my home theater. I told my son that I find it hard to listen to 2-channel minidiscs next to really good 5.1 recordings with good bass management, but this weekend I did some heads-up listening testing between 2-channel CDs and minidiscs I made from the CDs and I could not tell the difference on my stereo. I am somewhat picky, I think "128 kbps MP3 suck" and can prove it. More careful A/B testing through headphones might reveal more weaknesses in ATRAC and any codec has some files that will stress it, but I am impressed with the quality of ATRAC and also with the low complexity. I have a portable player that plays for hours that runs off a single AA battery, mechanical parts and all.

Re: QOA, the Quite OK Audio Format

#30
post #15

"The first lossless audio format to gain widespread adoption (FLAC) was released 6 years after MP3." AIFF and WAV say what?

From context they mean lossless compression audio format, and standard AIFF and WAV are uncompressed PCM. On the other hand, AIFF does have a compressed variant ("AIFF-C") spec'd in 1991 [1], which I suspect the author wasn't aware of. [1] https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/A...

[deleted]
Post reply on HN