Clear ARM NEON flag

Merge WEBRTC_ARCH_ARM64_NEON and WEBRTC_ARCH_ARM_NEON into one
WEBRTC_HAS_NEON.
Replace WEBRTC_DETECT_ARM_NEON by WEBRTC_DETECT_NEON.
Replace WEBRTC_ARCH_ARM by WEBRTC_ARCH_ARM64 for arm64 cpu.

BUG=4002
R=andrew@webrtc.org, jridges@masque.com, kjellander@webrtc.org

Change-Id: I870a4d0682b80633b671c9aab733153f6d95a980

Review URL: https://webrtc-codereview.appspot.com/49309004

Cr-Commit-Position: refs/heads/master@{#9228}
This commit is contained in:
Andrew MacDonald 2015-05-19 22:20:17 -07:00
parent 4d71edef45
commit cb7f8ce2df
31 changed files with 95 additions and 133 deletions

View File

@ -113,13 +113,8 @@ config("common_config") {
} }
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
defines += [ "WEBRTC_ARCH_ARM" ] defines += [ "WEBRTC_ARCH_ARM64" ]
# TODO(zhongwei) Defining an unique WEBRTC_NEON and defines += [ "WEBRTC_HAS_NEON" ]
# distinguishing ARMv7 NEON and ARM64 NEON by
# WEBRTC_ARCH_ARM_V7 and WEBRTC_ARCH_ARM64 should be better.
# This macro is used to distinguish ARMv7 NEON and ARM64 NEON
defines += [ "WEBRTC_ARCH_ARM64_NEON" ]
} }
if (current_cpu == "arm") { if (current_cpu == "arm") {
@ -127,9 +122,9 @@ config("common_config") {
if (arm_version >= 7) { if (arm_version >= 7) {
defines += [ "WEBRTC_ARCH_ARM_V7" ] defines += [ "WEBRTC_ARCH_ARM_V7" ]
if (arm_use_neon) { if (arm_use_neon) {
defines += [ "WEBRTC_ARCH_ARM_NEON" ] defines += [ "WEBRTC_HAS_NEON" ]
} else if (is_android) { } else if (arm_optionally_use_neon) {
defines += [ "WEBRTC_DETECT_ARM_NEON" ] defines += [ "WEBRTC_DETECT_NEON" ]
} }
} }
} }

View File

@ -260,13 +260,8 @@
}], }],
['target_arch=="arm64"', { ['target_arch=="arm64"', {
'defines': [ 'defines': [
'WEBRTC_ARCH_ARM', 'WEBRTC_ARCH_ARM64',
# TODO(zhongwei) Defining an unique WEBRTC_NEON and 'WEBRTC_HAS_NEON',
# distinguishing ARMv7 NEON and ARM64 NEON by
# WEBRTC_ARCH_ARM_V7 and WEBRTC_ARCH_ARM64 should be better.
# This macro is used to distinguish ARMv7 NEON and ARM64 NEON
'WEBRTC_ARCH_ARM64_NEON',
], ],
}], }],
['target_arch=="arm"', { ['target_arch=="arm"', {
@ -278,10 +273,10 @@
'defines': ['WEBRTC_ARCH_ARM_V7',], 'defines': ['WEBRTC_ARCH_ARM_V7',],
'conditions': [ 'conditions': [
['arm_neon==1', { ['arm_neon==1', {
'defines': ['WEBRTC_ARCH_ARM_NEON',], 'defines': ['WEBRTC_HAS_NEON',],
}], }],
['arm_neon==0 and OS=="android"', { ['arm_neon==0 and arm_neon_optional==1', {
'defines': ['WEBRTC_DETECT_ARM_NEON',], 'defines': ['WEBRTC_DETECT_NEON',],
}], }],
], ],
}], }],

View File

@ -57,19 +57,16 @@ FIRFilter* FIRFilter::Create(const float* coefficients,
filter = new FIRFilterC(coefficients, coefficients_length); filter = new FIRFilterC(coefficients, coefficients_length);
} }
#endif #endif
#elif defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) #elif defined(WEBRTC_HAS_NEON)
#if defined(WEBRTC_ARCH_ARM_NEON)
filter = filter =
new FIRFilterNEON(coefficients, coefficients_length, max_input_length); new FIRFilterNEON(coefficients, coefficients_length, max_input_length);
#else #elif defined(WEBRTC_DETECT_NEON)
// ARM CPU detection required.
if (WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) { if (WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) {
filter = filter =
new FIRFilterNEON(coefficients, coefficients_length, max_input_length); new FIRFilterNEON(coefficients, coefficients_length, max_input_length);
} else { } else {
filter = new FIRFilterC(coefficients, coefficients_length); filter = new FIRFilterC(coefficients, coefficients_length);
} }
#endif
#else #else
filter = new FIRFilterC(coefficients, coefficients_length); filter = new FIRFilterC(coefficients, coefficients_length);
#endif #endif

View File

@ -128,20 +128,15 @@ void SincResampler::InitializeCPUSpecificFeatures() {
convolve_proc_ = WebRtc_GetCPUInfo(kSSE2) ? Convolve_SSE : Convolve_C; convolve_proc_ = WebRtc_GetCPUInfo(kSSE2) ? Convolve_SSE : Convolve_C;
} }
#endif #endif
#elif defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) #elif defined(WEBRTC_HAS_NEON)
#if defined(WEBRTC_ARCH_ARM_NEON)
#define CONVOLVE_FUNC Convolve_NEON #define CONVOLVE_FUNC Convolve_NEON
void SincResampler::InitializeCPUSpecificFeatures() {} void SincResampler::InitializeCPUSpecificFeatures() {}
#else #elif defined(WEBRTC_DETECT_NEON)
// ARM CPU detection required. Function will be set by
// InitializeCPUSpecificFeatures().
#define CONVOLVE_FUNC convolve_proc_ #define CONVOLVE_FUNC convolve_proc_
void SincResampler::InitializeCPUSpecificFeatures() { void SincResampler::InitializeCPUSpecificFeatures() {
convolve_proc_ = WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON ? convolve_proc_ = WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON ?
Convolve_NEON : Convolve_C; Convolve_NEON : Convolve_C;
} }
#endif
#else #else
// Unknown architecture. // Unknown architecture.
#define CONVOLVE_FUNC Convolve_C #define CONVOLVE_FUNC Convolve_C

View File

@ -107,7 +107,7 @@ class SincResampler {
static float Convolve_SSE(const float* input_ptr, const float* k1, static float Convolve_SSE(const float* input_ptr, const float* k1,
const float* k2, const float* k2,
double kernel_interpolation_factor); double kernel_interpolation_factor);
#elif defined(WEBRTC_ARCH_ARM_V7) || defined(WEBRTC_ARCH_ARM64_NEON) #elif defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
static float Convolve_NEON(const float* input_ptr, const float* k1, static float Convolve_NEON(const float* input_ptr, const float* k1,
const float* k2, const float* k2,
double kernel_interpolation_factor); double kernel_interpolation_factor);

View File

@ -105,9 +105,9 @@ extern "C" {
#include "webrtc/common_audio/signal_processing/include/spl_inl.h" #include "webrtc/common_audio/signal_processing/include/spl_inl.h"
// Initialize SPL. Currently it contains only function pointer initialization. // Initialize SPL. Currently it contains only function pointer initialization.
// If the underlying platform is known to be ARM-Neon (WEBRTC_ARCH_ARM_NEON // If the underlying platform is known to be ARM-Neon (WEBRTC_HAS_NEON defined),
// defined), the pointers will be assigned to code optimized for Neon; otherwise // the pointers will be assigned to code optimized for Neon; otherwise
// if run-time Neon detection (WEBRTC_DETECT_ARM_NEON) is enabled, the pointers // if run-time Neon detection (WEBRTC_DETECT_NEON) is enabled, the pointers
// will be assigned to either Neon code or generic C code; otherwise, generic C // will be assigned to either Neon code or generic C code; otherwise, generic C
// code will be assigned. // code will be assigned.
// Note that this function MUST be called in any application that uses SPL // Note that this function MUST be called in any application that uses SPL
@ -154,8 +154,7 @@ void WebRtcSpl_ZerosArrayW32(int32_t* vector,
typedef int16_t (*MaxAbsValueW16)(const int16_t* vector, int length); typedef int16_t (*MaxAbsValueW16)(const int16_t* vector, int length);
extern MaxAbsValueW16 WebRtcSpl_MaxAbsValueW16; extern MaxAbsValueW16 WebRtcSpl_MaxAbsValueW16;
int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, int length); int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int16_t WebRtcSpl_MaxAbsValueW16Neon(const int16_t* vector, int length); int16_t WebRtcSpl_MaxAbsValueW16Neon(const int16_t* vector, int length);
#endif #endif
#if defined(MIPS32_LE) #if defined(MIPS32_LE)
@ -173,8 +172,7 @@ int16_t WebRtcSpl_MaxAbsValueW16_mips(const int16_t* vector, int length);
typedef int32_t (*MaxAbsValueW32)(const int32_t* vector, int length); typedef int32_t (*MaxAbsValueW32)(const int32_t* vector, int length);
extern MaxAbsValueW32 WebRtcSpl_MaxAbsValueW32; extern MaxAbsValueW32 WebRtcSpl_MaxAbsValueW32;
int32_t WebRtcSpl_MaxAbsValueW32C(const int32_t* vector, int length); int32_t WebRtcSpl_MaxAbsValueW32C(const int32_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int32_t WebRtcSpl_MaxAbsValueW32Neon(const int32_t* vector, int length); int32_t WebRtcSpl_MaxAbsValueW32Neon(const int32_t* vector, int length);
#endif #endif
#if defined(MIPS_DSP_R1_LE) #if defined(MIPS_DSP_R1_LE)
@ -194,8 +192,7 @@ int32_t WebRtcSpl_MaxAbsValueW32_mips(const int32_t* vector, int length);
typedef int16_t (*MaxValueW16)(const int16_t* vector, int length); typedef int16_t (*MaxValueW16)(const int16_t* vector, int length);
extern MaxValueW16 WebRtcSpl_MaxValueW16; extern MaxValueW16 WebRtcSpl_MaxValueW16;
int16_t WebRtcSpl_MaxValueW16C(const int16_t* vector, int length); int16_t WebRtcSpl_MaxValueW16C(const int16_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int16_t WebRtcSpl_MaxValueW16Neon(const int16_t* vector, int length); int16_t WebRtcSpl_MaxValueW16Neon(const int16_t* vector, int length);
#endif #endif
#if defined(MIPS32_LE) #if defined(MIPS32_LE)
@ -215,8 +212,7 @@ int16_t WebRtcSpl_MaxValueW16_mips(const int16_t* vector, int length);
typedef int32_t (*MaxValueW32)(const int32_t* vector, int length); typedef int32_t (*MaxValueW32)(const int32_t* vector, int length);
extern MaxValueW32 WebRtcSpl_MaxValueW32; extern MaxValueW32 WebRtcSpl_MaxValueW32;
int32_t WebRtcSpl_MaxValueW32C(const int32_t* vector, int length); int32_t WebRtcSpl_MaxValueW32C(const int32_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int32_t WebRtcSpl_MaxValueW32Neon(const int32_t* vector, int length); int32_t WebRtcSpl_MaxValueW32Neon(const int32_t* vector, int length);
#endif #endif
#if defined(MIPS32_LE) #if defined(MIPS32_LE)
@ -236,8 +232,7 @@ int32_t WebRtcSpl_MaxValueW32_mips(const int32_t* vector, int length);
typedef int16_t (*MinValueW16)(const int16_t* vector, int length); typedef int16_t (*MinValueW16)(const int16_t* vector, int length);
extern MinValueW16 WebRtcSpl_MinValueW16; extern MinValueW16 WebRtcSpl_MinValueW16;
int16_t WebRtcSpl_MinValueW16C(const int16_t* vector, int length); int16_t WebRtcSpl_MinValueW16C(const int16_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int16_t WebRtcSpl_MinValueW16Neon(const int16_t* vector, int length); int16_t WebRtcSpl_MinValueW16Neon(const int16_t* vector, int length);
#endif #endif
#if defined(MIPS32_LE) #if defined(MIPS32_LE)
@ -257,8 +252,7 @@ int16_t WebRtcSpl_MinValueW16_mips(const int16_t* vector, int length);
typedef int32_t (*MinValueW32)(const int32_t* vector, int length); typedef int32_t (*MinValueW32)(const int32_t* vector, int length);
extern MinValueW32 WebRtcSpl_MinValueW32; extern MinValueW32 WebRtcSpl_MinValueW32;
int32_t WebRtcSpl_MinValueW32C(const int32_t* vector, int length); int32_t WebRtcSpl_MinValueW32C(const int32_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int32_t WebRtcSpl_MinValueW32Neon(const int32_t* vector, int length); int32_t WebRtcSpl_MinValueW32Neon(const int32_t* vector, int length);
#endif #endif
#if defined(MIPS32_LE) #if defined(MIPS32_LE)
@ -558,8 +552,7 @@ void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
int16_t dim_cross_correlation, int16_t dim_cross_correlation,
int16_t right_shifts, int16_t right_shifts,
int16_t step_seq2); int16_t step_seq2);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
void WebRtcSpl_CrossCorrelationNeon(int32_t* cross_correlation, void WebRtcSpl_CrossCorrelationNeon(int32_t* cross_correlation,
const int16_t* seq1, const int16_t* seq1,
const int16_t* seq2, const int16_t* seq2,
@ -724,8 +717,7 @@ int WebRtcSpl_DownsampleFastC(const int16_t* data_in,
int coefficients_length, int coefficients_length,
int factor, int factor,
int delay); int delay);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in, int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
int data_in_length, int data_in_length,
int16_t* data_out, int16_t* data_out,

View File

@ -28,8 +28,8 @@ CrossCorrelation WebRtcSpl_CrossCorrelation;
DownsampleFast WebRtcSpl_DownsampleFast; DownsampleFast WebRtcSpl_DownsampleFast;
ScaleAndAddVectorsWithRound WebRtcSpl_ScaleAndAddVectorsWithRound; ScaleAndAddVectorsWithRound WebRtcSpl_ScaleAndAddVectorsWithRound;
#if (defined(WEBRTC_DETECT_ARM_NEON) || !defined(WEBRTC_ARCH_ARM_NEON)) && \ #if (defined(WEBRTC_DETECT_NEON) || !defined(WEBRTC_HAS_NEON)) && \
!defined(MIPS32_LE) && !defined(WEBRTC_ARCH_ARM64_NEON) !defined(MIPS32_LE)
/* Initialize function pointers to the generic C version. */ /* Initialize function pointers to the generic C version. */
static void InitPointersToC() { static void InitPointersToC() {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16C; WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16C;
@ -45,8 +45,7 @@ static void InitPointersToC() {
} }
#endif #endif
#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) || \ #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
/* Initialize function pointers to the Neon version. */ /* Initialize function pointers to the Neon version. */
static void InitPointersToNeon() { static void InitPointersToNeon() {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16Neon; WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16Neon;
@ -57,8 +56,6 @@ static void InitPointersToNeon() {
WebRtcSpl_MinValueW32 = WebRtcSpl_MinValueW32Neon; WebRtcSpl_MinValueW32 = WebRtcSpl_MinValueW32Neon;
WebRtcSpl_CrossCorrelation = WebRtcSpl_CrossCorrelationNeon; WebRtcSpl_CrossCorrelation = WebRtcSpl_CrossCorrelationNeon;
WebRtcSpl_DownsampleFast = WebRtcSpl_DownsampleFastNeon; WebRtcSpl_DownsampleFast = WebRtcSpl_DownsampleFastNeon;
/* TODO(henrik.lundin): re-enable NEON when the crash from bug 3243 is
understood. */
WebRtcSpl_ScaleAndAddVectorsWithRound = WebRtcSpl_ScaleAndAddVectorsWithRound =
WebRtcSpl_ScaleAndAddVectorsWithRoundC; WebRtcSpl_ScaleAndAddVectorsWithRoundC;
} }
@ -87,19 +84,19 @@ static void InitPointersToMIPS() {
#endif #endif
static void InitFunctionPointers(void) { static void InitFunctionPointers(void) {
#if defined(WEBRTC_DETECT_ARM_NEON) #if defined(WEBRTC_DETECT_NEON)
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
InitPointersToNeon(); InitPointersToNeon();
} else { } else {
InitPointersToC(); InitPointersToC();
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON) #elif defined(WEBRTC_HAS_NEON)
InitPointersToNeon(); InitPointersToNeon();
#elif defined(MIPS32_LE) #elif defined(MIPS32_LE)
InitPointersToMIPS(); InitPointersToMIPS();
#else #else
InitPointersToC(); InitPointersToC();
#endif /* WEBRTC_DETECT_ARM_NEON */ #endif /* WEBRTC_DETECT_NEON */
} }
#if defined(WEBRTC_POSIX) #if defined(WEBRTC_POSIX)

View File

@ -90,8 +90,7 @@ void WebRtcIsacfix_Spec2TimeC(int16_t* inreQ7,
int32_t* outre1Q16, int32_t* outre1Q16,
int32_t* outre2Q16); int32_t* outre2Q16);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
void WebRtcIsacfix_Time2SpecNeon(int16_t* inre1Q9, void WebRtcIsacfix_Time2SpecNeon(int16_t* inre1Q9,
int16_t* inre2Q9, int16_t* inre2Q9,
int16_t* outre, int16_t* outre,
@ -175,8 +174,7 @@ void WebRtcIsacfix_FilterMaLoopC(int16_t input0,
int32_t* ptr1, int32_t* ptr1,
int32_t* ptr2); int32_t* ptr2);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
int WebRtcIsacfix_AutocorrNeon(int32_t* __restrict r, int WebRtcIsacfix_AutocorrNeon(int32_t* __restrict r,
const int16_t* __restrict x, const int16_t* __restrict x,
int16_t N, int16_t N,

View File

@ -147,8 +147,7 @@ void WebRtcIsacfix_MatrixProduct2C(const int16_t matrix0[],
const int matrix0_index_factor, const int matrix0_index_factor,
const int matrix0_index_step); const int matrix0_index_step);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
void WebRtcIsacfix_MatrixProduct1Neon(const int16_t matrix0[], void WebRtcIsacfix_MatrixProduct1Neon(const int16_t matrix0[],
const int32_t matrix1[], const int32_t matrix1[],
int32_t matrix_product[], int32_t matrix_product[],

View File

@ -63,9 +63,8 @@ void WebRtcIsacfix_AllpassFilter2FixDec16C(
// Disable AllpassFilter2FixDec16Neon function due to a clang bug. // Disable AllpassFilter2FixDec16Neon function due to a clang bug.
// Refer more details at: // Refer more details at:
// https://code.google.com/p/webrtc/issues/detail?id=4567 // https://code.google.com/p/webrtc/issues/detail?id=4567
#if !(defined __clang__) #if !defined(__clang__) || !defined(WEBRTC_ARCH_ARM64)
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \ #if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
void WebRtcIsacfix_AllpassFilter2FixDec16Neon( void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
int16_t *data_ch1, int16_t *data_ch1,
int16_t *data_ch2, int16_t *data_ch2,

View File

@ -68,12 +68,12 @@ TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) {
// Disable AllpassFilter2FixDec16Neon function due to a clang bug. // Disable AllpassFilter2FixDec16Neon function due to a clang bug.
// Refer more details at: // Refer more details at:
// https://code.google.com/p/webrtc/issues/detail?id=4567 // https://code.google.com/p/webrtc/issues/detail?id=4567
#if !(defined __clang__) #if !(defined __clang__) || !defined(WEBRTC_ARCH_ARM64)
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon); CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) #elif defined(WEBRTC_HAS_NEON)
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon); CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
#endif #endif
#endif #endif

View File

@ -59,11 +59,11 @@ class FiltersTest : public testing::Test {
TEST_F(FiltersTest, AutocorrFixTest) { TEST_F(FiltersTest, AutocorrFixTest) {
FiltersTester(WebRtcIsacfix_AutocorrC); FiltersTester(WebRtcIsacfix_AutocorrC);
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
FiltersTester(WebRtcIsacfix_AutocorrNeon); FiltersTester(WebRtcIsacfix_AutocorrNeon);
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) #elif defined(WEBRTC_HAS_NEON)
FiltersTester(WebRtcIsacfix_AutocorrNeon); FiltersTester(WebRtcIsacfix_AutocorrNeon);
#endif #endif
} }

View File

@ -198,8 +198,7 @@ int16_t WebRtcIsacfix_FreeInternal(ISACFIX_MainStruct *ISAC_main_inst)
* This function initializes function pointers for ARM Neon platform. * This function initializes function pointers for ARM Neon platform.
*/ */
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON) || \ #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
(defined WEBRTC_ARCH_ARM64_NEON)
static void WebRtcIsacfix_InitNeon(void) { static void WebRtcIsacfix_InitNeon(void) {
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon; WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon;
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon; WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon;
@ -208,7 +207,7 @@ static void WebRtcIsacfix_InitNeon(void) {
// Disable AllpassFilter2FixDec16Neon function due to a clang bug. // Disable AllpassFilter2FixDec16Neon function due to a clang bug.
// Refer more details at: // Refer more details at:
// https://code.google.com/p/webrtc/issues/detail?id=4567 // https://code.google.com/p/webrtc/issues/detail?id=4567
#if !(defined __clang__) #if !defined(__clang__) || !defined(WEBRTC_ARCH_ARM64)
WebRtcIsacfix_AllpassFilter2FixDec16 = WebRtcIsacfix_AllpassFilter2FixDec16 =
WebRtcIsacfix_AllpassFilter2FixDec16Neon; WebRtcIsacfix_AllpassFilter2FixDec16Neon;
#endif #endif
@ -334,11 +333,11 @@ int16_t WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
WebRtcIsacfix_MatrixProduct1 = WebRtcIsacfix_MatrixProduct1C; WebRtcIsacfix_MatrixProduct1 = WebRtcIsacfix_MatrixProduct1C;
WebRtcIsacfix_MatrixProduct2 = WebRtcIsacfix_MatrixProduct2C; WebRtcIsacfix_MatrixProduct2 = WebRtcIsacfix_MatrixProduct2C;
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
WebRtcIsacfix_InitNeon(); WebRtcIsacfix_InitNeon();
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON) #elif defined(WEBRTC_HAS_NEON)
WebRtcIsacfix_InitNeon(); WebRtcIsacfix_InitNeon();
#endif #endif

View File

@ -9,11 +9,6 @@
*/ */
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h"
#ifdef WEBRTC_ARCH_ARM_NEON
#include <arm_neon.h>
#endif
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/system_wrappers/interface/compile_assert_c.h" #include "webrtc/system_wrappers/interface/compile_assert_c.h"

View File

@ -10,7 +10,7 @@
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h"
#ifdef WEBRTC_ARCH_ARM_NEON #ifdef WEBRTC_HAS_NEON
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
@ -56,7 +56,10 @@ void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) {
ysum32 -= in[k - 1] * in[k - 1] >> scaling; ysum32 -= in[k - 1] * in[k - 1] >> scaling;
ysum32 += in[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1] >> ysum32 += in[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1] >>
scaling; scaling;
#ifdef WEBRTC_ARCH_ARM_NEON
// TODO(zhongwei.yao): Move this function into a separate NEON code file so
// that WEBRTC_DETECT_NEON could take advantage of it.
#ifdef WEBRTC_HAS_NEON
{ {
int32_t vbuff[4]; int32_t vbuff[4];
int32x4_t int_32x4_sum = vmovq_n_s32(0); int32x4_t int_32x4_sum = vmovq_n_s32(0);

View File

@ -175,22 +175,22 @@ class TransformTest : public testing::Test {
TEST_F(TransformTest, Time2SpecTest) { TEST_F(TransformTest, Time2SpecTest) {
Time2SpecTester(WebRtcIsacfix_Time2SpecC); Time2SpecTester(WebRtcIsacfix_Time2SpecC);
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
Time2SpecTester(WebRtcIsacfix_Time2SpecNeon); Time2SpecTester(WebRtcIsacfix_Time2SpecNeon);
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) #elif defined(WEBRTC_HAS_NEON)
Time2SpecTester(WebRtcIsacfix_Time2SpecNeon); Time2SpecTester(WebRtcIsacfix_Time2SpecNeon);
#endif #endif
} }
TEST_F(TransformTest, Spec2TimeTest) { TEST_F(TransformTest, Spec2TimeTest) {
Spec2TimeTester(WebRtcIsacfix_Spec2TimeC); Spec2TimeTester(WebRtcIsacfix_Spec2TimeC);
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon); Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon);
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) #elif defined(WEBRTC_HAS_NEON)
Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon); Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon);
#endif #endif
} }

View File

@ -555,7 +555,7 @@ class AcmReceiverBitExactness : public ::testing::Test {
}; };
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_8kHzOutput DISABLED_8kHzOutput #define MAYBE_8kHzOutput DISABLED_8kHzOutput
#else #else
#define MAYBE_8kHzOutput 8kHzOutput #define MAYBE_8kHzOutput 8kHzOutput
@ -568,7 +568,7 @@ TEST_F(AcmReceiverBitExactness, MAYBE_8kHzOutput) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_16kHzOutput DISABLED_16kHzOutput #define MAYBE_16kHzOutput DISABLED_16kHzOutput
#else #else
#define MAYBE_16kHzOutput 16kHzOutput #define MAYBE_16kHzOutput 16kHzOutput
@ -581,7 +581,7 @@ TEST_F(AcmReceiverBitExactness, MAYBE_16kHzOutput) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_32kHzOutput DISABLED_32kHzOutput #define MAYBE_32kHzOutput DISABLED_32kHzOutput
#else #else
#define MAYBE_32kHzOutput 32kHzOutput #define MAYBE_32kHzOutput 32kHzOutput
@ -594,7 +594,7 @@ TEST_F(AcmReceiverBitExactness, MAYBE_32kHzOutput) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_48kHzOutput DISABLED_48kHzOutput #define MAYBE_48kHzOutput DISABLED_48kHzOutput
#else #else
#define MAYBE_48kHzOutput 48kHzOutput #define MAYBE_48kHzOutput 48kHzOutput
@ -760,7 +760,7 @@ class AcmSenderBitExactness : public ::testing::Test,
}; };
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_IsacWb30ms DISABLED_IsacWb30ms #define MAYBE_IsacWb30ms DISABLED_IsacWb30ms
#else #else
#define MAYBE_IsacWb30ms IsacWb30ms #define MAYBE_IsacWb30ms IsacWb30ms
@ -780,7 +780,7 @@ TEST_F(AcmSenderBitExactness, MAYBE_IsacWb30ms) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_IsacWb60ms DISABLED_IsacWb60ms #define MAYBE_IsacWb60ms DISABLED_IsacWb60ms
#else #else
#define MAYBE_IsacWb60ms IsacWb60ms #define MAYBE_IsacWb60ms IsacWb60ms
@ -944,7 +944,7 @@ TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(G722_stereo_20ms)) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_Opus_stereo_20ms DISABLED_Opus_stereo_20ms #define MAYBE_Opus_stereo_20ms DISABLED_Opus_stereo_20ms
#else #else
#define MAYBE_Opus_stereo_20ms Opus_stereo_20ms #define MAYBE_Opus_stereo_20ms Opus_stereo_20ms

View File

@ -750,7 +750,7 @@ class AcmReceiverBitExactnessOldApi : public ::testing::Test {
}; };
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_8kHzOutput DISABLED_8kHzOutput #define MAYBE_8kHzOutput DISABLED_8kHzOutput
#else #else
#define MAYBE_8kHzOutput 8kHzOutput #define MAYBE_8kHzOutput 8kHzOutput
@ -763,7 +763,7 @@ TEST_F(AcmReceiverBitExactnessOldApi, MAYBE_8kHzOutput) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_16kHzOutput DISABLED_16kHzOutput #define MAYBE_16kHzOutput DISABLED_16kHzOutput
#else #else
#define MAYBE_16kHzOutput 16kHzOutput #define MAYBE_16kHzOutput 16kHzOutput
@ -776,7 +776,7 @@ TEST_F(AcmReceiverBitExactnessOldApi, MAYBE_16kHzOutput) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_32kHzOutput DISABLED_32kHzOutput #define MAYBE_32kHzOutput DISABLED_32kHzOutput
#else #else
#define MAYBE_32kHzOutput 32kHzOutput #define MAYBE_32kHzOutput 32kHzOutput
@ -789,7 +789,7 @@ TEST_F(AcmReceiverBitExactnessOldApi, MAYBE_32kHzOutput) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_48kHzOutput DISABLED_48kHzOutput #define MAYBE_48kHzOutput DISABLED_48kHzOutput
#else #else
#define MAYBE_48kHzOutput 48kHzOutput #define MAYBE_48kHzOutput 48kHzOutput
@ -976,7 +976,7 @@ class AcmSenderBitExactnessOldApi : public ::testing::Test,
}; };
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_IsacWb30ms DISABLED_IsacWb30ms #define MAYBE_IsacWb30ms DISABLED_IsacWb30ms
#else #else
#define MAYBE_IsacWb30ms IsacWb30ms #define MAYBE_IsacWb30ms IsacWb30ms
@ -996,7 +996,7 @@ TEST_F(AcmSenderBitExactnessOldApi, MAYBE_IsacWb30ms) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_IsacWb60ms DISABLED_IsacWb60ms #define MAYBE_IsacWb60ms DISABLED_IsacWb60ms
#else #else
#define MAYBE_IsacWb60ms IsacWb60ms #define MAYBE_IsacWb60ms IsacWb60ms
@ -1151,7 +1151,7 @@ TEST_F(AcmSenderBitExactnessOldApi, DISABLED_ON_ANDROID(G722_stereo_20ms)) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_Opus_stereo_20ms DISABLED_Opus_stereo_20ms #define MAYBE_Opus_stereo_20ms DISABLED_Opus_stereo_20ms
#else #else
#define MAYBE_Opus_stereo_20ms Opus_stereo_20ms #define MAYBE_Opus_stereo_20ms Opus_stereo_20ms
@ -1171,7 +1171,7 @@ TEST_F(AcmSenderBitExactnessOldApi, MAYBE_Opus_stereo_20ms) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_Opus_stereo_20ms_voip DISABLED_Opus_stereo_20ms_voip #define MAYBE_Opus_stereo_20ms_voip DISABLED_Opus_stereo_20ms_voip
#else #else
#define MAYBE_Opus_stereo_20ms_voip Opus_stereo_20ms_voip #define MAYBE_Opus_stereo_20ms_voip Opus_stereo_20ms_voip

View File

@ -538,7 +538,7 @@ TEST_F(AudioDecoderIsacSwbTest, EncodeDecode) {
} }
// Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4198 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4198
#if defined(WEBRTC_ANDROID) && defined(__aarch64__) #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
#define MAYBE_EncodeDecode DISABLED_EncodeDecode #define MAYBE_EncodeDecode DISABLED_EncodeDecode
#else #else
#define MAYBE_EncodeDecode EncodeDecode #define MAYBE_EncodeDecode EncodeDecode

View File

@ -1458,9 +1458,9 @@ int WebRtcAec_CreateAec(AecCore** aecInst) {
WebRtcAec_InitAec_mips(); WebRtcAec_InitAec_mips();
#endif #endif
#if defined(WEBRTC_ARCH_ARM_NEON) #if defined(WEBRTC_HAS_NEON)
WebRtcAec_InitAec_neon(); WebRtcAec_InitAec_neon();
#elif defined(WEBRTC_DETECT_ARM_NEON) #elif defined(WEBRTC_DETECT_NEON)
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
WebRtcAec_InitAec_neon(); WebRtcAec_InitAec_neon();
} }

View File

@ -58,7 +58,7 @@ void WebRtcAec_InitAec_SSE2(void);
#if defined(MIPS_FPU_LE) #if defined(MIPS_FPU_LE)
void WebRtcAec_InitAec_mips(void); void WebRtcAec_InitAec_mips(void);
#endif #endif
#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
void WebRtcAec_InitAec_neon(void); void WebRtcAec_InitAec_neon(void);
#endif #endif

View File

@ -78,7 +78,7 @@ static void FilterFarNEON(AecCore* aec, float yf[2][PART_LEN1]) {
} }
// ARM64's arm_neon.h has already defined vdivq_f32 vsqrtq_f32. // ARM64's arm_neon.h has already defined vdivq_f32 vsqrtq_f32.
#if !defined (WEBRTC_ARCH_ARM64_NEON) #if !defined (WEBRTC_ARCH_ARM64)
static float32x4_t vdivq_f32(float32x4_t a, float32x4_t b) { static float32x4_t vdivq_f32(float32x4_t a, float32x4_t b) {
int i; int i;
float32x4_t x = vrecpeq_f32(b); float32x4_t x = vrecpeq_f32(b);
@ -120,7 +120,7 @@ static float32x4_t vsqrtq_f32(float32x4_t s) {
// sqrt(s) = s * 1/sqrt(s) // sqrt(s) = s * 1/sqrt(s)
return vmulq_f32(s, x);; return vmulq_f32(s, x);;
} }
#endif // WEBRTC_ARCH_ARM64_NEON #endif // WEBRTC_ARCH_ARM64
static void ScaleErrorSignalNEON(AecCore* aec, float ef[2][PART_LEN1]) { static void ScaleErrorSignalNEON(AecCore* aec, float ef[2][PART_LEN1]) {
const float mu = aec->extended_filter_enabled ? kExtendedMu : aec->normal_mu; const float mu = aec->extended_filter_enabled ? kExtendedMu : aec->normal_mu;

View File

@ -579,9 +579,9 @@ void aec_rdft_init(void) {
#if defined(MIPS_FPU_LE) #if defined(MIPS_FPU_LE)
aec_rdft_init_mips(); aec_rdft_init_mips();
#endif #endif
#if defined(WEBRTC_ARCH_ARM_NEON) #if defined(WEBRTC_HAS_NEON)
aec_rdft_init_neon(); aec_rdft_init_neon();
#elif defined(WEBRTC_DETECT_ARM_NEON) #elif defined(WEBRTC_DETECT_NEON)
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
aec_rdft_init_neon(); aec_rdft_init_neon();
} }

View File

@ -54,7 +54,7 @@ void aec_rdft_inverse_128(float* a);
#if defined(MIPS_FPU_LE) #if defined(MIPS_FPU_LE)
void aec_rdft_init_mips(void); void aec_rdft_init_mips(void);
#endif #endif
#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
void aec_rdft_init_neon(void); void aec_rdft_init_neon(void);
#endif #endif

View File

@ -373,8 +373,7 @@ static void ResetAdaptiveChannelC(AecmCore* aecm) {
} }
// Initialize function pointers for ARM Neon platform. // Initialize function pointers for ARM Neon platform.
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON || \ #if (defined WEBRTC_DETECT_NEON || defined WEBRTC_HAS_NEON)
defined WEBRTC_ARCH_ARM64_NEON)
static void WebRtcAecm_InitNeon(void) static void WebRtcAecm_InitNeon(void)
{ {
WebRtcAecm_StoreAdaptiveChannel = WebRtcAecm_StoreAdaptiveChannelNeon; WebRtcAecm_StoreAdaptiveChannel = WebRtcAecm_StoreAdaptiveChannelNeon;
@ -521,13 +520,13 @@ int WebRtcAecm_InitCore(AecmCore* const aecm, int samplingFreq) {
WebRtcAecm_StoreAdaptiveChannel = StoreAdaptiveChannelC; WebRtcAecm_StoreAdaptiveChannel = StoreAdaptiveChannelC;
WebRtcAecm_ResetAdaptiveChannel = ResetAdaptiveChannelC; WebRtcAecm_ResetAdaptiveChannel = ResetAdaptiveChannelC;
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
uint64_t features = WebRtc_GetCPUFeaturesARM(); uint64_t features = WebRtc_GetCPUFeaturesARM();
if ((features & kCPUFeatureNEON) != 0) if ((features & kCPUFeatureNEON) != 0)
{ {
WebRtcAecm_InitNeon(); WebRtcAecm_InitNeon();
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON) #elif defined(WEBRTC_HAS_NEON)
WebRtcAecm_InitNeon(); WebRtcAecm_InitNeon();
#endif #endif

View File

@ -409,8 +409,7 @@ extern ResetAdaptiveChannel WebRtcAecm_ResetAdaptiveChannel;
// For the above function pointers, functions for generic platforms are declared // For the above function pointers, functions for generic platforms are declared
// and defined as static in file aecm_core.c, while those for ARM Neon platforms // and defined as static in file aecm_core.c, while those for ARM Neon platforms
// are declared below and defined in file aecm_core_neon.c. // are declared below and defined in file aecm_core_neon.c.
#if (defined WEBRTC_DETECT_ARM_NEON) || defined (WEBRTC_ARCH_ARM_NEON) || \ #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
defined (WEBRTC_ARCH_ARM64_NEON)
void WebRtcAecm_CalcLinearEnergiesNeon(AecmCore* aecm, void WebRtcAecm_CalcLinearEnergiesNeon(AecmCore* aecm,
const uint16_t* far_spectrum, const uint16_t* far_spectrum,
int32_t* echo_est, int32_t* echo_est,

View File

@ -23,7 +23,7 @@
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
// Square root of Hanning window in Q14. // Square root of Hanning window in Q14.
#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
// Table is defined in an ARM assembly file. // Table is defined in an ARM assembly file.
extern const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END; extern const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END;
#else #else

View File

@ -32,7 +32,7 @@ const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = {
}; };
static inline void AddLanes(uint32_t* ptr, uint32x4_t v) { static inline void AddLanes(uint32_t* ptr, uint32x4_t v) {
#if defined(__aarch64__) #if defined(WEBRTC_ARCH_ARM64)
*(ptr) = vaddvq_u32(v); *(ptr) = vaddvq_u32(v);
#else #else
uint32x2_t tmp_v; uint32x2_t tmp_v;

View File

@ -19,7 +19,7 @@
#include "webrtc/modules/audio_processing/ns/nsx_core.h" #include "webrtc/modules/audio_processing/ns/nsx_core.h"
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h" #include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON) #if (defined WEBRTC_DETECT_NEON || defined WEBRTC_HAS_NEON)
/* Tables are defined in ARM assembly files. */ /* Tables are defined in ARM assembly files. */
extern const int16_t WebRtcNsx_kLogTable[9]; extern const int16_t WebRtcNsx_kLogTable[9];
extern const int16_t WebRtcNsx_kCounterDiv[201]; extern const int16_t WebRtcNsx_kCounterDiv[201];
@ -65,7 +65,7 @@ static const int16_t WebRtcNsx_kLogTableFrac[256] = {
237, 238, 238, 239, 240, 241, 241, 242, 243, 244, 244, 245, 246, 247, 247, 237, 238, 238, 239, 240, 241, 241, 242, 243, 244, 244, 245, 246, 247, 247,
248, 249, 249, 250, 251, 252, 252, 253, 254, 255, 255 248, 249, 249, 250, 251, 252, 252, 253, 254, 255, 255
}; };
#endif // WEBRTC_DETECT_ARM_NEON || WEBRTC_ARCH_ARM_NEON #endif // WEBRTC_DETECT_NEON || WEBRTC_HAS_NEON
// Skip first frequency bins during estimation. (0 <= value < 64) // Skip first frequency bins during estimation. (0 <= value < 64)
static const int kStartBand = 5; static const int kStartBand = 5;
@ -557,8 +557,7 @@ AnalysisUpdate WebRtcNsx_AnalysisUpdate;
Denormalize WebRtcNsx_Denormalize; Denormalize WebRtcNsx_Denormalize;
NormalizeRealBuffer WebRtcNsx_NormalizeRealBuffer; NormalizeRealBuffer WebRtcNsx_NormalizeRealBuffer;
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON || \ #if (defined WEBRTC_DETECT_NEON || defined WEBRTC_HAS_NEON)
defined WEBRTC_ARCH_ARM64_NEON)
// Initialize function pointers for ARM Neon platform. // Initialize function pointers for ARM Neon platform.
static void WebRtcNsx_InitNeon(void) { static void WebRtcNsx_InitNeon(void) {
WebRtcNsx_NoiseEstimation = WebRtcNsx_NoiseEstimationNeon; WebRtcNsx_NoiseEstimation = WebRtcNsx_NoiseEstimationNeon;
@ -763,12 +762,12 @@ int32_t WebRtcNsx_InitCore(NoiseSuppressionFixedC* inst, uint32_t fs) {
WebRtcNsx_Denormalize = DenormalizeC; WebRtcNsx_Denormalize = DenormalizeC;
WebRtcNsx_NormalizeRealBuffer = NormalizeRealBufferC; WebRtcNsx_NormalizeRealBuffer = NormalizeRealBufferC;
#ifdef WEBRTC_DETECT_ARM_NEON #ifdef WEBRTC_DETECT_NEON
uint64_t features = WebRtc_GetCPUFeaturesARM(); uint64_t features = WebRtc_GetCPUFeaturesARM();
if ((features & kCPUFeatureNEON) != 0) { if ((features & kCPUFeatureNEON) != 0) {
WebRtcNsx_InitNeon(); WebRtcNsx_InitNeon();
} }
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON) #elif defined(WEBRTC_HAS_NEON)
WebRtcNsx_InitNeon(); WebRtcNsx_InitNeon();
#endif #endif

View File

@ -215,8 +215,7 @@ void WebRtcNsx_SpeechNoiseProb(NoiseSuppressionFixedC* inst,
uint32_t* priorLocSnr, uint32_t* priorLocSnr,
uint32_t* postLocSnr); uint32_t* postLocSnr);
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON || \ #if (defined WEBRTC_DETECT_NEON || defined WEBRTC_HAS_NEON)
defined WEBRTC_ARCH_ARM64_NEON)
// For the above function pointers, functions for generic platforms are declared // For the above function pointers, functions for generic platforms are declared
// and defined as static in file nsx_core.c, while those for ARM Neon platforms // and defined as static in file nsx_core.c, while those for ARM Neon platforms
// are declared below and defined in file nsx_core_neon.c. // are declared below and defined in file nsx_core_neon.c.

View File

@ -55,8 +55,10 @@
#error Define either WEBRTC_ARCH_LITTLE_ENDIAN or WEBRTC_ARCH_BIG_ENDIAN #error Define either WEBRTC_ARCH_LITTLE_ENDIAN or WEBRTC_ARCH_BIG_ENDIAN
#endif #endif
#if (defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__)) || \ // TODO(zhongwei.yao): WEBRTC_CPU_DETECTION is only used in one place; we should
(defined(WEBRTC_ARCH_ARM_V7) && !defined(WEBRTC_ARCH_ARM_NEON)) // probably just remove it.
#if (defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__)) || \
defined(WEBRTC_DETECT_NEON)
#define WEBRTC_CPU_DETECTION #define WEBRTC_CPU_DETECTION
#endif #endif