Mercurial > libavcodec.hg
changeset 8677:3c484b73ca73 libavcodec
ARM: optimised mid_pred()
author | mru |
---|---|
date | Tue, 27 Jan 2009 16:06:38 +0000 |
parents | 7fcf95230c28 |
children | 6c256fc075e3 |
files | arm/mathops.h |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/arm/mathops.h Tue Jan 27 16:06:34 2009 +0000 +++ b/arm/mathops.h Tue Jan 27 16:06:38 2009 +0000 @@ -90,4 +90,22 @@ #endif +#define mid_pred mid_pred +static inline av_const int mid_pred(int a, int b, int c) +{ + int m; + __asm__ volatile ( + "mov %0, %2 \n\t" + "cmp %1, %2 \n\t" + "movgt %0, %1 \n\t" + "movgt %1, %2 \n\t" + "cmp %1, %3 \n\t" + "movle %1, %3 \n\t" + "cmp %0, %1 \n\t" + "movgt %0, %1 \n\t" + : "=&r"(m), "+r"(a) + : "r"(b), "r"(c)); + return m; +} + #endif /* AVCODEC_ARM_MATHOPS_H */