diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-04-05 14:24:19 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-04-05 14:24:19 +0000 |
| commit | 0930d9886b52a4d4f46162cc0c7c292cfd393ebd (patch) | |
| tree | 797451546350afcc39411a2af7dd514d58b3232b /libopenjpeg/fix.h | |
| parent | dd18811600365adc935a5f72d985bac43a01377f (diff) | |
fix.h, dwt.c and t1.c optimized. Thanks a lot to Dzonatas <dzonatas at dzonux.net> and Callum Lerwick <seg at haxxed.com> for these great patches !
Diffstat (limited to 'libopenjpeg/fix.h')
| -rw-r--r-- | libopenjpeg/fix.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libopenjpeg/fix.h b/libopenjpeg/fix.h index 6ae112c9..bcb2acb5 100644 --- a/libopenjpeg/fix.h +++ b/libopenjpeg/fix.h @@ -54,8 +54,9 @@ Multiply two fixed-precision rational numbers. @return Returns a * b */ static INLINE int fix_mul(int a, int b) { - int64 temp = (int64) a * (int64) b >> 12; - return (int) ((temp >> 1) + (temp & 1)) ; + int64 temp = (int64) a * (int64) b ; + temp += temp & 4096; + return (int) (temp >> 13) ; } /*@}*/ |
