diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-01-13 21:46:44 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-15 13:58:22 +0100 |
commit | f6badba1859fb266a9c0bdaf006a04c73873cd90 (patch) | |
tree | 652a134162a7ba0677c2d8f947a43b2d2960a60b /libavcodec/h264.h | |
parent | 8ac8f04993e5ff53a9c799d72c3085c77c228134 (diff) | |
download | ffmpeg-f6badba1859fb266a9c0bdaf006a04c73873cd90.tar.gz |
h264: don't clobber mmco opcode tables for non-first slice headers.
Clobbering these tables will temporarily clobber the template used
as a basis for other threads to start decoding from. If the other
decoding thread updates from the template right at that moment,
subsequent threads will get invalid (or, usually, none at all) mmco
tables. This leads to invalid reference lists and subsequent decode
failures.
Therefore, instead, decode the mmco tables only for the first slice in
a field or frame. For other slices, decode the bits and ensure they
are identical to the mmco tables in the first slice, but don't ever
clobber the context state. This prevents other threads from using a
clobbered/invalid template as starting point for decoding, and thus
fixes decoding in these cases.
This fixes occasional (~1%) failures of h264-conformance-mr1_bt_a with
frame-multithreading enabled.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r-- | libavcodec/h264.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 3355d05e97..b435180666 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -669,9 +669,10 @@ void ff_h264_remove_all_refs(H264Context *h); */ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count); -int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb); +int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, + int first_slice); -void ff_generate_sliding_window_mmcos(H264Context *h); +void ff_generate_sliding_window_mmcos(H264Context *h, int first_slice); /** * Check if the top & left blocks are available if needed & change the |