43 static void lsf2lsp(
const float *lsf,
double *lsp)
48 lsp[i] = cosf(lsf[i]);
51 static void dequant(
float *out,
const int *idx,
const float *cbs[])
55 for (i = 0; i < 4; i++)
56 memcpy(out + 3*i, cbs[i] + 3*idx[i], 3*
sizeof(
float));
58 memcpy(out + 12, cbs[4] + 4*idx[4], 4*
sizeof(
float));
62 const int* parm,
int ma_pred)
70 isp_new[i] = (1 -
qu[ma_pred]) * isp_q[i]
71 +
qu[ma_pred] * lsf_history[i]
75 memcpy(lsf_history, isp_q, LP_FILTER_ORDER_16k *
sizeof(
float));
83 return 3 * index - 690;
90 int pitch_delay_min = av_clip(pitch_lag_prev - 10,
91 pit_min, pit_max - 19);
92 return 3 * pitch_delay_min + index - 2;
108 memcpy(tmpbuf - LP_FILTER_ORDER_16k, mem_preemph,
109 LP_FILTER_ORDER_16k*
sizeof(*buf));
112 LP_FILTER_ORDER_16k);
114 memcpy(synth - LP_FILTER_ORDER_16k, mem_preemph,
115 LP_FILTER_ORDER_16k *
sizeof(*synth));
118 LP_FILTER_ORDER_16k);
120 memcpy(out_data + 30 - LP_FILTER_ORDER_16k,
121 synth + 30 - LP_FILTER_ORDER_16k,
122 LP_FILTER_ORDER_16k *
sizeof(*synth));
126 LP_FILTER_ORDER_16k);
129 memcpy(mem_preemph, out_data + 2*
L_SUBFR_16k - LP_FILTER_ORDER_16k,
130 LP_FILTER_ORDER_16k *
sizeof(*synth));
132 FFSWAP(
float *, filt_mem[0], filt_mem[1]);
133 for (i = 0, s = 0; i < 30; i++, s += 1.0/30)
134 out_data[i] = tmpbuf[i] + s * (synth[i] - tmpbuf[i]);
141 const double *lsp_2nd,
const double *lsp_prev)
148 lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) * 0.5;
160 float mr_energy,
const float *quant_energy,
161 const float *ma_prediction_coeff,
162 int subframe_size,
int ma_pred_order)
167 mr_energy = gain_corr_factor * exp(
M_LN10 / 20. * mr_energy) /
172 #define DIVIDE_BY_3(x) ((x) * 10923 >> 15)
183 float pitch_fac, gain_code;
207 float gain_corr_factor;
209 int pitch_delay_frac;
224 pitch_delay_frac = pitch_delay_3x + 2 - 3*pitch_delay_int;
227 &excitation[i_subfr] - pitch_delay_int + 1,
232 memset(fixed_vector, 0,
sizeof(fixed_vector));
240 gain_code = gain_corr_factor *
250 fixed_vector, pitch_fac,
251 gain_code, L_SUBFR_16k);
254 &excitation[i_subfr], L_SUBFR_16k,