Update of /cvsroot/ufraw/ufraw
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17103

Modified Files:
        ufraw_ufraw.c 
Log Message:
Added OpenMP support for hotpixel detection, patch by Frank van Maarseveen.


Index: ufraw_ufraw.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_ufraw.c,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- ufraw_ufraw.c       3 Oct 2009 20:21:46 -0000       1.193
+++ ufraw_ufraw.c       12 Oct 2009 02:16:22 -0000      1.194
@@ -907,6 +907,13 @@
  * of its neighbours. For simplicity border pixels are not considered.
  *
  * Reasonable values for uf->conf->hotpixel are in the range 0.5-10.
+ *
+ * OpenMP notes
+ * ------------
+ * The hot pixel count is updated atomically but this is merely for proof
+ * of concept: objdump -Sd shows a "lock addl $0x1,0x1f4(%edx) sequence.
+ * The algorithm uses pixel values from previous and next row anyway and
+ * whether or not pixels are marked makes a difference already.
  */
 static void ufraw_shave_hotpixels(ufraw_data *uf, dcraw_image_type *img,
        int width, int height, int colors, unsigned rgbMax)
@@ -919,6 +926,11 @@
     if (uf->conf->hotpixel <= 0.0)
        return;
     delta = rgbMax / (uf->conf->hotpixel + 1.0);
+#ifdef _OPENMP
+#pragma omp parallel for schedule(static,64) default(none) \
+  shared(uf,img,width,height,colors,rgbMax,delta) \
+  private(h,p,w,c,t,v,hi,i)
+#endif
     for (h = 1; h < height - 1; ++h) {
        p = img + 1 + h * width;
        for (w = 1; w < width - 1; ++w, ++p) {
@@ -958,6 +970,9 @@
                        memcpy(p[i], p[0], sizeof (p[i]));
                }
                p[0][c] = hi;
+#ifdef _OPENMP
+#pragma omp atomic
+#endif
                ++uf->hotpixels;
            }
        }


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to