- Timestamp:
- Jul 26, 2006 5:04:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/speex/cb_search.c
r278 r628 71 71 resj = MAC16_16(resj,shape[k],r[j-k]); 72 72 #ifdef FIXED_POINT 73 res16 = EXTRACT16(SHR32(resj, 1 1));73 res16 = EXTRACT16(SHR32(resj, 13)); 74 74 #else 75 75 res16 = 0.03125f*resj; … … 89 89 { 90 90 int n; 91 int q=0; 92 for (n=0;n<len;n++,q++) 93 t[n] = SUB32(t[n],MULT16_16_Q11_32(g,r[q])); 91 for (n=0;n<len;n++) 92 t[n] = SUB16(t[n],PSHR32(MULT16_16(g,r[n]),13)); 94 93 } 95 94 #endif … … 98 97 99 98 static void split_cb_search_shape_sign_N1( 100 spx_ sig_t target[], /* target vector */99 spx_word16_t target[], /* target vector */ 101 100 spx_coef_t ak[], /* LPCs for this subframe */ 102 101 spx_coef_t awk1[], /* Weighted LPCs for this subframe */ … … 114 113 { 115 114 int i,j,m,q; 116 #ifndef FIXED_POINT117 int n;118 #endif119 115 VARDECL(spx_word16_t *resp); 120 116 #ifdef _USE_SSE … … 159 155 /* FIXME: make that adaptive? */ 160 156 for (i=0;i<nsf;i++) 161 t[i]= EXTRACT16(PSHR32(target[i],6));157 t[i]=target[i]; 162 158 163 159 compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack); … … 223 219 #ifdef FIXED_POINT 224 220 g=sign*shape_cb[rind*subvect_size+m]; 221 #else 222 g=sign*0.03125*shape_cb[rind*subvect_size+m]; 223 #endif 225 224 target_update(t+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1)); 226 #else227 g=sign*0.03125*shape_cb[rind*subvect_size+m];228 /*FIXME: I think that one too can be replaced by target_update */229 for (n=subvect_size*(i+1);n<nsf;n++,q++)230 t[n] = SUB32(t[n],g*r[q]);231 #endif232 225 } 233 226 } … … 245 238 syn_percep_zero(e, ak, awk1, awk2, r2, nsf,p, stack); 246 239 for (j=0;j<nsf;j++) 247 target[j]=SUB 32(target[j],r2[j]);240 target[j]=SUB16(target[j],EXTRACT16(PSHR32(r2[j],8))); 248 241 } 249 242 } … … 252 245 253 246 void split_cb_search_shape_sign( 254 spx_ sig_t target[], /* target vector */247 spx_word16_t target[], /* target vector */ 255 248 spx_coef_t ak[], /* LPCs for this subframe */ 256 249 spx_coef_t awk1[], /* Weighted LPCs for this subframe */ … … 357 350 /* FIXME: make that adaptive? */ 358 351 for (i=0;i<nsf;i++) 359 t[i]= EXTRACT16(PSHR32(target[i],6));352 t[i]=target[i]; 360 353 361 354 for (j=0;j<N;j++) … … 445 438 #ifdef FIXED_POINT 446 439 g=sign*shape_cb[rind*subvect_size+m]; 440 #else 441 g=sign*0.03125*shape_cb[rind*subvect_size+m]; 442 #endif 447 443 target_update(nt[j]+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1)); 448 #else449 g=sign*0.03125*shape_cb[rind*subvect_size+m];450 /*FIXME: I think that one too can be replaced by target_update */451 for (n=subvect_size*(i+1);n<nsf;n++,q++)452 nt[j][n] = SUB32(nt[j][n],g*r[q]);453 #endif454 444 } 455 445 … … 515 505 syn_percep_zero(e, ak, awk1, awk2, r2, nsf,p, stack); 516 506 for (j=0;j<nsf;j++) 517 target[j]=SUB 32(target[j],r2[j]);507 target[j]=SUB16(target[j],EXTRACT16(PSHR32(r2[j],8))); 518 508 } 519 509 } … … 578 568 579 569 void noise_codebook_quant( 580 spx_ sig_t target[], /* target vector */570 spx_word16_t target[], /* target vector */ 581 571 spx_coef_t ak[], /* LPCs for this subframe */ 582 572 spx_coef_t awk1[], /* Weighted LPCs for this subframe */ … … 596 586 VARDECL(spx_sig_t *tmp); 597 587 ALLOC(tmp, nsf, spx_sig_t); 598 residue_percep_zero(target, ak, awk1, awk2, tmp, nsf, p, stack); 588 for (i=0;i<nsf;i++) 589 tmp[i]=PSHR32(EXTEND32(target[i]),SIG_SHIFT); 590 residue_percep_zero(tmp, ak, awk1, awk2, tmp, nsf, p, stack); 599 591 600 592 for (i=0;i<nsf;i++) … … 602 594 for (i=0;i<nsf;i++) 603 595 target[i]=0; 604 605 596 } 606 597 … … 614 605 ) 615 606 { 616 speex_rand_vec(1, exc, nsf); 607 int i; 608 /* FIXME: This is bad, but I don't think the function ever gets called anyway */ 609 spx_int32_t seed = 0; 610 for (i=0;i<nsf;i++) 611 exc[i]=SHL32(EXTEND32(speex_rand(1, &seed)),SIG_SHIFT); 617 612 }
Note: See TracChangeset
for help on using the changeset viewer.