Enable aecm neon optimized code in android build

Description:
This CL is a follow up of http://review.webrtc.org/575008/ and r2241.
Because of r2243, r2241 is messed up and reverted, I'm going to commit it again.
This is exact same to the last patch in 575008, just want to inform you and have
your double check before I commit it.

The original description
This cl enables cpu detection and aecm optimized code in android build.

BUG=
TEST=build on all platforms
Review URL: https://webrtc-codereview.appspot.com/568006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2259 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org 2012-05-18 16:48:45 +00:00
parent 08d9928443
commit ada5db4e75
5 changed files with 32 additions and 7 deletions

View File

@ -168,6 +168,7 @@
'WEBRTC_ANDROID',
# TODO(leozwang): move WEBRTC_ARCH_ARM to typedefs.h.
'WEBRTC_ARCH_ARM',
'WEBRTC_DETECT_ARM_NEON',
# TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
# support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
# remove it after I verify that CLOCK_MONOTONIC is fully functional

View File

@ -30,6 +30,28 @@
'aecm_core.c',
'aecm_core.h',
],
'conditions': [
['OS=="android"', {
'dependencies': [ 'aecm_neon', ],
}],
],
},
],
'conditions': [
['OS=="android"', {
'targets': [
{
'target_name': 'aecm_neon',
'type': '<(library)',
'includes': [ '../../../build/arm_neon.gypi', ],
'dependencies': [
'<(webrtc_root)/common_audio/common_audio.gyp:signal_processing',
],
'sources': [
'aecm_core_neon.c',
],
},
],
}],
],
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -16,7 +16,7 @@
// Square root of Hanning window in Q14.
static const WebRtc_Word16 kSqrtHanningReversed[] __attribute__((aligned(8))) = {
16384, 16373, 16354, 16325,
16384, 16373, 16354, 16325,
16286, 16237, 16179, 16111,
16034, 15947, 15851, 15746,
15631, 15506, 15373, 15231,
@ -92,7 +92,6 @@ static void InverseFFTAndWindowNeon(AecmCore_t* aecm,
WebRtc_Word16* output,
const WebRtc_Word16* nearendClean) {
int i, j, outCFFT;
WebRtc_Word32 tmp32no1;
// Synthesis
for (i = 0, j = 0; i < PART_LEN; i += 4, j += 8) {
@ -198,7 +197,6 @@ static void CalcLinearEnergiesNeon(AecmCore_t* aecm,
register WebRtc_UWord32 far_energy_r;
register WebRtc_UWord32 echo_energy_stored_r;
register WebRtc_UWord32 echo_energy_adapt_r;
uint32x4_t tmp32x4_0;
__asm__("vmov.i32 q14, #0" : : : "q14"); // far_energy
__asm__("vmov.i32 q8, #0" : : : "q8"); // echo_energy_stored

View File

@ -57,9 +57,6 @@
'conditions': [
['OS=="android"', {
'dependencies': [ 'ns_neon', ],
'defines': [
'WEBRTC_DETECT_ARM_NEON'
],
}],
],
},

View File

@ -142,6 +142,12 @@ LOCAL_SRC_FILES := \
$(MY_LIBS_PATH)/src/modules/libaecm.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libaecm_neon
LOCAL_SRC_FILES := \
$(MY_LIBS_PATH)/src/modules/libaecm_neon.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libbitrate_controller
LOCAL_SRC_FILES := \
@ -312,6 +318,7 @@ LOCAL_STATIC_LIBRARIES := \
libagc \
libaec \
libaecm \
libaecm_neon \
libbitrate_controller \
libresampler \
libsignal_processing \