[FFmpeg-devel] [PATCH 2/2] all: do standards compliant absdiff computation

Clément Bœsch u at pkh.me
Sun Aug 23 23:23:54 CEST 2015


On Sun, Aug 23, 2015 at 11:58:23AM -0400, Ganesh Ajjanagadde wrote:
[...]
> diff --git a/libavfilter/vf_hqx.c b/libavfilter/vf_hqx.c
> index fa15d9c..0178793 100644
> --- a/libavfilter/vf_hqx.c
> +++ b/libavfilter/vf_hqx.c
> @@ -65,9 +65,9 @@ static av_always_inline int yuv_diff(uint32_t yuv1, uint32_t yuv2)
>  #define YMASK 0xff0000
>  #define UMASK 0x00ff00
>  #define VMASK 0x0000ff
> -    return abs((yuv1 & YMASK) - (yuv2 & YMASK)) > (48 << 16) ||
> -           abs((yuv1 & UMASK) - (yuv2 & UMASK)) > ( 7 <<  8) ||
> -           abs((yuv1 & VMASK) - (yuv2 & VMASK)) > ( 6 <<  0);
> +    return FFUABSDIFF(yuv1 & YMASK, yuv2 & YMASK) > (48 << 16) ||
> +           FFUABSDIFF(yuv1 & UMASK, yuv2 & UMASK) > ( 7 <<  8) ||
> +           FFUABSDIFF(yuv1 & VMASK, yuv2 & VMASK) > ( 6 <<  0);

This is one of the bottleneck function of the filter. How does it affect
speed? Can you compare the generated ASM?

Same question for xbr.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150823/e4267fef/attachment.sig>


More information about the ffmpeg-devel mailing list