aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg4videodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-13 19:20:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-13 19:20:59 +0100
commit1bd024ec770e7639a0c7a545257b8b34bfa6aa85 (patch)
treea2afbbd56912fa41aea659109d89ef7488794c32 /libavcodec/mpeg4videodec.c
parentc74cd99986fc8c148a10ebcf13ab2b8d8c6de561 (diff)
downloadandroid_external_ffmpeg-1bd024ec770e7639a0c7a545257b8b34bfa6aa85.tar.gz
android_external_ffmpeg-1bd024ec770e7639a0c7a545257b8b34bfa6aa85.tar.bz2
android_external_ffmpeg-1bd024ec770e7639a0c7a545257b8b34bfa6aa85.zip
mpeg4videodec: split static decoder table init out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg4videodec.c')
-rw-r--r--libavcodec/mpeg4videodec.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index a60d03dcae..b78f735a77 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2255,23 +2255,10 @@ end:
return decode_vop_header(s, gb);
}
-static av_cold int decode_init(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
- int ret;
+av_cold int ff_mpeg4videodec_static_init(void) {
static int done = 0;
- s->divx_version=
- s->divx_build=
- s->xvid_build=
- s->lavc_build= -1;
-
- if((ret=ff_h263_decode_init(avctx)) < 0)
- return ret;
-
if (!done) {
- done = 1;
-
ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
@@ -2290,7 +2277,24 @@ static av_cold int decode_init(AVCodecContext *avctx)
INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
&ff_mb_type_b_tab[0][1], 2, 1,
&ff_mb_type_b_tab[0][0], 2, 1, 16);
+ done = 1;
}
+}
+
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+ MpegEncContext *s = avctx->priv_data;
+ int ret;
+
+ s->divx_version=
+ s->divx_build=
+ s->xvid_build=
+ s->lavc_build= -1;
+
+ if((ret=ff_h263_decode_init(avctx)) < 0)
+ return ret;
+
+ ff_mpeg4videodec_static_init();
s->h263_pred = 1;
s->low_delay = 0; //default, might be overridden in the vol header during header parsing