diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-24 21:28:34 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-18 02:09:34 +0200 |
commit | 010e345afe5d9744956dbc6253a4999e6851e7e9 (patch) | |
tree | bc585a965d63a7bdd4a87dbdfc8d73fb4483d494 /libavcodec/subviewerdec.c | |
parent | 43d02b4634de4882818cd226bba5952312df9a0a (diff) | |
download | ffmpeg-010e345afe5d9744956dbc6253a4999e6851e7e9.tar.gz |
avcodec/smacker: Avoid allocations for decoding Smacker
by using buffers on the stack instead. The fact that the effective
lifetime of most of the allocated buffers doesn't overlap enables one to
limit the stack space used to a fairly modest size (about 1.5 KiB).
That all the buffers used in HuffContexts have always the same number of
elements (namely 256) makes it possible to include the buffers directly
in the HuffContext. Doing so also makes the length field redundant; it has
therefore been removed.
This is beneficial for performance: For GCC 9 the time for one call to
smka_decode_frame() for the sample in ticket #2425 went down from
1794494 to 1709043 decicyles; for Clang 9 it decreased from 1449420 to
1355273 decicycles.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/subviewerdec.c')
0 files changed, 0 insertions, 0 deletions