comparison celp_filters.c @ 10045:d35904b4fe3f libavcodec

Add ff_celp_circ_addf() function to be used for sparse vector circular convolution in the upcoming AMR-NB floating point decoder. The function scales and adds a vector, that is lagged by some offset, to another vector with the same number of elements. Patch by Colin McQuillan ( m.niloc googlemail com )
author superdump
date Wed, 12 Aug 2009 19:54:28 +0000
parents 454cb6aa43a3
children 8d536f190e6e
comparison
equal deleted inserted replaced
10044:560708e850a4 10045:d35904b4fe3f
43 43
44 for (k = i; k < len; k++) 44 for (k = i; k < len; k++)
45 fc_out[k] += (fc_in[i] * filter[ k - i]) >> 15; 45 fc_out[k] += (fc_in[i] * filter[ k - i]) >> 15;
46 } 46 }
47 } 47 }
48 }
49
50 void ff_celp_circ_addf(float *out, const float *in,
51 const float *lagged, int lag, float fac, int n)
52 {
53 int k;
54 for (k = 0; k < lag; k++)
55 out[k] = in[k] + fac * lagged[n + k - lag];
56 for (; k < n; k++)
57 out[k] = in[k] + fac * lagged[ k - lag];
48 } 58 }
49 59
50 int ff_celp_lp_synthesis_filter(int16_t *out, 60 int ff_celp_lp_synthesis_filter(int16_t *out,
51 const int16_t* filter_coeffs, 61 const int16_t* filter_coeffs,
52 const int16_t* in, 62 const int16_t* in,