Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 24bit ReplayGain on waveform file conversion? (Read 8045 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

24bit ReplayGain on waveform file conversion?

Reply #25
OMFG... are you serious? You have produced 25 posts about what is better - applying RG to 32bps float or to 24bps fixed? OMG... Then maybe we should start divagation about HDMI cable jitters? Please...
Let me ask you all a question - is this "difference" even measurable by some fancy calculations? I mean - is it possible to show any mathematic proof that in fact there is any greater noise applied in one of these routines compared to another?
But I have better question - especially for "Nintendo Maniac" - if this difference really exists - is it greater than regular noise present in typical audio channel (caused by D/A and amplification stages)? I don't think so...
And if someone is so purist then why not install ASIO, disable RG and any DSP and stream audio via HDMI to his hi-end stereo system?

24bit ReplayGain on waveform file conversion?

Reply #26
If you're trying to compare the errors between different processes, peak normalising them independently will wreck this comparison.

I'm normalizing after the two waveforms have been mixed into a single waveform.

Starting at 44.1kHz or 48kHz, and 16-bits, with a target of a higher sample rate and/or a higher bitdepth + ReplayGain, I don't believe that any of the things you're discussing in this thread cause any audible difference even under the most extreme circumstances.

Fair point.  Admittedly I wasn't that interested in audible differences in the first place but was more concerned with preserving lossless-ness since, like I posted, I originally thought that 32float -> 24bit gain adjustments were supposed to be lossless and yet I wasn't seeing that, therefore my original concern.

Refusing to work in 32-bit float because you have a 24-bit output is as misguided as refusing to working in 24-bits because you have a 16-bit output or refusing to working in 16-bits because you have an 8-bit output. More bits during processing are not a problem: they're a potential benefit, and at least not worse (assuming everything else is equal).

I think you (and EpicForever) missed a post of mine.  Here, let me quote it for you:

Oh wow, I'm a derp.  The aliasing I've been seeing is due to resampling, not from the gain adjustment!


In case I wasn't clear enough, let me spell it out for you - the lossy difference I was seeing was due to resampling and not bit-depth reduction.


I would have edited my opening post to say that this was a false alarm and that I was seeing differences caused by resampling and not bit depth reduction, but it won't me edit that post anymore.

24bit ReplayGain on waveform file conversion?

Reply #27
I already caught that last part, at least.

There may yet be some rounding errors converting 24 bit to 32 bit float, gain scaling, then converting back. However, they are likely to be minuscule rounding errors, considering the 24 bit integer precision.

24bit ReplayGain on waveform file conversion?

Reply #28
There may yet be some rounding errors converting 24 bit to 32 bit float, gain scaling, then converting back. However, they are likely to be minuscule rounding errors, considering the 24 bit integer precision.

From my testing 32float -> gain change -> 32float results in the exact same waveform as 32float -> gain change -> 32float -> 24bit -> 32float.

EDIT: Except now I just tested again to make absolute sure and now they're not the same?  Hang on...


EDIT 2: Ok, figured it out.  The following two processes result in the exact same waveform:

  • 24bit -> 32float -> gain change -> 32float
  • 24bit -> 32float -> gain change -> 32float -> 24bit -> 32float


While the following two processes result in different waveforms:

  • 32float -> gain change -> 32float
  • 32float -> gain change -> 32float -> 24bit -> 32float


The key is what the starting bit depth is.

24bit ReplayGain on waveform file conversion?

Reply #29
Yeah, well, the initial waveform being 32 bit float does add the possibility of there being higher precision, and also unclipped values which may be clipped when converting down to integer.

24bit ReplayGain on waveform file conversion?

Reply #30
Clipping... that reminds me, Foobar's replay gain scanner (only the metadata part, not the "WaveGain" exporter) will adjust the waveform gain to the default target of -18 LUFS no matter what, even if it involves increasing the gain and clipping the peaks of the waveform.

Is this intentional?  For a real-world example, this occurs with the very first track of the Mario Galaxy OST, the song titled "Overture".

24bit ReplayGain on waveform file conversion?

Reply #31
Clipping... that reminds me, Foobar's replay gain scanner (only the metadata part, not the "WaveGain" exporter) will adjust the waveform gain to the default target of -18 LUFS no matter what, even if it involves increasing the gain and clipping the peaks of the waveform.
foobar2000's RG scanner does not adjust the gain at all, it just calculates the necessary gain adjustment. It's up to the playback software to avoid clipping when playing files with positive RG values. foobar2000 can prevent clipping according to peak values when using RG adjustment during playback.
It's only audiophile if it's inconvenient.

24bit ReplayGain on waveform file conversion?

Reply #32
foobar2000 can prevent clipping according to peak values when using RG adjustment during playback.

But can it do that without compressing or limiting the dynamics of said clipped waveform peak?

24bit ReplayGain on waveform file conversion?

Reply #33
Compressing would limit the dynamics. Default clipping prevention adjusts the output amplitude for the entire album or entire track depending on your settings so that peaks will reach digital fullscale but not go above it. This is identical to normal volume adjustment and does nothing to dynamic range.
Optionally you can enable either 'Hard -6dB limiter' or 'Advanced Limiter' DSP with foobar2000. The former compresses the peaks causing some dynamic range loss. The latter will dynamically start lowering amplitude when peaks are getting near fullscale. It affect the dynamic range too but without compression artifacts.

24bit ReplayGain on waveform file conversion?

Reply #34
Default clipping prevention adjusts the output amplitude for the entire album or entire track depending on your settings so that peaks will reach digital fullscale but not go above it. This is identical to normal volume adjustment and does nothing to dynamic range.

This is what I want, how can it be done for playback without needing to export/convert?

24bit ReplayGain on waveform file conversion?

Reply #35
Surprisingly, this is achieved by going into the Preferences for Playback and selecting the relevant album- or track-based option suffixed by “and prevent gain according to peak”.

…Did this entire thread of unnecessary worrying come around solely because you hadn’t looked around the options sufficiently?

24bit ReplayGain on waveform file conversion?

Reply #36
Surprisingly, this is achieved by going into the Preferences for Playback and selecting the relevant album- or track-based option suffixed by “and prevent gain according to peak”.

Oh, I had that enabled already.  Well now I feel like a derp again.


…Did this entire thread of unnecessary worrying come around solely because you hadn’t looked around the options sufficiently?

No, the original topic was about lossless-ness being preserved when doing gain changes at 32float and then exporting to 24bit.  Turns out it's lossless if the source material is 24bit or less, but is not lossless if the source is 32float or more, even when the gain adjustment it done at 32float for both.

24bit ReplayGain on waveform file conversion?

Reply #37
Quote
Turns out it's lossless if the source material is 24bit or less
of course (and thanks to Kohlrabi for clarifying re the bit allocation of 32-bit float)

Quote
but is not lossless if the source is 32float or more, even when the gain adjustment it done at 32float for both
Was this surprising? Taking your example of an n-bit signal being adjusted to a different gain and re-saved at the same depth: This process could be lossless as in totally reversible if the original and adjusted levels and the DR had specific, mathematically favourable values. However, it should be evident as a truism that performing DSP is not lossless: one necessarily performs DSP to change a signal, not to keep it the same.

24bit ReplayGain on waveform file conversion?

Reply #38
Was this surprising?

Well it explained why when I did resampling it caused the difference between 32float and 24bit to occur, even though I started with 16bit before resampling.