diff resample2.c @ 10778:002cd0505064 libavcodec

Stop the approximation in bessel() once it does no longer improve. This is faster.
author michael
date Wed, 06 Jan 2010 22:40:52 +0000
parents fff66291d84d
children 5cc6cb5167d8
line wrap: on
line diff
--- a/resample2.c	Wed Jan 06 21:51:20 2010 +0000
+++ b/resample2.c	Wed Jan 06 22:40:52 2010 +0000
@@ -76,11 +76,13 @@
  */
 static double bessel(double x){
     double v=1;
+    double lastv=0;
     double t=1;
     int i;
 
     x= x*x/4;
-    for(i=1; i<50; i++){
+    for(i=1; v != lastv; i++){
+        lastv=v;
         t *= x/(i*i);
         v += t;
     }