aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorAndreas Öman <andreas@olebyn.nu>2007-09-16 10:37:07 +0000
committerGuillaume Poirier <gpoirier@mplayerhq.hu>2007-09-16 10:37:07 +0000
commit50c21814b9de5635cf01e2d1ea091a9a272a4d67 (patch)
tree7622d9781329df07870fde6a07107224fab66597 /libavcodec/h264.c
parent87657757245d380dfb4fd41cbc260f478853a0c4 (diff)
downloadffmpeg-50c21814b9de5635cf01e2d1ea091a9a272a4d67.tar.gz
fix image corruption when with multi-threaded decoding.
dequant-tables were not correctly reinitialized in the slave contexts when a PPS came with updated matrices. Patch by Andreas Öman %andreas A olebyn P nu% Original thread: date: Sep 16, 2007 6:14 AM subject: [FFmpeg-devel] Parallelized h264 image corruption bug Originally committed as revision 10505 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c8
1 files 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);
}