[xiph-cvs] cvs commit: speex/src speexenc.c

Jean-Marc Valin jm at xiph.org
Thu Nov 7 21:58:59 PST 2002



jm          02/11/08 00:58:59

  Modified:    libspeex sb_celp.c
               src      speexenc.c
  Log:
  Some temporary kludging to make ultra-wideband work...

Revision  Changes    Path
1.90      +21 -13    speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- sb_celp.c	8 Nov 2002 05:00:26 -0000	1.89
+++ sb_celp.c	8 Nov 2002 05:58:59 -0000	1.90
@@ -149,8 +149,13 @@
    
    {
       /* FIXME: Should do this without explicit reference to a mode */
+#if 0
       int mod=6;
       speex_encoder_ctl(st->st_low, SPEEX_SET_MODE, &mod);
+#else
+      int mod=9;
+      speex_encoder_ctl(st->st_low, SPEEX_SET_QUALITY, &mod);
+#endif
    }
 
    st->lag_factor = mode->lag_factor;
@@ -933,58 +938,61 @@
       }
    case SPEEX_SET_QUALITY:
       {
-         int nb_mode;
+         int nb_qual;
          int quality = (*(int*)ptr);
          switch (quality)
          {
          case 0:
-            nb_mode=0;
+            nb_qual=0;
             st->submodeID = 0;
             break;
          case 1:
-            nb_mode=1;
+            nb_qual=1;
             st->submodeID = 1;
             break;
          case 2:
-            nb_mode=2;
+            nb_qual=2;
             st->submodeID = 1;
             break;
          case 3:
-            nb_mode=3;
+            nb_qual=4;
             st->submodeID = 1;
             break;
          case 4:
-            nb_mode=4;
+            nb_qual=6;
             st->submodeID = 1;
             break;
          case 5:
-            nb_mode=5;
+            nb_qual=8;
             st->submodeID = 1;
             break;
          case 6:
-            nb_mode=5;
+            nb_qual=8;
             st->submodeID = 2;
             break;
          case 7:
-            nb_mode=6;
+            nb_qual=9;
             st->submodeID = 2;
             break;
          case 8:
-            nb_mode=6;
+            nb_qual=9;
             st->submodeID = 3;
             break;
          case 9:
-            nb_mode=7;
+            nb_qual=10;
             st->submodeID = 3;
             break;
          case 10:
-            nb_mode=7;
+            nb_qual=10;
             st->submodeID = 4;
             break;
          default:
             fprintf(stderr, "Unknown sb_ctl quality: %d\n", quality);
          }
-         speex_encoder_ctl(st->st_low, SPEEX_SET_MODE, &nb_mode);
+         /*FIXME: This is a kludge*/
+         if (st->full_frame_size == 640)
+            st->submodeID = 1;
+         speex_encoder_ctl(st->st_low, SPEEX_SET_QUALITY, &nb_qual);
       }
       break;
    case SPEEX_SET_COMPLEXITY:

<p><p>1.57      +1 -1      speex/src/speexenc.c

Index: speexenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexenc.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- speexenc.c	7 Nov 2002 22:13:16 -0000	1.56
+++ speexenc.c	8 Nov 2002 05:58:59 -0000	1.57
@@ -418,7 +418,7 @@
          fprintf (stderr,"Warning: encoding a narrowband file in wideband\n");
    }
 
-   if (!wideband)
+   if (!wideband && !ultrawide)
       narrowband=1;
    if (narrowband)
    {

<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