diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-04 08:25:47 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:46 +0100 |
commit | 5ac9d78dd2977e9e9021749e215d7208c2a56f39 (patch) | |
tree | 626bb1cf6d75dada9e8b5a51363f65e3cb73b20c /libavcodec/lpc.h | |
parent | f697622f687c22392194d6939914c9a6a01ce69e (diff) | |
download | ffmpeg-5ac9d78dd2977e9e9021749e215d7208c2a56f39.tar.gz |
avcodec/atrac9dec: Make tables used to initialize VLCs smaller
The ATRAC9 decoder uses VLCs which are currently initialized with
static length tables of type uint8_t and code tables of type uint16_t.
Furthermore, in one case the actually desired symbols are in the range
-16..15 and in order to achieve this an ad-hoc symbols table of type
int16_t is calculated.
This commit modifies this process by replacing the codes tables by
symbols tables and switching to ff_init_vlc_from_lengths(); the signed
symbols are stored in the table after having been shifted by 16 to fit
into an uint8_t and are shifted back when the VLC is created. This makes
all symbols fit into an uint8_t, saving space. Furthermore, the earlier
tables had holes in them (entries with length zero that were inserted
because the actually used symbols were not contiguous); these holes are
unnecessary in the new approach, leading to further saving.
Finally, given that now both lengths as well as symbols are of the same
type, they can be combined; this saves a pointer for each VLC.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/lpc.h')
0 files changed, 0 insertions, 0 deletions