36 ac_index = 3 * ac_index - 510;
45 return 3 * (ac_index + pitch_delay_min);
46 else if(ac_index < 12)
47 return 3 * pitch_delay_min + ac_index + 6;
49 return 3 * (ac_index + pitch_delay_min) - 18;
56 return 3 * pitch_delay_min + ac_index - 2;
62 return ac_index + 105;
64 return 6 * (ac_index - 368);
70 return 6 * pitch_delay_min + ac_index - 3;
74 int16_t* quant_energy,
76 int log2_ma_pred_order,
80 int avg_gain=quant_energy[(1 << log2_ma_pred_order) - 1];
82 for(i=(1 << log2_ma_pred_order) - 1; i>0; i--)
84 avg_gain += quant_energy[i-1];
85 quant_energy[i] = quant_energy[i-1];
89 quant_energy[0] =
FFMAX(avg_gain >> log2_ma_pred_order, -10240) - 4096;
91 quant_energy[0] = (6165 * ((
ff_log2_q15(gain_corr_factor) >> 2) - (13 << 13))) >> 13;
99 const int16_t* quant_energy,
108 for(i=0; i<ma_pred_order; i++)
109 mr_energy += quant_energy[i] * ma_prediction_coeff[i];
112 mr_energy += (((-6165LL *
ff_log2(dsp->scalarproduct_int16(fc_v, fc_v, subframe_size, 0))) >> 3) & ~0x3ff);
114 mr_energy = (5439 * (mr_energy >> 15)) >> 8;
117 ((
ff_exp2(mr_energy & 0x7fff) + 16) >> 5) * (gain_corr_factor >> 1),
118 (mr_energy >> 15) - 25
121 mr_energy = gain_corr_factor * exp(
M_LN10 / (20 << 23) * mr_energy) /
123 return mr_energy >> 12;
129 const float *pred_table)
134 float val = fixed_gain_factor *
138 sqrtf(fixed_mean_energy);
141 memmove(&prediction_error[0], &prediction_error[1],
142 3 *
sizeof(prediction_error[0]));
143 prediction_error[3] = 20.0 *
log10f(fixed_gain_factor);
149 const int prev_lag_int,
const int subframe,
150 int third_as_first,
int resolution)
153 if (subframe == 0 || (subframe == 2 && third_as_first)) {
155 if (pitch_index < 197)
158 pitch_index = 3 * pitch_index - 335;
161 if (resolution == 4) {
166 if (pitch_index < 4) {
168 pitch_index = 3 * (pitch_index + search_range_min) + 1;
169 }
else if (pitch_index < 12) {
171 pitch_index += 3 * search_range_min + 7;
174 pitch_index = 3 * (pitch_index + search_range_min - 6) + 1;
180 if (resolution == 5) {
188 *lag_int = pitch_index * 10923 >> 15;
189 *lag_frac = pitch_index - 3 * *lag_int - 1;