aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-27 04:53:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-27 05:05:20 +0200
commitbbd3dc49ffc0ae2eb3ed665652093619e360312a (patch)
tree6fbc1dc5e24ae507b6a839d8c14141030b4526ec
parent4119fa702327f6f46d9d8a7411455f5850255a3b (diff)
downloadffmpeg-bbd3dc49ffc0ae2eb3ed665652093619e360312a.tar.gz
swr: unroll audioconvert core C function
36k->32k decicycles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswresample/audioconvert.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c
index ba47188bb3..7598bba05d 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