diff options
author | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-08-24 00:45:04 +0000 |
---|---|---|
committer | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-08-24 00:45:04 +0000 |
commit | a0b6bc0f658438cb74ea463c5d86fa538c4f23c2 (patch) | |
tree | 8d525445f37551fe4c1c6ec88501736edba8d5ba | |
parent | a4b7eb8824a55258d5a0410881835f196f12c8ad (diff) |
Small fixes for mec2 echo can from #6937
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@744 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-x | mec2.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -163,6 +163,7 @@ static inline void init_cc(echo_can_state_t *ec, int N, int maxy, int maxu) { // reset the near-end speech detector // ec->s_tilde_i = 0; + ec->y_tilde_i = 0; ec->HCNTR_d = (int)0; // exit gracefully @@ -239,9 +240,10 @@ static inline short echo_can_update(echo_can_state_t *ec, short iref, short isig /* compute the new convergence factor */ - Py_i = (ec->Ly_i >> DEFAULT_SIGMA_LY_I) * (ec->Ly_i >> DEFAULT_SIGMA_LY_I); - Py_i >>= 15; - if (ec->HCNTR_d > 0) { + if (!ec->HCNTR_d) { + Py_i = (ec->Ly_i >> DEFAULT_SIGMA_LY_I) * (ec->Ly_i >> DEFAULT_SIGMA_LY_I); + Py_i >>= 15; + } else { Py_i = (1 << 15); } |