Gapless works again (I think). Bit of cleaning up as well.
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Thu, 4 May 2006 15:19:28 +0000 (15:19 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Thu, 4 May 2006 15:19:28 +0000 (15:19 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@11342 0101bb08-14d6-0310-b084-bc0e0c8e3800

TODO
libspeex/nb_celp.c
libspeex/sb_celp.c
libspeex/testenc.c
libspeex/testenc_uwb.c
libspeex/testenc_wb.c
src/speexdec.c

diff --git a/TODO b/TODO
index 8d614d1..2cfee5e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,11 +1,12 @@
 For 1.1.13:
 Input buffer in new enhancer
-make pseudofloat.h more portable
-convert rest of enhancer to fixed-point
-add win32 stuff to the distribution
+(remove the if's in loops in interp_pitch())
+Fix --force-nb
+Fix wideband PLC
+change filter structure in vorbis-psy (use the numerator=LPC version)
+Fix overflow in mdf
 
 Later:
-reduce pitch search complexity in new enhancer
 use 16-bit version of the filters in ltp.c
 get rid of crap that shouldn't be exposed in speex.h
 
index 18f7bee..bd50d26 100644 (file)
@@ -1732,11 +1732,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
 #ifdef NEW_ENHANCER
    if (st->lpc_enh_enabled && SUBMODE(comb_gain)>0 && !st->count_lost)
    {
-      multicomb(st->exc-40, out, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, pitch_gain, SUBMODE(comb_gain), stack);
-      multicomb(st->exc+40, out+80, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, pitch_gain, SUBMODE(comb_gain), stack);
+      multicomb(st->exc-st->subframeSize, out, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, pitch_gain, SUBMODE(comb_gain), stack);
+      multicomb(st->exc+st->subframeSize, out+2*st->subframeSize, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, pitch_gain, SUBMODE(comb_gain), stack);
    } else {
       for (i=0;i<st->frameSize;i++)
-         out[i]=PSHR32(st->exc[i-40],SIG_SHIFT);
+         out[i]=PSHR32(st->exc[i-st->subframeSize],SIG_SHIFT);
    }
 #endif
    
@@ -2106,7 +2106,7 @@ int nb_decoder_ctl(void *state, int request, void *ptr)
       (*(int*)ptr)=0;
 #endif
       break;
-      case SPEEX_GET_PI_GAIN:
+   case SPEEX_GET_PI_GAIN:
       {
          int i;
          spx_word32_t *g = (spx_word32_t*)ptr;
index 1dca120..bc5c720 100644 (file)
@@ -1610,6 +1610,10 @@ int sb_decoder_ctl(void *state, int request, void *ptr)
    case SPEEX_GET_SUBMODE_ENCODING:
       (*(int*)ptr) = st->encode_submode;
       break;
+   case SPEEX_GET_LOOKAHEAD:
+      speex_decoder_ctl(st->st_low, SPEEX_GET_LOOKAHEAD, ptr);
+      (*(int*)ptr) = 2*(*(int*)ptr);
+      break;
    case SPEEX_GET_PI_GAIN:
       {
          int i;
index d3938c6..8f94506 100644 (file)
@@ -57,9 +57,9 @@ int main(int argc, char **argv)
    tmp=1;
    speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
 
-   speex_mode_query(&speex_nb_mode, SPEEX_MODE_FRAME_SIZE, &tmp);
-   fprintf (stderr, "frame size: %d\n", tmp);
-   skip_group_delay = tmp / 4;
+   speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
+   speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
+   skip_group_delay += tmp;
 
    if (argc != 4 && argc != 3)
    {
index bb2081d..7512336 100644 (file)
@@ -58,9 +58,10 @@ int main(int argc, char **argv)
    tmp=1;
    speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
 
-   speex_mode_query(&speex_nb_mode, SPEEX_MODE_FRAME_SIZE, &tmp);
-   fprintf (stderr, "frame size: %d\n", tmp);
-   skip_group_delay = 509;
+   speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
+   speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
+   skip_group_delay += tmp;
+
 
    if (argc != 4 && argc != 3)
    {
index 9ed4ef9..7a19189 100644 (file)
@@ -63,9 +63,10 @@ int main(int argc, char **argv)
    speex_encoder_ctl(st, SPEEX_SET_LOW_MODE, &tmp);
 */
 
-   speex_mode_query(&speex_wb_mode, SPEEX_MODE_FRAME_SIZE, &tmp);
-   fprintf (stderr, "frame size: %d\n", tmp);
-   skip_group_delay = 223-80;
+   speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
+   speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
+   skip_group_delay += tmp;
+
 
    if (argc != 4 && argc != 3)
    {
index 001f757..ff81ce9 100644 (file)
@@ -453,6 +453,7 @@ int main(int argc, char **argv)
    int rate=0;
    int extra_headers;
    int wav_format=0;
+   int lookahead;
 
    enh_enabled = 1;
 
@@ -618,6 +619,7 @@ int main(int argc, char **argv)
             if (packet_count==0)
             {
                st = process_header(&op, enh_enabled, &frame_size, &rate, &nframes, forceMode, &channels, &stereo, &extra_headers, quiet);
+               speex_decoder_ctl(st, SPEEX_GET_LOOKAHEAD, &lookahead);
                if (!nframes)
                   nframes=1;
                if (!st)
@@ -690,15 +692,16 @@ int main(int argc, char **argv)
                      int frame_offset = 0;
                      int new_frame_size = frame_size;
                      /*printf ("packet %d %d\n", packet_no, skip_samples);*/
+                     /*fprintf (stderr, "packet %d %d %d\n", packet_no, skip_samples, lookahead);*/
                      if (packet_no == 1 && j==0 && skip_samples > 0)
                      {
                         /*printf ("chopping first packet\n");*/
-                        new_frame_size -= skip_samples;
-                        frame_offset = skip_samples;
+                        new_frame_size -= skip_samples+lookahead;
+                        frame_offset = skip_samples+lookahead;
                      }
                      if (packet_no == page_nb_packets && skip_samples < 0)
                      {
-                        int packet_length = nframes*frame_size+skip_samples;
+                        int packet_length = nframes*frame_size+skip_samples+lookahead;
                         new_frame_size = packet_length - j*frame_size;
                         if (new_frame_size<0)
                            new_frame_size = 0;