Commit 783150b6 authored by benoit's avatar benoit

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]


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10431 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0206d785
...@@ -3815,6 +3815,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ ...@@ -3815,6 +3815,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
} }
if(h->deblocking_filter == 1 && h0->max_contexts > 1) { 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; h0->max_contexts = 1;
if(!h0->single_decode_warning) { if(!h0->single_decode_warning) {
av_log(s->avctx, AV_LOG_INFO, "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n"); 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){ ...@@ -3822,6 +3827,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
} }
if(h != h0) if(h != h0)
return 1; // deblocking switched inside frame return 1; // deblocking switched inside frame
}
} }
if( s->avctx->skip_loop_filter >= AVDISCARD_ALL if( s->avctx->skip_loop_filter >= AVDISCARD_ALL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment