Author: abrander
Date: 2010-01-30 12:39:18 +0100 (Sat, 30 Jan 2010)
New Revision: 3119
Modified:
branches/rawstudio-ng-color/plugins/colorspace-transform/Makefile.am
branches/rawstudio-ng-color/plugins/colorspace-transform/rs-cmm.c
Log:
Avoid -fno-strict-aliasing.
Modified: branches/rawstudio-ng-color/plugins/colorspace-transform/Makefile.am
===================================================================
--- branches/rawstudio-ng-color/plugins/colorspace-transform/Makefile.am
2010-01-29 15:13:05 UTC (rev 3118)
+++ branches/rawstudio-ng-color/plugins/colorspace-transform/Makefile.am
2010-01-30 11:39:18 UTC (rev 3119)
@@ -1,7 +1,7 @@
plugindir = $(libdir)/rawstudio/plugins
AM_CFLAGS =\
- -Wall -fno-strict-aliasing\
+ -Wall \
-O4
AM_CXXFLAGS = $(AM_CFLAGS)
Modified: branches/rawstudio-ng-color/plugins/colorspace-transform/rs-cmm.c
===================================================================
--- branches/rawstudio-ng-color/plugins/colorspace-transform/rs-cmm.c
2010-01-29 15:13:05 UTC (rev 3118)
+++ branches/rawstudio-ng-color/plugins/colorspace-transform/rs-cmm.c
2010-01-30 11:39:18 UTC (rev 3119)
@@ -45,6 +45,8 @@
static void prepare8(RSCmm *cmm);
static void prepare16(RSCmm *cmm);
+static GMutex *is_profile_gamma_22_corrected_linear_lock = NULL;
+
static void
rs_cmm_dispose(GObject *object)
{
@@ -67,6 +69,10 @@
nd = pow(nd, 1.0/2.2);
gammatable22[n] = CLAMP((gint) (nd*65535.0), 0, 65535);
}
+
+ /* GObject locking will protect us here */
+ if (!is_profile_gamma_22_corrected_linear_lock)
+ is_profile_gamma_22_corrected_linear_lock = g_mutex_new();
}
static void
@@ -249,9 +255,7 @@
51855, 51855, 51855
};
- GStaticMutex lock = G_STATIC_MUTEX_INIT;
-
- g_static_mutex_lock(&lock);
+ g_mutex_lock(is_profile_gamma_22_corrected_linear_lock);
if (linear == NULL)
{
static cmsCIExyYTRIPLE srgb_primaries = {
@@ -265,7 +269,7 @@
gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma(2,1.0);
linear = cmsCreateRGBProfile(&D65, &srgb_primaries, gamma);
}
- g_static_mutex_unlock(&lock);
+ g_mutex_unlock(is_profile_gamma_22_corrected_linear_lock);
testtransform = cmsCreateTransform(profile, TYPE_RGB_16, linear,
TYPE_RGB_16, INTENT_PERCEPTUAL, 0);
cmsDoTransform(testtransform, table_lin, buffer, 9);
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit