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.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libavcodec/h264.c') diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 27cbcd21aa..b8dfbf6874 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -285,7 +285,6 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) h->avctx = avctx; h->picture_structure = PICT_FRAME; - h->slice_context_count = 1; h->workaround_bugs = avctx->workaround_bugs; h->flags = avctx->flags; h->poc.prev_poc_msb = 1 << 16; @@ -300,7 +299,7 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; - h->nb_slice_ctx = (avctx->active_thread_type & FF_THREAD_SLICE) ? H264_MAX_THREADS : 1; + h->nb_slice_ctx = (avctx->active_thread_type & FF_THREAD_SLICE) ? avctx->thread_count : 1; h->slice_ctx = av_mallocz_array(h->nb_slice_ctx, sizeof(*h->slice_ctx)); if (!h->slice_ctx) { h->nb_slice_ctx = 0; @@ -809,7 +808,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) int nals_needed = 0; ///< number of NALs that need decoding before the next frame thread starts int i, ret = 0; - h->max_contexts = h->slice_context_count; + h->max_contexts = h->nb_slice_ctx; if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) { h->current_slice = 0; if (!h->first_field) -- cgit v1.2.3