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

Martin Storsjö martin
Mon Jul 19 09:06:22 CEST 2010


On Mon, 19 Jul 2010, Michael Niedermayer wrote:

> 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

Applied

// Martin



More information about the ffmpeg-devel mailing list