[babl] extensions/CIE: make some constants single precision float



commit cf26d430b9b880bee30ed2387050079df06a7d05
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Jan 12 21:39:11 2017 +0100

    extensions/CIE: make some constants single precision float
    
    Speeds up the 32bit float versions of conversions by a bit more than 5% without
    changing the precision of 32bit floating point since the constants are of
    similar magnitude to single precision IEEE float.

 extensions/CIE.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/extensions/CIE.c b/extensions/CIE.c
index 2e0aca2..23af1c9 100644
--- a/extensions/CIE.c
+++ b/extensions/CIE.c
@@ -28,8 +28,8 @@
 #define DEGREES_PER_RADIAN (180 / 3.14159265358979323846)
 #define RADIANS_PER_DEGREE (1 / DEGREES_PER_RADIAN)
 
-#define LAB_EPSILON       (216.0 / 24389.0)
-#define LAB_KAPPA         (24389.0 / 27.0)
+#define LAB_EPSILON       (216.0f / 24389.0f)
+#define LAB_KAPPA         (24389.0f / 27.0f)
 
 /* The constants below hard-code the D50-adapted sRGB ICC profile
  * reference white, aka the ICC profile D50 illuminant.
@@ -46,9 +46,9 @@
  * hard-coded D50 ICC profile illuminant values:
  */
 
-#define D50_WHITE_REF_X   0.964202880
-#define D50_WHITE_REF_Y   1.000000000
-#define D50_WHITE_REF_Z   0.824905400
+#define D50_WHITE_REF_X   0.964202880f
+#define D50_WHITE_REF_Y   1.000000000f
+#define D50_WHITE_REF_Z   0.824905400f
 
 
 int init (void);
@@ -1044,7 +1044,6 @@ types_u16 (void)
 
   babl_type_new (
     "CIE u16 ab",
-    "id", "CIE u8 ab",
     "integer",
     "unsigned",
     "bits", 16,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]