From 9bac374ff7136a29f6845faf89d9f56b3925dc5e Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 9 May 2023 03:00:04 +0000 Subject: [PATCH] color_helpers: Use rintf instead of roundf Saves ~0.2ms --- src/color_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color_helpers.h b/src/color_helpers.h index 8c2ec25..cc46f9e 100644 --- a/src/color_helpers.h +++ b/src/color_helpers.h @@ -12,7 +12,7 @@ // Color utils inline int quantize( float fVal, float fMaxVal ) { - return std::max( 0.f, std::min( fMaxVal, roundf( fVal * fMaxVal ) ) ); + return std::max( 0.f, std::min( fMaxVal, rintf( fVal * fMaxVal ) ) ); } inline uint16_t drm_quantize_lut_value( float flValue )