From 982331390e78ccb7ac681b3083fa8ce60b33ddab Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 23 Oct 2013 17:34:25 +0200 Subject: [PATCH 1/8] Added submodule msisac --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index 888c77edd..9fa5f9aec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,3 +76,6 @@ [submodule "submodules/externals/opus"] path = submodules/externals/opus url = git://git.opus-codec.org/opus.git +[submodule "submodules/msisac"] + path = submodules/msisac + url = git://git.linphone.org/msisac.git From 473d7778737a319c2a76ff2d36f4a693182e1fa7 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 23 Oct 2013 17:41:28 +0200 Subject: [PATCH 2/8] msisac @ current head --- submodules/msisac | 1 + 1 file changed, 1 insertion(+) create mode 160000 submodules/msisac diff --git a/submodules/msisac b/submodules/msisac new file mode 160000 index 000000000..5f4300408 --- /dev/null +++ b/submodules/msisac @@ -0,0 +1 @@ +Subproject commit 5f43004087e34a6d00de8f20c6b3b9326483f194 From fc179ddc59257d3e2b6e105cc6ee442a85f906e7 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 24 Oct 2013 16:49:05 +0200 Subject: [PATCH 3/8] msisac @head to add Android build --- submodules/msisac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/msisac b/submodules/msisac index 5f4300408..4ac637d32 160000 --- a/submodules/msisac +++ b/submodules/msisac @@ -1 +1 @@ -Subproject commit 5f43004087e34a6d00de8f20c6b3b9326483f194 +Subproject commit 4ac637d3256f87f92c94d61c1bc53acc0e8512cb From 9678ca7c01539ae62e49d05dc0ce4581a8a65cb5 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 24 Oct 2013 16:52:06 +0200 Subject: [PATCH 4/8] Added Android.mk file in build/webrtc for iSAC --- .../codecs/isac/fix/source/Android.mk | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk diff --git a/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk b/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk new file mode 100644 index 000000000..6fad2d78e --- /dev/null +++ b/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk @@ -0,0 +1,150 @@ +# 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. + +############################# +# Build the non-neon library. + +MY_WEBRTC_PATH := $(call my-dir)/../../../../../../ +LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/modules/audio_coding/codecs/isac/fix/source + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_isacfix +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := \ + arith_routines.c \ + arith_routines_hist.c \ + arith_routines_logist.c \ + bandwidth_estimator.c \ + decode.c \ + decode_bwe.c \ + decode_plc.c \ + encode.c \ + entropy_coding.c \ + fft.c \ + filterbank_tables.c \ + filterbanks.c \ + filters.c \ + initialize.c \ + isacfix.c \ + lattice.c \ + lpc_masking_model.c \ + lpc_tables.c \ + pitch_estimator.c \ + pitch_filter.c \ + pitch_gain_tables.c \ + pitch_lag_tables.c \ + spectrum_ar_model_tables.c \ + transform.c + +ifeq ($(ARCH_ARM_HAVE_ARMV7A),true) +# Using .S (instead of .s) extention is to include a C header file in assembly. +LOCAL_SRC_FILES += \ + lattice_armv7.S \ + pitch_filter_armv6.S +else +LOCAL_SRC_FILES += \ + lattice_c.c +endif + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/../interface \ + $(LOCAL_PATH)/../../../../../.. \ + $(MY_WEBRTC_PATH)/../../webrtc/common_audio/signal_processing/include + +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) + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_isacfix_neon +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := \ + filters_neon.c \ + lattice_neon.S \ + lpc_masking_model_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)/../interface \ + $(LOCAL_PATH)/../../../../../.. \ + $(MY_WEBRTC_PATH)/../../webrtc/common_audio/signal_processing/include + + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) + +endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) + +########################### +# isac test app + +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := tests +LOCAL_CPP_EXTENSION := .cc +LOCAL_SRC_FILES:= ../test/kenny.c + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := $(MY_WEBRTC_COMMON_DEFS) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/../interface \ + $(LOCAL_PATH)/../../../../../.. + +LOCAL_STATIC_LIBRARIES := \ + libwebrtc_isacfix \ + libwebrtc_spl \ + libwebrtc_system_wrappers + +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_isacfix_neon +endif + +LOCAL_SHARED_LIBRARIES := \ + libutils + +LOCAL_MODULE:= webrtc_isac_test + +ifdef NDK_ROOT +include $(BUILD_EXECUTABLE) +else +include $(BUILD_NATIVE_TEST) +endif From be0cede76a3d584f886b1c13617706848c605c3e Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 24 Oct 2013 16:52:58 +0200 Subject: [PATCH 5/8] Modified build process to include iSAC codec. It now needs inclusion in the Android app --- Makefile | 4 +++- jni/Android.mk | 45 +++++++++++++++++++++++++++++++++++++-------- jni/Application.mk | 5 +++++ 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 20d571d10..18415f601 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ BUILD_G729=0 BUILD_TUNNEL=0 BUILD_WEBRTC_AECM=1 BUILD_OPUS=1 +BUILD_WEBRTC_ISAC=1 BUILD_FOR_X86=1 USE_JAVAH=1 BUILD_TLS=1 @@ -210,6 +211,7 @@ $(LIBMSSILK_BUILD_DIR)/sdk/SILK_SDK_SRC_v1.0.8/SILK_SDK_SRC_ARM_v1.0.8/src/SKP_S prepare-silk: $(LIBMSSILK_BUILD_DIR)/sdk/SILK_SDK_SRC_v1.0.8/SILK_SDK_SRC_ARM_v1.0.8/src/SKP_Silk_resampler.c + #Zrtp $(TOPDIR)/submodules/externals/libzrtpcpp/libzrtpcpp-config.h : $(TOPDIR)/submodules/externals/build/libzrtpcpp/libzrtpcpp-config.h @cd $(TOPDIR)/submodules/externals/libzrtpcpp/ && \ @@ -283,7 +285,7 @@ prepare-sources: build-ffmpeg build-x264 prepare-ilbc build-vpx prepare-silk pre GENERATE_OPTIONS = NDK_DEBUG=$(NDK_DEBUG) BUILD_FOR_X86=$(BUILD_FOR_X86) \ BUILD_AMRNB=$(BUILD_AMRNB) BUILD_AMRWB=$(BUILD_AMRWB) BUILD_SILK=$(BUILD_SILK) BUILD_G729=$(BUILD_G729) BUILD_OPUS=$(BUILD_OPUS) \ BUILD_VIDEO=$(BUILD_VIDEO) BUILD_X264=$(BUILD_X264) \ - BUILD_UPNP=$(BUILD_UPNP) BUILD_GPLV3_ZRTP=$(BUILD_GPLV3_ZRTP) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) + BUILD_UPNP=$(BUILD_UPNP) BUILD_GPLV3_ZRTP=$(BUILD_GPLV3_ZRTP) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) BUILD_WEBRTC_ISAC=$(BUILD_WEBRTC_ISAC) LIBLINPHONE_OPTIONS = $(GENERATE_OPTIONS) \ LINPHONE_VERSION=$(LINPHONE_VERSION) BELLESIP_VERSION=$(BELLESIP_VERSION) USE_JAVAH=$(USE_JAVAH) \ diff --git a/jni/Android.mk b/jni/Android.mk index b4cc545ee..c62e7e552 100755 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -142,14 +142,43 @@ ifneq ($(BUILD_OPUS), 0) include $(linphone-root-dir)/submodules/externals/build/opus/Android.mk endif -ifneq ($(BUILD_WEBRTC_AECM), 0) -ifneq ($(TARGET_ARCH), x86) -ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) -WEBRTC_BUILD_NEON_LIBS=true +WEBRTC_BUILD_NEON_LIBS=false + +# AECM +ifneq ($(BUILD_WEBRTC_AECM),0) + + ifneq ($(TARGET_ARCH), x86) + + ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) + $(info $(TARGET_ARCH_ABI): Build NEON modules for AECM) + WEBRTC_BUILD_NEON_LIBS=true + endif + + $(info $(TARGET_ARCH_ABI): Build AECM from WebRTC) + + include $(linphone-root-dir)/submodules/externals/build/webrtc/system_wrappers/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 -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 + +# iSAC +ifneq ($(BUILD_WEBRTC_ISAC),0) + + # don't build for neon in x86 + ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) + $(info $(TARGET_ARCH_ABI): Build NEON modules for ISAC) + WEBRTC_BUILD_NEON_LIBS=true + endif + + $(info $(TARGET_ARCH_ABI): Build proprietary iSAC plugin for mediastreamer2) + include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk + include $(linphone-root-dir)/submodules/msisac/Android.mk endif + +# common modules for ISAC and AECM +ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC),00) + $(info $(TARGET_ARCH_ABI): Build common modules for iSAC and AECM ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC))) + include $(linphone-root-dir)/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk endif + diff --git a/jni/Application.mk b/jni/Application.mk index a70c47849..71a4a2021 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -95,6 +95,11 @@ APP_MODULES += libwebrtc_system_wrappers libwebrtc_spl libwebrtc_apm_utility lib APP_MODULES += libwebrtc_spl_neon libwebrtc_aecm_neon endif +ifneq ($(BUILD_WEBRTC_ISAC), 0) +APP_MODULES += libwebrtc_spl libwebrtc_isacfix libmsisac +APP_MODULES += libwebrtc_spl_neon libwebrtc_isacfix_neon +endif + ifeq ($(BUILD_MEDIASTREAMER2_SDK), 0) ifeq ($(RING),yes) APP_MODULES += libring From a18aab332cbc3b8c75e4f7e0981aefead6768f79 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 8 Nov 2013 14:52:43 +0100 Subject: [PATCH 6/8] Progress commit on isac integration --- jni/Application.mk | 2 +- submodules/externals/build/msisac/Android.mk | 8 +++++ .../common_audio/signal_processing/Android.mk | 29 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 submodules/externals/build/msisac/Android.mk diff --git a/jni/Application.mk b/jni/Application.mk index 71a4a2021..36fe8b7fc 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -95,7 +95,7 @@ APP_MODULES += libwebrtc_system_wrappers libwebrtc_spl libwebrtc_apm_utility lib APP_MODULES += libwebrtc_spl_neon libwebrtc_aecm_neon endif -ifneq ($(BUILD_WEBRTC_ISAC), 0) +ifeq ($(BUILD_WEBRTC_ISAC), 1) APP_MODULES += libwebrtc_spl libwebrtc_isacfix libmsisac APP_MODULES += libwebrtc_spl_neon libwebrtc_isacfix_neon endif diff --git a/submodules/externals/build/msisac/Android.mk b/submodules/externals/build/msisac/Android.mk new file mode 100755 index 000000000..5e978ec38 --- /dev/null +++ b/submodules/externals/build/msisac/Android.mk @@ -0,0 +1,8 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := libmsisac-linphone +LOCAL_MODULE_FILENAME := libmsisac-linphone-$(TARGET_ARCH) +LOCAL_SRC_FILES := $(TARGET_ARCH)/libmsisac-linphone-$(TARGET_ARCH).so + +include $(PREBUILT_SHARED_LIBRARY) diff --git a/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk b/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk index 0c04ebea3..62a4583e3 100644 --- a/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk +++ b/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk @@ -18,14 +18,36 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_MODULE := libwebrtc_spl LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := \ + auto_corr_to_refl_coef.c \ + auto_correlation.c \ complex_fft.c \ + copy_set_operations.c \ cross_correlation.c \ division_operations.c \ + dot_product_with_scale.c \ downsample_fast.c \ + energy.c \ + filter_ar.c \ + filter_ma_fast_q12.c \ + get_hanning_window.c \ + get_scaling_square.c \ + ilbc_specific_functions.c \ + levinson_durbin.c \ + lpc_to_refl_coef.c \ min_max_operations.c \ randomization_functions.c \ real_fft.c \ + refl_coef_to_lpc.c \ + resample.c \ + resample_48khz.c \ + resample_by_2.c \ + resample_by_2_internal.c \ + resample_fractional.c \ spl_init.c \ + spl_sqrt.c \ + spl_version.c \ + splitting_filter.c \ + sqrt_of_one_minus_x_squared.c \ vector_scaling_operations.c # Flags passed to both C and C++ files. @@ -36,6 +58,13 @@ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/../.. +ifeq ($(ARCH_ARM_HAVE_ARMV7A),true) +LOCAL_SRC_FILES += \ + filter_ar_fast_q12_armv7.s +else +LOCAL_SRC_FILES += \ + filter_ar_fast_q12.c +endif ifeq ($(TARGET_ARCH),arm) LOCAL_SRC_FILES += \ complex_bit_reverse_arm.s \ From 3b7b46786a735fcd3a795e4cb1cb18f6b618c534 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 8 Nov 2013 14:56:24 +0100 Subject: [PATCH 7/8] Fixeed missing files in Android.mk for isac --- .../modules/audio_coding/codecs/isac/fix/source/Android.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk b/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk index 6fad2d78e..e4d20f758 100644 --- a/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk +++ b/submodules/externals/build/webrtc/modules/audio_coding/codecs/isac/fix/source/Android.mk @@ -53,7 +53,8 @@ LOCAL_SRC_FILES += \ pitch_filter_armv6.S else LOCAL_SRC_FILES += \ - lattice_c.c + lattice_c.c \ + pitch_filter_c.c endif # Flags passed to both C and C++ files. From 41a276578b3154b30726b782d732ba9babaf4c97 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 8 Nov 2013 14:57:35 +0100 Subject: [PATCH 8/8] Update msisac module --- submodules/msisac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/msisac b/submodules/msisac index 4ac637d32..c6087cfd4 160000 --- a/submodules/msisac +++ b/submodules/msisac @@ -1 +1 @@ -Subproject commit 4ac637d3256f87f92c94d61c1bc53acc0e8512cb +Subproject commit c6087cfd4f07b3b67a888e7df631905b5ca9aeb9