Commit 46d208e1 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Martin Storsjö
Browse files

vp8: Wait for prev_frame to parse segment_map before reading it



This fixes occasional failures of vp8-test-vector-010 with frame-level
multithreading enabled.
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 6c86a63b
...@@ -1679,6 +1679,11 @@ static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata, ...@@ -1679,6 +1679,11 @@ static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
if (s->mb_layout == 1) if (s->mb_layout == 1)
mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1); mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
else { else {
// Make sure the previous frame has read its segmentation map,
// if we re-use the same map.
if (prev_frame && s->segmentation.enabled &&
!s->segmentation.update_map)
ff_thread_await_progress(&prev_frame->tf, mb_y, 0);
mb = s->macroblocks + (s->mb_height - mb_y - 1)*2; mb = s->macroblocks + (s->mb_height - mb_y - 1)*2;
memset(mb - 1, 0, sizeof(*mb)); // zero left macroblock memset(mb - 1, 0, sizeof(*mb)); // zero left macroblock
AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101); AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101);
...@@ -1960,13 +1965,14 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -1960,13 +1965,14 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
memset(s->ref_count, 0, sizeof(s->ref_count)); memset(s->ref_count, 0, sizeof(s->ref_count));
// Make sure the previous frame has read its segmentation map, if (s->mb_layout == 1) {
// if we re-use the same map. // Make sure the previous frame has read its segmentation map,
if (prev_frame && s->segmentation.enabled && !s->segmentation.update_map) // if we re-use the same map.
ff_thread_await_progress(&prev_frame->tf, 1, 0); if (prev_frame && s->segmentation.enabled &&
!s->segmentation.update_map)
if (s->mb_layout == 1) ff_thread_await_progress(&prev_frame->tf, 1, 0);
vp8_decode_mv_mb_modes(avctx, curframe, prev_frame); vp8_decode_mv_mb_modes(avctx, curframe, prev_frame);
}
if (avctx->active_thread_type == FF_THREAD_FRAME) if (avctx->active_thread_type == FF_THREAD_FRAME)
num_jobs = 1; num_jobs = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment