aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-04-09 19:58:55 +0200
committerNiklas Haas <git@haasn.dev>2022-04-23 21:51:55 +0200
commitb9a25963f7232433c9370ac369fb668ac0d5cb53 (patch)
treef4bc25c8eccccc4061239f1730263aa4ee7df17b /libavdevice
parent072dd047f0e7830bbc51c893bed91d8ba5e4f788 (diff)
downloadffmpeg-b9a25963f7232433c9370ac369fb668ac0d5cb53.tar.gz
lavfi: add ICC profile support via lcms2
This introduces an optional dependency on lcms2 into FFmpeg. lcms2 is a widely used library for ICC profile handling, which apart from being used in almost all major image processing programs and video players, has also been deployed in browsers. As such, it's both widely available and well-tested. Add a few helpers to cover our major use cases. This commit merely introduces the helpers (and configure check), even though nothing uses them yet. It's worth pointing out that the reason the cmsToneCurves for each AVCOL_TRC are cached inside the context, is because constructing a cmsToneCurve requires evaluating the curve at 4096 (by default) grid points and constructing a LUT. So, we ideally only want to do this once per curve. This matters for e.g. ff_icc_profile_detect_transfer, which essentially compares a profile against all of these generated LUTs. Re-generating the LUTs for every iteration would be unnecessarily wasteful. The same consideration does not apply to e.g. cmsCreate*Profile, which is a very lightweight operation just involving struct allocation and setting a few pointers. The cutoff value of 0.01 was determined by experimentation. The lowest "false positive" delta I saw in practice was 0.13, and the largest "false negative" delta was 0.0008. So a value of 0.01 sits comfortaby almost exactly in the middle. Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libavdevice')
0 files changed, 0 insertions, 0 deletions