IPB

Welcome Guest ( Log In | Register )

Wavegain vs. MP3Gain, Why the former might be better...
Jebus
post Jun 21 2003, 21:34
Post #1





Group: Developer
Posts: 1295
Joined: 17-March 03
From: Calgary, AB
Member No.: 5541



Yes, I know that MP3Gain is lossless. No, I am not talking about how MP3Gain is limited to 1.5dB steps (though this is another reason).
What I am thinking is this:

Psychoacoustic models tend to encode louder signals with more bits, right? This is why remasters (compressed) tend to use higher bitrates than older versions. Correct?

If we are then encoding a VERY LOUD album with LAME -aps for instance, then normalizing it down say 10.5dB (for a really bad one), aren't we wasting bits? Wouldn't we be able to save some bits by normalizing it down to 89dB FIRST, then encoding it?

I know wavegain is NOT LOSSLESS, but I am (incorrectly) assuming that this is just a theoretical lossiness, not a perceptible one. If this is the case, couldn't we argue that wavegained tracks will be of lower bitrates while still maintaining transparency (the goal, afterall, of -aps)?


---------------------------------
| UPDATE (May 21st, 2005) |
---------------------------------

The discussion below basically concludes that running a wavegain analysis, then applying the recommended scalefactor to lame (via the --scale switch) will save bits due to high-frequency bloat inherent in the mp3 format. Lots of people have since chosen to use this method over mp3gain, and in fact it can be automated now from within EAC using Wack, or my own Omni Encoder. Read on!

This post has been edited by Jebus: Jul 18 2006, 14:05
Go to the top of the page
+Quote Post
 
Start new topic
Replies
2Bdecided
post Jun 23 2003, 10:57
Post #2


ReplayGain developer


Group: Developer
Posts: 5171
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



In most of this thread, the real problem is only just hinted at.

Don't worry about what replay gain is doing or what scale is doing - you're not losing anything at all here when using the calculated value to set --scale in lame. Also, don't worry about what happens at the very limit: --scale 0.0 isn't possible - it's silence, and it's infinite attentuation. --scale 0.0 is less than -50dB, less than -100dB, less than -200dB, - it's -infinity dB! As such, it's misleading and irelevant. Take -100dB as the limit case: perfectly possible without loss in 32-bit floating point calculations. So, no need to worry there.

We're left with two worries: what lame does, and what happens at the 16-bit output when decoded. OK, forget the second one of these - this is always an issue with Replay Gain, and was discussed before there was even any RG software available (thanks for the quote Hanky!).


So, we have one, and only one issue: what does lame do? IIRC It supposedly looks at the "loudness" of the signal, makes some assumptions from this, and enforces a sensible absolute threshold of hearing. This is most critical for quiet tracks - if it assumed that you will never turn up the volume to hear them, then most of the audio signal is way below hearing threshold, and can be discarded. This used to happen, but people often turn up the volume, and heard problems: so (again, IIRC) for a few years now, lame has taken this into account, and shifted the ath down for quieter tracks. There's a time constant involved, and it may not be a linear process - this is why changing the volume before encoding can change the output file size. If lame were adjusting everything immediately and linearly, scaling a file in the floating point domain would make no difference at all to the resulting filesize.

There are probably other factors at work here. What worries me slightly is that lame --aps has been tuned with tracks ripped from CDs. Not with tracks ripped from CDs and then dropped by 10dB. If you get a smaller file, then by ddefinition it has less information in it. Something has been lost. The question is what? and does it matter?


Maybe it's possible to tell lame that the file has been replay gained, and that you will be listening to this track at a particular loudness - that then fixes the ath. It would be interesting to do this, so fixing the ath at the "correct" value, to see what kind of bitrates this yields.

Replay gain originally targetted 83dB. This calibration assumes that a full scale sine wave will give 103dB SPL. Most of the current implementations target 89dB. This calibration assumes that a full scale sine wave will give 97dB SPL.

I bet that lame is guessing that a full scale sine wave would give about 85-90dB SPL for highly compressed tracks. What switches can people use to turn off lame's automatic ath adjustment, and to enforce it at a level which makes sense if a full scale sine wave = 97 dB SPL?

(I'm assuming that no one will listen louder than this, and that listening quieter than this will not break the psychoacoustics. Both these assumptions are false, but so are any assumptions that assume how loud people will listen - including the current automatic one in lame - so I'm hoping this doesn't cause any problems).


John - is Wavgain using 83 or 89dB target?

Lame experts - which switches can fix the ath where we want it?

Jebus - can you try whatever gets suggested with your test track and report back please?

Dibrom/other devs = if you're reading this, can you see any way in which this would break --aps or lame in general?

Cheers,
David.
Go to the top of the page
+Quote Post

Posts in this topic
- Jebus   Wavegain vs. MP3Gain   Jun 21 2003, 21:34
- - Garf   Why not test the theory?   Jun 21 2003, 21:56
- - Jebus   Doing that right now... ETA 5min on the encode   Jun 21 2003, 22:02
- - Echizen   *lol* a new way to save bits. first decrease the v...   Jun 21 2003, 22:10
- - john33   The theory does work in practice, although I don...   Jun 21 2003, 22:12
- - M   Hmmm... I'll hazard a simple guess and say ...   Jun 21 2003, 22:13
- - Jebus   Here are the exciting results: "Mer De Noms...   Jun 21 2003, 22:20
- - HansHeijden   For mp3, it would be an idea if wavegain could pas...   Jun 21 2003, 22:22
- - Canar   QUOTE (Jebus @ Jun 21 2003 - 12:34 PM)Psychoa...   Jun 21 2003, 22:23
- - Jebus   QUOTE (HansHeijden @ Jun 21 2003 - 01:22 PM)F...   Jun 21 2003, 22:25
- - john33   QUOTE (HansHeijden @ Jun 21 2003 - 09:22 PM)F...   Jun 21 2003, 22:35
- - Jebus   QUOTE (john33 @ Jun 21 2003 - 01:35 PM)QUOTE ...   Jun 21 2003, 22:39
- - john33   QUOTE (Jebus @ Jun 21 2003 - 09:39 PM)QUOTE (...   Jun 22 2003, 00:12
- - Jebus   ah but i need to manually calculate scalefactor fr...   Jun 22 2003, 00:35
- - mrosscook   Jebus, In a problem like yours it can help to co...   Jun 22 2003, 03:48
- - westgroveg   The question of whether wavgain artifacts are perc...   Jun 22 2003, 04:03
- - Jebus   Well as it stands, I have just ripped a couple of ...   Jun 22 2003, 04:23
- - mrosscook   Westgroveq, I think it might be better to say th...   Jun 22 2003, 04:35
- - Canar   QUOTE (Jebus @ Jun 21 2003 - 07:23 PM)As reco...   Jun 22 2003, 05:14
- - Jebus   QUOTE (Canar @ Jun 21 2003 - 08:14 PM)QUOTE (...   Jun 22 2003, 05:33
- - Jebus   QUOTE (mrosscook @ Jun 21 2003 - 07:35 PM)Jeb...   Jun 22 2003, 05:37
- - indybrett   Geez... Does this mean I have to re-encode everyt...   Jun 22 2003, 06:29
- - Garf   QUOTE (Jebus @ Jun 22 2003 - 06:37 AM)(doesn...   Jun 22 2003, 08:12
- - tigre   - to avoid loss due to applying wavegain (= loweri...   Jun 22 2003, 08:16
- - Hanky   It does not surprise me that files get lower bitra...   Jun 22 2003, 11:11
- - HansHeijden   --scale is applied to float values so the lower vo...   Jun 22 2003, 11:53
- - john33   When applying the gain, WaveGain converts the inpu...   Jun 22 2003, 12:06
- - john33   QUOTE (Jebus @ Jun 21 2003 - 11:35 PM)ah but ...   Jun 22 2003, 12:45
- - M   QUOTE (john33 @ Jun 22 2003 - 06:45 AM)I just...   Jun 22 2003, 12:58
- - de Mon   May be I misunderstood something... If we are goin...   Jun 22 2003, 14:17
- - Xenno   Any non-zero value will be raised by the same amou...   Jun 22 2003, 14:39
- - mrosscook   Tigre, Hanky, HansHeijden, and John33, I don...   Jun 22 2003, 14:44
- - Hanky   After using the search function and finally realiz...   Jun 22 2003, 17:57
- - Jebus   QUOTE (john33 @ Jun 22 2003 - 03:45 AM)QUOTE ...   Jun 22 2003, 19:19
- - ibm2080   QUOTE (mrosscook @ Jun 22 2003 - 05:44 AM)Tig...   Jun 22 2003, 20:27
- - Jebus   The thing is, when you MP3gain a file down a few d...   Jun 22 2003, 20:56
- - mmortal03   QUOTE (Jebus @ Jun 22 2003 - 12:19 PM)4) sign...   Jun 22 2003, 21:08
- - Jebus   I personally can't ABX a difference, but my ea...   Jun 22 2003, 21:58
- - _Shorty   don't certain portions of the mp3 encoding pro...   Jun 23 2003, 10:10
- - 2Bdecided   In most of this thread, the real problem is only j...   Jun 23 2003, 10:57
- - john33   QUOTE (2Bdecided @ Jun 23 2003 - 09:57 AM)Joh...   Jun 23 2003, 11:10
- - ibm2080   QUOTE (2Bdecided @ Jun 23 2003 - 01:57 AM)The...   Jun 23 2003, 13:14
- - dev0   Let's just take a look at the current possibil...   Jun 23 2003, 14:45
- - 2Bdecided   QUOTE (dev0 @ Jun 23 2003 - 01:45 PM)1. Origi...   Jun 23 2003, 15:33
- - john33   These are the results from using one track only. I...   Jun 23 2003, 16:59
- - dev0   Could you please decode the test files and verify ...   Jun 23 2003, 17:07
- - tigre   QUOTE (dev0 @ Jun 23 2003 - 08:07 AM)Could yo...   Jun 23 2003, 17:22
- - mrosscook   In light of 2Bdecided's comments about the pos...   Jun 23 2003, 17:32
- - Jebus   Lets forget the actual wavegaining, as 2bdecided s...   Jun 23 2003, 18:54
- - M   From a simple numeric comparison (considering the ...   Jun 24 2003, 02:53
- - 2Bdecided   If Dibrom, JohnV, Gabriel etc etc are reading this...   Jun 24 2003, 11:52
- - john33   QUOTE (2Bdecided @ Jun 24 2003 - 10:52 AM)Fro...   Jun 24 2003, 12:16
- - 2Bdecided   Thanks john. That much I'd assumed. It's h...   Jun 24 2003, 14:58
- - ff123   QUOTE (2Bdecided @ Jun 24 2003 - 05:58 AM)Tha...   Jun 24 2003, 16:01
- - Garf   Vorbis should give identical results if scale is a...   Jun 24 2003, 16:13
- - ErikS   QUOTE (Garf @ Jun 24 2003 - 04:13 PM)Vorbis s...   Jun 24 2003, 17:15
- - /\/ephaestous   Vorbis test: CODEX:\Burn\TEST>di...   Jun 24 2003, 19:20
- - Garf   Does wavgain dither? Edit: the SCF clipping makes...   Jun 24 2003, 19:30
- - Jebus   I uploaded a bunch of samples for ABX testing on t...   Jun 24 2003, 20:04
- - sony666   My humble experiences with this topic: http://www....   Jun 24 2003, 20:20
- - john33   QUOTE (Garf @ Jun 24 2003 - 06:30 PM)Does wav...   Jun 24 2003, 20:52
- - Jebus   QUOTE (sony666 @ Jun 24 2003 - 11:20 AM)My hu...   Jun 24 2003, 21:33
- - ErikS   QUOTE (sony666 @ Jun 24 2003 - 08:20 PM)My hu...   Jun 24 2003, 21:46
- - AstralStorm   Does the -Y --scale version sound worse than --sca...   Jun 24 2003, 21:48
- - ff123   I believe the issue was adjusting the ath curve ba...   Jun 24 2003, 21:55
- - Jebus   ff123 That's a 40kbps change in total, 39kbps ...   Jun 24 2003, 22:40
- - /\/ephaestous   QUOTE (john33 @ Jun 24 2003 - 02:52 PM)QUOTE ...   Jun 25 2003, 01:56
- - ErikS   QUOTE (ff123 @ Jun 24 2003 - 09:55 PM)I belie...   Jun 25 2003, 06:08
- - mmortal03   I guess we just need to roll out some ABX tests. ...   Jun 25 2003, 10:27
- - 2Bdecided   Some answers (but not enough!)... ErikS, Re...   Jun 25 2003, 10:42
- - DickD   Finally reached the end of this thread (to date), ...   Jun 25 2003, 15:10
- - Jebus   Okay, so in summary we need people with good ears ...   Jun 25 2003, 19:12
- - Gabriel   My opinion is that if you intend to always play yo...   Jun 28 2003, 12:39
- - Garf   If it is purely an sfb21 problem, why does Vorbis ...   Jun 28 2003, 13:05
- - Garf   QUOTE (ErikS @ Jun 24 2003 - 10:46 PM)But how...   Jun 28 2003, 13:07
- - _Shorty   QUOTE (Gabriel @ Jun 28 2003 - 04:39 AM)It se...   Jun 29 2003, 03:20
- - Jebus   Thank you for your response Gabriel. I had already...   Jun 29 2003, 07:55
- - DickD   Thanks for the clarification about how the adaptiv...   Jul 1 2003, 16:36
- - mmortal03   I think it would be very worthwhile.   Jul 2 2003, 07:21
- - 2Bdecided   DickD, Life is very difficult if you have ideas, ...   Jul 2 2003, 11:12
- - john33   Give me a couple of days, or so, and I'll post...   Jul 2 2003, 11:46
- - RaWShadow   After using WaveGain, monkeys audio compress the w...   Jul 2 2003, 12:42
- - Jebus   QUOTE (RaWShadow @ Jul 2 2003 - 03:42 AM)Afte...   Jul 2 2003, 19:58
- - _Shorty   rawshadow, well, a 16bit per sample file can only ...   Jul 3 2003, 03:00
- - Jebus   QUOTE (_Shorty @ Jul 2 2003 - 06:00 PM)In oth...   Jul 3 2003, 03:50
- - Differenciam   Damn, this is a good idea.. I'm surprised no o...   Jul 3 2003, 04:08
- - mmortal03   QUOTE (john33 @ Jul 2 2003 - 04:46 AM)Give me...   Jul 3 2003, 09:58
- - flloyd   QUOTE (Differenciam @ Jul 2 2003 - 11:08 PM)D...   Jul 3 2003, 16:04
- - Jebus   QUOTE (flloyd @ Jul 3 2003 - 07:04 AM)QUOTE (...   Jul 3 2003, 17:13
- - DickD   QUOTE (john33 @ Jul 2 2003 - 11:46 AM)Give me...   Jul 3 2003, 18:11
- - john33   QUOTE (DickD @ Jul 3 2003 - 05:11 PM)@John33,...   Jul 3 2003, 18:23
- - DickD   QUOTE (john33 @ Jul 3 2003 - 06:23 PM)Yes, it...   Jul 3 2003, 19:17
- - john33   @DickD: I haven't forgotten this!!...   Jul 7 2003, 21:23
- - Mike Giacomelli   Any word? A search turned up this topic by accide...   Jul 15 2003, 04:54
- - john33   Sorry, I still intend doing this, but the weather ...   Jul 15 2003, 15:46
- - Mike Giacomelli   Thanks John. Also, I wouldn't mind the UK too...   Jul 15 2003, 23:07
- - john33   QUOTE (Mike Giacomelli @ Jul 15 2003, 10:07 P...   Jul 16 2003, 12:42
- - mmortal03   How can one compare our portable's volume outp...   Jul 17 2003, 09:57
- - DickD   QUOTE (mmortal03 @ Jul 17 2003, 09:57 AM)How ...   Jul 17 2003, 17:19
- - mmortal03   What I am getting at is the situation about losing...   Jul 18 2003, 09:07
2 Pages V   1 2 >


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st October 2014 - 05:47