[vlc-commits] src/misc: added runtime NEON detection code for Android

Felix Paul Kühne git at videolan.org
Tue Jul 31 18:52:11 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Jul 26 22:25:49 2012 -0300| [af0cf9fbfa5ae9d65b06e870460c633488f80c05] | committer: Felix Paul Kühne

src/misc: added runtime NEON detection code for Android

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

 src/misc/cpu.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/misc/cpu.c b/src/misc/cpu.c
index 9f605ec..089f891 100644
--- a/src/misc/cpu.c
+++ b/src/misc/cpu.c
@@ -49,6 +49,9 @@
 #ifdef __APPLE__
 #include <sys/sysctl.h>
 #endif
+#ifdef __ANDROID__
+#include <cpu-features.h>
+#endif
 
 #if defined(__OpenBSD__) && defined(__powerpc__)
 #include <sys/param.h>
@@ -316,6 +319,11 @@ out:
 #elif defined ( __arm__)
     #ifdef __ARM_NEON__
         i_capabilities |= CPU_CAPABILITY_NEON;
+    #elif defined (CAN_COMPILE_NEON)
+        #ifdef __ANDROID__
+            if (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON)
+                i_capabilities |= CPU_CAPABILITY_NEON;
+        #endif
     #endif
 #endif
 



More information about the vlc-commits mailing list