[opus] running at 44.1K but with standard frame sizes

Jean-Marc Valin jmvalin at jmvalin.ca
Fri Jun 14 23:23:42 PDT 2013


> I'm looking at how to run Opus at 44.1K. I have flexibility in the
> frame sizes of the unencoded audio, and packet sizes on the RF link.

You should probably consider resampling. It's not that expensive and it
would make things easy. But otherwise, see below.

On 06/14/2013 06:23 PM, Marc Lindahl wrote:
> So, I was digging through the code, and I didn't see any attempt to 
> measure in realtime the actual audio rate (makes sense, since this 
> codec can work offline too).

What do you mean by "measure in realtime the actual audio rate"?

> Opus_custom seems to be needed if you have a certain frame size 
> constraint with low latency.  I don't have that.  I can use the
> stock frame sizes ( 120, 240, 480, 960, 1920, and 2880
> sample/frame).
> 
> My conclusion is that I could set up Opus for 48K (stereo), and in 
> reality run it at 44.1K, as long as I use stock frame sizes, and it 
> would be fine.

Do not do that, ever. Everything is calibrated for 48 kHz and you will
likely cause audible noise. Besides, running at the wrong rates means
you lose all compatibility anyway, so you might as well use the custom
modes. Using custom modes means you would probably want to choose a
frame size that's a power of two and save a few extra cycles (maybe even
reuse a platform-specific power-of-two FFT).

> The only issue I can think of is any of the perceptual stuff will be 
> off by -8%, e.g. crossover/mask frequencies, etc.  Or is that true? 
> And with Opus_custom is all that stuff recalculated?

Yes, custom modes properly adjust all the psychoacoustics to the exact
sampling rate.

> If I do need to go to opus_custom, it seems that it's still best to 
> use the stock frame sizes, true?

There is no "stock frame size" with Opus custom. Modes are generated on
the fly (or you can always pre-generate them) with any frame size. The
frame size is that it can't have prime factors above 5, but that's about
the only constraint.

Cheers,

	Jean-Marc


More information about the opus mailing list