diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-02-01 00:55:41 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-02-01 00:55:41 +0000 |
commit | 13179eb2fc4b2384550a1681513986584634bfd6 (patch) | |
tree | 5e450b5b4ef50a7dfb8268e75d04785ab0adc13e /mec2.h | |
parent | 7976f3ed8ba610c565d4cd80a7f8c0643005de49 (diff) |
add support for Digium's High Performance Echo Canceller
rework the top-level Makefile so kernel 2.6 modules are built by a dedicated Makefile
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2076 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'mec2.h')
-rw-r--r-- | mec2.h | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -51,7 +51,7 @@ typedef struct { // class definition // -typedef struct { +struct echo_can_state { /* Echo canceller definition */ /* absolute time */ @@ -86,7 +86,16 @@ typedef struct { short max_y_tilde; int max_y_tilde_pos; -} echo_can_state_t; +}; + +static void echo_can_init(void) +{ + printk("Zaptel Echo Canceller: MARK2%s\n", ZAPTEL_ECHO_AGGRESSIVE); +} + +static void echo_can_shutdown(void) +{ +} static inline void init_cb_s(echo_can_cb_s *cb, int len, void *where) { @@ -112,12 +121,12 @@ static inline short get_cc_s(echo_can_cb_s *cb, int pos) return cb->buf_d[cb->idx_d + pos]; } -static inline void init_cc(echo_can_state_t *ec, int N, int maxy, int maxu) { +static inline void init_cc(struct echo_can_state *ec, int N, int maxy, int maxu) { void *ptr = ec; unsigned long tmp; /* double-word align past end of state */ - ptr += sizeof(echo_can_state_t); + ptr += sizeof(struct echo_can_state); tmp = (unsigned long)ptr; tmp += 3; tmp &= ~3L; @@ -170,12 +179,12 @@ static inline void init_cc(echo_can_state_t *ec, int N, int maxy, int maxu) { // } -static inline void echo_can_free(echo_can_state_t *ec) +static inline void echo_can_free(struct echo_can_state *ec) { FREE(ec); } -static inline short echo_can_update(echo_can_state_t *ec, short iref, short isig) { +static inline short echo_can_update(struct echo_can_state *ec, short iref, short isig) { /* declare local variables that are used more than once */ @@ -370,9 +379,9 @@ static inline short echo_can_update(echo_can_state_t *ec, short iref, short isig return u; } -static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) +static inline struct echo_can_state *echo_can_create(int len, int adaption_mode) { - echo_can_state_t *ec; + struct echo_can_state *ec; int maxy; int maxu; maxy = len + DEFAULT_M; @@ -383,7 +392,7 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) maxy = (1 << DEFAULT_SIGMA_LY_I); if (maxu < (1 << DEFAULT_SIGMA_LU_I)) maxu = (1 << DEFAULT_SIGMA_LU_I); - ec = (echo_can_state_t *)MALLOC(sizeof(echo_can_state_t) + + ec = (struct echo_can_state *)MALLOC(sizeof(struct echo_can_state) + 4 + /* align */ sizeof(int) * len + /* a_i */ sizeof(short) * len + /* a_s */ @@ -392,7 +401,7 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) 2 * sizeof(short) * (maxu) + /* u_s */ 2 * sizeof(short) * len); /* y_tilde_s */ if (ec) { - memset(ec, 0, sizeof(echo_can_state_t) + + memset(ec, 0, sizeof(struct echo_can_state) + 4 + /* align */ sizeof(int) * len + /* a_i */ sizeof(short) * len + /* a_s */ @@ -405,7 +414,7 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) return ec; } -static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val) +static inline int echo_can_traintap(struct echo_can_state *ec, int pos, short val) { /* Reset hang counter to avoid adjustments after initial forced training */ |