diff options
author | Leo Izen <leo.izen@gmail.com> | 2023-01-30 11:50:10 -0500 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-02-09 15:35:14 +0100 |
commit | 719a93f4e40b202c5b74b58bcff85395a3edd0c7 (patch) | |
tree | f91eafa4550e170cb9b26bde5db75c3f05f55fb8 /libavcodec/pngenc.c | |
parent | dc1b8135e096e4a41c1d606f8ca5795053136ad7 (diff) | |
download | ffmpeg-719a93f4e40b202c5b74b58bcff85395a3edd0c7.tar.gz |
avutil/{color_utils, csp}: merge color_utils into csp and expose API
libavutil/color_utils contains some avpriv_ symbols that map
enum AVTransferCharacteristic values to gamma-curve approximations and
to the actual transfer functions to invert them (i.e. -> linear).
There's two issues with this:
(1) avpriv is evil and should be avoided whenever possible
(2) libavutil/csp.h exposes a public API for handling color that
already handles primaries and matricies
I don't see any reason this API has to be private, so this commit takes
the functionality from avutil/color_utils and merges it into avutil/csp
with an exposed av_ API rather than the previous avpriv_ API.
Every reference to the previous API has been updated to point to the
new one. color_utils.h has been deleted as well. This should not break
any applications as it only contained avpriv_ symbols in the first
place, so nothing in that header could be referenced by other
applications.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r-- | libavcodec/pngenc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 81b95c143d..43bf2039ff 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -29,7 +29,6 @@ #include "zlib_wrapper.h" #include "libavutil/avassert.h" -#include "libavutil/color_utils.h" #include "libavutil/crc.h" #include "libavutil/csp.h" #include "libavutil/libm.h" @@ -317,7 +316,7 @@ static int png_get_chrm(enum AVColorPrimaries prim, uint8_t *buf) static int png_get_gama(enum AVColorTransferCharacteristic trc, uint8_t *buf) { - double gamma = avpriv_get_gamma_from_trc(trc); + double gamma = av_csp_approximate_trc_gamma(trc); if (gamma <= 1e-6) return 0; |