[babl] sse2: reuse linear premul/unpremul for gamma formats



commit 4df66f64a91b5656ca13c368db062841d9ec7fa3
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Jan 11 00:42:42 2016 +0100

    sse2: reuse linear premul/unpremul for gamma formats

 extensions/sse2-float.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/extensions/sse2-float.c b/extensions/sse2-float.c
index 97b201b..31b58d1 100644
--- a/extensions/sse2-float.c
+++ b/extensions/sse2-float.c
@@ -568,6 +568,14 @@ init (void)
     babl_component ("Ba"),
     babl_component ("A"),
     NULL);
+  const Babl *rgbAF_gamma = babl_format_new (
+    babl_model ("R'aG'aB'aA"),
+    babl_type ("float"),
+    babl_component ("R'a"),
+    babl_component ("G'a"),
+    babl_component ("B'a"),
+    babl_component ("A"),
+    NULL);
   const Babl *rgbaF_gamma = babl_format_new (
     babl_model ("R'G'B'A"),
     babl_type ("float"),
@@ -622,6 +630,12 @@ init (void)
                           "linear",
                           conv_rgbaF_linear_rgbAF_linear,
                           NULL);
+
+      babl_conversion_new(rgbaF_gamma, 
+                          rgbAF_gamma,
+                          "linear",
+                          conv_rgbaF_linear_rgbAF_linear,
+                          NULL);
                           
       /* Which of these is faster varies by CPU, and the difference
        * is big enough that it's worthwhile to include both and
@@ -632,6 +646,12 @@ init (void)
                           "linear",
                           conv_rgbAF_linear_rgbaF_linear_shuffle,
                           NULL);
+      babl_conversion_new(rgbAF_gamma, 
+                          rgbaF_gamma,
+                          "linear",
+                          conv_rgbAF_linear_rgbaF_linear_shuffle,
+                          NULL);
+
       babl_conversion_new(rgbAF_linear, 
                           rgbaF_linear,
                           "linear",


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