[FFmpeg-devel] [PATCH] h264: don't clobber mmco opcode tables for non-first slice headers.

Michael Niedermayer michaelni at gmx.at
Tue Jan 15 14:25:47 CET 2013


On Sun, Jan 13, 2013 at 09:46:44PM -0800, Ronald S. Bultje wrote:
> From: "Ronald S. Bultje" <rsbultje at gmail.com>
> 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.
> ---
>  libavcodec/h264.c      |  12 ++++-
>  libavcodec/h264.h      |   5 +-
>  libavcodec/h264_refs.c | 143 ++++++++++++++++++++++++++++++++++---------------
>  3 files changed, 114 insertions(+), 46 deletions(-)

This patch does not apply:

Applying: h264: don't clobber mmco opcode tables for non-first slice headers.
error: patch failed: libavcodec/h264_refs.c:476
error: libavcodec/h264_refs.c: patch does not apply
Patch failed at 0001 h264: don't clobber mmco opcode tables for non-first slice headers.
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index 3660597..e8b3e72 100644

The reason why it doesnt apply is that its based on libav and not

git show 3660597 | grep Libav | wc
      4      41     213
git show 3660597 | grep FFmpeg | wc
      0       0       0

Ill manually integrate and test it but please make sure you
test code on ffmpeg and submit code against ffmpeg.
Its alot of work to rebase and retest patches and it can lead to bugs
that themself need more work to debug and fix.



Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130115/ad714e5f/attachment.asc>

More information about the ffmpeg-devel mailing list