summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-04 00:14:48 +0200
committerAnton Khirnov <anton@khirnov.net>2011-10-07 14:23:26 +0200
commit14c21c1ff509eac97f6437aeb51202b15af3a700 (patch)
tree6f6a9e92ff5b508b5bafd88163b4b928718e9fd9 /libavcodec/h264.c
parenta72cad0a6c05aa74940101e937cb3dc602d7d67b (diff)
downloadffmpeg-streaming-14c21c1ff509eac97f6437aeb51202b15af3a700.zip
ffmpeg-streaming-14c21c1ff509eac97f6437aeb51202b15af3a700.tar.gz
H264: Only wait before triggering ff_thread_setup_complete() until the next slice that contains a start-of-field/frame macroblock
This allows concurrent decoding of the last field/frame, rather than only the last slice, of data packets with multiple NAL units packed together. This will fix the slowdown reported in e.g. bug 52. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 3b550cf..83c26ef 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3633,9 +3633,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;
}
OpenPOWER on IntegriCloud