Mercurial > libavcodec.hg
comparison acelp_filters.c @ 7653:155ec22a635a libavcodec
Remove mathops.h dependancy.
author | michael |
---|---|
date | Thu, 21 Aug 2008 23:25:41 +0000 |
parents | 9896f3cb1500 |
children | 3ced4fb23342 |
comparison
equal
deleted
inserted
replaced
7652:9896f3cb1500 | 7653:155ec22a635a |
---|---|
22 | 22 |
23 #include <inttypes.h> | 23 #include <inttypes.h> |
24 | 24 |
25 #include "avcodec.h" | 25 #include "avcodec.h" |
26 #include "acelp_filters.h" | 26 #include "acelp_filters.h" |
27 #define FRAC_BITS 13 | |
28 #include "mathops.h" | |
29 | 27 |
30 const int16_t ff_acelp_interp_filter[61] = | 28 const int16_t ff_acelp_interp_filter[61] = |
31 { /* (0.15) */ | 29 { /* (0.15) */ |
32 29443, 28346, 25207, 20449, 14701, 8693, | 30 29443, 28346, 25207, 20449, 14701, 8693, |
33 3143, -1352, -4402, -5865, -5850, -4673, | 31 3143, -1352, -4402, -5865, -5850, -4673, |
150 int i; | 148 int i; |
151 int tmp; | 149 int tmp; |
152 | 150 |
153 for(i=0; i<length; i++) | 151 for(i=0; i<length; i++) |
154 { | 152 { |
155 tmp = MULL(hpf_f[0], 15836); /* (14.13) = (13.13) * (1.13) */ | 153 tmp = (hpf_f[0]* 15836LL)>>13; /* (14.13) = (13.13) * (1.13) */ |
156 tmp += MULL(hpf_f[1], -7667); /* (13.13) = (13.13) * (0.13) */ | 154 tmp += (hpf_f[1]* -7667LL)>>13; /* (13.13) = (13.13) * (0.13) */ |
157 tmp += 7699 * (in[i] - 2*in[i-1] + in[i-2]); /* (14.13) = (0.13) * (14.0) */ | 155 tmp += 7699 * (in[i] - 2*in[i-1] + in[i-2]); /* (14.13) = (0.13) * (14.0) */ |
158 | 156 |
159 out[i] = av_clip_int16((tmp + 0x800) >> 12); /* (15.0) = 2 * (13.13) = (14.13) */ | 157 out[i] = av_clip_int16((tmp + 0x800) >> 12); /* (15.0) = 2 * (13.13) = (14.13) */ |
160 | 158 |
161 hpf_f[1] = hpf_f[0]; | 159 hpf_f[1] = hpf_f[0]; |