Commit 4ad13f08 authored by Ghislain MARY's avatar Ghislain MARY

Add compilation of WebRTC AECM in the plugin.

parent 84698348
EXTRA_DIST=autogen.sh mswebrtc.iss.in
isac_VERSION = 1.0.0
isac_DIR=$(top_builddir)/webrtc
webrtc_VERSION = 1.0.0
webrtc_DIR=$(top_builddir)/webrtc
ISAC_FLAVOUR ?= fix # use 'main' or 'fix'
ISAC_SRC_DIR = webrtc/modules/audio_coding/codecs/isac/$(ISAC_FLAVOUR)
ISAC_COMMON_DIR = webrtc/common_audio/signal_processing
AEC_SRC_DIR = webrtc/modules/audio_processing/aecm
WEBRTC_COMMON_DIR = webrtc/common_audio/signal_processing
pluginsdir = $(libdir)/mediastreamer/plugins
......@@ -57,42 +58,42 @@ ISAC_BASE_SRCS += $(ISAC_SRC_DIR)/source/decode_plc.c \
$(ISAC_SRC_DIR)/source/lattice_c.c \
$(ISAC_SRC_DIR)/source/pitch_filter_c.c \
$(ISAC_SRC_DIR)/source/lpc_masking_model.c \
$(ISAC_COMMON_DIR)/spl_sqrt.c \
$(ISAC_COMMON_DIR)/real_fft.c \
$(ISAC_COMMON_DIR)/filter_ar_fast_q12.c \
$(ISAC_COMMON_DIR)/webrtc_fft_t_1024_8.c \
$(ISAC_COMMON_DIR)/complex_bit_reverse.c \
$(ISAC_COMMON_DIR)/spl_init.c \
$(ISAC_COMMON_DIR)/splitting_filter.c \
$(ISAC_COMMON_DIR)/spl_sqrt_floor.c \
$(ISAC_COMMON_DIR)/levinson_durbin.c \
$(ISAC_COMMON_DIR)/filter_ar.c \
$(ISAC_COMMON_DIR)/get_scaling_square.c \
$(ISAC_COMMON_DIR)/resample_fractional.c \
$(ISAC_COMMON_DIR)/resample.c \
$(ISAC_COMMON_DIR)/downsample_fast.c \
$(ISAC_COMMON_DIR)/filter_ma_fast_q12.c \
$(ISAC_COMMON_DIR)/auto_corr_to_refl_coef.c \
$(ISAC_COMMON_DIR)/auto_correlation.c \
$(ISAC_COMMON_DIR)/refl_coef_to_lpc.c \
$(ISAC_COMMON_DIR)/dot_product_with_scale.c \
$(ISAC_COMMON_DIR)/copy_set_operations.c \
$(ISAC_COMMON_DIR)/spl_version.c \
$(ISAC_COMMON_DIR)/cross_correlation.c \
$(ISAC_COMMON_DIR)/sqrt_of_one_minus_x_squared.c \
$(ISAC_COMMON_DIR)/ilbc_specific_functions.c \
$(ISAC_COMMON_DIR)/resample_by_2.c \
$(ISAC_COMMON_DIR)/complex_fft.c \
$(ISAC_COMMON_DIR)/resample_48khz.c \
$(ISAC_COMMON_DIR)/energy.c \
$(ISAC_COMMON_DIR)/get_hanning_window.c \
$(ISAC_COMMON_DIR)/randomization_functions.c \
$(ISAC_COMMON_DIR)/vector_scaling_operations.c \
$(ISAC_COMMON_DIR)/webrtc_fft_t_rad.c \
$(ISAC_COMMON_DIR)/resample_by_2_internal.c \
$(ISAC_COMMON_DIR)/lpc_to_refl_coef.c \
$(ISAC_COMMON_DIR)/min_max_operations.c \
$(ISAC_COMMON_DIR)/division_operations.c
$(WEBRTC_COMMON_DIR)/spl_sqrt.c \
$(WEBRTC_COMMON_DIR)/real_fft.c \
$(WEBRTC_COMMON_DIR)/filter_ar_fast_q12.c \
$(WEBRTC_COMMON_DIR)/webrtc_fft_t_1024_8.c \
$(WEBRTC_COMMON_DIR)/complex_bit_reverse.c \
$(WEBRTC_COMMON_DIR)/spl_init.c \
$(WEBRTC_COMMON_DIR)/splitting_filter.c \
$(WEBRTC_COMMON_DIR)/spl_sqrt_floor.c \
$(WEBRTC_COMMON_DIR)/levinson_durbin.c \
$(WEBRTC_COMMON_DIR)/filter_ar.c \
$(WEBRTC_COMMON_DIR)/get_scaling_square.c \
$(WEBRTC_COMMON_DIR)/resample_fractional.c \
$(WEBRTC_COMMON_DIR)/resample.c \
$(WEBRTC_COMMON_DIR)/downsample_fast.c \
$(WEBRTC_COMMON_DIR)/filter_ma_fast_q12.c \
$(WEBRTC_COMMON_DIR)/auto_corr_to_refl_coef.c \
$(WEBRTC_COMMON_DIR)/auto_correlation.c \
$(WEBRTC_COMMON_DIR)/refl_coef_to_lpc.c \
$(WEBRTC_COMMON_DIR)/dot_product_with_scale.c \
$(WEBRTC_COMMON_DIR)/copy_set_operations.c \
$(WEBRTC_COMMON_DIR)/spl_version.c \
$(WEBRTC_COMMON_DIR)/cross_correlation.c \
$(WEBRTC_COMMON_DIR)/sqrt_of_one_minus_x_squared.c \
$(WEBRTC_COMMON_DIR)/ilbc_specific_functions.c \
$(WEBRTC_COMMON_DIR)/resample_by_2.c \
$(WEBRTC_COMMON_DIR)/complex_fft.c \
$(WEBRTC_COMMON_DIR)/resample_48khz.c \
$(WEBRTC_COMMON_DIR)/energy.c \
$(WEBRTC_COMMON_DIR)/get_hanning_window.c \
$(WEBRTC_COMMON_DIR)/randomization_functions.c \
$(WEBRTC_COMMON_DIR)/vector_scaling_operations.c \
$(WEBRTC_COMMON_DIR)/webrtc_fft_t_rad.c \
$(WEBRTC_COMMON_DIR)/resample_by_2_internal.c \
$(WEBRTC_COMMON_DIR)/lpc_to_refl_coef.c \
$(WEBRTC_COMMON_DIR)/min_max_operations.c \
$(WEBRTC_COMMON_DIR)/division_operations.c
# TODO: use assembly-optimized versions when possible
# $(ISAC_SRC_DIR)/source/filters_neon.c \
......@@ -106,6 +107,7 @@ endif
libmswebrtc_la_SOURCES= \
mswebrtc.c \
aec.c \
$(ISAC_BASE_SRCS) isac_dec.c isac_enc.c
webrtc_repo = git://git.linphone.org/webrtc
......@@ -127,7 +129,8 @@ libmswebrtc_la_LDFLAGS=-module -no-undefined
webrtc_CFLAGS = -I$(webrtc_DIR) \
-I$(ISAC_SRC_DIR)/source -I$(ISAC_SRC_DIR)/util -I$(ISAC_SRC_DIR)/interface \
-I$(ISAC_COMMON_DIR)/include
-I$(AEC_SRC_DIR)/include -Iwebrtc/common_audio/signal_processing/include
-I$(WEBRTC_COMMON_DIR)/include
AM_CFLAGS= \
$(webrtc_CFLAGS) \
......
This diff is collapsed.
......@@ -196,51 +196,60 @@ static int filter_have_plc(MSFilter *f, void *arg)
*(int*)arg = 1;
return 0;
}
static MSFilterMethod filter_methods[]={
static MSFilterMethod filter_methods[] = {
{ MS_FILTER_SET_SAMPLE_RATE, filter_set_sample_rate },
{ MS_FILTER_GET_SAMPLE_RATE, filter_get_sample_rate },
{ MS_DECODER_HAVE_PLC, filter_have_plc },
{ 0, NULL}
{ MS_DECODER_HAVE_PLC, filter_have_plc },
{ 0, NULL }
};
#define MS_ISAC_DEC_NAME "MSiSACDec"
#define MS_ISAC_DEC_DESCRIPTION "iSAC audio decoder filter."
#define MS_ISAC_DEC_CATEGORY MS_FILTER_DECODER
#define MS_ISAC_DEC_ENC_FMT "iSAC"
#define MS_ISAC_DEC_NINPUTS 1
#define MS_ISAC_DEC_NOUTPUTS 1
#define MS_ISAC_DEC_FLAGS MS_FILTER_IS_PUMP
#ifdef _MSC_VER
MSFilterDesc ms_isac_dec_desc={
MS_FILTER_PLUGIN_ID, /* from Allfilters.h*/
"MSiSACDec",
"isac decoder filter.",
MS_FILTER_DECODER,
"iSAC",
1, /*number of inputs*/
1, /*number of outputs*/
MSFilterDesc ms_isac_dec_desc = {
MS_FILTER_PLUGIN_ID,
MS_ISAC_DEC_NAME,
MS_ISAC_DEC_DESCRIPTION,
MS_ISAC_DEC_CATEGORY,
MS_ISAC_DEC_ENC_FMT,
MS_ISAC_DEC_NINPUTS,
MS_ISAC_DEC_NOUTPUTS,
filter_init,
filter_preprocess,
filter_process,
filter_postprocess,
filter_uninit,
filter_methods,
MS_FILTER_IS_PUMP
MS_ISAC_DEC_FLAGS
};
#else
MSFilterDesc ms_isac_dec_desc={
.id=MS_FILTER_PLUGIN_ID, /* from Allfilters.h*/
.name="MSiSACDec",
.text="iSAC decoder filter.",
.category=MS_FILTER_DECODER,
.enc_fmt="iSAC",
.ninputs=1, /*number of inputs*/
.noutputs=1, /*number of outputs*/
.init=filter_init,
.preprocess=filter_preprocess,
.process=filter_process,
.postprocess=filter_postprocess,
.uninit=filter_uninit,
.methods=filter_methods,
.flags=MS_FILTER_IS_PUMP
MSFilterDesc ms_isac_dec_desc = {
.id = MS_FILTER_PLUGIN_ID,
.name = MS_ISAC_DEC_NAME,
.text = MS_ISAC_DEC_DESCRIPTION,
.category = MS_ISAC_DEC_CATEGORY,
.enc_fmt = MS_ISAC_DEC_ENC_FMT,
.ninputs = MS_ISAC_DEC_NINPUTS,
.noutputs = MS_ISAC_DEC_NOUTPUTS,
.init = filter_init,
.preprocess = filter_preprocess,
.process = filter_process,
.postprocess = filter_postprocess,
.uninit = filter_uninit,
.methods = filter_methods,
.flags = MS_ISAC_DEC_FLAGS
};
#endif
......
......@@ -215,52 +215,62 @@ static int filter_get_bitrate ( MSFilter *f, void *arg ) {
}
static MSFilterMethod filter_methods[]= {
{MS_FILTER_GET_SAMPLE_RATE, filter_get_sample_rate },
{MS_FILTER_SET_BITRATE, filter_set_bitrate },
{MS_FILTER_GET_BITRATE, filter_get_bitrate },
#ifdef MS_AUDIO_ENCODER_SET_PTIME
{MS_AUDIO_ENCODER_SET_PTIME, filter_set_ptime },
{MS_AUDIO_ENCODER_GET_PTIME, filter_get_ptime },
#endif
{0, NULL}
{ MS_FILTER_GET_SAMPLE_RATE, filter_get_sample_rate },
{ MS_FILTER_SET_BITRATE, filter_set_bitrate },
{ MS_FILTER_GET_BITRATE, filter_get_bitrate },
#ifdef MS_AUDIO_ENCODER_SET_PTIME
{ MS_AUDIO_ENCODER_SET_PTIME, filter_set_ptime },
{ MS_AUDIO_ENCODER_GET_PTIME, filter_get_ptime },
#endif
{ 0, NULL }
};
#define MS_ISAC_ENC_NAME "MSiSACEnc"
#define MS_ISAC_ENC_DESCRIPTION "iSAC audio encoder filter."
#define MS_ISAC_ENC_CATEGORY MS_FILTER_ENCODER
#define MS_ISAC_ENC_ENC_FMT "iSAC"
#define MS_ISAC_ENC_NINPUTS 1
#define MS_ISAC_ENC_NOUTPUTS 1
#define MS_ISAC_ENC_FLAGS 0
#ifdef _MSC_VER
MSFilterDesc ms_isac_enc_desc= {
MS_FILTER_PLUGIN_ID, /* from Allfilters.h*/
"MSiSACEnc",
"iSAC audio encoder filter.",
MS_FILTER_ENCODER,
"iSAC",
1, /*number of inputs*/
1, /*number of outputs*/
MSFilterDesc ms_isac_enc_desc = {
MS_FILTER_PLUGIN_ID,
MS_ISAC_ENC_NAME,
MS_ISAC_ENC_DESCRIPTION,
MS_ISAC_ENC_CATEGORY,
MS_ISAC_ENC_ENC_FMT,
MS_ISAC_ENC_NINPUTS,
MS_ISAC_ENC_NOUTPUTS,
filter_init,
filter_preprocess,
filter_process,
filter_postprocess,
filter_uninit,
filter_methods,
0
MS_ISAC_ENC_FLAGS
};
#else
MSFilterDesc ms_isac_enc_desc = {
.id=MS_FILTER_PLUGIN_ID, /* from Allfilters.h*/
.name="MSiSACEnc",
.text="iSAC audio encoder filter.",
.category=MS_FILTER_ENCODER,
.enc_fmt="iSAC",
.ninputs=1, /*number of inputs*/
.noutputs=1, /*number of outputs*/
.init=filter_init,
.preprocess=filter_preprocess,
.process=filter_process,
.postprocess=filter_postprocess,
.uninit=filter_uninit,
.methods=filter_methods
.id = MS_FILTER_PLUGIN_ID,
.name = MS_ISAC_ENC_NAME,
.text = MS_ISAC_ENC_DESCRIPTION,
.category = MS_ISAC_ENC_CATEGORY,
.enc_fmt = MS_ISAC_ENC_ENC_FMT,
.ninputs = MS_ISAC_ENC_NINPUTS,
.noutputs = MS_ISAC_ENC_NOUTPUTS,
.init = filter_init,
.preprocess = filter_preprocess,
.process = filter_process,
.postprocess = filter_postprocess,
.uninit = filter_uninit,
.methods = filter_methods,
.flags = MS_ISAC_ENC_FLAGS
};
#endif
......
......@@ -28,6 +28,7 @@
extern MSFilterDesc ms_isac_dec_desc;
extern MSFilterDesc ms_isac_enc_desc;
extern MSFilterDesc ms_webrtc_aec_desc;
#ifndef VERSION
#define VERSION "debug"
......@@ -46,10 +47,11 @@ MS_PLUGIN_DECLARE ( void ) libmswebrtc_init() {
WebRtcSpl_Init();
WebRtcIsacfix_version(isac_version);
ms_filter_register ( &ms_isac_enc_desc );
ms_filter_register ( &ms_isac_dec_desc );
ms_filter_register(&ms_isac_enc_desc);
ms_filter_register(&ms_isac_dec_desc);
ms_filter_register(&ms_webrtc_aec_desc);
ms_message ( " libmswebrtc " VERSION " plugin loaded, iSAC codec version %s", isac_version );
ms_message("libmswebrtc " VERSION " plugin loaded, iSAC codec version %s", isac_version);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment