diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-01-06 22:40:52 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-01-06 22:40:52 +0000 |
commit | 2efcf292750a1bc99ae65912ee6987995314c809 (patch) | |
tree | 4032bc190b08fff3aa9a564f40d7b2ad2eb0fc04 /libavcodec/resample2.c | |
parent | 9df9b810c58829d147cfabe7f6f2e469025ca29a (diff) | |
download | ffmpeg-2efcf292750a1bc99ae65912ee6987995314c809.tar.gz |
Stop the approximation in bessel() once it does no longer improve.
This is faster.
Originally committed as revision 21038 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample2.c')
-rw-r--r-- | libavcodec/resample2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c index 31d2be7ded..52769836e0 100644 --- a/libavcodec/resample2.c +++ b/libavcodec/resample2.c @@ -76,11 +76,13 @@ typedef struct AVResampleContext{ */ 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; } |