From 92c6c2a605f9b077b8fbc25b7ed6625541232b87 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 17 Jan 2015 18:45:29 +0100 Subject: h264: split weighted pred-related vars into per-slice context --- libavcodec/h264_parser.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavcodec/h264_parser.c') diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 21e320d752..672411e7b8 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -102,6 +102,7 @@ static int scan_mmco_reset(AVCodecParserContext *s) { H264ParseContext *p = s->priv_data; H264Context *h = &p->h; + H264SliceContext *sl = &h->slice_ctx[0]; h->slice_type_nos = s->pict_type & 3; @@ -141,7 +142,7 @@ static int scan_mmco_reset(AVCodecParserContext *s) if ((h->pps.weighted_pred && h->slice_type_nos == AV_PICTURE_TYPE_P) || (h->pps.weighted_bipred_idc == 1 && h->slice_type_nos == AV_PICTURE_TYPE_B)) - ff_pred_weight_table(h); + ff_pred_weight_table(h, sl); if (get_bits1(&h->gb)) { // adaptive_ref_pic_marking_mode_flag int i; @@ -543,6 +544,12 @@ static av_cold int init(AVCodecParserContext *s) { H264ParseContext *p = s->priv_data; H264Context *h = &p->h; + + h->slice_ctx = av_mallocz(sizeof(*h->slice_ctx)); + if (!h->slice_ctx) + return 0; + h->nb_slice_ctx = 1; + h->thread_context[0] = h; h->slice_context_count = 1; ff_h264dsp_init(&h->h264dsp, 8, 1); -- cgit v1.2.3