diff options
author | Vikas Arora <vikasa@google.com> | 2013-01-29 16:19:32 -0800 |
---|---|---|
committer | Vikas Arora <vikasa@google.com> | 2013-02-06 12:42:45 -0800 |
commit | 4b2196c929b70f2cdc1c2556580d349db89356d8 (patch) | |
tree | 579254d51f66d5554655598d8e2d24d9732d955d /src/dsp/cpu.c | |
parent | 276905dd9bf0cffd7e04c78c95f2c1057275d5bd (diff) | |
download | webp-4b2196c929b70f2cdc1c2556580d349db89356d8.tar.gz |
Sync libwebp with head#I6ecefe33
Also added ARM/NEON code for decoder/encoder modules.
Change-Id: Ic8028037c94c1191c193d881b799a961b476138e
Diffstat (limited to 'src/dsp/cpu.c')
-rw-r--r-- | src/dsp/cpu.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/dsp/cpu.c b/src/dsp/cpu.c index 2ee7812d..bf9ae0c7 100644 --- a/src/dsp/cpu.c +++ b/src/dsp/cpu.c @@ -11,9 +11,9 @@ #include "./dsp.h" -//#if defined(__ANDROID__) -//#include <cpu-features.h> -//#endif +#if defined(__ANDROID__) +#include "./cpu-features.h" +#endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { @@ -57,17 +57,17 @@ static int x86CPUInfo(CPUFeature feature) { return 0; } VP8CPUInfo VP8GetCPUInfo = x86CPUInfo; -//#elif defined(WEBP_ANDROID_NEON) -//static int AndroidCPUInfo(CPUFeature feature) { -// const AndroidCpuFamily cpu_family = android_getCpuFamily(); -// const uint64_t cpu_features = android_getCpuFeatures(); -// if (feature == kNEON) { -// return (cpu_family == ANDROID_CPU_FAMILY_ARM && -// 0 != (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON)); -// } -// return 0; -//} -//VP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo; +#elif defined(WEBP_ANDROID_NEON) +static int AndroidCPUInfo(CPUFeature feature) { + const AndroidCpuFamily cpu_family = android_getCpuFamily(); + const uint64_t cpu_features = android_getCpuFeatures(); + if (feature == kNEON) { + return (cpu_family == ANDROID_CPU_FAMILY_ARM && + 0 != (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON)); + } + return 0; +} +VP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo; #elif defined(__ARM_NEON__) // define a dummy function to enable turning off NEON at runtime by setting // VP8DecGetCPUInfo = NULL |