Skip to main content
Topic: How does the opus encoder deal with a 24-bit source? (Read 1030 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How does the opus encoder deal with a 24-bit source?

I know opusenc can take a 24-bit audio file as an input.

But I want to know if the source audio file will be converted to 16-bit first and then be encoded into an opus file.

Re: How does the opus encoder deal with a 24-bit source?

Reply #1
As far as I know everything is converted to 16/48 before it's encoded. Also if you need to keep the 24 bit depth I suggest to use a lossless codec instead of a lossy codec. In practice the bitdepth can get lower than 16 bit theoretically.

Re: How does the opus encoder deal with a 24-bit source?

Reply #2
As far as I know everything is converted to 16/48 before it's encoded. Also if you need to keep the 24 bit depth I suggest to use a lossless codec instead of a lossy codec.

I don't prefer 24-bit over 16-bit (can't hear the difference), I am just curious.

In practice the bitdepth can get lower than 16 bit theoretically.

Could explain what does that mean?

Re: How does the opus encoder deal with a 24-bit source?

Reply #3
Actually all input is converted to 32-bit floating point and processed in that format.

Re: How does the opus encoder deal with a 24-bit source?

Reply #4
Actually all input is converted to 32-bit floating point and processed in that format.

Correct. It still means you won't be keeping the (theoretically) very low noise of your 24-bit recording (for that you need lossless). However, you *will* be keeping all of the dynamic range. Opus is capable of representing the full 24-bit dynamic range, and then some.

Re: How does the opus encoder deal with a 24-bit source?

Reply #5
But I want to know if the source audio file will be converted to 16-bit first and then be encoded into an opus file.

Almost all practical PC lossy encoders use floating point, so everything gets converted to 32 bit. 

Re: How does the opus encoder deal with a 24-bit source?

Reply #6
except fdk-aac, I think

Re: How does the opus encoder deal with a 24-bit source?

Reply #7
fdk-aac must deal with clipped integer samples, and is hard coded to specific integer precision. I even tried decoupling that a bit, to support fixed point that exceeds ±1.0, but the SBC and/or PS code break horribly if the input and output aren't clipped first.

Re: How does the opus encoder deal with a 24-bit source?

Reply #8
Actually all input is converted to 32-bit floating point and processed in that format.

Correct. It still means you won't be keeping the (theoretically) very low noise of your 24-bit recording (for that you need lossless). However, you *will* be keeping all of the dynamic range. Opus is capable of representing the full 24-bit dynamic range, and then some.

I thought low noise and high dynamic range were the same thing - dynamic range being the decibels between the quietest intentional sound above the noise floor and the loudest sound. So the only way to have high dynamic range is to have a low noise floor.

And that 16 bits already provides enough at listening levels where the peak won't cause hearing damage (or be distorted by speakers), 24-bits only being of real value during mastering.

Re: How does the opus encoder deal with a 24-bit source?

Reply #9
I thought low noise and high dynamic range were the same thing - dynamic range being the decibels between the quietest intentional sound above the noise floor and the loudest sound. So the only way to have high dynamic range is to have a low noise floor.

And that 16 bits already provides enough at listening levels where the peak won't cause hearing damage (or be distorted by speakers), 24-bits only being of real value during mastering.
Actually they are not the same thing and this is made clear with float point numbers, there are various definitions for snr and dr. On definition being: "Dynamic range in dB is the sum of the signal-to-noise ratio in dB plus the headroom in dB", with this definition:

16bit integer:
snr= 6 x number of bits= 6 x 16 = 96db
headroom = 0db
dynamic range = 96+0 = 96db

16bit IEEE half precision float
snr=6 x 2^(bits in exponent)= 6 x 2^5 = 192db
headroom= 6 x (2 + bits in mantissa) = 6 x (2 + 10) = 72db
dynamic range= 192+72 = 264db
altrough in floats I actually like to consider the precission as the real snr and in this case is 6 x (1 + bits in mantissa) = 66db.

PD. I'm not sure of the float point calculation but at worst the error is no more than 12db.

 

Re: How does the opus encoder deal with a 24-bit source?

Reply #10
fdk-aac must deal with clipped integer samples, and is hard coded to specific integer precision. I even tried decoupling that a bit, to support fixed point that exceeds ±1.0, but the SBC and/or PS code break horribly if the input and output aren't clipped first.
A bit sad result, but still pretty interesting experiment
I thought low noise and high dynamic range were the same thing - dynamic range being the decibels between the quietest intentional sound above the noise floor and the loudest sound. So the only way to have high dynamic range is to have a low noise floor.
The thing is, noise floor doesn't have to be constant. Lossy codecs, if grossly oversimplified, can be said to work by hiding noise under the signal in such a way that when the signal is quiet, noise is also quiet, and so we don't hear the presence of that noise, but it can be pretty loud (when the signal is even louder).

 
SimplePortal 1.0.0 RC1 © 2008-2019