Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Quite OK Audio (QOA)... anyone ? (Read 4155 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Quite OK Audio (QOA)... anyone ?

Reply #25
...
SIMD: yes, the algorithm doesn't seem to be very friendly to SIMD optimizations. I tried writing some intrinsics and only made it slower than my compiler's -O3. The problem is manly that the prediction needs a horizontal accumulation of all 4 weights * history and these are bog slow on x86. Updating the LMS state every sample in itself isn't too bad. On my aging i7-6700k decoding sits at around 3500x realtime (one thread). I'm still looking for ways to make it faster.
...
Would you mind sharing even if it's slower? I'm not competent with intrinsics and only just started an AVX2 port attempt. Used _mm256_madd_epi16 to do the multiply and half the gather, _mm256_hadd_epi32 to finish the gather. The goal is to be able to decode 4 channels at once with AVX2 (either 4 frames or more likely 2 dual channel frames for better memory locality). Currently researching how to vectorise the qoa_dequant_tab lookup, apparently shuffle instructions can be used for small lookup tables but no idea if qoa_dequant_tab fits that criteria or how to go about it yet.


Re: Quite OK Audio (QOA)... anyone ?

Reply #27
@john33 - any chance you could make a compile of QOA that also support input of wav, mp3, flac & qoa as the binary encoder you compiled earlier suggests?

Re: Quite OK Audio (QOA)... anyone ?

Reply #28
Noise shaping: there's an experimental branch where I implemented some very simplistic noise shaping. code here. I made a comparison page with all test samples with and without this noise shaping: https://phoboslab.org/files/qoa-samples/noiseshaping.html – The difference in 32_triangles-triangle_roll_stereo is night and day.

Great, moving quantization noise from lower to higher seems to work in 32_triangles-triangle_roll_stereo.
I believe that the high freq metallic sound of the triangle is good at masking the higher freq sound, so this conceals the now-higher quantization noise well. Lower-freq quantization noise is reduced, where this is more audible in this particular sample.
Can't we do it adaptively, so that quantization noise is moved to the insensitive part of the frequency due to auditory masking; for example, when the content is louder in lower freq, you move the quantization noise from higher to lower, so that we won't hear the hisses... sound. It is the typical case.

Re: Quite OK Audio (QOA)... anyone ?

Reply #29
Wouldn't doing all that make the encoding way more complex and computationally expensive?
Though that seems like it's probably OK in a lot of use cases for something like this, at least within reason

Re: Quite OK Audio (QOA)... anyone ?

Reply #30
Indeed, the noise shaping should be done adaptively, and indeed, it does come with a complexity overhead in the encoder. In my Master's thesis around 2007, I designed an ADPCM codec very similar to this one (but not operating on quadruples of samples IIRC), which used two noise shaping filters - a fixed highpass-like one (quite like QOA's experimental one) and a signal adaptive one (using a LPC filter). My supervisor and I wrote a freely available DAFx paper on it, which you can still find at

http://legacy.spa.aalto.fi/dafx08/papers/dafx08_40.pdf

Since then I found this dual fixed/adaptive shaping approach  to be very useful and performant. I even implemented such a psychoacoustic approach in the exhale encoder.

Chris
If I don't reply to your reply, it means I agree with you.

Re: Quite OK Audio (QOA)... anyone ?

Reply #31
I have never compiled for Windows so I am wondering if someone would like to compile QOA encoder with noise shaping to test out? Thanks in advance.

Re: Quite OK Audio (QOA)... anyone ?

Reply #32
Nevermind. I managed to not be lazy so I figured it out.

Re: Quite OK Audio (QOA)... anyone ?

Reply #33
@john33 - any chance you could make a compile of QOA that also support input of wav, mp3, flac & qoa as the binary encoder you compiled earlier suggests?
A little late in the day, but here is a compile with noise-shaping, and mp3 and flac input enabled (64bit compile). ;)

https://www.rarewares.org/files/QOAconv.zip

Re: Quite OK Audio (QOA)... anyone ?

Reply #34
@john33 - any chance you could make a compile of QOA that also support input of wav, mp3, flac & qoa as the binary encoder you compiled earlier suggests?
A little late in the day, but here is a compile with noise-shaping, and mp3 and flac input enabled (64bit compile). ;)

https://www.rarewares.org/files/QOAconv.zip

Thnx a lot John :)


 

Re: Quite OK Audio (QOA)... anyone ?

Reply #36
Interesting codec. Sounds quiet nice actually. Would it be possible to make this support hybrid mode with a lossless correction layer?