00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "libavutil/arm/cpu.h"
00022 #include "libavcodec/fft.h"
00023 #include "libavcodec/rdft.h"
00024 #include "libavcodec/synth_filter.h"
00025
00026 void ff_fft_permute_neon(FFTContext *s, FFTComplex *z);
00027 void ff_fft_calc_neon(FFTContext *s, FFTComplex *z);
00028
00029 void ff_imdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
00030 void ff_imdct_half_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
00031 void ff_mdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
00032
00033 void ff_rdft_calc_neon(struct RDFTContext *s, FFTSample *z);
00034
00035 void ff_synth_filter_float_neon(FFTContext *imdct,
00036 float *synth_buf_ptr, int *synth_buf_offset,
00037 float synth_buf2[32], const float window[512],
00038 float out[32], const float in[32],
00039 float scale);
00040
00041 av_cold void ff_fft_init_arm(FFTContext *s)
00042 {
00043 int cpu_flags = av_get_cpu_flags();
00044
00045 if (have_neon(cpu_flags)) {
00046 s->fft_permute = ff_fft_permute_neon;
00047 s->fft_calc = ff_fft_calc_neon;
00048 #if CONFIG_MDCT
00049 s->imdct_calc = ff_imdct_calc_neon;
00050 s->imdct_half = ff_imdct_half_neon;
00051 s->mdct_calc = ff_mdct_calc_neon;
00052 s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
00053 #endif
00054 }
00055 }
00056
00057 #if CONFIG_RDFT
00058 av_cold void ff_rdft_init_arm(RDFTContext *s)
00059 {
00060 int cpu_flags = av_get_cpu_flags();
00061
00062 if (have_neon(cpu_flags))
00063 s->rdft_calc = ff_rdft_calc_neon;
00064 }
00065 #endif
00066
00067 #if CONFIG_DCA_DECODER
00068 av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
00069 {
00070 int cpu_flags = av_get_cpu_flags();
00071
00072 if (have_neon(cpu_flags))
00073 s->synth_filter_float = ff_synth_filter_float_neon;
00074 }
00075 #endif