summaryrefslogtreecommitdiff
path: root/libavfilter/vf_blend.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-22 20:49:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-22 20:49:00 +0200
commit9b33cdcab211a773feab8d58819aa08a16c318f8 (patch)
tree9af3942cd95a3fe2c36ac75d302f44e38ef89a01 /libavfilter/vf_blend.c
parent31f77b46b2fae919e1977b0dcee38d9c4e23cf18 (diff)
avfilter/vf_blend: fix macro ()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_blend.c')
-rw-r--r--libavfilter/vf_blend.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index d422a9c94a..8bf19ffd50 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -179,10 +179,10 @@ static void blend_## name(const uint8_t *top, int top_linesize, \
#define A top[j]
#define B bottom[j]
-#define MULTIPLY(x, a, b) (x * ((a * b) / 255))
-#define SCREEN(x, a, b) (255 - x * ((255 - a) * (255 - b) / 255))
-#define BURN(a, b) ((a == 0) ? a : FFMAX(0, 255 - ((255 - b) << 8) / a))
-#define DODGE(a, b) ((a == 255) ? a : FFMIN(255, ((b << 8) / (255 - a))))
+#define MULTIPLY(x, a, b) ((x) * (((a) * (b)) / 255))
+#define SCREEN(x, a, b) (255 - (x) * ((255 - (a)) * (255 - (b)) / 255))
+#define BURN(a, b) (((a) == 0) ? (a) : FFMAX(0, 255 - ((255 - (b)) << 8) / (a)))
+#define DODGE(a, b) (((a) == 255) ? (a) : FFMIN(255, (((b) << 8) / (255 - (a)))))
DEFINE_BLEND(addition, FFMIN(255, A + B))
DEFINE_BLEND(average, (A + B) / 2)