diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 02:25:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 03:06:45 +0100 |
commit | 7d8f1158436c261d2d1657c33e731f9bec650c51 (patch) | |
tree | cf3c0261ba5202ad949af637a026b11dc4631a00 /libavcodec/h264.c | |
parent | 45552371e3434fb7aa4d0bc566fd4ef954f9af14 (diff) | |
parent | 881a5e047dc78ec9ab771817497dffec503d77ee (diff) | |
download | ffmpeg-7d8f1158436c261d2d1657c33e731f9bec650c51.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
mpegenc: use avctx->slices as number of slices
v410enc: fix undefined signed left shift caused by integer promotion
Release notes: mention cleaned up header includes
fix Changelog file
Fix a bunch of typos.
Drop some pointless void* return value casts from av_malloc() invocations.
wavpack: fix typos in previous cosmetic clean-up commit
wavpack: cosmetics: K&R pretty-printing
avconv: remove the 'codec framerate is different from stream' warning
wavpack: determine sample_fmt before requesting a buffer
bmv audio: implement new audio decoding API
mpegaudiodec: skip all channels when skipping granules
mpegenc: simplify muxrate calculation
Conflicts:
Changelog
avconv.c
doc/RELEASE_NOTES
libavcodec/h264.c
libavcodec/mpeg12.c
libavcodec/mpegaudiodec.c
libavcodec/mpegvideo.c
libavformat/mpegenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a9f15f44d9..8a79311f7c 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1315,7 +1315,6 @@ int ff_h264_frame_start(H264Context *h){ MpegEncContext * const s = &h->s; int i; const int pixel_shift = h->pixel_shift; - int thread_count = (s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1; if(MPV_frame_start(s, s->avctx) < 0) return -1; @@ -1345,7 +1344,7 @@ int ff_h264_frame_start(H264Context *h){ /* can't be in alloc_tables because linesize isn't known there. * FIXME: redo bipred weight to not require extra buffer? */ - for(i = 0; i < thread_count; i++) + for(i = 0; i < s->slice_context_count; i++) if(h->thread_context[i] && !h->thread_context[i]->s.obmc_scratchpad) h->thread_context[i]->s.obmc_scratchpad = av_malloc(16*6*s->linesize); @@ -2852,7 +2851,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ return -1; } } else { - for(i = 1; i < s->avctx->thread_count; i++) { + for(i = 1; i < s->slice_context_count; i++) { H264Context *c; c = h->thread_context[i] = av_malloc(sizeof(H264Context)); memcpy(c, h->s.thread_context[i], sizeof(MpegEncContext)); @@ -2866,7 +2865,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ clone_tables(c, h, i); } - for(i = 0; i < s->avctx->thread_count; i++) + for(i = 0; i < s->slice_context_count; i++) if (context_init(h->thread_context[i]) < 0) { av_log(h->s.avctx, AV_LOG_ERROR, "context_init() failed.\n"); return -1; @@ -3782,7 +3781,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ h->nal_unit_type= 0; - h->max_contexts = (HAVE_THREADS && (s->avctx->active_thread_type&FF_THREAD_SLICE)) ? avctx->thread_count : 1; + if(!s->slice_context_count) + s->slice_context_count= 1; + h->max_contexts = s->slice_context_count; + if(!(s->flags2 & CODEC_FLAG2_CHUNKS)){ h->current_slice = 0; if (!s->first_field) |