[FFmpeg-devel] [PATCH] vp9:enable multi-thread decoding when refreshctx is equal to 0

di1028.wu at samsung.com di1028.wu at samsung.com
Thu Oct 9 21:41:07 CEST 2014


From: Di Wu <di1028.wu at samsung.com>

Multi-thread decoding doesn't work when refreshctx is equal to 0. Fix
it by call ff_thread_finish_setup function in the condition when
refreshctx is equal to 0.

In vp9_decode_frame function, ff_thread_finish_setup is not called
when refreshctx is equal to 0. The next decoding thread can not
start work until the cunrrent frame has been decoded completely. So
multi-thread decoding in frame level is not enabled when  refreshctx
is equal to 0.

Signed-off-by: Di Wu <di1028.wu at samsung.com>
---
 libavcodec/vp9.c |    3 +++
 1 file changed, 3 insertions(+)
 mode change 100644 => 100755 libavcodec/vp9.c

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
old mode 100644
new mode 100755
index 31725e6..364b36a
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3799,6 +3799,9 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
                "Failed to allocate block buffers\n");
         return res;
     }
+    if (!s->refreshctx){
+        ff_thread_finish_setup(ctx);
+    }
     if (s->refreshctx && s->parallelmode) {
         int j, k, l, m;
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list