[vlc-devel] [PATCH] avcodec: reduce the amount of extra decoding buffers when using multithread

Steve Lhomme robux4 at gmail.com
Mon Feb 1 10:13:37 CET 2016


On Sat, Jan 30, 2016 at 3:50 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 2016-01-30 10:26, Steve Lhomme a écrit :
>>
>> From: Steve Lhomme <robUx4 at gmail.com>
>>
>> ---
>>  modules/codec/avcodec/video.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
>> index 6b23375..8980241 100644
>> --- a/modules/codec/avcodec/video.c
>> +++ b/modules/codec/avcodec/video.c
>> @@ -451,7 +451,7 @@ int InitVideoDec( decoder_t *p_dec,
>> AVCodecContext *p_context,
>>      }
>>
>>      if( p_context->thread_type & FF_THREAD_FRAME )
>> -        p_dec->i_extra_picture_buffers = 2 * p_context->thread_count;
>> +        p_dec->i_extra_picture_buffers = p_context->thread_count - 1;
>
>
> You can't be serious.

This value is used here:

        p_vout = input_resource_RequestVout( p_owner->p_resource,
                                             p_vout, &fmt,
                                             dpb_size +
                                             p_dec->i_extra_picture_buffers + 1,
                                             true );

The -1 is because of the +1. I don't see why we need 2 extra buffer
per decoding thread in addition to the dpb_size.

>>  #endif
>>
>>      /* ***** misc init ***** */
>
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/


More information about the vlc-devel mailing list