Mercurial > libavcodec.hg
comparison resample2.c @ 11324:5cc6cb5167d8 libavcodec
Make av_build_filter static (and remove av_): It is not used outside resample2.c.
author | cehoyos |
---|---|
date | Sun, 28 Feb 2010 19:58:26 +0000 |
parents | 002cd0505064 |
children | 7dd2a45249a9 |
comparison
equal
deleted
inserted
replaced
11323:7089198d1d10 | 11324:5cc6cb5167d8 |
---|---|
93 * builds a polyphase filterbank. | 93 * builds a polyphase filterbank. |
94 * @param factor resampling factor | 94 * @param factor resampling factor |
95 * @param scale wanted sum of coefficients for each filter | 95 * @param scale wanted sum of coefficients for each filter |
96 * @param type 0->cubic, 1->blackman nuttall windowed sinc, 2..16->kaiser windowed sinc beta=2..16 | 96 * @param type 0->cubic, 1->blackman nuttall windowed sinc, 2..16->kaiser windowed sinc beta=2..16 |
97 */ | 97 */ |
98 void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){ | 98 static void build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){ |
99 int ph, i; | 99 int ph, i; |
100 double x, y, w, tab[tap_count]; | 100 double x, y, w, tab[tap_count]; |
101 const int center= (tap_count-1)/2; | 101 const int center= (tap_count-1)/2; |
102 | 102 |
103 /* if upsampling, only need to interpolate, no filter */ | 103 /* if upsampling, only need to interpolate, no filter */ |
187 c->phase_mask= phase_count-1; | 187 c->phase_mask= phase_count-1; |
188 c->linear= linear; | 188 c->linear= linear; |
189 | 189 |
190 c->filter_length= FFMAX((int)ceil(filter_size/factor), 1); | 190 c->filter_length= FFMAX((int)ceil(filter_size/factor), 1); |
191 c->filter_bank= av_mallocz(c->filter_length*(phase_count+1)*sizeof(FELEM)); | 191 c->filter_bank= av_mallocz(c->filter_length*(phase_count+1)*sizeof(FELEM)); |
192 av_build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, WINDOW_TYPE); | 192 build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, WINDOW_TYPE); |
193 memcpy(&c->filter_bank[c->filter_length*phase_count+1], c->filter_bank, (c->filter_length-1)*sizeof(FELEM)); | 193 memcpy(&c->filter_bank[c->filter_length*phase_count+1], c->filter_bank, (c->filter_length-1)*sizeof(FELEM)); |
194 c->filter_bank[c->filter_length*phase_count]= c->filter_bank[c->filter_length - 1]; | 194 c->filter_bank[c->filter_length*phase_count]= c->filter_bank[c->filter_length - 1]; |
195 | 195 |
196 c->src_incr= out_rate; | 196 c->src_incr= out_rate; |
197 c->ideal_dst_incr= c->dst_incr= in_rate * phase_count; | 197 c->ideal_dst_incr= c->dst_incr= in_rate * phase_count; |