by smlckz on 8/8/23, 11:27 AM with 63 comments
by kragen on 8/9/23, 8:24 PM
like, can you reasonably qoa-compress real-time 16ksps audio on a 16 megahertz atmega328?
hmm, https://phoboslab.org/log/2023/04/qoa-specification has some benchmark results, let's see... seems like he encoded 9807 seconds of 44.1ksps stereo in 25.8 seconds and decoded it in 3.00 seconds on an i7-6700k running singlethreaded. what does that imply for other machines?
it seems to be integer code (because reproducibility between the predictor in encoding and decoding is important, and a significant part of it is 16-bit. https://ark.intel.com/content/www/xl/es/ark/products/88195/i... says it's a 4.2 gigahertz skylake. agner says skylake can do 4–6 ipc (well, μops/cycle) https://www.agner.org/optimize/blog/read.php?i=628, coincidentally testing on an i7-6700k himself, but let's assume it's 3 ipc, because it's usually hard to reach even that level of ilp in useful code
so that's about 380 μops per sample if i'm doing my math right; that might be on the order of 400 32-bit integer instructions per sample on an in-order processor. if (handwaving wildly now!) that's 600 8-bit instructions, the atmega328 should be able to encode somewhere in the range of 16–32 kilosamples per second
so, quite plausibly
for decoding the same math gives 43 μops per sample rather than 380
i'm very interested to hear anyone else's benchmarks or calculations
by g0xA52A2A on 8/9/23, 7:46 PM
3 months ago - https://news.ycombinator.com/item?id=35738817
6 months ago - https://news.ycombinator.com/item?id=34625573
by mips_r4300i on 8/10/23, 9:43 AM
Would be nice to see joint stereo support. If you were to take ADPCM or this OK format and try to encode any stereo music with it, you will need 2 channels. However, there is an extremely advantageous optimization that can be made here - most music is largely center panned, so both channels are almost the same. With joint stereo you record one channel (either by picking one or mixing to an average) and then you can store the difference for the other channel which will occupy a lot fewer bits, assuming you are able to quantize away the increased entropy.
For example, instead of using two 4bit ADPCM channels for stereo, which would only be a 50% savings over uncompressed, you could probably use an average of 5 bits per sample.
by gaazoh on 8/10/23, 10:10 AM
> I have just pushed a workaround to master. [...]
> This still introduces audible artifacts when the weights reset. It prevents the LMS from exploding, but is far from perfect :/
This, combined with the fact that that issue is still open mean that a breaking change is still to be expected.
by codeflo on 8/9/23, 7:52 PM
by Pet_Ant on 8/9/23, 6:43 PM
It should be spelled out explicitly, but I figured out the rest
L-Left,R-Right,C-Center,FL-Front Left,FR-FrontRight,SL-SideLeft,SR-SideRight,BL-BackLeft,BR-BackRight
---
Edit: LFE-LowFrequencyEffects... so subwoofer?
https://www.dolby.com/uploadedFiles/Assets/US/Doc/Profession...
by MobiusHorizons on 8/9/23, 8:39 PM
by Turing_Machine on 8/9/23, 7:37 PM
Other than that, looks great!
by marcoc on 8/9/23, 8:15 PM
by rockstarflo on 8/8/23, 11:28 AM
by ape4 on 8/9/23, 6:43 PM
by ericls on 8/9/23, 10:56 PM
by Aldipower on 8/9/23, 8:44 PM