aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3enc_fixed.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_fixed.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_fixed.c')
-rw-r--r--libavcodec/ac3enc_fixed.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c
index d55720eb80..ea3a46cdfa 100644
--- a/libavcodec/ac3enc_fixed.c
+++ b/libavcodec/ac3enc_fixed.c
@@ -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;