aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-03-22 00:52:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-03-22 00:52:49 +0000
commit50df67d3b517c88089613458d85e2154f99ecf78 (patch)
tree655dc459ab202503ac44128b019123fe8d4a6b9f /libavcodec
parent14f887efc61e95fc5b983dbb799ad9e0be50cfe2 (diff)
downloadffmpeg-50df67d3b517c88089613458d85e2154f99ecf78.tar.gz
optimize bessel function instead of trusting gcc to do trivial optimizations (as gcc doesnt ...)
Originally committed as revision 8474 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/resample2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c
index ebda7e5a8b..70d8a1d956 100644
--- a/libavcodec/resample2.c
+++ b/libavcodec/resample2.c
@@ -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;
}