[xiph-cvs] cvs commit: speex/libspeex lsp.c sb_celp.c smallft.c
Jean-Marc Valin
jm at xiph.org
Tue Oct 7 21:44:03 PDT 2003
jm 03/10/08 00:44:03
Modified: libspeex lsp.c sb_celp.c smallft.c
Log:
fixed-point: saturation for lsp_to_lpc, probably not the best solution
Revision Changes Path
1.30 +7 -1 speex/libspeex/lsp.c
Index: lsp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/lsp.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- lsp.c 8 Oct 2003 04:33:36 -0000 1.29
+++ lsp.c 8 Oct 2003 04:44:02 -0000 1.30
@@ -375,7 +375,13 @@
}
xout1 = xin1 + *(n4+1);
xout2 = xin2 - *(n4+2);
- ak[j] = ((128+xout1 + xout2)>>8);
+ /* FIXME: perhaps apply bandwidth expansion in case of overflow? */
+ if (xout1 + xout2>256*32766)
+ ak[j] = 32767;
+ else if (xout1 + xout2 < -256*32767)
+ ak[j] = -32768;
+ else
+ ak[j] = ((128+xout1 + xout2)>>8);
*(n4+1) = xin1;
*(n4+2) = xin2;
<p><p>1.134 +2 -2 speex/libspeex/sb_celp.c
Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- sb_celp.c 8 Oct 2003 04:42:59 -0000 1.133
+++ sb_celp.c 8 Oct 2003 04:44:02 -0000 1.134
@@ -130,7 +130,7 @@
SBEncState *st;
SpeexSBMode *mode;
- st = (SBEncState*)speex_alloc(sizeof(SBEncState)+8000*sizeof(float));
+ st = (SBEncState*)speex_alloc(sizeof(SBEncState)+8000*sizeof(spx_sig_t));
st->mode = m;
mode = (SpeexSBMode*)m->mode;
@@ -686,7 +686,7 @@
{
SBDecState *st;
SpeexSBMode *mode;
- st = (SBDecState*)speex_alloc(sizeof(SBDecState)+6000*sizeof(float));
+ st = (SBDecState*)speex_alloc(sizeof(SBDecState)+6000*sizeof(spx_sig_t));
st->mode = m;
mode=(SpeexSBMode*)m->mode;
<p><p>1.5 +0 -0 speex/libspeex/smallft.c
Index: smallft.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/smallft.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- smallft.c 8 Oct 2003 04:42:59 -0000 1.4
+++ smallft.c 8 Oct 2003 04:44:02 -0000 1.5
@@ -11,7 +11,7 @@
********************************************************************
function: *unnormalized* fft transform
- last mod: $Id: smallft.c,v 1.4 2003/10/08 04:42:59 jm Exp $
+ last mod: $Id: smallft.c,v 1.5 2003/10/08 04:44:02 jm Exp $
********************************************************************/
<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