[FFmpeg-devel] [PATCH] avcodec: do not use init_static_data on some codecs

Michael Niedermayer michael at niedermayer.cc
Sat Feb 3 04:29:40 EET 2018


On Sat, Feb 03, 2018 at 01:36:37AM +0700, Muhammad Faiz wrote:
> They don't modify AVCodec, no needs to call it at register. They will be
> wasteful if these codecs are unused. Instead, call static data initialization
> at codecs' init.
> 
> Benchmark:
> old: 51281340 decicycles in avcodec_register_all,       1 runs,      0 skips
> new:  6738960 decicycles in avcodec_register_all,       1 runs,      0 skips
> 
> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> ---
>  libavcodec/jpeg2000dec.c | 16 +++++++++-------
>  libavcodec/qdmc.c        |  7 +++++--
>  libavcodec/wmavoice.c    |  7 +++++--
>  3 files changed, 19 insertions(+), 11 deletions(-)

LGTM
 
it would be better though if this would happen for all
init_static_data() without the need for extra code per codec

thx

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180203/2598cabe/attachment.sig>


More information about the ffmpeg-devel mailing list