diff options
author | DRC <dcommander@users.sourceforge.net> | 2010-02-26 23:30:15 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2010-02-26 23:30:15 +0000 |
commit | a10f2f8e31fa7ecfa85dc0f713e5b5daa0b57d16 (patch) | |
tree | b4589c75437dc6bc05081b84e6dd04980897cfa4 /common/jpeg | |
parent | da73d26e04a87270e20c944351235a1f64777761 (diff) | |
download | tigervnc-a10f2f8e31fa7ecfa85dc0f713e5b5daa0b57d16.tar.gz tigervnc-a10f2f8e31fa7ecfa85dc0f713e5b5daa0b57d16.zip |
Make TJ_FORCE* work properly
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3998 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/jpeg')
-rw-r--r-- | common/jpeg/jpgtest.cxx | 8 | ||||
-rw-r--r-- | common/jpeg/simd/jsimd_i386.c | 8 | ||||
-rw-r--r-- | common/jpeg/turbojpegl.c | 8 |
3 files changed, 16 insertions, 8 deletions
diff --git a/common/jpeg/jpgtest.cxx b/common/jpeg/jpgtest.cxx index da0ef93f..b1c5e1a0 100644 --- a/common/jpeg/jpgtest.cxx +++ b/common/jpeg/jpgtest.cxx @@ -322,22 +322,22 @@ int main(int argc, char *argv[]) if(!stricmp(argv[i], "-tile")) dotile=1; if(!stricmp(argv[i], "-forcesse3")) { - printf("Using SSE3 code in Intel compressor\n"); + printf("Using SSE3 code\n"); forcesse3=1; } if(!stricmp(argv[i], "-forcesse2")) { - printf("Using SSE2 code in Intel compressor\n"); + printf("Using SSE2 code\n"); forcesse2=1; } if(!stricmp(argv[i], "-forcesse")) { - printf("Using SSE code in Intel compressor\n"); + printf("Using SSE code\n"); forcesse=1; } if(!stricmp(argv[i], "-forcemmx")) { - printf("Using MMX code in Intel compressor\n"); + printf("Using MMX code\n"); forcemmx=1; } if(!stricmp(argv[i], "-fastupsample")) diff --git a/common/jpeg/simd/jsimd_i386.c b/common/jpeg/simd/jsimd_i386.c index f5aec18b..ed1339b2 100644 --- a/common/jpeg/simd/jsimd_i386.c +++ b/common/jpeg/simd/jsimd_i386.c @@ -48,16 +48,16 @@ init_simd (void) /* Force different settings through environment variables */ env = getenv("JSIMD_FORCEMMX"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support &= JSIMD_MMX; + simd_support = JSIMD_MMX; env = getenv("JSIMD_FORCE3DNOW"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support &= JSIMD_3DNOW; + simd_support = JSIMD_3DNOW|JSIMD_MMX; env = getenv("JSIMD_FORCESSE"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support &= JSIMD_SSE; + simd_support = JSIMD_SSE|JSIMD_MMX; env = getenv("JSIMD_FORCESSE2"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support &= JSIMD_SSE2; + simd_support = JSIMD_SSE2; } GLOBAL(int) diff --git a/common/jpeg/turbojpegl.c b/common/jpeg/turbojpegl.c index 68dd35d6..2150a2d3 100644 --- a/common/jpeg/turbojpegl.c +++ b/common/jpeg/turbojpegl.c @@ -149,6 +149,10 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h, #error "TurboJPEG requires JPEG colorspace extensions" #endif + if(flags&TJ_FORCEMMX) putenv("JSIMD_FORCEMMX=1"); + else if(flags&TJ_FORCESSE) putenv("JSIMD_FORCESSE=1"); + else if(flags&TJ_FORCESSE2) putenv("JSIMD_FORCESSE2=1"); + if(setjmp(j->jerr.jb)) { // this will execute if LIBJPEG has an error if(row_pointer) free(row_pointer); @@ -288,6 +292,10 @@ DLLEXPORT int DLLCALL tjDecompress(tjhandle h, if(pitch==0) pitch=width*ps; + if(flags&TJ_FORCEMMX) putenv("JSIMD_FORCEMMX=1"); + else if(flags&TJ_FORCESSE) putenv("JSIMD_FORCESSE=1"); + else if(flags&TJ_FORCESSE2) putenv("JSIMD_FORCESSE2=1"); + if(setjmp(j->jerr.jb)) { // this will execute if LIBJPEG has an error if(row_pointer) free(row_pointer); |