diff options
author | Andreas Öman <andreas@olebyn.nu> | 2007-09-07 18:27:13 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-09-07 18:27:13 +0000 |
commit | ec970c2187453ddcc5b5440dc11d12f975a489e2 (patch) | |
tree | 5a1b8461a35fc16eb3a9c4da09a299f85196a850 | |
parent | 7a297ceb8f44035a6c072feec756791aab529968 (diff) | |
download | ffmpeg-ec970c2187453ddcc5b5440dc11d12f975a489e2.tar.gz |
Let H.264 decoder skip deblocking across slices
if running with multiple threads and CODEC_FLAGS2_FAST is set.
Thus, it may decode the slices in parallel to gain speed.
Patch by Andreas Öman: [andreas olebyn nu]
Originally committed as revision 10431 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 49eaa378c1..c2d5d990ca 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3815,6 +3815,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ } if(h->deblocking_filter == 1 && h0->max_contexts > 1) { + if(s->avctx->flags2 & CODEC_FLAG2_FAST) { + /* Cheat slightly for speed: + Dont bother to deblock across slices */ + h->deblocking_filter = 2; + } else { h0->max_contexts = 1; if(!h0->single_decode_warning) { av_log(s->avctx, AV_LOG_INFO, "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n"); @@ -3822,6 +3827,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ } if(h != h0) return 1; // deblocking switched inside frame + } } if( s->avctx->skip_loop_filter >= AVDISCARD_ALL |