aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-07-14 00:44:45 +0200
committerMattias Andrée <maandree@kth.se>2017-07-14 00:44:45 +0200
commitb384c0cc8c69783495e1f21f3fd0f3e6253645b1 (patch)
tree8fb3f1bce50bdbdcb7eba14d09a52844b3ff223a /src
parentAdd blind-mosaic-edges (diff)
downloadblind-b384c0cc8c69783495e1f21f3fd0f3e6253645b1.tar.gz
blind-b384c0cc8c69783495e1f21f3fd0f3e6253645b1.tar.bz2
blind-b384c0cc8c69783495e1f21f3fd0f3e6253645b1.tar.xz
Improve performance of blind-stack
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/blind-stack.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/blind-stack.c b/src/blind-stack.c
index bff2923..c317bf5 100644
--- a/src/blind-stack.c
+++ b/src/blind-stack.c
@@ -20,10 +20,11 @@ USAGE("[-bs] bottom-stream ... top-stream")
a2 = ((TYPE *)(streams[j].buf + i))[3];\
if (BLEND)\
a2 /= (TYPE)(j + 1);\
- x1 = x1 * a1 * (1 - a2) + x2 * a2;\
- y1 = y1 * a1 * (1 - a2) + y2 * a2;\
- z1 = z1 * a1 * (1 - a2) + z2 * a2;\
- a1 = a1 * (1 - a2) + a2;\
+ a1 *= 1 - a2;\
+ x1 = x1 * a1 + x2 * a2;\
+ y1 = y1 * a1 + y2 * a2;\
+ z1 = z1 * a1 + z2 * a2;\
+ a1 += a2;\
}\
((TYPE *)(streams[0].buf + i))[0] = x1;\
((TYPE *)(streams[0].buf + i))[1] = y1;\