[FFmpeg-devel] [PATCHv4] avcodec: Add librav1e encoder

Nicolas George george at nsup.org
Sat Jul 13 21:43:04 EEST 2019


James Almer (12019-07-13):
> > +        uint8_t *tmp = av_fast_realloc(ctx->pass_data, &ctx->pass_size,
> > +                                      ctx->pass_pos + buf_size);
> Just use av_reallocp(). Each call will make the buffer bigger, so you're
> not really making use the no-op benefits from av_fast_realloc(), which
> only trigger if newsize <= size.

av_fast_realloc() also allocates 17/16 of the requested memory, which
makes the incremental building of a buffer linear instead of quadratic.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190713/5e16a709/attachment.sig>


More information about the ffmpeg-devel mailing list