aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3data.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-06 10:14:22 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-08 17:51:46 +0100
commit22241d12c7bc7f317832d8101ebed8d2db78a41f (patch)
tree9e1dfe0ffa569a83987434cfe4485d14f545a6ca /libavcodec/vp3data.h
parent984fdfd042aeec7d48cd906661b2192568874730 (diff)
downloadffmpeg-22241d12c7bc7f317832d8101ebed8d2db78a41f.tar.gz
avcodec/vp3: Apply VLC offset during init
By switching to ff_init_vlc_from_lengths() one can apply both positive as well as negative offsets for free; in this case it even saves space because one replaces codes tables that don't fit into an uint8_t by symbols tables that fit into an uint8_t or can even be completely avoided as they are trivial. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/vp3data.h')
-rw-r--r--libavcodec/vp3data.h24
1 files changed, 5 insertions, 19 deletions
diff --git a/libavcodec/vp3data.h b/libavcodec/vp3data.h
index a1366788c5..4dc20c5f29 100644
--- a/libavcodec/vp3data.h
+++ b/libavcodec/vp3data.h
@@ -95,25 +95,11 @@ static const uint8_t vp31_filter_limit_values[64] = {
0, 0, 0, 0, 0, 0, 0, 0
};
-static const uint16_t superblock_run_length_vlc_table[34][2] = {
- { 0, 1 },
-
- { 4, 3 }, { 5, 3 },
-
- { 0xC, 4 }, { 0xD, 4 },
-
- { 0x38, 6 }, { 0x39, 6 }, { 0x3A, 6 }, { 0x3B, 6 },
-
- { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
- { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
-
- { 0x3E0, 10 }, { 0x3E1, 10 }, { 0x3E2, 10 }, { 0x3E3, 10 },
- { 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 },
- { 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 },
- { 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 },
-
- { 0x3F, 6 } /* this last VLC is a special case for reading 12 more
- * bits from stream and adding the value 34 */
+static const uint8_t superblock_run_length_vlc_lens[34] = {
+ 1, 3, 3, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 6, /* This last value is a special case for reading 12 more
+ * bits from the stream and adding the value 34. */
};
static const uint16_t fragment_run_length_vlc_table[30][2] = {