aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-10-07 17:57:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-07 18:00:58 +0200
commit1bc873acd6e15eaca8c2aebfd7dc6472b0429c50 (patch)
tree3fe511cb8d045776c07728346bc47f4907a220c5
parent6024c865ef13253b99d585a0b7fa6e21e34fb1b7 (diff)
downloadffmpeg-1bc873acd6e15eaca8c2aebfd7dc6472b0429c50.tar.gz
swresample/resample: manually unroll the main loop in bessel()
About 10% faster Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libswresample/resample.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index d6737d956a..036eff391f 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -51,11 +51,13 @@ static double bessel(double x){
x= x*x/4;
t = x;
v = 1 + x;
- for(i=1; v != lastv; i++){
- lastv=v;
+ for(i=1; v != lastv; i+=2){
t *= x*inv[i];
v += t;
- av_assert2(i<99);
+ lastv=v;
+ t *= x*inv[i + 1];
+ v += t;
+ av_assert2(i<98);
}
return v;
}