diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-25 19:00:28 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-18 02:03:36 +0200 |
commit | 527b853d1a72beb08ffaa63239d13b2c0c327c66 (patch) | |
tree | c9770f34258edf4dbe40ed33fda947801d8631cd /libavfilter/f_metadata.c | |
parent | b3e89ad6466a2b2dd14a0a675aa97a61b81300b8 (diff) | |
download | ffmpeg-527b853d1a72beb08ffaa63239d13b2c0c327c66.tar.gz |
avcodec/smacker: Replace implicit checks for overread by explicit ones
Using explicit checks has the advantage that one can combine several
checks into one and does not have to check every time. E.g. reading a
16bit PCM sample involves two calls to get_vlc2(), each of which may
read up to three times up to SMKTREE_BITS (= 9) bits. But given that the
padding that the input packet is supposed to have is large enough, it is
no problem to only check once for each sample.
This turned out to be beneficial for performance: For GCC 9, the time for
one call of smka_decode_frame() for the sample from ticket #2425 went down
from 2055905 to 1804751 decicycles; for Clang 9 it went down from 1510538
to 1479680 decicycles.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavfilter/f_metadata.c')
0 files changed, 0 insertions, 0 deletions