From c8c6acfa08a280e6eabd89eb7a2fedd95b4d2f48 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 4 Dec 2010 17:31:05 +0000 Subject: The FZ_COMBINE2 rounding fix doesn't work. Implement it the other way (round then add). --- fitz/fitz.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fitz') diff --git a/fitz/fitz.h b/fitz/fitz.h index 37bffbc5..a2803899 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -197,7 +197,7 @@ static inline int fz_mul255(int a, int b) /* Combine values A and C (in the same (any) range) and B and D (in the * 0..256 range), to give a single value in the same range as A and C were. */ -#define FZ_COMBINE2(A,B,C,D) (((A)*(B)+(C)*(D))>>8) +#define FZ_COMBINE2(A,B,C,D) (FZ_COMBINE((A), (B)) + FZ_COMBINE((C), (D))) /* Blend SRC and DST (in the same range) together according to * AMOUNT (in the 0...256 range). */ -- cgit v1.2.3