[xiph-cvs] cvs commit: speex/libspeex arch.h lbr_48k_tables.c ltp.c math_approx.c sb_celp.c

Jean-Marc Valin jm at xiph.org
Thu Nov 20 19:06:43 PST 2003



jm          03/11/20 22:06:43

  Modified:    libspeex arch.h lbr_48k_tables.c ltp.c math_approx.c
                        sb_celp.c
  Log:
  fixed-point: converted pitch gain computation in open-loop search

Revision  Changes    Path
1.2       +1 -0      speex/libspeex/arch.h

Index: arch.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/arch.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch.h	12 Nov 2003 17:16:38 -0000	1.1
+++ arch.h	21 Nov 2003 03:06:42 -0000	1.2
@@ -200,6 +200,7 @@
 #define MULT16_32_Q14(a,b)     ((a)*(b))
 #define MULT16_32_Q15(a,b)     ((a)*(b))
 
+#define MAC16_32_Q11(c,a,b)     ((c)+(a)*(b))
 #define MAC16_32_Q15(c,a,b)     ((c)+(a)*(b))
 
 #define MULT16_16_Q13(a,b)     ((a)*(b))

<p><p>1.2       +1 -0      speex/libspeex/lbr_48k_tables.c

Index: lbr_48k_tables.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/lbr_48k_tables.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lbr_48k_tables.c	13 May 2003 20:57:31 -0000	1.1
+++ lbr_48k_tables.c	21 Nov 2003 03:06:42 -0000	1.2
@@ -30,6 +30,7 @@
 */
 
 
+int dummy_epic_48k_variable=0;
 #ifdef EPIC_48K
 
 signed char gain_cdbk_ulbr[192] = {

<p><p>1.98      +11 -8     speex/libspeex/ltp.c

Index: ltp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/ltp.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- ltp.c	14 Nov 2003 17:48:58 -0000	1.97
+++ ltp.c	21 Nov 2003 03:06:42 -0000	1.98
@@ -35,6 +35,7 @@
 #include "stack_alloc.h"
 #include "filters.h"
 #include "speex_bits.h"
+#include "math_approx.h"
 
 #include <stdio.h>
 
@@ -84,6 +85,7 @@
    {
         best_score[i]=-1;
         gain[i]=0;
+        pitch[i]=start;
    }
 
 
@@ -163,21 +165,22 @@
          }
       }
    }
-   
+
    /* Compute open-loop gain */
    for (j=0;j<N;j++)
    {
-      float g1, g;
+      spx_word32_t g;
       i=pitch[j];
-      g1 = corr[i-start]/(energy[i-start]+10.);
-      g = sqrt(g1*corr[i-start]/(e0+10.));
-      if (g>g1)
-         g=g1;
+      g = DIV32(corr[i-start], 10+SHR(MULT16_16(spx_sqrt(e0),spx_sqrt(energy[i-start])),8));
+      /* FIXME: g = max(g,corr/energy) */
       if (g<0)
-         g=0;
+         g = 0;
+#ifdef FIXED_POINT
+      gain[j]=0.0039062*g;
+#else
       gain[j]=g;
+#endif
    }
-
 }
 
 

<p><p>1.8       +2 -0      speex/libspeex/math_approx.c

Index: math_approx.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/math_approx.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- math_approx.c	7 Nov 2003 08:34:14 -0000	1.7
+++ math_approx.c	21 Nov 2003 03:06:42 -0000	1.8
@@ -46,6 +46,8 @@
    int k=0;
    spx_word32_t rt;
 
+   if (x==0)
+      return 0;
 #if 1
    if (x>16777216)
    {

<p><p>1.156     +0 -1      speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- sb_celp.c	14 Nov 2003 19:16:22 -0000	1.155
+++ sb_celp.c	21 Nov 2003 03:06:42 -0000	1.156
@@ -493,7 +493,6 @@
    for (sub=0;sub<st->nbSubframes;sub++)
    {
       spx_sig_t *exc, *sp, *res, *target, *sw;
-      float tmp;
       spx_word16_t filter_ratio;
       int offset;
       spx_word32_t rl, rh;

<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