[xiph-cvs] cvs commit: speex/libspeex modes.c nb_celp.c stereo.c vbr.c

Jean-Marc Valin jm at xiph.org
Wed Nov 13 20:49:15 PST 2002



jm          02/11/13 23:49:14

  Modified:    libspeex modes.c nb_celp.c stereo.c vbr.c
  Log:
  Fixed bugs in stereo and zero-mode and did some VBR tuning... it's looking
  good.

Revision  Changes    Path
1.88      +1 -1      speex/libspeex/modes.c

Index: modes.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/modes.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- modes.c	11 Nov 2002 01:08:29 -0000	1.87
+++ modes.c	14 Nov 2002 04:49:14 -0000	1.88
@@ -320,7 +320,7 @@
    {NULL, &nb_submode1, &nb_submode2, &nb_submode3, &nb_submode4, &nb_submode5, &nb_submode6, &nb_submode7,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
    5,
-   {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7}
+   {1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7}
 };
 
 

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

Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- nb_celp.c	14 Nov 2002 00:51:35 -0000	1.81
+++ nb_celp.c	14 Nov 2002 04:49:14 -0000	1.82
@@ -390,7 +390,14 @@
             mode = 7;
             while (mode)
             {
-               if (level > vbr_nb_thresh[mode][vqual])
+               int v1;
+               float thresh;
+               v1=(int)floor(st->vbr_quality);
+               if (v1==10)
+                  thresh = vbr_nb_thresh[mode][v1];
+               else
+                  thresh = (st->vbr_quality-v1)*vbr_nb_thresh[mode][v1+1] + (1+v1-st->vbr_quality)*vbr_nb_thresh[mode][v1];
+               if (level > thresh)
                   break;
                mode--;
             }
@@ -418,7 +425,7 @@
       st->first=1;
 
       /* Final signal synthesis from excitation */
-      iir_mem2(st->exc, st->interp_qlpc, st->frame, st->subframeSize, st->lpcSize, st->mem_sp);
+      iir_mem2(st->exc, st->interp_qlpc, st->frame, st->frameSize, st->lpcSize, st->mem_sp);
 
       in[0] = st->frame[0] + st->preemph*st->pre_mem2;
       for (i=1;i<st->frameSize;i++)
@@ -988,9 +995,9 @@
       for (i=0;i<st->frameSize;i++)
          st->exc[i]=0;
       st->first=1;
-      
+
       /* Final signal synthesis from excitation */
-      iir_mem2(st->exc, st->interp_qlpc, st->frame, st->subframeSize, st->lpcSize, st->mem_sp);
+      iir_mem2(st->exc, st->interp_qlpc, st->frame, st->frameSize, st->lpcSize, st->mem_sp);
 
       out[0] = st->frame[0] + st->preemph*st->pre_mem;
       for (i=1;i<st->frameSize;i++)

<p><p>1.4       +2 -2      speex/libspeex/stereo.c

Index: stereo.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/stereo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- stereo.c	7 Nov 2002 22:13:15 -0000	1.3
+++ stereo.c	14 Nov 2002 04:49:14 -0000	1.4
@@ -90,8 +90,8 @@
    e_left  = e_sum*balance / (1+balance);
    e_right = e_sum-e_left;
 
-   e_left  = sqrt(e_left/e_tot);
-   e_right = sqrt(e_right/e_tot);
+   e_left  = sqrt(e_left/(e_tot+.01));
+   e_right = sqrt(e_right/(e_tot+.01));
 
    for (i=frame_size-1;i>=0;i--)
    {

<p><p>1.10      +1 -1      speex/libspeex/vbr.c

Index: vbr.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vbr.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vbr.c	14 Nov 2002 00:51:35 -0000	1.9
+++ vbr.c	14 Nov 2002 04:49:14 -0000	1.10
@@ -48,7 +48,7 @@
 float vbr_nb_thresh[8][11]={
    {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}, /* silence */
    { 4.5,  3.5,  2.5,  1.5,  0.5,  0.0,  0.0,  0.0,  0.0,  0.0, -1.0}, /*  2 kbps */
-   { 9.5,  7.5,  6.5,  5.5,  5.0,  4.0,  4.5,  3.0,  2.0,  1.0,  0.0}, /*  6 kbps */
+   { 9.0,  7.5,  6.5,  5.5,  5.0,  4.0,  4.5,  3.0,  2.0,  1.0,  0.0}, /*  6 kbps */
    {11.0,  9.5,  8.5,  7.5,  7.0,  6.5,  6.0,  5.0,  4.0,  3.0,  1.0}, /*  8 kbps */
    {11.0, 11.0, 11.0,  9.5,  8.5,  7.5,  6.5,  6.0,  5.0,  4.0,  2.0}, /* 11 kbps */
    {11.0, 11.0, 11.0, 11.0,  9.5,  9.0,  8.0,  7.5,  6.5,  5.0,  3.0}, /* 15 kbps */

<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