From e0652795292223f8bc8e5bac019c1fca7323d23c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 13 Apr 2016 17:28:26 +0200 Subject: h264: remove an artificial restriction on the number of slice threads This limit is now unnecessary, we can easily support an arbitrary number of threads. --- libavcodec/h264_slice.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'libavcodec/h264_slice.c') diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 4c52effc06..e0e3577223 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -829,9 +829,6 @@ static int init_dimensions(H264Context *h) static int h264_slice_header_init(H264Context *h) { const SPS *sps = h->ps.sps; - int nb_slices = (HAVE_THREADS && - h->avctx->active_thread_type & FF_THREAD_SLICE) ? - h->avctx->thread_count : 1; int i, ret; ff_set_sar(h->avctx, sps->sar); @@ -877,18 +874,6 @@ static int h264_slice_header_init(H264Context *h) sps->chroma_format_idc); ff_videodsp_init(&h->vdsp, sps->bit_depth_luma); - if (nb_slices > H264_MAX_THREADS || (nb_slices > h->mb_height && h->mb_height)) { - int max_slices; - if (h->mb_height) - max_slices = FFMIN(H264_MAX_THREADS, h->mb_height); - else - max_slices = H264_MAX_THREADS; - av_log(h->avctx, AV_LOG_WARNING, "too many threads/slices %d," - " reducing to %d\n", nb_slices, max_slices); - nb_slices = max_slices; - } - h->slice_context_count = nb_slices; - if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) { ret = ff_h264_slice_context_init(h, &h->slice_ctx[0]); if (ret < 0) { @@ -896,7 +881,7 @@ static int h264_slice_header_init(H264Context *h) return ret; } } else { - for (i = 0; i < h->slice_context_count; i++) { + for (i = 0; i < h->nb_slice_ctx; i++) { H264SliceContext *sl = &h->slice_ctx[i]; sl->h264 = h; -- cgit v1.2.3