Commit graph

6 commits

Author SHA1 Message Date
Andreas Rheinhardt
c1f124f3f0 avcodec/hq_hqa: Use ff_vlc_init_from_lengths()
This allows to avoid the codes table; furthermore, given
that the runs fit into seven bits and level into nine,
one can put them into one int16_t and use as symbols table
in ff_vlc_init_from_lengths().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:26:37 +02:00
Andreas Rheinhardt
9c0d6145c9 avcodec/hq_hqa: Include implicit +1 run in RL VLC table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:25:43 +02:00
Andreas Rheinhardt
ce0074f97b avcodec/hq_hqa: Use RL-VLC table
This moves indirections to init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:25:29 +02:00
Andreas Rheinhardt
18309fba3c avcodec/hq_hqadata: Avoid relocations
Initialize a list of 128 pointers at decoder init
instead of using a const list of pointers (which
will be initialized at runtime when libavcodec
is loaded when using pic code with Elf); the former
takes only 128 bytes (+ a bit of initialization code),
the latter 1KiB on 64 bit systems (+3KiB on x64 elf
for relocation information).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:24:39 +02:00
Andreas Rheinhardt
e38616c4ac avcodec/hq{xvlc,_hqadata}: Deduplicate and hardcode cbp table
This table is so small (32 elements amounting to 128 bytes)
that it is more efficient size-wise to hardcode it instead
of initializing it at runtime.

Also stop duplicating it in hq_hqa.o and hqx.o.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-13 08:14:51 +02:00
Andreas Rheinhardt
51b2343ef9 avcodec/hq_hqadata: Move data in a header
It is only used by hq_hqa.c, so said header can simply
be included there.
Also move the code to initialize the VLCs to hq_hqa.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-07 09:15:18 +01:00
Renamed from libavcodec/hq_hqadata.c (Browse further)