[FFmpeg-devel] [PATCH 4/4] avcodec/pngdec: use memcpy instead of byte loops for P frames.

Benoit Fouet benoit.fouet at free.fr
Wed Dec 3 18:32:38 CET 2014


Le 03/12/2014 14:51, Christophe Gisquet a écrit :
> Hi,
> 2014-12-03 14:16 GMT+01:00 Benoit Fouet <benoit.fouet at free.fr>:
>> Rely on the way memcpy is optimized for one's system instead of looping
>> on a byte buffer for buffer copies to handle P frames.
> Are there many compilers left that actually perform a call here
> instead of inlining code? Some people will smugly call that ricing,
> but it would be interesting to bench this for small and large images.
> As you mention "P frames", that might be smaller widths here, where
> the overhead of checking the various aligments etc in a C lib memcpy
> is larger.

When the overhead here is high, then it means that we are going to 
perform a lot on the frame itself, looping using byte buffers.
I believe this is a good compromise (and also I had up to 20% better 
performances on the APNG samples I have).


More information about the ffmpeg-devel mailing list