[Bf-blender-cvs] [a7307edbe1b] temp-lineart-contained: Fix CalculateStandardDeviationOperation incorrect results for R G B channels

Manuel Castilla noreply at git.blender.org
Sat Dec 19 06:18:50 CET 2020


Commit: a7307edbe1b5aa51a7d4f6604efa93b20db9b036
Author: Manuel Castilla
Date:   Fri Nov 13 08:19:39 2020 +0100
Branches: temp-lineart-contained
https://developer.blender.org/rBa7307edbe1b5aa51a7d4f6604efa93b20db9b036

Fix CalculateStandardDeviationOperation incorrect results for R G B channels

Standard deviation formula wasn't being applied correctly when selecting
R G B cases. Issue is there since Blender 2.64 as it was incorrectly
ported over from the previous compositor.

Reviewed By: Sergey Sharybin, Jeroen Bakker

Differential Revision: https://developer.blender.org/D9384

===================================================================

M	source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
index 9ef77b9e5ea..9a1e48177ed 100644
--- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
+++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
@@ -61,21 +61,18 @@ void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect)
           case 2: /* red */
           {
             float value = buffer[offset];
-            sum += value;
             sum += (value - mean) * (value - mean);
             break;
           }
           case 3: /* green */
           {
             float value = buffer[offset + 1];
-            sum += value;
             sum += (value - mean) * (value - mean);
             break;
           }
           case 4: /* blue */
           {
             float value = buffer[offset + 2];
-            sum += value;
             sum += (value - mean) * (value - mean);
             break;
           }



More information about the Bf-blender-cvs mailing list