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

Alexander Strange astrange
Mon Nov 29 16:47:05 CET 2010


On Nov 29, 2010, at 8:46 AM, Ronald S. Bultje wrote:

> 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

Lines are only 8-byte aligned - look for STRIDE_ALIGN.



More information about the ffmpeg-devel mailing list