QUOTE (Xenion @ Jan 27 2003 - 02:14 PM)
i never understood this but i knew that normalization is not lossless.
whats the difference between normalization and replaygain. is replaygain good for preventing clipping ? but when a file (cd) is already clipped you can't declip it, can you ?
I would answer your question, but I've been hypnotized by your avatar....
replay gain is a method for analysing the loudness of an audio file, and storing it in the file as metadata
mp3gain takes the replay gain value, and applies a gain change to the mp3 to make the audio in the file match a particular loudness
These two are lossless because
a.) replay gain doesn't change anything about the audio - it's just a value in the header/footer of the file
b.) mp3gain changes something called the "global gain" in each frame of the mp3 - the value in each frame is changed by the same amount. so, if you keep a note of what number was added to each "global gain", you can just subtract it again, and you're back to where you started.
mp3gain isn't truly "lossless" if you don't keep a note of the amount you changed the gain, because you can't get back to where you started. However, the process doesn't introduce any rounding errors because the global gain value can only be changed in discrete 1.5dB steps.
wavgain, or any type of normalisation applied to the .wav file, is lossy, because you're working with a fixed precision (e.g. 16-bits), and every change of gain is followed by a rounding process. To change the gain, you'd multiply every sample by the same number, and then you have to round the result. However, unless you're very lucky, you can't multiply by a number, round the result, divide by the same number, round the result, and get back to where you started. You'll get approximately the same number, but it won't be exact.
replay gain usually suggests that the audio file should be quieter than it is. If this is change is carried out within the decoder (or at least before clipping or truncating the decoded samples), then any clipping that would have been introduced at the decoding stage of a lossy codec will be eliminated. It can't do anything about clipping on the original CD - it can only prevent additional clipping due to the lossy codec (e.g. mp3).
Hope this helps,
(still recovering from your avatar, but it's very nice!)
Cheers,
David.