summaryrefslogtreecommitdiff
path: root/libopenjpeg
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2005-01-03 17:39:30 +0000
committerAntonin Descampe <antonin@gmail.com>2005-01-03 17:39:30 +0000
commitbfb2f9f58bfa179785e9b67d21b2ea4d98d6ef8e (patch)
treebf4e94858af861476899b3500b72b91ba4e393c9 /libopenjpeg
parent13b8ecfe44e9d3f5b1a31626ed44099a0224dd01 (diff)
Luke Lee optimization for fix_mul... Thanks to him
Diffstat (limited to 'libopenjpeg')
-rw-r--r--libopenjpeg/fix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libopenjpeg/fix.c b/libopenjpeg/fix.c
index 77ca6d63..4a5f91e6 100644
--- a/libopenjpeg/fix.c
+++ b/libopenjpeg/fix.c
@@ -43,6 +43,7 @@
//}
//Mod Antonin : multbug1
+/*
int fix_mul(int a, int b)
{
double tmp= (double) ((int64) a * (int64) b);
@@ -50,5 +51,12 @@ int fix_mul(int a, int b)
v = (tmp<0)?-v:v;
return (int) v;
}
+*/
//doM
+int fix_mul(int a, int b) // Luke Lee optimized : 11/16/2004
+{
+ int64 temp = (int64) a * (int64) b >> 12;
+ return (int) ((temp >> 1) + (temp & 1)) ;
+}
+