Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2015-01-19 20:13:26 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2015-01-19 20:17:50 +0300
commit35d3b6316b21ad9ae7eb96a7a541c4051eae3441 (patch)
treedd4eea63f9229d87041e2f5a5679d05f1360afea /source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
parenta8fa291b8c539da7669463ef622d5c61ee9c90e7 (diff)
D627: Memory usage optimization for the compositor.
The compostor used a fixed size of 4 floats to hold pixel data. this patch will select size of a pixel based on its type. It uses 1 float for Value, 3 float for vector and 4 floats for color data types. When benchmarking on shots (opening shot of caminandes) we get a reduction of memory of 30% and a tiny speedup as less data transformations needs to take place (but these are negligable. More information of the patch can be found on https://developer.blender.org/D627 and http://wiki.blender.org/index.php/Dev:Ref/Proposals/Compositor2014_p1.1_TD Developers: jbakker & mdewanchand Thanks for Sergey for his indept review.
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_KeyingBlurOperation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
index ddc09ecb483..72c7512cb23 100644
--- a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
@@ -58,7 +58,7 @@ void KeyingBlurOperation::executePixel(float output[4], int x, int y, void *data
const int start = max(0, x - this->m_size + 1),
end = min(bufferWidth, x + this->m_size);
for (int cx = start; cx < end; ++cx) {
- int bufferIndex = (y * bufferWidth + cx) * 4;
+ int bufferIndex = (y * bufferWidth + cx);
average += buffer[bufferIndex];
count++;
}
@@ -67,7 +67,7 @@ void KeyingBlurOperation::executePixel(float output[4], int x, int y, void *data
const int start = max(0, y - this->m_size + 1),
end = min(inputBuffer->getHeight(), y + this->m_size);
for (int cy = start; cy < end; ++cy) {
- int bufferIndex = (cy * bufferWidth + x) * 4;
+ int bufferIndex = (cy * bufferWidth + x);
average += buffer[bufferIndex];
count++;
}