diff options
author | Niklas Haas <git@haasn.dev> | 2024-11-29 15:05:26 +0100 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2024-12-23 12:33:43 +0100 |
commit | dddf536d3d575a8f7cf7eb85bdd2b2d20fc36369 (patch) | |
tree | f2244f22f4c109015819b146e18d892430341823 /libswscale/graph.c | |
parent | 2e674780b7402d8b75dc222340fd51511f7856aa (diff) | |
download | ffmpeg-dddf536d3d575a8f7cf7eb85bdd2b2d20fc36369.tar.gz |
swscale/cms: add color management subsystem
The underlying color mapping logic was ported as straightforwardly as possible
from libplacebo, although the API and glue code has been very heavily
refactored / rewritten. In particular, the generalization of gamut mapping
methods is replaced by a single ICC intent selection, and constants have been
hard-coded.
To minimize the amount of overall operations, this gamut mapping LUT now embeds
a direct end-to-end transformation to the output color space; something that
libplacebo does in shaders, but which is prohibitively expensive in software.
In order to preserve compatibility with dynamic tone mapping without severely
regressing performance, we add the ability to generate a pair of "split" LUTS,
one for encoding the input and output to the perceptual color space, and a
third to embed the tone mapping operation. Additionally, this intermediate
space could be used for additional subjective effect (e.g. changing
saturation or brightness).
The big downside of the new approach is that generating a static color mapping
LUT is now fairly slow, as the chromaticity lobe peaks have to be recomputed
for every single RGB value, since correlated RGB colors are not necessarily
aligned in ICh space. Generating a split 3DLUT significantly alleviates this
problem because the expensive step is done as part of the IPT input LUT, which
can share the same hue peak calculation at least for all input intensities.
Diffstat (limited to 'libswscale/graph.c')
0 files changed, 0 insertions, 0 deletions