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

Cédric Schieli cschieli
Mon Apr 27 17:09:34 CEST 2009


2009/4/27 Michael Niedermayer <michaelni at gmx.at>:
> 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.

[...]

>> --- 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

patch updated
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_yuv2rgb_mmx_unaligned.patch
Type: text/x-patch
Size: 2326 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090427/276dec41/attachment.bin>



More information about the ffmpeg-devel mailing list