On Friday, March 21, 2003, at 11:43 PM, Andre wrote:
The reason you find a difference in the PCM output has to do with the fact that the synthetically created Huffman data in turn causes overflow conditions in the subsequent IMDCT calculations due to MAD's limited fixed-point representation.
Would it perhaps be better to clip at less than full scale during requantisation ?? This would reduce the chance of overflow in the IMDCT routine (which potentially corrupts far more data).
There are many reasons not to. Subband samples above full scale may just as well be canceled during IMDCT rather than overflow. Also the mere time required to check each sample would affect performance.
I intentionally avoid clipping at any point during the decoding process so that the decision to clip can be left to the application. That's why I leave 3 dB of headroom in the PCM sample format, so signals slightly above full scale can still be accurately represented.
In any case, I've never seen samples wildly beyond full scale occur in practice. The actual signal described by the test bitstream in question is nearly 18 dB above full scale. That bitstream is synthetic, and I doubt any real signal (with 0 dB maximum peak) could be encoded in such a way as to peak anywhere near 18 dB when decoded.