summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/csputils.c')
-rw-r--r--video/csputils.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 9b558c9a3e..ea83739e8e 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -476,11 +476,7 @@ void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params,
// want to linearize any brightness additions. 2 is a reasonable
// approximation for any sort of gamma function that could be in use.
// As this is an aesthetic setting only, any exact values do not matter.
- if (brightness < 0) {
- brightness *= -brightness;
- } else {
- brightness *= brightness;
- }
+ brightness *= fabs(brightness);
for (int i = 0; i < 3; i++)
m->c[i] = brightness;