[FFmpeg-cvslog] H264: hotfix for speedloss on frame threading and h264 files with slices.

Michael Niedermayer git at videolan.org
Tue Oct 11 21:52:01 CEST 2011


ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Tue Oct  4 00:14:48 2011 +0200| [09a288476fecb855b77c2b13f939310467735af0] | committer: Michael Niedermayer

H264: hotfix for speedloss on frame threading and h264 files with slices.

This fix is not ideal as it still limits the multithreading on field pictures
to the 2nd field only.
Ill try to fix it properly to allow both fields to decode concurrently but this
needs more work.

This bug exists since and was caused by:
commit ea6331f8bbaf3343faec6ffe77a6218a016a3af5
Author: Ronald S. Bultje <rsbultje at gmail.com>
Date:   Mon Jun 20 10:24:33 2011 -0400

    h264-mt: fix deadlock in packets with multiple slices (e.g. MP4).
(cherry picked from commit eaa21b6870ba8bba4b0370e91f1941307c1c9681)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09a288476fecb855b77c2b13f939310467735af0
---

 libavcodec/h264.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index bab032b..f6e93bd 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3753,9 +3753,13 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
             switch (hx->nal_unit_type) {
                 case NAL_SPS:
                 case NAL_PPS:
+                    nals_needed = nal_index;
+                    break;
                 case NAL_IDR_SLICE:
                 case NAL_SLICE:
-                    nals_needed = nal_index;
+                    init_get_bits(&hx->s.gb, ptr, bit_length);
+                    if(!get_ue_golomb(&hx->s.gb))
+                        nals_needed = nal_index;
             }
             continue;
         }



More information about the ffmpeg-cvslog mailing list