[FFmpeg-cvslog] libavutil: Add ARM av_clip_intp2_arm

Peter Meerwald git at videolan.org
Sat Feb 21 11:23:33 CET 2015


ffmpeg | branch: master | Peter Meerwald <pmeerw at pmeerw.net> | Fri Feb 20 01:35:34 2015 +0100| [76ce9bd8e26dcb3652240a1072840ff4011d7cdc] | committer: Luca Barbato

libavutil: Add ARM av_clip_intp2_arm

add ARM code for implementing av_clip_intp2 using the ssat instruction

on Cortex-A8, av_clip_intp2_arm() is faster than av_clip_intp2_c() and
the generic av_clip(), about -19%

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavutil/arm/intmath.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavutil/arm/intmath.h b/libavutil/arm/intmath.h
index 56fcdb3..2b15ba0 100644
--- a/libavutil/arm/intmath.h
+++ b/libavutil/arm/intmath.h
@@ -62,6 +62,14 @@ static av_always_inline av_const int av_clip_int16_arm(int a)
     return x;
 }
 
+#define av_clip_intp2 av_clip_intp2_arm
+static av_always_inline av_const int av_clip_intp2_arm(int a, int p)
+{
+    unsigned x;
+    __asm__ ("ssat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p+1));
+    return x;
+}
+
 #define av_clip_uintp2 av_clip_uintp2_arm
 static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
 {



More information about the ffmpeg-cvslog mailing list