aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorClément Bœsch <clement@stupeflix.com>2016-06-21 10:19:13 +0200
committerClément Bœsch <clement@stupeflix.com>2016-06-21 10:24:31 +0200
commit04aefe205b285a07646c99a834dcea04cd8a0110 (patch)
tree103065a3a63d6d79b63dee300919aca52d9f9f46 /libavcodec/h264.c
parent26cfafa52dfb2f3d6236799094d1bc3d30defadd (diff)
parente0652795292223f8bc8e5bac019c1fca7323d23c (diff)
downloadffmpeg-04aefe205b285a07646c99a834dcea04cd8a0110.tar.gz
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 <clement@stupeflix.com>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 9d2cabaa04..9292168da3 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -312,7 +312,6 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h)
h->cur_chroma_format_idc = -1;
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;
@@ -330,7 +329,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;
@@ -883,9 +882,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
h->nal_unit_type= 0;
- if(!h->slice_context_count)
- h->slice_context_count= 1;
- 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)