[xiph-cvs] cvs commit: speex/libspeex cb_search.c cb_search.h filters.c filters.h ltp.c ltp.h misc.c misc.h modes.h nb_celp.c nb_celp.h sb_celp.c sb_celp.h vq.c vq.h

Jean-Marc Valin jm at xiph.org
Tue Oct 7 21:40:42 PDT 2003



jm          03/10/08 00:40:42

  Modified:    libspeex cb_search.c cb_search.h filters.c filters.h ltp.c
                        ltp.h misc.c misc.h modes.h nb_celp.c nb_celp.h
                        sb_celp.c sb_celp.h vq.c vq.h
  Log:
  fixed-point: converted all signals to spx_sig_t

Revision  Changes    Path
1.91      +28 -27    speex/libspeex/cb_search.c

Index: cb_search.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/cb_search.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- cb_search.c	8 Oct 2003 04:38:53 -0000	1.90
+++ cb_search.c	8 Oct 2003 04:40:41 -0000	1.91
@@ -37,27 +37,28 @@
 #include "misc.h"
 
 void split_cb_search_shape_sign(
-float target[],			/* target vector */
+spx_sig_t target[],			/* target vector */
 spx_coef_t ak[],			/* LPCs for this subframe */
 spx_coef_t awk1[],			/* Weighted LPCs for this subframe */
 spx_coef_t awk2[],			/* Weighted LPCs for this subframe */
 void *par,                      /* Codebook/search parameters*/
 int   p,                        /* number of LPC coeffs */
 int   nsf,                      /* number of samples in subframe */
-float *exc,
-float *r,
+spx_sig_t *exc,
+spx_sig_t *r,
 SpeexBits *bits,
 char *stack,
 int   complexity
 )
 {
    int i,j,k,m,n,q;
-   float *resp;
-   float *t, *e, *E, *r2;
-   float *tmp;
+   spx_sig_t *resp;
+   spx_sig_t *t, *e, *r2;
+   float *E;
+   spx_sig_t *tmp;
    float *ndist, *odist;
    int *itmp;
-   float **ot, **nt;
+   spx_sig_t **ot, **nt;
    int **nind, **oind;
    int *ind;
    signed char *shape_cb;
@@ -72,8 +73,8 @@
    if (N>10)
       N=10;
 
-   ot=PUSH(stack, N, float*);
-   nt=PUSH(stack, N, float*);
+   ot=PUSH(stack, N, spx_sig_t*);
+   nt=PUSH(stack, N, spx_sig_t*);
    oind=PUSH(stack, N, int*);
    nind=PUSH(stack, N, int*);
 
@@ -83,14 +84,14 @@
    shape_cb_size = 1<<params->shape_bits;
    shape_cb = params->shape_cb;
    have_sign = params->have_sign;
-   resp = PUSH(stack, shape_cb_size*subvect_size, float);
-   t = PUSH(stack, nsf, float);
-   e = PUSH(stack, nsf, float);
-   r2 = PUSH(stack, nsf, float);
+   resp = PUSH(stack, shape_cb_size*subvect_size, spx_sig_t);
+   t = PUSH(stack, nsf, spx_sig_t);
+   e = PUSH(stack, nsf, spx_sig_t);
+   r2 = PUSH(stack, nsf, spx_sig_t);
    E = PUSH(stack, shape_cb_size, float);
    ind = PUSH(stack, nb_subvect, int);
 
-   tmp = PUSH(stack, 2*N*nsf, float);
+   tmp = PUSH(stack, 2*N*nsf, spx_sig_t);
    for (i=0;i<N;i++)
    {
       ot[i]=tmp;
@@ -125,7 +126,7 @@
    /* Pre-compute codewords response and energy */
    for (i=0;i<shape_cb_size;i++)
    {
-      float *res;
+      spx_sig_t *res;
       signed char *shape;
 
       res = resp+i*subvect_size;
@@ -137,7 +138,7 @@
          res[j]=0;
          for (k=0;k<=j;k++)
             res[j] += shape[k]*r[j-k];
-         res[j] *= 0.03125*SIG_SCALING;
+         res[j] *= 0.03125;
       }
       
       /* Compute codeword energy */
@@ -158,7 +159,7 @@
       /*For all n-bests of previous subvector*/
       for (j=0;j<N;j++)
       {
-         float *x=ot[j]+subvect_size*i;
+         spx_sig_t *x=ot[j]+subvect_size*i;
          /*Find new n-best based on previous n-best j*/
          if (have_sign)
             vq_nbest_sign(x, resp, subvect_size, shape_cb_size, E, N, best_index, best_dist);
@@ -168,7 +169,7 @@
          /*For all new n-bests*/
          for (k=0;k<N;k++)
          {
-            float *ct;
+            spx_sig_t *ct;
             float err=0;
             ct = ot[j];
             /*update target*/
@@ -180,7 +181,7 @@
             /* New code: update only enough of the target to calculate error*/
             {
                int rind;
-               float *res;
+               spx_sig_t *res;
                float sign=1;
                rind = best_index[k];
                if (rind>=shape_cb_size)
@@ -221,7 +222,7 @@
                      rind-=shape_cb_size;
                   }
 
-                  g=sign*0.03125*SIG_SCALING*shape_cb[rind*subvect_size+m];
+                  g=sign*0.03125*shape_cb[rind*subvect_size+m];
                   q=subvect_size-m;
                   for (n=subvect_size*(i+1);n<nsf;n++,q++)
                      t[n] -= g*r[q];
@@ -258,7 +259,7 @@
       /*update old-new data*/
       /* just swap pointers instead of a long copy */
       {
-         float **tmp2;
+         spx_sig_t **tmp2;
          tmp2=ot;
          ot=nt;
          nt=tmp2;
@@ -305,7 +306,7 @@
 
 
 void split_cb_shape_sign_unquant(
-float *exc,
+spx_sig_t *exc,
 void *par,                      /* non-overlapping codebook */
 int   nsf,                      /* number of samples in subframe */
 SpeexBits *bits,
@@ -355,22 +356,22 @@
 }
 
 void noise_codebook_quant(
-float target[],			/* target vector */
+spx_sig_t target[],			/* target vector */
 spx_coef_t ak[],			/* LPCs for this subframe */
 spx_coef_t awk1[],			/* Weighted LPCs for this subframe */
 spx_coef_t awk2[],			/* Weighted LPCs for this subframe */
 void *par,                      /* Codebook/search parameters*/
 int   p,                        /* number of LPC coeffs */
 int   nsf,                      /* number of samples in subframe */
-float *exc,
-float *r,
+spx_sig_t *exc,
+spx_sig_t *r,
 SpeexBits *bits,
 char *stack,
 int   complexity
 )
 {
    int i;
-   float *tmp=PUSH(stack, nsf, float);
+   spx_sig_t *tmp=PUSH(stack, nsf, spx_sig_t);
    residue_percep_zero(target, ak, awk1, awk2, tmp, nsf, p, stack);
 
    for (i=0;i<nsf;i++)
@@ -382,7 +383,7 @@
 
 
 void noise_codebook_unquant(
-float *exc,
+spx_sig_t *exc,
 void *par,                      /* non-overlapping codebook */
 int   nsf,                      /* number of samples in subframe */
 SpeexBits *bits,

<p><p>1.30      +8 -8      speex/libspeex/cb_search.h

Index: cb_search.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/cb_search.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- cb_search.h	8 Oct 2003 04:27:51 -0000	1.29
+++ cb_search.h	8 Oct 2003 04:40:41 -0000	1.30
@@ -46,22 +46,22 @@
 
 
 void split_cb_search_shape_sign(
-float target[],			/* target vector */
+spx_sig_t target[],			/* target vector */
 spx_coef_t ak[],			/* LPCs for this subframe */
 spx_coef_t awk1[],			/* Weighted LPCs for this subframe */
 spx_coef_t awk2[],			/* Weighted LPCs for this subframe */
 void *par,                      /* Codebook/search parameters*/
 int   p,                        /* number of LPC coeffs */
 int   nsf,                      /* number of samples in subframe */
-float *exc,
-float *r,
+spx_sig_t *exc,
+spx_sig_t *r,
 SpeexBits *bits,
 char *stack,
 int   complexity
 );
 
 void split_cb_shape_sign_unquant(
-float *exc,
+spx_sig_t *exc,
 void *par,                      /* non-overlapping codebook */
 int   nsf,                      /* number of samples in subframe */
 SpeexBits *bits,
@@ -70,15 +70,15 @@
 
 
 void noise_codebook_quant(
-float target[],			/* target vector */
+spx_sig_t target[],			/* target vector */
 spx_coef_t ak[],			/* LPCs for this subframe */
 spx_coef_t awk1[],			/* Weighted LPCs for this subframe */
 spx_coef_t awk2[],			/* Weighted LPCs for this subframe */
 void *par,                      /* Codebook/search parameters*/
 int   p,                        /* number of LPC coeffs */
 int   nsf,                      /* number of samples in subframe */
-float *exc,
-float *r,
+spx_sig_t *exc,
+spx_sig_t *r,
 SpeexBits *bits,
 char *stack,
 int   complexity
@@ -86,7 +86,7 @@
 
 
 void noise_codebook_unquant(
-float *exc,
+spx_sig_t *exc,
 void *par,                      /* non-overlapping codebook */
 int   nsf,                      /* number of samples in subframe */
 SpeexBits *bits,

<p><p>1.39      +12 -12    speex/libspeex/filters.c

Index: filters.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- filters.c	8 Oct 2003 04:36:24 -0000	1.38
+++ filters.c	8 Oct 2003 04:40:41 -0000	1.39
@@ -55,7 +55,7 @@
 #define MUL_16_32_R15(a,bh,bl) ((a)*(bh) + ((a)*(bl)>>15))
 
 
-void filter_mem2(float *x, spx_coef_t *num, spx_coef_t *den, float *y, int N, int ord, spx_mem_t *mem)
+void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
 {
    int i,j;
    int xi,yi;
@@ -79,7 +79,7 @@
    }
 }
 
-void iir_mem2(float *x, spx_coef_t *den, float *y, int N, int ord, spx_mem_t *mem)
+void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
 {
    int i,j;
    int xi,yi;
@@ -104,7 +104,7 @@
 }
 
 
-void fir_mem2(float *x, spx_coef_t *num, float *y, int N, int ord, spx_mem_t *mem)
+void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
 {
    int i,j;
    int xi,yi;
@@ -138,7 +138,7 @@
 #else
 
 
-void filter_mem2(float *x, spx_coef_t *num, spx_coef_t *den, float *y, int N, int ord,  spx_mem_t *mem)
+void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord,  spx_mem_t *mem)
 {
    int i,j;
    float xi,yi;
@@ -156,7 +156,7 @@
 }
 
 
-void iir_mem2(float *x, spx_coef_t *den, float *y, int N, int ord, spx_mem_t *mem)
+void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
 {
    int i,j;
    for (i=0;i<N;i++)
@@ -173,7 +173,7 @@
 
 #endif
 
-void fir_mem2(float *x, spx_coef_t *num, float *y, int N, int ord, spx_mem_t *mem)
+void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem)
 {
    int i,j;
    float xi;
@@ -193,7 +193,7 @@
 #endif
 
 
-void syn_percep_zero(float *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, float *y, int N, int ord, char *stack)
+void syn_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack)
 {
    int i;
    spx_mem_t *mem = PUSH(stack,ord, spx_mem_t);
@@ -205,7 +205,7 @@
    filter_mem2(y, awk1, awk2, y, N, ord, mem);
 }
 
-void residue_percep_zero(float *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, float *y, int N, int ord, char *stack)
+void residue_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack)
 {
    int i;
    spx_mem_t *mem = PUSH(stack,ord, spx_mem_t);
@@ -218,7 +218,7 @@
 }
 
 
-void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem, char *stack)
+void qmf_decomp(float *xx, float *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, float *mem, char *stack)
 {
    int i,j,k,M2;
    float *a;
@@ -253,7 +253,7 @@
 }
 
 /* By segher */
-void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem, char *stack)
+void fir_mem_up(spx_sig_t *x, float *a, spx_sig_t *y, int N, int M, float *mem, char *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 */
@@ -314,8 +314,8 @@
 }
 
 void comb_filter(
-float *exc,          /*decoded excitation*/
-float *new_exc,      /*enhanced excitation*/
+spx_sig_t *exc,          /*decoded excitation*/
+spx_sig_t *new_exc,      /*enhanced excitation*/
 spx_coef_t *ak,           /*LPC filter coefs*/
 int p,               /*LPC order*/
 int nsf,             /*sub-frame size*/

<p><p>1.25      +10 -10    speex/libspeex/filters.h

Index: filters.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- filters.h	8 Oct 2003 04:27:51 -0000	1.24
+++ filters.h	8 Oct 2003 04:40:41 -0000	1.25
@@ -42,13 +42,13 @@
 } CombFilterMem;
 
 
-void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem, char *stack);
-void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem, char *stack);
+void qmf_decomp(float *xx, float *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, float *mem, char *stack);
+void fir_mem_up(spx_sig_t *x, float *a, spx_sig_t *y, int N, int M, float *mem, char *stack);
 
 
-void filter_mem2(float *x, spx_coef_t *num, spx_coef_t *den, float *y, int N, int ord, spx_mem_t *mem);
-void fir_mem2(float *x, spx_coef_t *num, float *y, int N, int ord, spx_mem_t *mem);
-void iir_mem2(float *x, spx_coef_t *den, float *y, int N, int ord, spx_mem_t *mem);
+void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
+void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
+void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
 
 /* Apply bandwidth expansion on LPC coef */
 void bw_lpc(float gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
@@ -56,17 +56,17 @@
 
 
 /* FIR filter */
-void fir_decim_mem(float *x, float *a, float *y, int N, int M, float *mem);
+void fir_decim_mem(spx_sig_t *x, float *a, spx_sig_t *y, int N, int M, float *mem);
 
-void syn_percep_zero(float *x, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, float *y, int N, int ord, char *stack);
+void syn_percep_zero(spx_sig_t *x, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
 
-void residue_percep_zero(float *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, float *y, int N, int ord, char *stack);
+void residue_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
 
 void comp_filter_mem_init (CombFilterMem *mem);
 
 void comb_filter(
-float *exc,          /*decoded excitation*/
-float *new_exc,      /*enhanced excitation*/
+spx_sig_t *exc,          /*decoded excitation*/
+spx_sig_t *new_exc,      /*enhanced excitation*/
 spx_coef_t *ak,           /*LPC filter coefs*/
 int p,               /*LPC order*/
 int nsf,             /*sub-frame size*/

<p><p>1.79      +23 -23    speex/libspeex/ltp.c

Index: ltp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- ltp.c	8 Oct 2003 04:36:24 -0000	1.78
+++ ltp.c	8 Oct 2003 04:40:41 -0000	1.79
@@ -39,7 +39,7 @@
 #ifdef _USE_SSE
 #include "ltp_sse.h"
 #else
-static float inner_prod(float *x, float *y, int len)
+static float inner_prod(spx_sig_t *x, spx_sig_t *y, int len)
 {
    int i;
    float sum1=0,sum2=0,sum3=0,sum4=0;
@@ -67,7 +67,7 @@
 */
 
 
-void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack)
+void open_loop_nbest_pitch(spx_sig_t *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack)
 {
    int i,j,k;
    /*float corr=0;*/
@@ -141,27 +141,27 @@
 
 /** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */
 static float pitch_gain_search_3tap(
-float target[],                 /* Target vector */
+spx_sig_t target[],                 /* Target vector */
 spx_coef_t ak[],                     /* LPCs for this subframe */
 spx_coef_t awk1[],                   /* Weighted LPCs #1 for this subframe */
 spx_coef_t awk2[],                   /* Weighted LPCs #2 for this subframe */
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 void *par,
 int   pitch,                    /* Pitch value */
 int   p,                        /* Number of LPC coeffs */
 int   nsf,                      /* Number of samples in subframe */
 SpeexBits *bits,
 char *stack,
-float *exc2,
-float *r,
+spx_sig_t *exc2,
+spx_sig_t *r,
 int  *cdbk_index,
 int cdbk_offset
 )
 {
    int i,j;
-   float *tmp, *tmp2;
-   float *x[3];
-   float *e[3];
+   spx_sig_t *tmp, *tmp2;
+   spx_sig_t *x[3];
+   spx_sig_t *e[3];
    float corr[3];
    float A[3][3];
    float gain[3];
@@ -173,8 +173,8 @@
    params = (ltp_params*) par;
    gain_cdbk_size = 1<<params->gain_bits;
    gain_cdbk = params->gain_cdbk + 3*gain_cdbk_size*cdbk_offset;
-   tmp = PUSH(stack, 3*nsf, float);
-   tmp2 = PUSH(stack, 3*nsf, float);
+   tmp = PUSH(stack, 3*nsf, spx_sig_t);
+   tmp2 = PUSH(stack, 3*nsf, spx_sig_t);
 
    x[0]=tmp;
    x[1]=tmp+nsf;
@@ -290,12 +290,12 @@
 
 /** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */
 int pitch_search_3tap(
-float target[],                 /* Target vector */
-float *sw,
+spx_sig_t target[],                 /* Target vector */
+spx_sig_t *sw,
 spx_coef_t ak[],                     /* LPCs for this subframe */
 spx_coef_t awk1[],                   /* Weighted LPCs #1 for this subframe */
 spx_coef_t awk2[],                   /* Weighted LPCs #2 for this subframe */
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 void *par,
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
@@ -304,8 +304,8 @@
 int   nsf,                      /* Number of samples in subframe */
 SpeexBits *bits,
 char *stack,
-float *exc2,
-float *r,
+spx_sig_t *exc2,
+spx_sig_t *r,
 int complexity,
 int cdbk_offset
 )
@@ -370,7 +370,7 @@
 }
 
 void pitch_unquant_3tap(
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
 float pitch_coef,               /* Voicing (pitch) coefficient */
@@ -495,12 +495,12 @@
 
 /** Forced pitch delay and gain */
 int forced_pitch_quant(
-float target[],                 /* Target vector */
-float *sw,
+spx_sig_t target[],                 /* Target vector */
+spx_sig_t *sw,
 spx_coef_t ak[],                     /* LPCs for this subframe */
 spx_coef_t awk1[],                   /* Weighted LPCs #1 for this subframe */
 spx_coef_t awk2[],                   /* Weighted LPCs #2 for this subframe */
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 void *par,
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
@@ -509,8 +509,8 @@
 int   nsf,                      /* Number of samples in subframe */
 SpeexBits *bits,
 char *stack,
-float *exc2,
-float *r,
+spx_sig_t *exc2,
+spx_sig_t *r,
 int complexity,
 int cdbk_offset
 )
@@ -527,7 +527,7 @@
 
 /** Unquantize forced pitch delay and gain */
 void forced_pitch_unquant(
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
 float pitch_coef,               /* Voicing (pitch) coefficient */

<p><p>1.36      +13 -13    speex/libspeex/ltp.h

Index: ltp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- ltp.h	8 Oct 2003 04:27:51 -0000	1.35
+++ ltp.h	8 Oct 2003 04:40:41 -0000	1.36
@@ -40,17 +40,17 @@
 } ltp_params;
 
 
-void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack);
+void open_loop_nbest_pitch(spx_sig_t *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack);
 
 
 /** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */
 int pitch_search_3tap(
-float target[],                 /* Target vector */
-float *sw,
+spx_sig_t target[],                 /* Target vector */
+spx_sig_t *sw,
 spx_coef_t ak[],                     /* LPCs for this subframe */
 spx_coef_t awk1[],                   /* Weighted LPCs #1 for this subframe */
 spx_coef_t awk2[],                   /* Weighted LPCs #2 for this subframe */
-float exc[],                    /* Overlapping codebook */
+spx_sig_t exc[],                    /* Overlapping codebook */
 void *par,
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
@@ -59,15 +59,15 @@
 int   nsf,                      /* Number of samples in subframe */
 SpeexBits *bits,
 char *stack,
-float *exc2,
-float *r,
+spx_sig_t *exc2,
+spx_sig_t *r,
 int   complexity,
 int   cdbk_offset
 );
 
 /*Unquantize adaptive codebook and update pitch contribution*/
 void pitch_unquant_3tap(
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
 float pitch_coef,               /* Voicing (pitch) coefficient */
@@ -85,12 +85,12 @@
 
 /** Forced pitch delay and gain */
 int forced_pitch_quant(
-float target[],                 /* Target vector */
-float *sw,
+spx_sig_t target[],                 /* Target vector */
+spx_sig_t *sw,
 spx_coef_t ak[],                     /* LPCs for this subframe */
 spx_coef_t awk1[],                   /* Weighted LPCs #1 for this subframe */
 spx_coef_t awk2[],                   /* Weighted LPCs #2 for this subframe */
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 void *par,
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
@@ -99,15 +99,15 @@
 int   nsf,                      /* Number of samples in subframe */
 SpeexBits *bits,
 char *stack,
-float *exc2,
-float *r,
+spx_sig_t *exc2,
+spx_sig_t *r,
 int complexity,
 int cdbk_offset
 );
 
 /** Unquantize forced pitch delay and gain */
 void forced_pitch_unquant(
-float exc[],                    /* Excitation */
+spx_sig_t exc[],                    /* Excitation */
 int   start,                    /* Smallest pitch value allowed */
 int   end,                      /* Largest pitch value allowed */
 float pitch_coef,               /* Voicing (pitch) coefficient */

<p><p>1.9       +1 -1      speex/libspeex/misc.c

Index: misc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/misc.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- misc.c	8 Jan 2003 21:58:59 -0000	1.8
+++ misc.c	8 Oct 2003 04:40:41 -0000	1.9
@@ -126,7 +126,7 @@
    fprintf (stderr, "warning: %s %d\n", str, val);
 }
 
-void speex_rand_vec(float std, float *data, int len)
+void speex_rand_vec(float std, spx_sig_t *data, int len)
 {
    int i;
    for (i=0;i<len;i++)

<p><p>1.29      +1 -1      speex/libspeex/misc.h

Index: misc.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/misc.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- misc.h	8 Oct 2003 04:38:53 -0000	1.28
+++ misc.h	8 Oct 2003 04:40:41 -0000	1.29
@@ -124,7 +124,7 @@
 
 void speex_warning_int(char *str, int val);
 
-void speex_rand_vec(float std, float *data, int len);
+void speex_rand_vec(float std, spx_sig_t *data, int len);
 
 float speex_rand(float std);
 

<p><p>1.46      +7 -7      speex/libspeex/modes.h

Index: modes.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/modes.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- modes.h	8 Oct 2003 04:35:01 -0000	1.45
+++ modes.h	8 Oct 2003 04:40:41 -0000	1.46
@@ -55,21 +55,21 @@
 
 
 /** Long-term predictor quantization */
-typedef int (*ltp_quant_func)(float *, float *, spx_coef_t *, spx_coef_t *, 
-                              spx_coef_t *, float *, void *, int, int, float, 
-                              int, int, SpeexBits*, char *, float *, float *, int, int);
+typedef int (*ltp_quant_func)(spx_sig_t *, spx_sig_t *, spx_coef_t *, spx_coef_t *, 
+                              spx_coef_t *, spx_sig_t *, void *, int, int, float, 
+                              int, int, SpeexBits*, char *, spx_sig_t *, spx_sig_t *, int, int);
 
 /** Long-term un-quantize */
-typedef void (*ltp_unquant_func)(float *, int, int, float, void *, int, int *,
+typedef void (*ltp_unquant_func)(spx_sig_t *, int, int, float, void *, int, int *,
                                  float *, SpeexBits*, char*, int, int, float, int);
 
 
 /** Innovation quantization function */
-typedef void (*innovation_quant_func)(float *, spx_coef_t *, spx_coef_t *, spx_coef_t *, void *, int, int, 
-                                      float *, float *, SpeexBits *, char *, int);
+typedef void (*innovation_quant_func)(spx_sig_t *, spx_coef_t *, spx_coef_t *, spx_coef_t *, void *, int, int, 
+                                      spx_sig_t *, spx_sig_t *, SpeexBits *, char *, int);
 
 /** Innovation unquantization function */
-typedef void (*innovation_unquant_func)(float *, void *, int, SpeexBits*, char *);
+typedef void (*innovation_unquant_func)(spx_sig_t *, void *, int, SpeexBits*, char *);
 
 /** Description of a Speex sub-mode (wither narrowband or wideband */
 typedef struct SpeexSubmode {

<p><p>1.131     +26 -31    speex/libspeex/nb_celp.c

Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -r1.130 -r1.131
--- nb_celp.c	8 Oct 2003 04:38:53 -0000	1.130
+++ nb_celp.c	8 Oct 2003 04:40:41 -0000	1.131
@@ -72,7 +72,7 @@
    int i;
 
    mode=(SpeexNBMode *)m->mode;
-   st = (EncState*)speex_alloc(sizeof(EncState)+8000*sizeof(float));
+   st = (EncState*)speex_alloc(sizeof(EncState)+8000*sizeof(spx_sig_t));
    if (!st)
       return NULL;
 
@@ -103,18 +103,18 @@
 #endif
 
    /* Allocating input buffer */
-   st->inBuf = PUSH(st->stack, st->bufSize, float);
+   st->inBuf = PUSH(st->stack, st->bufSize, spx_sig_t);
    st->frame = st->inBuf + st->bufSize - st->windowSize;
    /* Allocating excitation buffer */
-   st->excBuf = PUSH(st->stack, st->bufSize, float);
+   st->excBuf = PUSH(st->stack, st->bufSize, spx_sig_t);
    st->exc = st->excBuf + st->bufSize - st->windowSize;
-   st->swBuf = PUSH(st->stack, st->bufSize, float);
+   st->swBuf = PUSH(st->stack, st->bufSize, spx_sig_t);
    st->sw = st->swBuf + st->bufSize - st->windowSize;
 
-   st->exc2Buf = PUSH(st->stack, st->bufSize, float);
+   st->exc2Buf = PUSH(st->stack, st->bufSize, spx_sig_t);
    st->exc2 = st->exc2Buf + st->bufSize - st->windowSize;
 
-   st->innov = PUSH(st->stack, st->frameSize, float);
+   st->innov = PUSH(st->stack, st->frameSize, spx_sig_t);
 
    /* Asymmetric "pseudo-Hamming" window */
    {
@@ -134,7 +134,7 @@
 
    st->autocorr = PUSH(st->stack, st->lpcSize+1, spx_word16_t);
 
-   st->buf2 = PUSH(st->stack, st->windowSize, float);
+   st->buf2 = PUSH(st->stack, st->windowSize, spx_sig_t);
 
    st->lpc = PUSH(st->stack, st->lpcSize+1, spx_coef_t);
    st->interp_lpc = PUSH(st->stack, st->lpcSize+1, spx_coef_t);
@@ -198,12 +198,12 @@
    int ol_pitch;
    float ol_pitch_coef;
    float ol_gain;
-   float *res, *target;
+   spx_sig_t *res, *target;
    spx_mem_t *mem;
    char *stack;
-   float *syn_resp;
+   spx_sig_t *syn_resp;
    float lsp_dist=0;
-   float *orig;
+   spx_sig_t *orig;
 #ifdef EPIC_48K
    int pitch_half[2];
    int ol_pitch_id=0;
@@ -597,12 +597,12 @@
    }
 
    /* Filter response */
-   res = PUSH(stack, st->subframeSize, float);
+   res = PUSH(stack, st->subframeSize, spx_sig_t);
    /* Target signal */
-   target = PUSH(stack, st->subframeSize, float);
-   syn_resp = PUSH(stack, st->subframeSize, float);
+   target = PUSH(stack, st->subframeSize, spx_sig_t);
+   syn_resp = PUSH(stack, st->subframeSize, spx_sig_t);
    mem = PUSH(stack, st->lpcSize, spx_mem_t);
-   orig = PUSH(stack, st->frameSize, float);
+   orig = PUSH(stack, st->frameSize, spx_sig_t);
    for (i=0;i<st->frameSize;i++)
       orig[i]=st->frame[i];
 
@@ -611,7 +611,7 @@
    {
       float tmp;
       int   offset;
-      float *sp, *sw, *exc, *exc2;
+      spx_sig_t *sp, *sw, *exc, *exc2;
       int pitch;
 
 #ifdef EPIC_48K
@@ -773,7 +773,7 @@
 
       /* Quantization of innovation */
       {
-         float *innov;
+         spx_sig_t *innov;
          float ener=0, ener_1;
 
          innov = st->innov+sub*st->subframeSize;
@@ -820,9 +820,6 @@
          for (i=0;i<st->subframeSize;i++)
             target[i]*=ener_1;
          
-         for (i=0;i<st->subframeSize;i++)
-            syn_resp[i]/=SIG_SCALING;
-
          /* Quantize innovation */
          if (SUBMODE(innovation_quant))
          {
@@ -843,7 +840,7 @@
          /* In some (rare) modes, we do a second search (more bits) to reduce noise even more */
          if (SUBMODE(double_codebook)) {
             char *tmp_stack=stack;
-            float *innov2 = PUSH(tmp_stack, st->subframeSize, float);
+            spx_sig_t *innov2 = PUSH(tmp_stack, st->subframeSize, spx_sig_t);
             for (i=0;i<st->subframeSize;i++)
                innov2[i]=0;
             for (i=0;i<st->subframeSize;i++)
@@ -858,9 +855,6 @@
          }
 
          for (i=0;i<st->subframeSize;i++)
-            syn_resp[i]*=SIG_SCALING;
-
-         for (i=0;i<st->subframeSize;i++)
             target[i]*=ener;
 
       }
@@ -929,7 +923,7 @@
    int i;
 
    mode=(SpeexNBMode*)m->mode;
-   st = (DecState *)speex_alloc(sizeof(DecState)+4000*sizeof(float));
+   st = (DecState *)speex_alloc(sizeof(DecState)+4000*sizeof(spx_sig_t));
    st->mode=m;
 
    st->stack = ((char*)st) + sizeof(DecState);
@@ -958,15 +952,15 @@
    st->lpc_enh_enabled=0;
 
 
-   st->inBuf = PUSH(st->stack, st->bufSize, float);
+   st->inBuf = PUSH(st->stack, st->bufSize, spx_sig_t);
    st->frame = st->inBuf + st->bufSize - st->windowSize;
-   st->excBuf = PUSH(st->stack, st->bufSize, float);
+   st->excBuf = PUSH(st->stack, st->bufSize, spx_sig_t);
    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 = PUSH(st->stack, st->frameSize, float);
+   st->innov = PUSH(st->stack, st->frameSize, spx_sig_t);
 
    st->interp_qlpc = PUSH(st->stack, st->lpcSize+1, spx_coef_t);
    st->qlsp = PUSH(st->stack, st->lpcSize, float);
@@ -1034,7 +1028,7 @@
    for (sub=0;sub<st->nbSubframes;sub++)
    {
       int offset;
-      float *sp, *exc;
+      spx_sig_t *sp, *exc;
       /* Offset relative to start of frame */
       offset = st->subframeSize*sub;
       /* Original signal */
@@ -1356,7 +1350,8 @@
    for (sub=0;sub<st->nbSubframes;sub++)
    {
       int offset;
-      float *sp, *exc, tmp;
+      spx_sig_t *sp, *exc;
+      float tmp;
 
 #ifdef EPIC_48K
       if (st->lbr_48k)
@@ -1512,7 +1507,7 @@
       {
          int q_energy;
          float ener;
-         float *innov;
+         spx_sig_t *innov;
          
          innov = st->innov+sub*st->subframeSize;
          for (i=0;i<st->subframeSize;i++)
@@ -1581,7 +1576,7 @@
          if (SUBMODE(double_codebook))
          {
             char *tmp_stack=stack;
-            float *innov2 = PUSH(tmp_stack, st->subframeSize, float);
+            spx_sig_t *innov2 = PUSH(tmp_stack, st->subframeSize, spx_sig_t);
             for (i=0;i<st->subframeSize;i++)
                innov2[i]=0;
             SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize, bits, tmp_stack);

<p><p>1.56      +15 -15    speex/libspeex/nb_celp.h

Index: nb_celp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- nb_celp.h	8 Oct 2003 04:38:53 -0000	1.55
+++ nb_celp.h	8 Oct 2003 04:40:41 -0000	1.56
@@ -70,17 +70,17 @@
    float  lag_factor;     /**< Lag windowing Gaussian width */
    float  lpc_floor;      /**< Noise floor multiplier for A[0] in LPC analysis*/
    char  *stack;          /**< Pseudo-stack allocation for temporary memory */
-   float *inBuf;          /**< Input buffer (original signal) */
-   float *frame;          /**< Start of original frame */
-   float *excBuf;         /**< Excitation buffer */
-   float *exc;            /**< Start of excitation frame */
-   float *exc2Buf;        /**< "Pitch enhanced" excitation */
-   float *exc2;           /**< "Pitch enhanced" excitation */
-   float *swBuf;          /**< Weighted signal buffer */
-   float *sw;             /**< Start of weighted signal frame */
-   float *innov;          /**< Innovation for the frame */
+   spx_sig_t *inBuf;          /**< Input buffer (original signal) */
+   spx_sig_t *frame;          /**< Start of original frame */
+   spx_sig_t *excBuf;         /**< Excitation buffer */
+   spx_sig_t *exc;            /**< Start of excitation frame */
+   spx_sig_t *exc2Buf;        /**< "Pitch enhanced" excitation */
+   spx_sig_t *exc2;           /**< "Pitch enhanced" excitation */
+   spx_sig_t *swBuf;          /**< Weighted signal buffer */
+   spx_sig_t *sw;             /**< Start of weighted signal frame */
+   spx_sig_t *innov;          /**< Innovation for the frame */
    spx_word16_t *window;         /**< Temporary (Hanning) window */
-   float *buf2;           /**< 2nd temporary buffer */
+   spx_sig_t *buf2;           /**< 2nd temporary buffer */
    spx_word16_t *autocorr;       /**< auto-correlation */
    float *lagWindow;      /**< Window applied to auto-correlation */
    spx_coef_t *lpc;            /**< LPCs for current frame */
@@ -144,11 +144,11 @@
    float  gamma1;         /**< Perceptual filter: A(z/gamma1) */
    float  gamma2;         /**< Perceptual filter: A(z/gamma2) */
    char  *stack;          /**< Pseudo-stack allocation for temporary memory */
-   float *inBuf;          /**< Input buffer (original signal) */
-   float *frame;          /**< Start of original frame */
-   float *excBuf;         /**< Excitation buffer */
-   float *exc;            /**< Start of excitation frame */
-   float *innov;          /**< Innovation for the frame */
+   spx_sig_t *inBuf;          /**< Input buffer (original signal) */
+   spx_sig_t *frame;          /**< Start of original frame */
+   spx_sig_t *excBuf;         /**< Excitation buffer */
+   spx_sig_t *exc;            /**< Start of excitation frame */
+   spx_sig_t *innov;          /**< Innovation for the frame */
    float *qlsp;           /**< Quantized LSPs for current frame */
    float *old_qlsp;       /**< Quantized LSPs for previous frame */
    float *interp_qlsp;    /**< Interpolated quantized LSPs */

<p><p>1.132     +58 -45    speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -r1.131 -r1.132
--- sb_celp.c	8 Oct 2003 04:38:53 -0000	1.131
+++ sb_celp.c	8 Oct 2003 04:40:41 -0000	1.132
@@ -158,24 +158,24 @@
    st->gamma2=mode->gamma2;
    st->first=1;
 
-   st->x0d=PUSH(st->stack, st->frame_size, float);
-   st->x1d=PUSH(st->stack, st->frame_size, float);
-   st->high=PUSH(st->stack, st->full_frame_size, float);
-   st->y0=PUSH(st->stack, st->full_frame_size, float);
-   st->y1=PUSH(st->stack, st->full_frame_size, float);
+   st->x0d=PUSH(st->stack, st->frame_size, spx_sig_t);
+   st->x1d=PUSH(st->stack, st->frame_size, spx_sig_t);
+   st->high=PUSH(st->stack, st->full_frame_size, spx_sig_t);
+   st->y0=PUSH(st->stack, st->full_frame_size, spx_sig_t);
+   st->y1=PUSH(st->stack, st->full_frame_size, spx_sig_t);
 
    st->h0_mem=PUSH(st->stack, QMF_ORDER, float);
    st->h1_mem=PUSH(st->stack, QMF_ORDER, float);
    st->g0_mem=PUSH(st->stack, QMF_ORDER, float);
    st->g1_mem=PUSH(st->stack, QMF_ORDER, float);
 
-   st->buf=PUSH(st->stack, st->windowSize, float);
-   st->excBuf=PUSH(st->stack, st->bufSize, float);
+   st->buf=PUSH(st->stack, st->windowSize, spx_sig_t);
+   st->excBuf=PUSH(st->stack, st->bufSize, spx_sig_t);
    st->exc = st->excBuf + st->bufSize - st->windowSize;
 
-   st->res=PUSH(st->stack, st->frame_size, float);
-   st->sw=PUSH(st->stack, st->frame_size, float);
-   st->target=PUSH(st->stack, st->frame_size, float);
+   st->res=PUSH(st->stack, st->frame_size, spx_sig_t);
+   st->sw=PUSH(st->stack, st->frame_size, spx_sig_t);
+   st->target=PUSH(st->stack, st->frame_size, spx_sig_t);
    /*Asymmetric "pseudo-Hamming" window*/
    {
       int part1, part2;
@@ -239,8 +239,9 @@
    int i, roots, sub;
    char *stack;
    spx_mem_t *mem;
-   float *innov, *syn_resp;
-   float *low_pi_gain, *low_exc, *low_innov;
+   spx_sig_t *innov, *syn_resp;
+   float *low_pi_gain;
+   spx_sig_t *low_exc, *low_innov;
    SpeexSBMode *mode;
    int dtx;
 
@@ -248,11 +249,21 @@
    stack=st->stack;
    mode = (SpeexSBMode*)(st->mode->mode);
 
-   /* Compute the two sub-bands by filtering with h0 and h1*/
-   qmf_decomp(in, h0, st->x0d, st->x1d, st->full_frame_size, QMF_ORDER, st->h0_mem, stack);
-    
-   /* Encode the narrowband part*/
-   speex_encode(st->st_low, st->x0d, bits);
+   {
+      float *low = PUSH(stack, st->frame_size, float);
+
+      /* Compute the two sub-bands by filtering with h0 and h1*/
+      qmf_decomp(in, h0, st->x0d, st->x1d, st->full_frame_size, QMF_ORDER, st->h0_mem, stack);
+      
+      for (i=0;i<st->frame_size;i++)
+         low[i] = st->x0d[i];
+      
+      /* Encode the narrowband part*/
+      speex_encode(st->st_low, low, bits);
+
+      for (i=0;i<st->frame_size;i++)
+         st->x0d[i] = low[i];
+   }
 
    for (i=0;i<st->frame_size;i++)
       st->x0d[i] *= SIG_SCALING;
@@ -269,8 +280,8 @@
 
 
    low_pi_gain = PUSH(stack, st->nbSubframes, float);
-   low_exc = PUSH(stack, st->frame_size, float);
-   low_innov = PUSH(stack, st->frame_size, float);
+   low_exc = PUSH(stack, st->frame_size, spx_sig_t);
+   low_innov = PUSH(stack, st->frame_size, spx_sig_t);
    speex_encoder_ctl(st->st_low, SPEEX_GET_PI_GAIN, low_pi_gain);
    speex_encoder_ctl(st->st_low, SPEEX_GET_EXC, low_exc);
    speex_encoder_ctl(st->st_low, SPEEX_GET_INNOV, low_innov);
@@ -454,12 +465,13 @@
    }
    
    mem=PUSH(stack, st->lpcSize, spx_mem_t);
-   syn_resp=PUSH(stack, st->subframeSize, float);
-   innov = PUSH(stack, st->subframeSize, float);
+   syn_resp=PUSH(stack, st->subframeSize, spx_sig_t);
+   innov = PUSH(stack, st->subframeSize, spx_sig_t);
 
    for (sub=0;sub<st->nbSubframes;sub++)
    {
-      float *exc, *sp, *res, *target, *sw, tmp, filter_ratio;
+      spx_sig_t *exc, *sp, *res, *target, *sw;
+      float tmp, filter_ratio;
       int offset;
       float rl, rh, eh=0, el=0;
       int fold;
@@ -605,9 +617,6 @@
          for (i=0;i<st->subframeSize;i++)
             target[i]*=scale_1;
 
-         for (i=0;i<st->subframeSize;i++)
-            syn_resp[i]/=SIG_SCALING;
-
          /* Reset excitation */
          for (i=0;i<st->subframeSize;i++)
             innov[i]=0;
@@ -623,7 +632,7 @@
 
          if (SUBMODE(double_codebook)) {
             char *tmp_stack=stack;
-            float *innov2 = PUSH(tmp_stack, st->subframeSize, float);
+            spx_sig_t *innov2 = PUSH(tmp_stack, st->subframeSize, spx_sig_t);
             for (i=0;i<st->subframeSize;i++)
                innov2[i]=0;
             for (i=0;i<st->subframeSize;i++)
@@ -637,9 +646,6 @@
                exc[i] += innov2[i];
          }
 
-         for (i=0;i<st->subframeSize;i++)
-            syn_resp[i]/=SIG_SCALING;
-
       }
 
          /*Keep the previous memory*/
@@ -705,18 +711,18 @@
    st->first=1;
 
 
-   st->x0d=PUSH(st->stack, st->frame_size, float);
-   st->x1d=PUSH(st->stack, st->frame_size, float);
-   st->high=PUSH(st->stack, st->full_frame_size, float);
-   st->y0=PUSH(st->stack, st->full_frame_size, float);
-   st->y1=PUSH(st->stack, st->full_frame_size, float);
+   st->x0d=PUSH(st->stack, st->frame_size, spx_sig_t);
+   st->x1d=PUSH(st->stack, st->frame_size, spx_sig_t);
+   st->high=PUSH(st->stack, st->full_frame_size, spx_sig_t);
+   st->y0=PUSH(st->stack, st->full_frame_size, spx_sig_t);
+   st->y1=PUSH(st->stack, st->full_frame_size, spx_sig_t);
 
    st->h0_mem=PUSH(st->stack, QMF_ORDER, float);
    st->h1_mem=PUSH(st->stack, QMF_ORDER, float);
    st->g0_mem=PUSH(st->stack, QMF_ORDER, float);
    st->g1_mem=PUSH(st->stack, QMF_ORDER, float);
 
-   st->exc=PUSH(st->stack, st->frame_size, float);
+   st->exc=PUSH(st->stack, st->frame_size, spx_sig_t);
 
    st->qlsp = PUSH(st->stack, st->lpcSize, float);
    st->old_qlsp = PUSH(st->stack, st->lpcSize, float);
@@ -835,7 +841,8 @@
    int wideband;
    int ret;
    char *stack;
-   float *low_pi_gain, *low_exc, *low_innov;
+   float *low_pi_gain;
+   spx_sig_t *low_exc, *low_innov;
    spx_coef_t *awk1, *awk2, *awk3;
    int dtx;
    SpeexSBMode *mode;
@@ -844,11 +851,16 @@
    stack=st->stack;
    mode = (SpeexSBMode*)(st->mode->mode);
 
-   /* Decode the low-band */
-   ret = speex_decode(st->st_low, bits, st->x0d);
-
-   for (i=0;i<st->frame_size;i++)
-      st->x0d[i] *= SIG_SCALING;
+   {
+      float *low;
+      low = PUSH(stack, st->frame_size, float);
+      
+      /* Decode the low-band */
+      ret = speex_decode(st->st_low, bits, low);
+      
+      for (i=0;i<st->frame_size;i++)
+         st->x0d[i] = low[i]*SIG_SCALING;
+   }
 
    speex_decoder_ctl(st->st_low, SPEEX_GET_DTX_STATUS, &dtx);
 
@@ -920,8 +932,8 @@
       st->exc[i]=0;
 
    low_pi_gain = PUSH(stack, st->nbSubframes, float);
-   low_exc = PUSH(stack, st->frame_size, float);
-   low_innov = PUSH(stack, st->frame_size, float);
+   low_exc = PUSH(stack, st->frame_size, spx_sig_t);
+   low_innov = PUSH(stack, st->frame_size, spx_sig_t);
    speex_decoder_ctl(st->st_low, SPEEX_GET_PI_GAIN, low_pi_gain);
    speex_decoder_ctl(st->st_low, SPEEX_GET_EXC, low_exc);
    speex_decoder_ctl(st->st_low, SPEEX_GET_INNOV, low_innov);
@@ -940,7 +952,8 @@
 
    for (sub=0;sub<st->nbSubframes;sub++)
    {
-      float *exc, *sp, tmp, filter_ratio, el=0;
+      spx_sig_t *exc, *sp;
+      float tmp, filter_ratio, el=0;
       int offset;
       float rl=0,rh=0;
       
@@ -1041,7 +1054,7 @@
 
          if (SUBMODE(double_codebook)) {
             char *tmp_stack=stack;
-            float *innov2 = PUSH(tmp_stack, st->subframeSize, float);
+            spx_sig_t *innov2 = PUSH(tmp_stack, st->subframeSize, spx_sig_t);
             for (i=0;i<st->subframeSize;i++)
                innov2[i]=0;
             SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize, 

<p><p>1.44      +13 -13    speex/libspeex/sb_celp.h

Index: sb_celp.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- sb_celp.h	8 Oct 2003 04:38:54 -0000	1.43
+++ sb_celp.h	8 Oct 2003 04:40:41 -0000	1.44
@@ -58,17 +58,17 @@
    float  gamma2;              /**< Perceptual weighting coef 2 */
 
    char  *stack;               /**< Temporary allocation stack */
-   float *x0d, *x1d; /**< QMF filter signals*/
-   float *high;                /**< High-band signal (buffer) */
-   float *y0, *y1;             /**< QMF synthesis signals */
+   spx_sig_t *x0d, *x1d; /**< QMF filter signals*/
+   spx_sig_t *high;                /**< High-band signal (buffer) */
+   spx_sig_t *y0, *y1;             /**< QMF synthesis signals */
    float *h0_mem, *h1_mem, *g0_mem, *g1_mem; /**< QMF memories */
 
-   float *excBuf;              /**< High-band excitation */
-   float *exc;                 /**< High-band excitation (for QMF only)*/
-   float *buf;                 /**< Temporary buffer */
-   float *res;                 /**< Zero-input response (ringing) */
-   float *sw;                  /**< Perceptually weighted signal */
-   float *target;              /**< Weighted target signal (analysis by synthesis) */
+   spx_sig_t *excBuf;              /**< High-band excitation */
+   spx_sig_t *exc;                 /**< High-band excitation (for QMF only)*/
+   spx_sig_t *buf;                 /**< Temporary buffer */
+   spx_sig_t *res;                 /**< Zero-input response (ringing) */
+   spx_sig_t *sw;                  /**< Perceptually weighted signal */
+   spx_sig_t *target;              /**< Weighted target signal (analysis by synthesis) */
    spx_word16_t *window;              /**< LPC analysis window */
    float *lagWindow;           /**< Auto-correlation window */
    spx_word16_t *autocorr;            /**< Auto-correlation (for LPC analysis) */
@@ -122,12 +122,12 @@
    int    lpc_enh_enabled;
 
    char  *stack;
-   float *x0d, *x1d;
-   float *high;
-   float *y0, *y1;
+   spx_sig_t *x0d, *x1d;
+   spx_sig_t *high;
+   spx_sig_t *y0, *y1;
    float *h0_mem, *h1_mem, *g0_mem, *g1_mem;
 
-   float *exc;
+   spx_sig_t *exc;
    float *qlsp;
    float *old_qlsp;
    float *interp_qlsp;

<p><p>1.9       +2 -2      speex/libspeex/vq.c

Index: vq.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vq.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- vq.c	15 Dec 2002 04:45:41 -0000	1.8
+++ vq.c	8 Oct 2003 04:40:41 -0000	1.9
@@ -57,7 +57,7 @@
 
 
 /*Finds the indices of the n-best entries in a codebook*/
-void vq_nbest(float *in, float *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist)
+void vq_nbest(spx_sig_t *in, spx_sig_t *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist)
 {
    int i,j,k,used;
    used = 0;
@@ -81,7 +81,7 @@
 }
 
 /*Finds the indices of the n-best entries in a codebook with sign*/
-void vq_nbest_sign(float *in, float *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist)
+void vq_nbest_sign(spx_sig_t *in, spx_sig_t *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist)
 {
    int i,j,k, sign, used;
    used=0;

<p><p>1.8       +4 -2      speex/libspeex/vq.h

Index: vq.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vq.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vq.h	23 Oct 2002 05:18:29 -0000	1.7
+++ vq.h	8 Oct 2003 04:40:41 -0000	1.8
@@ -33,10 +33,12 @@
 #ifndef VQ_H
 #define VQ_H
 
+#include "misc.h"
+
 int vq_index(float *in, float *codebook, int len, int entries);
 
-void vq_nbest(float *in, float *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist);
+void vq_nbest(spx_sig_t *in, spx_sig_t *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist);
 
-void vq_nbest_sign(float *in, float *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist);
+void vq_nbest_sign(spx_sig_t *in, spx_sig_t *codebook, int len, int entries, float *E, int N, int *nbest, float *best_dist);
 
 #endif

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list