[FFmpeg-cvslog] swr: unroll audioconvert core C function

Michael Niedermayer git at videolan.org
Fri Apr 27 05:10:41 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 27 04:53:56 2012 +0200| [bbd3dc49ffc0ae2eb3ed665652093619e360312a] | committer: Michael Niedermayer

swr: unroll audioconvert core C function

36k->32k decicycles

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libswresample/audioconvert.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c
index ba47188..7598bba 100644
--- a/libswresample/audioconvert.c
+++ b/libswresample/audioconvert.c
@@ -47,9 +47,16 @@ struct AudioConvert {
 #define CONV_FUNC(ofmt, otype, ifmt, expr)\
 static void CONV_FUNC_NAME(ofmt, ifmt)(uint8_t *po, const uint8_t *pi, int is, int os, uint8_t *end)\
 {\
-    do{\
+    uint8_t *end2 = end - 3*os;\
+    while(po < end2){\
         *(otype*)po = expr; pi += is; po += os;\
-    }while(po < end);\
+        *(otype*)po = expr; pi += is; po += os;\
+        *(otype*)po = expr; pi += is; po += os;\
+        *(otype*)po = expr; pi += is; po += os;\
+    }\
+    while(po < end){\
+        *(otype*)po = expr; pi += is; po += os;\
+    }\
 }
 
 //FIXME put things below under ifdefs so we do not waste space for cases no codec will need



More information about the ffmpeg-cvslog mailing list