mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
23503cadd1
commit
6e86d6af6b
@ -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)
|
static av_cold int vp6_decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
VP56Context *s = avctx->priv_data;
|
VP56Context *s = avctx->priv_data;
|
||||||
|
|
||||||
ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6,
|
ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6,
|
||||||
avctx->codec->id == AV_CODEC_ID_VP6A);
|
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->deblock_filtering = 0;
|
||||||
s->vp56_coord_div = vp6_coord_div;
|
s->vp56_coord_div = vp6_coord_div;
|
||||||
s->parse_vector_adjustment = vp6_parse_vector_adjustment;
|
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_vector_models = vp6_parse_vector_models;
|
||||||
s->parse_coeff_models = vp6_parse_coeff_models;
|
s->parse_coeff_models = vp6_parse_coeff_models;
|
||||||
s->parse_header = vp6_parse_header;
|
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)
|
static av_cold int vp6_decode_free(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
VP56Context *s = avctx->priv_data;
|
VP56Context *s = avctx->priv_data;
|
||||||
int pt, ct, cg;
|
|
||||||
|
|
||||||
ff_vp56_free(avctx);
|
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++) {
|
for (pt=0; pt<2; pt++) {
|
||||||
ff_free_vlc(&s->dccv_vlc[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++)
|
for (cg=0; cg<6; cg++)
|
||||||
ff_free_vlc(&s->ract_vlc[pt][ct][cg]);
|
ff_free_vlc(&s->ract_vlc[pt][ct][cg]);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AVCodec ff_vp6_decoder = {
|
AVCodec ff_vp6_decoder = {
|
||||||
|
Loading…
Reference in New Issue
Block a user