[FFmpeg-devel] [PATCH] swscale: Only copy dstW/chrDstW of the last line in the plane in planar copy

Michael Niedermayer michaelni
Mon Jul 19 02:42:17 CEST 2010


On Sun, Jul 18, 2010 at 11:41:43PM +0300, Martin Storsj? wrote:
> On Fri, 16 Jul 2010, Reimar D?ffinger wrote:
> 
> > On Fri, Jul 16, 2010 at 08:33:01PM +0300, Martin Storsj? wrote:
> > > > what speed effect does it have to do this with all lines?
> > > > if its slower we could pass a flag to swscale.
> > > 
> > > Haven't benchmarked anything, but I guess it depends on the dimensions. 
> > > More memcpys (height vs 1) but fewer bytes copied in total.
> > 
> > I think it would be nice if it did not overwrite stuff in-between,
> > I guess this might be useful for handling interlaced.
> > I'd really suspect memory bandwidth to be limiting for higher resolutions
> > anyway, but you never know.
> 
> So if this is desired, we could apply the attached patch, which changes 
> the memcpy back to use the full stride for all lines, but only does this 
> if stride == length - then we shouldn't overwrite any data outside of the 
> intended area at all.
> 
> // Martin
>  swscale.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 1ed5ae197650a83fd54f27beb8c43f2340780417  0001-Do-planar-copy-with-a-single-memcpy-only-if-the-stri.patch
> From 015025fee2d42776b4486ac9d9b6a67d4ed86965 Mon Sep 17 00:00:00 2001
> From: Martin Storsjo <martin at martin.st>
> Date: Sun, 18 Jul 2010 23:34:14 +0300
> Subject: [PATCH] Do planar copy with a single memcpy only if the stride is equal to the length

ok with me

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20100719/56ab4fcb/attachment.pgp>



More information about the ffmpeg-devel mailing list