diff options
-rw-r--r-- | source/blender/blenkernel/intern/seqmodifier.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c index 9ea405ef636..a64a4895e9b 100644 --- a/source/blender/blenkernel/intern/seqmodifier.c +++ b/source/blender/blenkernel/intern/seqmodifier.c @@ -237,9 +237,9 @@ static void curves_apply_threaded(int width, int height, unsigned char *rect, fl rgb_uchar_to_float(t, mask_rect + pixel_index); - tempc[0] = pixel[0] * (1.0f - t[0]) + result[0] * t[0]; - tempc[1] = pixel[1] * (1.0f - t[1]) + result[1] * t[1]; - tempc[2] = pixel[2] * (1.0f - t[2]) + result[2] * t[2]; + tempc[0] = tempc[0] * (1.0f - t[0]) + result[0] * t[0]; + tempc[1] = tempc[1] * (1.0f - t[1]) + result[1] * t[1]; + tempc[2] = tempc[2] * (1.0f - t[2]) + result[2] * t[2]; } else { tempc[0] = result[0]; @@ -438,7 +438,7 @@ static void brightcontrast_apply_threaded(int width, int height, unsigned char * unsigned char *m = mask_rect + pixel_index; float t = (float) m[c] / 255.0f; - v = (float) pixel[c] * (1.0f - t) + v * t; + v = (float) pixel[c] / 255.0f * (1.0f - t) + v * t; } pixel[c] = FTOCHAR(v); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 68618287546..b0a65d23d93 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1544,8 +1544,11 @@ static void color_balance_byte_byte(StripColorBalance *cb_, unsigned char *rect, for (c = 0; c < 3; c++) { float t = color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul); - if (m) - p[c] = p[c] * (1.0f - (float)m[c] / 255.0f) + t * m[c]; + if (m) { + float m_normal = (float) m[c] / 255.0f; + + p[c] = p[c] * (1.0f - m_normal) + t * m_normal; + } else p[c] = t; } |