Author: post
Date: 2009-12-30 23:39:52 +0100 (Wed, 30 Dec 2009)
New Revision: 2929

Modified:
   branches/rawstudio-ng-color/plugins/lensfun/Makefile.am
   branches/rawstudio-ng-color/plugins/lensfun/lensfun.c
Log:
Lensfun: Enable SSE2 interpolator on 32 bit machines.

Modified: branches/rawstudio-ng-color/plugins/lensfun/Makefile.am
===================================================================
--- branches/rawstudio-ng-color/plugins/lensfun/Makefile.am     2009-12-30 
22:12:42 UTC (rev 2928)
+++ branches/rawstudio-ng-color/plugins/lensfun/Makefile.am     2009-12-30 
22:39:52 UTC (rev 2929)
@@ -1,8 +1,15 @@
 plugindir = $(libdir)/rawstudio/plugins
 
+if CAN_COMPILE_SSE2
+SSE_FLAG=-msse2
+else
+SSE_FLAG=
+endif
+
 AM_CFLAGS =\
        -Wall\
-       -O4
+       -O4\
+       $(SSE_FLAG)
 
 AM_CXXFLAGS = $(AM_CFLAGS)
 

Modified: branches/rawstudio-ng-color/plugins/lensfun/lensfun.c
===================================================================
--- branches/rawstudio-ng-color/plugins/lensfun/lensfun.c       2009-12-30 
22:12:42 UTC (rev 2928)
+++ branches/rawstudio-ng-color/plugins/lensfun/lensfun.c       2009-12-30 
22:39:52 UTC (rev 2929)
@@ -304,6 +304,7 @@
                        rs_filter_changed(RS_FILTER(lensfun), 
RS_FILTER_CHANGED_PIXELDATA);
                        break;
                case PROP_DISTORTION_ENABLED:
+                       lensfun->DIRTY = TRUE;
                        lensfun->distortion_enabled = 
g_value_get_boolean(value);
                        rs_filter_changed(RS_FILTER(lensfun), 
RS_FILTER_CHANGED_PIXELDATA);
                        break;
@@ -342,6 +343,7 @@
                }
        }
 
+       gboolean sse2_available = !!(rs_detect_cpu_features() & 
RS_CPU_FLAG_SSE2);
        if (t->stage == 3) 
        {
                /* Do TCA and distortion */
@@ -354,14 +356,21 @@
                        lf_modifier_apply_subpixel_geometry_distortion(t->mod, 
t->roi->x, (gfloat) y, t->roi->width, 1, pos);
                        target = GET_PIXEL(t->output, t->roi->x, y);
                        gfloat* l_pos = pos;
-
+#if defined (__SSE2__)
+                       if (sse2_available)
+                       {
+                               for(x = 0; x < t->roi->width ; x++)
+                               {
+                                       rs_image16_bilinear_full_sse2(t->input, 
target, l_pos);
+                                       target += pixelsize;
+                                       l_pos += 6;
+                               }
+                       } else 
+#endif
                        for(x = 0; x < t->roi->width ; x++)
                        {
-#if defined (__SSE2__)
                                rs_image16_bilinear_full_sse2(t->input, target, 
l_pos);
-#else
                                rs_image16_bilinear_full(t->input, target, 
l_pos);
-#endif
                                target += pixelsize;
                                l_pos += 6;
                        }


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to