[FFmpeg-devel] [PATCH] yuv2rgb: Trailing pixels are not converted if destination width is not multiple of 8 in MMX versions

Michael Niedermayer michaelni
Mon Apr 27 16:23:45 CEST 2009


On Mon, Apr 27, 2009 at 04:22:23PM +0200, C?dric Schieli wrote:
> Hi,
> 
> This patch fixes $suject, using the yuv2rgb_trail helper function.
> 
> Regards,
> C?dric Schieli

>  yuv2rgb_mmx.c      |   17 +++++++++++++++++
>  yuv2rgb_template.c |    2 ++
>  2 files changed, 19 insertions(+)
> 2d4b75624ef828fe088091ba9829210d10458a5b  sws_yuv2rgb_mmx_unaligned.patch
> Index: ffmpeg/libswscale/x86/yuv2rgb_mmx.c
> ===================================================================
> --- ffmpeg.orig/libswscale/x86/yuv2rgb_mmx.c	2009-04-27 15:59:45.397833626 +0200
> +++ ffmpeg/libswscale/x86/yuv2rgb_mmx.c	2009-04-27 16:00:08.848834526 +0200
> @@ -42,6 +42,23 @@ DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw
>  DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
>  DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
>  
> +static void yuv2rgb_mmx_trail(SwsContext *c, uint8_t *py, uint8_t *pu,
> +                              uint8_t *pv, uint8_t *pa, int srcStride,
> +                              uint8_t *dst, int dstStride, int mmx_width,
> +                              int y) {
> +    if (!(y&1) && mmx_width < c->dstW) {
> +        if (pa)
> +            c->yuv2rgb_trail(c, py + mmx_width, py + mmx_width + srcStride,
> +                             pu + (mmx_width>>1), pv + (mmx_width>>1),
> +                             pa + mmx_width, pa + mmx_width + srcStride,
> +                             dst, dst + dstStride, y);
> +        else

{} between if and else would not hurt


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090427/43c8bf7e/attachment.pgp>



More information about the ffmpeg-devel mailing list