[FFmpeg-devel] [PATCH] SSE dct32()

Måns Rullgård mans
Sun Jun 20 15:22:41 CEST 2010

Vitor Sessak <vitor1001 at gmail.com> writes:

> Another solution would be to make everything accepting in != out and
> use inlines to avoid the slowdown:
> static av_always_inline void ff_dct_calc_I_inline_c(DCTContext *ctx,
> FFTSample *in, FFTSample *out)
> {
>    [... actual code ...]
> }
> static void ff_dct_calc_I_c(DCTContext *ctx, FFTSample *in, FFTSample *out)
> {
>     if (in == out)
>         ff_dct_calc_I_inline_c(ctx, out, out);
>     else
>         ff_dct_calc_I_inline_c(ctx, in, out);
> }
> But it introduces its own ugliness...

Yes, I though about that already.  It's kind of ugly, and it results
in duplication for no good reason.

What we'd need is some way to tell the compiler those pointers are
either equal or do not alias at all (and make it use that information).
That's just wishful thinking of course.

All things considered, I suppose a separate dct32 pointer with
separate in/out args is the least ugly solution.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list