Commit 14c21c1f authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Anton Khirnov

H264: Only wait before triggering ff_thread_setup_complete() until the next...

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: 's avatarAnton Khirnov <anton@khirnov.net>
parent a72cad0a
...@@ -3633,8 +3633,12 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ ...@@ -3633,8 +3633,12 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
switch (hx->nal_unit_type) { switch (hx->nal_unit_type) {
case NAL_SPS: case NAL_SPS:
case NAL_PPS: case NAL_PPS:
nals_needed = nal_index;
break;
case NAL_IDR_SLICE: case NAL_IDR_SLICE:
case NAL_SLICE: case NAL_SLICE:
init_get_bits(&hx->s.gb, ptr, bit_length);
if (!get_ue_golomb(&hx->s.gb))
nals_needed = nal_index; nals_needed = nal_index;
} }
continue; continue;
......
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