diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-01-24 07:54:01 +0100 |
---|---|---|
committer | Leo Izen <leo.izen@gmail.com> | 2023-03-02 09:37:06 -0500 |
commit | cb9ba6cb26a2b5649c7b9ea997ed5b25ede5360c (patch) | |
tree | 01905bc447966e6e6ee6c3932ec5d276428ebf8e /video/out | |
parent | c31e145e1f968c13e5094481059e04cb72fe8d5d (diff) | |
download | mpv-cb9ba6cb26a2b5649c7b9ea997ed5b25ede5360c.tar.bz2 mpv-cb9ba6cb26a2b5649c7b9ea997ed5b25ede5360c.tar.xz |
csputils: add MP_CSP_TRC_ST428 as defined in ST 428-1
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gpu/video_shaders.c | 6 | ||||
-rw-r--r-- | video/out/placebo/utils.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c index d9393faa48..049151bd24 100644 --- a/video/out/gpu/video_shaders.c +++ b/video/out/gpu/video_shaders.c @@ -422,6 +422,9 @@ void pass_linearize(struct gl_shader_cache *sc, enum mp_csp_trc trc) " %s(lessThanEqual(vec3(%f), color.rgb))); \n", SLOG_Q, SLOG_P, SLOG_C, SLOG_A, SLOG_B, SLOG_K2, gl_sc_bvec(sc, 3), SLOG_Q); break; + case MP_CSP_TRC_ST428: + GLSL(color.rgb = vec3(52.37/48.0) * pow(color.rgb, vec3(2.6));); + break; default: abort(); } @@ -512,6 +515,9 @@ void pass_delinearize(struct gl_shader_cache *sc, enum mp_csp_trc trc) " %s(lessThanEqual(vec3(0.0), color.rgb))); \n", SLOG_P, SLOG_Q, SLOG_A / M_LN10, SLOG_K2, SLOG_B, SLOG_C, gl_sc_bvec(sc, 3)); break; + case MP_CSP_TRC_ST428: + GLSL(color.rgb = pow(color.rgb * vec3(48.0/52.37), vec3(1.0/2.6));); + break; default: abort(); } diff --git a/video/out/placebo/utils.c b/video/out/placebo/utils.c index 76fac9234d..03a2fdd005 100644 --- a/video/out/placebo/utils.c +++ b/video/out/placebo/utils.c @@ -110,6 +110,11 @@ enum pl_color_transfer mp_trc_to_pl(enum mp_csp_trc trc) case MP_CSP_TRC_V_LOG: return PL_COLOR_TRC_V_LOG; case MP_CSP_TRC_S_LOG1: return PL_COLOR_TRC_S_LOG1; case MP_CSP_TRC_S_LOG2: return PL_COLOR_TRC_S_LOG2; +#if PL_API_VER >= 240 + case MP_CSP_TRC_ST428: return PL_COLOR_TRC_ST428; +#else + case MP_CSP_TRC_ST428: return PL_COLOR_TRC_UNKNOWN; +#endif case MP_CSP_TRC_COUNT: return PL_COLOR_TRC_COUNT; } |