diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-11-13 17:35:12 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-11-13 17:35:12 +0000 |
| commit | dbeebe72b9d35f6ff807c21c7f217b569fa894f6 (patch) | |
| tree | d9ecfc6b2eba42119552405212cceea2a72b26a1 /libopenjpeg/opj_includes.h | |
| parent | 014694b04f94ff0844a91244b8242f9d09af656d (diff) | |
Patch by Dzonatas and Callum Lerwick. Fp/vectorization patch which basically converts most of the irreversible decode codepath to floating point, eliminating a few rounds of int/fp conversion, resulting in a vast performance improvement, and an increase in accuracy.
Diffstat (limited to 'libopenjpeg/opj_includes.h')
| -rw-r--r-- | libopenjpeg/opj_includes.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libopenjpeg/opj_includes.h b/libopenjpeg/opj_includes.h index 7599a71f..80d43df9 100644 --- a/libopenjpeg/opj_includes.h +++ b/libopenjpeg/opj_includes.h @@ -76,6 +76,30 @@ Most compilers implement their own version of this keyword ... #endif /* defined(<Compiler>) */ #endif /* INLINE */ +/* Are restricted pointers available? (C99) */ +#if (__STDC_VERSION__ != 199901L) + /* Not a C99 compiler */ + #ifdef __GNUC__ + #define restrict __restrict__ + #else + #define restrict /* restrict */ + #endif +#endif + +/* MSVC does not have lrintf */ +#ifdef _MSC_VER +static INLINE long lrintf(float f){ + int i; + + _asm{ + fld f + fistp i + }; + + return i; +} +#endif + #include "j2k_lib.h" #include "opj_malloc.h" #include "event.h" |
