Skip to content

Commit 84fbd4f

Browse files
committed
Merge branch 'master' into dev
2 parents 29e453f + bd96b30 commit 84fbd4f

File tree

11 files changed

+52
-7
lines changed

11 files changed

+52
-7
lines changed

Diff for: ChangeLog.md

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ When using the slow integer DCT/IDCT, this speeds up the compression of RGB
119119
images by approximately 70-100% and the decompression of RGB images by
120120
approximately 2-3.5x.
121121

122+
14. Fixed a build error when building with older MinGW releases (regression
123+
caused by 1.5.1[7].)
124+
122125

123126
1.5.3
124127
=====

Diff for: jmemmgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "jinclude.h"
3333
#include "jpeglib.h"
3434
#include "jmemsys.h" /* import the system-dependent declarations */
35-
#ifndef _WIN32
35+
#if !defined(_MSC_VER) || _MSC_VER > 1600
3636
#include <stdint.h>
3737
#endif
3838
#include <limits.h>

Diff for: release/installer.nsi.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!include x64.nsh
22
Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@"
33
OutFile "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}@[email protected]"
4-
InstallDir @INST_DIR@
4+
InstallDir "@INST_DIR@"
55

66
SetCompressor bzip2
77

Diff for: simd/arm/jsimd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2009 Pierre Ossman <[email protected]> for Cendio AB
55
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
6-
* Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
6+
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, D. R. Commander.
77
* Copyright (C) 2015-2016, Matthieu Darbois.
88
*
99
* Based on the x86 SIMD extension for IJG JPEG library,
@@ -102,7 +102,9 @@ parse_proc_cpuinfo(int bufsize)
102102
LOCAL(void)
103103
init_simd(void)
104104
{
105+
#ifndef NO_GETENV
105106
char *env = NULL;
107+
#endif
106108
#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
107109
int bufsize = 1024; /* an initial guess for the line buffer size limit */
108110
#endif
@@ -125,6 +127,7 @@ init_simd(void)
125127
}
126128
#endif
127129

130+
#ifndef NO_GETENV
128131
/* Force different settings through environment variables */
129132
env = getenv("JSIMD_FORCENEON");
130133
if ((env != NULL) && (strcmp(env, "1") == 0))
@@ -135,6 +138,7 @@ init_simd(void)
135138
env = getenv("JSIMD_NOHUFFENC");
136139
if ((env != NULL) && (strcmp(env, "1") == 0))
137140
simd_huffman = 0;
141+
#endif
138142
}
139143

140144
GLOBAL(int)

Diff for: simd/arm64/jsimd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2009 Pierre Ossman <[email protected]> for Cendio AB
55
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
6-
* Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
6+
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, D. R. Commander.
77
* Copyright (C) 2015-2016, Matthieu Darbois.
88
*
99
* Based on the x86 SIMD extension for IJG JPEG library,
@@ -122,7 +122,9 @@ parse_proc_cpuinfo(int bufsize)
122122
LOCAL(void)
123123
init_simd(void)
124124
{
125+
#ifndef NO_GETENV
125126
char *env = NULL;
127+
#endif
126128
#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
127129
int bufsize = 1024; /* an initial guess for the line buffer size limit */
128130
#endif
@@ -141,6 +143,7 @@ init_simd(void)
141143
}
142144
#endif
143145

146+
#ifndef NO_GETENV
144147
/* Force different settings through environment variables */
145148
env = getenv("JSIMD_FORCENEON");
146149
if ((env != NULL) && (strcmp(env, "1") == 0))
@@ -161,6 +164,7 @@ init_simd(void)
161164
simd_features |= JSIMD_FASTST3;
162165
if ((env != NULL) && (strcmp(env, "0") == 0))
163166
simd_features &= ~JSIMD_FASTST3;
167+
#endif
164168
}
165169

166170
GLOBAL(int)

Diff for: simd/i386/jsimd.c

+4
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ static unsigned int simd_huffman = 1;
4242
LOCAL(void)
4343
init_simd(void)
4444
{
45+
#ifndef NO_GETENV
4546
char *env = NULL;
47+
#endif
4648

4749
if (simd_support != ~0U)
4850
return;
4951

5052
simd_support = jpeg_simd_cpu_support();
5153

54+
#ifndef NO_GETENV
5255
/* Force different settings through environment variables */
5356
env = getenv("JSIMD_FORCEMMX");
5457
if ((env != NULL) && (strcmp(env, "1") == 0))
@@ -71,6 +74,7 @@ init_simd(void)
7174
env = getenv("JSIMD_NOHUFFENC");
7275
if ((env != NULL) && (strcmp(env, "1") == 0))
7376
simd_huffman = 0;
77+
#endif
7478
}
7579

7680
GLOBAL(int)

Diff for: simd/loongson/jsimd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jsimd_loongson.c
33
*
44
* Copyright 2009 Pierre Ossman <[email protected]> for Cendio AB
5-
* Copyright (C) 2009-2011, 2014, 2016, D. R. Commander.
5+
* Copyright (C) 2009-2011, 2014, 2016, 2018, D. R. Commander.
66
* Copyright (C) 2013-2014, MIPS Technologies, Inc., California.
77
* Copyright (C) 2015, Matthieu Darbois.
88
* Copyright (C) 2016-2017, Loongson Technology Corporation Limited, BeiJing.
@@ -34,17 +34,21 @@ static unsigned int simd_support = ~0;
3434
LOCAL(void)
3535
init_simd(void)
3636
{
37+
#ifndef NO_GETENV
3738
char *env = NULL;
39+
#endif
3840

3941
if (simd_support != ~0U)
4042
return;
4143

4244
simd_support |= JSIMD_MMI;
4345

46+
#ifndef NO_GETENV
4447
/* Force different settings through environment variables */
4548
env = getenv("JSIMD_FORCENONE");
4649
if ((env != NULL) && (strcmp(env, "1") == 0))
4750
simd_support = 0;
51+
#endif
4852
}
4953

5054
GLOBAL(int)

Diff for: simd/mips/jsimd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jsimd_mips.c
33
*
44
* Copyright 2009 Pierre Ossman <[email protected]> for Cendio AB
5-
* Copyright (C) 2009-2011, 2014, 2016, D. R. Commander.
5+
* Copyright (C) 2009-2011, 2014, 2016, 2018, D. R. Commander.
66
* Copyright (C) 2013-2014, MIPS Technologies, Inc., California.
77
* Copyright (C) 2015, Matthieu Darbois.
88
*
@@ -64,7 +64,9 @@ parse_proc_cpuinfo(const char *search_string)
6464
LOCAL(void)
6565
init_simd(void)
6666
{
67+
#ifndef NO_GETENV
6768
char *env = NULL;
69+
#endif
6870

6971
if (simd_support != ~0U)
7072
return;
@@ -81,13 +83,15 @@ init_simd(void)
8183
return;
8284
#endif
8385

86+
#ifndef NO_GETENV
8487
/* Force different settings through environment variables */
8588
env = getenv("JSIMD_FORCEDSPR2");
8689
if ((env != NULL) && (strcmp(env, "1") == 0))
8790
simd_support = JSIMD_DSPR2;
8891
env = getenv("JSIMD_FORCENONE");
8992
if ((env != NULL) && (strcmp(env, "1") == 0))
9093
simd_support = 0;
94+
#endif
9195
}
9296

9397
static const int mips_idct_ifast_coefs[4] = {

Diff for: simd/powerpc/jsimd.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jsimd_powerpc.c
33
*
44
* Copyright 2009 Pierre Ossman <[email protected]> for Cendio AB
5-
* Copyright (C) 2009-2011, 2014-2016, D. R. Commander.
5+
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
66
* Copyright (C) 2015, Matthieu Darbois.
77
*
88
* Based on the x86 SIMD extension for IJG JPEG library,
@@ -111,7 +111,9 @@ parse_proc_cpuinfo(int bufsize)
111111
LOCAL(void)
112112
init_simd(void)
113113
{
114+
#ifndef NO_GETENV
114115
char *env = NULL;
116+
#endif
115117
#if !defined(__ALTIVEC__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
116118
int bufsize = 1024; /* an initial guess for the line buffer size limit */
117119
#elif defined(__amigaos4__)
@@ -144,13 +146,15 @@ init_simd(void)
144146
simd_support |= JSIMD_ALTIVEC;
145147
#endif
146148

149+
#ifndef NO_GETENV
147150
/* Force different settings through environment variables */
148151
env = getenv("JSIMD_FORCEALTIVEC");
149152
if ((env != NULL) && (strcmp(env, "1") == 0))
150153
simd_support = JSIMD_ALTIVEC;
151154
env = getenv("JSIMD_FORCENONE");
152155
if ((env != NULL) && (strcmp(env, "1") == 0))
153156
simd_support = 0;
157+
#endif
154158
}
155159

156160
GLOBAL(int)

Diff for: simd/x86_64/jsimd.c

+4
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ static unsigned int simd_huffman = 1;
4242
LOCAL(void)
4343
init_simd(void)
4444
{
45+
#ifndef NO_GETENV
4546
char *env = NULL;
47+
#endif
4648

4749
if (simd_support != ~0U)
4850
return;
4951

5052
simd_support = jpeg_simd_cpu_support();
5153

54+
#ifndef NO_GETENV
5255
/* Force different settings through environment variables */
5356
env = getenv("JSIMD_FORCESSE2");
5457
if ((env != NULL) && (strcmp(env, "1") == 0))
@@ -62,6 +65,7 @@ init_simd(void)
6265
env = getenv("JSIMD_NOHUFFENC");
6366
if ((env != NULL) && (strcmp(env, "1") == 0))
6467
simd_huffman = 0;
68+
#endif
6569
}
6670

6771
GLOBAL(int)

Diff for: turbojpeg.c

+14
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,11 @@ DLLEXPORT int tjCompress2(tjhandle handle, const unsigned char *srcBuf,
626626
cinfo->image_width = width;
627627
cinfo->image_height = height;
628628

629+
#ifndef NO_PUTENV
629630
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
630631
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
631632
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
633+
#endif
632634

633635
if (flags & TJFLAG_NOREALLOC) {
634636
alloc = 0; *jpegSize = tjBufSize(width, height, jpegSubsamp);
@@ -724,9 +726,11 @@ DLLEXPORT int tjEncodeYUVPlanes(tjhandle handle, const unsigned char *srcBuf,
724726
cinfo->image_width = width;
725727
cinfo->image_height = height;
726728

729+
#ifndef NO_PUTENV
727730
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
728731
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
729732
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
733+
#endif
730734

731735
if (setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags) == -1) return -1;
732736

@@ -932,9 +936,11 @@ DLLEXPORT int tjCompressFromYUVPlanes(tjhandle handle,
932936
cinfo->image_width = width;
933937
cinfo->image_height = height;
934938

939+
#ifndef NO_PUTENV
935940
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
936941
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
937942
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
943+
#endif
938944

939945
if (flags & TJFLAG_NOREALLOC) {
940946
alloc = 0; *jpegSize = tjBufSize(width, height, subsamp);
@@ -1210,9 +1216,11 @@ DLLEXPORT int tjDecompress2(tjhandle handle, const unsigned char *jpegBuf,
12101216
pitch < 0 || height < 0 || pixelFormat < 0 || pixelFormat >= TJ_NUMPF)
12111217
_throw("tjDecompress2(): Invalid argument");
12121218

1219+
#ifndef NO_PUTENV
12131220
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
12141221
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
12151222
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
1223+
#endif
12161224

12171225
if (setjmp(this->jerr.setjmp_buffer)) {
12181226
/* If we get here, the JPEG code has signaled an error. */
@@ -1376,9 +1384,11 @@ DLLEXPORT int tjDecodeYUVPlanes(tjhandle handle,
13761384
dinfo->image_width = width;
13771385
dinfo->image_height = height;
13781386

1387+
#ifndef NO_PUTENV
13791388
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
13801389
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
13811390
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
1391+
#endif
13821392

13831393
if (setDecodeDefaults(dinfo, pixelFormat, subsamp, flags) == -1) {
13841394
retval = -1; goto bailout;
@@ -1542,9 +1552,11 @@ DLLEXPORT int tjDecompressToYUVPlanes(tjhandle handle,
15421552
width < 0 || height < 0)
15431553
_throw("tjDecompressToYUVPlanes(): Invalid argument");
15441554

1555+
#ifndef NO_PUTENV
15451556
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
15461557
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
15471558
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
1559+
#endif
15481560

15491561
if (setjmp(this->jerr.setjmp_buffer)) {
15501562
/* If we get here, the JPEG code has signaled an error. */
@@ -1796,9 +1808,11 @@ DLLEXPORT int tjTransform(tjhandle handle, const unsigned char *jpegBuf,
17961808
dstSizes == NULL || t == NULL || flags < 0)
17971809
_throw("tjTransform(): Invalid argument");
17981810

1811+
#ifndef NO_PUTENV
17991812
if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
18001813
else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
18011814
else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
1815+
#endif
18021816

18031817
if ((xinfo =
18041818
(jpeg_transform_info *)malloc(sizeof(jpeg_transform_info) * n)) == NULL)

0 commit comments

Comments
 (0)