diff options
author | Niklas Haas <git@nand.wakku.to> | 2014-04-01 00:17:07 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-22 19:02:06 +0200 |
commit | fbd35caef830a1d0a25f1ee6e3b5d71453c98a59 (patch) | |
tree | 9e0e3a6ec3fcb7bf573ab023b84691cc6d4b8951 /video/csputils.h | |
parent | 7f3ea1280228175664241ba5b8edaee48fd33439 (diff) | |
download | mpv-fbd35caef830a1d0a25f1ee6e3b5d71453c98a59.tar.bz2 mpv-fbd35caef830a1d0a25f1ee6e3b5d71453c98a59.tar.xz |
video: Refactor rendering intent for DCP XYZ and :srgb
Notably, we now conform to SMPTE 428-1-2006 when decoding XYZ12 input,
and we can support rendering intents other than colorimetric when
converting between BT.709 and BT.2020, like with :srgb or :icc-profile.
Diffstat (limited to 'video/csputils.h')
-rw-r--r-- | video/csputils.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/video/csputils.h b/video/csputils.h index f2e96beb3d..9257102df5 100644 --- a/video/csputils.h +++ b/video/csputils.h @@ -70,6 +70,15 @@ enum mp_csp_prim { // Any enum mp_csp_prim value is a valid index (except MP_CSP_PRIM_COUNT) extern const char *const mp_csp_prim_names[MP_CSP_PRIM_COUNT]; +// These constants are based on the ICC specification (Table 23) and match +// up with the API of LittleCMS, which treats them as integers. +enum mp_render_intent { + MP_INTENT_PERCEPTUAL = 0, + MP_INTENT_RELATIVE_COLORIMETRIC = 1, + MP_INTENT_SATURATION = 2, + MP_INTENT_ABSOLUTE_COLORIMETRIC = 3 +}; + struct mp_csp_details { enum mp_csp format; enum mp_csp_levels levels_in; // encoded video @@ -187,10 +196,13 @@ void mp_gen_gamma_map(unsigned char *map, int size, float gamma); #define COL_C 3 struct mp_csp_primaries mp_get_csp_primaries(enum mp_csp_prim csp); -void mp_get_cms_matrix(struct mp_csp_primaries src, struct mp_csp_primaries dest, float cms_matrix[3][3]); +void mp_apply_chromatic_adaptation(struct mp_csp_col_xy src, struct mp_csp_col_xy dest, float m[3][3]); +void mp_get_cms_matrix(struct mp_csp_primaries src, struct mp_csp_primaries dest, + enum mp_render_intent intent, float cms_matrix[3][3]); void mp_get_rgb2xyz_matrix(struct mp_csp_primaries space, float m[3][3]); -void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params, struct mp_csp_primaries prim, float xyz2rgb[3][4]); +void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params, struct mp_csp_primaries prim, + enum mp_render_intent intent, float xyz2rgb[3][4]); void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, float yuv2rgb[3][4]); void mp_gen_yuv2rgb_map(struct mp_csp_params *params, uint8_t *map, int size); |