[FFmpeg-devel] Fwd: [PATCH] lavfi: add xbr filter

Michael Niedermayer michaelni at gmx.at
Sat Nov 8 13:51:49 CET 2014


On Sat, Nov 08, 2014 at 05:12:13PM +0530, arwa arif wrote:
[...]

> +static int df(uint32_t x, uint32_t y, const uint32_t *r2y)
> +{
> +
> +#define YMASK 0xff0000
> +#define UMASK 0x00ff00
> +#define VMASK 0x0000ff
> +
> +    uint32_t yuv1 = r2y[x & 0xffffff];
> +    uint32_t yuv2 = r2y[y & 0xffffff];
> +
> +    return abs((yuv1 & YMASK) - (yuv2 & YMASK)) > (48 << 16) ||
> +           abs((yuv1 & UMASK) - (yuv2 & UMASK)) > ( 7 <<  8) ||
> +           abs((yuv1 & VMASK) - (yuv2 & VMASK)) > ( 6 <<  0);

the "> some constant" is wrong
the new code expects this to be a scalar not a boolean
adding the 3 absolute differences together should work better

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141108/eaf3def4/attachment.asc>


More information about the ffmpeg-devel mailing list