Mercurial > libavcodec.hg
comparison resample2.c @ 4701:5fa551fb7640 libavcodec
optimize bessel function instead of trusting gcc to do trivial optimizations (as gcc doesnt ...)
| author | michael |
|---|---|
| date | Thu, 22 Mar 2007 00:52:49 +0000 |
| parents | e210bbc7dd19 |
| children | a8794f26ea98 |
comparison
equal
deleted
inserted
replaced
| 4700:e210bbc7dd19 | 4701:5fa551fb7640 |
|---|---|
| 69 static double bessel(double x){ | 69 static double bessel(double x){ |
| 70 double v=1; | 70 double v=1; |
| 71 double t=1; | 71 double t=1; |
| 72 int i; | 72 int i; |
| 73 | 73 |
| 74 x= x*x/4; | |
| 74 for(i=1; i<50; i++){ | 75 for(i=1; i<50; i++){ |
| 75 t *= i; | 76 t *= x/(i*i); |
| 76 v += pow(x*x/4, i)/(t*t); | 77 v += t; |
| 77 } | 78 } |
| 78 return v; | 79 return v; |
| 79 } | 80 } |
| 80 | 81 |
| 81 /** | 82 /** |
