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

Jean-Marc Valin jm at xiph.org
Fri Dec 20 09:45:36 PST 2002



jm          02/12/20 12:45:36

  Modified:    libspeex nb_celp.c vbr.c
  Log:
  Allowed CNG in VBR mode

Revision  Changes    Path
1.101     +16 -0     speex/libspeex/nb_celp.c

Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- nb_celp.c	20 Dec 2002 08:24:46 -0000	1.100
+++ nb_celp.c	20 Dec 2002 17:45:36 -0000	1.101
@@ -411,6 +411,22 @@
                break;
             mode--;
          }
+         
+         if (mode==0)
+         {
+            if (st->submodeID>1 || lsp_dist>.05 || st->dtx_count>20)
+            {
+               mode=1;
+               st->dtx_count=0;
+            } else {
+               mode=0;
+               st->dtx_count++;
+            }
+         } else {
+            if (st->submodeID>1)
+               st->dtx_count=0;
+         }
+
          /*fprintf(stderr, "");
          fprintf (stderr, "encode %f %d\n", st->relative_quality, mode);
          fprintf(stderr, "encode: %d %d\n",st->submodeID, mode);*/

<p><p>1.17      +2 -5      speex/libspeex/vbr.c

Index: vbr.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vbr.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- vbr.c	20 Dec 2002 05:20:28 -0000	1.16
+++ vbr.c	20 Dec 2002 17:45:36 -0000	1.17
@@ -35,9 +35,6 @@
 #include "vbr.h"
 #include <math.h>
 
-#ifdef DEBUG
-#include <stdio.h>
-#endif
 
 #define sqr(x) ((x)*(x))
 
@@ -47,7 +44,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}, /*   CNG   */
-   {-.01, -0.2, -0.3, -0.4, -0.5, -0.6, -0.7, -0.8, -0.9, -0.9, -1.0}, /*  2 kbps */
+   { 3.0,  2.5,  1.5,  0.5, -0.1, -0.3, -0.5, -0.7, -0.8, -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 */
@@ -117,7 +114,7 @@
   non-stationary (harder to notice high-frequency noise)???
 
 */
-#include <stdio.h>
+
 float vbr_analysis(VBRState *vbr, float *sig, int len, int pitch, float pitch_coef)
 {
    int i;

<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