diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-25 15:14:53 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-18 02:00:34 +0200 |
commit | 3899adc29869301bfab77a9064a21da7a5a5163d (patch) | |
tree | c9ddd548b30c64a068a03823fd3e70a0d8fe6fe7 /libavcodec/aliaspixdec.c | |
parent | 943a4581570728b4b1a2bf97e5601e24f3f80404 (diff) | |
download | ffmpeg-3899adc29869301bfab77a9064a21da7a5a5163d.tar.gz |
avcodec/smacker: Remove redundant checks when reading VLC codes
The VLC codes in question originate from a Huffmann tree and so every
sequence of bits that is longer than the longest code contains an
initial sequence that is a valid code. Given that it has been checked
during reading said tree (and once again in ff_init_vlc_sparse()) that
the length of each code is <= 3 * the number of bits read at once when
reading codes, get_vlc2() will always find a matching entry.
These checks have been added in 71d3c25a7ef442ac2dd7b6fbf7c489ebc0b58e9b
at a time when the length of the codes had not been checked when parsing
the tree.
For GCC 9 and the sample from ticket #2425 this led to a slight
performance regression: The time for one call to smka_decode_frame()
increased from 2053671 to 2064529 decicycles; for Clang 9, performance
improved from 1521288 to 1508459 decicycles.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/aliaspixdec.c')
0 files changed, 0 insertions, 0 deletions