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
This commit is contained in:
Manuel Castilla 2020-11-13 08:19:39 +01:00 committed by Jeroen Bakker
parent db7d8281c5
commit 4dc5920525
1 changed files with 0 additions and 3 deletions

View File

@ -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;
}