Mercurial > libavcodec.hg
comparison resample2.c @ 2308:de38526a1f3f libavcodec
user selectble cutoff frequency
| author | michael |
|---|---|
| date | Thu, 21 Oct 2004 21:07:40 +0000 |
| parents | df3e4a8e6aac |
| children | 424e6b29de74 |
comparison
equal
deleted
inserted
replaced
| 2307:df3e4a8e6aac | 2308:de38526a1f3f |
|---|---|
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * initalizes a audio resampler. | 130 * initalizes a audio resampler. |
| 131 * note, if either rate is not a integer then simply scale both rates up so they are | 131 * note, if either rate is not a integer then simply scale both rates up so they are |
| 132 */ | 132 */ |
| 133 AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear){ | 133 AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){ |
| 134 AVResampleContext *c= av_mallocz(sizeof(AVResampleContext)); | 134 AVResampleContext *c= av_mallocz(sizeof(AVResampleContext)); |
| 135 double factor= FFMIN(out_rate / (double)in_rate, 1.0); | 135 double factor= FFMIN(out_rate * cutoff / in_rate, 1.0); |
| 136 int phase_count= 1<<phase_shift; | 136 int phase_count= 1<<phase_shift; |
| 137 | 137 |
| 138 memset(c, 0, sizeof(AVResampleContext)); | 138 memset(c, 0, sizeof(AVResampleContext)); |
| 139 | 139 |
| 140 c->phase_shift= phase_shift; | 140 c->phase_shift= phase_shift; |
