[xiph-cvs] cvs commit: speex/libspeex misc.h nb_celp.c sb_celp.c testenc_uwb.c

Jean-Marc Valin jm at xiph.org
Tue Nov 11 21:09:28 PST 2003



jm          03/11/12 00:09:28

  Modified:    libspeex misc.h nb_celp.c sb_celp.c testenc_uwb.c
  Log:
  think I've fixed the performance problem caused by underflows.

Revision  Changes    Path
1.46      +4 -0      speex/libspeex/misc.h

Index: misc.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/misc.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- misc.h	11 Nov 2003 00:19:46 -0000	1.45
+++ misc.h	12 Nov 2003 05:09:27 -0000	1.46
@@ -56,6 +56,8 @@
 #define LPC_SHIFT    13
 #define SIG_SHIFT    14
 
+#define VERY_SMALL 0
+
 #ifdef COUNT_MIPS
 extern long long spx_mips;
 #endif
@@ -185,6 +187,8 @@
 #define LPC_SHIFT    0
 #define SIG_SHIFT    0
 
+#define VERY_SMALL 1e-30
+
 #define PSHR(a,shift)       (a)
 #define SHR(a,shift)       (a)
 #define SHL(a,shift)       (a)

<p><p>1.148     +4 -4      speex/libspeex/nb_celp.c

Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -r1.147 -r1.148
--- nb_celp.c	11 Nov 2003 07:33:03 -0000	1.147
+++ nb_celp.c	12 Nov 2003 05:09:27 -0000	1.148
@@ -475,7 +475,7 @@
    if (st->submodes[st->submodeID] == NULL)
    {
       for (i=0;i<st->frameSize;i++)
-         st->exc[i]=st->exc2[i]=st->sw[i]=0;
+         st->exc[i]=st->exc2[i]=st->sw[i]=VERY_SMALL;
 
       for (i=0;i<st->lpcSize;i++)
          st->mem_sw[i]=0;
@@ -655,15 +655,15 @@
 
       /* Compute impulse response of A(z/g1) / ( A(z)*A(z/g2) )*/
       for (i=0;i<st->subframeSize;i++)
-         exc[i]=0;
+         exc[i]=VERY_SMALL;
       exc[0]=SIG_SCALING;
       syn_percep_zero(exc, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, syn_resp, st->subframeSize, st->lpcSize, stack);
 
       /* Reset excitation */
       for (i=0;i<st->subframeSize;i++)
-         exc[i]=0;
+         exc[i]=VERY_SMALL;
       for (i=0;i<st->subframeSize;i++)
-         exc2[i]=0;
+         exc2[i]=VERY_SMALL;
 
       /* Compute zero response of A(z/g1) / ( A(z/g2) * A(z) ) */
       for (i=0;i<st->lpcSize;i++)

<p><p>1.146     +6 -6      speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- sb_celp.c	11 Nov 2003 07:33:03 -0000	1.145
+++ sb_celp.c	12 Nov 2003 05:09:27 -0000	1.146
@@ -159,7 +159,7 @@
    SBEncState *st;
    SpeexSBMode *mode;
 
-   st = (SBEncState*)speex_alloc(sizeof(SBEncState)+8000*sizeof(spx_sig_t));
+   st = (SBEncState*)speex_alloc(sizeof(SBEncState)+10000*sizeof(spx_sig_t));
    st->mode = m;
    mode = (SpeexSBMode*)m->mode;
 
@@ -445,14 +445,14 @@
    if (dtx || st->submodes[st->submodeID] == NULL)
    {
       for (i=0;i<st->frame_size;i++)
-         st->exc[i]=st->sw[i]=0;
+         st->exc[i]=st->sw[i]=VERY_SMALL;
 
       for (i=0;i<st->lpcSize;i++)
          st->mem_sw[i]=0;
       st->first=1;
 
       /* Final signal synthesis from excitation */
-      iir_mem2(st->exc, st->interp_qlpc, st->high, st->subframeSize, st->lpcSize, st->mem_sp);
+      iir_mem2(st->exc, st->interp_qlpc, st->high, st->frame_size, st->lpcSize, st->mem_sp);
 
 #ifndef RELEASE
 
@@ -589,13 +589,13 @@
          scale_1 = 1/scale;
 
          for (i=0;i<st->subframeSize;i++)
-            exc[i]=0;
+            exc[i]=VERY_SMALL;
          exc[0]=SIG_SCALING;
          syn_percep_zero(exc, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, syn_resp, st->subframeSize, st->lpcSize, stack);
          
          /* Reset excitation */
          for (i=0;i<st->subframeSize;i++)
-            exc[i]=0;
+            exc[i]=VERY_SMALL;
          
          /* Compute zero response (ringing) of A(z/g1) / ( A(z/g2) * Aq(z) ) */
          for (i=0;i<st->lpcSize;i++)
@@ -919,7 +919,7 @@
       }
 
       for (i=0;i<st->frame_size;i++)
-         st->exc[i]=0;
+         st->exc[i]=VERY_SMALL;
 
       st->first=1;
 

<p><p>1.5       +1 -1      speex/libspeex/testenc_uwb.c

Index: testenc_uwb.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/testenc_uwb.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testenc_uwb.c	6 Nov 2003 21:35:30 -0000	1.4
+++ testenc_uwb.c	12 Nov 2003 05:09:27 -0000	1.5
@@ -56,7 +56,7 @@
 
    speex_mode_query(&speex_nb_mode, SPEEX_MODE_FRAME_SIZE, &tmp);
    fprintf (stderr, "frame size: %d\n", tmp);
-   skip_group_delay = tmp / 2;
+   skip_group_delay = 509;
 
    if (argc != 4 && argc != 3)
    {

<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