diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-10-27 14:15:58 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:45 +0100 |
commit | 530d86b90d5f776844a936d5fcf1393cc0cd439c (patch) | |
tree | bc25e34d5dd4b5c17c41b9f370264d185aaf3804 /libavcodec/ttadsp.c | |
parent | 8887232c770f0b191e559945a05e3b99ca8d8561 (diff) | |
download | ffmpeg-530d86b90d5f776844a936d5fcf1393cc0cd439c.tar.gz |
avcodec/cook: Make tables to initialize VLCs smaller
Up until now, the Cook decoder used tables for the lengths of codes and
tables of the codes itself to initialize VLCs; the tables for the codes
were of type uint16_t because the codes were so long. It did not use
explicit symbol tables. This commit instead reorders the tables so that
the code tables are sorted from left to right in the tree. Then the
codes can be easily derived from the lengths and therefore be omitted.
This comes at the price of explicitly coding the symbols, but this is
nevertheless a net win because most of the symbols tables can be coded
on one byte. Furthermore, Cook actually does not use a contiguous range
of symbols for its main VLC tables and the old code compensated for that
by adding holes (codes of length zero) to the tables (that are skipped by
ff_init_vlc_sparse()). This is no longer necessary with the new
approach. All in all, this saves about 1.7KB.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/ttadsp.c')
0 files changed, 0 insertions, 0 deletions