From 51222d104165ff7e7914dcf3ee1abc9d2f70c9cb Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 4 Jun 2009 10:37:29 +0000 Subject: cosmetics: K&R style reformatting Originally committed as revision 19088 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/acelp_filters.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'libavcodec/acelp_filters.c') diff --git a/libavcodec/acelp_filters.c b/libavcodec/acelp_filters.c index 94ec94792f..b31f301fba 100644 --- a/libavcodec/acelp_filters.c +++ b/libavcodec/acelp_filters.c @@ -25,8 +25,7 @@ #include "avcodec.h" #include "acelp_filters.h" -const int16_t ff_acelp_interp_filter[61] = -{ /* (0.15) */ +const int16_t ff_acelp_interp_filter[61] = { /* (0.15) */ 29443, 28346, 25207, 20449, 14701, 8693, 3143, -1352, -4402, -5865, -5850, -4673, -2783, -672, 1211, 2536, 3130, 2991, @@ -40,26 +39,19 @@ const int16_t ff_acelp_interp_filter[61] = 0, }; -void ff_acelp_interpolate( - int16_t* out, - const int16_t* in, - const int16_t* filter_coeffs, - int precision, - int frac_pos, - int filter_length, - int length) +void ff_acelp_interpolate(int16_t* out, const int16_t* in, + const int16_t* filter_coeffs, int precision, + int frac_pos, int filter_length, int length) { int n, i; assert(pitch_delay_frac >= 0 && pitch_delay_frac < precision); - for(n=0; n>15) != (v>>15)) + if (av_clip_int16(v >> 15) != (v >> 15)) av_log(NULL, AV_LOG_WARNING, "overflow that would need cliping in ff_acelp_interpolate()\n"); out[n] = v >> 15; } } -void ff_acelp_high_pass_filter( - int16_t* out, - int hpf_f[2], - const int16_t* in, - int length) +void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2], + const int16_t* in, int length) { int i; int tmp; - for(i=0; i>13; - tmp += (hpf_f[1]* -7667LL)>>13; + for (i = 0; i < length; i++) { + tmp = (hpf_f[0]* 15836LL) >> 13; + tmp += (hpf_f[1]* -7667LL) >> 13; tmp += 7699 * (in[i] - 2*in[i-1] + in[i-2]); /* With "+0x800" rounding, clipping is needed -- cgit v1.2.3