summaryrefslogtreecommitdiff
path: root/kb1ec.h
diff options
context:
space:
mode:
authorqwell <qwell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-05-17 17:17:42 +0000
committerqwell <qwell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-05-17 17:17:42 +0000
commit94317b45c73ae3b754c79d2fded509ee68ca23f5 (patch)
treee400d762b829005d5d8373ac65fbee433bc02422 /kb1ec.h
parent674b54763cf42fc3f04d821be3e063313564f8f2 (diff)
Add support for "Timed Agressive Echo Cancellation" for mg2 and kb1.
Issue 9703, patch by SoloFlyer. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2526 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kb1ec.h')
-rw-r--r--kb1ec.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/kb1ec.h b/kb1ec.h
index 7fbede0..b4a1370 100644
--- a/kb1ec.h
+++ b/kb1ec.h
@@ -435,6 +435,9 @@ static inline short echo_can_update(struct echo_can_state *ec, short iref, short
#ifndef NO_ECHO_SUPPRESSOR
#ifdef AGGRESSIVE_SUPPRESSOR
+#ifdef AGGRESSIVE_TIMELIMIT
+ if (ec->i_d < AGGRESSIVE_TIMELIMIT ) {
+#endif
if ((ec->HCNTR_d < AGGRESSIVE_HCNTR) && (ec->Ly_i > (ec->Lu_i << 1))) {
for (k=0; k < RESIDUAL_SUPRESSION_PASSES; k++) {
u = u * (ec->Lu_i >> DEFAULT_SIGMA_LU_I) / ((ec->Ly_i >> (DEFAULT_SIGMA_LY_I)) + 1);
@@ -446,7 +449,12 @@ static inline short echo_can_update(struct echo_can_state *ec, short iref, short
++ec->cntr_residualcorrected_frames;
#endif
}
-#else
+#ifdef AGGRESSIVE_TIMELIMIT
+ }
+ else {
+#endif
+#endif
+#if (defined AGGRESSIVE_SUPPRESSOR && defined AGGRESSIVE_TIMELIMIT) || !defined AGGRESSIVE_SUPPRESSOR
if (ec->HCNTR_d == 0) {
if ((ec->Ly_i/(ec->Lu_i + 1)) > DEFAULT_SUPPR_I) {
for (k=0; k < RESIDUAL_SUPRESSION_PASSES; k++) {
@@ -465,6 +473,9 @@ static inline short echo_can_update(struct echo_can_state *ec, short iref, short
}
#endif
}
+#ifdef AGGRESSIVE_TIMELIMIT
+ }
+#endif
#endif
#endif