Nothing in this decoder would break if the generic code were to be changed to allow slice "threading" with only one thread.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -2240,7 +2240,6 @@ static void mpeg12_execute_slice_threads(AVCodecContext *avctx, · 2239 unmodified lines | |||
| 2240 | !avctx->hwaccel) { | 2240 | !avctx->hwaccel) { |
| 2241 | MpegEncContext *const s2 = &s->mpeg_enc_ctx; | 2241 | MpegEncContext *const s2 = &s->mpeg_enc_ctx; |
| 2242 | int error_count = 0; | 2242 | int error_count = 0; |
| 2243 | av_assert0(avctx->thread_count > 1); | ||
| 2244 | 2243 | ||
| 2245 | avctx->execute(avctx, slice_decode_thread, | 2244 | avctx->execute(avctx, slice_decode_thread, |
| 2246 | s2->thread_context, NULL, | 2245 | s2->thread_context, NULL, |
| @@ -2538,7 +2537,6 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, · 291 unmodified lines | |||
| 2538 | int threshold = (s2->mb_height * s->slice_count + | 2537 | int threshold = (s2->mb_height * s->slice_count + |
| 2539 | s2->slice_context_count / 2) / | 2538 | s2->slice_context_count / 2) / |
| 2540 | s2->slice_context_count; | 2539 | s2->slice_context_count; |
| 2541 | av_assert0(avctx->thread_count > 1); | ||
| 2542 | if (threshold <= mb_y) { | 2540 | if (threshold <= mb_y) { |
| 2543 | MpegEncContext *thread_context = s2->thread_context[s->slice_count]; | 2541 | MpegEncContext *thread_context = s2->thread_context[s->slice_count]; |
| 2544 | 2542 | ||