[gegl] gegl: remove big overallocation in auto-threading code



commit 58032de51a21bf393402337fd532707901064102
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Sep 27 23:42:27 2017 +0200

    gegl: remove big overallocation in auto-threading code
    
    Second attempt at fixing bug #788252, this time allocating all temp
    buffers based on tile_width and tile_height of output buffer.

 gegl/operation/gegl-operation-point-composer.c  |    8 +++++---
 gegl/operation/gegl-operation-point-composer3.c |   10 ++++++----
 gegl/operation/gegl-operation-point-filter.c    |    6 ++++--
 3 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index e68f28c..37268bf 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -27,6 +27,8 @@
 #include "gegl-operation-context.h"
 #include "gegl-config.h"
 #include "gegl-types-internal.h"
+#include "gegl-buffer-private.h"
+#include "gegl-tile-storage.h"
 #include <sys/types.h>
 #include <unistd.h>
 #include <string.h>
@@ -348,7 +350,7 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
             if (in_buf_format != in_format)
             {
               thread_data[j].input_fish = babl_fish (in_buf_format, in_format);
-              thread_data[j].in_tmp = gegl_temp_buffer (temp_id++, in_bpp * result->width * result->height);
+              thread_data[j].in_tmp = gegl_temp_buffer (temp_id++, in_bpp * output->tile_storage->tile_width 
* output->tile_storage->tile_height);
             }
             else
             {
@@ -368,7 +370,7 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
             if (aux_buf_format != aux_format)
             {
               thread_data[j].aux_fish = babl_fish (aux_buf_format, aux_format);
-              thread_data[j].aux_tmp = gegl_temp_buffer (temp_id++, aux_bpp * result->width * 
result->height);
+              thread_data[j].aux_tmp = gegl_temp_buffer (temp_id++, aux_bpp * 
output->tile_storage->tile_width * output->tile_storage->tile_height);
             }
             else
             {
@@ -387,7 +389,7 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
           if (output_buf_format != gegl_buffer_get_format (output))
           {
             thread_data[j].output_fish = babl_fish (out_format, output_buf_format);
-            thread_data[j].output_tmp = gegl_temp_buffer (temp_id++, out_bpp * result->width * 
result->height);
+            thread_data[j].output_tmp = gegl_temp_buffer (temp_id++, out_bpp * 
output->tile_storage->tile_width * output->tile_storage->tile_height);
           }
           else
           {
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index 705fa9b..3f352de 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -26,6 +26,8 @@
 #include "gegl-operation-context.h"
 #include "gegl-types-internal.h"
 #include "gegl-config.h"
+#include "gegl-buffer-private.h"
+#include "gegl-tile-storage.h"
 #include <sys/types.h>
 #include <unistd.h>
 #include <string.h>
@@ -271,7 +273,7 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
             if (in_buf_format != in_format)
             {
               thread_data[j].input_fish = babl_fish (in_buf_format, in_format);
-              thread_data[j].in_tmp = gegl_temp_buffer (temp_id++, in_bpp * result->width * result->height);
+              thread_data[j].in_tmp = gegl_temp_buffer (temp_id++, in_bpp * output->tile_storage->tile_width 
* output->tile_storage->tile_height);
             }
             else
             {
@@ -297,7 +299,7 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
             if (aux_buf_format != aux_format)
             {
               thread_data[j].aux_fish = babl_fish (aux_buf_format, aux_format);
-              thread_data[j].aux_tmp = gegl_temp_buffer (temp_id++, aux_bpp * result->width * 
result->height);
+              thread_data[j].aux_tmp = gegl_temp_buffer (temp_id++, aux_bpp * 
output->tile_storage->tile_width * output->tile_storage->tile_height);
             }
             else
             {
@@ -325,7 +327,7 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
             if (aux2_buf_format != aux2_format)
             {
               thread_data[j].aux2_fish = babl_fish (aux2_buf_format, aux2_format);
-              thread_data[j].aux2_tmp = gegl_temp_buffer (temp_id++, aux2_bpp * result->width * 
result->height);
+              thread_data[j].aux2_tmp = gegl_temp_buffer (temp_id++, aux2_bpp * 
output->tile_storage->tile_width * output->tile_storage->tile_height);
             }
             else
             {
@@ -344,7 +346,7 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
           if (output_buf_format != gegl_buffer_get_format (output))
           {
             thread_data[j].output_fish = babl_fish (out_format, output_buf_format);
-            thread_data[j].output_tmp = gegl_temp_buffer (temp_id++, out_bpp * result->width * 
result->height);
+            thread_data[j].output_tmp = gegl_temp_buffer (temp_id++, out_bpp * 
output->tile_storage->tile_width * output->tile_storage->tile_height);
           }
           else
           {
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 18118bc..49679d0 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -27,6 +27,8 @@
 #include "gegl-operation-context.h"
 #include "gegl-config.h"
 #include "gegl-types-internal.h"
+#include "gegl-buffer-private.h"
+#include "gegl-tile-storage.h"
 #include <sys/types.h>
 #include <unistd.h>
 #include <string.h>
@@ -312,7 +314,7 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
             if (in_buf_format != in_format)
             {
               thread_data[j].input_fish = babl_fish (in_buf_format, in_format);
-              thread_data[j].in_tmp = gegl_temp_buffer (temp_id++, in_bpp * result->width * result->height);
+              thread_data[j].in_tmp = gegl_temp_buffer (temp_id++, in_bpp * output->tile_storage->tile_width 
* output->tile_storage->tile_height);
             }
             else
             {
@@ -329,7 +331,7 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
           if (output_buf_format != gegl_buffer_get_format (output))
           {
             thread_data[j].output_fish = babl_fish (out_format, output_buf_format);
-            thread_data[j].output_tmp = gegl_temp_buffer (temp_id++, out_bpp * result->width * 
result->height);
+            thread_data[j].output_tmp = gegl_temp_buffer (temp_id++, out_bpp * 
output->tile_storage->tile_width * output->tile_storage->tile_height);
           }
           else
           {


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