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

jm at svn.xiph.org jm at svn.xiph.org
Tue Aug 8 07:17:56 PDT 2006


Author: jm
Date: 2006-08-08 07:17:53 -0700 (Tue, 08 Aug 2006)
New Revision: 11752

Modified:
   trunk/speex/libspeex/cb_search.c
   trunk/speex/libspeex/sb_celp.c
Log:
complexity now has more effect on pitch than innovation codebook


Modified: trunk/speex/libspeex/cb_search.c
===================================================================
--- trunk/speex/libspeex/cb_search.c	2006-08-08 07:43:44 UTC (rev 11751)
+++ trunk/speex/libspeex/cb_search.c	2006-08-08 14:17:53 UTC (rev 11752)
@@ -107,7 +107,6 @@
 spx_word16_t *r,
 SpeexBits *bits,
 char *stack,
-int   complexity,
 int   update_target
 )
 {
@@ -125,15 +124,9 @@
    const signed char *shape_cb;
    int shape_cb_size, subvect_size, nb_subvect;
    const split_cb_params *params;
-   int N=2;
    int best_index;
    spx_word32_t best_dist;
    int have_sign;
-   N=complexity;
-   if (N>10)
-      N=10;
-   if (N<1)
-      N=1;
    
    params = (const split_cb_params *) par;
    subvect_size = params->subvect_size;
@@ -295,10 +288,11 @@
       N=10;
    if (N<1)
       N=1;
-   
+   /* Complexity isn't as important for the codebooks as it is for the pitch */
+   N=(2*N)/3;
    if (N==1)
    {
-      split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack,complexity,update_target);
+      split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack,update_target);
       return;
    }
    ALLOC(ot2, N, spx_word16_t*);

Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c	2006-08-08 07:43:44 UTC (rev 11751)
+++ trunk/speex/libspeex/sb_celp.c	2006-08-08 14:17:53 UTC (rev 11752)
@@ -766,7 +766,7 @@
          /*print_vec(target, st->subframeSize, "\ntarget");*/
          SUBMODE(innovation_quant)(target, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, 
                                    SUBMODE(innovation_params), st->lpcSize, st->subframeSize, 
-                                   innov, syn_resp, bits, stack, (st->complexity+1)>>1, SUBMODE(double_codebook));
+                                   innov, syn_resp, bits, stack, st->complexity, SUBMODE(double_codebook));
          /*print_vec(target, st->subframeSize, "after");*/
 
          signal_mul(innov, innov, scale, st->subframeSize);
@@ -790,7 +790,7 @@
                target[i]*=2.5;
             SUBMODE(innovation_quant)(target, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, 
                                       SUBMODE(innovation_params), st->lpcSize, st->subframeSize, 
-                                      innov2, syn_resp, bits, stack, (st->complexity+1)>>1, 0);
+                                      innov2, syn_resp, bits, stack, st->complexity, 0);
             for (i=0;i<st->subframeSize;i++)
                innov2[i]*=scale*(1/2.5)/SIG_SCALING;
             for (i=0;i<st->subframeSize;i++)



More information about the commits mailing list