Anthony Airon Oetzmann airon@gmx.net wrote:
A fairly serious quality question here. I'd like the encoder to scale back
the volume of the output before it gets decoded. The reason is that too many
encoded files clip when decoded.
I'm assuming you mean you'd like the *decoder* to scale back the volume? As
soon as you have an MP3 file the encoder is out of the picture.
I'd like to suggest a way to do this without mucking about in the actual
decoding code. It's the way the Waves Renaissance EQ handles it. It actualy
calculates with a headroom and at a higher bitresolution. It is able to
accuratly tell me how many dB I'm overshooting my output.
MAD already does something similar. Output samples are actually calculated
internally with 29 bits of precision, with 3 extra bits of "headroom" for
decoded samples that exceed full scale.
What I'd like the MAD plugin to do is have a control setting that tells it
to pull x dB out of the final signal, before it gets CUT OFF at the 0dB Full
Scale, and sent to the output plugin. I'd suggest a default setting of -2
dB. Perhaps even a clip indicator, if this is possible to display in some
way in the Winamp window or another window(on/off switch in prefs).
This might be possible. Scaling the output is easy to do, and wouldn't lose
any quality because the internal samples are 32-bit values. A clip indicator
might also be easy to add. The trick will be for the user to find an
appropriate setting.
Some of you may not hear this revolting distortion. Well I do, and it don't
sound good folks. Some songs are mastered to already CLIP on the CD, though
they keep that clipped signal below 0dB, as not to make the CD production
plant mad(no more than 5 clipping samples on an entire CD is a RED BOOK
standard provision where clipped -> 0dB I guess).
Do you hear clipping even with MAD? I ask because MAD doesn't clip the same
way other decoders do.
The problem with almost any damn plugin out there is that the volume in fact
can only be changed AFTER decoding. Calculating perhaps with 24 + 2 bits
would perhaps be advisable, buy I'll leave that to you guys.
I think what you mean is that the volume can typically only be changed after
samples have been clipped and scaled to the output resolution (e.g. 16 bits);
"decoding" in my mind doesn't include this step. The output of decoding in MAD
is 32-bit samples that can be further manipulated without loss of quality
before clipping, scaling, and dithering to the output resolution.
If there is consensus among other MAD users, I will consider adding something
like this to monitor the amount of clipping and perhaps allow the user to
attenuate the signal before output samples are produced.
What do people think?
--
Rob Leslie
rob@mars.org