Skip to content

Commit 9bdae42

Browse files
committed
Merge pull request godotengine#113945 from akien-mga/libjpeg-turbo-3.1.3
libjpeg-turbo: Update to 3.1.3
2 parents d3613aa + e70c6f9 commit 9bdae42

22 files changed

Lines changed: 186 additions & 406 deletions

COPYRIGHT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ License: BSD-3-clause
372372

373373
Files: thirdparty/libjpeg-turbo/*
374374
Comment: libjpeg-turbo
375-
Copyright: 2009-2024, D. R. Commander
375+
Copyright: 2009-2025, D. R. Commander
376376
2015, Viktor Szathmáry.
377377
1991-2020, Thomas G. Lane, Guido Vollbeding
378378
License: BSD-3-clause and IJG

thirdparty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ Patches:
538538
## libjpeg-turbo
539539

540540
- Upstream: https://github.com/libjpeg-turbo/libjpeg-turbo
541-
- Version: 3.1.0 (20ade4dea9589515a69793e447a6c6220b464535, 2024)
541+
- Version: 3.1.3 (af9c1c268520a29adf98cad5138dafe612b3d318, 2025)
542542
- License: BSD-3-Clause and IJG
543543

544544
Files extracted from upstream source:

thirdparty/libjpeg-turbo/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ intended solely for clarification.
9494
The Modified (3-clause) BSD License
9595
===================================
9696

97-
Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.<br>
97+
Copyright (C)2009-2025 D. R. Commander. All Rights Reserved.<br>
9898
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
9999

100100
Redistribution and use in source and binary forms, with or without

thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch

Lines changed: 0 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -1,280 +1,3 @@
1-
diff --git a/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch b/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
2-
index 72354390a6..e69de29bb2 100644
3-
--- a/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
4-
+++ b/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
5-
@@ -1,272 +0,0 @@
6-
-diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h
7-
-new file mode 100644
8-
-index 0000000000..42d9654c0f
9-
---- /dev/null
10-
-+++ b/thirdparty/libjpeg-turbo/src/jconfig.h
11-
-@@ -0,0 +1,62 @@
12-
-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
13-
-+
14-
-+/* Version ID for the JPEG library.
15-
-+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
16-
-+ */
17-
-+#define JPEG_LIB_VERSION 62
18-
-+
19-
-+/* libjpeg-turbo version */
20-
-+#define LIBJPEG_TURBO_VERSION 3.1.0
21-
-+
22-
-+/* libjpeg-turbo version in integer form */
23-
-+#define LIBJPEG_TURBO_VERSION_NUMBER 3001000
24-
-+
25-
-+/* Support arithmetic encoding when using 8-bit samples */
26-
-+#define C_ARITH_CODING_SUPPORTED 1
27-
-+
28-
-+/* Support arithmetic decoding when using 8-bit samples */
29-
-+#define D_ARITH_CODING_SUPPORTED 1
30-
-+
31-
-+/* Support in-memory source/destination managers */
32-
-+#define MEM_SRCDST_SUPPORTED 1
33-
-+
34-
-+/* Use accelerated SIMD routines when using 8-bit samples */
35-
-+//#define WITH_SIMD 1
36-
-+
37-
-+/* This version of libjpeg-turbo supports run-time selection of data precision,
38-
-+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
39-
-+ * time. However, some downstream software expects the macro to be defined.
40-
-+ * Since 12-bit data precision is an opt-in feature that requires explicitly
41-
-+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
42-
-+ * types, the unmodified portion of the libjpeg API still behaves as if it were
43-
-+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
44-
-+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
45-
-+ */
46-
-+#ifndef BITS_IN_JSAMPLE
47-
-+#define BITS_IN_JSAMPLE 8
48-
-+#endif
49-
-+
50-
-+#ifdef _WIN32
51-
-+
52-
-+#undef RIGHT_SHIFT_IS_UNSIGNED
53-
-+
54-
-+/* Define "boolean" as unsigned char, not int, per Windows custom */
55-
-+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
56-
-+typedef unsigned char boolean;
57-
-+#endif
58-
-+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
59-
-+
60-
-+/* Define "INT32" as int, not long, per Windows custom */
61-
-+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
62-
-+typedef short INT16;
63-
-+typedef signed int INT32;
64-
-+#endif
65-
-+#define XMD_H /* prevent jmorecfg.h from redefining it */
66-
-+
67-
-+#else
68-
-+
69-
-+/* Define if your (broken) compiler shifts signed values as if they were
70-
-+ unsigned. */
71-
-+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
72-
-+
73-
-+#endif
74-
-diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h
75-
-new file mode 100644
76-
---- /dev/null
77-
-+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h
78-
-@@ -0,0 +1,102 @@
79-
-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
80-
-+
81-
-+/* libjpeg-turbo build number */
82-
-+#define BUILD "20250317"
83-
-+
84-
-+/* How to hide global symbols. */
85-
-+#ifndef HIDDEN
86-
-+ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
87-
-+ #define HIDDEN __attribute__((visibility("hidden")))
88-
-+ #else
89-
-+ #define HIDDEN
90-
-+ #endif
91-
-+#endif
92-
-+
93-
-+/* Compiler's inline keyword */
94-
-+#undef inline
95-
-+
96-
-+/* How to obtain function inlining. */
97-
-+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
98-
-+ #define INLINE __inline__ __attribute__((always_inline))
99-
-+#else
100-
-+ #define INLINE inline
101-
-+#endif
102-
-+
103-
-+/* How to obtain thread-local storage */
104-
-+#if defined(_MSC_VER)
105-
-+#define THREAD_LOCAL __declspec(thread)
106-
-+#else
107-
-+#define THREAD_LOCAL __thread
108-
-+#endif
109-
-+
110-
-+/* Define to the full name of this package. */
111-
-+#define PACKAGE_NAME "libjpeg-turbo"
112-
-+
113-
-+/* Version number of package */
114-
-+#define VERSION "3.1.0"
115-
-+
116-
-+/* The size of `size_t', as computed by sizeof. */
117-
-+#if defined(__SIZEOF_SIZE_T__)
118-
-+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__
119-
-+#elif defined(_WIN64)
120-
-+ #define SIZEOF_SIZE_T 8
121-
-+#elif defined(_WIN32)
122-
-+ #define SIZEOF_SIZE_T 4
123-
-+#else
124-
-+ #error "Cannot determine size of size_t"
125-
-+#endif
126-
-+
127-
-+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
128-
-+#if defined(__GNUC__)
129-
-+ #define HAVE_BUILTIN_CTZL
130-
-+#endif
131-
-+
132-
-+/* Define to 1 if you have the <intrin.h> header file. */
133-
-+/* #undef HAVE_INTRIN_H */
134-
-+
135-
-+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
136-
-+#if (SIZEOF_SIZE_T == 8)
137-
-+#define HAVE_BITSCANFORWARD64
138-
-+#elif (SIZEOF_SIZE_T == 4)
139-
-+#define HAVE_BITSCANFORWARD
140-
-+#endif
141-
-+#endif
142-
-+
143-
-+#if defined(__has_attribute)
144-
-+#if __has_attribute(fallthrough)
145-
-+#define FALLTHROUGH __attribute__((fallthrough));
146-
-+#else
147-
-+#define FALLTHROUGH
148-
-+#endif
149-
-+#else
150-
-+#define FALLTHROUGH
151-
-+#endif
152-
-+
153-
-+/*
154-
-+ * Define BITS_IN_JSAMPLE as either
155-
-+ * 8 for 8-bit sample values (the usual setting)
156-
-+ * 12 for 12-bit sample values
157-
-+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
158-
-+ * JPEG standard, and the IJG code does not support anything else!
159-
-+ */
160-
-+
161-
-+#ifndef BITS_IN_JSAMPLE
162-
-+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
163-
-+#endif
164-
-+
165-
-+#undef C_ARITH_CODING_SUPPORTED
166-
-+#undef D_ARITH_CODING_SUPPORTED
167-
-+#undef WITH_SIMD
168-
-+
169-
-+#if BITS_IN_JSAMPLE == 8
170-
-+
171-
-+/* Support arithmetic encoding */
172-
-+#define C_ARITH_CODING_SUPPORTED 1
173-
-+
174-
-+/* Support arithmetic decoding */
175-
-+#define D_ARITH_CODING_SUPPORTED 1
176-
-+
177-
-+/* Use accelerated SIMD routines. */
178-
-+//#define WITH_SIMD 1
179-
-+
180-
-+#endif
181-
-diff --git a/thirdparty/libjpeg-turbo/src/jmorecfg.h b/thirdparty/libjpeg-turbo/src/jmorecfg.h
182-
---- a/thirdparty/libjpeg-turbo/src/jmorecfg.h
183-
-+++ b/thirdparty/libjpeg-turbo/src/jmorecfg.h
184-
-@@ -1,3 +1,5 @@
185-
-+// Modified to remove lossless jpeg support.
186-
-+
187-
- /*
188-
- * jmorecfg.h
189-
- *
190-
-@@ -8,6 +10,6 @@
191-
- * Copyright (C) 1999, Ken Murchison.
192-
- * libjpeg-turbo Modifications:
193-
- * Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, 2022, D. R. Commander.
194-
- * For conditions of distribution and use, see the accompanying README.ijg
195-
- * file.
196-
- *
197-
-@@ -242,7 +244,7 @@ typedef int boolean;
198-
-
199-
- #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
200-
- #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
201-
--#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
202-
-+//#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
203-
- #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
204-
- /* Note: if you selected 12-bit data precision, it is dangerous to turn off
205-
- * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
206-
-@@ -259,7 +263,7 @@ typedef int boolean;
207-
-
208-
- #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
209-
- #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
210-
--#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
211-
-+//#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
212-
- #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
213-
- #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
214-
- #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
215-
-diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h
216-
-new file mode 100644
217-
---- /dev/null
218-
-+++ b/thirdparty/libjpeg-turbo/src/jversion.h
219-
-@@ -0,0 +18446744073709551615,58 @@
220-
-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
221-
-+
222-
-+/*
223-
-+ * jversion.h
224-
-+ *
225-
-+ * This file was part of the Independent JPEG Group's software:
226-
-+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
227-
-+ * libjpeg-turbo Modifications:
228-
-+ * Copyright (C) 2010, 2012-2024, D. R. Commander.
229-
-+ * For conditions of distribution and use, see the accompanying README.ijg
230-
-+ * file.
231-
-+ *
232-
-+ * This file contains software version identification.
233-
-+ */
234-
-+
235-
-+
236-
-+#if JPEG_LIB_VERSION >= 80
237-
-+
238-
-+#define JVERSION "8d 15-Jan-2012"
239-
-+
240-
-+#elif JPEG_LIB_VERSION >= 70
241-
-+
242-
-+#define JVERSION "7 27-Jun-2009"
243-
-+
244-
-+#else
245-
-+
246-
-+#define JVERSION "6b 27-Mar-1998"
247-
-+
248-
-+#endif
249-
-+
250-
-+/*
251-
-+ * NOTE: It is our convention to place the authors in the following order:
252-
-+ * - libjpeg-turbo authors (2009-) in descending order of the date of their
253-
-+ * most recent contribution to the project, then in ascending order of the
254-
-+ * date of their first contribution to the project, then in alphabetical
255-
-+ * order
256-
-+ * - Upstream authors in descending order of the date of the first inclusion of
257-
-+ * their code
258-
-+ */
259-
-+
260-
-+#define JCOPYRIGHT1 \
261-
-+ "Copyright (C) 2009-2024 D. R. Commander\n" \
262-
-+ "Copyright (C) 2015, 2020 Google, Inc.\n" \
263-
-+ "Copyright (C) 2019-2020 Arm Limited\n" \
264-
-+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
265-
-+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \
266-
-+ "Copyright (C) 2015 Intel Corporation\n"
267-
-+#define JCOPYRIGHT2 \
268-
-+ "Copyright (C) 2013-2014 Linaro Limited\n" \
269-
-+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
270-
-+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
271-
-+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
272-
-+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
273-
-+ "Copyright (C) 1999 Ken Murchison\n" \
274-
-+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"
275-
-+
276-
-+#define JCOPYRIGHT_SHORT \
277-
-+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"
2781
diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h
2792
new file mode 100644
2803
index 0000000000..42d9654c0f

thirdparty/libjpeg-turbo/patches/0002-disable-16bitlossless.patch

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
commit 462c1cd875ae8f6b5f6406dda01881fb173ac30c
2-
Author: Daniel Kinsman <danielkinsman@riseup.net>
3-
Date: Thu Mar 20 12:21:28 2025 +1100
4-
5-
remove unneeded source files and lossless jpeg support
6-
1+
diff --git a/thirdparty/README.md b/thirdparty/README.md
2+
index c22ef77af7..52b635df05 100644
3+
--- a/thirdparty/README.md
4+
+++ b/thirdparty/README.md
5+
@@ -539,7 +539,7 @@ Patches:
6+
## libjpeg-turbo
7+
8+
- Upstream: https://github.com/libjpeg-turbo/libjpeg-turbo
9+
-- Version: 3.1.0 (20ade4dea9589515a69793e447a6c6220b464535, 2024)
10+
+- Version: 3.1.3 (af9c1c268520a29adf98cad5138dafe612b3d318, 2025)
11+
- License: BSD-3-Clause and IJG
12+
13+
Files extracted from upstream source:
714
diff --git a/thirdparty/libjpeg-turbo/src/turbojpeg.c b/thirdparty/libjpeg-turbo/src/turbojpeg.c
8-
index 389aea55d3..eec8e2a616 100644
15+
index 45fc0f954c..d514da43d2 100644
916
--- a/thirdparty/libjpeg-turbo/src/turbojpeg.c
1017
+++ b/thirdparty/libjpeg-turbo/src/turbojpeg.c
11-
@@ -1200,9 +1200,6 @@ bailout:
18+
@@ -1196,9 +1196,6 @@ bailout:
1219
#define BITS_IN_JSAMPLE 12
1320
#include "turbojpeg-mp.c"
1421
#undef BITS_IN_JSAMPLE

thirdparty/libjpeg-turbo/patches/0003-remove-bmp-ppm-support.patch

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1+
diff --git a/thirdparty/README.md b/thirdparty/README.md
2+
index c22ef77af7..52b635df05 100644
3+
--- a/thirdparty/README.md
4+
+++ b/thirdparty/README.md
5+
@@ -539,7 +539,7 @@ Patches:
6+
## libjpeg-turbo
7+
8+
- Upstream: https://github.com/libjpeg-turbo/libjpeg-turbo
9+
-- Version: 3.1.0 (20ade4dea9589515a69793e447a6c6220b464535, 2024)
10+
+- Version: 3.1.3 (af9c1c268520a29adf98cad5138dafe612b3d318, 2025)
11+
- License: BSD-3-Clause and IJG
12+
13+
Files extracted from upstream source:
114
diff --git a/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c b/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c
2-
index 1fa63b8185..72f99e236a 100644
15+
index 6fecc5cb80..21d26536c1 100644
316
--- a/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c
417
+++ b/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c
518
@@ -286,271 +286,6 @@ bailout:
@@ -275,10 +288,20 @@ index 1fa63b8185..72f99e236a 100644
275288
#undef _JSAMPROW
276289
#undef _buffer
277290
diff --git a/thirdparty/libjpeg-turbo/src/turbojpeg.c b/thirdparty/libjpeg-turbo/src/turbojpeg.c
278-
index eec8e2a616..8ce446148a 100644
291+
index 45fc0f954c..969174f72e 100644
279292
--- a/thirdparty/libjpeg-turbo/src/turbojpeg.c
280293
+++ b/thirdparty/libjpeg-turbo/src/turbojpeg.c
281-
@@ -3095,48 +3095,3 @@ bailout:
294+
@@ -1196,9 +1196,6 @@ bailout:
295+
#define BITS_IN_JSAMPLE 12
296+
#include "turbojpeg-mp.c"
297+
#undef BITS_IN_JSAMPLE
298+
-#define BITS_IN_JSAMPLE 16
299+
-#include "turbojpeg-mp.c"
300+
-#undef BITS_IN_JSAMPLE
301+
302+
/* TurboJPEG 1.2+ */
303+
DLLEXPORT int tjCompress2(tjhandle handle, const unsigned char *srcBuf,
304+
@@ -3094,48 +3091,3 @@ bailout:
282305
free(sizes);
283306
return retval;
284307
}

0 commit comments

Comments
 (0)