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

Jean-Marc Valin jm at xiph.org
Tue Nov 26 21:22:47 PST 2002



jm          02/11/27 00:22:47

  Modified:    libspeex nb_celp.c sb_celp.c
  Log:
  wideband VBR seems to (almost) work. Need to adapt it to work on ultra-
  wideband too.

Revision  Changes    Path
1.85      +5 -1      speex/libspeex/nb_celp.c

Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- nb_celp.c	27 Nov 2002 02:54:34 -0000	1.84
+++ nb_celp.c	27 Nov 2002 05:22:47 -0000	1.85
@@ -384,8 +384,12 @@
                break;
             mode--;
          }
-         fprintf (stderr, "%f %d\n", st->relative_quality, mode);
+         /*fprintf(stderr, "");
+         fprintf (stderr, "encode %f %d\n", st->relative_quality, mode);
+         fprintf(stderr, "encode: %d %d\n",st->submodeID, mode);*/
+
          speex_encoder_ctl(state, SPEEX_SET_MODE, &mode);
+         /*fprintf(stderr, "encode: %d %d\n",st->submodeID, mode);*/
       } else {
          st->relative_quality = -1;
       }

<p><p>1.96      +11 -4     speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- sb_celp.c	27 Nov 2002 02:54:34 -0000	1.95
+++ sb_celp.c	27 Nov 2002 05:22:47 -0000	1.96
@@ -346,7 +346,7 @@
       st->lsp[i] = acos(st->lsp[i]);
 
    /* VBR code */
-   if (0){
+   if (st->vbr_enabled){
       float e_low=0, e_high=0;
       float ratio;
       float low_qual;
@@ -389,8 +389,9 @@
                break;
             mode--;
          }
-         fprintf (stderr, "%f %d\n", low_qual, mode);
+         /*fprintf (stderr, "%f %d\n", low_qual, mode);*/
          speex_encoder_ctl(state, SPEEX_SET_HIGH_MODE, &mode);
+         /*fprintf (stderr, "%d %d\n", st->submodeID, mode);*/
       }
       /*fprintf (stderr, "%f %f\n", ratio, low_qual);*/
    }
@@ -763,7 +764,7 @@
    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);
    
    /* Reconstruct the original */
    fir_mem_up(st->x0d, h0, st->y0, st->full_frame_size, QMF_ORDER, st->g0_mem, stack);
@@ -827,7 +828,7 @@
       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);
 
       fir_mem_up(st->x0d, h0, st->y0, st->full_frame_size, QMF_ORDER, st->g0_mem, stack);
       fir_mem_up(st->high, h1, st->y1, st->full_frame_size, QMF_ORDER, st->g1_mem, stack);
@@ -982,8 +983,12 @@
       speex_encoder_ctl(st, SPEEX_SET_QUALITY, ptr);
       break;
    case SPEEX_SET_VBR:
+      st->vbr_enabled = (*(int*)ptr);
       speex_encoder_ctl(st->st_low, SPEEX_SET_VBR, ptr);
       break;
+   case SPEEX_GET_VBR:
+      (*(int*)ptr) = st->vbr_enabled;
+      break;
    case SPEEX_SET_VBR_QUALITY:
       {
          int q;
@@ -1036,10 +1041,12 @@
       break;
    case SPEEX_GET_BITRATE:
       speex_encoder_ctl(st->st_low, request, ptr);
+      /*fprintf (stderr, "before: %d\n", (*(int*)ptr));*/
       if (st->submodes[st->submodeID])
          (*(int*)ptr) += st->sampling_rate*SUBMODE(bits_per_frame)/st->full_frame_size;
       else
          (*(int*)ptr) += st->sampling_rate*(SB_SUBMODE_BITS+1)/st->full_frame_size;
+      /*fprintf (stderr, "after: %d\n", (*(int*)ptr));*/
       break;
    case SPEEX_SET_SAMPLING_RATE:
       {

<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