Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4699a6a4 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Clean up USE_NEON to make it easier to disable NEON for benchmarking

Bug: 27242871
Change-Id: I30ba8bfe55885cde531706c760ec27e593d7f8b3
parent 262c39e3
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,9 @@ LOCAL_SHARED_LIBRARIES := \


LOCAL_MODULE := libaudioresampler
LOCAL_MODULE := libaudioresampler


# uncomment to disable NEON on architectures that actually do support NEON, for benchmarking
#LOCAL_CFLAGS += -DUSE_NEON=false

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)


include $(call all-makefiles-under,$(LOCAL_PATH))
include $(call all-makefiles-under,$(LOCAL_PATH))
+5 −1
Original line number Original line Diff line number Diff line
@@ -26,11 +26,15 @@ namespace android {
#endif
#endif


#if defined(__aarch64__) || defined(__ARM_NEON__)
#if defined(__aarch64__) || defined(__ARM_NEON__)
#ifndef USE_NEON
#define USE_NEON (true)
#define USE_NEON (true)
#include <arm_neon.h>
#endif
#else
#else
#define USE_NEON (false)
#define USE_NEON (false)
#endif
#endif
#if USE_NEON
#include <arm_neon.h>
#endif


template<typename T, typename U>
template<typename T, typename U>
struct is_same
struct is_same
+8 −4
Original line number Original line Diff line number Diff line
@@ -43,10 +43,14 @@
#endif
#endif


#if defined(__aarch64__) || defined(__ARM_NEON__)
#if defined(__aarch64__) || defined(__ARM_NEON__)
#include <arm_neon.h>
#ifndef USE_NEON
#define USE_NEON
#define USE_NEON (true)
#endif
#else
#else
#undef USE_NEON
#define USE_NEON (false)
#endif
#if USE_NEON
#include <arm_neon.h>
#endif
#endif


#define UNUSED(x) ((void)(x))
#define UNUSED(x) ((void)(x))
@@ -417,7 +421,7 @@ void AudioResamplerSinc::filterCoefficient(int32_t* out, uint32_t phase,


    size_t count = offset;
    size_t count = offset;


#ifndef USE_NEON
#if !USE_NEON
    int32_t l = 0;
    int32_t l = 0;
    int32_t r = 0;
    int32_t r = 0;
    for (size_t i=0 ; i<count ; i++) {
    for (size_t i=0 ; i<count ; i++) {