Originally committed as revision 19088 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -25,8 +25,7 @@ |
| 25 | 25 |
#include "avcodec.h" |
| 26 | 26 |
#include "acelp_filters.h" |
| 27 | 27 |
|
| 28 |
-const int16_t ff_acelp_interp_filter[61] = |
|
| 29 |
-{ /* (0.15) */
|
|
| 28 |
+const int16_t ff_acelp_interp_filter[61] = { /* (0.15) */
|
|
| 30 | 29 |
29443, 28346, 25207, 20449, 14701, 8693, |
| 31 | 30 |
3143, -1352, -4402, -5865, -5850, -4673, |
| 32 | 31 |
-2783, -672, 1211, 2536, 3130, 2991, |
| ... | ... |
@@ -40,26 +39,19 @@ const int16_t ff_acelp_interp_filter[61] = |
| 40 | 40 |
0, |
| 41 | 41 |
}; |
| 42 | 42 |
|
| 43 |
-void ff_acelp_interpolate( |
|
| 44 |
- int16_t* out, |
|
| 45 |
- const int16_t* in, |
|
| 46 |
- const int16_t* filter_coeffs, |
|
| 47 |
- int precision, |
|
| 48 |
- int frac_pos, |
|
| 49 |
- int filter_length, |
|
| 50 |
- int length) |
|
| 43 |
+void ff_acelp_interpolate(int16_t* out, const int16_t* in, |
|
| 44 |
+ const int16_t* filter_coeffs, int precision, |
|
| 45 |
+ int frac_pos, int filter_length, int length) |
|
| 51 | 46 |
{
|
| 52 | 47 |
int n, i; |
| 53 | 48 |
|
| 54 | 49 |
assert(pitch_delay_frac >= 0 && pitch_delay_frac < precision); |
| 55 | 50 |
|
| 56 |
- for(n=0; n<length; n++) |
|
| 57 |
- {
|
|
| 51 |
+ for (n = 0; n < length; n++) {
|
|
| 58 | 52 |
int idx = 0; |
| 59 | 53 |
int v = 0x4000; |
| 60 | 54 |
|
| 61 |
- for(i=0; i<filter_length;) |
|
| 62 |
- {
|
|
| 55 |
+ for (i = 0; i < filter_length;) {
|
|
| 63 | 56 |
|
| 64 | 57 |
/* The reference G.729 and AMR fixed point code performs clipping after |
| 65 | 58 |
each of the two following accumulations. |
| ... | ... |
@@ -75,26 +67,22 @@ void ff_acelp_interpolate( |
| 75 | 75 |
i++; |
| 76 | 76 |
v += in[n - i] * filter_coeffs[idx - frac_pos]; |
| 77 | 77 |
} |
| 78 |
- if(av_clip_int16(v>>15) != (v>>15)) |
|
| 78 |
+ if (av_clip_int16(v >> 15) != (v >> 15)) |
|
| 79 | 79 |
av_log(NULL, AV_LOG_WARNING, "overflow that would need cliping in ff_acelp_interpolate()\n"); |
| 80 | 80 |
out[n] = v >> 15; |
| 81 | 81 |
} |
| 82 | 82 |
} |
| 83 | 83 |
|
| 84 | 84 |
|
| 85 |
-void ff_acelp_high_pass_filter( |
|
| 86 |
- int16_t* out, |
|
| 87 |
- int hpf_f[2], |
|
| 88 |
- const int16_t* in, |
|
| 89 |
- int length) |
|
| 85 |
+void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2], |
|
| 86 |
+ const int16_t* in, int length) |
|
| 90 | 87 |
{
|
| 91 | 88 |
int i; |
| 92 | 89 |
int tmp; |
| 93 | 90 |
|
| 94 |
- for(i=0; i<length; i++) |
|
| 95 |
- {
|
|
| 96 |
- tmp = (hpf_f[0]* 15836LL)>>13; |
|
| 97 |
- tmp += (hpf_f[1]* -7667LL)>>13; |
|
| 91 |
+ for (i = 0; i < length; i++) {
|
|
| 92 |
+ tmp = (hpf_f[0]* 15836LL) >> 13; |
|
| 93 |
+ tmp += (hpf_f[1]* -7667LL) >> 13; |
|
| 98 | 94 |
tmp += 7699 * (in[i] - 2*in[i-1] + in[i-2]); |
| 99 | 95 |
|
| 100 | 96 |
/* With "+0x800" rounding, clipping is needed |
| ... | ... |
@@ -51,15 +51,9 @@ extern const int16_t ff_acelp_interp_filter[61]; |
| 51 | 51 |
* See ff_acelp_interp_filter for an example. |
| 52 | 52 |
* |
| 53 | 53 |
*/ |
| 54 |
-void ff_acelp_interpolate( |
|
| 55 |
- int16_t* out, |
|
| 56 |
- const int16_t* in, |
|
| 57 |
- const int16_t* filter_coeffs, |
|
| 58 |
- int precision, |
|
| 59 |
- int frac_pos, |
|
| 60 |
- int filter_length, |
|
| 61 |
- int length); |
|
| 62 |
- |
|
| 54 |
+void ff_acelp_interpolate(int16_t* out, const int16_t* in, |
|
| 55 |
+ const int16_t* filter_coeffs, int precision, |
|
| 56 |
+ int frac_pos, int filter_length, int length); |
|
| 63 | 57 |
|
| 64 | 58 |
/** |
| 65 | 59 |
* high-pass filtering and upscaling (4.2.5 of G.729). |
| ... | ... |
@@ -84,10 +78,7 @@ void ff_acelp_interpolate( |
| 84 | 84 |
* fixed-point all coefficients are the same as in G.729. Thus this |
| 85 | 85 |
* routine can be used for the fixed-point AMR decoder, too. |
| 86 | 86 |
*/ |
| 87 |
-void ff_acelp_high_pass_filter( |
|
| 88 |
- int16_t* out, |
|
| 89 |
- int hpf_f[2], |
|
| 90 |
- const int16_t* in, |
|
| 91 |
- int length); |
|
| 87 |
+void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2], |
|
| 88 |
+ const int16_t* in, int length); |
|
| 92 | 89 |
|
| 93 | 90 |
#endif /* AVCODEC_ACELP_FILTERS_H */ |