summaryrefslogtreecommitdiff
path: root/include/fitz/math.h
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-11-15 07:50:43 +0100
committerTor Andersson <tor@ghostscript.com>2004-11-15 07:50:43 +0100
commit01a774064e13cebc9a75e44432226d845fa46f9a (patch)
treee817e8ad3d4fa2d4bb52f1ac543c9b932b40d657 /include/fitz/math.h
parent67781c58fef0f94ea234341cea8e7e13646bc4a2 (diff)
downloadmupdf-01a774064e13cebc9a75e44432226d845fa46f9a.tar.xz
render optimizations
Diffstat (limited to 'include/fitz/math.h')
-rw-r--r--include/fitz/math.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/fitz/math.h b/include/fitz/math.h
index 30577691..b2f1bf24 100644
--- a/include/fitz/math.h
+++ b/include/fitz/math.h
@@ -1,24 +1,18 @@
/* multiply 8-bit fixpoint (0..1) so that 0*0==0 and 255*255==255 */
static inline unsigned char fz_mul255(unsigned char a, unsigned char b)
{
- return ((a + 1) * b) >> 8;
+ return (a * ((unsigned int)b + 1)) >> 8;
}
/* floor / ceil towards/from +/- inf */
static inline float fz_floor(float x)
{
return floor(x);
-// if (x > 0)
-// return floor(x);
-// return ceil(x);
}
static inline float fz_ceil(float x)
{
return ceil(x);
-// if (x > 0)
-// return ceil(x);
-// return floor(x);
}
/* divide and floor towards -inf */