summaryrefslogtreecommitdiffstats
path: root/external/libjpeg-turbo
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /external/libjpeg-turbo
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/libjpeg-turbo')
-rw-r--r--external/libjpeg-turbo/Makefile7
-rw-r--r--external/libjpeg-turbo/Module_libjpeg-turbo.mk17
-rw-r--r--external/libjpeg-turbo/README6
-rw-r--r--external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk214
-rw-r--r--external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk28
-rw-r--r--external/libjpeg-turbo/include.patch12
-rw-r--r--external/libjpeg-turbo/jconfig.h55
-rw-r--r--external/libjpeg-turbo/jconfigint.h54
-rw-r--r--external/libjpeg-turbo/jversion.h54
9 files changed, 447 insertions, 0 deletions
diff --git a/external/libjpeg-turbo/Makefile b/external/libjpeg-turbo/Makefile
new file mode 100644
index 0000000000..e4968cf85f
--- /dev/null
+++ b/external/libjpeg-turbo/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libjpeg-turbo/Module_libjpeg-turbo.mk b/external/libjpeg-turbo/Module_libjpeg-turbo.mk
new file mode 100644
index 0000000000..29be901558
--- /dev/null
+++ b/external/libjpeg-turbo/Module_libjpeg-turbo.mk
@@ -0,0 +1,17 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libjpeg-turbo))
+
+$(eval $(call gb_Module_add_targets,libjpeg-turbo,\
+ UnpackedTarball_libjpeg-turbo \
+ StaticLibrary_libjpeg-turbo \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libjpeg-turbo/README b/external/libjpeg-turbo/README
new file mode 100644
index 0000000000..7f0065b5f6
--- /dev/null
+++ b/external/libjpeg-turbo/README
@@ -0,0 +1,6 @@
+External library for reading/writing jpegs
+
+This is used by the jpeg import and export filters that are provided
+for use by VCL see [[vcl/source/filter/jpeg]]
+
+From [https://www.libjpeg-turbo.org/].
diff --git a/external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk b/external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk
new file mode 100644
index 0000000000..ace14fd8fc
--- /dev/null
+++ b/external/libjpeg-turbo/StaticLibrary_libjpeg-turbo.mk
@@ -0,0 +1,214 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozillarg/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,libjpeg-turbo))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,libjpeg-turbo,libjpeg-turbo))
+
+$(eval $(call gb_StaticLibrary_set_warnings_disabled,libjpeg-turbo))
+
+$(eval $(call gb_StaticLibrary_set_include,libjpeg-turbo,\
+ -I$(call gb_UnpackedTarball_get_dir,libjpeg-turbo) \
+ $$(INCLUDE) \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\
+ -DHAVE_INTRIN_H=1 \
+))
+endif
+
+$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\
+ -DSIZEOF_SIZE_T=$(SIZEOF_SIZE_T) \
+))
+
+ifeq ($(COM),GCC)
+ifneq ($(ENABLE_OPTIMIZED),)
+$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\
+ -O3 \
+))
+endif
+endif
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/jaricom \
+ UnpackedTarball/libjpeg-turbo/jcapimin \
+ UnpackedTarball/libjpeg-turbo/jcapistd \
+ UnpackedTarball/libjpeg-turbo/jcarith \
+ UnpackedTarball/libjpeg-turbo/jccoefct \
+ UnpackedTarball/libjpeg-turbo/jccolor \
+ UnpackedTarball/libjpeg-turbo/jcdctmgr \
+ UnpackedTarball/libjpeg-turbo/jchuff \
+ UnpackedTarball/libjpeg-turbo/jcicc \
+ UnpackedTarball/libjpeg-turbo/jcinit \
+ UnpackedTarball/libjpeg-turbo/jcmainct \
+ UnpackedTarball/libjpeg-turbo/jcmarker \
+ UnpackedTarball/libjpeg-turbo/jcmaster \
+ UnpackedTarball/libjpeg-turbo/jcomapi \
+ UnpackedTarball/libjpeg-turbo/jcparam \
+ UnpackedTarball/libjpeg-turbo/jcphuff \
+ UnpackedTarball/libjpeg-turbo/jcprepct \
+ UnpackedTarball/libjpeg-turbo/jcsample \
+ UnpackedTarball/libjpeg-turbo/jctrans \
+ UnpackedTarball/libjpeg-turbo/jdapimin \
+ UnpackedTarball/libjpeg-turbo/jdapistd \
+ UnpackedTarball/libjpeg-turbo/jdarith \
+ UnpackedTarball/libjpeg-turbo/jdatadst \
+ UnpackedTarball/libjpeg-turbo/jdatasrc \
+ UnpackedTarball/libjpeg-turbo/jdcoefct \
+ UnpackedTarball/libjpeg-turbo/jdcolor \
+ UnpackedTarball/libjpeg-turbo/jddctmgr \
+ UnpackedTarball/libjpeg-turbo/jdhuff \
+ UnpackedTarball/libjpeg-turbo/jdicc \
+ UnpackedTarball/libjpeg-turbo/jdinput \
+ UnpackedTarball/libjpeg-turbo/jdmainct \
+ UnpackedTarball/libjpeg-turbo/jdmarker \
+ UnpackedTarball/libjpeg-turbo/jdmaster \
+ UnpackedTarball/libjpeg-turbo/jdmerge \
+ UnpackedTarball/libjpeg-turbo/jdphuff \
+ UnpackedTarball/libjpeg-turbo/jdpostct \
+ UnpackedTarball/libjpeg-turbo/jdsample \
+ UnpackedTarball/libjpeg-turbo/jdtrans \
+ UnpackedTarball/libjpeg-turbo/jerror \
+ UnpackedTarball/libjpeg-turbo/jfdctflt \
+ UnpackedTarball/libjpeg-turbo/jfdctfst \
+ UnpackedTarball/libjpeg-turbo/jfdctint \
+ UnpackedTarball/libjpeg-turbo/jidctflt \
+ UnpackedTarball/libjpeg-turbo/jidctfst \
+ UnpackedTarball/libjpeg-turbo/jidctint \
+ UnpackedTarball/libjpeg-turbo/jidctred \
+ UnpackedTarball/libjpeg-turbo/jmemmgr \
+ UnpackedTarball/libjpeg-turbo/jmemnobs \
+ UnpackedTarball/libjpeg-turbo/jquant1 \
+ UnpackedTarball/libjpeg-turbo/jquant2 \
+ UnpackedTarball/libjpeg-turbo/jutils \
+))
+
+ifneq ($(NASM),)
+
+$(eval $(call gb_StaticLibrary_add_nasmflags,libjpeg-turbo,\
+ -I$(call gb_UnpackedTarball_get_dir,libjpeg-turbo)/simd/nasm/ \
+ -I$(dir $(call gb_UnpackedTarball_get_dir,libjpeg-turbo)/$(1)) \
+))
+
+ifeq ($(CPUNAME),X86_64)
+
+$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\
+ -DWITH_SIMD \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jsimd \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_nasmobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jsimdcpu.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctflt-sse.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jccolor-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jcgray-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jchuff-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jcphuff-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jcsample-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jdcolor-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jdmerge-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jdsample-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctfst-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctint-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctflt-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctfst-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctint-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctred-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jquantf-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jquanti-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jccolor-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jcgray-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jcsample-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jdcolor-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jdmerge-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jdsample-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jfdctint-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jidctint-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/x86_64/jquanti-avx2.asm \
+))
+
+else ifeq ($(CPUNAME),INTEL)
+
+$(eval $(call gb_StaticLibrary_add_cflags,libjpeg-turbo,\
+ -DWITH_SIMD \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/simd/i386/jsimd \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_nasmobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/simd/i386/jsimdcpu.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctflt-3dn.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctflt-3dn.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jquant-3dn.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jccolor-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcgray-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcsample-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdcolor-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdmerge-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdsample-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctfst-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctint-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctfst-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctint-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctred-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jquant-mmx.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctflt-sse.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctflt-sse.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jquant-sse.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jccolor-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcgray-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jchuff-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcphuff-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcsample-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdcolor-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdmerge-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdsample-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctfst-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctint-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctflt-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctfst-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctint-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctred-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jquantf-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jquanti-sse2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jccolor-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcgray-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jcsample-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdcolor-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdmerge-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jdsample-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jfdctint-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jidctint-avx2.asm \
+ UnpackedTarball/libjpeg-turbo/simd/i386/jquanti-avx2.asm \
+))
+
+else
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/jsimd_none \
+))
+
+endif
+
+else
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,libjpeg-turbo,\
+ UnpackedTarball/libjpeg-turbo/jsimd_none \
+))
+
+endif
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk b/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk
new file mode 100644
index 0000000000..5c88c8756c
--- /dev/null
+++ b/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk
@@ -0,0 +1,28 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libjpeg-turbo))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libjpeg-turbo,$(LIBJPEG_TURBO_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libjpeg-turbo,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libjpeg-turbo, \
+ external/libjpeg-turbo/include.patch \
+))
+
+# jconfigint.h and jconfig.h generated via
+# cmake -DENABLE_STATIC:BOOL=ON -DENABLE_SHARED:BOOL=NO -DWITH_JAVA:BOOL=OFF -DWITH_TURBOJPEG:BOOL=OFF -DWITH_SIMD:BOOL=ON
+# and then tweaking
+
+$(eval $(call gb_UnpackedTarball_add_file,libjpeg-turbo,jconfigint.h,external/libjpeg-turbo/jconfigint.h))
+$(eval $(call gb_UnpackedTarball_add_file,libjpeg-turbo,jconfig.h,external/libjpeg-turbo/jconfig.h))
+$(eval $(call gb_UnpackedTarball_add_file,libjpeg-turbo,jversion.h,external/libjpeg-turbo/jversion.h))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libjpeg-turbo/include.patch b/external/libjpeg-turbo/include.patch
new file mode 100644
index 0000000000..0a36075ee7
--- /dev/null
+++ b/external/libjpeg-turbo/include.patch
@@ -0,0 +1,12 @@
+--- jpeglib.h
++++ jpeglib.h
+@@ -31,6 +31,9 @@
+ #include "jmorecfg.h" /* seldom changed options */
+
+
++#include <stdio.h>
++
++
+ #ifdef __cplusplus
+ #ifndef DONT_USE_EXTERN_C
+ extern "C" {
diff --git a/external/libjpeg-turbo/jconfig.h b/external/libjpeg-turbo/jconfig.h
new file mode 100644
index 0000000000..3855ccec9c
--- /dev/null
+++ b/external/libjpeg-turbo/jconfig.h
@@ -0,0 +1,55 @@
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
+ */
+#define JPEG_LIB_VERSION 62
+
+/* libjpeg-turbo version */
+#define LIBJPEG_TURBO_VERSION 2.1.5.1
+
+/* libjpeg-turbo version in integer form */
+#define LIBJPEG_TURBO_VERSION_NUMBER 2001005
+
+/* Support arithmetic encoding */
+#define C_ARITH_CODING_SUPPORTED 1
+
+/* Support arithmetic decoding */
+#define D_ARITH_CODING_SUPPORTED 1
+
+/* Support in-memory source/destination managers */
+#define MEM_SRCDST_SUPPORTED 1
+
+/* Use accelerated SIMD routines. */
+/* #undef WITH_SIMD */
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ * 8 for 8-bit sample values (the usual setting)
+ * 12 for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ * We do not support run-time selection of data precision, sorry.
+ */
+
+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
+
+/* Define if your (broken) compiler shifts signed values as if they were
+ unsigned. */
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
+
+/* Extra Libreoffice config for windows */
+#ifdef _MSC_VER
+
+/* Define "boolean" as unsigned char, not int, per Windows custom */
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+
+/* Define "INT32" as int, not long, per Windows custom */
+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
+typedef short INT16;
+typedef signed int INT32;
+#endif
+#define XMD_H /* prevent jmorecfg.h from redefining it */
+
+#endif /* _MSC_VER */
diff --git a/external/libjpeg-turbo/jconfigint.h b/external/libjpeg-turbo/jconfigint.h
new file mode 100644
index 0000000000..b7644cbac9
--- /dev/null
+++ b/external/libjpeg-turbo/jconfigint.h
@@ -0,0 +1,54 @@
+#include <sal/types.h>
+
+/* libjpeg-turbo build number */
+#define BUILD "20230315"
+
+/* Compiler's inline keyword */
+#undef inline
+
+/* How to obtain function inlining. */
+#if defined _MSC_VER
+#define INLINE __forceinline
+#elif defined __GNUC__
+#define INLINE __attribute__((always_inline)) inline
+#else
+#define INLINE inline
+#endif
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libjpeg-turbo"
+
+/* Version number of package */
+#define VERSION "2.1.5.1"
+
+/* The size of `size_t', as computed by sizeof. */
+/* #undef SIZEOF_SIZE_T */
+
+/* How to obtain thread-local storage */
+#define THREAD_LOCAL
+
+#if defined(__GNUC__) && SAL_TYPES_SIZEOFLONG == SIZEOF_SIZE_T
+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
+#define HAVE_BUILTIN_CTZL
+#endif
+
+/* Define to 1 if you have the <intrin.h> header file. */
+/* #undef HAVE_INTRIN_H */
+
+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
+#if (SIZEOF_SIZE_T == 8)
+#define HAVE_BITSCANFORWARD64
+#elif (SIZEOF_SIZE_T == 4)
+#define HAVE_BITSCANFORWARD
+#endif
+#endif
+
+#if defined(__has_attribute)
+#if __has_attribute(fallthrough)
+#define FALLTHROUGH __attribute__((fallthrough));
+#else
+#define FALLTHROUGH
+#endif
+#else
+#define FALLTHROUGH
+#endif
diff --git a/external/libjpeg-turbo/jversion.h b/external/libjpeg-turbo/jversion.h
new file mode 100644
index 0000000000..ea6de648d9
--- /dev/null
+++ b/external/libjpeg-turbo/jversion.h
@@ -0,0 +1,54 @@
+/*
+ * jversion.h
+ *
+ * This file was part of the Independent JPEG Group's software:
+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
+ * libjpeg-turbo Modifications:
+ * Copyright (C) 2010, 2012-2023, D. R. Commander.
+ * For conditions of distribution and use, see the accompanying README.ijg
+ * file.
+ *
+ * This file contains software version identification.
+ */
+
+
+#if JPEG_LIB_VERSION >= 80
+
+#define JVERSION "8d 15-Jan-2012"
+
+#elif JPEG_LIB_VERSION >= 70
+
+#define JVERSION "7 27-Jun-2009"
+
+#else
+
+#define JVERSION "6b 27-Mar-1998"
+
+#endif
+
+/*
+ * NOTE: It is our convention to place the authors in the following order:
+ * - libjpeg-turbo authors (2009-) in descending order of the date of their
+ * most recent contribution to the project, then in ascending order of the
+ * date of their first contribution to the project, then in alphabetical
+ * order
+ * - Upstream authors in descending order of the date of the first inclusion of
+ * their code
+ */
+
+#define JCOPYRIGHT \
+ "Copyright (C) 2009-2023 D. R. Commander\n" \
+ "Copyright (C) 2015, 2020 Google, Inc.\n" \
+ "Copyright (C) 2019-2020 Arm Limited\n" \
+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \
+ "Copyright (C) 2015 Intel Corporation\n" \
+ "Copyright (C) 2013-2014 Linaro Limited\n" \
+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding"
+
+#define JCOPYRIGHT_SHORT \
+ "Copyright (C) 1991-2023 The libjpeg-turbo Project and many others"