summaryrefslogtreecommitdiff
path: root/third_party/ilbc/syntFilter.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-04-07 12:47:34 +0000
committerBenny Prijono <bennylp@teluu.com>2007-04-07 12:47:34 +0000
commit81d1b2797aa3945c529d57f9ddf6179ec2b392a4 (patch)
tree2ae3b710e8152fb1140653473fbc338a6638178e /third_party/ilbc/syntFilter.c
parent3ade1510e72926d02d7c7d4416257449bc0cd3f3 (diff)
Moved ilbc to third_party directory
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/split-3rd-party@1169 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party/ilbc/syntFilter.c')
-rw-r--r--third_party/ilbc/syntFilter.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/third_party/ilbc/syntFilter.c b/third_party/ilbc/syntFilter.c
new file mode 100644
index 00000000..190eb009
--- /dev/null
+++ b/third_party/ilbc/syntFilter.c
@@ -0,0 +1,80 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ syntFilter.c
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #include "iLBC_define.h"
+
+ /*----------------------------------------------------------------*
+ * LP synthesis filter.
+ *---------------------------------------------------------------*/
+
+ void syntFilter(
+ float *Out, /* (i/o) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len, /* (i) Length of signal */
+
+
+
+
+
+ float *mem /* (i/o) Filter state */
+ ){
+ int i, j;
+ float *po, *pi, *pa, *pm;
+
+ po=Out;
+
+ /* Filter first part using memory from past */
+
+ for (i=0; i<LPC_FILTERORDER; i++) {
+ pi=&Out[i-1];
+ pa=&a[1];
+ pm=&mem[LPC_FILTERORDER-1];
+ for (j=1; j<=i; j++) {
+ *po-=(*pa++)*(*pi--);
+ }
+ for (j=i+1; j<LPC_FILTERORDER+1; j++) {
+ *po-=(*pa++)*(*pm--);
+ }
+ po++;
+ }
+
+ /* Filter last part where the state is entirely in
+ the output vector */
+
+ for (i=LPC_FILTERORDER; i<len; i++) {
+ pi=&Out[i-1];
+ pa=&a[1];
+ for (j=1; j<LPC_FILTERORDER+1; j++) {
+ *po-=(*pa++)*(*pi--);
+ }
+ po++;
+ }
+
+ /* Update state vector */
+
+ memcpy(mem, &Out[len-LPC_FILTERORDER],
+ LPC_FILTERORDER*sizeof(float));
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+