summaryrefslogtreecommitdiff
path: root/mec.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 /mec.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 'mec.h')
-rw-r--r--mec.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/mec.h b/mec.h
index f399e1b..51c8bbe 100644
--- a/mec.h
+++ b/mec.h
@@ -53,7 +53,7 @@
#define HANG_T 600 /* 600 samples, or 75ms */
-typedef struct mark_ec {
+struct echo_can_state {
/* Circular position */
int cpos;
short y[NUM_TAPS]; /* Last N samples (relative to cpos) transmitted */
@@ -80,7 +80,7 @@ typedef struct mark_ec {
int lastmax; /* Optimize maximum search */
int maxTy; /* Maximum Ty */
-} echo_can_state_t;
+};
#define INLINE inline
@@ -98,11 +98,20 @@ typedef struct mark_ec {
#define FREE(a) free(a)
#endif
-static INLINE echo_can_state_t *echo_can_create(int len, int adaption_mode)
+static void echo_can_init(void)
{
- echo_can_state_t *ec;
+ printk("Zaptel Echo Canceller: MARK%s\n", ZAPTEL_ECHO_AGGRESSIVE);
+}
+
+static void echo_can_shutdown(void)
+{
+}
+
+static INLINE struct echo_can_state *echo_can_create(int len, int adaption_mode)
+{
+ struct echo_can_state *ec;
/* Uhm, we're only one length, sorry. */
- ec = MALLOC(sizeof(echo_can_state_t));
+ ec = MALLOC(sizeof(struct echo_can_state));
if (ec)
memset(ec, 0, sizeof(*ec));
return ec;
@@ -111,12 +120,12 @@ static INLINE echo_can_state_t *echo_can_create(int len, int adaption_mode)
#define PASSPOS 32000
#undef PASSPOS
-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 int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx)
+static INLINE int16_t echo_can_update(struct echo_can_state *ec, int16_t tx, int16_t rx)
{
/* Process a sample, where tx is the near end and rx is the far end + echo */
@@ -292,7 +301,7 @@ static INLINE int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t
return suppr;
}
-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 */