ac3enc: clip coefficients after MDCT.

This ensures that any processing between the MDCT and exponent extraction will
be using clipped coefficients.
This commit is contained in:
Justin Ruggles
2011-06-27 14:29:33 -04:00
parent 6054cd25b4
commit 523b7eba19
4 changed files with 35 additions and 3 deletions

View File

@@ -111,6 +111,15 @@ static void scale_coefficients(AC3EncodeContext *s)
}
/**
* Clip MDCT coefficients to allowable range.
*/
static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
{
dsp->vector_clipf(coef, coef, COEF_MIN, COEF_MAX, len);
}
#if CONFIG_AC3_ENCODER
AVCodec ff_ac3_encoder = {
"ac3",