optimize bessel function instead of trusting gcc to do trivial optimizations (as...
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2007 00:52:49 +0000 (00:52 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2007 00:52:49 +0000 (00:52 +0000)
Originally committed as revision 8474 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/resample2.c

index ebda7e5..70d8a1d 100644 (file)
@@ -71,9 +71,10 @@ static double bessel(double x){
     double t=1;
     int i;
 
+    x= x*x/4;
     for(i=1; i<50; i++){
-        t *= i;
-        v += pow(x*x/4, i)/(t*t);
+        t *= x/(i*i);
+        v += t;
     }
     return v;
 }