aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/ilbc/hpInput.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-15 04:36:52 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-15 04:36:52 +0000
commit9fa1f6563a431a73d7eb0c8a284e4cf419cbc2fa (patch)
tree468bcd1944564d1b84b5a9d46b2eb437fe3c73a3 /codecs/ilbc/hpInput.c
parent0cc1bf692bcfc7f3f9ffef9d62c6621cd9ab9f4a (diff)
Add iLBC codec
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@852 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/ilbc/hpInput.c')
-rwxr-xr-xcodecs/ilbc/hpInput.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/codecs/ilbc/hpInput.c b/codecs/ilbc/hpInput.c
new file mode 100755
index 000000000..1599c2923
--- /dev/null
+++ b/codecs/ilbc/hpInput.c
@@ -0,0 +1,58 @@
+
+/******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ hpInput.c
+
+ Copyright (c) 2001,
+ Global IP Sound AB.
+ All rights reserved.
+
+******************************************************************/
+
+#include "constants.h"
+
+/*----------------------------------------------------------------*
+ * Input high-pass filter
+ *---------------------------------------------------------------*/
+
+void hpInput(
+ 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 = hpi_zero_coefsTbl[0] * (*pi);
+ *po += hpi_zero_coefsTbl[1] * mem[0];
+ *po += hpi_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 -= hpi_pole_coefsTbl[1] * mem[2];
+ *po -= hpi_pole_coefsTbl[2] * mem[3];
+
+ mem[3] = mem[2];
+ mem[2] = *po;
+ po++;
+ }
+}
+
+