[xiph-commits] r11203 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Fri Apr 21 07:45:34 PDT 2006


Author: jm
Date: 2006-04-21 07:45:31 -0700 (Fri, 21 Apr 2006)
New Revision: 11203

Modified:
   trunk/speex/libspeex/ltp.c
Log:
Fixed a major regression in the 4 kbps mode by adding the target update to
forced_pitch_quant().


Modified: trunk/speex/libspeex/ltp.c
===================================================================
--- trunk/speex/libspeex/ltp.c	2006-04-21 14:20:39 UTC (rev 11202)
+++ trunk/speex/libspeex/ltp.c	2006-04-21 14:45:31 UTC (rev 11203)
@@ -549,7 +549,6 @@
    return err;
 }
 
-
 /** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */
 int pitch_search_3tap(
 spx_sig_t target[],                 /* Target vector */
@@ -583,7 +582,7 @@
    int N;
    const ltp_params *params;
    VARDECL(int *nbest);
-
+   
    N=complexity;
    if (N>10)
       N=10;
@@ -631,7 +630,6 @@
          best_gain_index=cdbk_index;
       }
    }
-   
    /*printf ("pitch: %d %d\n", best_pitch, best_gain_index);*/
    speex_bits_pack(bits, best_pitch-start, params->pitch_bits);
    speex_bits_pack(bits, best_gain_index, params->gain_bits);
@@ -768,12 +766,17 @@
 {
    int i;
    float coef = GAIN_SCALING_1*pitch_coef;
+   VARDECL(spx_sig_t *res);
+   ALLOC(res, nsf, spx_sig_t);
    if (coef>.99)
       coef=.99;
    for (i=0;i<nsf;i++)
    {
       exc[i]=exc[i-start]*coef;
    }
+   syn_percep_zero(exc, ak, awk1, awk2, res, nsf, p, stack);
+   for (i=0;i<nsf;i++)
+      target[i]=SATURATE(SUB32(target[i],res[i]),805306368);
    return start;
 }
 



More information about the commits mailing list