Wavegain vs. MP3Gain, Why the former might be better... |
Wavegain vs. MP3Gain, Why the former might be better... |
Jun 21 2003, 21:34
Post
#1
|
|
|
Group: Developer Posts: 1289 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 |
|
|
|
![]() |
Jun 25 2003, 15:10
Post
#2
|
|
|
Group: Members Posts: 265 Joined: 12-January 03 Member No.: 4542 |
Finally reached the end of this thread (to date), and glad to see that sfb21 has been found to be the culprit, as I'd been starting to suspect. I agree with 2Bdecided about how the sfb21 problem manifests itself. It's a common misperception that the extra bits are wasted as 16kHz+, when in fact they're wasted on <16 kHz content if certain things happen in the 16kHz+ content that requires the workaround to maintain quality.
This is my educated guess as to what's happening: By chance, john33 picked a track where the sfb21 issue wasn't causing much bitrate bloat in normal APS (without the -Y), so it wasn't much higher in the version with no --scale applied. Jebus picked an album where the sfb21 issue was causing bloat in APS at full volume, but wasn't at lower volume. As 2Bdecided said, there is no scalefactor for 16 kHz+ (sfb21) so the global scalefactor has to be used. If the scale required to get fine enough quantization in sfb21 doesn't match the existing global scalefactor, the workaround is to adjust the global scalefactor, which then causes more bits to be used to encode all the other spectral bands (sfb0 to sfb20). This forces all other bands to be quantized more finely than the masking threshold requires, so wastes bits in encoding detail in the <16 kHz area that is inaudible. (Encoders like Musepack and Vorbis don't have this sfb21 issue, so there's less difference - perhaps a fraction due to the way the adaptive ATH works). It so happens that the --scale version doesn't need such a big change in the global scalefactor, so it doesn't get forced to waste bits on masked (inaudible) detail in bands 0-20 just to get the quantization noise in sfb21 low enough to go below the masking threshold. Probably an analysis with mp3x graphical frame analyzer could help to verify whether this is true or not. So, providing the psychoacoustics are correct about the masking threshold for <16 kHz components of the signal, the lower bitrate file should sound just as transparent as the high bitrate file that has been mp3gained (or had RG in Foobar2000 or similar). So, if I'm correct, then only for cases where sfb21 bitrate bloat is happening, one should obtain just as good transparency with the smaller file (much closer to Musepack --standard --xlevel bitrates and APS - Y bitrates) when compared to the original lossless file with replaygain applied (even if played back on a 24-bit system, where the noise floor doesn't rise under ReplayGain, because LAME isn't forced to encode inaudible details just to get around the lack of sfb21 scalefactor. Mind you, can this be right? If so, it implies that one could obtain just as low a bitrate without affecting the original volume by using, for example, --scale 0.5 to obtain -6.0 dB volume change in the encode step then applying a corrective mp3gain Constant Gain of +6.0 dB after encoding (or use anything else that edits the global gain, like mp3DirectCut) to restore the original volume. If so, surely Lame APS would already use --scale accompanied with an opposite adjustment of the global gain value, like mp3gain, as a more efficient workaround for the sfb21 issue, and could apply it to individual frames of the MP3 where the bloat occurs. The only exception is if it doesn't work for changes in 1.5 dB steps, but only happens to work for some values between the steps of the global gain, or that the times when it works can't be predicted by LAME (though LAME is well aware of when the bloat is occuring, because the -Y switch lets it ignore the +16 kHz content at those times instead of implementing the bloat-inducing workaround for the lack of sfb21 scalefactor). In that case, perhaps some files would become MORE bloated when --scale is applied. Hmm, I think we need a Lame VBR expert to help here. Wouldn't it be awesome if full-bandwidth LAME APS could be 20-30 kbps smaller without sounding any less transparent or breaking the MP3 standard! I'm just suspecting there's something to stop it working like that, or it would have been done before. This post has been edited by DickD: Jun 25 2003, 15:12 |
|
|
|
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
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![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 07:08 |