summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-16 14:56:13 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-08 17:51:47 +0100
commit90c4958640cb0a4eb495a16e01926d379c1ceaed (patch)
tree3d87bb98daa9ee59e2e237e2d5fbef69d9201a1b
parent0ecd6879b33d6af11c28ff2387c43d2e151e8831 (diff)
avcodec/mv30: Reduce the size of tables used to initialize VLCs
By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one can remove the array of codes of type uint16_t here; given that the symbols are the default ones (0,1,2,...), no explicit symbols table needs to be added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/mv30.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index a361873c80..2efc96bbf9 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -35,6 +35,8 @@
#include "internal.h"
#include "aandcttab.h"
+#define CBP_VLC_BITS 9
+
typedef struct MV30Context {
GetBitContext gb;
@@ -651,18 +653,14 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return avpkt->size;
}
-static const uint16_t cbp_codes[] = {
- 0, 1, 4, 5, 6, 0xE, 0x1E, 0x3E, 0x7E, 0xFE, 0x1FE, 0x1FF,
-};
-
static const uint8_t cbp_bits[] = {
2, 2, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9,
};
static av_cold void init_static_data(void)
{
- INIT_VLC_SPARSE_STATIC(&cbp_tab, 9, FF_ARRAY_ELEMS(cbp_bits),
- cbp_bits, 1, 1, cbp_codes, 2, 2, NULL, 0, 0, 512);
+ INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits),
+ cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS);
}
static av_cold int decode_init(AVCodecContext *avctx)