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:
@ -90,8 +90,7 @@ void WebRtcIsacfix_Spec2TimeC(int16_t* inreQ7,
|
||||
int32_t* outre1Q16,
|
||||
int32_t* outre2Q16);
|
||||
|
||||
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
|
||||
(defined WEBRTC_ARCH_ARM64_NEON)
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
void WebRtcIsacfix_Time2SpecNeon(int16_t* inre1Q9,
|
||||
int16_t* inre2Q9,
|
||||
int16_t* outre,
|
||||
@ -175,8 +174,7 @@ void WebRtcIsacfix_FilterMaLoopC(int16_t input0,
|
||||
int32_t* ptr1,
|
||||
int32_t* ptr2);
|
||||
|
||||
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
|
||||
(defined WEBRTC_ARCH_ARM64_NEON)
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
int WebRtcIsacfix_AutocorrNeon(int32_t* __restrict r,
|
||||
const int16_t* __restrict x,
|
||||
int16_t N,
|
||||
|
||||
@ -147,8 +147,7 @@ void WebRtcIsacfix_MatrixProduct2C(const int16_t matrix0[],
|
||||
const int matrix0_index_factor,
|
||||
const int matrix0_index_step);
|
||||
|
||||
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
|
||||
(defined WEBRTC_ARCH_ARM64_NEON)
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
void WebRtcIsacfix_MatrixProduct1Neon(const int16_t matrix0[],
|
||||
const int32_t matrix1[],
|
||||
int32_t matrix_product[],
|
||||
|
||||
@ -63,9 +63,8 @@ void WebRtcIsacfix_AllpassFilter2FixDec16C(
|
||||
// Disable AllpassFilter2FixDec16Neon function due to a clang bug.
|
||||
// Refer more details at:
|
||||
// https://code.google.com/p/webrtc/issues/detail?id=4567
|
||||
#if !(defined __clang__)
|
||||
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
|
||||
(defined WEBRTC_ARCH_ARM64_NEON)
|
||||
#if !defined(__clang__) || !defined(WEBRTC_ARCH_ARM64)
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
|
||||
int16_t *data_ch1,
|
||||
int16_t *data_ch2,
|
||||
|
||||
@ -68,12 +68,12 @@ TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) {
|
||||
// Disable AllpassFilter2FixDec16Neon function due to a clang bug.
|
||||
// Refer more details at:
|
||||
// https://code.google.com/p/webrtc/issues/detail?id=4567
|
||||
#if !(defined __clang__)
|
||||
#ifdef WEBRTC_DETECT_ARM_NEON
|
||||
#if !(defined __clang__) || !defined(WEBRTC_ARCH_ARM64)
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
|
||||
}
|
||||
#elif defined(WEBRTC_ARCH_ARM_NEON)
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -59,11 +59,11 @@ class FiltersTest : public testing::Test {
|
||||
|
||||
TEST_F(FiltersTest, AutocorrFixTest) {
|
||||
FiltersTester(WebRtcIsacfix_AutocorrC);
|
||||
#ifdef WEBRTC_DETECT_ARM_NEON
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
FiltersTester(WebRtcIsacfix_AutocorrNeon);
|
||||
}
|
||||
#elif defined(WEBRTC_ARCH_ARM_NEON)
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
FiltersTester(WebRtcIsacfix_AutocorrNeon);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -198,8 +198,7 @@ int16_t WebRtcIsacfix_FreeInternal(ISACFIX_MainStruct *ISAC_main_inst)
|
||||
* This function initializes function pointers for ARM Neon platform.
|
||||
*/
|
||||
|
||||
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON) || \
|
||||
(defined WEBRTC_ARCH_ARM64_NEON)
|
||||
#if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
|
||||
static void WebRtcIsacfix_InitNeon(void) {
|
||||
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon;
|
||||
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon;
|
||||
@ -208,7 +207,7 @@ static void WebRtcIsacfix_InitNeon(void) {
|
||||
// Disable AllpassFilter2FixDec16Neon function due to a clang bug.
|
||||
// Refer more details at:
|
||||
// https://code.google.com/p/webrtc/issues/detail?id=4567
|
||||
#if !(defined __clang__)
|
||||
#if !defined(__clang__) || !defined(WEBRTC_ARCH_ARM64)
|
||||
WebRtcIsacfix_AllpassFilter2FixDec16 =
|
||||
WebRtcIsacfix_AllpassFilter2FixDec16Neon;
|
||||
#endif
|
||||
@ -334,11 +333,11 @@ int16_t WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
WebRtcIsacfix_MatrixProduct1 = WebRtcIsacfix_MatrixProduct1C;
|
||||
WebRtcIsacfix_MatrixProduct2 = WebRtcIsacfix_MatrixProduct2C;
|
||||
|
||||
#ifdef WEBRTC_DETECT_ARM_NEON
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
WebRtcIsacfix_InitNeon();
|
||||
}
|
||||
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON)
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
WebRtcIsacfix_InitNeon();
|
||||
#endif
|
||||
|
||||
|
||||
@ -9,11 +9,6 @@
|
||||
*/
|
||||
|
||||
#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/system_wrappers/interface/compile_assert_c.h"
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#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>
|
||||
#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[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1] >>
|
||||
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];
|
||||
int32x4_t int_32x4_sum = vmovq_n_s32(0);
|
||||
|
||||
@ -175,22 +175,22 @@ class TransformTest : public testing::Test {
|
||||
|
||||
TEST_F(TransformTest, Time2SpecTest) {
|
||||
Time2SpecTester(WebRtcIsacfix_Time2SpecC);
|
||||
#ifdef WEBRTC_DETECT_ARM_NEON
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
Time2SpecTester(WebRtcIsacfix_Time2SpecNeon);
|
||||
}
|
||||
#elif defined(WEBRTC_ARCH_ARM_NEON)
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
Time2SpecTester(WebRtcIsacfix_Time2SpecNeon);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_F(TransformTest, Spec2TimeTest) {
|
||||
Spec2TimeTester(WebRtcIsacfix_Spec2TimeC);
|
||||
#ifdef WEBRTC_DETECT_ARM_NEON
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon);
|
||||
}
|
||||
#elif defined(WEBRTC_ARCH_ARM_NEON)
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user