Regarding Lame's tuning: No its psy model does not account for any possible clippings since the information is preserved. It's up to you to source LAME with appropriate signals or to use tools like replaygain, mp3gain if you're semi-paranoid about this issue ... mp3 encoding is a lossy process so there's always the risk of clipping -- especially when your source is very loud.
My thinking here was that the tuning of the lame presets probably involved iterative feedback from experienced users. It's clear that high quality lame presets will produce files that will clip on decoding for a significant number of source files (probably a particular problem for modern pop/rock songs with lots of dynamic compression). So if this type of clipping resulted in audible artifacts on decode, users would complain about these artifacts. As a result the developers would search for settings that eliminated them. If the artifacts were caused by clipping, then the search would necessarily lead to settings that reduced or eliminated the clipping (such as pre-scaling adjustments). Ergo, the fact that the tuned lame settings still frequently produced clipping suggests that this clipping does not generally produce audible artifacts.
There are, of course, a number of ways these assumption could be wrong and as I don't really know what the tuning process entailed I wouldn't presume to claim my analysis is correct. Just thought I'd explain my reasoning... Even if I'm correct, it only speaks to the effects of clipping from a newly lame encoded mp3 file, not to effects of introducing clipping by raising the gain after the fact.
BTW, tinaa, the link to the "other" thread is to a post midawy in the thread, and IMHO not to a most brilliant part of it...
Yeah, I'm not really sure the correct way to link to other threads. I just copied the address bar from the browser window, which at the time actually was showing the first page of the thread. I suspect some of the fancy HTML code on the forum may render what's shown in the address bar outdated compared to what's in the window. Although, the graph was the point in that thread where I finally started to think I understood what was going on. Unfortunately, the originator of that thread never quite seemed to get it. Let's chalk that up to less than fluent mastery of English... In any case, my hope was that this thread would clear some of that up and be considerably shorter to wade through...
As for the headers, I think Dynamic's post really explains what's going on but I thought I'd add, reiterate some of it for clarity.
My reference to the Lame tag was probably from a misunderstanding of something I'd read. It turns out the Lame header does contain some relevant tags although they're probably not used by any other application. Here's what LameTag has to say about it:
>lametag.exe -help
LameTag - Reads the LAME tag from an mp3 file
Copyright (c) 2005 phwip
Release 0.4.1, compiled 2005-09-09
Usage: LameTag [--recursive] <filename|folder>
Wildcards are supported in the filename
<SNIP>
- The ReplayGain fields are only written by LAME version 3.94 and
higher.
- The MP3Gain field in the LAME tag is not written by any current
implementations of MP3Gain.
From a freshly encoded file with no other tags I found these tags using lametag.exe:
RG track peak: <not stored>
RG track gain: -10.1dB (determined automatically)
RG album gain: <not stored>
MP3Gain change: <none>
So there's some replaygain data put there by lame, although it's incomplete. I've verified that MP3Gain doesn't modify the lame tags in any way.
After running MP3Gains analysis, an APEv2 header is added. I used dbPoweramp to read the tags. Here's what's displayed in the MP3Gain window after undo any changes, followed by the APEv2 tags:
Volume: 99.1
clipping: Y
Track Gain: -10.5
clip(Track): N
Max Noclip Gain: -1.5
Album Volume: 97.7
Album Gain: -9.0
clip(Album): N
MP3GAIN_MINMAX: 147,255
MP3GAIN_ALBUM_MINMAX: 139,255
MP3GAIN_UNDO: +000,+000,N
REPLAYGAIN_TRACK_GAIN: -10.07000 dB
REPLAYGAIN_TRACK_PEAK: 1.153396
REPLAYGAIN_ALBUM_GAIN: -8.730000 dB
REPLAYGAIN_ALBUM_PEAK: 1.201895
Then after performing a track gain in MP3Gain:
Volume: 88.5
clipping: N
Track Gain: 0.0
clip(Track): N
Max Noclip Gain: 9.0
Album Volume: 87.2
Album Gain: 1.5
clip(Album): N
MP3GAIN_MINMAX: 140,248
MP3GAIN_ALBUM_MINMAX: 132,248
MP3GAIN_UNDO: +007,+007,N
REPLAYGAIN_TRACK_GAIN: +0.465000 dB
REPLAYGAIN_TRACK_PEAK: 0.342907
REPLAYGAIN_ALBUM_GAIN: +1.805000 dB
REPLAYGAIN_ALBUM_PEAK: 0.357326
and after performing an album gain:
Volume: 90.0
clipping: N
Track Gain: -1.5
clip(Track): N
Max Noclip Gain: 7.5
Album Volume: 88.7
Album Gain: 0.0
clip(Album): N
MP3GAIN_MINMAX: 141,249
MP3GAIN_ALBUM_MINMAX: 133,249
MP3GAIN_UNDO: +006,+006,N
REPLAYGAIN_TRACK_GAIN: -1.040000 dB
REPLAYGAIN_TRACK_PEAK: 0.407787
REPLAYGAIN_ALBUM_GAIN: +0.300000 dB
REPLAYGAIN_ALBUM_PEAK: 0.424935
So this shows, as Dynamic said, that the normalization data is stored to a higher accuracy in the replaygain tags by MP3Gain. It also shows that both track and album replaygain data as well as peak data is stored by MP3Gain. Furthermore, it shows that when MP3Gain makes any direct gain modifications to the MP3 file it updates both the MP3Gain tags and the Replaygain tags appropriately to reflect the modified file.
From some comments I've read in other threads, one might get the impression that it's necessary to redo the replaygain analysis in foobar2000 after having used MP3Gain on the same files. However, based on what's been presented in this thread, I would say that redoing the replaygain analysis in foobar2000 is completely redundant as all the same information is already accurately placed in the APEv2 tags by MP3gain. This could save a lot of time considering how long the analysis can take on a large library...
Of course, this wouldn't be true if foobar2000 can't properly read the APEv2 tags created by MP3Gain or if foobar2000 adds some extra useful information. However, so far I haven't read anything to suggest this is the case.
Thanks to everyone for participating!