Path: blob/master/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
9906 views
diff --git a/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch b/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch1index 72354390a6..e69de29bb2 1006442--- a/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch3+++ b/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch4@@ -1,272 +0,0 @@5-diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h6-new file mode 1006447-index 0000000000..42d9654c0f8---- /dev/null9-+++ b/thirdparty/libjpeg-turbo/src/jconfig.h10-@@ -0,0 +1,62 @@11-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.12-+13-+/* Version ID for the JPEG library.14-+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".15-+ */16-+#define JPEG_LIB_VERSION 6217-+18-+/* libjpeg-turbo version */19-+#define LIBJPEG_TURBO_VERSION 3.1.020-+21-+/* libjpeg-turbo version in integer form */22-+#define LIBJPEG_TURBO_VERSION_NUMBER 300100023-+24-+/* Support arithmetic encoding when using 8-bit samples */25-+#define C_ARITH_CODING_SUPPORTED 126-+27-+/* Support arithmetic decoding when using 8-bit samples */28-+#define D_ARITH_CODING_SUPPORTED 129-+30-+/* Support in-memory source/destination managers */31-+#define MEM_SRCDST_SUPPORTED 132-+33-+/* Use accelerated SIMD routines when using 8-bit samples */34-+//#define WITH_SIMD 135-+36-+/* This version of libjpeg-turbo supports run-time selection of data precision,37-+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build38-+ * time. However, some downstream software expects the macro to be defined.39-+ * Since 12-bit data precision is an opt-in feature that requires explicitly40-+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data41-+ * types, the unmodified portion of the libjpeg API still behaves as if it were42-+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data43-+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.44-+ */45-+#ifndef BITS_IN_JSAMPLE46-+#define BITS_IN_JSAMPLE 847-+#endif48-+49-+#ifdef _WIN3250-+51-+#undef RIGHT_SHIFT_IS_UNSIGNED52-+53-+/* Define "boolean" as unsigned char, not int, per Windows custom */54-+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */55-+typedef unsigned char boolean;56-+#endif57-+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */58-+59-+/* Define "INT32" as int, not long, per Windows custom */60-+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */61-+typedef short INT16;62-+typedef signed int INT32;63-+#endif64-+#define XMD_H /* prevent jmorecfg.h from redefining it */65-+66-+#else67-+68-+/* Define if your (broken) compiler shifts signed values as if they were69-+ unsigned. */70-+/* #undef RIGHT_SHIFT_IS_UNSIGNED */71-+72-+#endif73-diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h74-new file mode 10064475---- /dev/null76-+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h77-@@ -0,0 +1,102 @@78-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.79-+80-+/* libjpeg-turbo build number */81-+#define BUILD "20250317"82-+83-+/* How to hide global symbols. */84-+#ifndef HIDDEN85-+ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)86-+ #define HIDDEN __attribute__((visibility("hidden")))87-+ #else88-+ #define HIDDEN89-+ #endif90-+#endif91-+92-+/* Compiler's inline keyword */93-+#undef inline94-+95-+/* How to obtain function inlining. */96-+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)97-+ #define INLINE __inline__ __attribute__((always_inline))98-+#else99-+ #define INLINE inline100-+#endif101-+102-+/* How to obtain thread-local storage */103-+#if defined(_MSC_VER)104-+#define THREAD_LOCAL __declspec(thread)105-+#else106-+#define THREAD_LOCAL __thread107-+#endif108-+109-+/* Define to the full name of this package. */110-+#define PACKAGE_NAME "libjpeg-turbo"111-+112-+/* Version number of package */113-+#define VERSION "3.1.0"114-+115-+/* The size of `size_t', as computed by sizeof. */116-+#if defined(__SIZEOF_SIZE_T__)117-+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__118-+#elif defined(_WIN64)119-+ #define SIZEOF_SIZE_T 8120-+#elif defined(_WIN32)121-+ #define SIZEOF_SIZE_T 4122-+#else123-+ #error "Cannot determine size of size_t"124-+#endif125-+126-+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */127-+#if defined(__GNUC__)128-+ #define HAVE_BUILTIN_CTZL129-+#endif130-+131-+/* Define to 1 if you have the <intrin.h> header file. */132-+/* #undef HAVE_INTRIN_H */133-+134-+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)135-+#if (SIZEOF_SIZE_T == 8)136-+#define HAVE_BITSCANFORWARD64137-+#elif (SIZEOF_SIZE_T == 4)138-+#define HAVE_BITSCANFORWARD139-+#endif140-+#endif141-+142-+#if defined(__has_attribute)143-+#if __has_attribute(fallthrough)144-+#define FALLTHROUGH __attribute__((fallthrough));145-+#else146-+#define FALLTHROUGH147-+#endif148-+#else149-+#define FALLTHROUGH150-+#endif151-+152-+/*153-+ * Define BITS_IN_JSAMPLE as either154-+ * 8 for 8-bit sample values (the usual setting)155-+ * 12 for 12-bit sample values156-+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the157-+ * JPEG standard, and the IJG code does not support anything else!158-+ */159-+160-+#ifndef BITS_IN_JSAMPLE161-+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */162-+#endif163-+164-+#undef C_ARITH_CODING_SUPPORTED165-+#undef D_ARITH_CODING_SUPPORTED166-+#undef WITH_SIMD167-+168-+#if BITS_IN_JSAMPLE == 8169-+170-+/* Support arithmetic encoding */171-+#define C_ARITH_CODING_SUPPORTED 1172-+173-+/* Support arithmetic decoding */174-+#define D_ARITH_CODING_SUPPORTED 1175-+176-+/* Use accelerated SIMD routines. */177-+//#define WITH_SIMD 1178-+179-+#endif180-diff --git a/thirdparty/libjpeg-turbo/src/jmorecfg.h b/thirdparty/libjpeg-turbo/src/jmorecfg.h181---- a/thirdparty/libjpeg-turbo/src/jmorecfg.h182-+++ b/thirdparty/libjpeg-turbo/src/jmorecfg.h183-@@ -1,3 +1,5 @@184-+// Modified to remove lossless jpeg support.185-+186- /*187- * jmorecfg.h188- *189-@@ -8,6 +10,6 @@190- * Copyright (C) 1999, Ken Murchison.191- * libjpeg-turbo Modifications:192- * Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, 2022, D. R. Commander.193- * For conditions of distribution and use, see the accompanying README.ijg194- * file.195- *196-@@ -242,7 +244,7 @@ typedef int boolean;197-198- #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */199- #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/200--#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */201-+//#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */202- #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */203- /* Note: if you selected 12-bit data precision, it is dangerous to turn off204- * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit205-@@ -259,7 +263,7 @@ typedef int boolean;206-207- #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */208- #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/209--#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */210-+//#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */211- #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */212- #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */213- #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */214-diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h215-new file mode 100644216---- /dev/null217-+++ b/thirdparty/libjpeg-turbo/src/jversion.h218-@@ -0,0 +18446744073709551615,58 @@219-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.220-+221-+/*222-+ * jversion.h223-+ *224-+ * This file was part of the Independent JPEG Group's software:225-+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.226-+ * libjpeg-turbo Modifications:227-+ * Copyright (C) 2010, 2012-2024, D. R. Commander.228-+ * For conditions of distribution and use, see the accompanying README.ijg229-+ * file.230-+ *231-+ * This file contains software version identification.232-+ */233-+234-+235-+#if JPEG_LIB_VERSION >= 80236-+237-+#define JVERSION "8d 15-Jan-2012"238-+239-+#elif JPEG_LIB_VERSION >= 70240-+241-+#define JVERSION "7 27-Jun-2009"242-+243-+#else244-+245-+#define JVERSION "6b 27-Mar-1998"246-+247-+#endif248-+249-+/*250-+ * NOTE: It is our convention to place the authors in the following order:251-+ * - libjpeg-turbo authors (2009-) in descending order of the date of their252-+ * most recent contribution to the project, then in ascending order of the253-+ * date of their first contribution to the project, then in alphabetical254-+ * order255-+ * - Upstream authors in descending order of the date of the first inclusion of256-+ * their code257-+ */258-+259-+#define JCOPYRIGHT1 \260-+ "Copyright (C) 2009-2024 D. R. Commander\n" \261-+ "Copyright (C) 2015, 2020 Google, Inc.\n" \262-+ "Copyright (C) 2019-2020 Arm Limited\n" \263-+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \264-+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \265-+ "Copyright (C) 2015 Intel Corporation\n"266-+#define JCOPYRIGHT2 \267-+ "Copyright (C) 2013-2014 Linaro Limited\n" \268-+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \269-+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \270-+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \271-+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \272-+ "Copyright (C) 1999 Ken Murchison\n" \273-+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"274-+275-+#define JCOPYRIGHT_SHORT \276-+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"277diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h278new file mode 100644279index 0000000000..42d9654c0f280--- /dev/null281+++ b/thirdparty/libjpeg-turbo/src/jconfig.h282@@ -0,0 +1,62 @@283+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.284+285+/* Version ID for the JPEG library.286+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".287+ */288+#define JPEG_LIB_VERSION 62289+290+/* libjpeg-turbo version */291+#define LIBJPEG_TURBO_VERSION 3.1.0292+293+/* libjpeg-turbo version in integer form */294+#define LIBJPEG_TURBO_VERSION_NUMBER 3001000295+296+/* Support arithmetic encoding when using 8-bit samples */297+#define C_ARITH_CODING_SUPPORTED 1298+299+/* Support arithmetic decoding when using 8-bit samples */300+#define D_ARITH_CODING_SUPPORTED 1301+302+/* Support in-memory source/destination managers */303+#define MEM_SRCDST_SUPPORTED 1304+305+/* Use accelerated SIMD routines when using 8-bit samples */306+//#define WITH_SIMD 1307+308+/* This version of libjpeg-turbo supports run-time selection of data precision,309+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build310+ * time. However, some downstream software expects the macro to be defined.311+ * Since 12-bit data precision is an opt-in feature that requires explicitly312+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data313+ * types, the unmodified portion of the libjpeg API still behaves as if it were314+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data315+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.316+ */317+#ifndef BITS_IN_JSAMPLE318+#define BITS_IN_JSAMPLE 8319+#endif320+321+#ifdef _WIN32322+323+#undef RIGHT_SHIFT_IS_UNSIGNED324+325+/* Define "boolean" as unsigned char, not int, per Windows custom */326+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */327+typedef unsigned char boolean;328+#endif329+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */330+331+/* Define "INT32" as int, not long, per Windows custom */332+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */333+typedef short INT16;334+typedef signed int INT32;335+#endif336+#define XMD_H /* prevent jmorecfg.h from redefining it */337+338+#else339+340+/* Define if your (broken) compiler shifts signed values as if they were341+ unsigned. */342+/* #undef RIGHT_SHIFT_IS_UNSIGNED */343+344+#endif345diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h346new file mode 100644347index 0000000000..45bd3ec321348--- /dev/null349+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h350@@ -0,0 +1,102 @@351+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.352+353+/* libjpeg-turbo build number */354+#define BUILD "20250317"355+356+/* How to hide global symbols. */357+#ifndef HIDDEN358+ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)359+ #define HIDDEN __attribute__((visibility("hidden")))360+ #else361+ #define HIDDEN362+ #endif363+#endif364+365+/* Compiler's inline keyword */366+#undef inline367+368+/* How to obtain function inlining. */369+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)370+ #define INLINE __inline__ __attribute__((always_inline))371+#else372+ #define INLINE inline373+#endif374+375+/* How to obtain thread-local storage */376+#if defined(_MSC_VER)377+#define THREAD_LOCAL __declspec(thread)378+#else379+#define THREAD_LOCAL __thread380+#endif381+382+/* Define to the full name of this package. */383+#define PACKAGE_NAME "libjpeg-turbo"384+385+/* Version number of package */386+#define VERSION "3.1.0"387+388+/* The size of `size_t', as computed by sizeof. */389+#if defined(__SIZEOF_SIZE_T__)390+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__391+#elif defined(_WIN64)392+ #define SIZEOF_SIZE_T 8393+#elif defined(_WIN32)394+ #define SIZEOF_SIZE_T 4395+#else396+ #error "Cannot determine size of size_t"397+#endif398+399+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */400+#if defined(__GNUC__)401+ #define HAVE_BUILTIN_CTZL402+#endif403+404+/* Define to 1 if you have the <intrin.h> header file. */405+/* #undef HAVE_INTRIN_H */406+407+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)408+#if (SIZEOF_SIZE_T == 8)409+#define HAVE_BITSCANFORWARD64410+#elif (SIZEOF_SIZE_T == 4)411+#define HAVE_BITSCANFORWARD412+#endif413+#endif414+415+#if defined(__has_attribute)416+#if __has_attribute(fallthrough)417+#define FALLTHROUGH __attribute__((fallthrough));418+#else419+#define FALLTHROUGH420+#endif421+#else422+#define FALLTHROUGH423+#endif424+425+/*426+ * Define BITS_IN_JSAMPLE as either427+ * 8 for 8-bit sample values (the usual setting)428+ * 12 for 12-bit sample values429+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the430+ * JPEG standard, and the IJG code does not support anything else!431+ */432+433+#ifndef BITS_IN_JSAMPLE434+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */435+#endif436+437+#undef C_ARITH_CODING_SUPPORTED438+#undef D_ARITH_CODING_SUPPORTED439+#undef WITH_SIMD440+441+#if BITS_IN_JSAMPLE == 8442+443+/* Support arithmetic encoding */444+#define C_ARITH_CODING_SUPPORTED 1445+446+/* Support arithmetic decoding */447+#define D_ARITH_CODING_SUPPORTED 1448+449+/* Use accelerated SIMD routines. */450+//#define WITH_SIMD 1451+452+#endif453diff --git a/thirdparty/libjpeg-turbo/src/jmorecfg.h b/thirdparty/libjpeg-turbo/src/jmorecfg.h454index 89c7842c87..c96edd2300 100644455--- a/thirdparty/libjpeg-turbo/src/jmorecfg.h456+++ b/thirdparty/libjpeg-turbo/src/jmorecfg.h457@@ -1,3 +1,5 @@458+// Modified to remove lossless jpeg support.459+460/*461* jmorecfg.h462*463@@ -242,7 +244,7 @@ typedef int boolean;464465#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */466#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/467-#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */468+//#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */469#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */470/* Note: if you selected 12-bit data precision, it is dangerous to turn off471* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit472@@ -259,7 +261,7 @@ typedef int boolean;473474#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */475#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/476-#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */477+//#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */478#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */479#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */480#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */481diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h482new file mode 100644483index 0000000000..40f7a6cc82484--- /dev/null485+++ b/thirdparty/libjpeg-turbo/src/jversion.h486@@ -0,0 +1,58 @@487+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.488+489+/*490+ * jversion.h491+ *492+ * This file was part of the Independent JPEG Group's software:493+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.494+ * libjpeg-turbo Modifications:495+ * Copyright (C) 2010, 2012-2024, D. R. Commander.496+ * For conditions of distribution and use, see the accompanying README.ijg497+ * file.498+ *499+ * This file contains software version identification.500+ */501+502+503+#if JPEG_LIB_VERSION >= 80504+505+#define JVERSION "8d 15-Jan-2012"506+507+#elif JPEG_LIB_VERSION >= 70508+509+#define JVERSION "7 27-Jun-2009"510+511+#else512+513+#define JVERSION "6b 27-Mar-1998"514+515+#endif516+517+/*518+ * NOTE: It is our convention to place the authors in the following order:519+ * - libjpeg-turbo authors (2009-) in descending order of the date of their520+ * most recent contribution to the project, then in ascending order of the521+ * date of their first contribution to the project, then in alphabetical522+ * order523+ * - Upstream authors in descending order of the date of the first inclusion of524+ * their code525+ */526+527+#define JCOPYRIGHT1 \528+ "Copyright (C) 2009-2024 D. R. Commander\n" \529+ "Copyright (C) 2015, 2020 Google, Inc.\n" \530+ "Copyright (C) 2019-2020 Arm Limited\n" \531+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \532+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \533+ "Copyright (C) 2015 Intel Corporation\n"534+#define JCOPYRIGHT2 \535+ "Copyright (C) 2013-2014 Linaro Limited\n" \536+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \537+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \538+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \539+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \540+ "Copyright (C) 1999 Ken Murchison\n" \541+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"542+543+#define JCOPYRIGHT_SHORT \544+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"545546547