From b06f7b87896639e9708cd6ccb10b365a5ee88c0c Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Fri, 13 May 2022 19:13:30 -0400 Subject: [PATCH] Switch to libjpeg-turbo (version 2.0.7 ESR). --- .gitmodules | 2 +- project/Build.xml | 1 + project/lib/jpeg | 2 +- project/lib/jpeg-files.xml | 143 ++++++++++++------------ project/lib/overrides/jpeg/jconfig.h | 73 ++++++++++++ project/lib/overrides/jpeg/jconfigint.h | 44 ++++++++ project/lib/overrides/jpeg/jversion.h | 54 +++++++++ 7 files changed, 248 insertions(+), 71 deletions(-) create mode 100644 project/lib/overrides/jpeg/jconfig.h create mode 100644 project/lib/overrides/jpeg/jconfigint.h create mode 100644 project/lib/overrides/jpeg/jversion.h diff --git a/.gitmodules b/.gitmodules index 4a23951d4..5ac12d801 100644 --- a/.gitmodules +++ b/.gitmodules @@ -32,7 +32,7 @@ shallow = true [submodule "project/lib/jpeg"] path = project/lib/jpeg - url = https://github.com/openfl/libjpeg + url = https://github.com/libjpeg-turbo/libjpeg-turbo shallow = true [submodule "project/lib/freetype"] path = project/lib/freetype diff --git a/project/Build.xml b/project/Build.xml index 23068d800..60af884ad 100644 --- a/project/Build.xml +++ b/project/Build.xml @@ -137,6 +137,7 @@
+ diff --git a/project/lib/jpeg b/project/lib/jpeg index a105289f5..e811baf30 160000 --- a/project/lib/jpeg +++ b/project/lib/jpeg @@ -1 +1 @@ -Subproject commit a105289f5a6cdcd1363e3d2f1c31af4954b374cc +Subproject commit e811baf301c8719978fd1a878595e7dffa94b522 diff --git a/project/lib/jpeg-files.xml b/project/lib/jpeg-files.xml index f644e0c4e..879cf78af 100644 --- a/project/lib/jpeg-files.xml +++ b/project/lib/jpeg-files.xml @@ -1,75 +1,80 @@ - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/project/lib/overrides/jpeg/jconfig.h b/project/lib/overrides/jpeg/jconfig.h new file mode 100644 index 000000000..87e0fc57b --- /dev/null +++ b/project/lib/overrides/jpeg/jconfig.h @@ -0,0 +1,73 @@ +/* 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.0.7 + +/* libjpeg-turbo version in integer form */ +#define LIBJPEG_TURBO_VERSION_NUMBER 2000007 + +/* 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. */ +#define WITH_SIMD 1 + +/* + * 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 to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if you need to include to get size_t. */ +#define NEED_SYS_TYPES_H 1 + +/* Define if you have BSD-like bzero and bcopy in rather than + memset/memcpy in . */ +/* #undef NEED_BSD_STRINGS */ + +/* Define to 1 if the system has the type `unsigned char'. */ +#define HAVE_UNSIGNED_CHAR 1 + +/* Define to 1 if the system has the type `unsigned short'. */ +#define HAVE_UNSIGNED_SHORT 1 + +/* Compiler does not support pointers to undefined structures. */ +/* #undef INCOMPLETE_TYPES_BROKEN */ + +/* Define if your (broken) compiler shifts signed values as if they were + unsigned. */ +/* #undef RIGHT_SHIFT_IS_UNSIGNED */ + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* #undef __CHAR_UNSIGNED__ */ +#endif + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/project/lib/overrides/jpeg/jconfigint.h b/project/lib/overrides/jpeg/jconfigint.h new file mode 100644 index 000000000..98f5895a5 --- /dev/null +++ b/project/lib/overrides/jpeg/jconfigint.h @@ -0,0 +1,44 @@ +/* libjpeg-turbo build number */ +#define BUILD "20220513" + +/* Compiler's inline keyword */ +#undef inline + +/* How to obtain function inlining. */ +#define INLINE __inline__ __attribute__((always_inline)) + +/* How to obtain thread-local storage */ +#define THREAD_LOCAL __thread + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libjpeg-turbo" + +/* Version number of package */ +#define VERSION "2.0.7" + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */ +#define HAVE_BUILTIN_CTZL + +/* Define to 1 if you have the 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/project/lib/overrides/jpeg/jversion.h b/project/lib/overrides/jpeg/jversion.h new file mode 100644 index 000000000..015b38e93 --- /dev/null +++ b/project/lib/overrides/jpeg/jversion.h @@ -0,0 +1,54 @@ +/* + * jversion.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. + * libjpeg-turbo Modifications: + * Copyright (C) 2010, 2012-2022, 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-2022 D. R. Commander\n" \ + "Copyright (C) 2015, 2020 Google, Inc.\n" \ + "Copyright (C) 2019 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-2017 Thomas G. Lane, Guido Vollbeding" + +#define JCOPYRIGHT_SHORT \ + "Copyright (C) 1991-2022 The libjpeg-turbo Project and many others"