summaryrefslogtreecommitdiffstats
path: root/video/csputils.h
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-28 00:59:09 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-28 01:07:35 +0100
commitfbacd5de31de964f7cd562304ab1c9b4a0d76015 (patch)
treecce495e7699f98ae64103b87459008b7d8503e0d /video/csputils.h
parent076b3d13855870df9eb599b7a26e708f9b8d1ace (diff)
downloadmpv-fbacd5de31de964f7cd562304ab1c9b4a0d76015.tar.bz2
mpv-fbacd5de31de964f7cd562304ab1c9b4a0d76015.tar.xz
csputils: add missing gamma support
We have MP_CSP_TRC defined, but it wasn't being used by practically anything. This commit adds missing conversion logic, adds it to mp_image, and moves the auto-guessing logic to where it should be, in mp_image_params_guess_csp (and out of vo_opengl). Note that this also fixes a minor bug: csp_prim was not being copied between mp_image structs if the format was not YUV in both cases, but this is wrong - the primaries are always relevant.
Diffstat (limited to 'video/csputils.h')
-rw-r--r--video/csputils.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/video/csputils.h b/video/csputils.h
index b6d17c1815..b84a4a3544 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -68,15 +68,19 @@ enum mp_csp_prim {
MP_CSP_PRIM_COUNT
};
+// 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];
+
enum mp_csp_trc {
- MP_CSP_TRC_NONE,
+ MP_CSP_TRC_AUTO,
MP_CSP_TRC_BT_1886,
MP_CSP_TRC_SRGB,
- MP_CSP_TRC_LINEAR
+ MP_CSP_TRC_LINEAR,
+ MP_CSP_TRC_COUNT
};
-// 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];
+// Any enum mp_csp_trc value is a valid index (except MP_CSP_TRC_COUNT)
+extern const char *const mp_csp_trc_names[MP_CSP_TRC_COUNT];
// These constants are based on the ICC specification (Table 23) and match
// up with the API of LittleCMS, which treats them as integers.
@@ -205,6 +209,8 @@ int mp_csp_levels_to_avcol_range(enum mp_csp_levels range);
int mp_csp_prim_to_avcol_pri(enum mp_csp_prim prim);
+int mp_csp_trc_to_avcol_trc(enum mp_csp_trc trc);
+
enum mp_csp mp_csp_guess_colorspace(int width, int height);
enum mp_csp_prim mp_csp_guess_primaries(int width, int height);