summaryrefslogtreecommitdiff
path: root/mec3.h
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-01 00:55:41 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-01 00:55:41 +0000
commit13179eb2fc4b2384550a1681513986584634bfd6 (patch)
tree5e450b5b4ef50a7dfb8268e75d04785ab0adc13e /mec3.h
parent7976f3ed8ba610c565d4cd80a7f8c0643005de49 (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 'mec3.h')
-rw-r--r--mec3.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/mec3.h b/mec3.h
index e28c66b..b5cb56f 100644
--- a/mec3.h
+++ b/mec3.h
@@ -69,7 +69,7 @@ typedef struct {
int maxexp;
} cbuf_s;
-typedef struct {
+struct echo_can_state {
short a_s[NTAPS]; /* Coefficients in shorts */
int a_i[NTAPS]; /* Coefficients in ints*/
#ifdef DO_BACKUP
@@ -85,9 +85,18 @@ typedef struct {
int hcntr; /* Hangtime counter */
int pos; /* Position in curcular buffers */
int backup; /* Backup timer */
-} echo_can_state_t;
+};
+
+static void echo_can_init(void)
+{
+ printk("Zaptel Echo Canceller: MARK3%s\n", ZAPTEL_ECHO_AGGRESSIVE);
+}
+
+static void echo_can_shutdown(void)
+{
+}
-static inline void echo_can_free(echo_can_state_t *ec)
+static inline void echo_can_free(struct echo_can_state *ec)
{
FREE(ec);
}
@@ -114,7 +123,7 @@ static inline void buf_add(cbuf_s *b, short sample, int pos, int taps)
}
}
-static inline short echo_can_update(echo_can_state_t *ec, short ref, short sig)
+static inline short echo_can_update(struct echo_can_state *ec, short ref, short sig)
{
int x;
short u;
@@ -204,15 +213,15 @@ static inline short echo_can_update(echo_can_state_t *ec, short ref, short sig)
return u;
}
-static inline echo_can_state_t *echo_can_create(int taps, int adaption_mode)
+static inline struct echo_can_state *echo_can_create(int taps, int adaption_mode)
{
- echo_can_state_t *ec;
+ struct echo_can_state *ec;
int x;
taps = NTAPS;
- ec = MALLOC(sizeof(echo_can_state_t));
+ ec = MALLOC(sizeof(struct echo_can_state));
if (ec) {
- memset(ec, 0, sizeof(echo_can_state_t));
+ memset(ec, 0, sizeof(struct echo_can_state));
ec->taps = taps;
ec->pos = ec->taps-1;
for (x=0;x<31;x++) {
@@ -225,7 +234,7 @@ static inline echo_can_state_t *echo_can_create(int taps, 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 */