From 523b7eba19590652b7ba19c5bdd85dd257bfe4f7 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Mon, 27 Jun 2011 14:29:33 -0400 Subject: ac3enc: clip coefficients after MDCT. This ensures that any processing between the MDCT and exponent extraction will be using clipped coefficients. --- libavcodec/ac3enc_float.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libavcodec/ac3enc_float.c') diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index 12d6b19241..718cc1f2b2 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -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", -- cgit v1.2.3