diff options
author | Ben Jackson <ben@ben.com> | 2012-09-15 10:32:40 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-15 20:26:29 +0200 |
commit | 6e86d6af6bd914fb076d1263cbb240c888a1284e (patch) | |
tree | a9ea6e681687c5767eef8c732feb77579eebfd9a /libavcodec | |
parent | 23503cadd15929aeea4a4fc8dde8aad54ecf6846 (diff) | |
download | ffmpeg-6e86d6af6bd914fb076d1263cbb240c888a1284e.tar.gz |
lavc/vp6: Refactor vp6_decode_init into vp6_decode_init/vp6_decode_init_context
Pave the way for per-thread context initialization.
Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp6.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 2002a1e805..a895386085 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -590,12 +590,20 @@ static void vp6_filter(VP56Context *s, uint8_t *dst, uint8_t *src, } } +static av_cold void vp6_decode_init_context(VP56Context *s); + static av_cold int vp6_decode_init(AVCodecContext *avctx) { VP56Context *s = avctx->priv_data; ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6, avctx->codec->id == AV_CODEC_ID_VP6A); + vp6_decode_init_context(s); + return 0; +} + +static av_cold void vp6_decode_init_context(VP56Context *s) +{ s->deblock_filtering = 0; s->vp56_coord_div = vp6_coord_div; s->parse_vector_adjustment = vp6_parse_vector_adjustment; @@ -604,16 +612,22 @@ static av_cold int vp6_decode_init(AVCodecContext *avctx) s->parse_vector_models = vp6_parse_vector_models; s->parse_coeff_models = vp6_parse_coeff_models; s->parse_header = vp6_parse_header; - - return 0; } +static av_cold void vp6_decode_free_context(VP56Context *s); + static av_cold int vp6_decode_free(AVCodecContext *avctx) { VP56Context *s = avctx->priv_data; - int pt, ct, cg; ff_vp56_free(avctx); + vp6_decode_free_context(s); + return 0; +} + +static av_cold void vp6_decode_free_context(VP56Context *s) +{ + int pt, ct, cg; for (pt=0; pt<2; pt++) { ff_free_vlc(&s->dccv_vlc[pt]); @@ -622,7 +636,6 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx) for (cg=0; cg<6; cg++) ff_free_vlc(&s->ract_vlc[pt][ct][cg]); } - return 0; } AVCodec ff_vp6_decoder = { |