[FFmpeg-cvslog] swscale: factorize DITHER_COPY()

Michael Niedermayer michaelni at gmx.at
Wed May 11 16:54:08 CEST 2011


On Tue, May 10, 2011 at 07:52:14AM +0200, Christophe Gisquet wrote:
> 2011/5/10 Michael Niedermayer <git at videolan.org>:
> > +#define DITHER_COPY(dst, dstStride, src, srcStride)\
> 
> And why not make it a C function, and have a function pointer (eg in
> SwsContext) set to it? This would allow specific arch optimizations.

because a macro allows me to pass 8bit and 16bit arrayes that can be
used while a c function would not like that


> 
> > +                    DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2)
> > +                    DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2)
> 
> And that would avoid doing those integer divisions by 2 (it's really
> signed I guess?) on every line.

per line is too little to matter

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20110511/77050b51/attachment.asc>


More information about the ffmpeg-cvslog mailing list