[FFmpeg-devel] [PATCH] avcodec.h: document padding requirements for get_buffer() callback.
Lynne
dev at lynne.ee
Fri Jan 3 00:50:22 EET 2025
On 03/01/2025 07:47, James Almer wrote:
> On 1/2/2025 7:39 PM, Ronald S. Bultje wrote:
>> ---
>> libavcodec/avcodec.h | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 12e6e8749f..7ecb819dae 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -1199,7 +1199,8 @@ typedef struct AVCodecContext {
>> * some other means.
>> *
>> * Each data plane must be aligned to the maximum required by
>> the target
>> - * CPU.
>> + * CPU. In addition, each data plane must be padded by that same
>> amount
>> + * plus 15 bytes.
>
> IMO, remove the 15 bytes part. Even if the default allocator adds those,
> asking for max_cpu_align padding bytes should be more than enough.
>
> And for that matter, see fuzz_video_get_buffer() in tools/
> target_dec_fuzzer.c, where no such thing is done precisely to simulate
> what a user reading this doxy might do with their own custom callback.
> This padding should in theory not be a requirement when
> avcodec_align_dimensions2() is documented as handling this stuff.
>
> Maybe avcodec_align_dimensions2() should be updated for VP9 to
> overallocate? I see it does for h264, vp6 and many other codecs where
> the native decoder overreads for different reasons.
Yeah, avcodec_align_dimensions2() should be used to control padding.
Users are supposed to call it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250103/4fe25977/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250103/4fe25977/attachment.sig>
More information about the ffmpeg-devel
mailing list