They are used when decoding the frame header.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:[email protected]
---
libavcodec/mpeg4video.h | 2 ++
libavcodec/mpeg4video_parser.c | 2 ++
libavcodec/mpeg4videodec.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index c22fbfd..d7157d3 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -112,6 +112,8 @@ void ff_mpeg4_init_direct_mv(MpegEncContext *s);
*/
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
+void ff_mpeg4_init_tables(void);
+
extern uint8_t ff_mpeg4_static_rl_table_store[3][2][2 * MAX_RUN + MAX_LEVEL +
3];
#if 0 //3IV1 is quite rare and it slows things down a tiny bit
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index a8def0e..dfddeda 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -105,6 +105,8 @@ static av_cold int
mpeg4video_parse_init(AVCodecParserContext *s)
{
struct Mp4vParseContext *pc = s->priv_data;
+ ff_mpeg4_init_tables();
+
pc->first_picture = 1;
pc->enc.slice_context_count = 1;
return 0;
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index b36c572..dd8f565 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -47,7 +47,7 @@ static const int mb_type_b_map[4]= {
MB_TYPE_L0 | MB_TYPE_16x16,
};
-static void init_tables(void)
+void ff_mpeg4_init_tables(void)
{
static int done = 0;
if (!done) {
@@ -2224,7 +2224,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
MpegEncContext *s = avctx->priv_data;
int ret;
- init_tables();
+ ff_mpeg4_init_tables();
s->divx_version=
s->divx_build=
--
1.7.10.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel