Add WebRTC echo canceller.
This commit is contained in:
parent
9ae1b0d596
commit
326a606048
12 changed files with 305 additions and 3 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -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
|
||||
|
|
2
Makefile
2
Makefile
|
@ -49,7 +49,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 -j$(NUMCPUS)
|
||||
$(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full BUILD_G729=1 BUILD_WEBRTC_AECM=1 -j$(NUMCPUS)
|
||||
|
||||
update-project:
|
||||
$(SDK_PATH)/android update project --path .
|
||||
|
|
|
@ -143,3 +143,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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
el_type=mic
|
||||
el_thres=0.03
|
||||
|
|
10
submodules/externals/build/webrtc/Android.mk
vendored
Normal file
10
submodules/externals/build/webrtc/Android.mk
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
MY_WEBRTC_COMMON_DEFS := \
|
||||
-DWEBRTC_ANDROID \
|
||||
-DWEBRTC_LINUX \
|
||||
-DWEBRTC_CLOCK_TYPE_REALTIME \
|
||||
-DWEBRTC_ARCH_ARM
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
|
||||
MY_WEBRTC_COMMON_DEFS += \
|
||||
-DWEBRTC_DETECT_ARM_NEON
|
||||
endif
|
96
submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk
vendored
Normal file
96
submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk
vendored
Normal 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)
|
87
submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk
vendored
Normal file
87
submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk
vendored
Normal 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)
|
8
submodules/externals/build/webrtc/modules/audio_processing/aecm/aecm_core_neon_offsets.h
vendored
Normal file
8
submodules/externals/build/webrtc/modules/audio_processing/aecm/aecm_core_neon_offsets.h
vendored
Normal 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
|
43
submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk
vendored
Normal file
43
submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk
vendored
Normal 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)
|
39
submodules/externals/build/webrtc/system_wrappers/Android.mk
vendored
Normal file
39
submodules/externals/build/webrtc/system_wrappers/Android.mk
vendored
Normal 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
1
submodules/externals/webrtc
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 2117f353f82da43f648b10dc6bd99f55e0d44c3f
|
Loading…
Reference in a new issue