From: Alyssa Rosenzweig Date: Tue, 19 May 2020 15:14:52 +0000 (-0400) Subject: util/format: Use SATURATE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f1fde1fafb64ac6e33325b30443b53e243bfb0e;p=mesa.git util/format: Use SATURATE Signed-off-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Part-of: --- diff --git a/src/util/format/u_format_yuv.h b/src/util/format/u_format_yuv.h index 3c822bcb148..37f76dc014c 100644 --- a/src/util/format/u_format_yuv.h +++ b/src/util/format/u_format_yuv.h @@ -58,9 +58,9 @@ static inline void util_format_rgb_float_to_yuv(float r, float g, float b, uint8_t *y, uint8_t *u, uint8_t *v) { - const float _r = CLAMP(r, 0.0f, 1.0f); - const float _g = CLAMP(g, 0.0f, 1.0f); - const float _b = CLAMP(b, 0.0f, 1.0f); + const float _r = SATURATE(r); + const float _g = SATURATE(g); + const float _b = SATURATE(b); const float scale = 255.0f;