mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-26 21:24:16 +00:00
swap to new ilbc library
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12095 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
d6993cb472
commit
749114b704
191 files changed
+60584
-19045
No files matched your search
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* iLBC - a library for the iLBC codec
|
||||
*
|
||||
* hpInput.c - The iLBC low bit rate speech codec.
|
||||
*
|
||||
* Adapted by Steve Underwood <steveu@coppice.org> from the reference
|
||||
* iLBC code supplied in RFC3951.
|
||||
*
|
||||
* Original code Copyright (C) The Internet Society (2004).
|
||||
* All changes to produce this version Copyright (C) 2008 by Steve Underwood
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: hpInput.c,v 1.2 2008/03/06 12:27:38 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "constants.h"
|
||||
#include "hpInput.h"
|
||||
|
||||
/*----------------------------------------------------------------*
|
||||
* Input high-pass filter
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void hpInput(const 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;
|
||||
const float *pi;
|
||||
float *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++;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user