summaryrefslogtreecommitdiff
path: root/trunk/turbojpegl.c
diff options
context:
space:
mode:
authordcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2010-02-22 08:34:44 +0000
committerdcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2010-02-22 08:34:44 +0000
commitb46064256f56358ace22030fe82a5c4fa90ada25 (patch)
tree8ed8c3d61bf44b0470400de6a26e92feee303fa3 /trunk/turbojpegl.c
parentd61d547716d7da1e07b8b6b234928f1b893bc1e3 (diff)
Make TJ_FORCE* options work correctly
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@138 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'trunk/turbojpegl.c')
-rw-r--r--trunk/turbojpegl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/trunk/turbojpegl.c b/trunk/turbojpegl.c
index 82acf23..f5f0db1 100644
--- a/trunk/turbojpegl.c
+++ b/trunk/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);
@@ -287,6 +291,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);