Lossy audio codecs - opus update

Opus is the best lossy codec (quality/size ratio wise), but still slow to encode/decode. Fortunately, it's not abandonned at all.
This Opus 1.2-alpha alpha release of the upcoming Opus 1.2 brings many quality improvements, new features, and bug fixes, including: Speech quality improvements especially in the 12-20 kbit/s range Improved VBR encoding for hybrid mode More aggressive use of wider speech bandwidth, including fullband speech starting at 14 kbit/s Music quality improvements in the 32-48 kb/s range Generic and SSE CELT optimizations Support for directly encoding packets up to 120 ms DTX support for CELT mode SILK CBR improvements Support for all of the fixes in draft-ietf-codec-opus-update-04 (the mono downmix and the folding fixes need –enable-update-draft) Many bug fixes, including integer overflows discovered through fuzzing (no security implications)
For the fun, I also benchmarked most lossy codecs (except AAC) at their "best" bitrate, encoding and decoding:
benchmark.sh 5 opusenc --quiet --bitrate 128 "02 - A Fine Day To Die.wav" "02 - A Fine Day To Die.opus"9.292benchmark.sh 5 opusdec --quiet "02 - A Fine Day To Die.opus" out.wav4.664benchmark.sh 5 ffmpeg -y -threads 1 -loglevel quiet -c:a opus -i "02 - A Fine Day To Die.opus" out.wav2.24benchmark.sh 5 lame --quiet --noreplaygain -V3 "02 - A Fine Day To Die.wav"10.3benchmark.sh 5 lame --quiet --decode "02 - A Fine Day To Die.mp3"1.832benchmark.sh 5 ffmpeg -y -threads 1 -loglevel quiet -c:a mp3 -i "02 - A Fine Day To Die.mp3" out.wav1.844benchmark.sh 5 oggenc -Q --bitrate 160 "02 - A Fine Day To Die.wav"8.436benchmark.sh 5 oggdec -Q -o out.wav "02 - A Fine Day To Die.ogg"1.272benchmark.sh 5 ffmpeg -y -threads 1 -loglevel quiet -c:a vorbis -i "02 - A Fine Day To Die.ogg" out.wav.9benchmark.sh 5 mpcenc --silent --overwrite "02 - A Fine Day To Die.wav" "02 - A Fine Day To Die.mpc"8.61benchmark.sh 5 mpcdec "02 - A Fine Day To Die.mpc" out.wav1.188benchmark.sh 5 ffmpeg -y -threads 1 -loglevel quiet -c:a mpc8 -i "02 - A Fine Day To Die.mpc" out.wav1.518
tl;dr use Opus if lack space, use Vorbis or Musepack in any other case

Other urls found in this thread:

rockbox.org/wiki/CodecPerformanceComparison
rockbox.org/wiki/CodecMemoryUsage
rockbox.org/wiki/FasterMDCT
wiki.xiph.org/OpusFAQ#Does_Opus_make_all_those_other_lossy_codecs_obsolete.3F
en.wikipedia.org/wiki/CELT#History
twitter.com/NSFWRedditVideo

If I'm going to use a lossy codec for anything it has to be playable on my devices. I don't listen to lossy music on my PC which is why the only lossy codec I will be using is mp3 until this shit has better support.

What pleb device can't at least play vorbis or even AAC?

A $600 iPhone :^)

Does it support replaygain yet?

Does AAC support filesizes over 2GB yet?

I don't know what your devices are, but I have no problem playing opus files on my Android device.

Reading blackplayer's documentation, I encountered that playability is related to the android version, not the application. Apparently 6.0 onwards should be able to play opus just fine; sadly when I tried to use it, I couldn't edit the tags at all (at least not with BP).

I use BlackPlayer on 6.0.1, and it played Opus fine, but only in the .ogg container. Tags seemed OK, IIRC.

gonna try that, thanks

What does AAC 2GB support have to do with vorbis replaygain support?

Is Opus supported by 8ch yet? I always make my webms in Vorbis so they actually play here.

I've always made webms with opus and never had it not work. Maybe you just have shitty or badly configured browser.

I always use VP9+Opus and it just werks.

These pages should be pretty interesting here:
rockbox.org/wiki/CodecPerformanceComparison
rockbox.org/wiki/CodecMemoryUsage
rockbox.org/wiki/FasterMDCT

Here's the 2016 result. Musepack is still faster. But well, 17 (mpc) vs 21 (vorbis) MHz isn't that much.
Think I'll use vorbis.

Everything. Think about it.

It's not slow enough to matter. Every time I've ever encoded in Opus, the bottleneck has been I/O, not CPU, so it encodes faster than any other codec, as it encodes smaller, saving I/O.

As far as decoding goes, I haven't noticed any issues, like shorter battery life or anything.

Not him, what are you talking about?

Opus replaygain is a big clusterfuck. The official gain system is ebur128, but players only seem to read Replaygain 2.0 tags.

m8, unless you use a smartphone where NEON optimisations do all the work, opus consumes a lot more than vorbis/mpc. Look at in the CPU frequency column.

What does MHz even mean in this context? At how much freq the processor needed to run in order to decode the thing in time? If so 40 MHz is nothing in any context.

m8, unless you use a smartphone where NEON optimisations do all the work, opus consumes a lot more than vorbis/mpc. Look at in the CPU frequency column.

Now that you say it, the page doesn't really says. I suppose that this is the CPU frequency during playback.

Well it was the case a couple years ago. Guess I never bothered staying informed. Gasaraki was kind of disappointing.

Well it was the case a couple years ago. Guess I never bothered staying informed. Gasaraki was kind of disappointing.

...

Asking whether an audio codec supports metadata makes as zero sense as asking whether it has file size limits. Replaygain goes in the fucking container.

I never bothered to test it, but I'd assume changing complexity to anything else but the default 10 (max) would have some influence on this.

Then you lose its advantage. Using Vorbis 160 instead of Opus 128 makes sense on underpowered devices like Sansa.

that's epic fail…

also, Vorbis is better than Opus at -q 6 and higher, because Opus is not designed to have high frequency-domain precision at any bitrate (this is fine for lower bitrates however)

yep, I mean, at any bitrate.

so that's big disappointment for those who jumped into using Musepack without doing any prior testing themselves.

and the cause of this is likely the poop quality of the filterbank implementation that's used to split audio into subbands (or maybe quantization). there are LOTS of new frequencies that were not present in the source, similar to the result of crappy resampling

Source? Opus at higher bitrate (e.g. >32k) is CELT, which is basically Vorbis' succesor, so I don't see how it's worse than Vorbis.

I looked at the difference between original and encoded waves for both codecs. In case of Opus vs Vorbis, the difference is much bigger for Opus when competing against Vorbis q6+.

of course this is not necessarily bad for listening, because that stuff is hard to hear for most humans anyway, but the fact is that Vorbis has more precision given high enough bitrates (q6 and higher).

real advantage of Opus is low bitrate performance, when all other mainstream codecs stop being usable at all. AFAIK is's because it has some cool tricks specially designed to cover big inaccuracies when having too little bits, for example preserving "average energy" for bands by filling holes with noise, etc

>wiki.xiph.org/OpusFAQ#Does_Opus_make_all_those_other_lossy_codecs_obsolete.3F
Xiph themselves say that it deprecates Vorbis (you know, their older codec).
>en.wikipedia.org/wiki/CELT#History
CELT IS Vorbis 2.0.

Seriously, if Opus was as fast as Vorbis to decode, I'll use 128 everywhere (well, except for archiving, obviously).

Maybe, maybe not. It won't be as good as the max value, but that doesn't mean it isn't still better than (or just as good as) the other codecs. I wouldn't be surprised if the difference is small. Kinda like the difference between a "Best" and "Good" webm.

I encoded a song with complexity 10 and with complexity 0. It took 6.438s vs 2.839s which is quite a speed difference. I couldn't really hear the difference in quality, but I'm on a laptop, so maybe someone with a better system (and hearing) could check that part out.

And what counts is decoding speed.
for i in 0 3 6 10; do opusenc --bitrate 128 --comp $i '01 - Kanaan.flac' $i.opus; donetime-avg.sh 5 "ffmpeg -loglevel quiet -i 0.opus out.wav; rm out.wav".984time-avg.sh 5 ffmpeg -loglevel quiet -i 3.opus out.wav; rm out.wav1.13time-avg.sh 5 ffmpeg -loglevel quiet -i 6.opus out.wav; rm out.wav1.148time-avg.sh 5 ffmpeg -loglevel quiet -i 10.opus out.wav; rm out.wav1.152oggenc --bitrate 160 01\ -\ Kanaan.flactime-avg.sh 5 ffmpeg -loglevel quiet -i '01 - Kanaan.ogg' out.wav; rm out.wav.514
tl;dr vorbis is a lo faster because ffmpeg has a really optimised MDCT implementation.

Hmm, framesize do make a real change, though
opusenc --bitrate 128 --framesize 60 01\ -\ Kanaan.flac out60.opusopusenc --bitrate 128 01\ -\ Kanaan.flac out20.opustime-avg.sh 5 ffmpeg -loglevel quiet -i out20.opus out.wav; rm out.wav1.136time-avg.sh 5 ffmpeg -loglevel quiet -i out60.opus out.wav; rm out.wav1.012

What's the from?

It doesn't mean that CELT is a somehow improved version of Vorbis. It's a completely new codec, with its own advantages and also some disadvantages.

/fit/

Do I need to quote it for you?

Whoops, it's Patlabor 2.

You obviously didn't do any real testing or reading the codez.

If the guys who made Vorbis says that Opus "should replace Vorbis", there's no code reading to do. Also, vorbiscomment can't do covers because it's retarded; opusenc can.

>Also, vorbiscomment can't do covers because it's retarded; opusenc can.
which is ironic because they both use exactly the same container

I was using a pretty old libopus (1.1). Here are the results with 1.1.3:
opusenc --quiet --bitrate 128 "02 - A Fine Day To Die.wav" "02 - A Fine Day To Die.opus": 8.078
Decoding is pretty much the same.

Yes, the man page still says Ogg Vorbis, though. I don't know why they don't rename the binary to oggcomment and let encoder/decoders do only encoding/decoding.

i never understood this meme i can encode a 5 min 24 bit flac david bowie song in less than 10 seconds on my core i7 4770 and the decoding cpu use is irrelevant because it's so low.
What does someone have to run to not be able to decode their opus tracks, a fucking 386?

You could read the thread.
tl;dr Even underpowered devices, like ARM9 CPUs (used in most portable players), have dynamic voltage scaling.