summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-08-31 16:28:04 +0200
committersfan5 <sfan5@live.de>2023-11-05 18:57:36 +0100
commit1174afcccc47101beed57068f4933c481e967efc (patch)
tree616622855079dedc23be65f0d82f67bc58445c47 /video
parent07efb63931bb3522d298d2387ffbd17253ce20b3 (diff)
downloadmpv-1174afcccc47101beed57068f4933c481e967efc.tar.bz2
mpv-1174afcccc47101beed57068f4933c481e967efc.tar.xz
csputils: add pl_hdr_metadata to mp_colorspace and deprecate sig_peak
Note this commit does not change all uses of sig-peak, this is for future refactoring.
Diffstat (limited to 'video')
-rw-r--r--video/csputils.c4
-rw-r--r--video/csputils.h3
-rw-r--r--video/filter/vf_format.c4
3 files changed, 8 insertions, 3 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 34fc4ead42..b7fe5737cd 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -133,6 +133,7 @@ void mp_colorspace_merge(struct mp_colorspace *orig, struct mp_colorspace *new)
orig->sig_peak = new->sig_peak;
if (!orig->light)
orig->light = new->light;
+ pl_hdr_metadata_merge(&orig->hdr, &new->hdr);
}
// The short name _must_ match with what vf_stereo3d accepts (if supported).
@@ -912,7 +913,8 @@ bool mp_colorspace_equal(struct mp_colorspace c1, struct mp_colorspace c2)
c1.primaries == c2.primaries &&
c1.gamma == c2.gamma &&
c1.light == c2.light &&
- c1.sig_peak == c2.sig_peak;
+ c1.sig_peak == c2.sig_peak &&
+ pl_hdr_metadata_equal(&c1.hdr, &c2.hdr);
}
enum mp_csp_equalizer_param {
diff --git a/video/csputils.h b/video/csputils.h
index ab5d9792e0..5b2fe6d63e 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -147,7 +147,8 @@ struct mp_colorspace {
enum mp_csp_prim primaries;
enum mp_csp_trc gamma;
enum mp_csp_light light;
- float sig_peak; // highest relative value in signal. 0 = unknown/auto
+ float sig_peak; // highest relative value in signal. 0 = unknown/auto (deprecated)
+ struct pl_hdr_metadata hdr;
};
// For many colorspace conversions, in particular those involving HDR, an
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index e295b1b752..c0ec11d0b8 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -81,8 +81,10 @@ static void set_params(struct vf_format_opts *p, struct mp_image_params *out,
out->color.light = MP_CSP_LIGHT_AUTO;
}
}
- if (p->sig_peak)
+ if (p->sig_peak) {
out->color.sig_peak = p->sig_peak;
+ out->color.hdr.max_cll = p->sig_peak;
+ }
if (p->light)
out->color.light = p->light;
if (p->chroma_location)