diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 00:04:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 00:04:55 +0400 |
commit | e1241030db424ce10e9fee04076ff7e209eac98c (patch) | |
tree | ac8e1a81a81fa130e166366c6b93587e77e4188f /source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp | |
parent | 7fec7070d7fcf7bde53768e555b40b57ef4a7552 (diff) |
yse BLI_math for the compositor in more places.
Diffstat (limited to 'source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index c7da43fc20f..c0561704596 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -95,18 +95,11 @@ void GaussianYBlurOperation::executePixel(float *color, int x, int y, MemoryBuff for (int ny = miny ; ny < maxy ; ny +=step) { index = (ny-y)+this->rad; int bufferindex = ((minx - bufferstartx)*4)+((ny-bufferstarty)*4*bufferwidth); - float multiplyer = gausstab[index]; - tempColor[0] += multiplyer * buffer[bufferindex]; - tempColor[1] += multiplyer * buffer[bufferindex+1]; - tempColor[2] += multiplyer * buffer[bufferindex+2]; - tempColor[3] += multiplyer * buffer[bufferindex+3]; + const float multiplyer = gausstab[index]; + madd_v4_v4fl(tempColor, &buffer[bufferindex], multiplyer); overallmultiplyer += multiplyer; } - float divider = 1.0f / overallmultiplyer; - color[0] = tempColor[0] * divider; - color[1] = tempColor[1] * divider; - color[2] = tempColor[2] * divider; - color[3] = tempColor[3] * divider; + mul_v4_v4fl(color, tempColor, 1.0f / overallmultiplyer); } void GaussianYBlurOperation::deinitExecution() |