diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-14 05:15:48 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-14 05:15:48 +0000 |
commit | 92a945abe63a2579c66257696ddda848ab5a3ea0 (patch) | |
tree | 0deebbd8647eb5799eef8ddc6f084ec945574299 /codecs/ilbc/anaFilter.c | |
parent | 850b151d70bb9a1dc28edd3c0d737b57b1ab43cc (diff) |
Update to new iLBC codec
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3997 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/ilbc/anaFilter.c')
-rwxr-xr-x | codecs/ilbc/anaFilter.c | 139 |
1 files changed, 70 insertions, 69 deletions
diff --git a/codecs/ilbc/anaFilter.c b/codecs/ilbc/anaFilter.c index 268c9266c..1c9e71889 100755 --- a/codecs/ilbc/anaFilter.c +++ b/codecs/ilbc/anaFilter.c @@ -1,69 +1,70 @@ - -/****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - anaFilter.c - - Copyright (c) 2001, - Global IP Sound AB. - All rights reserved. - -******************************************************************/ - -#include <string.h> -#include "iLBC_define.h" -#include "anaFilter.h" - -/*----------------------------------------------------------------* - * LP analysis filter. - *---------------------------------------------------------------*/ - -void anaFilter( - float *In, /* (i) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len,/* (i) Length of signal */ - float *Out, /* (o) Filtered signal */ - float *mem /* (i/o) Filter state */ -){ - int i, j; - float *po, *pi, *pm, *pa; - - po = Out; - - /* Filter first part using memory from past */ - - for (i=0;i<LPC_FILTERORDER;i++) { - pi = &In[i]; - pm = &mem[LPC_FILTERORDER-1]; - pa = a; - *po=0.0; - for (j=0;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 entierly - in the input vector */ - - for (i=LPC_FILTERORDER;i<len;i++) { - pi = &In[i]; - pa = a; - *po=0.0; - for (j=0;j<LPC_FILTERORDER+1;j++) { - *po+=(*pa++)*(*pi--); - } - po++; - } - - /* Update state vector */ - - memcpy(mem, &In[len-LPC_FILTERORDER], - LPC_FILTERORDER*sizeof(float)); -} - - + +/****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + anaFilter.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + +******************************************************************/ + +#include <string.h> +#include "iLBC_define.h" + +/*----------------------------------------------------------------* + * LP analysis filter. + + + *---------------------------------------------------------------*/ + +void anaFilter( + float *In, /* (i) Signal to be filtered */ + float *a, /* (i) LP parameters */ + int len,/* (i) Length of signal */ + float *Out, /* (o) Filtered signal */ + float *mem /* (i/o) Filter state */ +){ + int i, j; + float *po, *pi, *pm, *pa; + + po = Out; + + /* Filter first part using memory from past */ + + for (i=0; i<LPC_FILTERORDER; i++) { + pi = &In[i]; + pm = &mem[LPC_FILTERORDER-1]; + pa = a; + *po=0.0; + for (j=0; 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 entierly + in the input vector */ + + for (i=LPC_FILTERORDER; i<len; i++) { + pi = &In[i]; + pa = a; + *po=0.0; + for (j=0; j<LPC_FILTERORDER+1; j++) { + *po+=(*pa++)*(*pi--); + } + po++; + } + + /* Update state vector */ + + memcpy(mem, &In[len-LPC_FILTERORDER], + LPC_FILTERORDER*sizeof(float)); +} + + |