diff options
author | Clément Bœsch <[email protected]> | 2016-06-21 10:19:13 +0200 |
---|---|---|
committer | Clément Bœsch <[email protected]> | 2016-06-21 10:24:31 +0200 |
commit | 04aefe205b285a07646c99a834dcea04cd8a0110 (patch) | |
tree | 103065a3a63d6d79b63dee300919aca52d9f9f46 /libavcodec/h264_slice.c | |
parent | 26cfafa52dfb2f3d6236799094d1bc3d30defadd (diff) | |
parent | e0652795292223f8bc8e5bac019c1fca7323d23c (diff) |
Merge commit 'e0652795292223f8bc8e5bac019c1fca7323d23c'
* commit 'e0652795292223f8bc8e5bac019c1fca7323d23c':
h264: remove an artificial restriction on the number of slice threads
Tested with multiple runs of fate-h264 THREADS=50 THREAD_TYPE=slice
Merged-by: Clément Bœsch <[email protected]>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r-- | libavcodec/h264_slice.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index ccc7e65d66..6e7b940f2a 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -917,9 +917,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); @@ -981,19 +978,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; - h->max_contexts = FFMIN(h->max_contexts, 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) { @@ -1001,7 +985,7 @@ static int h264_slice_header_init(H264Context *h) goto fail; } } 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; |