diff 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
line wrap: on
line diff
--- a/resample2.c	Thu Mar 22 00:16:41 2007 +0000
+++ b/resample2.c	Thu Mar 22 00:52:49 2007 +0000
@@ -71,9 +71,10 @@
     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;
 }