diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-13 16:38:43 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-13 16:38:43 +0400 |
commit | d8c3170c9ff81b5563eba543ff56687bcb7f5127 (patch) | |
tree | 3d99afbb09f2032ef8851736d5f4801a2ba17586 /libavcodec/celp_filters.c | |
parent | bd70a527129a1c049a8ab38236bf87f7d459df10 (diff) | |
parent | 69665bd6f40f02ecf822f80c05dd2765da2dfa7b (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
g723.1: do not pass large structs by value
g723.1: do not bounce intermediate values via memory
g723.1: declare a variable in the block it is used
g723.1: avoid saving/restoring excitation
g723.1: avoid unnecessary memcpy() in residual_interp()
g723.1: make postfilter write directly to output buffer
g723.1: drop unnecessary variable buf_ptr in formant_postfilter()
g723.1: make scale_vector() output to a separate buffer
g723.1: make autocorr_max() work on an arbitrary buffer
g723.1: do not needlessly use int64_t
g723.1: use saturating addition functions
g723.1: optimise scale_vector()
g723.1: remove useless uses of MUL64()
g723.1: remove unnecessary argument 'shift' from dot_product()
g723.1: deobfuscate "(x << 4) - x" to "15 * x"
celp: optimise ff_celp_lp_synthesis_filter()
libavutil: add saturating addition functions
cllc: Implement ARGB support
cllc: Add support for QRGB
cllc: Rename some funcs to represent what they actually do
...
Conflicts:
LICENSE
libavcodec/g723_1.c
libavcodec/x86/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/celp_filters.c')
-rw-r--r-- | libavcodec/celp_filters.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c index 8047a78452..cf2198d325 100644 --- a/libavcodec/celp_filters.c +++ b/libavcodec/celp_filters.c @@ -63,17 +63,16 @@ int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs, int i,n; for (n = 0; n < buffer_length; n++) { - int sum = rounder; + int sum = -rounder, sum1; for (i = 1; i <= filter_length; i++) - sum -= filter_coeffs[i-1] * out[n-i]; + sum += filter_coeffs[i-1] * out[n-i]; - sum = ((sum >> 12) + in[n]) >> shift; + sum1 = ((-sum >> 12) + in[n]) >> shift; + sum = av_clip_int16(sum1); + + if (stop_on_overflow && sum != sum1) + return 1; - if (sum + 0x8000 > 0xFFFFU) { - if (stop_on_overflow) - return 1; - sum = (sum >> 31) ^ 32767; - } out[n] = sum; } |