diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2023-02-15 21:01:50 +0000 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-02-24 13:55:29 +0100 |
commit | fb48722234e94539c269d2f0034be8a87ca32ccb (patch) | |
tree | 6b8d47723f4b1b92f9b84c1e427eaf60f57e5132 /video | |
parent | 0d991eba7242f1f7df6d62151305939c57956fe4 (diff) | |
download | mpv-fb48722234e94539c269d2f0034be8a87ca32ccb.tar.bz2 mpv-fb48722234e94539c269d2f0034be8a87ca32ccb.tar.xz |
video: make csp equalizer params float
This allows more precise adjustments.
Fixes #11316
Diffstat (limited to 'video')
-rw-r--r-- | video/csputils.c | 14 | ||||
-rw-r--r-- | video/csputils.h | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/video/csputils.c b/video/csputils.c index ea9f280205..75575280d7 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -879,18 +879,18 @@ bool mp_colorspace_equal(struct mp_colorspace c1, struct mp_colorspace c2) const struct m_sub_options mp_csp_equalizer_conf = { .opts = (const m_option_t[]) { - {"brightness", OPT_INT(values[MP_CSP_EQ_BRIGHTNESS]), + {"brightness", OPT_FLOAT(values[MP_CSP_EQ_BRIGHTNESS]), M_RANGE(-100, 100)}, - {"saturation", OPT_INT(values[MP_CSP_EQ_SATURATION]), + {"saturation", OPT_FLOAT(values[MP_CSP_EQ_SATURATION]), M_RANGE(-100, 100)}, - {"contrast", OPT_INT(values[MP_CSP_EQ_CONTRAST]), + {"contrast", OPT_FLOAT(values[MP_CSP_EQ_CONTRAST]), M_RANGE(-100, 100)}, - {"hue", OPT_INT(values[MP_CSP_EQ_HUE]), + {"hue", OPT_FLOAT(values[MP_CSP_EQ_HUE]), M_RANGE(-100, 100)}, - {"gamma", OPT_INT(values[MP_CSP_EQ_GAMMA]), + {"gamma", OPT_FLOAT(values[MP_CSP_EQ_GAMMA]), M_RANGE(-100, 100)}, {"video-output-levels", - OPT_CHOICE_C(values[MP_CSP_EQ_OUTPUT_LEVELS], mp_csp_levels_names)}, + OPT_CHOICE_C(output_levels, mp_csp_levels_names)}, {0} }, .size = sizeof(struct mp_csp_equalizer_opts), @@ -905,7 +905,7 @@ void mp_csp_copy_equalizer_values(struct mp_csp_params *params, params->hue = eq->values[MP_CSP_EQ_HUE] / 100.0 * M_PI; params->saturation = (eq->values[MP_CSP_EQ_SATURATION] + 100) / 100.0; params->gamma = exp(log(8.0) * eq->values[MP_CSP_EQ_GAMMA] / 100.0); - params->levels_out = eq->values[MP_CSP_EQ_OUTPUT_LEVELS]; + params->levels_out = eq->output_levels; } struct mp_csp_equalizer_state *mp_csp_equalizer_create(void *ta_parent, diff --git a/video/csputils.h b/video/csputils.h index 323468260f..49b61c4963 100644 --- a/video/csputils.h +++ b/video/csputils.h @@ -210,15 +210,15 @@ enum mp_csp_equalizer_param { MP_CSP_EQ_HUE, MP_CSP_EQ_SATURATION, MP_CSP_EQ_GAMMA, - MP_CSP_EQ_OUTPUT_LEVELS, MP_CSP_EQ_COUNT, }; // Default initialization with 0 is enough, except for the capabilities field struct mp_csp_equalizer_opts { - // Value for each property is in the range [-100, 100]. - // 0 is default, meaning neutral or no change. - int values[MP_CSP_EQ_COUNT]; + // Value for each property is in the range [-100.0, 100.0]. + // 0.0 is default, meaning neutral or no change. + float values[MP_CSP_EQ_COUNT]; + int output_levels; }; void mp_csp_copy_equalizer_values(struct mp_csp_params *params, |