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

Martin Storsjö martin
Sun Jul 18 22:41:43 CEST 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-planar-copy-with-a-single-memcpy-only-if-the-stri.patch
Type: text/x-diff
Size: 1260 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100718/535f79fd/attachment.patch>



More information about the ffmpeg-devel mailing list