45 static void lsf2lsp(
const float *lsf,
double *lsp)
50 lsp[i] =
cosf(lsf[i]);
53 static void dequant(
float *
out,
const int *idx,
const float *cbs[])
57 for (i = 0; i < 4; i++)
58 memcpy(out + 3*i, cbs[i] + 3*idx[i], 3*
sizeof(
float));
60 memcpy(out + 12, cbs[4] + 4*idx[4], 4*
sizeof(
float));
64 const int* parm,
int ma_pred)
72 isp_new[i] = (1 -
qu[ma_pred]) * isp_q[i]
73 +
qu[ma_pred] * lsf_history[i]
77 memcpy(lsf_history, isp_q, LP_FILTER_ORDER_16k *
sizeof(
float));
85 return 3 * index - 690;
92 int pitch_delay_min = av_clip(pitch_lag_prev - 10,
93 pit_min, pit_max - 19);
94 return 3 * pitch_delay_min + index - 2;
110 memcpy(tmpbuf - LP_FILTER_ORDER_16k, mem_preemph,
111 LP_FILTER_ORDER_16k*
sizeof(*buf));
114 LP_FILTER_ORDER_16k);
116 memcpy(synth - LP_FILTER_ORDER_16k, mem_preemph,
117 LP_FILTER_ORDER_16k *
sizeof(*synth));
120 LP_FILTER_ORDER_16k);
122 memcpy(out_data + 30 - LP_FILTER_ORDER_16k,
123 synth + 30 - LP_FILTER_ORDER_16k,
124 LP_FILTER_ORDER_16k *
sizeof(*synth));
128 LP_FILTER_ORDER_16k);
131 memcpy(mem_preemph, out_data + 2*
L_SUBFR_16k - LP_FILTER_ORDER_16k,
132 LP_FILTER_ORDER_16k *
sizeof(*synth));
134 FFSWAP(
float *, filt_mem[0], filt_mem[1]);
135 for (i = 0, s = 0; i < 30; i++, s += 1.0/30)
136 out_data[i] = tmpbuf[i] + s * (synth[i] - tmpbuf[i]);
143 const double *lsp_2nd,
const double *lsp_prev)
150 lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) * 0.5;
162 float mr_energy,
const float *quant_energy,
164 int subframe_size,
int ma_pred_order)
169 mr_energy = gain_corr_factor * exp(
M_LN10 / 20. * mr_energy) /
174 #define DIVIDE_BY_3(x) ((x) * 10923 >> 15)
185 float pitch_fac, gain_code;
209 float gain_corr_factor;
211 int pitch_delay_frac;
226 pitch_delay_frac = pitch_delay_3x + 2 - 3*pitch_delay_int;
229 &excitation[i_subfr] - pitch_delay_int + 1,
234 memset(fixed_vector, 0,
sizeof(fixed_vector));
242 gain_code = gain_corr_factor *
252 fixed_vector, pitch_fac,
253 gain_code, L_SUBFR_16k);
256 &excitation[i_subfr], L_SUBFR_16k,