[xiph-cvs] cvs commit: speex/libspeex filters.c ltp.c misc.h smallft.c
Jean-Marc Valin
jm at xiph.org
Tue Oct 7 21:56:09 PDT 2003
jm 03/10/08 00:56:09
Modified: libspeex filters.c ltp.c misc.h smallft.c
Log:
fixed-point: pitch stuff
Revision Changes Path
1.43 +1 -1 speex/libspeex/filters.c
Index: filters.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- filters.c 8 Oct 2003 04:53:18 -0000 1.42
+++ filters.c 8 Oct 2003 04:56:09 -0000 1.43
@@ -88,7 +88,7 @@
}
/*FIXME: remove division*/
- return (1<<(sig_shift+3))*sqrt(1+sum/len)/SIG_SCALING;
+ return (1<<(sig_shift+3))*sqrt(1+sum/len)/(float)SIG_SCALING;
}
#define MUL_16_32_R15(a,bh,bl) ((a)*(bh) + ((a)*(bl)>>15))
<p><p>1.82 +6 -1 speex/libspeex/ltp.c
Index: ltp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- ltp.c 8 Oct 2003 04:53:18 -0000 1.81
+++ ltp.c 8 Oct 2003 04:56:09 -0000 1.82
@@ -340,7 +340,12 @@
x[i][j+1]=x[i+1][j];
x[i][0]=0;
for (j=0;j<nsf;j++)
- x[i][j]+=e[i][0]*r[j]/SIG_SCALING;
+ {
+ /* FIXME: Check for overflows */
+ /*x[i][j]+=e[i][0]*r[j]/SIG_SCALING;*/
+ x[i][j]+=MULT16_32_Q13(SHR(r[j],1), e[i][0]);
+ /*printf ("%d\n", (int)r[j]);*/
+ }
}
}
<p><p>1.32 +9 -0 speex/libspeex/misc.h
Index: misc.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/misc.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- misc.h 8 Oct 2003 04:45:26 -0000 1.31
+++ misc.h 8 Oct 2003 04:56:09 -0000 1.32
@@ -57,6 +57,7 @@
#define SHL(a,shift) ((a) << (shift))
#define MULT16_16(a,b) (((signed int)(a))*(b))
+#define MULT16_32_Q13(a,b) (((a)*((b)>>13)) + ((a)*((signed int)((b)&0x00001fff))>>13))
#define MULT16_32_Q14(a,b) (((a)*((b)>>14)) + ((a)*((signed int)((b)&0x00003fff))>>14))
#define MULT16_32_Q15(a,b) (((a)*((b)>>15)) + ((a)*((signed int)((b)&0x00007fff))>>15))
@@ -87,6 +88,14 @@
#define SHL(a,shift) (a)
#define MULT16_16(a,b) ((a)*(b))
+#define MULT16_32_Q13(a,b) ((a)*(b))
+#define MULT16_32_Q14(a,b) ((a)*(b))
+#define MULT16_32_Q15(a,b) ((a)*(b))
+
+#define MULT16_16_Q13(a,b) ((a)*(b))
+#define MULT16_16_Q14(a,b) ((a)*(b))
+#define MULT16_16_Q15(a,b) ((a)*(b))
+
#endif
<p><p>1.12 +0 -0 speex/libspeex/smallft.c
Index: smallft.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/smallft.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- smallft.c 8 Oct 2003 04:53:18 -0000 1.11
+++ smallft.c 8 Oct 2003 04:56:09 -0000 1.12
@@ -11,7 +11,7 @@
********************************************************************
function: *unnormalized* fft transform
- last mod: $Id: smallft.c,v 1.11 2003/10/08 04:53:18 jm Exp $
+ last mod: $Id: smallft.c,v 1.12 2003/10/08 04:56:09 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