[FFmpeg-devel] [PATCH] swscale: use 16-bit intermediate precision for RGB/XYZ conversion

Leo Izen leo.izen at gmail.com
Sun Dec 22 12:50:56 EET 2024


On 12/21/24 4:50 AM, Niklas Haas wrote:
> On Mon, 16 Dec 2024 14:56:07 +0100 Niklas Haas <ffmpeg at haasn.xyz> wrote:
>> From: Niklas Haas <git at haasn.dev>
>>
>> The current logic uses 12-bit linear light math, which is woefully insufficient
>> and leads to nasty postarization artifacts. This patch simply switches the
>> internal logic to 16-bit precision.
>>
>> This raises the memory requirement of these tables from 32 kB to 272 kB.
> 
> Will merge this one (with the FATE changes) in a few days if there are no
> further objections.
> 
> Should we try and lazily allocate these tables to save the ~272 kB of static
> memory or is that considered an insignificant amount?
> 

What if we lazily allocate them only if CONFIG_SMALL? Considering we 
have NULL_IF_CONFIG_SMALL() on several-byte text strings I can see us 
caring in that scenario.

- Leo Izen (Traneptora)



More information about the ffmpeg-devel mailing list