]> git.sesse.net Git - ffmpeg/commit
avcodec/smacker: Don't zero-initialize unnecessarily
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 25 Jun 2020 14:59:13 +0000 (16:59 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 17 Sep 2020 23:54:31 +0000 (01:54 +0200)
commit77c9507253cab75474825be0836dd147dd2ab602
tree461d4e84425ab79e882504472962ce10c71d9bbf
parent2db38ae7349c4d5f311723ea45cb03bc1745d26d
avcodec/smacker: Don't zero-initialize unnecessarily

With the possible exception of the "last" values when decoding video,
only the part that is actually initialized with values derived from the
bitstream is used afterwards, so it is unnecessary to zero everything at
the beginning. This is also no problem for the "last" values at all,
because they are reset for every frame anyway.

While at it, use sizeof(variable) instead of sizeof(type).

Performance increased slightly: For GCC, from 2068389 decicycles per call
to smka_decode_frame() when decoding the sample from ticket #2425 to 2053758
decicycles; for Clang, from 1534188 to 1523153 decicycles.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/smacker.c