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

Jean-Marc Valin jm at xiph.org
Wed Dec 11 14:03:35 PST 2002



jm          02/12/11 17:03:35

  Modified:    libspeex nb_celp.c vbr.c
  Log:
  Improvements to the way silence is handled in VBR.

Revision  Changes    Path
1.90      +2 -2      speex/libspeex/nb_celp.c

Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- nb_celp.c	11 Dec 2002 08:24:05 -0000	1.89
+++ nb_celp.c	11 Dec 2002 22:03:35 -0000	1.90
@@ -335,7 +335,7 @@
                                nol_pitch, nol_pitch_coef, 6, stack);
          ol_pitch=nol_pitch[0];
          ol_pitch_coef = nol_pitch_coef[0];
-         printf ("%f %d %d %d %d %d %d ", ol_pitch_coef, nol_pitch[0], nol_pitch[1], nol_pitch[2], nol_pitch[3], nol_pitch[4], nol_pitch[5]);
+         /*printf ("%f %d %d %d %d %d %d ", ol_pitch_coef, nol_pitch[0], nol_pitch[1], nol_pitch[2], nol_pitch[3], nol_pitch[4], nol_pitch[5]);*/
          /*Try to remove pitch multiples*/
          for (i=1;i<6;i++)
          {
@@ -347,7 +347,7 @@
                ol_pitch = nol_pitch[i];
             }
          }
-         printf ("%d\n", ol_pitch);
+         /*printf ("%d\n", ol_pitch);*/
          /*if (ol_pitch>50)
            ol_pitch/=2;*/
          /*ol_pitch_coef = sqrt(ol_pitch_coef);*/

<p><p>1.14      +21 -2     speex/libspeex/vbr.c

Index: vbr.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vbr.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- vbr.c	30 Nov 2002 05:24:41 -0000	1.13
+++ vbr.c	11 Dec 2002 22:03:35 -0000	1.14
@@ -47,8 +47,8 @@
 
 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 */
-   { 3.9,  2.5,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, -1.0}, /*  2 kbps */
-   { 8.0,  5.6,  4.7,  4.2,  3.9,  3.5,  3.0,  2.5,  2.0,  1.0,  0.0}, /*  6 kbps */
+   {-.01, -0.2, -0.3, -0.4, -0.5, -0.6, -0.7, -0.8, -0.9, -0.9, -1.0}, /*  2 kbps */
+   { 8.5,  5.6,  4.7,  4.2,  3.9,  3.5,  3.0,  2.5,  2.0,  1.0,  0.0}, /*  6 kbps */
    {11.0,  8.5,  7.5,  6.5,  5.0,  3.9,  3.9,  3.9,  3.5,  3.0,  1.0}, /*  8 kbps */
    {11.0, 11.0,  9.9,  9.0,  8.0,  7.0,  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.0,  6.5,  5.0,  3.0}, /* 15 kbps */
@@ -211,13 +211,32 @@
    if (qual>10)
       qual=10;
    
+   /*
    if (vbr->consec_noise>=2)
       qual-=1.3;
    if (vbr->consec_noise>=5)
       qual-=1.3;
    if (vbr->consec_noise>=12)
       qual-=1.3;
+   */
+   if (vbr->consec_noise)
+      qual-=.8*log(2.0 + vbr->consec_noise);
+   if (qual<0)
+      qual=0;
    
+   if (ener<60000)
+   {
+      if (vbr->consec_noise)
+         qual-=0.8*log(2.0 + vbr->consec_noise);
+      if (ener<10000&&vbr->consec_noise)
+         qual-=0.8*log(2.0 + vbr->consec_noise);
+      if (qual<0)
+         qual=0;
+      qual += .3*log(ener/60000.0);
+   }
+   if (qual<-1)
+      qual=-1;
+
    vbr->last_pitch_coef = pitch_coef;
    vbr->last_quality = qual;
 

<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