[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 18:53:42 CEST 2009


On Mon, Apr 27, 2009 at 05:09:34PM +0200, C?dric Schieli wrote:
> 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

>  yuv2rgb_mmx.c      |   18 ++++++++++++++++++
>  yuv2rgb_template.c |    2 ++
>  2 files changed, 20 insertions(+)
> 380ea784f72d7e3891717dc030756fc3d003d613  sws_yuv2rgb_mmx_unaligned.patch

ive meant just between the if/else not for the else too but anyway
patch ok

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- 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/4c7a90d4/attachment.pgp>



More information about the ffmpeg-devel mailing list