aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-15 22:13:46 +0100
committerAnton Khirnov <anton@khirnov.net>2013-11-27 09:51:42 +0100
commitbd405475ceb38c01088cc9cf1838b23bdd8f685f (patch)
treefbc4595cf028d60c9f1fb53a3ab26c0f17031ede
parent56eded8bc7bccdf14245bae3a45b0fecf9d9d122 (diff)
downloadffmpeg-bd405475ceb38c01088cc9cf1838b23bdd8f685f.tar.gz
mpeg4video_parser: init mpeg4 static tables.
They are used when decoding the frame header. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/mpeg4video.h1
-rw-r--r--libavcodec/mpeg4video_parser.c2
-rw-r--r--libavcodec/mpeg4videodec.c4
3 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index 64c0243785..0dec893371 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -110,6 +110,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
extern uint8_t ff_mpeg4_static_rl_table_store[3][2][2*MAX_RUN + MAX_LEVEL + 3];
+void ff_mpeg4_init_tables(void);
#if 0 //3IV1 is quite rare and it slows things down a tiny bit
#define IS_3IV1 s->codec_tag == AV_RL32("3IV1")
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index e291262d94..6587d7fe52 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -100,6 +100,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 443326c401..3e8c8f79b4 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -45,7 +45,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) {
@@ -2230,7 +2230,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=