46 static void lsf2lsp(
const float *lsf,
double *lsp)
51 lsp[i] =
cosf(lsf[i]);
54 static void dequant(
float *
out,
const int *idx,
const float *cbs[])
58 for (i = 0; i < 4; i++)
59 memcpy(out + 3*i, cbs[i] + 3*idx[i], 3*
sizeof(
float));
61 memcpy(out + 12, cbs[4] + 4*idx[4], 4*
sizeof(
float));
65 const int* parm,
int ma_pred)
73 isp_new[i] = (1 -
qu[ma_pred]) * isp_q[i]
74 +
qu[ma_pred] * lsf_history[i]
78 memcpy(lsf_history, isp_q, LP_FILTER_ORDER_16k *
sizeof(
float));
86 return 3 * index - 690;
93 int pitch_delay_min = av_clip(pitch_lag_prev - 10,
94 pit_min, pit_max - 19);
95 return 3 * pitch_delay_min + index - 2;
111 memcpy(tmpbuf - LP_FILTER_ORDER_16k, mem_preemph,
112 LP_FILTER_ORDER_16k*
sizeof(*buf));
115 LP_FILTER_ORDER_16k);
117 memcpy(synth - LP_FILTER_ORDER_16k, mem_preemph,
118 LP_FILTER_ORDER_16k *
sizeof(*synth));
121 LP_FILTER_ORDER_16k);
123 memcpy(out_data + 30 - LP_FILTER_ORDER_16k,
124 synth + 30 - LP_FILTER_ORDER_16k,
125 LP_FILTER_ORDER_16k *
sizeof(*synth));
129 LP_FILTER_ORDER_16k);
132 memcpy(mem_preemph, out_data + 2*
L_SUBFR_16k - LP_FILTER_ORDER_16k,
133 LP_FILTER_ORDER_16k *
sizeof(*synth));
135 FFSWAP(
float *, filt_mem[0], filt_mem[1]);
136 for (i = 0, s = 0; i < 30; i++, s += 1.0/30)
137 out_data[i] = tmpbuf[i] + s * (synth[i] - tmpbuf[i]);
144 const double *lsp_2nd,
const double *lsp_prev)
151 lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) * 0.5;
163 float mr_energy,
const float *quant_energy,
165 int subframe_size,
int ma_pred_order)
170 mr_energy = gain_corr_factor * exp(
M_LN10 / 20. * mr_energy) /
175 #define DIVIDE_BY_3(x) ((x) * 10923 >> 15)
186 float pitch_fac, gain_code;
210 float gain_corr_factor;
212 int pitch_delay_frac;
227 pitch_delay_frac = pitch_delay_3x + 2 - 3*pitch_delay_int;
230 &excitation[i_subfr] - pitch_delay_int + 1,
235 memset(fixed_vector, 0,
sizeof(fixed_vector));
243 gain_code = gain_corr_factor *
253 fixed_vector, pitch_fac,
254 gain_code, L_SUBFR_16k);
257 &excitation[i_subfr], L_SUBFR_16k,