aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3enc_float.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-06-27 14:29:33 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-07-01 13:02:11 -0400
commit523b7eba19590652b7ba19c5bdd85dd257bfe4f7 (patch)
treeb5d326ff4d73740275cae5bf623eabcbee692cb6 /libavcodec/ac3enc_float.c
parent6054cd25b4d7dce97c4fa3cc6e4757ba1e59ab86 (diff)
downloadffmpeg-523b7eba19590652b7ba19c5bdd85dd257bfe4f7.tar.gz
ac3enc: clip coefficients after MDCT.
This ensures that any processing between the MDCT and exponent extraction will be using clipped coefficients.
Diffstat (limited to 'libavcodec/ac3enc_float.c')
-rw-r--r--libavcodec/ac3enc_float.c9
1 files changed, 9 insertions, 0 deletions
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",