aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3enc_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-11 20:17:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-11 20:39:20 +0200
commitd912e449b655797407a75527380c566955b71a8e (patch)
tree392b432edecba4d8a714da69dc123900d43b5be9 /libavcodec/ac3enc_template.c
parent961a1a81d88a05afabb895f8a9dd11e789a07d89 (diff)
parentc766eb1ce1edb3ad03472b78c21e42c543b04937 (diff)
downloadffmpeg-d912e449b655797407a75527380c566955b71a8e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: ac3enc: add macros for option names to make them more understandable. ac3enc: fix 'channel_coupling' option to actually allow 'auto'. cavs: fix some crashes with invalid bitstreams ac3enc: clip coupling coordinates during calculation Remove incorrect info in documentation of AVCodecContext.bits_per_raw_sample. lavc: fix parentheses placement in avcodec_open2(). Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3enc_template.c')
-rw-r--r--libavcodec/ac3enc_template.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index 7a6d72ff48..943a55a133 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -126,7 +126,7 @@ static inline float calc_cpl_coord(float energy_ch, float energy_cpl)
float coord = 0.125;
if (energy_cpl > 0)
coord *= sqrtf(energy_ch / energy_cpl);
- return coord;
+ return FFMIN(coord, COEF_MAX);
}
@@ -291,7 +291,6 @@ static void apply_channel_coupling(AC3EncodeContext *s)
if (!block->cpl_in_use)
continue;
- clip_coefficients(&s->dsp, cpl_coords[blk][1], s->fbw_channels * 16);
s->ac3dsp.float_to_fixed24(fixed_cpl_coords[blk][1],
cpl_coords[blk][1],
s->fbw_channels * 16);