1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00
Files
ffmpeg/libavfilter
Niklas Haas 931db4d377 avfilter/vf_gainmap: add filter to compute a gain map
This is a mostly straightforward translation of the logic from ISO 21496.

Implementation notes:

- Slice threading is used to vastly speed up processing

- We quantize the EOTF to a LUT if possible; this doesn't work for HLG becaus
  HLG embeds a channel-dependent OOTF. It's possible we could implement a
  custom HLG function here in the future, but for now, simply calling out
  to the EOTF function is a reasonable fallback.

- Similar to libultrahdr, we use a two-pass approach when the gain range is
  unknown a priori, and fold the quantization step into a single pass if
  all parameters are specified up-front.

- Unlike libultrahdr, we make an effort to also pick an optimal gamma to
  tune the quantized encoding. Users can always disable this by specifying
  `:gamma=1.0` explicitly.

- This filter is bidirectional and can also compute an HDR->SDR gainmap,
  so the naming is left deliberately abstract internally.

- We need to be careful to avoid platform-specific floating point differences.
  This is accomplished by quantizing the floating point values to a fixed
  point AVRational representation rather than using av_d2q().

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-09-30 14:37:59 +02:00
..
2023-11-18 19:55:42 +01:00
2024-08-19 21:48:04 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2024-08-19 21:48:04 +02:00
…
…
…
…
…
2024-08-19 21:48:04 +02:00
…
…
2025-08-03 13:48:47 +02:00
…
…
2024-08-19 21:48:04 +02:00
…
…
…
2024-08-19 21:48:04 +02:00
…
…
2025-08-03 13:48:47 +02:00
2024-07-01 22:31:02 +02:00
2024-08-19 21:48:04 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2024-08-19 21:48:04 +02:00
…
2024-02-16 21:34:38 +01:00
2026-09-12 23:52:20 +00:00
2025-06-15 21:00:38 +05:30
2025-10-16 18:41:19 +02:00
2025-07-04 01:32:27 +02:00
2025-07-04 01:32:27 +02:00
2026-05-15 20:29:29 +02:00
2026-05-15 20:29:29 +02:00
2025-08-03 13:48:47 +02:00
…
2026-09-16 19:02:27 +00:00
…
…