[FFmpeg-devel] [PATCH] Port gradfun to libavfilter (GCI)

Ronald S. Bultje rsbultje
Mon Nov 29 14:46:21 CET 2010


Hi,

On Mon, Nov 29, 2010 at 7:18 AM, Nolan L <nol888 at gmail.com> wrote:
> As part of a GCI task, I've ported the gradfun debanding filter from mplayer
> to libavfilter.
>
> The patch includes changes to the build system to account for CPU
> optimizations that weren't present previously.
>
> There is a SSE2 method that remains unported due to lack of SSE2 detection
> in the configure script that I wasn't quite sure how to add.

if (HAVE_MMX && flags & AV_CPU_FLAG_MMX2) will do what you want, and
then without the #ifdef HAVE_MMX2 parts.

> +static void blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1,
> +                           uint8_t *src, int sstride, int width)
> +{
> +    if (((intptr_t)src|sstride)&15) {
> +        BLURV("movdqu");
> +    } else {
> +        BLURV("movdqa");
> +    }
> +}

My understanding is that lines in FFmpeg are always 16-byte aligned,
so this check is unneeded (we can always use movdqa, which is faster).
If my understanding is wrong, that should be fixed, not this check
added. :-).

Ronald



More information about the ffmpeg-devel mailing list