[FFmpeg-devel] [PATCH v2 1/2] lavc/texturedsp: fix premult2straight inversion

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Feb 2 11:16:31 EET 2024


Niklas Haas:
> On Thu, 01 Feb 2024 17:10:50 -0800 Connor Worley <connorbworley at gmail.com> wrote:
>> +    src[0] = (uint8_t) FFMIN(r * 255 / a, 255);
>> +    src[1] = (uint8_t) FFMIN(g * 255 / a, 255);
>> +    src[2] = (uint8_t) FFMIN(b * 255 / a, 255);
> 
> av_clip_uint8?

That is for int values and therefore has to take care of negative values
as well. At least the C version is more complicated (i.e. the compiler
will have to work harder to optimize it to something like the above).

- Andreas




More information about the ffmpeg-devel mailing list