Flaw in ReplayGain spec
Flaw in ReplayGain spec
May 12 2002, 11:04
Group: Developer (Donating)
Joined: 24-September 01
Member No.: 13
It occured to me today that there is a problem with the current ReplayGain spec, or rather, my proposal for doing it in Vorbis.
The issue is combining replaygain and clipping prevention.
If applying the replaygain would cause the track to clip, clipping prevention kicks in, and reduces the level. This will make the output loudness different from the ideal, 'equal' level.
When running in radio/track mode, there is no way around this, since you don't know in advance what you are going to encounter. The best you can do is set the default level low enough so you can hope it'll never happen. I believe this was the idea (among possibly other things) behind setting the default level to K-20 in the new MPC decoders? (Frank? )
If the implementation in the current Vorbis players is correct, a similar effect can be reached by setting the preamp in the plugin to -6dB or so.
In album gain, you could avoid this from happening for the entire album you're listening to, since you already ReplayGain-processed them in group and thus know what is coming up, however, my current proposal poses problems for doing this: You would need to read in all files that belong to the album, read in the peak values, and remember the largest, and use that as the peak value for the individual tracks.
This is what I originally envisioned, however, looking back, this is both ugly, cumbersome and it may not even be possible in some player/plugin architectures.
I think the correct solution would probably be to store an album-peak value.
It would be trivial to implement in the ReplayGain tools, and require only minimal changes in the players without all the uglyness the current method would require (which isn't done correctly by anyone anyway).
The disadvantage is that it requires another tag. However, since the Vorbis people seem to have gotten a bit more enthousiastic about ReplayGain lately, perhaps that isn't so much of a problem.
I believe it's valuable to do this, as it may post a real problem in practise. Moreover, the proposal as it is now is broken by design in this regard, and I'd prefer to fix it while it's still fixable.
Also, the ReplayGain proposal on David's site doesn't mention anything about this? Is there another way to address this problem?
There's two other issues with the current spec that I'd like to discuss about while it's still possible.
1) Change RG_* into REPLAYGAIN_*
This was proposed by Segher, with the idea that someone looking at the tags and that doesn't know what they are can at least google to find out, whereas you'd be left clueless with the current 'RG'. I think this idea is valuable and good.
2) Source/version tag
I didn't include one originally because I saw no way to keep it consistent if you allow the user to edit the tags (you can't require them to know the spec...), and because I didn't see the RG calculations being improved for quite a while. Unfortunately, Frank Klemm has already proven me wrong on the latter. I don't see a way to make such a tag actually _work_ though.
I'd like feedback from everyone about all of this. Is it worthwhile to change the current proposal and fix some of the above issues?
May 21 2002, 22:19
Joined: 8-May 02
From: Philadelphia, PA
Member No.: 1994
"I don't feel it justified to call the current proposal quick-n-dirty. The vorbis implemenation predates your involvement with Xiph and it is based on the by now quite matured work of David Robinson. It's a complete solution with as only drawback that the data is not stored in the best place imaginable - forcedly so, since there is no other place for now and for the time to come."
I didn't mean to imply that RG was quick-and-dirty, only the proposed implementation. This is a common theme, I'm finding. People assume that I don't like RG, that I think it's useless, that I've never tried it, etc. Balderdash. My primary concern is that the current proposed implementation puts data where data don't belong.
Let me repeat this again. I don't have a problem with replaygain. I think it's useful. My problem is not with the methodology used to do what it does, my problem is that the proposed implementation does not jive with our standard.
And one more time, for those who missed it. I think that replaygain serves a powerful and useful purpose. My problem is not with what it does or what need it serves, my problem lies in the proposed implementation.
I hope that's clear now.
There is a tremendous amount of work that needs to be done, and this particular issue is driving me to distraction. At the end of the day, I have to look at our mission statement and see where things fit. It's my job to facilitate and manage the creation, production and maintenance of Open Multimedia. That's my primary concern.
I feel that a lot of people don't recognize this, and they bang on the 'I want my favorite feature implemented right now' door, with little concern that there may be other things that are simply more important. They're like the Comic Book Guy on the Simpsons. If we don't implement what they want right away, it's 'Worst Codec Ever.'
I feel fairly secure that at the end of the day, the people who really want this feature will implement it themselves, for themselves. After all, they've been doing it for a while now already. This is great, but there is a driving desire to see RG implemented on a much larger scale. That's okay, and definitely understandable (it's useful), but it's not my primary objective.
CEO, Xiph.org Foundation
|Lo-Fi Version||Time is now: 28th November 2015 - 11:04|