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

@ -104,6 +104,15 @@ static void scale_coefficients(AC3EncodeContext *s)
}
/**
* Clip MDCT coefficients to allowable range.
*/
static void clip_coefficients(DSPContext *dsp, int32_t *coef, unsigned int len)
{
dsp->vector_clip_int32(coef, coef, COEF_MIN, COEF_MAX, len);
}
static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
{
AC3EncodeContext *s = avctx->priv_data;