New ("fullframe") CPU compositor backend is being used now, and all the code
related to "tiled" CPU compositor is just never used anymore. The new backend
is faster, uses less memory, better matches GPU compositor, etc.
TL;DR: 20 thousand lines of code gone.
This commit:
- Removes various bits and pieces related to "tiled" compositor (execution
groups, one-pixel-at-a-time node processing, read/write buffer operations
related to node execution groups).
- "GPU" (OpenCL) execution device, that was only used by several nodes of
the tiled compositor.
- With that, remove CLEW external library too, since nothing within Blender
uses OpenCL directly anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/118819
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "COM_CalculateStandardDeviationOperation.h"
|
|
|
|
#include "COM_ExecutionSystem.h"
|
|
|
|
#include "IMB_colormanagement.hh"
|
|
|
|
namespace blender::compositor {
|
|
|
|
float CalculateStandardDeviationOperation::calculate_value(const MemoryBuffer *input) const
|
|
{
|
|
const float mean = this->calculate_mean(input);
|
|
|
|
PixelsSum total = {0};
|
|
exec_system_->execute_work<PixelsSum>(
|
|
input->get_rect(),
|
|
[=](const rcti &split) { return this->calc_area_sum(input, split, mean); },
|
|
total,
|
|
[](PixelsSum &join, const PixelsSum &chunk) {
|
|
join.sum += chunk.sum;
|
|
join.num_pixels += chunk.num_pixels;
|
|
});
|
|
|
|
return total.num_pixels <= 1 ? 0.0f : sqrt(total.sum / float(total.num_pixels - 1));
|
|
}
|
|
|
|
using PixelsSum = CalculateMeanOperation::PixelsSum;
|
|
PixelsSum CalculateStandardDeviationOperation::calc_area_sum(const MemoryBuffer *input,
|
|
const rcti &area,
|
|
const float mean) const
|
|
{
|
|
PixelsSum result = {0};
|
|
for (const float *elem : input->get_buffer_area(area)) {
|
|
if (elem[3] <= 0.0f) {
|
|
continue;
|
|
}
|
|
const float value = setting_func_(elem);
|
|
result.sum += (value - mean) * (value - mean);
|
|
result.num_pixels++;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
} // namespace blender::compositor
|