Patch for a Windows x64 build of OpenJPEG

368 مرّة مشاهدة
التخطي إلى أول رسالة غير مقروءة

cy...@nuclex.org

غير مقروءة،
05‏/04‏/2008، 10:24:33 ص5‏/4‏/2008
إلى OpenJPEG
Hi!

I'm trying to compile OpenJPEG for the Windows x64 platform. The only
thing that has caused trouble until now is the inline assembler code
in opj_includes.h.

Here's a patch that makes OpenJPEG compile on Windows x64 for me:

--- libopenjpeg\opj_includes.original.h Tue Nov 13 19:35:12 2007
+++ libopenjpeg\opj_includes.h Fri Apr 04 12:40:50 2008
@@ -89,6 +89,9 @@
/* MSVC does not have lrintf */
#ifdef _MSC_VER
static INLINE long lrintf(float f){
+#ifdef _M_X64
+ return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
+#else
int i;

_asm{
@@ -97,6 +100,7 @@
};

return i;
+#endif
}
#endif

-Markus-

Colby Dillion

غير مقروءة،
05‏/04‏/2008، 9:40:23 م5‏/4‏/2008
إلى OpenJPEG
Hi Markus,

I was having the same problem getting the library compiled under
Win64. I originally wrote something very close to what you have. In
the end I ended up with the code below. It was faster, but not as
fast as 32-bit mode.

#ifdef _M_X64
#include <emmintrin.h>
static INLINE long lrintf(float f) {
return _mm_cvtss_si32(_mm_load_ss(&f));
}
#else

Colby
الرد على الكل
رد على الكاتب
إعادة توجيه
0 رسالة جديدة