stupid VBR bug corrected + improvements
authorjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Fri, 16 Aug 2002 07:08:47 +0000 (07:08 +0000)
committerjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Fri, 16 Aug 2002 07:08:47 +0000 (07:08 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@3831 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/cb_search.c
libspeex/ltp.c
libspeex/nb_celp.c

index 3442c48..f04b7fc 100644 (file)
@@ -601,5 +601,5 @@ float *stack
    int i;
 
    for (i=0;i<nsf;i++)
-      exc[i]+=2*((((float)rand())/RAND_MAX)-.5);
+      exc[i]+=3*((((float)rand())/RAND_MAX)-.5);
 }
index 950c224..77356ee 100644 (file)
@@ -48,7 +48,7 @@ void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, f
       {
          float g1, g;
          g1 = corr/(energy+10);
-         g = sqrt(corr/(e0+10));
+         g = sqrt(g1*corr/(e0+10));
          if (g>g1)
             g=g1;
          if (g<0)
@@ -444,8 +444,8 @@ int complexity
 )
 {
    int i;
-   if (pitch_coef>.98)
-      pitch_coef=.98;
+   if (pitch_coef>.9)
+      pitch_coef=.9;
    for (i=0;i<nsf;i++)
    {
       exc[i]=exc[i-start]*pitch_coef;
@@ -469,8 +469,8 @@ int lost)
 {
    int i;
    /*pitch_coef=.9;*/
-   if (pitch_coef>.98)
-      pitch_coef=.98;
+   if (pitch_coef>.9)
+      pitch_coef=.9;
    for (i=0;i<nsf;i++)
    {
       exc[i]=exc[i-start]*pitch_coef;
index 7678185..5675d91 100644 (file)
@@ -305,11 +305,13 @@ void nb_encode(void *state, float *in, SpeexBits *bits)
    if (st->vbr)
    {
       delta_qual = vbr_analysis(st->vbr, in, st->frameSize, ol_pitch, ol_pitch_coef);
-      if (delta_qual<0)
+      /*if (delta_qual<0)*/
          delta_qual*=.1*(3+st->vbr_quality);
       if (st->vbr_enabled) 
       {
          int qual = (int)floor(st->vbr_quality+delta_qual+.5);
+         if (qual<1 && delta_qual>-3.5)
+            qual=1;
          if (qual<0)
             qual=0;
          if (qual>10)