HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: Alexxander on 2021-10-18 11:44:07

Title: Understanding FB2K Converter audio processing chain
Post by: Alexxander on 2021-10-18 11:44:07
Hi,

As I’m looking to convert mainly from FLAC to AAC (qaac used) with single target level -14 LUFS, I’m looking to understand the audio processing chain that's behind the Converter Setup >> Processing screen.

I’ve read tens of posts and didn’t find a clear answer.

The Hydrogenaudio Wiki Foobar2000:Converter page (https://wiki.hydrogenaudio.org/index.php?title=Foobar2000redirect:987D6F0F-285D-4EB2-92BC-AF267209EEB0) states:

Quote
ReplayGain
    Select the relevant ReplayGain settings to apply to the converted content. This will permanently apply the change to the output file.
DSP
    Apply the effects of any available DSPs to the converted content. Again, this will permanently apply the change to the output file.

So it’s saying clearly that RG and active DSPs are applied to the AAC file.

However, I did some testing and my conclusion is the opposite: RG and DSP is applied before the encoding to AAC. If for example I set -20dB at preamp, the bitrate of the created AAC is lower than done without preamp.

On the other hand, if I scan and apply RG to an already existing AAC file, the average bitrate remains unchanged (as expected).

The audio processing chain of the Converter for example FLAC to AAC is like this?

    FLAC > WAV or PCM (not sure) > RG and/or Preamp > Active DSPs > Encode to AAC

As a side note, of RG and DSP applied before encoding, could encoding to AAC not cause clipping in some specific cases?

Many thanks for clarifying

Title: Re: Understanding FB2K Converter audio processing chain
Post by: Alexxander on 2021-10-20 07:51:57
The Hydrogenaudio Wiki Foobar2000:Converter page (https://wiki.hydrogenaudio.org/index.php?title=Foobar2000redirect:987D6F0F-285D-4EB2-92BC-AF267209EEB0) states:

Quote
ReplayGain
    Select the relevant ReplayGain settings to apply to the converted content. This will permanently apply the change to the output file.
DSP
    Apply the effects of any available DSPs to the converted content. Again, this will permanently apply the change to the output file.

Can anyone confirm the Wiki quote about RG is incorrect or what am I missing?

Thanks
Title: Re: Understanding FB2K Converter audio processing chain
Post by: A_Man_Eating_Duck on 2021-10-20 09:21:41
When applying replaygain you are altering the volume of the source when it's being encoded to the output format.

Under the other menu there is an option to replaygain-scan output files as albums or transfer replaygain info which will keep the file volume the same as the source but write the replaygain info in to the tags.
Title: Re: Understanding FB2K Converter audio processing chain
Post by: Alexxander on 2021-10-20 10:30:30
Thanks A_Man_Eating_Duck, but my point is not about volume change, this I just used it to verify impact on final encoded file.

My point is whether this sequence is correct:

    FLAC > WAV or PCM (not sure) > RG and/or Preamp > Active DSPs > Encode to AAC

And if correct, then the quoted wiki part is wrongly written.
Title: Re: Understanding FB2K Converter audio processing chain
Post by: Case on 2021-10-20 16:22:55
The Hydrogenaudio Wiki Foobar2000:Converter page (https://wiki.hydrogenaudio.org/index.php?title=Foobar2000redirect:987D6F0F-285D-4EB2-92BC-AF267209EEB0) states:

Quote
ReplayGain
    Select the relevant ReplayGain settings to apply to the converted content. This will permanently apply the change to the output file.
DSP
    Apply the effects of any available DSPs to the converted content. Again, this will permanently apply the change to the output file.

So it’s saying clearly that RG and active DSPs are applied to the AAC file.

I suppose the text can be interpreted that way too. But all processing is performed to the decoded signal. My interpretation of the quoted text is that the ReplayGain adjustment and the DSP effects get "baked in" to the output. But my interpretation might be biased because I know what it does.

The audio processing chain of the Converter for example FLAC to AAC is like this?

    FLAC > WAV or PCM (not sure) > RG and/or Preamp > Active DSPs > Encode to AAC

Yes, source file is decoded to 32-bit floating point PCM, converter applies ReplayGain, then DSPs, then signal is converted to target format supported by the encoder.

As a side note, of RG and DSP applied before encoding, could encoding to AAC not cause clipping in some specific cases?

What do you mean exactly? Are you referring to the fact that most lossy formats, when decoded, show peaks above digital fullscale? That's generally not something you need to worry about, clipping is rarely a reason for audible differences from the original. Only way to prevent that would be to lower the amplitude, but then it would be audibly different from the original.
Title: Re: Understanding FB2K Converter audio processing chain
Post by: Alexxander on 2021-10-20 18:40:09
Thanks Case for getting back. I get now "converted content" and "output file" not necessarily point to the final produced file (AAC).

Quote
As a side note, of RG and DSP applied before encoding, could encoding to AAC not cause clipping in some specific cases?

What do you mean exactly? Are you referring to the fact that most lossy formats, when decoded, show peaks above digital fullscale? That's generally not something you need to worry about, clipping is rarely a reason for audible differences from the original. Only way to prevent that would be to lower the amplitude, but then it would be audibly different from the original.

I was thinking about the case that RG and DSP could push up the peaks and these would be encoded. I suppose putting something like the Advanced Limiter DSP at the end of the DSP chain can avoid this happening, aside from (rare) intersample peaks after the Advanced Limiter DSP.
Title: Re: Understanding FB2K Converter audio processing chain
Post by: Case on 2021-10-20 19:39:20
Note that most new encoders can handle peaks beyond digital fullscale and the signal won't get clipped. For example qaac can easily encode such content. Of course if the encoded file was too loud playing it back without clipping or volume pumping will require volume adjustment in some form.