]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/feature.c
(no commit message)
[imagemagick] / MagickCore / feature.c
index 6b8fede5b05edd0039043da266f2c6c4c1ae0a26..39163a31bca85e80330790e433838da6c730f6d3 100644 (file)
@@ -17,7 +17,7 @@
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -181,8 +181,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     length;
 
   ssize_t
-    y,
-    z;
+    y;
 
   unsigned int
     number_grays;
@@ -209,7 +208,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
         channel_features);
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(channel_features);
     }
   for (i=0; i <= (ssize_t) MaxMap; i++)
@@ -221,9 +220,9 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     grays[i].black=(~0U);
   }
   status=MagickTrue;
-  image_view=AcquireCacheView(image);
+  image_view=AcquireVirtualCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (y=0; y < (ssize_t) image->rows; y++)
   {
@@ -339,7 +338,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
         channel_features);
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(channel_features);
     }
   (void) ResetMagickMemory(&correlation,0,sizeof(correlation));
@@ -388,14 +387,14 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
         channel_features);
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(channel_features);
     }
   /*
     Initialize spatial dependence matrix.
   */
   status=MagickTrue;
-  image_view=AcquireCacheView(image);
+  image_view=AcquireVirtualCacheView(image,exception);
   for (y=0; y < (ssize_t) image->rows; y++)
   {
     register const Quantum
@@ -521,7 +520,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
         channel_features);
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(channel_features);
     }
   /*
@@ -593,7 +592,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     Compute texture features.
   */
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (i=0; i < 4; i++)
   {
@@ -777,7 +776,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     Compute more texture features.
   */
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (i=0; i < 4; i++)
   {
@@ -852,7 +851,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     Compute more texture features.
   */
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (i=0; i < 4; i++)
   {
@@ -972,7 +971,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
   (void) ResetMagickMemory(&variance,0,sizeof(variance));
   (void) ResetMagickMemory(&sum_squares,0,sizeof(sum_squares));
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (i=0; i < 4; i++)
   {
@@ -1123,10 +1122,13 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     Compute more texture features.
   */
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (i=0; i < 4; i++)
   {
+    ssize_t
+      z;
+
     for (z=0; z < (ssize_t) number_grays; z++)
     {
       register ssize_t