summaryrefslogtreecommitdiff
path: root/codecs/ilbc/hpOutput.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-04-15 04:36:52 +0000
committerMark Spencer <markster@digium.com>2003-04-15 04:36:52 +0000
commitc4da749362b2842ba0478dcdb309c29dd353c795 (patch)
tree468bcd1944564d1b84b5a9d46b2eb437fe3c73a3 /codecs/ilbc/hpOutput.c
parentdbe00ec2d2029c61ffb7b58ee6184274058767f4 (diff)
Add iLBC codec
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'codecs/ilbc/hpOutput.c')
-rwxr-xr-xcodecs/ilbc/hpOutput.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/codecs/ilbc/hpOutput.c b/codecs/ilbc/hpOutput.c
new file mode 100755
index 000000000..fa75f2578
--- /dev/null
+++ b/codecs/ilbc/hpOutput.c
@@ -0,0 +1,58 @@
+
+/******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ hpOutput.c
+
+ Copyright (c) 2001,
+ Global IP Sound AB.
+ All rights reserved.
+
+******************************************************************/
+
+#include "constants.h"
+
+/*----------------------------------------------------------------*
+ * Output high-pass filter
+ *---------------------------------------------------------------*/
+
+void hpOutput(
+ float *In, /* (i) vector to filter */
+ int len,/* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+){
+ int i;
+ float *pi, *po;
+
+ /* all-zero section*/
+
+ pi = &In[0];
+ po = &Out[0];
+ for (i=0; i<len; i++) {
+ *po = hpo_zero_coefsTbl[0] * (*pi);
+ *po += hpo_zero_coefsTbl[1] * mem[0];
+ *po += hpo_zero_coefsTbl[2] * mem[1];
+
+ mem[1] = mem[0];
+ mem[0] = *pi;
+ po++;
+ pi++;
+
+ }
+
+ /* all-pole section*/
+
+ po = &Out[0];
+ for (i=0; i<len; i++) {
+ *po -= hpo_pole_coefsTbl[1] * mem[2];
+ *po -= hpo_pole_coefsTbl[2] * mem[3];
+
+ mem[3] = mem[2];
+ mem[2] = *po;
+ po++;
+ }
+}
+
+