*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
- * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
+ * Copyright (C) 2009-2011, 2013-2014, 2016, 2018, D. R. Commander.
* Copyright (C) 2015-2016, Matthieu Darbois.
*
* Based on the x86 SIMD extension for IJG JPEG library,
LOCAL(void)
init_simd (void)
{
+#ifndef NO_GETENV
char *env = NULL;
+#endif
#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
int bufsize = 1024; /* an initial guess for the line buffer size limit */
#endif
}
#endif
+#ifndef NO_GETENV
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCENEON");
if ((env != NULL) && (strcmp(env, "1") == 0))
env = getenv("JSIMD_NOHUFFENC");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_huffman = 0;
+#endif
}
GLOBAL(int)
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
- * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
+ * Copyright (C) 2009-2011, 2013-2014, 2016, 2018, D. R. Commander.
* Copyright (C) 2015-2016, Matthieu Darbois.
*
* Based on the x86 SIMD extension for IJG JPEG library,
LOCAL(void)
init_simd (void)
{
+#ifndef NO_GETENV
char *env = NULL;
+#endif
#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
int bufsize = 1024; /* an initial guess for the line buffer size limit */
#endif
}
#endif
+#ifndef NO_GETENV
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCENEON");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_features |= JSIMD_FASTST3;
if ((env != NULL) && (strcmp(env, "0") == 0))
simd_features &= ~JSIMD_FASTST3;
+#endif
}
GLOBAL(int)
* jsimd_i386.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
- * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
+ * Copyright (C) 2009-2011, 2013-2014, 2016, 2018, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
*
* Based on the x86 SIMD extension for IJG JPEG library,
LOCAL(void)
init_simd (void)
{
+#ifndef NO_GETENV
char *env = NULL;
+#endif
if (simd_support != ~0U)
return;
simd_support = jpeg_simd_cpu_support();
+#ifndef NO_GETENV
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCEMMX");
if ((env != NULL) && (strcmp(env, "1") == 0))
env = getenv("JSIMD_NOHUFFENC");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_huffman = 0;
+#endif
}
GLOBAL(int)
* jsimd_mips.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
- * Copyright (C) 2009-2011, 2014, 2016, D. R. Commander.
+ * Copyright (C) 2009-2011, 2014, 2016, 2018, D. R. Commander.
* Copyright (C) 2013-2014, MIPS Technologies, Inc., California.
* Copyright (C) 2015, Matthieu Darbois.
*
LOCAL(void)
init_simd (void)
{
+#ifndef NO_GETENV
char *env = NULL;
+#endif
if (simd_support != ~0U)
return;
return;
#endif
+#ifndef NO_GETENV
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCEDSPR2");
if ((env != NULL) && (strcmp(env, "1") == 0))
env = getenv("JSIMD_FORCENONE");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = 0;
+#endif
}
static const int mips_idct_ifast_coefs[4] = {
* jsimd_powerpc.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
- * Copyright (C) 2009-2011, 2014-2016, D. R. Commander.
+ * Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
*
* Based on the x86 SIMD extension for IJG JPEG library,
LOCAL(void)
init_simd (void)
{
+#ifndef NO_GETENV
char *env = NULL;
+#endif
#if !defined(__ALTIVEC__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
int bufsize = 1024; /* an initial guess for the line buffer size limit */
#elif defined(__amigaos4__)
simd_support |= JSIMD_ALTIVEC;
#endif
+#ifndef NO_GETENV
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCEALTIVEC");
if ((env != NULL) && (strcmp(env, "1") == 0))
env = getenv("JSIMD_FORCENONE");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = 0;
+#endif
}
GLOBAL(int)
* jsimd_x86_64.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
- * Copyright (C) 2009-2011, 2014, 2016, D. R. Commander.
+ * Copyright (C) 2009-2011, 2014, 2016, 2018, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
*
* Based on the x86 SIMD extension for IJG JPEG library,
LOCAL(void)
init_simd (void)
{
+#ifndef NO_GETENV
char *env = NULL;
+#endif
if (simd_support != ~0U)
return;
simd_support = JSIMD_SSE2 | JSIMD_SSE;
+#ifndef NO_GETENV
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCENONE");
if ((env != NULL) && (strcmp(env, "1") == 0))
env = getenv("JSIMD_NOHUFFENC");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_huffman = 0;
+#endif
}
GLOBAL(int)
/*
- * Copyright (C)2009-2017 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2009-2018 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
cinfo->image_width=width;
cinfo->image_height=height;
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if(flags&TJFLAG_NOREALLOC)
{
cinfo->image_width=width;
cinfo->image_height=height;
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
cinfo->image_width=width;
cinfo->image_height=height;
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if(flags&TJFLAG_NOREALLOC)
{
|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)
_throw("tjDecompress2(): Invalid argument");
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if(setjmp(this->jerr.setjmp_buffer))
{
dinfo->image_width=width;
dinfo->image_height=height;
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
{
|| height<0)
_throw("tjDecompressToYUVPlanes(): Invalid argument");
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if(setjmp(this->jerr.setjmp_buffer))
{
|| t==NULL || flags<0)
_throw("tjTransform(): Invalid argument");
+#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
+#endif
if((xinfo=(jpeg_transform_info *)malloc(sizeof(jpeg_transform_info)*n))
==NULL)