- Timestamp:
- Nov 23, 2006 10:19:46 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/speex/cb_search.c
r641 r823 1 /* Copyright (C) 2002 Jean-Marc Valin1 /* Copyright (C) 2002-2006 Jean-Marc Valin 2 2 File: cb_search.c 3 3 … … 86 86 87 87 #ifndef OVERRIDE_TARGET_UPDATE 88 PJ_INLINE(void)target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len)88 static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len) 89 89 { 90 90 int n; … … 108 108 SpeexBits *bits, 109 109 char *stack, 110 int complexity,111 110 int update_target 112 111 ) … … 126 125 int shape_cb_size, subvect_size, nb_subvect; 127 126 const split_cb_params *params; 128 int N=2;129 127 int best_index; 130 128 spx_word32_t best_dist; 131 129 int have_sign; 132 N=complexity;133 if (N>10)134 N=10;135 if (N<1)136 N=1;137 130 138 131 params = (const split_cb_params *) par; … … 153 146 ALLOC(e, nsf, spx_sig_t); 154 147 155 /* FIXME: make that adaptive? */148 /* FIXME: Do we still need to copy the target? */ 156 149 for (i=0;i<nsf;i++) 157 150 t[i]=target[i]; … … 294 287 if (N>10) 295 288 N=10; 289 /* Complexity isn't as important for the codebooks as it is for the pitch */ 290 N=(2*N)/3; 296 291 if (N<1) 297 292 N=1; 298 299 293 if (N==1) 300 294 { 301 split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack, complexity,update_target);295 split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack,update_target); 302 296 return; 303 297 } … … 348 342 } 349 343 350 /* FIXME: make that adaptive? */351 344 for (i=0;i<nsf;i++) 352 345 t[i]=target[i]; … … 515 508 int nsf, /* number of samples in subframe */ 516 509 SpeexBits *bits, 517 char *stack 510 char *stack, 511 spx_int32_t *seed 518 512 ) 519 513 { … … 602 596 int nsf, /* number of samples in subframe */ 603 597 SpeexBits *bits, 604 char *stack 598 char *stack, 599 spx_int32_t *seed 605 600 ) 606 601 { 607 602 int i; 608 603 /* FIXME: This is bad, but I don't think the function ever gets called anyway */ 609 spx_int32_t seed = 0;610 604 for (i=0;i<nsf;i++) 611 exc[i]=SHL32(EXTEND32(speex_rand(1, &seed)),SIG_SHIFT);605 exc[i]=SHL32(EXTEND32(speex_rand(1, seed)),SIG_SHIFT); 612 606 }
Note: See TracChangeset
for help on using the changeset viewer.