summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2023-01-30 11:50:10 -0500
committerAnton Khirnov <anton@khirnov.net>2023-02-09 15:35:14 +0100
commit719a93f4e40b202c5b74b58bcff85395a3edd0c7 (patch)
treef91eafa4550e170cb9b26bde5db75c3f05f55fb8 /libavformat/movenc.c
parentdc1b8135e096e4a41c1d606f8ca5795053136ad7 (diff)
downloadffmpeg-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 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 87ee7a921f..aca8b9d585 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -47,6 +47,7 @@
#include "internal.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/csp.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/libm.h"
@@ -56,7 +57,6 @@
#include "libavutil/stereo3d.h"
#include "libavutil/timecode.h"
#include "libavutil/dovi_meta.h"
-#include "libavutil/color_utils.h"
#include "libavutil/uuid.h"
#include "hevc.h"
#include "rtpenc.h"
@@ -2011,9 +2011,8 @@ static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_gama_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track, double gamma)
{
uint32_t gama = 0;
- if (gamma <= 0.0) {
- gamma = avpriv_get_gamma_from_trc(track->par->color_trc);
- }
+ if (gamma <= 0.0)
+ gamma = av_csp_approximate_trc_gamma(track->par->color_trc);
av_log(s, AV_LOG_DEBUG, "gamma value %g\n", gamma);
if (gamma > 1e-6) {