Lines Matching refs:st

179 		VadVars * st,                         /* i/o : State struct               */
196 filter5(&tmp_buf[2 * i], &tmp_buf[2 * i + 1], st->a_data5[0]);
200 filter5(&tmp_buf[4 * i], &tmp_buf[4 * i + 2], st->a_data5[1]);
201 filter5(&tmp_buf[4 * i + 1], &tmp_buf[4 * i + 3], st->a_data5[2]);
205 filter5(&tmp_buf[8 * i], &tmp_buf[8 * i + 4], st->a_data5[3]);
206 filter5(&tmp_buf[8 * i + 2], &tmp_buf[8 * i + 6], st->a_data5[4]);
207 filter3(&tmp_buf[8 * i + 3], &tmp_buf[8 * i + 7], &st->a_data3[0]);
211 filter3(&tmp_buf[16 * i + 0], &tmp_buf[16 * i + 8], &st->a_data3[1]);
212 filter3(&tmp_buf[16 * i + 4], &tmp_buf[16 * i + 12], &st->a_data3[2]);
213 filter3(&tmp_buf[16 * i + 6], &tmp_buf[16 * i + 14], &st->a_data3[3]);
218 filter3(&tmp_buf[32 * i + 0], &tmp_buf[32 * i + 16], &st->a_data3[4]);
219 filter3(&tmp_buf[32 * i + 8], &tmp_buf[32 * i + 24], &st->a_data3[5]);
225 level[11] = level_calculation(tmp_buf, &st->sub_level[11], 16, 64, 4, 1, 14);
227 level[10] = level_calculation(tmp_buf, &st->sub_level[10], 8, 32, 8, 7, 15);
229 level[9] = level_calculation(tmp_buf, &st->sub_level[9],8, 32, 8, 3, 15);
231 level[8] = level_calculation(tmp_buf, &st->sub_level[8],8, 32, 8, 2, 15);
233 level[7] = level_calculation(tmp_buf, &st->sub_level[7],4, 16, 16, 14, 16);
235 level[6] = level_calculation(tmp_buf, &st->sub_level[6],4, 16, 16, 6, 16);
237 level[5] = level_calculation(tmp_buf, &st->sub_level[5],4, 16, 16, 4, 16);
239 level[4] = level_calculation(tmp_buf, &st->sub_level[4],4, 16, 16, 12, 16);
241 level[3] = level_calculation(tmp_buf, &st->sub_level[3],2, 8, 32, 8, 17);
243 level[2] = level_calculation(tmp_buf, &st->sub_level[2],2, 8, 32, 24, 17);
245 level[1] = level_calculation(tmp_buf, &st->sub_level[1],2, 8, 32, 16, 17);
247 level[0] = level_calculation(tmp_buf, &st->sub_level[0],2, 8, 32, 0, 17);
258 VadVars * st, /* i/o : State structure */
267 if (sub((Word16) (st->tone_flag & 0x7c00), 0x7c00) == 0)
269 st->stat_count = STAT_COUNT;
273 if ((st->vadreg & 0x7f80) == 0)
275 st->stat_count = STAT_COUNT;
281 if(level[i] > st->ave_level[i])
284 denom = st->ave_level[i];
287 num = st->ave_level[i];
310 st->stat_count = STAT_COUNT;
313 if ((st->vadreg & 0x4000) != 0)
316 if (st->stat_count != 0)
318 st->stat_count = st->stat_count - 1;
327 if(st->stat_count == STAT_COUNT)
330 } else if ((st->vadreg & 0x4000) == 0)
336 st->ave_level[i] = add1(st->ave_level[i], vo_mult_r(alpha, vo_sub(level[i], st->ave_level[i])));
348 VadVars * st, /* i/o : State structure */
357 st->burst_count = 0;
358 st->hang_count = 0;
362 if ((st->vadreg & 0x4000) != 0)
364 st->burst_count = st->burst_count + 1;
365 if(st->burst_count >= burst_len)
367 st->hang_count = hang_len;
372 st->burst_count = 0;
373 if (st->hang_count > 0)
375 st->hang_count = st->hang_count - 1;
390 VadVars * st, /* i/o : State structure */
398 update_cntrl(st, level);
401 if ((0x7800 & st->vadreg) == 0)
407 if ((st->stat_count == 0))
423 temp = (st->old_level[i] - st->bckr_est[i]);
427 st->bckr_est[i] = add1(-2, add(st->bckr_est[i],vo_mult_r(alpha_down, temp)));
429 if(st->bckr_est[i] < NOISE_MIN)
431 st->bckr_est[i] = NOISE_MIN;
435 st->bckr_est[i] = add1(bckr_add, add1(st->bckr_est[i],vo_mult_r(alpha_up, temp)));
438 if(st->bckr_est[i] > NOISE_MAX)
440 st->bckr_est[i] = NOISE_MAX;
448 st->old_level[i] = level[i];
460 VadVars * st, /* i/o : State structure */
481 exp = norm_s(st->bckr_est[i]);
482 temp = (st->bckr_est[i] << exp);
492 L_temp = vo_L_add(L_temp, st->bckr_est[i]);
499 if(st->speech_level < temp)
501 st->speech_level = temp;
507 ilog2_speech_level = ilog2(st->speech_level - temp);
527 st->vadreg = (st->vadreg >> 1);
532 st->vadreg = (Word16) (st->vadreg | 0x4000);
543 noise_estimate_update(st, level);
553 return (hangover_addition(st, low_power_flag, hang_len, burst_len));
569 VadVars * st, /* i/o : State structure */
576 if((st->sp_est_cnt - st->sp_max_cnt) > (SP_EST_COUNT - SP_ACTIVITY_COUNT))
578 st->sp_est_cnt = 0;
579 st->sp_max = 0;
580 st->sp_max_cnt = 0;
582 st->sp_est_cnt += 1;
584 if (((st->vadreg & 0x4000)||(in_level > st->speech_level)) && (in_level > MIN_SPEECH_LEVEL1))
587 if(in_level > st->sp_max)
589 st->sp_max = in_level;
591 st->sp_max_cnt += 1;
593 if(st->sp_max_cnt >= SP_ACTIVITY_COUNT)
597 tmp = (st->sp_max >> 1); /* scale to get "average" speech level */
600 if(tmp > st->speech_level)
609 st->speech_level = add1(st->speech_level, vo_mult_r(alpha, vo_sub(tmp, st->speech_level)));
612 st->sp_max = 0;
613 st->sp_max_cnt = 0;
614 st->sp_est_cnt = 0;
738 VadVars * st, /* i/o : State struct */
743 st->tone_flag = (st->tone_flag >> 1);
748 st->tone_flag = (Word16) (st->tone_flag | 0x4000);
760 VadVars * st, /* i/o : State structure */
777 pow_sum = L_add(L_temp, st->prev_pow_sum);
780 st->prev_pow_sum = L_temp;
785 st->tone_flag = (Word16) (st->tone_flag & 0x1fff);
788 filter_bank(st, in_buf, level);
791 VAD_flag = vad_decision(st, level, pow_sum);
802 Estimate_Speech(st, temp); /* Estimate speech level */