Add WebRTC echo canceller.

This commit is contained in:
Ghislain MARY 2012-11-12 14:30:55 +01:00
parent c810d41432
commit b980070b66
12 changed files with 295 additions and 5 deletions

3
.gitmodules vendored
View file

@ -55,3 +55,6 @@
[submodule "submodules/bcg729"]
path = submodules/bcg729
url = git://git.linphone.org/bcg729.git
[submodule "submodules/externals/webrtc"]
path = submodules/externals/webrtc
url = gitosis@git.linphone.org:webrtc.git

View file

@ -48,7 +48,7 @@ prepare-mediastreamer2:
prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-srtp prepare-mediastreamer2
generate-libs:
$(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full BUILD_GPLV3_ZRTP=1 USE_JAVAH=1 -j$(NUMCPUS)
$(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full BUILD_WEBRTC_AECM=1 BUILD_GPLV3_ZRTP=1 USE_JAVAH=1 -j$(NUMCPUS)
update-project:
$(SDK_PATH)/android update project --path .

View file

@ -149,3 +149,15 @@ ifneq ($(BUILD_G729), 0)
include $(linphone-root-dir)/submodules/bcg729/Android.mk
include $(linphone-root-dir)/submodules/bcg729/msbcg729/Android.mk
endif
ifneq ($(BUILD_WEBRTC_AECM), 0)
ifneq ($(TARGET_ARCH), x86)
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
WEBRTC_BUILD_NEON_LIBS=true
endif
include $(linphone-root-dir)/submodules/externals/build/webrtc/system_wrappers/Android.mk
include $(linphone-root-dir)/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk
include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk
include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk
endif
endif

View file

@ -48,6 +48,11 @@ ifeq ($(BUILD_G729),1)
APP_MODULES +=libbcg729 libmsbcg729
endif
ifneq ($BUILD_WEBRTC_AECM), 0)
APP_MODULES += libwebrtc_system_wrappers libwebrtc_spl libwebrtc_apm_utility libwebrtc_aecm
APP_MODULES += libwebrtc_spl_neon libwebrtc_aecm_neon
endif
ifeq ($(RING),yes)
APP_MODULES += libring
endif

View file

@ -34,8 +34,6 @@ ringer_dev_id=
capture_dev_id=
remote_ring=/data/data/org.linphone/files/ringback.wav
local_ring=/data/data/org.linphone/files/oldphone_mono.wav
ec_tail_len=120
ec_framesize=128
dtmf_player_amp=0.1
el_type=mic

View file

@ -36,8 +36,6 @@ ringer_dev_id=
capture_dev_id=
remote_ring=/data/data/org.linphone/files/ringback.wav
local_ring=/data/data/org.linphone/files/oldphone_mono.wav
ec_tail_len=120
ec_framesize=128
dtmf_player_amp=0.1
el_type=mic

View file

@ -0,0 +1,96 @@
# 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
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
MY_WEBRTC_PATH := $(call my-dir)/../../
LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/common_audio/signal_processing
include $(CLEAR_VARS)
include $(MY_WEBRTC_PATH)/Android.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE := libwebrtc_spl
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
complex_fft.c \
cross_correlation.c \
division_operations.c \
downsample_fast.c \
min_max_operations.c \
randomization_functions.c \
real_fft.c \
spl_init.c \
vector_scaling_operations.c
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../..
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += \
complex_bit_reverse_arm.s \
spl_sqrt_floor_arm.s
else
LOCAL_SRC_FILES += \
complex_bit_reverse.c \
spl_sqrt_floor.c
endif
LOCAL_SHARED_LIBRARIES := libstlport
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
endif
ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES += libdl
endif
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)
#########################
# Build the neon library.
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
include $(CLEAR_VARS)
include $(MY_WEBRTC_PATH)/Android.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE := libwebrtc_spl_neon
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
cross_correlation_neon.s \
downsample_fast_neon.s \
min_max_operations_neon.s \
vector_scaling_operations_neon.s
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS) \
$(MY_ARM_CFLAGS_NEON)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../..
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)
endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)

View file

@ -0,0 +1,87 @@
#############################
# Build the non-neon library.
MY_WEBRTC_PATH := $(call my-dir)/../../../
LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/modules/audio_processing/aecm
include $(CLEAR_VARS)
include $(MY_WEBRTC_PATH)/Android.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE := libwebrtc_aecm
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
echo_control_mobile.c \
aecm_core.c
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := $(MY_WEBRTC_COMMON_DEFS)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../utility \
$(LOCAL_PATH)/../../.. \
$(LOCAL_PATH)/../../../common_audio/signal_processing/include \
$(LOCAL_PATH)/../../../system_wrappers/interface \
LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
libstlport
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)
#########################
# Build the neon library.
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
include $(CLEAR_VARS)
include $(MY_WEBRTC_PATH)/Android.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE := libwebrtc_aecm_neon
LOCAL_MODULE_TAGS := optional
# Generate a header file aecm_core_neon_offsets.h which will be included in
# assembly file aecm_core_neon.S, from file aecm_core_neon_offsets.c.
#$(LOCAL_PATH)/aecm_core_neon_offsets.h: $(LOCAL_PATH)/aecm_core_neon_offsets.S
# python $(LOCAL_PATH)/../../../build/generate_asm_header.py $^ $@ offset_aecm_
#
#$(LOCAL_PATH)/aecm_core_neon_offsets.S: $(LOCAL_PATH)/aecm_core_neon_offsets.c
# $(TARGET_CC) $(addprefix -I, $(LOCAL_INCLUDES)) $(addprefix -isystem ,\
# $(TARGET_C_INCLUDES)) -S -o $@ $^
#
#$(LOCAL_PATH)/aecm_core_neon.S: $(LOCAL_PATH)/aecm_core_neon_offsets.h
LOCAL_SRC_FILES := aecm_core_neon.S
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS) \
-mfpu=neon \
-mfloat-abi=softfp \
-flax-vector-conversions
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../../.. \
$(LOCAL_PATH)/../../../common_audio/signal_processing/include \
$(MY_WEBRTC_PATH)/modules/audio_processing/aecm
LOCAL_INCLUDES := $(LOCAL_C_INCLUDES)
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)
endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)

View file

@ -0,0 +1,8 @@
#define offset_aecm_dfaCleanQDomain 13976
#define offset_aecm_outBuf 15988
#define offset_aecm_xBuf 15976
#define offset_aecm_dBufNoisy 15984
#define offset_aecm_dBufClean 15980
#define offset_aecm_channelStored 15964
#define offset_aecm_channelAdapt16 15968
#define offset_aecm_channelAdapt32 15972

View file

@ -0,0 +1,43 @@
# Copyright (c) 2011 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
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
MY_WEBRTC_PATH := $(call my-dir)/../../../
LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/modules/audio_processing/utility
include $(CLEAR_VARS)
include $(MY_WEBRTC_PATH)/Android.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE := libwebrtc_apm_utility
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
ring_buffer.c \
delay_estimator.c \
delay_estimator_wrapper.c
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS)
# Include paths placed before CFLAGS/CPPFLAGS
LOCAL_C_INCLUDES := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/../../.. \
$(LOCAL_PATH)/../../../common_audio/signal_processing/include
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
libstlport
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)

View file

@ -0,0 +1,39 @@
# 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
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
MY_WEBRTC_PATH := $(call my-dir)/../
LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/system_wrappers/source
include $(CLEAR_VARS)
include $(MY_WEBRTC_PATH)/Android.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE := libwebrtc_system_wrappers
LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := \
cpu_features_android.c
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/../interface \
$(LOCAL_PATH)/spreadsortlib
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
libstlport
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)

1
submodules/externals/webrtc vendored Submodule

@ -0,0 +1 @@
Subproject commit da96f6281285f76cd67432d21fb20f6d1bd5068b