Mercurial > libavcodec.hg
changeset 9792:05ea4942df9b libavcodec
cosmetics: K&R style reformatting
author | diego |
---|---|
date | Thu, 04 Jun 2009 10:37:29 +0000 |
parents | de4a8f76b1b9 |
children | 54456267c77c |
files | acelp_filters.c acelp_filters.h |
diffstat | 2 files changed, 17 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/acelp_filters.c Wed Jun 03 23:48:28 2009 +0000 +++ b/acelp_filters.c Thu Jun 04 10:37:29 2009 +0000 @@ -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 @@ 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<length; n++) - { + for (n = 0; n < length; n++) { int idx = 0; int v = 0x4000; - for(i=0; i<filter_length;) - { + for (i = 0; i < filter_length;) { /* The reference G.729 and AMR fixed point code performs clipping after each of the two following accumulations. @@ -75,26 +67,22 @@ i++; v += in[n - i] * filter_coeffs[idx - frac_pos]; } - if(av_clip_int16(v>>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<length; i++) - { - tmp = (hpf_f[0]* 15836LL)>>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
--- a/acelp_filters.h Wed Jun 03 23:48:28 2009 +0000 +++ b/acelp_filters.h Thu Jun 04 10:37:29 2009 +0000 @@ -51,15 +51,9 @@ * See ff_acelp_interp_filter for an example. * */ -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); /** * high-pass filtering and upscaling (4.2.5 of G.729). @@ -84,10 +78,7 @@ * fixed-point all coefficients are the same as in G.729. Thus this * routine can be used for the fixed-point AMR decoder, too. */ -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); #endif /* AVCODEC_ACELP_FILTERS_H */