Skip to content

Commit

Permalink
external libs: update libjpeg to latest 9c release.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Nov 9, 2019
1 parent eb050b1 commit 3e88543
Show file tree
Hide file tree
Showing 196 changed files with 1,877 additions and 831 deletions.
2 changes: 1 addition & 1 deletion Android.mk
Expand Up @@ -4,7 +4,7 @@ SDL_IMAGE_LOCAL_PATH := $(call my-dir)
# Enable this if you want to support loading JPEG images
# The library path should be a relative path to this directory.
SUPPORT_JPG ?= true
JPG_LIBRARY_PATH := external/jpeg-9b
JPG_LIBRARY_PATH := external/jpeg-9c

# Enable this if you want to support loading PNG images
# The library path should be a relative path to this directory.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -24,7 +24,7 @@ target_compile_definitions(SDL2_image PRIVATE

if (SUPPORT_JPG)
target_compile_definitions(SDL2_image PRIVATE -DLOAD_JPG)
add_subdirectory(external/jpeg-9b)
add_subdirectory(external/jpeg-9c)
target_link_libraries(SDL2_image PRIVATE jpeg)
endif()

Expand Down
28 changes: 14 additions & 14 deletions VisualC/external/include/jpeglib.h
Expand Up @@ -2,7 +2,7 @@
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2015 by Guido Vollbeding.
* Modified 2002-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
Expand Down Expand Up @@ -39,7 +39,7 @@ extern "C" {

#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
#define JPEG_LIB_VERSION_MAJOR 9
#define JPEG_LIB_VERSION_MINOR 2
#define JPEG_LIB_VERSION_MINOR 3


/* Various constants determining the sizes of things.
Expand Down Expand Up @@ -137,9 +137,9 @@ typedef struct {
/* The decompressor output side may not use these variables. */
int dc_tbl_no; /* DC entropy table selector (0..3) */
int ac_tbl_no; /* AC entropy table selector (0..3) */

/* Remaining fields should be treated as private by applications. */

/* These values are computed during compression or decompression startup: */
/* Component's size in DCT blocks.
* Any dummy blocks added to complete an MCU are not counted; therefore
Expand Down Expand Up @@ -411,21 +411,21 @@ struct jpeg_compress_struct {
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
/* The coefficient controller receives data in units of MCU rows as defined
* for fully interleaved scans (whether the JPEG file is interleaved or not).
* There are v_samp_factor * DCTSIZE sample rows of each component in an
* "iMCU" (interleaved MCU) row.
* There are v_samp_factor * DCT_v_scaled_size sample rows of each component
* in an "iMCU" (interleaved MCU) row.
*/

/*
* These fields are valid during any one scan.
* They describe the components and MCUs actually appearing in the scan.
*/
int comps_in_scan; /* # of JPEG components in this scan */
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
/* *cur_comp_info[i] describes component that appears i'th in SOS */

JDIMENSION MCUs_per_row; /* # of MCUs across the image */
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */

int blocks_in_MCU; /* # of DCT blocks per MCU */
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
/* MCU_membership[i] is index in cur_comp_info of component owning */
Expand Down Expand Up @@ -636,7 +636,7 @@ struct jpeg_decompress_struct {
* in fully interleaved JPEG scans, but are used whether the scan is
* interleaved or not. We define an iMCU row as v_samp_factor DCT block
* rows of each component. Therefore, the IDCT output contains
* v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
* v_samp_factor * DCT_v_scaled_size sample rows of a component per iMCU row.
*/

JSAMPLE * sample_range_limit; /* table for fast range-limiting */
Expand Down Expand Up @@ -711,7 +711,7 @@ struct jpeg_error_mgr {
#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
/* Reset error state variables at start of a new image */
JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));

/* The message ID code and any parameters are saved here.
* A message can have one string parameter or up to 8 int parameters.
*/
Expand All @@ -721,11 +721,11 @@ struct jpeg_error_mgr {
int i[8];
char s[JMSG_STR_PARM_MAX];
} msg_parm;

/* Standard state variables for error facility */

int trace_level; /* max msg_level that will be displayed */

/* For recoverable corrupt-data errors, we emit a warning message,
* but keep going unless emit_message chooses to abort. emit_message
* should count warnings in num_warnings. The surrounding application
Expand Down
Binary file modified VisualC/external/lib/x64/libjpeg-9.dll
Binary file not shown.
Binary file modified VisualC/external/lib/x86/libjpeg-9.dll
Binary file not shown.
84 changes: 0 additions & 84 deletions external/jpeg-9b/jcinit.c

This file was deleted.

24 changes: 12 additions & 12 deletions external/jpeg-9b.patch → external/jpeg-9c.patch
@@ -1,6 +1,6 @@
diff -ruN jpeg-9b.orig/Android.mk jpeg-9b/Android.mk
--- jpeg-9b.orig/Android.mk 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/Android.mk 2017-10-23 07:33:24.698623073 -0700
diff -u /dev/null jpeg-9c/Android.mk
--- /dev/null
+++ jpeg-9c/Android.mk
@@ -0,0 +1,37 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
Expand Down Expand Up @@ -39,9 +39,9 @@ diff -ruN jpeg-9b.orig/Android.mk jpeg-9b/Android.mk
+LOCAL_MODULE:= jpeg
+
+include $(BUILD_STATIC_LIBRARY)
diff -ruN jpeg-9b.orig/jconfig.h jpeg-9b/jconfig.h
--- jpeg-9b.orig/jconfig.h 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/jconfig.h 2017-10-22 10:55:55.745170265 -0700
diff -u /dev/null jpeg-9c/jconfig.h
--- /dev/null
+++ jpeg-9c/jconfig.h
@@ -0,0 +1,156 @@
+/* android jconfig.h */
+/*
Expand Down Expand Up @@ -199,9 +199,9 @@ diff -ruN jpeg-9b.orig/jconfig.h jpeg-9b/jconfig.h
+
+
+#endif /* JPEG_CJPEG_DJPEG */
diff -ruN jpeg-9b.orig/jidctfst.S jpeg-9b/jidctfst.S
--- jpeg-9b.orig/jidctfst.S 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/jidctfst.S 2017-10-22 10:55:55.829170262 -0700
diff -u /dev/null jpeg-9c/jidctfst.S
--- /dev/null
+++ jpeg-9c/jidctfst.S
@@ -0,0 +1,476 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
Expand Down Expand Up @@ -679,9 +679,9 @@ diff -ruN jpeg-9b.orig/jidctfst.S jpeg-9b/jidctfst.S
+ b HLoopTail
+
+ .endfunc
diff -ruN jpeg-9b.orig/jmem-android.c jpeg-9b/jmem-android.c
--- jpeg-9b.orig/jmem-android.c 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/jmem-android.c 2017-10-22 10:55:55.833170261 -0700
diff -u /dev/null jpeg-9c/jmem-android.c
--- /dev/null
+++ jpeg-9c/jmem-android.c
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2007-2008 The Android Open Source Project
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 14 additions & 10 deletions external/jpeg-9b/Makefile.am → external/jpeg-9c/Makefile.am
Expand Up @@ -35,15 +35,15 @@ DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
# Makefiles for various systems
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \
makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \
makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \
makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \
makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \
makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \
makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \
makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \
makefile.sas makefile.mms makefile.vms makvms.opt
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makewmak.vc6 makejsln.v15 makeasln.v15 makejvcx.v15 makejfil.v15 \
makecvcx.v15 makecfil.v15 makedvcx.v15 makedfil.v15 maketvcx.v15 \
maketfil.v15 makervcx.v15 makerfil.v15 makewvcx.v15 makewfil.v15 \
makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt

# Configuration files
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
Expand All @@ -55,7 +55,7 @@ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib

# Miscellaneous support files
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in

# Test support files
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
Expand Down Expand Up @@ -103,6 +103,10 @@ noinst_HEADERS = $(OTHERINCLUDES)
EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \
$(OTHERFILES) $(TESTFILES)

# pkg-config file
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = libjpeg.pc

# Files to be cleaned
CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \
testoutt.jpg
Expand Down

0 comments on commit 3e88543

Please sign in to comment.