diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-04-13 17:28:26 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-04-24 10:06:25 +0200 |
commit | e0652795292223f8bc8e5bac019c1fca7323d23c (patch) | |
tree | 541a7062d985aa0ed10c59fbae986e2bb8a1609a /libavcodec/h264.c | |
parent | 4fd34e639d15b44e02686c9b4ef58c9c3c9b0a69 (diff) | |
download | ffmpeg-e0652795292223f8bc8e5bac019c1fca7323d23c.tar.gz |
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.
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 5 |
1 files changed, 2 insertions, 3 deletions
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) |