changeset 5646:adc9ec0f7385 libavcodec

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]
author benoit
date Fri, 07 Sep 2007 18:27:13 +0000
parents abf90ea2c392
children 7c139ea9065e
files h264.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Thu Sep 06 14:55:13 2007 +0000
+++ b/h264.c	Fri Sep 07 18:27:13 2007 +0000
@@ -3815,6 +3815,11 @@
     }
 
     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 @@
         }
         if(h != h0)
             return 1; // deblocking switched inside frame
+        }
     }
 
     if(   s->avctx->skip_loop_filter >= AVDISCARD_ALL