mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
Android: only build dec_neon with NEON support
Defining LOCAL_ARM_NEON = true can result in neon instructions being used in portions unprotected by the cpu check. This changes defines a WEBP_USE_NEON/WEBP_ANDROID_NEON pair similar to the SSE2 code and MSVC. Change-Id: Ifac010b06e42c73d5aca529baa2198c6796674bd
This commit is contained in:
@ -57,7 +57,7 @@ static int x86CPUInfo(CPUFeature feature) {
|
||||
return 0;
|
||||
}
|
||||
VP8CPUInfo VP8GetCPUInfo = x86CPUInfo;
|
||||
#elif defined(__ANDROID__)
|
||||
#elif defined(WEBP_ANDROID_NEON)
|
||||
static int AndroidCPUInfo(CPUFeature feature) {
|
||||
const AndroidCpuFamily cpu_family = android_getCpuFamily();
|
||||
const uint64_t cpu_features = android_getCpuFeatures();
|
||||
|
@ -719,7 +719,7 @@ void VP8DspInit(void) {
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
VP8DspInitSSE2();
|
||||
}
|
||||
#elif defined(__GNUC__) && defined(__ARM_NEON__)
|
||||
#elif defined(WEBP_USE_NEON)
|
||||
if (VP8GetCPUInfo(kNEON)) {
|
||||
VP8DspInitNEON();
|
||||
}
|
||||
|
@ -10,7 +10,9 @@
|
||||
// Authors: Somnath Banerjee (somnath@google.com)
|
||||
// Johann Koenig (johannkoenig@google.com)
|
||||
|
||||
#if defined(__GNUC__) && defined(__ARM_NEON__)
|
||||
#include "./dsp.h"
|
||||
|
||||
#if defined(WEBP_USE_NEON)
|
||||
|
||||
#include "../dec/vp8i.h"
|
||||
|
||||
@ -324,4 +326,4 @@ void VP8DspInitNEON(void) {
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // __GNUC__ && __ARM_NEON__
|
||||
#endif // WEBP_USE_NEON
|
||||
|
@ -29,6 +29,14 @@ extern "C" {
|
||||
#define WEBP_USE_SSE2
|
||||
#endif
|
||||
|
||||
#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
|
||||
#define WEBP_ANDROID_NEON // Android targets that might support NEON
|
||||
#endif
|
||||
|
||||
#if defined(__ARM_NEON__) || defined(WEBP_ANDROID_NEON)
|
||||
#define WEBP_USE_NEON
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
kSSE2,
|
||||
kSSE3,
|
||||
|
Reference in New Issue
Block a user