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"))
/* 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)
#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);
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);