Skip to content
Snippets Groups Projects
Commit 1bc873ac authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

swresample/resample: manually unroll the main loop in bessel()


About 10% faster

Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6024c865
No related branches found
No related tags found
No related merge requests found
...@@ -51,11 +51,13 @@ static double bessel(double x){ ...@@ -51,11 +51,13 @@ static double bessel(double x){
x= x*x/4; x= x*x/4;
t = x; t = x;
v = 1 + x; v = 1 + x;
for(i=1; v != lastv; i++){ for(i=1; v != lastv; i+=2){
lastv=v;
t *= x*inv[i]; t *= x*inv[i];
v += t; v += t;
av_assert2(i<99); lastv=v;
t *= x*inv[i + 1];
v += t;
av_assert2(i<98);
} }
return v; return v;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment