[babl] sse2-float: correctly handle associted alpha in remainder
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] sse2-float: correctly handle associted alpha in remainder
- Date: Thu, 27 Jan 2022 07:51:44 +0000 (UTC)
commit debe24980e0e17758e3c88721455d58754856701
Author: Øyvind Kolås <pippin gimp org>
Date: Thu Jan 27 04:33:04 2022 +0100
sse2-float: correctly handle associted alpha in remainder
extensions/sse2-float.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/extensions/sse2-float.c b/extensions/sse2-float.c
index 3757ffe09..e4cd7cfac 100644
--- a/extensions/sse2-float.c
+++ b/extensions/sse2-float.c
@@ -157,11 +157,8 @@ conv_rgbAF_linear_rgbaF_linear_shuffle (const Babl *conversion,
while (remainder--)
{
float alpha = src[3];
- float recip;
- if (alpha <= 0.0f)
- recip = 0.0f;
- else
- recip = 1.0f/alpha;
+ float used_alpha = babl_epsilon_for_zero_float (alpha);
+ float recip = 1.0f/used_alpha;
dst[0] = src[0] * recip;
dst[1] = src[1] * recip;
dst[2] = src[2] * recip;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]