[FFmpeg-devel] [PATCH] Call rdft by function pointer

Måns Rullgård mans
Sun Mar 14 23:38:00 CET 2010


Alex Converse <alex.converse at gmail.com> writes:

> Call the RDFT by a function pointer like other FFT related transforms.
> This makes instruction set optimized versions possible.
>
> --Alex
>
> diff --git a/libavcodec/fft.c b/libavcodec/fft.c
> index 7275d98..8c96fd3 100644
> --- a/libavcodec/fft.c
> +++ b/libavcodec/fft.c
> @@ -107,6 +107,9 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
>      s->imdct_half  = ff_imdct_half_c;
>      s->mdct_calc   = ff_mdct_calc_c;
>  #endif
> +#if CONFIG_RDFT
> +    s->rdft_calc   = ff_rdft_calc_c;
> +#endif
>      s->exptab1     = NULL;
>      s->split_radix = 1;
>  
> diff --git a/libavcodec/fft.h b/libavcodec/fft.h
> index 636f76b..2c5ac2f 100644
> --- a/libavcodec/fft.h
> +++ b/libavcodec/fft.h
> @@ -27,6 +27,8 @@
>  #include "libavutil/mem.h"
>  #include "avfft.h"
>  
> +struct RDFTContext;

Already declared in avfft.h, but read on.

>  /* FFT computation */
>  
>  struct FFTContext {
> @@ -46,6 +48,7 @@ struct FFTContext {
>      void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
>      void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
>      void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
> +    void (*rdft_calc)(struct RDFTContext *s, FFTSample *z);

Why don't you put this in RDFTContext instead?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list