diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-03-22 02:44:49 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-03-22 02:44:49 +0300 |
commit | 20cf58c32bda10537960048f4218fc50b803a1e9 (patch) | |
tree | 7f3fd898a94389945da67461c29fe77612ffa308 /libavcodec/resample2.c | |
parent | f88e7c833b17cbc8fef3e26dd14844231720138e (diff) |
make kaiser windows with other beta than 16 available
Originally committed as revision 8472 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample2.c')
-rw-r--r-- | libavcodec/resample2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c index 84221f4d65..10e98e580e 100644 --- a/libavcodec/resample2.c +++ b/libavcodec/resample2.c @@ -80,7 +80,7 @@ static double bessel(double x){ * builds a polyphase filterbank. * @param factor resampling factor * @param scale wanted sum of coefficients for each filter - * @param type 0->cubic, 1->blackman nuttall windowed sinc, 2->kaiser windowed sinc beta=16 + * @param type 0->cubic, 1->blackman nuttall windowed sinc, 2..16->kaiser windowed sinc beta=2..16 */ void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){ int ph, i, v; @@ -108,9 +108,9 @@ void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_coun w = 2.0*x / (factor*tap_count) + M_PI; y *= 0.3635819 - 0.4891775 * cos(w) + 0.1365995 * cos(2*w) - 0.0106411 * cos(3*w); break; - case 2: + default: w = 2.0*x / (factor*tap_count*M_PI); - y *= bessel(16*sqrt(FFMAX(1-w*w, 0))); + y *= bessel(type*sqrt(FFMAX(1-w*w, 0))); break; } |