Enable isac NEON building on Aarch64

Passed building isac_neon and modules_unittests on Android ARM64 and
ARMv7.
Passed modules_unittests with following filters:
--gtest_filter=FiltersTest*
--gtest_filter=LpcMaskingModelTest*
--gtest_filter=TransformTest*
--gtest_filter=FilterBanksTest*

WebRtcIsacfix_CalculateResidualEnergyNeon is not enabled due to Issue
4224.

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

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

Patch from Zhongwei Yao <zhongwei.yao@arm.com>.

Cr-Commit-Position: refs/heads/master@{#9092}
This commit is contained in:
Zhongwei Yao
2015-04-28 14:42:11 +08:00
committed by Zhongwei Yao
parent d7e5c44e94
commit e8a197bd07
7 changed files with 95 additions and 33 deletions

View File

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

View File

@ -147,7 +147,8 @@ 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)
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
void WebRtcIsacfix_MatrixProduct1Neon(const int16_t matrix0[],
const int32_t matrix1[],
int32_t matrix_product[],

View File

@ -60,7 +60,12 @@ void WebRtcIsacfix_AllpassFilter2FixDec16C(
int32_t *filter_state_ch1,
int32_t *filter_state_ch2);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON)
// 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)
void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
int16_t *data_ch1,
int16_t *data_ch2,
@ -70,6 +75,7 @@ void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
int32_t *filter_state_ch1,
int32_t *filter_state_ch2);
#endif
#endif
#if defined(MIPS_DSP_R1_LE)
void WebRtcIsacfix_AllpassFilter2FixDec16MIPS(

View File

@ -64,6 +64,11 @@ class FilterBanksTest : public testing::Test {
TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) {
CalculateResidualEnergyTester(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__)
#ifdef WEBRTC_DETECT_ARM_NEON
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
@ -71,6 +76,7 @@ TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) {
#elif defined(WEBRTC_ARCH_ARM_NEON)
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
#endif
#endif
}
TEST_F(FilterBanksTest, HighpassFilterFixDec32Test) {

View File

@ -198,16 +198,24 @@ 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)
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
static void WebRtcIsacfix_InitNeon(void) {
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon;
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon;
WebRtcIsacfix_Spec2Time = WebRtcIsacfix_Spec2TimeNeon;
WebRtcIsacfix_Time2Spec = WebRtcIsacfix_Time2SpecNeon;
#if !(defined WEBRTC_ARCH_ARM64_NEON)
WebRtcIsacfix_CalculateResidualEnergy =
WebRtcIsacfix_CalculateResidualEnergyNeon;
#endif
// 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__)
WebRtcIsacfix_AllpassFilter2FixDec16 =
WebRtcIsacfix_AllpassFilter2FixDec16Neon;
#endif
WebRtcIsacfix_MatrixProduct1 = WebRtcIsacfix_MatrixProduct1Neon;
WebRtcIsacfix_MatrixProduct2 = WebRtcIsacfix_MatrixProduct2Neon;
}
@ -334,7 +342,7 @@ int16_t WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
WebRtcIsacfix_InitNeon();
}
#elif defined(WEBRTC_ARCH_ARM_NEON)
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON)
WebRtcIsacfix_InitNeon();
#endif

View File

@ -95,6 +95,9 @@
}],
],
}],
['target_arch=="arm64"', {
'dependencies': ['isac_neon', ],
}],
['target_arch=="mipsel" and mips_arch_variant!="r6"', {
'sources': [
'fix/source/entropy_coding_mips.c',
@ -128,7 +131,7 @@
},
],
'conditions': [
['target_arch=="arm" and arm_version>=7', {
['target_arch=="arm" and arm_version>=7 or target_arch=="arm64"', {
'targets': [
{
'target_name': 'isac_neon',
@ -137,9 +140,6 @@
'dependencies': [
'<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
],
'include_dirs': [
'<(webrtc_root)',
],
'sources': [
'fix/source/entropy_coding_neon.c',
'fix/source/filterbanks_neon.S',
@ -156,6 +156,28 @@
'-ffat-lto-objects',
],
}],
['target_arch=="arm64"', {
'sources!': [
'fix/source/filterbanks_neon.S',
'fix/source/filters_neon.S',
'fix/source/lattice_neon.S',
'fix/source/lpc_masking_model_neon.S',
'fix/source/transform_neon.S',
],
'sources': [
'fix/source/filters_neon.c',
'fix/source/lattice_neon.c',
'fix/source/transform_neon.c',
],
'conditions': [
# Disable AllpassFilter2FixDec16Neon function due to a clang
# bug. Refer more details at:
# https://code.google.com/p/webrtc/issues/detail?id=4567
['clang==0', {
'sources': ['fix/source/filterbanks_neon.c',],
}],
],
}]
],
},
],