HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: BFG on 2012-12-13 18:24:58

Title: ReplayGain BEFORE encoding as MP3?
Post by: BFG on 2012-12-13 18:24:58
I've read elsewhere on these forums that applying ReplayGain or AlbumGain BEFORE encoding a lossless file as MP3 can slightly decrease the size of the MP3, and increase the overall quality - assuming that the dB level is reduced - because LAME then places less focus on retaining the now-quieter background noise.

I'm looking for a quick and effective way to achieve this from a technical perspective.  I'm currently ripping my entire CD collection as FLACs via EAC, and need suggestions on how to encode the same collection as MP3s that have AlbumGain applied before the transcode step, without losing any metatags or album art.  I'd prefer also to be able to split apart two-song tracks (i.e. end-of-album tracks with "hidden songs", or pregap tracks) into separate MP3s.
Title: ReplayGain BEFORE encoding as MP3?
Post by: benski on 2012-12-13 18:32:43
This is side-effect of the fact that most MP3 encoders assume a fixed low-sound-level threshold (e.g. -70dB) rather than determining a noise floor systematically through a multi-pass encoding mechanism.

Whether or not changing levels before encoding to MP3 will increase quality is debatable.  It might well do the opposite.  But it is true that it will change the output of the encoder.
Title: ReplayGain BEFORE encoding as MP3?
Post by: Dynamic on 2012-12-13 19:51:37
I've read elsewhere on these forums that applying ReplayGain or AlbumGain BEFORE encoding a lossless file as MP3 can slightly decrease the size of the MP3, and increase the overall quality - assuming that the dB level is reduced - because LAME then places less focus on retaining the now-quieter background noise.

I'm looking for a quick and effective way to achieve this from a technical perspective.  I'm currently ripping my entire CD collection as FLACs via EAC, and need suggestions on how to encode the same collection as MP3s that have AlbumGain applied before the transcode step, without losing any metatags or album art.  I'd prefer also to be able to split apart two-song tracks (i.e. end-of-album tracks with "hidden songs", or pregap tracks) into separate MP3s.


I do this myself, arguing that an MP3 encoder that can properly encode a 1990 era album at 83 to 89 dB SPL, can properly encode a 2012 album turned down to the same loudness (as I would do with my volume control anyway).

I typically use foobar2000 to scan all my lossless or lossyFLAC music.

Typically, I use foobar2000 with the Convert dialogue. I turn on ReplayGain / Apply Album Gain in the Convert... dialogue and it will pass high bit-depth (usu 24-bit) data to LAME - thus losing no audible information from the 16-bit CD on its way to LAME, which will encode at the desired loudness.

Some of the bitrate savings come from reduced sfb21 bitrate bloat, I believe. I'd imagine that saved bits here might allow greater bit reservoir elsewhere, which is the only plausible way of increasing quality aside from avoiding decode clipping.