Mercurial > libavcodec.hg
changeset 4699:4040ca52670a libavcodec
make kaiser windows with other beta than 16 available
author | michael |
---|---|
date | Wed, 21 Mar 2007 23:44:49 +0000 |
parents | 9fad30d1230b |
children | e210bbc7dd19 |
files | resample2.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/resample2.c Wed Mar 21 23:07:24 2007 +0000 +++ b/resample2.c Wed Mar 21 23:44:49 2007 +0000 @@ -80,7 +80,7 @@ * 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 @@ 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; }