Lines Matching +full:- +full:j

1 /* Copyright (C) 2002-2006 Jean-Marc Valin 
8 - Redistributions of source code must retain the above copyright
11 - Redistributions in binary form must reproduce the above copyright
15 - Neither the name of the Xiph.org Foundation nor the names of its
55 int i, j, k; in compute_weighted_codebook() local
68 for(j=0;j<subvect_size;j++) in compute_weighted_codebook()
72 for (k=0;k<=j;k++) in compute_weighted_codebook()
73 resj = MAC16_16(resj,shape[k],r[j-k]); in compute_weighted_codebook()
81 res[j] = res16; in compute_weighted_codebook()
82 /*printf ("%d\n", (int)res[j]);*/ in compute_weighted_codebook()
115 int i,j,m,q; in split_cb_search_shape_sign_N1() local
134 subvect_size = params->subvect_size; in split_cb_search_shape_sign_N1()
135 nb_subvect = params->nb_subvect; in split_cb_search_shape_sign_N1()
136 shape_cb_size = 1<<params->shape_bits; in split_cb_search_shape_sign_N1()
137 shape_cb = params->shape_cb; in split_cb_search_shape_sign_N1()
138 have_sign = params->have_sign; in split_cb_search_shape_sign_N1()
158 /*Find new n-best based on previous n-best j*/ in split_cb_search_shape_sign_N1()
164 speex_bits_pack(bits,best_index,params->shape_bits+have_sign); in split_cb_search_shape_sign_N1()
173 sign=-1; in split_cb_search_shape_sign_N1()
174 rind-=shape_cb_size; in split_cb_search_shape_sign_N1()
187 for (j=0;j<subvect_size;j++) in split_cb_search_shape_sign_N1()
188 e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5); in split_cb_search_shape_sign_N1()
190 for (j=0;j<subvect_size;j++) in split_cb_search_shape_sign_N1()
191 … e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5)); in split_cb_search_shape_sign_N1()
194 for (j=0;j<subvect_size;j++) in split_cb_search_shape_sign_N1()
195 e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j]; in split_cb_search_shape_sign_N1()
208 sign=-1; in split_cb_search_shape_sign_N1()
209 rind-=shape_cb_size; in split_cb_search_shape_sign_N1()
212 q=subvect_size-m; in split_cb_search_shape_sign_N1()
218 target_update(t+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1)); in split_cb_search_shape_sign_N1()
224 for (j=0;j<nsf;j++) in split_cb_search_shape_sign_N1()
225 exc[j]=ADD32(exc[j],e[j]); in split_cb_search_shape_sign_N1()
232 for (j=0;j<nsf;j++) in split_cb_search_shape_sign_N1()
233 r2[j] = EXTRACT16(PSHR32(e[j] ,6)); in split_cb_search_shape_sign_N1()
235 for (j=0;j<nsf;j++) in split_cb_search_shape_sign_N1()
236 target[j]=SUB16(target[j],PSHR16(r2[j],2)); in split_cb_search_shape_sign_N1()
258 int i,j,k,m,n,q; in split_cb_search_shape_sign() local
306 subvect_size = params->subvect_size; in split_cb_search_shape_sign()
307 nb_subvect = params->nb_subvect; in split_cb_search_shape_sign()
308 shape_cb_size = 1<<params->shape_bits; in split_cb_search_shape_sign()
309 shape_cb = params->shape_cb; in split_cb_search_shape_sign()
310 have_sign = params->have_sign; in split_cb_search_shape_sign()
347 for (j=0;j<N;j++) in split_cb_search_shape_sign()
348 SPEEX_COPY(&ot[j][0], t, nsf); in split_cb_search_shape_sign()
350 /* Pre-compute codewords response and energy */ in split_cb_search_shape_sign()
353 for (j=0;j<N;j++) in split_cb_search_shape_sign()
354 odist[j]=0; in split_cb_search_shape_sign()
360 for (j=0;j<N;j++) in split_cb_search_shape_sign()
361 ndist[j]=VERY_LARGE32; in split_cb_search_shape_sign()
365 for (j=0;j<N;j++) in split_cb_search_shape_sign()
366 best_nind[j] = best_ntarget[j] = 0; in split_cb_search_shape_sign()
367 /*For all n-bests of previous subvector*/ in split_cb_search_shape_sign()
368 for (j=0;j<N;j++) in split_cb_search_shape_sign()
370 spx_word16_t *x=ot[j]+subvect_size*i; in split_cb_search_shape_sign()
379 /*Find new n-best based on previous n-best j*/ in split_cb_search_shape_sign()
385 /*For all new n-bests*/ in split_cb_search_shape_sign()
388 /* Compute total distance (including previous sub-vectors */ in split_cb_search_shape_sign()
389 spx_word32_t err = ADD32(ADD32(odist[j],best_dist[k]),tener); in split_cb_search_shape_sign()
391 /*update n-best list*/ in split_cb_search_shape_sign()
392 if (err<ndist[N-1]) in split_cb_search_shape_sign()
398 for (n=N-1;n>m;n--) in split_cb_search_shape_sign()
400 ndist[n] = ndist[n-1]; in split_cb_search_shape_sign()
401 best_nind[n] = best_nind[n-1]; in split_cb_search_shape_sign()
402 best_ntarget[n] = best_ntarget[n-1]; in split_cb_search_shape_sign()
407 best_ntarget[n] = j; in split_cb_search_shape_sign()
416 for (j=0;j<N;j++) in split_cb_search_shape_sign()
420 nt[j][m]=ot[best_ntarget[j]][m]; in split_cb_search_shape_sign()
428 rind = best_nind[j]; in split_cb_search_shape_sign()
431 sign=-1; in split_cb_search_shape_sign()
432 rind-=shape_cb_size; in split_cb_search_shape_sign()
435 q=subvect_size-m; in split_cb_search_shape_sign()
441 target_update(nt[j]+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1)); in split_cb_search_shape_sign()
445 nind[j][q]=oind[best_ntarget[j]][q]; in split_cb_search_shape_sign()
446 nind[j][i]=best_nind[j]; in split_cb_search_shape_sign()
449 /*update old-new data*/ in split_cb_search_shape_sign()
457 for (j=0;j<N;j++) in split_cb_search_shape_sign()
459 oind[j][m]=nind[j][m]; in split_cb_search_shape_sign()
460 for (j=0;j<N;j++) in split_cb_search_shape_sign()
461 odist[j]=ndist[j]; in split_cb_search_shape_sign()
468 speex_bits_pack(bits,ind[i],params->shape_bits+have_sign); in split_cb_search_shape_sign()
479 sign=-1; in split_cb_search_shape_sign()
480 rind-=shape_cb_size; in split_cb_search_shape_sign()
485 for (j=0;j<subvect_size;j++) in split_cb_search_shape_sign()
486 e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5); in split_cb_search_shape_sign()
488 for (j=0;j<subvect_size;j++) in split_cb_search_shape_sign()
489 e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5)); in split_cb_search_shape_sign()
492 for (j=0;j<subvect_size;j++) in split_cb_search_shape_sign()
493 e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j]; in split_cb_search_shape_sign()
497 for (j=0;j<nsf;j++) in split_cb_search_shape_sign()
498 exc[j]=ADD32(exc[j],e[j]); in split_cb_search_shape_sign()
505 for (j=0;j<nsf;j++) in split_cb_search_shape_sign()
506 r2[j] = EXTRACT16(PSHR32(e[j] ,6)); in split_cb_search_shape_sign()
508 for (j=0;j<nsf;j++) in split_cb_search_shape_sign()
509 target[j]=SUB16(target[j],PSHR16(r2[j],2)); in split_cb_search_shape_sign()
516 const void *par, /* non-overlapping codebook */ in split_cb_shape_sign_unquant()
523 int i,j; in split_cb_shape_sign_unquant() local
532 subvect_size = params->subvect_size; in split_cb_shape_sign_unquant()
533 nb_subvect = params->nb_subvect; in split_cb_shape_sign_unquant()
534 shape_cb_size = 1<<params->shape_bits; in split_cb_shape_sign_unquant()
535 shape_cb = params->shape_cb; in split_cb_shape_sign_unquant()
536 have_sign = params->have_sign; in split_cb_shape_sign_unquant()
548 ind[i] = speex_bits_unpack_unsigned(bits, params->shape_bits); in split_cb_shape_sign_unquant()
555 s=-1; in split_cb_shape_sign_unquant()
559 for (j=0;j<subvect_size;j++) in split_cb_shape_sign_unquant()
560 exc[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5); in split_cb_shape_sign_unquant()
562 for (j=0;j<subvect_size;j++) in split_cb_shape_sign_unquant()
563 … exc[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5)); in split_cb_shape_sign_unquant()
566 for (j=0;j<subvect_size;j++) in split_cb_shape_sign_unquant()
567 exc[subvect_size*i+j]+=s*0.03125*shape_cb[ind[i]*subvect_size+j]; in split_cb_shape_sign_unquant()
601 const void *par, /* non-overlapping codebook */ in noise_codebook_unquant()