summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2015-02-11 05:10:06 +0000
committerNanang Izzuddin <nanang@teluu.com>2015-02-11 05:10:06 +0000
commitdbae9140153559747dcb6b12c3fda2c139836733 (patch)
tree828af5380da669d59fc6373ec6789c460667159b
parent4a278132621eafe2c1a9f86d7aab6455ba774b25 (diff)
Misc (re #1782): added compile-time settings for Speex AGC & denoiser in Speex AEC, note that both are enabled by default, as previously AGC was enabled (by pjmedia, as it seems to improve AEC performance) and denoiser was also enabled by default by Speex.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4981 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/include/pjmedia/config.h21
-rw-r--r--pjmedia/src/pjmedia/echo_speex.c10
2 files changed, 29 insertions, 2 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index c075538b..8bd622ba 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -636,6 +636,27 @@
/**
+ * Specify whether Automatic Gain Control (AGC) should also be enabled in
+ * Speex AEC.
+ *
+ * Default: 1 (yes)
+ */
+#ifndef PJMEDIA_SPEEX_AEC_USE_AGC
+# define PJMEDIA_SPEEX_AEC_USE_AGC 1
+#endif
+
+
+/**
+ * Specify whether denoise should also be enabled in Speex AEC.
+ *
+ * Default: 1 (yes)
+ */
+#ifndef PJMEDIA_SPEEX_AEC_USE_DENOISE
+# define PJMEDIA_SPEEX_AEC_USE_DENOISE 1
+#endif
+
+
+/**
* Maximum number of parameters in SDP fmtp attribute.
*
* Default: 16
diff --git a/pjmedia/src/pjmedia/echo_speex.c b/pjmedia/src/pjmedia/echo_speex.c
index 18f42b3b..fca460eb 100644
--- a/pjmedia/src/pjmedia/echo_speex.c
+++ b/pjmedia/src/pjmedia/echo_speex.c
@@ -109,11 +109,17 @@ PJ_DEF(pj_status_t) speex_aec_create(pj_pool_t *pool,
&enabled);
#endif
- /* Enable AGC */
+ /* Enable/disable AGC & denoise */
{
- spx_int32_t enabled = 1;
+ spx_int32_t enabled;
+
+ enabled = PJMEDIA_SPEEX_AEC_USE_AGC;
speex_preprocess_ctl(echo->preprocess, SPEEX_PREPROCESS_SET_AGC,
&enabled);
+
+ enabled = PJMEDIA_SPEEX_AEC_USE_DENOISE;
+ speex_preprocess_ctl(echo->preprocess, SPEEX_PREPROCESS_SET_DENOISE,
+ &enabled);
}
/* Control echo cancellation in the preprocessor */