[FFmpeg-cvslog] swresample/resample: manually unroll the main loop in bessel()

Michael Niedermayer git at videolan.org
Wed Oct 7 18:14:03 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Oct  7 17:57:58 2015 +0200| [1bc873acd6e15eaca8c2aebfd7dc6472b0429c50] | committer: Michael Niedermayer

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

About 10% faster

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bc873acd6e15eaca8c2aebfd7dc6472b0429c50
---

 libswresample/resample.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index d6737d9..036eff3 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;
 }



More information about the ffmpeg-cvslog mailing list