From 50c21814b9de5635cf01e2d1ea091a9a272a4d67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20=C3=96man?= Date: Sun, 16 Sep 2007 10:37:07 +0000 Subject: [PATCH] =?utf8?q?fix=20image=20corruption=20when=20with=20multi-t?= =?utf8?q?hreaded=20decoding.=20dequant-tables=20were=20not=20correctly=20?= =?utf8?q?reinitialized=20in=20the=20slave=20contexts=20when=20a=20PPS=20c?= =?utf8?q?ame=20with=20updated=20matrices.=20Patch=20by=20Andreas=20=C3=96?= =?utf8?q?man=20%andreas=20A=20olebyn=20P=20nu%=20Original=20thread:=20dat?= =?utf8?q?e:=20Sep=2016,=202007=206:14=20AM=20subject:=20[FFmpeg-devel]=20?= =?utf8?q?Parallelized=20h264=20image=20corruption=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Originally committed as revision 10505 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 60653d55bd..26a6d407d0 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2164,11 +2164,8 @@ static void clone_tables(H264Context *dst, H264Context *src){ dst->mvd_table[1] = src->mvd_table[1]; dst->direct_table = src->direct_table; - if(!dst->dequant4_coeff[0]) - init_dequant_tables(dst); dst->s.obmc_scratchpad = NULL; ff_h264_pred_init(&dst->hpc, src->s.codec_id); - dst->dequant_coeff_pps= -1; } /** @@ -3522,6 +3519,9 @@ static void clone_slice(H264Context *dst, H264Context *src) memcpy(dst->long_ref, src->long_ref, sizeof(dst->long_ref)); memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list)); memcpy(dst->ref_list, src->ref_list, sizeof(dst->ref_list)); + + memcpy(dst->dequant4_coeff, src->dequant4_coeff, sizeof(src->dequant4_coeff)); + memcpy(dst->dequant8_coeff, src->dequant8_coeff, sizeof(src->dequant8_coeff)); } /** @@ -3589,7 +3589,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ } h->sps = *h0->sps_buffers[h->pps.sps_id]; - if(h->dequant_coeff_pps != pps_id){ + if(h == h0 && h->dequant_coeff_pps != pps_id){ h->dequant_coeff_pps = pps_id; init_dequant_tables(h); } -- 2.11.0