[FFmpeg-devel] [PATCH] libsvtav1: Enable 2-pass encoding

Fredrik Lundkvist fredrik.lundkvist at svt.se
Thu May 16 09:31:15 EEST 2024


> > + ret = av_reallocp(&param->rc_stats_buffer.buf, param->rc_stats_buffer.sz);

> Why realloc instead of malloc?

As far as I gathered, rc_stats_buffer.buf is already allocated by SVT-AV1; if malloc is preferred, I can change it and test to make sure it doesn’t cause any obvious issues.


> Wouldn't it be safer to free rc_stats_buffer.buf and set rc_stats_buffer.sz to 0 on failure here too?

Absolutely agree on setting rc_stats_buffer.sz to 0, not quite sure about freeing rc_stats_buffer_buf it is allocated by SVT-AV1.

Thank you for the review, the other comments will be fixed in V2.

/Fredrik


More information about the ffmpeg-devel mailing list