Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Rheinhardt 7f66d9d6c5 avcodec/aacdec_common: Apply offset for SBR VLCs during init
This avoids having to apply it later after every get_vlc2().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 21:44:48 +01:00
Andreas Rheinhardt 1aca4e7fc5 avcodec/aacdec_common: Combine huffman tabs
This allows to avoid the relocations inherent in a table
to individual tables; it also reduces padding.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 21:44:48 +01:00
Andreas Rheinhardt 2c131f126d avcodec/aacdec_common: Switch to ff_vlc_init_tables_from_lengths()
It allows to replace code tables of type uint32_t or uint16_t
by symbols of type uint8_t. It is also faster.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 21:44:48 +01:00
Andreas Rheinhardt 0b4e69cc87 avcodec/aacdec_common: Avoid superfluous VLC structures for SBR VLCs
For all VLCs here, the number of bits of the VLC is
write-only, because it is hardcoded at the call site.
Therefore one can replace these VLC structures with
the only thing that is actually used: The pointer
to the VLCElem table.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 21:44:48 +01:00
Andreas Rheinhardt 22d60524d8 avcodec/aacsbr_template: Deduplicate VLCs
The VLCs, their init code and the tables used for initialization
are currently duplicated for the floating- and fixed-point decoders.
This commit stops doing so and moves this stuff to aacdec_common.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 21:44:48 +01:00
Andreas Rheinhardt 4d6042e9d7 avcodec/aacdec_common: Avoid superfluous VLC structures
For all VLCs here, the number of bits of the VLC is
write-only, because it is hardcoded at the call site.
Therefore one can replace these VLC structures with
the only thing that is actually used: The pointer
to the VLCElem table. And in some cases one can even
avoid this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 21:44:48 +01:00
Andreas Rheinhardt 3b080fe7af avcodec/aacdec_template: Deduplicate VLCs
They (as well as their init code) are currently duplicated
for the floating- and fixed-point decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 20:47:00 +01:00
Andreas Rheinhardt 1f15a7e9a8 avcodec/aacdectab: Deduplicate common decoder tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 20:47:00 +01:00