diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-11-15 07:50:43 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-11-15 07:50:43 +0100 |
commit | 01a774064e13cebc9a75e44432226d845fa46f9a (patch) | |
tree | e817e8ad3d4fa2d4bb52f1ac543c9b932b40d657 /include/fitz/math.h | |
parent | 67781c58fef0f94ea234341cea8e7e13646bc4a2 (diff) | |
download | mupdf-01a774064e13cebc9a75e44432226d845fa46f9a.tar.xz |
render optimizations
Diffstat (limited to 'include/fitz/math.h')
-rw-r--r-- | include/fitz/math.h | 8 |
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 */ |