aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g723_1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-10 16:19:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-10 16:25:23 +0200
commit18b0c39f99eee508107c47345494e535b8757434 (patch)
treeb1418e52aab2f1fb8a171c3bb3fada3c7b0df531 /libavcodec/g723_1.c
parentd9d0c1ccc3df39fecbbbb6b600c18542741c5a51 (diff)
parent05c36e0e5fbf0b75dbbbd327ad2f6a62992f9262 (diff)
downloadffmpeg-18b0c39f99eee508107c47345494e535b8757434.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: g723.1: fix addition overflow g723.1: simplify and fix multiplication overflow g723.1: deobfuscate an expression g723.1: remove unused #includes ARM: add missing "cc" clobber in av_clipl_int32_arm() rtmp: Factorize the code by adding handle_invoke_error rtmp: Factorize the code by adding handle_invoke_status rtmp: Factorize the code by adding handle_invoke_result libavutil: remove unused av_abort() macro ffmenc: replace if/abort with assert() libavutil: drop offsetof() fallback definition libavutil: drop fallback definitions of INTxx_MIN/MAX configure: Check for a sctp struct instead of just the header configure: suncc: Add -xc99 to dependency flags, required on Solaris doxygen: Fix function parameter names to match the code doc: Drop obsolete shared libs cflags hint to workaround Cygwin gcc bugs swf: Move shared table out of the header file swf: Move swf_audio_codec_tags table to the only place it is used fate: add G.723.1 decoder tests Conflicts: configure doc/platform.texi libavformat/Makefile libavutil/arm/intmath.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/g723_1.c')
-rw-r--r--libavcodec/g723_1.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index dcf285db1e..c4016f8112 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -35,7 +35,6 @@
#include "acelp_vectors.h"
#include "celp_filters.h"
#include "celp_math.h"
-#include "lsp.h"
#include "g723_1_data.h"
typedef struct g723_1_context {
@@ -924,7 +923,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
signal_ptr = filter_signal + LPC_ORDER;
for (i = 0; i < SUBFRAMES; i++) {
int16_t temp_vector[SUBFRAME_LEN];
- int16_t temp;
+ int temp;
int auto_corr[2];
int scale, energy;
@@ -943,13 +942,12 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
if (temp) {
temp = (auto_corr[0] >> 2) / temp;
}
- p->reflection_coef = ((p->reflection_coef << 2) - p->reflection_coef +
- temp + 2) >> 2;
- temp = (p->reflection_coef * 0xffffc >> 3) & 0xfffc;
+ p->reflection_coef = (3 * p->reflection_coef + temp + 2) >> 2;
+ temp = -p->reflection_coef >> 1 & ~3;
/* Compensation filter */
for (j = 0; j < SUBFRAME_LEN; j++) {
- buf_ptr[j] = av_clipl_int32(signal_ptr[j] +
+ buf_ptr[j] = av_clipl_int32((int64_t)signal_ptr[j] +
((signal_ptr[j - 1] >> 16) *
temp << 1)) >> 16;
}