window[i] = sqrt(local_window[i] / sum);
}
+DECLARE_ALIGNED(16, float, ff_sine_128 [ 128]);
+DECLARE_ALIGNED(16, float, ff_sine_256 [ 256]);
+DECLARE_ALIGNED(16, float, ff_sine_512 [ 512]);
+DECLARE_ALIGNED(16, float, ff_sine_1024[1024]);
+DECLARE_ALIGNED(16, float, ff_sine_2048[2048]);
+float *ff_sine_windows[5] = {
+ ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048,
+};
+
// Generate a sine window.
void ff_sine_window_init(float *window, int n) {
int i;
for(i = 0; i < n; i++)
- window[i] = sin((i + 0.5) / (2 * n) * M_PI);
+ window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n)));
}
/**
* @param output N/2 samples
* @param input N/2 samples
*/
-void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
{
int k, n8, n4, n2, n, j;
const uint16_t *revtab = s->fft.revtab;
* @param input N/2 samples
* @param tmp N/2 samples
*/
-void ff_imdct_calc(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp)
+void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
{
int k;
int n = 1 << s->nbits;
int n2 = n >> 1;
int n4 = n >> 2;
- ff_imdct_half(s, output+n4, input);
+ ff_imdct_half_c(s, output+n4, input);
for(k = 0; k < n4; k++) {
output[k] = -output[n2-k-1];
* @param out N/2 samples
* @param tmp temporary storage of N/2 samples
*/
-void ff_mdct_calc(MDCTContext *s, FFTSample *out,
- const FFTSample *input, FFTSample *tmp)
+void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input)
{
int i, j, n, n8, n4, n2, n3;
- FFTSample re, im, re1, im1;
+ FFTSample re, im;
const uint16_t *revtab = s->fft.revtab;
const FFTSample *tcos = s->tcos;
const FFTSample *tsin = s->tsin;