diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2015-01-19 20:13:26 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2015-01-19 20:17:50 +0300 |
commit | 35d3b6316b21ad9ae7eb96a7a541c4051eae3441 (patch) | |
tree | dd4eea63f9229d87041e2f5a5679d05f1360afea /source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp | |
parent | a8fa291b8c539da7669463ef622d5c61ee9c90e7 (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_GaussianAlphaXBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp index c78347e7b1c..dde57ab640f 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp @@ -102,15 +102,14 @@ void GaussianAlphaXBlurOperation::executePixel(float output[4], int x, int y, vo /* *** this is the main part which is different to 'GaussianXBlurOperation' *** */ int step = getStep(); - int offsetadd = getOffsetAdd(); - int bufferindex = ((xmin - bufferstartx) * 4) + ((ymin - bufferstarty) * 4 * bufferwidth); + int bufferindex = ((xmin - bufferstartx)) + ((ymin - bufferstarty) * bufferwidth); /* gauss */ float alpha_accum = 0.0f; float multiplier_accum = 0.0f; /* dilate */ - float value_max = finv_test(buffer[(x * 4) + (y * 4 * bufferwidth)], do_invert); /* init with the current color to avoid unneeded lookups */ + float value_max = finv_test(buffer[(x) + (y * bufferwidth)], do_invert); /* init with the current color to avoid unneeded lookups */ float distfacinv_max = 1.0f; /* 0 to 1 */ for (int nx = xmin; nx < xmax; nx += step) { @@ -134,7 +133,7 @@ void GaussianAlphaXBlurOperation::executePixel(float output[4], int x, int y, vo distfacinv_max = multiplier; } } - bufferindex += offsetadd; + bufferindex += step; } /* blend between the max value and gauss blue - gives nice feather */ |