Commit 98ca1ddc authored by jm's avatar jm
Browse files

Made the code valid for a C++ compiler (void* stuff), plus some cleanup


git-svn-id: http://svn.xiph.org/trunk/speex@4060 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 5d10b870
## Process this file with automake to produce Makefile.in. -*-Makefile-*-
# $Id: Makefile.am,v 1.41 2002/10/26 04:37:15 jm Exp $
# $Id: Makefile.am,v 1.42 2002/10/27 06:01:30 jm Exp $
# Disable automatic dependency tracking if using other tools than gcc and gmake
#AUTOMAKE_OPTIONS = no-dependencies
......@@ -60,7 +60,7 @@ noinst_HEADERS = lsp.h \
libspeex_la_LDFLAGS = -release $(LT_RELEASE)
bin_PROGRAMS = testenc testenc_wb
noinst_PROGRAMS = testenc testenc_wb
testenc_SOURCES = testenc.c
testenc_LDADD = libspeex.la
......
......@@ -40,7 +40,7 @@
void speex_bits_init(SpeexBits *bits)
{
int i;
bits->bytes = speex_alloc(MAX_BYTES_PER_FRAME);
bits->bytes = (char*)speex_alloc(MAX_BYTES_PER_FRAME);
for (i=0;i<MAX_BYTES_PER_FRAME;i++)
bits->bytes[i]=0;
......@@ -53,7 +53,7 @@ void speex_bits_init(SpeexBits *bits)
void speex_bits_init_buffer(SpeexBits *bits, void *buff)
{
int i;
bits->bytes = buff;
bits->bytes = (char*)buff;
for (i=0;i<MAX_BYTES_PER_FRAME;i++)
bits->bytes[i]=0;
......
......@@ -55,10 +55,9 @@ int complexity
int i,j,k,m,n,q;
float *resp;
float *t, *e, *E, *r2;
/*FIXME: Should make this dynamic*/
float *tmp, *_ot[20], *_nt[20];
float *tmp;
float *ndist, *odist;
int *itmp, *_nind[20], *_oind[20];
int *itmp;
float **ot, **nt;
int **nind, **oind;
int *ind;
......@@ -70,14 +69,15 @@ int complexity
float *best_dist;
int have_sign;
ot=_ot;
nt=_nt;
oind=_oind;
nind=_nind;
N=complexity;
if (N>10)
N=10;
ot=PUSH(stack, N, float*);
nt=PUSH(stack, N, float*);
oind=PUSH(stack, N, int*);
nind=PUSH(stack, N, int*);
params = (split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
......
......@@ -32,17 +32,8 @@
#include "filters.h"
#include "stack_alloc.h"
#include <stdio.h>
#include <math.h>
void print_vec(float *vec, int len, char *name)
{
int i;
printf ("%s ", name);
for (i=0;i<len;i++)
printf (" %f", vec[i]);
printf ("\n");
}
void bw_lpc(float gamma, float *lpc_in, float *lpc_out, int order)
{
......@@ -131,16 +122,17 @@ void residue_percep_zero(float *xx, float *ak, float *awk1, float *awk2, float *
fir_mem2(y, awk2, y, N, ord, mem);
}
#define MAX_FILTER 100
#define MAX_SIGNAL 1000
void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem)
void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem, void *stack)
{
int i,j,k,M2;
/* FIXME: this should be dynamic */
float a[MAX_FILTER];
float x[MAX_SIGNAL];
float *x2=x+M-1;
float *a;
float *x;
float *x2;
a = PUSH(stack, M, float);
x = PUSH(stack, N+M-1, float);
x2=x+M-1;
M2=M>>1;
for (i=0;i<M;i++)
a[M-i-1]=aa[i];
......@@ -166,14 +158,13 @@ void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float
}
/* By segher */
void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem)
void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem, void *stack)
/* assumptions:
all odd x[i] are zero -- well, actually they are left out of the array now
N and M are multiples of 4 */
{
int i, j;
/*FIXME: Make that dynamic*/
float xx[384];
float *xx=PUSH(stack, M+N-1, float);
for (i = 0; i < N/2; i++)
xx[2*i] = x[N/2-1-i];
......
......@@ -33,10 +33,9 @@
#ifndef FILTERS_H
#define FILTERS_H
void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem);
void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem);
void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem, void *stack);
void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem, void *stack);
void print_vec(float *vec, int len, char *name);
void filter_mem2(float *x, float *num, float *den, float *y, int N, int ord, float *mem);
void fir_mem2(float *x, float *num, float *y, int N, int ord, float *mem);
......
......@@ -68,7 +68,7 @@ Modified by Jean-Marc Valin
float cheb_poly_eva(float *coef,float x,int m,float *stack)
float cheb_poly_eva(float *coef,float x,int m,void *stack)
/* float coef[] coefficients of the polynomial to be evaluated */
/* float x the point where polynomial is to be evaluated */
/* int m order of the polynomial */
......
......@@ -357,8 +357,8 @@ int complexity
N=complexity;
if (N>10)
N=10;
/*FIXME: This breaks if sizeof(int) != sizeof(float) */
nbest=(int*)PUSH(stack, N, float);
nbest=PUSH(stack, N, int);
gains = PUSH(stack, N, float);
params = (ltp_params*) par;
......
......@@ -84,9 +84,7 @@ static float inner_prod(float *a, float *b, int len)
movhlps %%xmm3, %%xmm4
addps %%xmm4, %%xmm3
movaps %%xmm3, %%xmm4
//FIXME: which one?
shufps $0x55, %%xmm4, %%xmm4
//shufps $33, %%xmm4, %%xmm4
addss %%xmm4, %%xmm3
movss %%xmm3, (%%edx)
......
......@@ -33,6 +33,18 @@
#include "misc.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifndef RELEASE
void print_vec(float *vec, int len, char *name)
{
int i;
printf ("%s ", name);
for (i=0;i<len;i++)
printf (" %f", vec[i]);
printf ("\n");
}
#endif
unsigned int be_int(unsigned int i)
{
......
......@@ -39,6 +39,10 @@
#define VERSION "Speex-1.0beta2"
#endif
#ifndef RELEASE
void print_vec(float *vec, int len, char *name);
#endif
unsigned int be_int(unsigned int i);
unsigned int le_int(unsigned int i);
......
......@@ -506,7 +506,7 @@ void speex_decoder_ctl(void *state, int request, void *ptr)
static void nb_mode_query(void *mode, int request, void *ptr)
{
SpeexNBMode *m = mode;
SpeexNBMode *m = (SpeexNBMode*)mode;
switch (request)
{
......@@ -524,7 +524,7 @@ static void nb_mode_query(void *mode, int request, void *ptr)
static void wb_mode_query(void *mode, int request, void *ptr)
{
SpeexSBMode *m = mode;
SpeexSBMode *m = (SpeexSBMode*)mode;
switch (request)
{
......
......@@ -67,8 +67,8 @@ void *nb_encoder_init(SpeexMode *m)
SpeexNBMode *mode;
int i;
mode=m->mode;
st = speex_alloc(sizeof(EncState));
mode=(SpeexNBMode *)m->mode;
st = (EncState*)speex_alloc(sizeof(EncState));
st->mode=m;
/* Codec parameters, should eventually have several "modes"*/
st->frameSize = mode->frameSize;
......@@ -92,71 +92,71 @@ void *nb_encoder_init(SpeexMode *m)
st->bounded_pitch = 0;
/* Allocating input buffer */
st->inBuf = speex_alloc(st->bufSize*sizeof(float));
st->inBuf = (float*)speex_alloc(st->bufSize*sizeof(float));
st->frame = st->inBuf + st->bufSize - st->windowSize;
/* Allocating excitation buffer */
st->excBuf = speex_alloc(st->bufSize*sizeof(float));
st->excBuf = (float*)speex_alloc(st->bufSize*sizeof(float));
st->exc = st->excBuf + st->bufSize - st->windowSize;
st->swBuf = speex_alloc(st->bufSize*sizeof(float));
st->swBuf = (float*)speex_alloc(st->bufSize*sizeof(float));
st->sw = st->swBuf + st->bufSize - st->windowSize;
st->exc2Buf = speex_alloc(st->bufSize*sizeof(float));
st->exc2Buf = (float*)speex_alloc(st->bufSize*sizeof(float));
st->exc2 = st->exc2Buf + st->bufSize - st->windowSize;
st->innov = speex_alloc(st->frameSize*sizeof(float));
st->innov = (float*)speex_alloc(st->frameSize*sizeof(float));
/* Asymetric "pseudo-Hamming" window */
{
int part1, part2;
part1 = st->subframeSize*7/2;
part2 = st->subframeSize*5/2;
st->window = speex_alloc(st->windowSize*sizeof(float));
st->window = (float*)speex_alloc(st->windowSize*sizeof(float));
for (i=0;i<part1;i++)
st->window[i]=.54-.46*cos(M_PI*i/part1);
for (i=0;i<part2;i++)
st->window[part1+i]=.54+.46*cos(M_PI*i/part2);
}
/* Create the window for autocorrelation (lag-windowing) */
st->lagWindow = speex_alloc((st->lpcSize+1)*sizeof(float));
st->lagWindow = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
for (i=0;i<st->lpcSize+1;i++)
st->lagWindow[i]=exp(-.5*sqr(2*M_PI*st->lag_factor*i));
st->autocorr = speex_alloc((st->lpcSize+1)*sizeof(float));
st->autocorr = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->stack = speex_alloc(20000*sizeof(float));
st->stack = (float*)speex_alloc(20000*sizeof(float));
st->buf2 = (float*)speex_alloc(st->windowSize*sizeof(float));
st->buf2 = speex_alloc(st->windowSize*sizeof(float));
st->lpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->interp_lpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->interp_qlpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc1 = speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc2 = speex_alloc((st->lpcSize+1)*sizeof(float));
st->lsp = speex_alloc(st->lpcSize*sizeof(float));
st->qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->old_lsp = speex_alloc(st->lpcSize*sizeof(float));
st->old_qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->interp_lsp = speex_alloc(st->lpcSize*sizeof(float));
st->interp_qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->rc = speex_alloc(st->lpcSize*sizeof(float));
st->lpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->interp_lpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->interp_qlpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc1 = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc2 = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->lsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->old_lsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->old_qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->interp_lsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->interp_qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->rc = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->first = 1;
for (i=0;i<st->lpcSize;i++)
{
st->lsp[i]=(M_PI*((float)(i+1)))/(st->lpcSize+1);
}
st->mem_sp = speex_alloc(st->lpcSize*sizeof(float));
st->mem_sw = speex_alloc(st->lpcSize*sizeof(float));
st->mem_sw_whole = speex_alloc(st->lpcSize*sizeof(float));
st->mem_exc = speex_alloc(st->lpcSize*sizeof(float));
st->mem_sp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->mem_sw = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->mem_sw_whole = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->mem_exc = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->pi_gain = speex_alloc(st->nbSubframes*sizeof(float));
st->pi_gain = (float*)speex_alloc(st->nbSubframes*sizeof(float));
st->pitch = speex_alloc(st->nbSubframes*sizeof(int));
st->pitch = (int*)speex_alloc(st->nbSubframes*sizeof(int));
if (1) {
st->vbr = speex_alloc(sizeof(VBRState));
st->vbr = (VBRState*)speex_alloc(sizeof(VBRState));
vbr_init(st->vbr);
st->vbr_quality = 8;
st->vbr_enabled = 0;
......@@ -170,14 +170,14 @@ void *nb_encoder_init(SpeexMode *m)
void nb_encoder_destroy(void *state)
{
EncState *st=state;
EncState *st=(EncState *)state;
/* Free all allocated memory */
speex_free(st->inBuf);
speex_free(st->excBuf);
speex_free(st->swBuf);
speex_free(st->exc2Buf);
speex_free(st->innov);
speex_free(st->stack);
speex_free((float*)st->stack);
speex_free(st->window);
speex_free(st->buf2);
......@@ -208,7 +208,7 @@ void nb_encoder_destroy(void *state)
speex_free(st->vbr);
/*Free state memory... should be last*/
speex_free(st);
speex_free((float*)st);
}
void nb_encode(void *state, float *in, SpeexBits *bits)
......@@ -223,7 +223,7 @@ void nb_encode(void *state, float *in, SpeexBits *bits)
void *stack;
float *syn_resp;
st=state;
st=(EncState *)state;
stack=st->stack;
/* Copy new data in input buffer */
......@@ -671,7 +671,7 @@ void nb_encode(void *state, float *in, SpeexBits *bits)
/* In some (rare) modes, we do a second search (more bits) to reduce noise even more */
if (SUBMODE(double_codebook)) {
float *tmp_stack=stack;
void *tmp_stack=stack;
float *innov2 = PUSH(tmp_stack, st->subframeSize, float);
for (i=0;i<st->subframeSize;i++)
innov2[i]=0;
......@@ -731,8 +731,8 @@ void *nb_decoder_init(SpeexMode *m)
SpeexNBMode *mode;
int i;
mode=m->mode;
st = speex_alloc(sizeof(DecState));
mode=(SpeexNBMode*)m->mode;
st = (DecState *)speex_alloc(sizeof(DecState));
st->mode=m;
st->first=1;
......@@ -757,23 +757,23 @@ void *nb_decoder_init(SpeexMode *m)
st->stack = speex_alloc(20000*sizeof(float));
st->inBuf = speex_alloc(st->bufSize*sizeof(float));
st->inBuf = (float*)speex_alloc(st->bufSize*sizeof(float));
st->frame = st->inBuf + st->bufSize - st->windowSize;
st->excBuf = speex_alloc(st->bufSize*sizeof(float));
st->excBuf = (float*)speex_alloc(st->bufSize*sizeof(float));
st->exc = st->excBuf + st->bufSize - st->windowSize;
for (i=0;i<st->bufSize;i++)
st->inBuf[i]=0;
for (i=0;i<st->bufSize;i++)
st->excBuf[i]=0;
st->innov = speex_alloc(st->frameSize*sizeof(float));
st->innov = (float*)speex_alloc(st->frameSize*sizeof(float));
st->interp_qlpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->old_qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->interp_qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->mem_sp = speex_alloc(5*st->lpcSize*sizeof(float));
st->interp_qlpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->old_qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->interp_qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->mem_sp = (float*)speex_alloc(5*st->lpcSize*sizeof(float));
st->pi_gain = speex_alloc(st->nbSubframes*sizeof(float));
st->pi_gain = (float*)speex_alloc(st->nbSubframes*sizeof(float));
st->last_pitch = 40;
st->count_lost=0;
......@@ -789,7 +789,7 @@ void *nb_decoder_init(SpeexMode *m)
void nb_decoder_destroy(void *state)
{
DecState *st;
st=state;
st=(DecState*)state;
speex_free(st->inBuf);
speex_free(st->excBuf);
speex_free(st->innov);
......@@ -901,7 +901,7 @@ int nb_decode(void *state, SpeexBits *bits, float *out)
int m;
void *stack;
float *awk1, *awk2, *awk3;
st=state;
st=(DecState*)state;
stack=st->stack;
/* If bits is NULL, consider the packet to be lost (what could we do anyway) */
......@@ -1156,7 +1156,7 @@ int nb_decode(void *state, SpeexBits *bits, float *out)
/* Decode second codebook (only for some modes) */
if (SUBMODE(double_codebook))
{
float *tmp_stack=stack;
void *tmp_stack=stack;
float *innov2 = PUSH(tmp_stack, st->subframeSize, float);
for (i=0;i<st->subframeSize;i++)
innov2[i]=0;
......@@ -1215,7 +1215,7 @@ int nb_decode(void *state, SpeexBits *bits, float *out)
void nb_encoder_ctl(void *state, int request, void *ptr)
{
EncState *st;
st=state;
st=(EncState*)state;
switch(request)
{
case SPEEX_GET_FRAME_SIZE:
......@@ -1286,7 +1286,7 @@ void nb_encoder_ctl(void *state, int request, void *ptr)
void nb_decoder_ctl(void *state, int request, void *ptr)
{
DecState *st;
st=state;
st=(DecState*)state;
switch(request)
{
case SPEEX_SET_ENH:
......@@ -1306,7 +1306,7 @@ void nb_decoder_ctl(void *state, int request, void *ptr)
break;
case SPEEX_SET_HANDLER:
{
SpeexCallback *c = ptr;
SpeexCallback *c = (SpeexCallback*)ptr;
st->speex_callbacks[c->callback_id].func=c->func;
st->speex_callbacks[c->callback_id].data=c->data;
st->speex_callbacks[c->callback_id].callback_id=c->callback_id;
......@@ -1314,7 +1314,7 @@ void nb_decoder_ctl(void *state, int request, void *ptr)
break;
case SPEEX_SET_USER_HANDLER:
{
SpeexCallback *c = ptr;
SpeexCallback *c = (SpeexCallback*)ptr;
st->user_callback.func=c->func;
st->user_callback.data=c->data;
st->user_callback.callback_id=c->callback_id;
......
......@@ -131,9 +131,9 @@ void *sb_encoder_init(SpeexMode *m)
SBEncState *st;
SpeexSBMode *mode;
st = speex_alloc(sizeof(SBEncState));
st = (SBEncState*)speex_alloc(sizeof(SBEncState));
st->mode = m;
mode = m->mode;
mode = (SpeexSBMode*)m->mode;
st->st_low = nb_encoder_init(mode->nb_mode);
st->full_frame_size = 2*mode->frameSize;
......@@ -158,58 +158,57 @@ void *sb_encoder_init(SpeexMode *m)
st->first=1;
st->stack = speex_alloc(10000*sizeof(float));
st->x0d=speex_alloc(st->frame_size*sizeof(float));
st->x1d=speex_alloc(st->frame_size*sizeof(float));
st->high=speex_alloc(st->full_frame_size*sizeof(float));
st->y0=speex_alloc(st->full_frame_size*sizeof(float));
st->y1=speex_alloc(st->full_frame_size*sizeof(float));
st->x0d=(float*)speex_alloc(st->frame_size*sizeof(float));
st->x1d=(float*)speex_alloc(st->frame_size*sizeof(float));
st->high=(float*)speex_alloc(st->full_frame_size*sizeof(float));
st->y0=(float*)speex_alloc(st->full_frame_size*sizeof(float));
st->y1=(float*)speex_alloc(st->full_frame_size*sizeof(float));
st->h0_mem=speex_alloc(QMF_ORDER*sizeof(float));
st->h1_mem=speex_alloc(QMF_ORDER*sizeof(float));
st->g0_mem=speex_alloc(QMF_ORDER*sizeof(float));
st->g1_mem=speex_alloc(QMF_ORDER*sizeof(float));
st->h0_mem=(float*)speex_alloc(QMF_ORDER*sizeof(float));
st->h1_mem=(float*)speex_alloc(QMF_ORDER*sizeof(float));
st->g0_mem=(float*)speex_alloc(QMF_ORDER*sizeof(float));
st->g1_mem=(float*)speex_alloc(QMF_ORDER*sizeof(float));
st->buf=speex_alloc(st->windowSize*sizeof(float));
st->excBuf=speex_alloc(st->bufSize*sizeof(float));
st->buf=(float*)speex_alloc(st->windowSize*sizeof(float));
st->excBuf=(float*)speex_alloc(st->bufSize*sizeof(float));
st->exc = st->excBuf + st->bufSize - st->windowSize;
/*st->exc=st->excBuf+st->frame_size;*/
st->res=speex_alloc(st->frame_size*sizeof(float));
st->sw=speex_alloc(st->frame_size*sizeof(float));
st->target=speex_alloc(st->frame_size*sizeof(float));
st->res=(float*)speex_alloc(st->frame_size*sizeof(float));
st->sw=(float*)speex_alloc(st->frame_size*sizeof(float));
st->target=(float*)speex_alloc(st->frame_size*sizeof(float));
/*Asymetric "pseudo-Hamming" window*/
{
int part1, part2;
part1 = st->subframeSize*7/2;
part2 = st->subframeSize*5/2;
st->window = speex_alloc(st->windowSize*sizeof(float));
st->window = (float*)speex_alloc(st->windowSize*sizeof(float));
for (i=0;i<part1;i++)
st->window[i]=.54-.46*cos(M_PI*i/part1);
for (i=0;i<part2;i++)
st->window[part1+i]=.54+.46*cos(M_PI*i/part2);
}
st->lagWindow = speex_alloc((st->lpcSize+1)*sizeof(float));
st->lagWindow = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
for (i=0;i<st->lpcSize+1;i++)
st->lagWindow[i]=exp(-.5*sqr(2*M_PI*st->lag_factor*i));
st->rc = speex_alloc(st->lpcSize*sizeof(float));
st->autocorr = speex_alloc((st->lpcSize+1)*sizeof(float));
st->lpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc1 = speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc2 = speex_alloc((st->lpcSize+1)*sizeof(float));
st->lsp = speex_alloc(st->lpcSize*sizeof(float));
st->qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->old_lsp = speex_alloc(st->lpcSize*sizeof(float));
st->old_qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->interp_lsp = speex_alloc(st->lpcSize*sizeof(float));
st->interp_qlsp = speex_alloc(st->lpcSize*sizeof(float));
st->interp_lpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->interp_qlpc = speex_alloc((st->lpcSize+1)*sizeof(float));
st->mem_sp = speex_alloc(st->lpcSize*sizeof(float));
st->mem_sp2 = speex_alloc(st->lpcSize*sizeof(float));
st->mem_sw = speex_alloc(st->lpcSize*sizeof(float));
st->rc = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->autocorr = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->lpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc1 = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->bw_lpc2 = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->lsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->old_lsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->old_qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->interp_lsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->interp_qlsp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->interp_lpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->interp_qlpc = (float*)speex_alloc((st->lpcSize+1)*sizeof(float));
st->mem_sp = (float*)speex_alloc(st->lpcSize*sizeof(float));
st->mem_sp2 = (float*)speex_alloc(st->lpcSize*sizeof(float));