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

Reynaldo H. Verdejo Pinochet reynaldo at osg.samsung.com
Wed Oct 8 18:18:09 CEST 2014


Hello, thanks for your patch. Comments bellow:

On 10/09/2014 04:41 PM, di1028.wu at samsung.com wrote:
> 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.

Can you try rephrasing the above log to a shorter version? Not rly
a blocker but both paragraphs seem a bit redundant. Also, add an
space after vp9: in the summary please.

> 
> 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

^ this is not correct. Please don't submit mode changes
to source files unless it's actually needed. This is not
the case.

> 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);
> +    }

Surrounding code does not use braces for single statement if()s,
please drop them.

CCing Clement so he can comment on the validity of the change otherwise.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley


More information about the ffmpeg-devel mailing list