From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] libsvtav1: Enable 2-pass encoding
Date: Thu, 16 May 2024 12:13:55 +0200
Message-ID: <AS8P250MB0744735147CAB39EAA09E7E28FED2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <A5EE3EC8-63B1-4373-AB72-C808A3D67217@svt.se>
Fredrik Lundkvist via ffmpeg-devel:
>>> + ret = av_reallocp(¶m->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.
>
https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Source/API/EbSvtAv1Enc.h?ref_type=heads#L163
says that this pointer is a non-ownership pointer. Which would imply
that you can't realloc the initial pointer at all and have to simply
replace it with something of our own.
(That we would probably also need to free on our own.)
>
>> 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
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-05-16 10:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 6:31 Fredrik Lundkvist via ffmpeg-devel
2024-05-16 6:59 ` Fredrik Lundkvist via ffmpeg-devel
2024-05-16 10:13 ` Andreas Rheinhardt [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-05-15 14:14 Fredrik Lundkvist via ffmpeg-devel
2024-05-15 14:57 ` James Almer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB0744735147CAB39EAA09E7E28FED2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git