summaryrefslogtreecommitdiff
path: root/libopenjpeg/fix.h
diff options
context:
space:
mode:
authorFreeimage <freeimage@aliceadsl.fr>2006-02-01 21:25:11 +0000
committerFreeimage <freeimage@aliceadsl.fr>2006-02-01 21:25:11 +0000
commit8d7b0c9c0564514d7edd36e8cc260a267c7d4213 (patch)
tree96dc1e56c0d55b58b4c5a9f14f75ae240e2b9083 /libopenjpeg/fix.h
parent33b5757921fd177c063e1b885f6816bc0350664c (diff)
changed function definitions of INT and FIX modules to 'inline'
Diffstat (limited to 'libopenjpeg/fix.h')
-rw-r--r--libopenjpeg/fix.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/libopenjpeg/fix.h b/libopenjpeg/fix.h
index b5b62e67..9dd5839a 100644
--- a/libopenjpeg/fix.h
+++ b/libopenjpeg/fix.h
@@ -29,11 +29,18 @@
*/
#ifndef __FIX_H
#define __FIX_H
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#define int64 __int64
+#else
+#define int64 long long
+#endif
+
/**
@file fix.h
@brief Implementation of operations of specific multiplication (FIX)
-The functions in FIX.C have for goal to realize specific multiplication.
+The functions in FIX.H have for goal to realize specific multiplication.
*/
/** @defgroup FIX FIX - Implementation of operations of specific multiplication */
@@ -45,7 +52,10 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
-int fix_mul(int a, int b);
+INLINE int fix_mul(int a, int b) {
+ int64 temp = (int64) a * (int64) b >> 12;
+ return (int) ((temp >> 1) + (temp & 1)) ;
+}
/*@}*/