• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Opus codec and why its magic

yuki980e

Member
Joined
Aug 3, 2019
Messages
16
Likes
4
Since yesterday I've been doing heavy ABX tests on 128kbps Opus vs others at 96 to 256k, It's pretty much the quality of 192 to 320kbps AAC/Vorbis/MP3.
 

BillG

Major Contributor
Joined
Sep 12, 2018
Messages
1,699
Likes
2,268
Location
Auckland, New Zealand
Since yesterday I've been doing heavy ABX tests on 128kbps Opus vs others at 96 to 256k, It's pretty much the quality of 192 to 320kbps AAC/Vorbis/MP3.

Our ears are rather insensitive, but a spectral analysis will give one better insights... :cool:
 

q3cpma

Major Contributor
Joined
May 22, 2019
Messages
3,060
Likes
4,419
Location
France
Since yesterday I've been doing heavy ABX tests on 128kbps Opus vs others at 96 to 256k, It's pretty much the quality of 192 to 320kbps AAC/Vorbis/MP3.
While Opus is certainly extremely good, grouping AAC/Vorbis and MP3 is a grave mistake. A bit like saying that MPEG-2 and MPEG-4 AVC are the same.
Our ears are rather insensitive, but a spectral analysis will give one better insights... :cool:
How? Lossy compression is all about psychoacoustic tuning. Same way we can't really measure video encoder performances without looking, for now; yes, even with VMAF getting better.
 

BillG

Major Contributor
Joined
Sep 12, 2018
Messages
1,699
Likes
2,268
Location
Auckland, New Zealand
I think he is right, spectral analysis won't really tell you how good lossy codec is

Well, you can think whatever you like, but that doesn't mean that's what actually happens when these things are developed and evaluated: a spectral analysis would very much be part of that process, along with ABX testing... :p
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,069
Location
Zg, Cro
Well, you can think whatever you like, but that doesn't mean that's what actually happens when these things are developed and evaluated: a spectral analysis would very much be part of that process, along with ABX testing... :p

Don't be so sure - with lossy codecs it's mostly about dropping parts of the signal that are masked and that happens dynamically meaning not always will the same frequency be cut and spectral analysis won't show that. 2 lossy codecs can have very similar spectrum graph yet they will sound completely different. The point is that when looking at spectral analysis you can't even begin to guess about the true strategy of a lossy codec.
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,069
Location
Zg, Cro
@j_j might be willing to enlighten some on the development of audio codec's .

I believe it dose come down to having folks listen to it.

Of course it does.

Here is, for example, a spectrum of 500Hz-spaced multitone signal at –10dBFS of AAC codec at rate of 320kbps.

AAC_320.jpg


Same thing for MP3 at rate of 320kbps.


MP3_320.jpg


So, tell me, @BillG, what can you make out of it?
 

dc655321

Major Contributor
Joined
Mar 4, 2018
Messages
1,597
Likes
2,236
Don't be so sure - with lossy codecs it's mostly about dropping parts of the signal that are masked and that happens dynamically meaning not always will the same frequency be cut and spectral analysis won't show that. 2 lossy codecs can have very similar spectrum graph yet they will sound completely different. The point is that when looking at spectral analysis you can't even begin to guess about the true strategy of a lossy codec.

That's a good point - looking at the spectra of the total signal at once may not be terribly revealing.
More useful would be to difference the files in the time domain - lossless minus lossy - then create a spectrogram of that result.
Maybe an experiment for a lazy weekend (i.e. not this one :().

EDIT: oops, meant "lossy minus lossy".
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,069
Location
Zg, Cro
That's a good point - looking at the spectra of the total signal at once may not be terribly revealing.
More useful would be to difference the files in the time domain - lossless minus lossy - then create a spectrogram of that result.
Maybe an experiment for a lazy weekend (i.e. not this one :().

EDIT: oops, meant "lossy minus lossy".

Good idea. Although looking at these 2 spectrums I suspect that even that one wouldn't be able to tell much about differences. I never did ABX comparison between mp3 and AAC but I suspect the difference would be far from obvious.
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,705
Location
Hampshire
Good idea. Although looking at these 2 spectrums I suspect that even that one wouldn't be able to tell much about differences. I never did ABX comparison between mp3 and AAC but I suspect the difference would be far from obvious.
Depends on the bit rate and the material. At 128 kbps or lower, the differences can be quite apparent. If you want to compare lossy codecs, you need to push them until they start falling apart. That's where the differences will reveal themselves.
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,069
Location
Zg, Cro
Depends on the bit rate and the material. At 128 kbps or lower, the differences can be quite apparent. If you want to compare lossy codecs, you need to push them until they start falling apart. That's where the differences will reveal themselves.

While that is true I think that 320kbps (and eventually 256kbps) are most frequently in use and differences there are probably quite small.
 

Soniclife

Major Contributor
Forum Donor
Joined
Apr 13, 2017
Messages
4,516
Likes
5,440
Location
UK
Are there tests that show opus becomes transparent at a bitrate, if it's better than aac at high rates, not just low it might manage it.

Is there a good reason it's not being adopted more, other than inertia.
 

Jim777

Active Member
Forum Donor
Joined
May 28, 2019
Messages
124
Likes
203
Location
Greater Boston
There's no shortcuts when evaluating perceptual codecs. Those who have worked on codecs all wish there was, but there's not. Their strategy is to hide noise where it doesn't matter, both in time and frequency domain. So looking at the difference in time or frequency is interesting, but won't inform about perceived quality. The open-source codecs tend to develop *and* evaluate/compare using a psychoacoustic model (PEAQ, etc.). That's cheap and worthless, it's just a fancier way of comparing differences. Modern codecs are at least as sophisticated as the perceptual models in these evaluation methods, so not the right tool for the job.

The only way to evaluate these is by blind listening tests (MUSHRA, ABX, etc) with enough listeners. And with high rates, the first step is to find critical material (stuff that is hard to encode). Examples that come up a lot are applaud (try stereo too), castanets, speech (German is tough to encode for some reason), bagpipes and other tonal instruments. These stress either the time or frequency behavior of a codec.

Have fun, but accept that this is hard work.
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,282
Likes
4,792
Location
My kitchen or my listening room.
The only way to evaluate these is by blind listening tests (MUSHRA, ABX, etc) with enough listeners. And with high rates, the first step is to find critical material (stuff that is hard to encode). Examples that come up a lot are applaud (try stereo too), castanets, speech (German is tough to encode for some reason), bagpipes and other tonal instruments. These stress either the time or frequency behavior of a codec.

Have fun, but accept that this is hard work.

Except that ABC/hr is better than MUSHRA, please, all of that ^^^^
 

Jim777

Active Member
Forum Donor
Joined
May 28, 2019
Messages
124
Likes
203
Location
Greater Boston
Except that ABC/hr is better than MUSHRA, please, all of that ^^^^
That's true, a problem with MUSHRA is too many things to compare at the same time, so people don't put the effort where it counts if some items are too similar. Since the OP is interested in high bit rates, your recommendation for ABC/hr is spot on.
 
Last edited:

March Audio

Master Contributor
Audio Company
Joined
Mar 1, 2016
Messages
6,378
Likes
9,321
Location
Albany Western Australia
While Opus is certainly extremely good, grouping AAC/Vorbis and MP3 is a grave mistake. A bit like saying that MPEG-2 and MPEG-4 AVC are the same.

How? Lossy compression is all about psychoacoustic tuning. Same way we can't really measure video encoder performances without looking, for now; yes, even with VMAF getting better.
We can make measures of video encoder performance (not ignoring the requirement for controlled subjective analysis)

PSNR as an example.
 
Last edited:

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,282
Likes
4,792
Location
My kitchen or my listening room.
Are there tests that show opus becomes transparent at a bitrate, if it's better than aac at high rates, not just low it might manage it.

Is there a good reason it's not being adopted more, other than inertia.

I'm in a position where I can't comment exactly, but many codecs have a basic design that force a limit to improvement at some given bit rate.
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,282
Likes
4,792
Location
My kitchen or my listening room.
We very much can make measures of video encoder performance

PSNR

Yeah, I can calculate PSNR, SNR, SegSNR, and lots of other SNR's on audio too.

But what do they tell us?

There is a world of difference between a video codec whose error pattern is, oh, say +1+1+1+1-1-1-1-1 and one that is just +1 or -1, but the PSNR remains the same.

YES?
 
Top Bottom