00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "fft.h"
00022 #include "synth_filter.h"
00023
00024 static void synth_filter_float(FFTContext *imdct,
00025 float *synth_buf_ptr, int *synth_buf_offset,
00026 float synth_buf2[32], const float window[512],
00027 float out[32], const float in[32], float scale, float bias)
00028 {
00029 float *synth_buf= synth_buf_ptr + *synth_buf_offset;
00030 int i, j;
00031
00032 ff_imdct_half(imdct, synth_buf, in);
00033
00034 for (i = 0; i < 16; i++){
00035 float a= synth_buf2[i ];
00036 float b= synth_buf2[i + 16];
00037 float c= 0;
00038 float d= 0;
00039 for (j = 0; j < 512 - *synth_buf_offset; j += 64){
00040 a += window[i + j ]*(-synth_buf[15 - i + j ]);
00041 b += window[i + j + 16]*( synth_buf[ i + j ]);
00042 c += window[i + j + 32]*( synth_buf[16 + i + j ]);
00043 d += window[i + j + 48]*( synth_buf[31 - i + j ]);
00044 }
00045 for ( ; j < 512; j += 64){
00046 a += window[i + j ]*(-synth_buf[15 - i + j - 512]);
00047 b += window[i + j + 16]*( synth_buf[ i + j - 512]);
00048 c += window[i + j + 32]*( synth_buf[16 + i + j - 512]);
00049 d += window[i + j + 48]*( synth_buf[31 - i + j - 512]);
00050 }
00051 out[i ] = a*scale + bias;
00052 out[i + 16] = b*scale + bias;
00053 synth_buf2[i ] = c;
00054 synth_buf2[i + 16] = d;
00055 }
00056 *synth_buf_offset= (*synth_buf_offset - 32)&511;
00057 }
00058
00059 av_cold void ff_synth_filter_init(SynthFilterContext *c)
00060 {
00061 c->synth_filter_float = synth_filter_float;
00062
00063 if (ARCH_ARM) ff_synth_filter_init_arm(c);
00064 }