[FFmpeg-cvslog] mpeg4video_parser: init mpeg4 static tables.

Anton Khirnov git at videolan.org
Sat Dec 21 02:49:09 CET 2013


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Fri Nov 15 22:13:46 2013 +0100| [bd405475ceb38c01088cc9cf1838b23bdd8f685f] | committer: Anton Khirnov

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 at libav.org

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd405475ceb38c01088cc9cf1838b23bdd8f685f
---

 libavcodec/mpeg4video.h        |    1 +
 libavcodec/mpeg4video_parser.c |    2 ++
 libavcodec/mpeg4videodec.c     |    4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index 64c0243..0dec893 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 e291262..6587d7f 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 443326c..3e8c8f7 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=



More information about the ffmpeg-cvslog mailing list