HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: skamp on 2012-11-28 20:36:41

Title: Negative gains may result in slightly lower bitrates
Post by: skamp on 2012-11-28 20:36:41
I started experimenting a bit after Greynol said that he applies album gain prior to MP3 encoding. I did the same while transcoding my entire library to Vorbis (AoTuV) -q 5: the resulting files take 711 MiB less than their counterpart (gain unchanged), over a total of 27.2 GiB. That's a 2.56% gain; average bitrate went down from 161 kbps to 157 kbps.

Obviously, I got those results because most of my music gets negative Replaygain values. As far as I'm concerned, it's interesting because I'm pretty short on space on my Clip's 32 GB microsdhc card.
Title: Negative gains may result in slightly lower bitrates
Post by: greynol on 2012-11-28 20:43:25
Yes I also notice a slight decrease in average bitrate as a result of attenuating prior to encoding.

This is nothing new however:
http://www.hydrogenaudio.org/forums/index....c=10637&hl= (http://www.hydrogenaudio.org/forums/index.php?showtopic=10637&hl=)

The OP in that link is the author of Omni Encoder which, IIRC can scale prior to encoding.
http://www.hydrogenaudio.org/forums/index....c=51093&hl= (http://www.hydrogenaudio.org/forums/index.php?showtopic=51093&hl=)
Title: Negative gains may result in slightly lower bitrates
Post by: skamp on 2012-11-28 20:51:49
Thanks for that. Caudec in SVN can now do it too:
Code: [Select]
caudec -c ogg -q 5 -G album *.flac
Title: Negative gains may result in slightly lower bitrates
Post by: greynol on 2012-11-28 20:56:52
No problem.  Another benefit of scaling downwards prior to encoding is that clipping during lossy decoding can be mitigated, for those who are worried about it.
Title: Negative gains may result in slightly lower bitrates
Post by: BFG on 2012-11-28 21:05:08
I suppose that this makes sense, in that some of the quieter sections of the track will be attenuated down to (near) silence, so the lossy encoder only needs to approximate a narrower section of the audio spectrum.

EDIT: The topics that greynol links to seems to explain this quite well.  Looks like I have some reading to do
Title: Negative gains may result in slightly lower bitrates
Post by: Dynamic on 2012-11-29 01:13:26
Aside from Absolute Threshold of Hearing (ATH) models (or adaptive ATH models) being able to shed some info, it wasn't all that obvious why most codecs gained much by reducing volume given that nothing gets lost as such - it's pretty much all ratios used in psychoacoustic decisions, and the scaling is done in 32-bit floating point in virtually any codec, and really only ATH is based on absolute rather than relative loudness.

In LAME MP3 (in that first thread APS was --alt-preset standard, the old version of what's now -V2) there was a lot to gain by overcoming the sfb21 limitation of mp3 which means that bits don't need to be wasted below 16kHz - and this was demonstrated by using the -Y switch in LAME which saw scaling save only 0.5 kbps versus about 20 kbps without -Y in one example.