Compare commits

...

3 Commits

Author SHA1 Message Date
Guido Vollbeding
9fc018fd1a The Independent JPEG Group's JPEG software v9d 2020-10-23 10:00:48 -05:00
Guido Vollbeding
96e4e7eb60 The Independent JPEG Group's JPEG software v9c 2020-10-23 09:56:39 -05:00
Guido Vollbeding
a560e4b423 The Independent JPEG Group's JPEG software v9b 2016-02-16 12:27:41 -06:00
125 changed files with 14651 additions and 7275 deletions

View File

@@ -33,17 +33,17 @@ DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
structure.txt coderules.txt filelist.txt change.log structure.txt coderules.txt filelist.txt change.log
# Makefiles for various systems # Makefiles for various systems
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
# Configuration files # Configuration files
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
@@ -55,11 +55,11 @@ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
# Miscellaneous support files # 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 # Test support files
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
# libtool libraries to build # libtool libraries to build
lib_LTLIBRARIES = libjpeg.la lib_LTLIBRARIES = libjpeg.la
@@ -103,9 +103,13 @@ noinst_HEADERS = $(OTHERINCLUDES)
EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \ EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \
$(OTHERFILES) $(TESTFILES) $(OTHERFILES) $(TESTFILES)
# pkg-config file
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = libjpeg.pc
# Files to be cleaned # Files to be cleaned
CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \ CLEANFILES = testout.ppm testout.gif testout.bmp testout.jpg testoutp.ppm \
testoutt.jpg testoutp.jpg testoutt.jpg
# Install jconfig.h # Install jconfig.h
install-data-local: install-data-local:
@@ -121,12 +125,14 @@ test: check-local
check-local: check-local:
rm -f testout* rm -f testout*
./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
./djpeg -dct int -gif -outfile testout.gif $(srcdir)/testorig.jpg
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
cmp $(srcdir)/testimg.ppm testout.ppm cmp $(srcdir)/testimg.ppm testout.ppm
cmp $(srcdir)/testimg.gif testout.gif
cmp $(srcdir)/testimg.bmp testout.bmp cmp $(srcdir)/testimg.bmp testout.bmp
cmp $(srcdir)/testimg.jpg testout.jpg cmp $(srcdir)/testimg.jpg testout.jpg
cmp $(srcdir)/testimg.ppm testoutp.ppm cmp $(srcdir)/testimg.ppm testoutp.ppm

View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am. # Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc. # Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -22,8 +22,19 @@
VPATH = @srcdir@ VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \ am__make_running_with_option = \
case $${target_option-} in \ case $${target_option-} in \
?) ;; \ ?) ;; \
@@ -91,20 +102,22 @@ target_triplet = @target@
bin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \ bin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \
rdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT) rdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT)
subdir = . subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/jconfig.cfg depcomp $(include_HEADERS) \
$(noinst_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(include_HEADERS) $(noinst_HEADERS)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = jconfig.h CONFIG_HEADER = jconfig.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES = libjpeg.pc
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(includedir)"
PROGRAMS = $(bin_PROGRAMS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \ am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -132,8 +145,6 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \ $(am__cd) "$$dir" && rm -f $$files; }; \
} }
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES) LTLIBRARIES = $(lib_LTLIBRARIES)
libjpeg_la_LIBADD = libjpeg_la_LIBADD =
am__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \ am__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \
@@ -155,7 +166,6 @@ am__v_lt_1 =
libjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ libjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@ $(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS)
am_cjpeg_OBJECTS = cjpeg.$(OBJEXT) rdppm.$(OBJEXT) rdgif.$(OBJEXT) \ am_cjpeg_OBJECTS = cjpeg.$(OBJEXT) rdppm.$(OBJEXT) rdgif.$(OBJEXT) \
rdtarga.$(OBJEXT) rdrle.$(OBJEXT) rdbmp.$(OBJEXT) \ rdtarga.$(OBJEXT) rdrle.$(OBJEXT) rdbmp.$(OBJEXT) \
rdswitch.$(OBJEXT) cdjpeg.$(OBJEXT) rdswitch.$(OBJEXT) cdjpeg.$(OBJEXT)
@@ -190,7 +200,40 @@ am__v_at_0 = @
am__v_at_1 = am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/@MEMORYMGR@.Plo \
./$(DEPDIR)/cdjpeg.Po ./$(DEPDIR)/cjpeg.Po \
./$(DEPDIR)/djpeg.Po ./$(DEPDIR)/jaricom.Plo \
./$(DEPDIR)/jcapimin.Plo ./$(DEPDIR)/jcapistd.Plo \
./$(DEPDIR)/jcarith.Plo ./$(DEPDIR)/jccoefct.Plo \
./$(DEPDIR)/jccolor.Plo ./$(DEPDIR)/jcdctmgr.Plo \
./$(DEPDIR)/jchuff.Plo ./$(DEPDIR)/jcinit.Plo \
./$(DEPDIR)/jcmainct.Plo ./$(DEPDIR)/jcmarker.Plo \
./$(DEPDIR)/jcmaster.Plo ./$(DEPDIR)/jcomapi.Plo \
./$(DEPDIR)/jcparam.Plo ./$(DEPDIR)/jcprepct.Plo \
./$(DEPDIR)/jcsample.Plo ./$(DEPDIR)/jctrans.Plo \
./$(DEPDIR)/jdapimin.Plo ./$(DEPDIR)/jdapistd.Plo \
./$(DEPDIR)/jdarith.Plo ./$(DEPDIR)/jdatadst.Plo \
./$(DEPDIR)/jdatasrc.Plo ./$(DEPDIR)/jdcoefct.Plo \
./$(DEPDIR)/jdcolor.Plo ./$(DEPDIR)/jddctmgr.Plo \
./$(DEPDIR)/jdhuff.Plo ./$(DEPDIR)/jdinput.Plo \
./$(DEPDIR)/jdmainct.Plo ./$(DEPDIR)/jdmarker.Plo \
./$(DEPDIR)/jdmaster.Plo ./$(DEPDIR)/jdmerge.Plo \
./$(DEPDIR)/jdpostct.Plo ./$(DEPDIR)/jdsample.Plo \
./$(DEPDIR)/jdtrans.Plo ./$(DEPDIR)/jerror.Plo \
./$(DEPDIR)/jfdctflt.Plo ./$(DEPDIR)/jfdctfst.Plo \
./$(DEPDIR)/jfdctint.Plo ./$(DEPDIR)/jidctflt.Plo \
./$(DEPDIR)/jidctfst.Plo ./$(DEPDIR)/jidctint.Plo \
./$(DEPDIR)/jmemmgr.Plo ./$(DEPDIR)/jpegtran.Po \
./$(DEPDIR)/jquant1.Plo ./$(DEPDIR)/jquant2.Plo \
./$(DEPDIR)/jutils.Plo ./$(DEPDIR)/rdbmp.Po \
./$(DEPDIR)/rdcolmap.Po ./$(DEPDIR)/rdgif.Po \
./$(DEPDIR)/rdjpgcom.Po ./$(DEPDIR)/rdppm.Po \
./$(DEPDIR)/rdrle.Po ./$(DEPDIR)/rdswitch.Po \
./$(DEPDIR)/rdtarga.Po ./$(DEPDIR)/transupp.Po \
./$(DEPDIR)/wrbmp.Po ./$(DEPDIR)/wrgif.Po \
./$(DEPDIR)/wrjpgcom.Po ./$(DEPDIR)/wrppm.Po \
./$(DEPDIR)/wrrle.Po ./$(DEPDIR)/wrtarga.Po
am__mv = mv -f am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -220,6 +263,7 @@ am__can_run_installinfo = \
man1dir = $(mandir)/man1 man1dir = $(mandir)/man1
NROFF = nroff NROFF = nroff
MANS = $(man_MANS) MANS = $(man_MANS)
DATA = $(nodist_pkgconfig_DATA)
HEADERS = $(include_HEADERS) $(noinst_HEADERS) HEADERS = $(include_HEADERS) $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)jconfig.cfg $(LISP)jconfig.cfg
@@ -276,6 +320,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JPEG_LIB_VERSION = @JPEG_LIB_VERSION@ JPEG_LIB_VERSION = @JPEG_LIB_VERSION@
JPEG_LIB_VERSION_MAJOR = @JPEG_LIB_VERSION_MAJOR@
JPEG_LIB_VERSION_MINOR = @JPEG_LIB_VERSION_MINOR@
LD = @LD@ LD = @LD@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
@@ -284,6 +330,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@ LIPO = @LIPO@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@ MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -397,17 +444,17 @@ DOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \
# Makefiles for various systems # Makefiles for various systems
MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
# Configuration files # Configuration files
@@ -422,11 +469,11 @@ CONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp \
# Miscellaneous support files # 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 # Test support files
TESTFILES = testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES = testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
# libtool libraries to build # libtool libraries to build
@@ -467,9 +514,13 @@ EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \
$(OTHERFILES) $(TESTFILES) $(OTHERFILES) $(TESTFILES)
# pkg-config file
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = libjpeg.pc
# Files to be cleaned # Files to be cleaned
CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \ CLEANFILES = testout.ppm testout.gif testout.bmp testout.jpg testoutp.ppm \
testoutt.jpg testoutp.jpg testoutt.jpg
all: jconfig.h all: jconfig.h
$(MAKE) $(AM_MAKEFLAGS) all-am $(MAKE) $(AM_MAKEFLAGS) all-am
@@ -491,15 +542,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
echo ' $(SHELL) ./config.status'; \ echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \ $(SHELL) ./config.status;; \
*) \ *) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac; esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -525,44 +575,8 @@ $(srcdir)/jconfig.cfg: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
distclean-hdr: distclean-hdr:
-rm -f jconfig.h stamp-h1 -rm -f jconfig.h stamp-h1
libjpeg.pc: $(top_builddir)/config.status $(srcdir)/libjpeg.pc.in
install-libLTLIBRARIES: $(lib_LTLIBRARIES) cd $(top_builddir) && $(SHELL) ./config.status $@
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES)
$(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS) install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -613,6 +627,44 @@ clean-binPROGRAMS:
echo " rm -f" $$list; \ echo " rm -f" $$list; \
rm -f $$list rm -f $$list
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES)
$(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)
cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES) cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES)
@rm -f cjpeg$(EXEEXT) @rm -f cjpeg$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS) $(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS)
@@ -639,71 +691,77 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -777,6 +835,27 @@ uninstall-man1:
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-nodist_pkgconfigDATA: $(nodist_pkgconfig_DATA)
@$(NORMAL_INSTALL)
@list='$(nodist_pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
done
uninstall-nodist_pkgconfigDATA:
@$(NORMAL_UNINSTALL)
@list='$(nodist_pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
install-includeHEADERS: $(include_HEADERS) install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
@@ -860,12 +939,12 @@ distclean-tags:
check-am: all-am check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local $(MAKE) $(AM_MAKEFLAGS) check-local
check: check-am check: check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \ all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(MANS) $(DATA) $(HEADERS) \
jconfig.h jconfig.h
install-binPROGRAMS: install-libLTLIBRARIES install-binPROGRAMS: install-libLTLIBRARIES
installdirs: installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)"; do \ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done done
install: install-am install: install-am
@@ -906,7 +985,71 @@ clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
distclean: distclean-am distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR) -rm -f ./$(DEPDIR)/@MEMORYMGR@.Plo
-rm -f ./$(DEPDIR)/cdjpeg.Po
-rm -f ./$(DEPDIR)/cjpeg.Po
-rm -f ./$(DEPDIR)/djpeg.Po
-rm -f ./$(DEPDIR)/jaricom.Plo
-rm -f ./$(DEPDIR)/jcapimin.Plo
-rm -f ./$(DEPDIR)/jcapistd.Plo
-rm -f ./$(DEPDIR)/jcarith.Plo
-rm -f ./$(DEPDIR)/jccoefct.Plo
-rm -f ./$(DEPDIR)/jccolor.Plo
-rm -f ./$(DEPDIR)/jcdctmgr.Plo
-rm -f ./$(DEPDIR)/jchuff.Plo
-rm -f ./$(DEPDIR)/jcinit.Plo
-rm -f ./$(DEPDIR)/jcmainct.Plo
-rm -f ./$(DEPDIR)/jcmarker.Plo
-rm -f ./$(DEPDIR)/jcmaster.Plo
-rm -f ./$(DEPDIR)/jcomapi.Plo
-rm -f ./$(DEPDIR)/jcparam.Plo
-rm -f ./$(DEPDIR)/jcprepct.Plo
-rm -f ./$(DEPDIR)/jcsample.Plo
-rm -f ./$(DEPDIR)/jctrans.Plo
-rm -f ./$(DEPDIR)/jdapimin.Plo
-rm -f ./$(DEPDIR)/jdapistd.Plo
-rm -f ./$(DEPDIR)/jdarith.Plo
-rm -f ./$(DEPDIR)/jdatadst.Plo
-rm -f ./$(DEPDIR)/jdatasrc.Plo
-rm -f ./$(DEPDIR)/jdcoefct.Plo
-rm -f ./$(DEPDIR)/jdcolor.Plo
-rm -f ./$(DEPDIR)/jddctmgr.Plo
-rm -f ./$(DEPDIR)/jdhuff.Plo
-rm -f ./$(DEPDIR)/jdinput.Plo
-rm -f ./$(DEPDIR)/jdmainct.Plo
-rm -f ./$(DEPDIR)/jdmarker.Plo
-rm -f ./$(DEPDIR)/jdmaster.Plo
-rm -f ./$(DEPDIR)/jdmerge.Plo
-rm -f ./$(DEPDIR)/jdpostct.Plo
-rm -f ./$(DEPDIR)/jdsample.Plo
-rm -f ./$(DEPDIR)/jdtrans.Plo
-rm -f ./$(DEPDIR)/jerror.Plo
-rm -f ./$(DEPDIR)/jfdctflt.Plo
-rm -f ./$(DEPDIR)/jfdctfst.Plo
-rm -f ./$(DEPDIR)/jfdctint.Plo
-rm -f ./$(DEPDIR)/jidctflt.Plo
-rm -f ./$(DEPDIR)/jidctfst.Plo
-rm -f ./$(DEPDIR)/jidctint.Plo
-rm -f ./$(DEPDIR)/jmemmgr.Plo
-rm -f ./$(DEPDIR)/jpegtran.Po
-rm -f ./$(DEPDIR)/jquant1.Plo
-rm -f ./$(DEPDIR)/jquant2.Plo
-rm -f ./$(DEPDIR)/jutils.Plo
-rm -f ./$(DEPDIR)/rdbmp.Po
-rm -f ./$(DEPDIR)/rdcolmap.Po
-rm -f ./$(DEPDIR)/rdgif.Po
-rm -f ./$(DEPDIR)/rdjpgcom.Po
-rm -f ./$(DEPDIR)/rdppm.Po
-rm -f ./$(DEPDIR)/rdrle.Po
-rm -f ./$(DEPDIR)/rdswitch.Po
-rm -f ./$(DEPDIR)/rdtarga.Po
-rm -f ./$(DEPDIR)/transupp.Po
-rm -f ./$(DEPDIR)/wrbmp.Po
-rm -f ./$(DEPDIR)/wrgif.Po
-rm -f ./$(DEPDIR)/wrjpgcom.Po
-rm -f ./$(DEPDIR)/wrppm.Po
-rm -f ./$(DEPDIR)/wrrle.Po
-rm -f ./$(DEPDIR)/wrtarga.Po
-rm -f Makefile -rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \ distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags distclean-hdr distclean-libtool distclean-tags
@@ -923,7 +1066,8 @@ info: info-am
info-am: info-am:
install-data-am: install-data-local install-includeHEADERS install-man install-data-am: install-data-local install-includeHEADERS install-man \
install-nodist_pkgconfigDATA
install-dvi: install-dvi-am install-dvi: install-dvi-am
@@ -954,7 +1098,71 @@ installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR) -rm -f ./$(DEPDIR)/@MEMORYMGR@.Plo
-rm -f ./$(DEPDIR)/cdjpeg.Po
-rm -f ./$(DEPDIR)/cjpeg.Po
-rm -f ./$(DEPDIR)/djpeg.Po
-rm -f ./$(DEPDIR)/jaricom.Plo
-rm -f ./$(DEPDIR)/jcapimin.Plo
-rm -f ./$(DEPDIR)/jcapistd.Plo
-rm -f ./$(DEPDIR)/jcarith.Plo
-rm -f ./$(DEPDIR)/jccoefct.Plo
-rm -f ./$(DEPDIR)/jccolor.Plo
-rm -f ./$(DEPDIR)/jcdctmgr.Plo
-rm -f ./$(DEPDIR)/jchuff.Plo
-rm -f ./$(DEPDIR)/jcinit.Plo
-rm -f ./$(DEPDIR)/jcmainct.Plo
-rm -f ./$(DEPDIR)/jcmarker.Plo
-rm -f ./$(DEPDIR)/jcmaster.Plo
-rm -f ./$(DEPDIR)/jcomapi.Plo
-rm -f ./$(DEPDIR)/jcparam.Plo
-rm -f ./$(DEPDIR)/jcprepct.Plo
-rm -f ./$(DEPDIR)/jcsample.Plo
-rm -f ./$(DEPDIR)/jctrans.Plo
-rm -f ./$(DEPDIR)/jdapimin.Plo
-rm -f ./$(DEPDIR)/jdapistd.Plo
-rm -f ./$(DEPDIR)/jdarith.Plo
-rm -f ./$(DEPDIR)/jdatadst.Plo
-rm -f ./$(DEPDIR)/jdatasrc.Plo
-rm -f ./$(DEPDIR)/jdcoefct.Plo
-rm -f ./$(DEPDIR)/jdcolor.Plo
-rm -f ./$(DEPDIR)/jddctmgr.Plo
-rm -f ./$(DEPDIR)/jdhuff.Plo
-rm -f ./$(DEPDIR)/jdinput.Plo
-rm -f ./$(DEPDIR)/jdmainct.Plo
-rm -f ./$(DEPDIR)/jdmarker.Plo
-rm -f ./$(DEPDIR)/jdmaster.Plo
-rm -f ./$(DEPDIR)/jdmerge.Plo
-rm -f ./$(DEPDIR)/jdpostct.Plo
-rm -f ./$(DEPDIR)/jdsample.Plo
-rm -f ./$(DEPDIR)/jdtrans.Plo
-rm -f ./$(DEPDIR)/jerror.Plo
-rm -f ./$(DEPDIR)/jfdctflt.Plo
-rm -f ./$(DEPDIR)/jfdctfst.Plo
-rm -f ./$(DEPDIR)/jfdctint.Plo
-rm -f ./$(DEPDIR)/jidctflt.Plo
-rm -f ./$(DEPDIR)/jidctfst.Plo
-rm -f ./$(DEPDIR)/jidctint.Plo
-rm -f ./$(DEPDIR)/jmemmgr.Plo
-rm -f ./$(DEPDIR)/jpegtran.Po
-rm -f ./$(DEPDIR)/jquant1.Plo
-rm -f ./$(DEPDIR)/jquant2.Plo
-rm -f ./$(DEPDIR)/jutils.Plo
-rm -f ./$(DEPDIR)/rdbmp.Po
-rm -f ./$(DEPDIR)/rdcolmap.Po
-rm -f ./$(DEPDIR)/rdgif.Po
-rm -f ./$(DEPDIR)/rdjpgcom.Po
-rm -f ./$(DEPDIR)/rdppm.Po
-rm -f ./$(DEPDIR)/rdrle.Po
-rm -f ./$(DEPDIR)/rdswitch.Po
-rm -f ./$(DEPDIR)/rdtarga.Po
-rm -f ./$(DEPDIR)/transupp.Po
-rm -f ./$(DEPDIR)/wrbmp.Po
-rm -f ./$(DEPDIR)/wrgif.Po
-rm -f ./$(DEPDIR)/wrjpgcom.Po
-rm -f ./$(DEPDIR)/wrppm.Po
-rm -f ./$(DEPDIR)/wrrle.Po
-rm -f ./$(DEPDIR)/wrtarga.Po
-rm -f Makefile -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -972,30 +1180,35 @@ ps: ps-am
ps-am: ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES uninstall-local uninstall-man uninstall-libLTLIBRARIES uninstall-local uninstall-man \
uninstall-nodist_pkgconfigDATA
uninstall-man: uninstall-man1 uninstall-man: uninstall-man1
.MAKE: all check-am install-am install-strip .MAKE: all check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \ .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
check-local clean clean-binPROGRAMS clean-cscope clean-generic \ check-am check-local clean clean-binPROGRAMS clean-cscope \
clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ clean-generic clean-libLTLIBRARIES clean-libtool cscope \
ctags-am distclean distclean-compile distclean-generic \ cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-hdr distclean-libtool distclean-tags dvi dvi-am html \ distclean-generic distclean-hdr distclean-libtool \
html-am info info-am install install-am install-binPROGRAMS \ distclean-tags dvi dvi-am html html-am info info-am install \
install-data install-data-am install-data-local install-dvi \ install-am install-binPROGRAMS install-data install-data-am \
install-dvi-am install-exec install-exec-am install-html \ install-data-local install-dvi install-dvi-am install-exec \
install-html-am install-includeHEADERS install-info \ install-exec-am install-html install-html-am \
install-info-am install-libLTLIBRARIES install-man \ install-includeHEADERS install-info install-info-am \
install-man1 install-pdf install-pdf-am install-ps \ install-libLTLIBRARIES install-man install-man1 \
install-ps-am install-strip installcheck installcheck-am \ install-nodist_pkgconfigDATA install-pdf install-pdf-am \
installdirs maintainer-clean maintainer-clean-generic \ install-ps install-ps-am install-strip installcheck \
mostlyclean mostlyclean-compile mostlyclean-generic \ installcheck-am installdirs maintainer-clean \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ maintainer-clean-generic mostlyclean mostlyclean-compile \
uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall-libLTLIBRARIES uninstall-local uninstall-man \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-man1 uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-local uninstall-man uninstall-man1 \
uninstall-nodist_pkgconfigDATA
.PRECIOUS: Makefile
# Install jconfig.h # Install jconfig.h
@@ -1012,12 +1225,14 @@ test: check-local
check-local: check-local:
rm -f testout* rm -f testout*
./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
./djpeg -dct int -gif -outfile testout.gif $(srcdir)/testorig.jpg
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
cmp $(srcdir)/testimg.ppm testout.ppm cmp $(srcdir)/testimg.ppm testout.ppm
cmp $(srcdir)/testimg.gif testout.gif
cmp $(srcdir)/testimg.bmp testout.bmp cmp $(srcdir)/testimg.bmp testout.bmp
cmp $(srcdir)/testimg.jpg testout.jpg cmp $(srcdir)/testimg.jpg testout.jpg
cmp $(srcdir)/testimg.ppm testoutp.ppm cmp $(srcdir)/testimg.ppm testoutp.ppm

52
README
View File

@@ -1,7 +1,7 @@
The Independent JPEG Group's JPEG software The Independent JPEG Group's JPEG software
========================================== ==========================================
README for release 9a of 19-Jan-2014 README for release 9d of 12-Jan-2020
==================================== ====================================
This distribution contains the ninth public release of the Independent JPEG This distribution contains the ninth public release of the Independent JPEG
@@ -10,8 +10,8 @@ to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, John Korejwa, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
and other members of the Independent JPEG Group. Ge' Weijers, and other members of the Independent JPEG Group.
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
(previously known as JPEG, together with ITU-T SG16). (previously known as JPEG, together with ITU-T SG16).
@@ -60,7 +60,7 @@ OVERVIEW
This package contains C software to implement JPEG image encoding, decoding, This package contains C software to implement JPEG image encoding, decoding,
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
method for full-color and gray-scale images. method for full-color and grayscale images.
This software implements JPEG baseline, extended-sequential, and progressive This software implements JPEG baseline, extended-sequential, and progressive
compression processes. Provision is made for supporting all variants of these compression processes. Provision is made for supporting all variants of these
@@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you, fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy. its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below. All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this Permission is hereby granted to use, copy, modify, and distribute this
@@ -152,18 +152,6 @@ The same holds for its supporting scripts (config.guess, config.sub,
ltmain.sh). Another support script, install-sh, is copyright by X Consortium ltmain.sh). Another support script, install-sh, is copyright by X Consortium
but is also freely distributable. but is also freely distributable.
The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
support has been removed altogether, and the GIF writer has been simplified
to produce "uncompressed GIFs". This technique does not use the LZW
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.
We are required to state that
"The Graphics Interchange Format(c) is the Copyright property of
CompuServe Incorporated. GIF(sm) is a Service Mark property of
CompuServe Incorporated."
REFERENCES REFERENCES
========== ==========
@@ -176,8 +164,8 @@ The best short technical introduction to the JPEG compression algorithm is
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
(Adjacent articles in that issue discuss MPEG motion picture compression, (Adjacent articles in that issue discuss MPEG motion picture compression,
applications of JPEG, and related topics.) If you don't have the CACM issue applications of JPEG, and related topics.) If you don't have the CACM issue
handy, a PostScript file containing a revised version of Wallace's article is handy, a PDF file containing a revised version of Wallace's article is
available at http://www.ijg.org/files/wallace.ps.gz. The file (actually available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
a preprint for an article that appeared in IEEE Trans. Consumer Electronics) a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
omits the sample images that appeared in CACM, but it includes corrections omits the sample images that appeared in CACM, but it includes corrections
and some added material. Note: the Wallace article is copyright ACM and IEEE, and some added material. Note: the Wallace article is copyright ACM and IEEE,
@@ -225,14 +213,13 @@ WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris,
France. France.
The JPEG standard does not specify all details of an interchangeable file The JPEG standard does not specify all details of an interchangeable file
format. For the omitted details we follow the "JFIF" conventions, revision format. For the omitted details we follow the "JFIF" conventions, version 2.
1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report JFIF version 1 has been adopted as Recommendation ITU-T T.871 (05/2011) :
and thus received a formal publication status. It is available as a free Information technology - Digital compression and coding of continuous-tone
download in PDF format from still images: JPEG File Interchange Format (JFIF). It is available as a
http://www.ecma-international.org/publications/techreports/E-TR-098.htm. free download in PDF file format from http://www.itu.int/rec/T-REC-T.871.
A PostScript version of the JFIF document is available at A PDF file of the older JFIF document is available at
http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at http://www.w3.org/Graphics/JPEG/jfif3.pdf.
http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
The TIFF 6.0 file format specification can be obtained by FTP from The TIFF 6.0 file format specification can be obtained by FTP from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
@@ -252,8 +239,8 @@ ARCHIVE LOCATIONS
The "official" archive site for this software is www.ijg.org. The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in The most recent released version can always be found there in
directory "files". This particular version will be archived as directory "files". This particular version will be archived as
http://www.ijg.org/files/jpegsrc.v9a.tar.gz, and in Windows-compatible http://www.ijg.org/files/jpegsrc.v9d.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr9a.zip. "zip" archive format as http://www.ijg.org/files/jpegsr9d.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG. general information about JPEG.
@@ -299,8 +286,11 @@ communication about JPEG configuration in Sigma Photo Pro software.
Thank to Andrew Finkenstadt for hosting the ijg.org site. Thank to Andrew Finkenstadt for hosting the ijg.org site.
Last but not least special thank to Thomas G. Lane for the original Thank to Thomas G. Lane for the original design and development of
design and development of this singular software package. this singular software package.
Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert,
Andrej Werner, and Ulf-Dietrich Braumann for support and public relations.
FILE FORMAT WARS FILE FORMAT WARS

2748
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

4
ar-lib
View File

@@ -4,7 +4,7 @@
me=ar-lib me=ar-lib
scriptversion=2012-03-01.08; # UTC scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2013 Free Software Foundation, Inc. # Copyright (C) 2010-2018 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>. # Written by Peter Rosin <peda@lysator.liu.se>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a

View File

@@ -2,7 +2,7 @@
* cderror.h * cderror.h
* *
* Copyright (C) 1994-1997, Thomas G. Lane. * Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2009 by Guido Vollbeding. * Modified 2009-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -41,16 +41,16 @@ JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
#ifdef BMP_SUPPORTED #ifdef BMP_SUPPORTED
JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format") JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported") JMESSAGE(JERR_BMP_BADDEPTH, "Only 8-, 24-, and 32-bit BMP files are supported")
JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length") JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1") JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB") JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported") JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image")
JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM") JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image") JMESSAGE(JERR_BMP_OUTOFRANGE, "Numeric value out of range in BMP file")
JMESSAGE(JTRC_BMP, "%ux%u %d-bit BMP image")
JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image") JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image") JMESSAGE(JTRC_BMP_OS2, "%ux%u %d-bit OS2 BMP image")
JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image") JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
#endif /* BMP_SUPPORTED */ #endif /* BMP_SUPPORTED */
@@ -75,6 +75,7 @@ JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB") JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file") JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file") JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
JMESSAGE(JERR_PPM_OUTOFRANGE, "Numeric value out of range in PPM file")
JMESSAGE(JTRC_PGM, "%ux%u PGM image") JMESSAGE(JTRC_PGM, "%ux%u PGM image")
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image") JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
JMESSAGE(JTRC_PPM, "%ux%u PPM image") JMESSAGE(JTRC_PPM, "%ux%u PPM image")

View File

@@ -2,6 +2,7 @@
* cdjpeg.h * cdjpeg.h
* *
* Copyright (C) 1994-1997, Thomas G. Lane. * Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -121,7 +122,8 @@ EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo, EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
boolean is_os2)); boolean is_os2));
EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo)); EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo)); EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo,
boolean is_lzw));
EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo)); EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo)); EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo)); EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));

View File

@@ -1,6 +1,99 @@
CHANGE LOG for Independent JPEG Group's JPEG software CHANGE LOG for Independent JPEG Group's JPEG software
Version 9d 12-Jan-2020
-----------------------
Optimize the optimal Huffman code table generation to produce
slightly smaller files. Thank to John Korejwa for suggestion.
Note: Requires rebuild of testimgp.jpg.
Decoding Huffman: Use default tables if tables are not defined.
Thank to Simone Azzalin for report (Motion JPEG),
and to Martin Strunz for hint.
Add sanity check in optimal Huffman code table generation.
Thank to Adam Farley for suggestion.
rdtarga.c: use read_byte(), with EOF check, instead of getc()
in read_*_pixel().
Thank to Chijin Zhou for cjpeg potential vulnerability report.
jmemnobs.c: respect the max_memory_to_use setting in
jpeg_mem_available() computation. Thank to Sheng Shu and
Dongdong She for djpeg potential vulnerability report.
jdarith.c, jdhuff.c: avoid left shift of negative value
compiler warning in decode_mcu_AC_refine().
Thank to Indu Bhagat for suggestion.
Add x64 (64-bit) platform support, avoid compiler warnings.
Thank to Jonathan Potter, Feiyun Wang, and Sheng Shu for suggestion.
Adjust libjpeg version specification for pkg-config file.
Thank to Chen Chen for suggestion.
Restore GIF read and write support from libjpeg version 6a.
Thank to Wolfgang Werner (W.W.) Heinz for suggestion.
Improve consistency in raw (downsampled) image data processing mode.
Thank to Zhongyuan Zhou for hint.
Avoid out of bounds array read (AC derived table pointers)
in start pass in jdhuff.c. Thank to Peng Li for report.
Improve code sanity (jdhuff.c).
Thank to Reza Mirzazade farkhani for reports.
Add jpegtran -drop option; add options to the crop extension and wipe
to fill the extra area with content from the source image region,
instead of gray out.
Version 9c 14-Jan-2018
-----------------------
jpegtran: add an option to the -wipe switch to fill the region
with the average of adjacent blocks, instead of gray out.
Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
Make range extension bits adjustable (in jpegint.h).
Thank to Robin Watts for suggestion.
Provide macros for fflush() and ferror() in jinclude.h in order
to facilitate adaption by applications using an own FILE class.
Thank to Gerhard Huber for suggestion.
Add libjpeg pkg-config file. Thank to Mark Lavi, Vincent Torri,
Patrick McMunn, and Huw Davies for suggestion.
Add sanity checks in cjpeg image reader modules.
Thank to Bingchang, Liu for reports.
Version 9b 17-Jan-2016
-----------------------
Improvements and optimizations in DCT and color calculations.
Normalize range limit array composition and access pattern.
Thank to Sia Furler and Maddie Ziegler for inspiration.
Use merged upsample with scaled DCT sizes larger than 8.
Thank to Taylor Hatala for inspiration.
Check for excessive comment lengths in argument parsing in wrjpgcom.c.
Thank to Julian Cohen for hint.
Add makefile.b32 for use with Borland C++ 32-bit (bcc32).
Thank to Joe Slater for contribution.
Document 'f' specifier for jpegtran -crop specification.
Thank to Michele Martone for suggestion.
Use defined value from header instead of hardwired number in rdswitch.c.
Thank to Robert Sprowson for hint.
Version 9a 19-Jan-2014 Version 9a 19-Jan-2014
----------------------- -----------------------

17
cjpeg.1
View File

@@ -1,4 +1,4 @@
.TH CJPEG 1 "23 November 2013" .TH CJPEG 1 "28 April 2019"
.SH NAME .SH NAME
cjpeg \- compress an image file to a JPEG file cjpeg \- compress an image file to a JPEG file
.SH SYNOPSIS .SH SYNOPSIS
@@ -16,8 +16,9 @@ cjpeg \- compress an image file to a JPEG file
compresses the named image file, or the standard input if no file is compresses the named image file, or the standard input if no file is
named, and produces a JPEG/JFIF file on the standard output. named, and produces a JPEG/JFIF file on the standard output.
The currently supported input file formats are: PPM (PBMPLUS color The currently supported input file formats are: PPM (PBMPLUS color
format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster format), PGM (PBMPLUS grayscale format), BMP, GIF, Targa, and RLE (Utah Raster
Toolkit format). (RLE is supported only if the URT library is available.) Toolkit format). (RLE is supported only if the URT library is available,
which it isn't on most non-Unix systems.)
.SH OPTIONS .SH OPTIONS
All switch names may be abbreviated; for example, All switch names may be abbreviated; for example,
.B \-grayscale .B \-grayscale
@@ -42,10 +43,10 @@ Scale quantization tables to adjust image quality. Quality is 0 (worst) to
.TP .TP
.B \-grayscale .B \-grayscale
Create monochrome JPEG file from color input. Be sure to use this switch when Create monochrome JPEG file from color input. Be sure to use this switch when
compressing a grayscale BMP file, because compressing a grayscale BMP or GIF file, because
.B cjpeg .B cjpeg
isn't bright enough to notice whether a BMP file uses only shades of gray. isn't bright enough to notice whether a BMP or GIF file uses only shades of
By saying gray. By saying
.BR \-grayscale , .BR \-grayscale ,
you'll get a smaller JPEG file that takes less time to process. you'll get a smaller JPEG file that takes less time to process.
.TP .TP
@@ -375,10 +376,6 @@ Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
.SH AUTHOR .SH AUTHOR
Independent JPEG Group Independent JPEG Group
.SH BUGS .SH BUGS
GIF input files are no longer supported, to avoid the Unisys LZW patent
(now expired).
(Conversion of GIF files to JPEG is usually a bad idea anyway.)
.PP
Not all variants of BMP and Targa file formats are supported. Not all variants of BMP and Targa file formats are supported.
.PP .PP
The The

13
compile
View File

@@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'. # Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>. # Written by Tom Tromey <tromey@cygnus.com>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion" echo "compile $scriptversion"
exit $? exit $?
;; ;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return... func_cl_wrapper "$@" # Doesn't return...
;; ;;
esac esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC" # time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC" # time-stamp-end: "; # UTC"
# End: # End:

822
config.guess vendored

File diff suppressed because it is too large Load Diff

324
config.sub vendored
View File

@@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc. # Copyright 1992-2018 Free Software Foundation, Inc.
timestamp='2013-10-01' timestamp='2018-03-08'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2013-10-01'
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <https://www.gnu.org/licenses/>.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@@ -25,7 +25,7 @@ timestamp='2013-10-01'
# of the GNU General Public License, version 3 ("GPLv3"). # of the GNU General Public License, version 3 ("GPLv3").
# Please send patches with a ChangeLog entry to config-patches@gnu.org. # Please send patches to <config-patches@gnu.org>.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
@@ -33,7 +33,7 @@ timestamp='2013-10-01'
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
@@ -53,12 +53,11 @@ timestamp='2013-10-01'
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
usage="\ usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
$0 [OPTION] ALIAS
Canonicalize a configuration name. Canonicalize a configuration name.
Operation modes: Options:
-h, --help print this help, then exit -h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit -t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit -v, --version print version number, then exit
@@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc. Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -95,7 +94,7 @@ while test $# -gt 0 ; do
*local*) *local*)
# First pass through any local machine types. # First pass through any local machine types.
echo $1 echo "$1"
exit ;; exit ;;
* ) * )
@@ -113,24 +112,24 @@ esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*) storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
android-linux) android-linux)
os=-linux-android os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;; ;;
*) *)
basic_machine=`echo $1 | sed 's/-[^-]*$//'` basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ] if [ "$basic_machine" != "$1" ]
then os=`echo $1 | sed 's/.*-/-/'` then os=`echo "$1" | sed 's/.*-/-/'`
else os=; fi else os=; fi
;; ;;
esac esac
@@ -179,44 +178,44 @@ case $os in
;; ;;
-sco6) -sco6)
os=-sco5v6 os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco5) -sco5)
os=-sco3.2v5 os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco4) -sco4)
os=-sco3.2v4 os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco3.2.[4-9]*) -sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco3.2v[4-9]*) -sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer. # Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco5v6*) -sco5v6*)
# Don't forget version if it is 3.2v4 or newer. # Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco*) -sco*)
os=-sco3.2v2 os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-udk*) -udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-isc) -isc)
os=-isc2.2 os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-clix*) -clix*)
basic_machine=clipper-intergraph basic_machine=clipper-intergraph
;; ;;
-isc*) -isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;; ;;
-lynx*178) -lynx*178)
os=-lynxos178 os=-lynxos178
@@ -228,10 +227,7 @@ case $os in
os=-lynxos os=-lynxos
;; ;;
-ptx*) -ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;; ;;
-psos*) -psos*)
os=-psos os=-psos
@@ -255,15 +251,16 @@ case $basic_machine in
| arc | arceb \ | arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \ | avr | avr32 \
| ba \
| be32 | be64 \ | be32 | be64 \
| bfin \ | bfin \
| c4x | c8051 | clipper \ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
| epiphany \ | e2k | epiphany \
| fido | fr30 | frv \ | fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \ | hexagon \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia16 | ia64 \
| ip2k | iq2000 \ | ip2k | iq2000 \
| k1om \ | k1om \
| le32 | le64 \ | le32 | le64 \
@@ -283,8 +280,10 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \ | mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \ | mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \ | mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \ | mipsr5900 | mipsr5900el \
@@ -296,14 +295,15 @@ case $basic_machine in
| nds32 | nds32le | nds32be \ | nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 \ | open8 | or1k | or1knd | or32 \
| or1k | or32 \ | pdp10 | pj | pjl \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \ | pyramid \
| riscv32 | riscv64 \
| rl78 | rx \ | rl78 | rx \
| score \ | score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -311,7 +311,8 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \ | ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \ | visium \
| wasm32 \
| x86 | xc16x | xstormy16 | xtensa \ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80) | z8k | z80)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
@@ -325,11 +326,14 @@ case $basic_machine in
c6x) c6x)
basic_machine=tic6x-unknown basic_machine=tic6x-unknown
;; ;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
;; ;;
ms1) ms1)
basic_machine=mt-unknown basic_machine=mt-unknown
@@ -358,7 +362,7 @@ case $basic_machine in
;; ;;
# Object if more than one company name word. # Object if more than one company name word.
*-*-*) *-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
exit 1 exit 1
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
@@ -370,17 +374,18 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \ | avr-* | avr32-* \
| ba-* \
| be32-* | be64-* \ | be32-* | be64-* \
| bfin-* | bs2000-* \ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \ | d10v-* | d30v-* | dlx-* \
| elxsi-* \ | e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \ | h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
| ip2k-* | iq2000-* \ | ip2k-* | iq2000-* \
| k1om-* \ | k1om-* \
| le32-* | le64-* \ | le32-* | le64-* \
@@ -402,8 +407,10 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \ | mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \ | mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \ | mipsr5900-* | mipsr5900el-* \
@@ -415,16 +422,19 @@ case $basic_machine in
| nios-* | nios2-* | nios2eb-* | nios2el-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \ | open8-* \
| or1k*-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \ | pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \ | tile*-* \
@@ -432,6 +442,8 @@ case $basic_machine in
| ubicom32-* \ | ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \ | vax-* \
| visium-* \
| wasm32-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
@@ -445,7 +457,7 @@ case $basic_machine in
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
386bsd) 386bsd)
basic_machine=i386-unknown basic_machine=i386-pc
os=-bsd os=-bsd
;; ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@@ -479,7 +491,7 @@ case $basic_machine in
basic_machine=x86_64-pc basic_machine=x86_64-pc
;; ;;
amd64-*) amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
amdahl) amdahl)
basic_machine=580-amdahl basic_machine=580-amdahl
@@ -508,6 +520,9 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
os=-aros os=-aros
;; ;;
asmjs)
basic_machine=asmjs-unknown
;;
aux) aux)
basic_machine=m68k-apple basic_machine=m68k-apple
os=-aux os=-aux
@@ -521,7 +536,7 @@ case $basic_machine in
os=-linux os=-linux
;; ;;
blackfin-*) blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
bluegene*) bluegene*)
@@ -529,13 +544,13 @@ case $basic_machine in
os=-cnk os=-cnk
;; ;;
c54x-*) c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
c55x-*) c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
c6x-*) c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
c90) c90)
basic_machine=c90-cray basic_machine=c90-cray
@@ -624,10 +639,18 @@ case $basic_machine in
basic_machine=rs6000-bull basic_machine=rs6000-bull
os=-bosx os=-bosx
;; ;;
dpx2* | dpx2*-bull) dpx2*)
basic_machine=m68k-bull basic_machine=m68k-bull
os=-sysv3 os=-sysv3
;; ;;
e500v[12])
basic_machine=powerpc-unknown
os=$os"spe"
;;
e500v[12]-*)
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=$os"spe"
;;
ebmon29k) ebmon29k)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-ebmon os=-ebmon
@@ -717,9 +740,6 @@ case $basic_machine in
hp9k8[0-9][0-9] | hp8[0-9][0-9]) hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp basic_machine=hppa1.0-hp
;; ;;
hppa-next)
os=-nextstep3
;;
hppaosf) hppaosf)
basic_machine=hppa1.1-hp basic_machine=hppa1.1-hp
os=-osf os=-osf
@@ -732,26 +752,26 @@ case $basic_machine in
basic_machine=i370-ibm basic_machine=i370-ibm
;; ;;
i*86v32) i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv32 os=-sysv32
;; ;;
i*86v4*) i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv4 os=-sysv4
;; ;;
i*86v) i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv os=-sysv
;; ;;
i*86sol2) i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-solaris2 os=-solaris2
;; ;;
i386mach) i386mach)
basic_machine=i386-mach basic_machine=i386-mach
os=-mach os=-mach
;; ;;
i386-vsta | vsta) vsta)
basic_machine=i386-unknown basic_machine=i386-unknown
os=-vsta os=-vsta
;; ;;
@@ -769,17 +789,17 @@ case $basic_machine in
basic_machine=m68k-isi basic_machine=m68k-isi
os=-sysv os=-sysv
;; ;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
;;
m68knommu) m68knommu)
basic_machine=m68k-unknown basic_machine=m68k-unknown
os=-linux os=-linux
;; ;;
m68knommu-*) m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230) magnum | m3230)
basic_machine=mips-mips basic_machine=mips-mips
os=-sysv os=-sysv
@@ -811,10 +831,10 @@ case $basic_machine in
os=-mint os=-mint
;; ;;
mips3*-*) mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
;; ;;
mips3*) mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
;; ;;
monitor) monitor)
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
@@ -824,12 +844,16 @@ case $basic_machine in
basic_machine=powerpc-unknown basic_machine=powerpc-unknown
os=-morphos os=-morphos
;; ;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos) msdos)
basic_machine=i386-pc basic_machine=i386-pc
os=-msdos os=-msdos
;; ;;
ms1-*) ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
;; ;;
msys) msys)
basic_machine=i686-pc basic_machine=i686-pc
@@ -916,6 +940,12 @@ case $basic_machine in
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
nsv-tandem)
basic_machine=nsv-tandem
;;
nsx-tandem)
basic_machine=nsx-tandem
;;
op50n-* | op60c-*) op50n-* | op60c-*)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
@@ -948,7 +978,7 @@ case $basic_machine in
os=-linux os=-linux
;; ;;
parisc-*) parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
pbd) pbd)
@@ -964,7 +994,7 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
;; ;;
pc98-*) pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
pentium | p5 | k5 | k6 | nexgen | viac3) pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc basic_machine=i586-pc
@@ -979,16 +1009,16 @@ case $basic_machine in
basic_machine=i786-pc basic_machine=i786-pc
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-* | athlon-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
pentium4-*) pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
@@ -998,23 +1028,23 @@ case $basic_machine in
ppc | ppcbe) basic_machine=powerpc-unknown ppc | ppcbe) basic_machine=powerpc-unknown
;; ;;
ppc-* | ppcbe-*) ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
;; ;;
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown ppc64) basic_machine=powerpc64-unknown
;; ;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little) ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown basic_machine=powerpc64le-unknown
;; ;;
ppc64le-* | powerpc64little-*) ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
ps2) ps2)
basic_machine=i386-ibm basic_machine=i386-ibm
@@ -1068,17 +1098,10 @@ case $basic_machine in
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el) sh5el)
basic_machine=sh5le-unknown basic_machine=sh5le-unknown
;; ;;
sh64) simso-wrs)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs basic_machine=sparclite-wrs
os=-vxworks os=-vxworks
;; ;;
@@ -1097,7 +1120,7 @@ case $basic_machine in
os=-sysv4 os=-sysv4
;; ;;
strongarm-* | thumb-*) strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;; ;;
sun2) sun2)
basic_machine=m68000-sun basic_machine=m68000-sun
@@ -1219,6 +1242,9 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
x64)
basic_machine=x86_64-pc
;;
xbox) xbox)
basic_machine=i686-pc basic_machine=i686-pc
os=-mingw32 os=-mingw32
@@ -1227,20 +1253,12 @@ case $basic_machine in
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
xscale-* | xscalee[bl]-*) xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
;; ;;
ymp) ymp)
basic_machine=ymp-cray basic_machine=ymp-cray
os=-unicos os=-unicos
;; ;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none) none)
basic_machine=none-none basic_machine=none-none
os=-none os=-none
@@ -1269,10 +1287,6 @@ case $basic_machine in
vax) vax)
basic_machine=vax-dec basic_machine=vax-dec
;; ;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11) pdp11)
basic_machine=pdp11-dec basic_machine=pdp11-dec
;; ;;
@@ -1282,9 +1296,6 @@ case $basic_machine in
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra) cydra)
basic_machine=cydra-cydrome basic_machine=cydra-cydrome
;; ;;
@@ -1304,7 +1315,7 @@ case $basic_machine in
# Make sure to match an already-canonicalized machine name. # Make sure to match an already-canonicalized machine name.
;; ;;
*) *)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
exit 1 exit 1
;; ;;
esac esac
@@ -1312,10 +1323,10 @@ esac
# Here we canonicalize certain aliases for manufacturers. # Here we canonicalize certain aliases for manufacturers.
case $basic_machine in case $basic_machine in
*-digital*) *-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
;; ;;
*-commodore*) *-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
;; ;;
*) *)
;; ;;
@@ -1326,8 +1337,8 @@ esac
if [ x"$os" != x"" ] if [ x"$os" != x"" ]
then then
case $os in case $os in
# First match some system type aliases # First match some system type aliases that might get confused
# that might get confused with valid system types. # with valid system types.
# -solaris* is a basic system type, with this one exception. # -solaris* is a basic system type, with this one exception.
-auroraux) -auroraux)
os=-auroraux os=-auroraux
@@ -1338,45 +1349,48 @@ case $os in
-solaris) -solaris)
os=-solaris2 os=-solaris2
;; ;;
-svr4*)
os=-sysv4
;;
-unixware*) -unixware*)
os=-sysv4.2uw os=-sysv4.2uw
;; ;;
-gnu/linux*) -gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;; ;;
# First accept the basic system types. # es1800 is here to avoid being matched by es* (a different OS)
-es1800*)
os=-ose
;;
# Now accept the basic system types.
# The portable systems comes first. # The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number. # Each alternative MUST end in a * to match a version number.
# -sysv* is not here because it comes later, after sysvr4. # -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
| -chorusos* | -chorusrdb* | -cegcc* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -morphos* | -superux* | -rtmk* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
| -midnightbsd*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@@ -1393,12 +1407,12 @@ case $os in
-nto*) -nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'` os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -xray | -os68k* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -windows* | -osx | -abug | -netware* | -os9* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;; ;;
-mac*) -mac*)
os=`echo $os | sed -e 's|mac|macos|'` os=`echo "$os" | sed -e 's|mac|macos|'`
;; ;;
-linux-dietlibc) -linux-dietlibc)
os=-linux-dietlibc os=-linux-dietlibc
@@ -1407,10 +1421,10 @@ case $os in
os=`echo $os | sed -e 's|linux|linux-gnu|'` os=`echo $os | sed -e 's|linux|linux-gnu|'`
;; ;;
-sunos5*) -sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'` os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;; ;;
-sunos6*) -sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'` os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;; ;;
-opened*) -opened*)
os=-openedition os=-openedition
@@ -1421,12 +1435,6 @@ case $os in
-wince*) -wince*)
os=-wince os=-wince
;; ;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*) -utek*)
os=-bsd os=-bsd
;; ;;
@@ -1473,7 +1481,7 @@ case $os in
-oss*) -oss*)
os=-sysv3 os=-sysv3
;; ;;
-svr4) -svr4*)
os=-sysv4 os=-sysv4
;; ;;
-svr3) -svr3)
@@ -1488,32 +1496,38 @@ case $os in
-ose*) -ose*)
os=-ose os=-ose
;; ;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;; ;;
-aros*)
os=-aros
;;
-zvmoe) -zvmoe)
os=-zvmoe os=-zvmoe
;; ;;
-dicos*) -dicos*)
os=-dicos os=-dicos
;; ;;
-pikeos*)
# Until real need of OS specific support for
# particular features comes up, bare metal
# configurations are quite functional.
case $basic_machine in
arm*)
os=-eabi
;;
*)
os=-elf
;;
esac
;;
-nacl*) -nacl*)
;; ;;
-ios)
;;
-none) -none)
;; ;;
*) *)
# Get rid of the `-' at the beginning of $os. # Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'` os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
exit 1 exit 1
;; ;;
esac esac
@@ -1594,9 +1608,6 @@ case $basic_machine in
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or1k-*)
os=-elf
;;
or32-*) or32-*)
os=-coff os=-coff
;; ;;
@@ -1606,12 +1617,12 @@ case $basic_machine in
sparc-* | *-sun) sparc-* | *-sun)
os=-sunos4.1.1 os=-sunos4.1.1
;; ;;
pru-*)
os=-elf
;;
*-be) *-be)
os=-beos os=-beos
;; ;;
*-haiku)
os=-haiku
;;
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
@@ -1666,9 +1677,6 @@ case $basic_machine in
i370-*) i370-*)
os=-mvs os=-mvs
;; ;;
*-next)
os=-nextstep3
;;
*-gould) *-gould)
os=-sysv os=-sysv
;; ;;
@@ -1778,15 +1786,15 @@ case $basic_machine in
vendor=stratus vendor=stratus
;; ;;
esac esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
;; ;;
esac esac
echo $basic_machine$os echo "$basic_machine$os"
exit exit
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='" # time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d" # time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'" # time-stamp-end: "'"

2249
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
# Configure script for IJG libjpeg # Configure script for IJG libjpeg
# #
AC_INIT([libjpeg], [9.1.0]) AC_INIT([libjpeg], [9.4.0])
# Directory where autotools helper scripts lives. # Directory where autotools helper scripts lives.
AC_CONFIG_AUX_DIR([.]) AC_CONFIG_AUX_DIR([.])
@@ -357,9 +357,10 @@ AC_SUBST([MEMORYMGR])
AC_MSG_CHECKING([libjpeg version number]) AC_MSG_CHECKING([libjpeg version number])
[major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` [major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`
minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`] minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`]
AC_SUBST([JPEG_LIB_VERSION], AC_SUBST([JPEG_LIB_VERSION], [`expr $major + $minor`:0:$minor])
[`expr $major + $minor`:0:$minor]) AC_SUBST([JPEG_LIB_VERSION_MAJOR], [$major])
AC_MSG_RESULT([$JPEG_LIB_VERSION]) AC_SUBST([JPEG_LIB_VERSION_MINOR], [$minor])
AC_MSG_RESULT([$major.$minor.0])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile libjpeg.pc])
AC_OUTPUT AC_OUTPUT

10
depcomp
View File

@@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@@ -783,9 +783,9 @@ exit 0
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC" # time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC" # time-stamp-end: "; # UTC"
# End: # End:

54
djpeg.1
View File

@@ -1,4 +1,4 @@
.TH DJPEG 1 "23 November 2013" .TH DJPEG 1 "28 April 2019"
.SH NAME .SH NAME
djpeg \- decompress a JPEG file to an image file djpeg \- decompress a JPEG file to an image file
.SH SYNOPSIS .SH SYNOPSIS
@@ -16,7 +16,8 @@ djpeg \- decompress a JPEG file to an image file
decompresses the named JPEG file, or the standard input if no file is named, decompresses the named JPEG file, or the standard input if no file is named,
and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP, and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected. GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
(RLE is supported only if the URT library is available.) (RLE is supported only if the URT library is available, which it isn't
on most non-Unix systems.)
.SH OPTIONS .SH OPTIONS
All switch names may be abbreviated; for example, All switch names may be abbreviated; for example,
.B \-grayscale .B \-grayscale
@@ -55,11 +56,16 @@ default options are chosen for highest quality output.) Currently, this is
equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR. equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
.TP .TP
.B \-grayscale .B \-grayscale
Force gray-scale output even if JPEG file is color. Useful for viewing on Force grayscale output even if JPEG file is color.
monochrome displays; also, Useful for viewing on monochrome displays; also,
.B djpeg .B djpeg
runs noticeably faster in this mode. runs noticeably faster in this mode.
.TP .TP
.B \-rgb
Force RGB output even if JPEG file is grayscale.
This is provided to support applications that don't
want to cope with grayscale as a separate case.
.TP
.BI \-scale " M/N" .BI \-scale " M/N"
Scale the output image by a factor M/N. Currently supported scale factors are Scale the output image by a factor M/N. Currently supported scale factors are
M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
@@ -71,31 +77,42 @@ Scaling is handy if the image is larger than your screen; also,
runs much faster when scaling down the output. runs much faster when scaling down the output.
.TP .TP
.B \-bmp .B \-bmp
Select BMP output format (Windows flavor). 8-bit colormapped format is Select BMP output format (Windows flavor).
emitted if 8-bit colormapped format is emitted if
.B \-colors .B \-colors
or or
.B \-grayscale .B \-grayscale
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
format is emitted. format is emitted.
.TP .TP
.B \-gif .B \-gif
Select GIF output format. Since GIF does not support more than 256 colors, Select GIF output format (LZW compressed).
Since GIF does not support more than 256 colors,
.B \-colors 256 .B \-colors 256
is assumed (unless you specify a smaller number of colors). is assumed (unless you specify a smaller number of colors). If you specify
.BR \-fast ,
the default number of colors is 216.
.TP
.B \-gif0
Select GIF output format (uncompressed).
Since GIF does not support more than 256 colors,
.B \-colors 256
is assumed (unless you specify a smaller number of colors). If you specify
.BR \-fast ,
the default number of colors is 216.
.TP .TP
.B \-os2 .B \-os2
Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is Select BMP output format (OS/2 1.x flavor).
emitted if 8-bit colormapped format is emitted if
.B \-colors .B \-colors
or or
.B \-grayscale .B \-grayscale
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
format is emitted. format is emitted.
.TP .TP
.B \-pnm .B \-pnm
Select PBMPLUS (PPM/PGM) output format (this is the default format). Select PBMPLUS (PPM/PGM) output format (this is the default format).
PGM is emitted if the JPEG file is gray-scale or if PGM is emitted if the JPEG file is grayscale or if
.B \-grayscale .B \-grayscale
is specified; otherwise PPM is emitted. is specified; otherwise PPM is emitted.
.TP .TP
@@ -103,8 +120,8 @@ is specified; otherwise PPM is emitted.
Select RLE output format. (Requires URT library.) Select RLE output format. (Requires URT library.)
.TP .TP
.B \-targa .B \-targa
Select Targa output format. Gray-scale format is emitted if the JPEG file is Select Targa output format. Grayscale format is emitted if the JPEG file is
gray-scale or if grayscale or if
.B \-grayscale .B \-grayscale
is specified; otherwise, colormapped format is emitted if is specified; otherwise, colormapped format is emitted if
.B \-colors .B \-colors
@@ -162,7 +179,7 @@ faster and needs less memory, but it produces a lower-quality image.
is ignored unless you also say is ignored unless you also say
.B \-colors .B \-colors
.IR N . .IR N .
Also, the one-pass method is always used for gray-scale output (the two-pass Also, the one-pass method is always used for grayscale output (the two-pass
method is no improvement then). method is no improvement then).
.TP .TP
.BI \-maxmemory " N" .BI \-maxmemory " N"
@@ -245,8 +262,3 @@ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
.SH AUTHOR .SH AUTHOR
Independent JPEG Group Independent JPEG Group
.SH BUGS
To avoid the Unisys LZW patent (now expired),
.B djpeg
produces uncompressed GIF files. These are larger than they should be, but
are readable by standard GIF decoders.

30
djpeg.c
View File

@@ -2,7 +2,7 @@
* djpeg.c * djpeg.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2009-2013 by Guido Vollbeding. * Modified 2009-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -59,7 +59,8 @@ static const char * const cdjpeg_message_table[] = {
typedef enum { typedef enum {
FMT_BMP, /* BMP format (Windows flavor) */ FMT_BMP, /* BMP format (Windows flavor) */
FMT_GIF, /* GIF format */ FMT_GIF, /* GIF format (LZW compressed) */
FMT_GIF0, /* GIF format (uncompressed) */
FMT_OS2, /* BMP format (OS/2 flavor) */ FMT_OS2, /* BMP format (OS/2 flavor) */
FMT_PPM, /* PPM/PGM (PBMPLUS formats) */ FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
FMT_RLE, /* RLE format */ FMT_RLE, /* RLE format */
@@ -102,6 +103,7 @@ usage (void)
fprintf(stderr, " -colors N Reduce image to no more than N colors\n"); fprintf(stderr, " -colors N Reduce image to no more than N colors\n");
fprintf(stderr, " -fast Fast, low-quality processing\n"); fprintf(stderr, " -fast Fast, low-quality processing\n");
fprintf(stderr, " -grayscale Force grayscale output\n"); fprintf(stderr, " -grayscale Force grayscale output\n");
fprintf(stderr, " -rgb Force RGB output\n");
#ifdef IDCT_SCALING_SUPPORTED #ifdef IDCT_SCALING_SUPPORTED
fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n"); fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
#endif #endif
@@ -110,8 +112,10 @@ usage (void)
(DEFAULT_FMT == FMT_BMP ? " (default)" : "")); (DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
#endif #endif
#ifdef GIF_SUPPORTED #ifdef GIF_SUPPORTED
fprintf(stderr, " -gif Select GIF output format%s\n", fprintf(stderr, " -gif Select GIF output format (LZW compressed)%s\n",
(DEFAULT_FMT == FMT_GIF ? " (default)" : "")); (DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
fprintf(stderr, " -gif0 Select GIF output format (uncompressed)%s\n",
(DEFAULT_FMT == FMT_GIF0 ? " (default)" : ""));
#endif #endif
#ifdef BMP_SUPPORTED #ifdef BMP_SUPPORTED
fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n", fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n",
@@ -194,7 +198,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
arg++; /* advance past switch marker character */ arg++; /* advance past switch marker character */
if (keymatch(arg, "bmp", 1)) { if (keymatch(arg, "bmp", 1)) {
/* BMP output format. */ /* BMP output format (Windows flavor). */
requested_fmt = FMT_BMP; requested_fmt = FMT_BMP;
} else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) || } else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
@@ -257,13 +261,21 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
cinfo->do_fancy_upsampling = FALSE; cinfo->do_fancy_upsampling = FALSE;
} else if (keymatch(arg, "gif", 1)) { } else if (keymatch(arg, "gif", 1)) {
/* GIF output format. */ /* GIF output format (LZW compressed). */
requested_fmt = FMT_GIF; requested_fmt = FMT_GIF;
} else if (keymatch(arg, "gif0", 4)) {
/* GIF output format (uncompressed). */
requested_fmt = FMT_GIF0;
} else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
/* Force monochrome output. */ /* Force monochrome output. */
cinfo->out_color_space = JCS_GRAYSCALE; cinfo->out_color_space = JCS_GRAYSCALE;
} else if (keymatch(arg, "rgb", 3)) {
/* Force RGB output. */
cinfo->out_color_space = JCS_RGB;
} else if (keymatch(arg, "map", 3)) { } else if (keymatch(arg, "map", 3)) {
/* Quantize to a color map taken from an input file. */ /* Quantize to a color map taken from an input file. */
if (++argn >= argc) /* advance to next argument */ if (++argn >= argc) /* advance to next argument */
@@ -456,7 +468,7 @@ main (int argc, char **argv)
* APP12 is used by some digital camera makers for textual info, * APP12 is used by some digital camera makers for textual info,
* so we provide the ability to display it as text. * so we provide the ability to display it as text.
* If you like, additional APPn marker types can be selected for display, * If you like, additional APPn marker types can be selected for display,
* but don't try to override APP0 or APP14 this way (see libjpeg.doc). * but don't try to override APP0 or APP14 this way (see libjpeg.txt).
*/ */
jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker); jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker); jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
@@ -549,7 +561,10 @@ main (int argc, char **argv)
#endif #endif
#ifdef GIF_SUPPORTED #ifdef GIF_SUPPORTED
case FMT_GIF: case FMT_GIF:
dest_mgr = jinit_write_gif(&cinfo); dest_mgr = jinit_write_gif(&cinfo, TRUE);
break;
case FMT_GIF0:
dest_mgr = jinit_write_gif(&cinfo, FALSE);
break; break;
#endif #endif
#ifdef PPM_SUPPORTED #ifdef PPM_SUPPORTED
@@ -569,7 +584,6 @@ main (int argc, char **argv)
#endif #endif
default: default:
ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT); ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
break;
} }
dest_mgr->output_file = output_file; dest_mgr->output_file = output_file;

View File

@@ -1,6 +1,6 @@
IJG JPEG LIBRARY: FILE LIST IJG JPEG LIBRARY: FILE LIST
Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding. Copyright (C) 1994-2019, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software. This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file. For conditions of distribution and use, see the accompanying README file.
@@ -151,7 +151,7 @@ transupp.c Support code for jpegtran: lossless image manipulations.
Image file reader modules for cjpeg: Image file reader modules for cjpeg:
rdbmp.c BMP file input. rdbmp.c BMP file input.
rdgif.c GIF file input (now just a stub). rdgif.c GIF file input.
rdppm.c PPM/PGM file input. rdppm.c PPM/PGM file input.
rdrle.c Utah RLE file input. rdrle.c Utah RLE file input.
rdtarga.c Targa file input. rdtarga.c Targa file input.
@@ -159,7 +159,7 @@ rdtarga.c Targa file input.
Image file writer modules for djpeg: Image file writer modules for djpeg:
wrbmp.c BMP file output. wrbmp.c BMP file output.
wrgif.c GIF file output (a mere shadow of its former self). wrgif.c GIF file output.
wrppm.c PPM/PGM file output. wrppm.c PPM/PGM file output.
wrrle.c Utah RLE file output. wrrle.c Utah RLE file output.
wrtarga.c Targa file output. wrtarga.c Targa file output.
@@ -207,6 +207,7 @@ jconfig.txt Template for making jconfig.h by hand.
mak*.* Sample makefiles for particular systems. mak*.* Sample makefiles for particular systems.
jconfig.* Sample jconfig.h for particular systems. jconfig.* Sample jconfig.h for particular systems.
libjpeg.map Script to generate shared library with versioned symbols. libjpeg.map Script to generate shared library with versioned symbols.
libjpeg.pc.in libjpeg.pc pkg-config file input for configure.
aclocal.m4 M4 macro definitions for use with Autoconf. aclocal.m4 M4 macro definitions for use with Autoconf.
Test files (see install.txt for test procedure): Test files (see install.txt for test procedure):

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
# from scratch. # from scratch.
tab=' '
nl=' nl='
' '
IFS=" "" $nl" IFS=" $tab$nl"
# set DOITPROG to echo to test this script # Set DOITPROG to "echo" to test this script.
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-} doit=${DOITPROG-}
if test -z "$doit"; then doit_exec=${doit:-exec}
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path; # Put in absolute file names if you don't have them in your path;
# or use environment vars. # or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm} rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip} stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir= posix_mkdir=
# Desired mode of installed file. # Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
dst_arg= dst_arg=
copy_on_change=false copy_on_change=false
no_target_directory= is_target_a_directory=possibly
usage="\ usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -143,8 +128,7 @@ while test $# -ne 0; do
-m) mode=$2 -m) mode=$2
case $mode in case $mode in
*' '* | *' '* | *' *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2 echo "$0: invalid mode: $mode" >&2
exit 1;; exit 1;;
esac esac
@@ -155,14 +139,16 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;; -s) stripcmd=$stripprog;;
-t) dst_arg=$2 -t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities. # Protect names problematic for 'test' and other utilities.
case $dst_arg in case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;; -* | [=\(\)!]) dst_arg=./$dst_arg;;
esac esac
shift;; shift;;
-T) no_target_directory=true;; -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;; --version) echo "$0 $scriptversion"; exit $?;;
@@ -177,6 +163,16 @@ while test $# -ne 0; do
shift shift
done done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create. # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified. # When -t is used, the destination is already specified.
@@ -207,6 +203,15 @@ if test $# -eq 0; then
exit 0 exit 0
fi fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret' do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1 trap "ret=129; $do_exit" 1
@@ -266,49 +271,31 @@ do
fi fi
dst=$dst_arg dst=$dst_arg
# If destination is a directory, append the input filename; won't work # If destination is a directory, append the input filename.
# if double slashes aren't ignored.
if test -d "$dst"; then if test -d "$dst"; then
if test -n "$no_target_directory"; then if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2 echo "$0: $dst_arg: Is a directory" >&2
exit 1 exit 1
fi fi
dstdir=$dst dstdir=$dst
dst=$dstdir/`basename "$src"` dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0 dstdir_status=0
else else
# Prefer dirname, but fall back on a substitute if dirname fails. dstdir=`dirname "$dst"`
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir" test -d "$dstdir"
dstdir_status=$? dstdir_status=$?
fi fi
fi fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false obsolete_mkdir_used=false
if test $dstdir_status != 0; then if test $dstdir_status != 0; then
@@ -345,34 +332,43 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0. # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;; ;;
*) *)
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask && if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 $mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then then
if test -z "$dir_arg" || { if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m. # Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't. # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"` test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;; d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;; d????-?--*) different_mode=755;;
*) false;; *) false;;
esac && esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && { $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
} }
} }
then posix_mkdir=: then posix_mkdir=:
fi fi
rmdir "$tmpdir/d" "$tmpdir" rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else else
# Remove any dirs left behind by ancient mkdir implementations. # Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi fi
trap '' 0;; trap '' 0;;
esac;; esac;;
@@ -396,14 +392,12 @@ do
*) prefix='';; *) prefix='';;
esac esac
eval "$initialize_posix_glob"
oIFS=$IFS oIFS=$IFS
IFS=/ IFS=/
$posix_glob set -f set -f
set fnord $dstdir set fnord $dstdir
shift shift
$posix_glob set +f set +f
IFS=$oIFS IFS=$oIFS
prefixes= prefixes=
@@ -450,8 +444,8 @@ do
else else
# Make a couple of temp file names in the proper directory. # Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_ dsttmp=${dstdirslash}_inst.$$_
rmtmp=$dstdir/_rm.$$_ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit. # Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
@@ -474,13 +468,10 @@ do
if $copy_on_change && if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 && set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f && set +f &&
test "$old" = "$new" && test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then then
@@ -519,9 +510,9 @@ do
done done
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC" # time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC" # time-stamp-end: "; # UTC"
# End: # End:

View File

@@ -1,6 +1,6 @@
INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software
Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. Copyright (C) 1991-2019, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software. This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file. For conditions of distribution and use, see the accompanying README file.
@@ -147,9 +147,12 @@ makefile.bcc jconfig.bcc MS-DOS or OS/2, Borland C
makefile.dj jconfig.dj MS-DOS, DJGPP (Delorie's port of GNU C) makefile.dj jconfig.dj MS-DOS, DJGPP (Delorie's port of GNU C)
makefile.mc6 jconfig.mc6 MS-DOS, Microsoft C (16-bit only) makefile.mc6 jconfig.mc6 MS-DOS, Microsoft C (16-bit only)
makefile.wat jconfig.wat MS-DOS, OS/2, or Windows NT, Watcom C makefile.wat jconfig.wat MS-DOS, OS/2, or Windows NT, Watcom C
makefile.vc jconfig.vc Windows NT/95, MS Visual C++ makefile.vc jconfig.vc Windows, MS Visual C++
make*.vc6 jconfig.vc Windows NT/95, MS Visual C++ 6 makefile.vs jconfig.vc Windows, MS Visual C++ 6 Developer Studio
make*.v10 jconfig.vc Windows NT/95, MS Visual C++ 2010 (v10) make*.vc6
makefile.vs jconfig.vc Windows, Visual Studio 2019 (v16)
make*.v16
makefile.b32 jconfig.vc Windows, Borland C++ 32-bit (bcc32)
makefile.mms jconfig.vms Digital VMS, with MMS software makefile.mms jconfig.vms Digital VMS, with MMS software
makefile.vms jconfig.vms Digital VMS, without MMS software makefile.vms jconfig.vms Digital VMS, without MMS software
@@ -1018,57 +1021,75 @@ the configuration to prevent jpeglib.h from using extern "C".
Microsoft Windows, Microsoft Visual C++ 6 Developer Studio: Microsoft Windows, Microsoft Visual C++ 6 Developer Studio:
We include makefiles that should work as project files in DevStudio 6.0 or We include makefiles that should work as project files in Developer Studio
later. There is a library makefile that builds the IJG library as a static 6.0 or later. There is a library makefile that builds the IJG library as
Win32 library, and application makefiles that build the sample applications a static Win32 library, and application makefiles that build the sample
as Win32 console applications. (Even if you only want the library, we
recommend building the applications so that you can run the self-test.)
To use:
1. Open the command prompt, change to the main directory and execute the
command line
NMAKE /f makefile.vc setup-vc6
This will move jconfig.vc to jconfig.h and makefiles to project files.
(Note that the renaming is critical!)
2. Open the workspace file jpeg.dsw, build the library project.
(If you are using DevStudio more recent than 6.0, you'll probably
get a message saying that the project files are being updated.)
3. Open the workspace file apps.dsw, build the application projects.
4. To perform the self-test, execute the command line
NMAKE /f makefile.vc test-build
5. Move the application .exe files from `app`\Release to an
appropriate location on your path.
Microsoft Windows, Microsoft Visual C++ 2010 Developer Studio (v10):
We include makefiles that should work as project files in Visual Studio
2010 or later. There is a library makefile that builds the IJG library
as a static Win32 library, and application makefiles that build the sample
applications as Win32 console applications. (Even if you only want the applications as Win32 console applications. (Even if you only want the
library, we recommend building the applications so that you can run the library, we recommend building the applications so that you can run the
self-test.) self-test.)
To use: To use:
1. Open the command prompt, change to the main directory and execute the 1. Open the command prompt, change to the source directory and execute
command line the command line
NMAKE /f makefile.vc setup-v10 NMAKE /f makefile.vs setup-vc6
If you get an error message saying that the "NMAKE" command could
not be found, execute the command
"%ProgramFiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32"
to set the environment for using Microsoft Visual C++ tools,
and repeat the NMAKE call.
This will move jconfig.vc to jconfig.h and makefiles to project files. This will move jconfig.vc to jconfig.h and makefiles to project files.
(Note that the renaming is critical!) (Note that the renaming is critical!)
2. Open the solution file jpeg.sln, build the library project. Alternatively you can use
(If you are using Visual Studio more recent than 2010 (v10), you'll NMAKE /f makefile.vs setupcopy-vc6
This will create renamed copies of the files, which allows to repeat
the setup later.
2. Open the workspace file jpeg.dsw, build the library project.
(If you are using Developer Studio more recent than 6.0, you'll
probably get a message saying that the project files are being updated.) probably get a message saying that the project files are being updated.)
3. Open the solution file apps.sln, build the application projects. 3. Open the workspace file apps.dsw, build the application projects.
4. To perform the self-test, execute the command line 4. To perform the self-test, execute the command line
NMAKE /f makefile.vc test-build NMAKE /f makefile.vs test-build
5. Move the application .exe files from `app`\Release to an 5. Move the application .exe files from the Release folder to an
appropriate location on your path. appropriate location on your path.
Note:
There seems to be an optimization bug in the compiler which causes the Microsoft Windows, Visual Studio 2019 (v16):
self-test to fail with the color quantization option.
We have disabled optimization for the file jquant2.c in the library We include makefiles that should work as project files in Visual Studio
project file which causes the self-test to pass properly. 2019 (v16) or later. There is a library makefile that builds the IJG
library as a static Win32/x64 library, and application makefiles that
build the sample applications as Win32/x64 console applications. (Even
if you only want the library, we recommend building the applications so
that you can run the self-test.)
To use:
1. Open the Developer Command Prompt for VS 2019, change to the source
directory and execute the command line
NMAKE /f makefile.vs setup-v16
This will move jconfig.vc to jconfig.h and makefiles to project files.
(Note that the renaming is critical!)
Alternatively you can use
NMAKE /f makefile.vs setupcopy-v16
This will create renamed copies of the files, which allows to repeat
the setup later.
2. Open the solution file jpeg.sln, build the library project.
a) If you are using Visual Studio more recent than
2019 (v16), you'll probably get a message saying
that the project files are being updated.
b) If necessary, open the project properties and
adapt the Windows Target Platform Version in
the Configuration Properties, General section;
we support the latest version at the time of release.
c) If you want to build x64 code, change the platform setting from
Win32 to x64. You can build Win32 and x64 versions side by side.
3. Open the solution file apps.sln, build the application projects.
4. To perform the self-test, execute the command line
NMAKE /f makefile.vs test-32
for the Win32 build, or on a 64-bit system
NMAKE /f makefile.vs test-64
for the x64 build.
5. Move the application .exe files from the Release folder to an
appropriate location on your path.
OS/2, Borland C++: OS/2, Borland C++:

View File

@@ -1,7 +1,7 @@
/* /*
* jcarith.c * jcarith.c
* *
* Developed 1997-2013 by Guido Vollbeding. * Developed 1997-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -181,11 +181,11 @@ finish_pass (j_compress_ptr cinfo)
if (e->zc) /* output final pending zero bytes */ if (e->zc) /* output final pending zero bytes */
do emit_byte(0x00, cinfo); do emit_byte(0x00, cinfo);
while (--e->zc); while (--e->zc);
emit_byte((e->c >> 19) & 0xFF, cinfo); emit_byte((int) ((e->c >> 19) & 0xFF), cinfo);
if (((e->c >> 19) & 0xFF) == 0xFF) if (((e->c >> 19) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo); emit_byte(0x00, cinfo);
if (e->c & 0x7F800L) { if (e->c & 0x7F800L) {
emit_byte((e->c >> 11) & 0xFF, cinfo); emit_byte((int) ((e->c >> 11) & 0xFF), cinfo);
if (((e->c >> 11) & 0xFF) == 0xFF) if (((e->c >> 11) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo); emit_byte(0x00, cinfo);
} }
@@ -280,7 +280,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
/* Note: The 3 spacer bits in the C register guarantee /* Note: The 3 spacer bits in the C register guarantee
* that the new buffer byte can't be 0xFF here * that the new buffer byte can't be 0xFF here
* (see page 160 in the P&M JPEG book). */ * (see page 160 in the P&M JPEG book). */
e->buffer = temp & 0xFF; /* new output byte, might overflow later */ /* New output byte, might overflow later */
e->buffer = (int) (temp & 0xFF);
} else if (temp == 0xFF) { } else if (temp == 0xFF) {
++e->sc; /* stack 0xFF byte (which might overflow later) */ ++e->sc; /* stack 0xFF byte (which might overflow later) */
} else { } else {
@@ -302,7 +303,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
emit_byte(0x00, cinfo); emit_byte(0x00, cinfo);
} while (--e->sc); } while (--e->sc);
} }
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */ /* New output byte (can still overflow) */
e->buffer = (int) (temp & 0xFF);
} }
e->c &= 0x7FFFFL; e->c &= 0x7FFFFL;
e->ct += 8; e->ct += 8;
@@ -926,9 +928,8 @@ jinit_arith_encoder (j_compress_ptr cinfo)
arith_entropy_ptr entropy; arith_entropy_ptr entropy;
int i; int i;
entropy = (arith_entropy_ptr) entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_encoder));
SIZEOF(arith_entropy_encoder));
cinfo->entropy = &entropy->pub; cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass; entropy->pub.start_pass = start_pass;
entropy->pub.finish_pass = finish_pass; entropy->pub.finish_pass = finish_pass;

View File

@@ -2,7 +2,7 @@
* jccolor.c * jccolor.c
* *
* Copyright (C) 1991-1996, Thomas G. Lane. * Copyright (C) 1991-1996, Thomas G. Lane.
* Modified 2011-2013 by Guido Vollbeding. * Modified 2011-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -105,7 +105,7 @@ rgb_ycc_start (j_compress_ptr cinfo)
/* Allocate and fill in the conversion tables. */ /* Allocate and fill in the conversion tables. */
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *) cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(TABLE_SIZE * SIZEOF(INT32))); TABLE_SIZE * SIZEOF(INT32));
for (i = 0; i <= MAXJSAMPLE; i++) { for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i; rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i;
@@ -131,12 +131,12 @@ rgb_ycc_start (j_compress_ptr cinfo)
* Convert some rows of samples to the JPEG colorspace. * Convert some rows of samples to the JPEG colorspace.
* *
* Note that we change from the application's interleaved-pixel format * Note that we change from the application's interleaved-pixel format
* to our internal noninterleaved, one-plane-per-component format. * to our internal noninterleaved, one-plane-per-component format. The
* The input buffer is therefore three times as wide as the output buffer. * input buffer is therefore three times as wide as the output buffer.
* *
* A starting row offset is provided only for the output buffer. The caller * A starting row offset is provided only for the output buffer. The
* can easily adjust the passed input_buf value to accommodate any row * caller can easily adjust the passed input_buf value to accommodate
* offset required on that side. * any row offset required on that side.
*/ */
METHODDEF(void) METHODDEF(void)
@@ -145,8 +145,8 @@ rgb_ycc_convert (j_compress_ptr cinfo,
JDIMENSION output_row, int num_rows) JDIMENSION output_row, int num_rows)
{ {
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b; register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr; register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2; register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col; register JDIMENSION col;
@@ -162,6 +162,7 @@ rgb_ycc_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]); r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]); g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]); b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation. * must be too; we do not need an explicit range-limiting operation.
* Hence the value being shifted is never negative, and we don't * Hence the value being shifted is never negative, and we don't
@@ -179,7 +180,6 @@ rgb_ycc_convert (j_compress_ptr cinfo,
outptr2[col] = (JSAMPLE) outptr2[col] = (JSAMPLE)
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS); >> SCALEBITS);
inptr += RGB_PIXELSIZE;
} }
} }
} }
@@ -201,8 +201,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
JDIMENSION output_row, int num_rows) JDIMENSION output_row, int num_rows)
{ {
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b; register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr; register JSAMPROW inptr;
register JSAMPROW outptr; register JSAMPROW outptr;
register JDIMENSION col; register JDIMENSION col;
@@ -215,11 +215,11 @@ rgb_gray_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]); r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]); g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]); b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* Y */ /* Y */
outptr[col] = (JSAMPLE) outptr[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS); >> SCALEBITS);
inptr += RGB_PIXELSIZE;
} }
} }
} }
@@ -228,8 +228,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
/* /*
* Convert some rows of samples to the JPEG colorspace. * Convert some rows of samples to the JPEG colorspace.
* This version handles Adobe-style CMYK->YCCK conversion, * This version handles Adobe-style CMYK->YCCK conversion,
* where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the
* conversion as above, while passing K (black) unchanged. * same conversion as above, while passing K (black) unchanged.
* We assume rgb_ycc_start has been called. * We assume rgb_ycc_start has been called.
*/ */
@@ -239,8 +239,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
JDIMENSION output_row, int num_rows) JDIMENSION output_row, int num_rows)
{ {
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b; register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr; register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2, outptr3; register JSAMPROW outptr0, outptr1, outptr2, outptr3;
register JDIMENSION col; register JDIMENSION col;
@@ -259,6 +259,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
/* K passes through as-is */ /* K passes through as-is */
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
inptr += 4;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation. * must be too; we do not need an explicit range-limiting operation.
* Hence the value being shifted is never negative, and we don't * Hence the value being shifted is never negative, and we don't
@@ -276,7 +277,6 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
outptr2[col] = (JSAMPLE) outptr2[col] = (JSAMPLE)
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS); >> SCALEBITS);
inptr += 4;
} }
} }
} }
@@ -312,13 +312,13 @@ rgb_rgb1_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]); r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]); g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]); b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
* (modulo) operator is equivalent to the bitmask operator AND. * (modulo) operator is equivalent to the bitmask operator AND.
*/ */
outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE); outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE);
outptr1[col] = (JSAMPLE) g; outptr1[col] = (JSAMPLE) g;
outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE); outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE);
inptr += RGB_PIXELSIZE;
} }
} }
} }
@@ -335,17 +335,17 @@ grayscale_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows) JDIMENSION output_row, int num_rows)
{ {
int instride = cinfo->input_components;
register JSAMPROW inptr; register JSAMPROW inptr;
register JSAMPROW outptr; register JSAMPROW outptr;
register JDIMENSION col; register JDIMENSION count;
register int instride = cinfo->input_components;
JDIMENSION num_cols = cinfo->image_width; JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) { while (--num_rows >= 0) {
inptr = *input_buf++; inptr = *input_buf++;
outptr = output_buf[0][output_row++]; outptr = output_buf[0][output_row++];
for (col = 0; col < num_cols; col++) { for (count = num_cols; count > 0; count--) {
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ *outptr++ = *inptr; /* don't need GETJSAMPLE() here */
inptr += instride; inptr += instride;
} }
} }
@@ -396,21 +396,21 @@ null_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows) JDIMENSION output_row, int num_rows)
{ {
int ci;
register int nc = cinfo->num_components;
register JSAMPROW inptr; register JSAMPROW inptr;
register JSAMPROW outptr; register JSAMPROW outptr;
register JDIMENSION col; register JDIMENSION count;
register int num_comps = cinfo->num_components;
JDIMENSION num_cols = cinfo->image_width; JDIMENSION num_cols = cinfo->image_width;
int ci;
while (--num_rows >= 0) { while (--num_rows >= 0) {
/* It seems fastest to make a separate pass for each component. */ /* It seems fastest to make a separate pass for each component. */
for (ci = 0; ci < nc; ci++) { for (ci = 0; ci < num_comps; ci++) {
inptr = input_buf[0] + ci; inptr = input_buf[0] + ci;
outptr = output_buf[ci][output_row]; outptr = output_buf[ci][output_row];
for (col = 0; col < num_cols; col++) { for (count = num_cols; count > 0; count--) {
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */ *outptr++ = *inptr; /* don't need GETJSAMPLE() here */
inptr += nc; inptr += num_comps;
} }
} }
input_buf++; input_buf++;
@@ -439,9 +439,8 @@ jinit_color_converter (j_compress_ptr cinfo)
{ {
my_cconvert_ptr cconvert; my_cconvert_ptr cconvert;
cconvert = (my_cconvert_ptr) cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_converter));
SIZEOF(my_color_converter));
cinfo->cconvert = &cconvert->pub; cinfo->cconvert = &cconvert->pub;
/* set start_pass to null method until we find out differently */ /* set start_pass to null method until we find out differently */
cconvert->pub.start_pass = null_method; cconvert->pub.start_pass = null_method;
@@ -455,9 +454,11 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_RGB: case JCS_RGB:
case JCS_BG_RGB: case JCS_BG_RGB:
#if RGB_PIXELSIZE != 3
if (cinfo->input_components != RGB_PIXELSIZE) if (cinfo->input_components != RGB_PIXELSIZE)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break; break;
#endif /* else share code with YCbCr */
case JCS_YCbCr: case JCS_YCbCr:
case JCS_BG_YCC: case JCS_BG_YCC:
@@ -474,7 +475,6 @@ jinit_color_converter (j_compress_ptr cinfo)
default: /* JCS_UNKNOWN can be anything */ default: /* JCS_UNKNOWN can be anything */
if (cinfo->input_components < 1) if (cinfo->input_components < 1)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
} }
/* Support color transform only for RGB colorspaces */ /* Support color transform only for RGB colorspaces */
@@ -507,7 +507,8 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_BG_RGB: case JCS_BG_RGB:
if (cinfo->num_components != 3) if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == cinfo->jpeg_color_space) { if (cinfo->in_color_space != cinfo->jpeg_color_space)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
switch (cinfo->color_transform) { switch (cinfo->color_transform) {
case JCT_NONE: case JCT_NONE:
cconvert->pub.color_convert = rgb_convert; cconvert->pub.color_convert = rgb_convert;
@@ -518,8 +519,6 @@ jinit_color_converter (j_compress_ptr cinfo)
default: default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
} }
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break; break;
case JCS_YCbCr: case JCS_YCbCr:
@@ -572,10 +571,9 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_CMYK: case JCS_CMYK:
if (cinfo->num_components != 4) if (cinfo->num_components != 4)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_CMYK) if (cinfo->in_color_space != JCS_CMYK)
cconvert->pub.color_convert = null_convert;
else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
cconvert->pub.color_convert = null_convert;
break; break;
case JCS_YCCK: case JCS_YCCK:
@@ -599,6 +597,5 @@ jinit_color_converter (j_compress_ptr cinfo)
cinfo->num_components != cinfo->input_components) cinfo->num_components != cinfo->input_components)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
cconvert->pub.color_convert = null_convert; cconvert->pub.color_convert = null_convert;
break;
} }
} }

137
jchuff.c
View File

@@ -2,7 +2,7 @@
* jchuff.c * jchuff.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2006-2013 by Guido Vollbeding. * Modified 2006-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -178,13 +178,12 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
htbl = htbl =
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
if (htbl == NULL) if (htbl == NULL)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); htbl = jpeg_std_huff_table((j_common_ptr) cinfo, isDC, tblno);
/* Allocate a workspace if we haven't already done so. */ /* Allocate a workspace if we haven't already done so. */
if (*pdtbl == NULL) if (*pdtbl == NULL)
*pdtbl = (c_derived_tbl *) *pdtbl = (c_derived_tbl *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(c_derived_tbl));
SIZEOF(c_derived_tbl));
dtbl = *pdtbl; dtbl = *pdtbl;
/* Figure C.1: make table of Huffman code length for each symbol */ /* Figure C.1: make table of Huffman code length for each symbol */
@@ -1256,10 +1255,82 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
int codesize[257]; /* codesize[k] = code length of symbol k */ int codesize[257]; /* codesize[k] = code length of symbol k */
int others[257]; /* next symbol in current branch of tree */ int others[257]; /* next symbol in current branch of tree */
int c1, c2; int c1, c2, i, j;
int p, i, j; UINT8 *p;
long v; long v;
freq[256] = 1; /* make sure 256 has a nonzero count */
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
* that no real symbol is given code-value of all ones, because 256
* will be placed last in the largest codeword category.
* In the symbol list build procedure this element serves as sentinel
* for the zero run loop.
*/
#ifndef DONT_USE_FANCY_HUFF_OPT
/* Build list of symbols sorted in order of descending frequency */
/* This approach has several benefits (thank to John Korejwa for the idea):
* 1.
* If a codelength category is split during the length limiting procedure
* below, the feature that more frequent symbols are assigned shorter
* codewords remains valid for the adjusted code.
* 2.
* To reduce consecutive ones in a Huffman data stream (thus reducing the
* number of stuff bytes in JPEG) it is preferable to follow 0 branches
* (and avoid 1 branches) as much as possible. This is easily done by
* assigning symbols to leaves of the Huffman tree in order of decreasing
* frequency, with no secondary sort based on codelengths.
* 3.
* The symbol list can be built independently from the assignment of code
* lengths by the Huffman procedure below.
* Note: The symbol list build procedure must be performed first, because
* the Huffman procedure assigning the codelengths clobbers the frequency
* counts!
*/
/* Here we use the others array as a linked list of nonzero frequencies
* to be sorted. Already sorted elements are removed from the list.
*/
/* Building list */
/* This item does not correspond to a valid symbol frequency and is used
* as starting index.
*/
j = 256;
for (i = 0;; i++) {
if (freq[i] == 0) /* skip zero frequencies */
continue;
if (i > 255)
break;
others[j] = i; /* this symbol value */
j = i; /* previous symbol value */
}
others[j] = -1; /* mark end of list */
/* Sorting list */
p = htbl->huffval;
while ((c1 = others[256]) >= 0) {
v = freq[c1];
i = c1; /* first symbol value */
j = 256; /* pseudo symbol value for starting index */
while ((c2 = others[c1]) >= 0) {
if (freq[c2] > v) {
v = freq[c2];
i = c2; /* this symbol value */
j = c1; /* previous symbol value */
}
c1 = c2;
}
others[j] = others[i]; /* remove this symbol i from list */
*p++ = (UINT8) i;
}
#endif /* DONT_USE_FANCY_HUFF_OPT */
/* This algorithm is explained in section K.2 of the JPEG standard */ /* This algorithm is explained in section K.2 of the JPEG standard */
MEMZERO(bits, SIZEOF(bits)); MEMZERO(bits, SIZEOF(bits));
@@ -1267,12 +1338,6 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
for (i = 0; i < 257; i++) for (i = 0; i < 257; i++)
others[i] = -1; /* init links to empty */ others[i] = -1; /* init links to empty */
freq[256] = 1; /* make sure 256 has a nonzero count */
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
* that no real symbol is given code-value of all ones, because 256
* will be placed last in the largest codeword category.
*/
/* Huffman's basic algorithm to assign optimal code lengths to symbols */ /* Huffman's basic algorithm to assign optimal code lengths to symbols */
for (;;) { for (;;) {
@@ -1329,7 +1394,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
/* The JPEG standard seems to think that this can't happen, */ /* The JPEG standard seems to think that this can't happen, */
/* but I'm paranoid... */ /* but I'm paranoid... */
if (codesize[i] > MAX_CLEN) if (codesize[i] > MAX_CLEN)
ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); ERREXIT(cinfo, JERR_HUFF_CLEN_OUTOFBOUNDS);
bits[codesize[i]]++; bits[codesize[i]]++;
} }
@@ -1349,8 +1414,11 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
for (i = MAX_CLEN; i > 16; i--) { for (i = MAX_CLEN; i > 16; i--) {
while (bits[i] > 0) { while (bits[i] > 0) {
j = i - 2; /* find length of new prefix to be used */ j = i - 2; /* find length of new prefix to be used */
while (bits[j] == 0) while (bits[j] == 0) {
if (j == 0)
ERREXIT(cinfo, JERR_HUFF_CLEN_OUTOFBOUNDS);
j--; j--;
}
bits[i] -= 2; /* remove two symbols */ bits[i] -= 2; /* remove two symbols */
bits[i-1]++; /* one goes in this length */ bits[i-1]++; /* one goes in this length */
@@ -1367,20 +1435,23 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
/* Return final symbol counts (only for lengths 0..16) */ /* Return final symbol counts (only for lengths 0..16) */
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
#ifdef DONT_USE_FANCY_HUFF_OPT
/* Return a list of the symbols sorted by code length */ /* Return a list of the symbols sorted by code length */
/* It's not real clear to me why we don't need to consider the codelength /* Note: Due to the codelength changes made above, it can happen
* changes made above, but the JPEG spec seems to think this works. * that more frequent symbols are assigned longer codewords.
*/ */
p = 0; p = htbl->huffval;
for (i = 1; i <= MAX_CLEN; i++) { for (i = 1; i <= MAX_CLEN; i++) {
for (j = 0; j <= 255; j++) { for (j = 0; j <= 255; j++) {
if (codesize[j] == i) { if (codesize[j] == i) {
htbl->huffval[p] = (UINT8) j; *p++ = (UINT8) j;
p++;
} }
} }
} }
#endif /* DONT_USE_FANCY_HUFF_OPT */
/* Set sent_table FALSE so updated table will be written to JPEG file. */ /* Set sent_table FALSE so updated table will be written to JPEG file. */
htbl->sent_table = FALSE; htbl->sent_table = FALSE;
} }
@@ -1400,13 +1471,13 @@ finish_pass_gather (j_compress_ptr cinfo)
boolean did_dc[NUM_HUFF_TBLS]; boolean did_dc[NUM_HUFF_TBLS];
boolean did_ac[NUM_HUFF_TBLS]; boolean did_ac[NUM_HUFF_TBLS];
/* It's important not to apply jpeg_gen_optimal_table more than once
* per table, because it clobbers the input frequency counts!
*/
if (cinfo->progressive_mode) if (cinfo->progressive_mode)
/* Flush out buffered data (all we care about is counting the EOB symbol) */ /* Flush out buffered data (all we care about is counting the EOB symbol) */
emit_eobrun(entropy); emit_eobrun(entropy);
/* It's important not to apply jpeg_gen_optimal_table more than once
* per table, because it clobbers the input frequency counts!
*/
MEMZERO(did_dc, SIZEOF(did_dc)); MEMZERO(did_dc, SIZEOF(did_dc));
MEMZERO(did_ac, SIZEOF(did_ac)); MEMZERO(did_ac, SIZEOF(did_ac));
@@ -1475,9 +1546,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
entropy->pub.encode_mcu = encode_mcu_AC_refine; entropy->pub.encode_mcu = encode_mcu_AC_refine;
/* AC refinement needs a correction bit buffer */ /* AC refinement needs a correction bit buffer */
if (entropy->bit_buffer == NULL) if (entropy->bit_buffer == NULL)
entropy->bit_buffer = (char *) entropy->bit_buffer = (char *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, MAX_CORR_BITS * SIZEOF(char));
MAX_CORR_BITS * SIZEOF(char));
} }
} }
@@ -1505,9 +1575,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
/* Allocate and zero the statistics tables */ /* Allocate and zero the statistics tables */
/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
if (entropy->dc_count_ptrs[tbl] == NULL) if (entropy->dc_count_ptrs[tbl] == NULL)
entropy->dc_count_ptrs[tbl] = (long *) entropy->dc_count_ptrs[tbl] = (long *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, 257 * SIZEOF(long));
257 * SIZEOF(long));
MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long)); MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long));
} else { } else {
/* Compute derived values for Huffman tables */ /* Compute derived values for Huffman tables */
@@ -1525,9 +1594,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
if (tbl < 0 || tbl >= NUM_HUFF_TBLS) if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
if (entropy->ac_count_ptrs[tbl] == NULL) if (entropy->ac_count_ptrs[tbl] == NULL)
entropy->ac_count_ptrs[tbl] = (long *) entropy->ac_count_ptrs[tbl] = (long *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, 257 * SIZEOF(long));
257 * SIZEOF(long));
MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long)); MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long));
} else { } else {
jpeg_make_c_derived_tbl(cinfo, FALSE, tbl, jpeg_make_c_derived_tbl(cinfo, FALSE, tbl,
@@ -1556,9 +1624,8 @@ jinit_huff_encoder (j_compress_ptr cinfo)
huff_entropy_ptr entropy; huff_entropy_ptr entropy;
int i; int i;
entropy = (huff_entropy_ptr) entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_encoder));
SIZEOF(huff_entropy_encoder));
cinfo->entropy = &entropy->pub; cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass_huff; entropy->pub.start_pass = start_pass_huff;

169
jcinit.c
View File

@@ -2,7 +2,7 @@
* jcinit.c * jcinit.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding. * Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -21,6 +21,168 @@
#include "jpeglib.h" #include "jpeglib.h"
/*
* Compute JPEG image dimensions and related values.
* NOTE: this is exported for possible use by application.
* Hence it mustn't do anything that can't be done twice.
*/
GLOBAL(void)
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
/* Sanity check on input image dimensions to prevent overflow in
* following calculations.
* We do check jpeg_width and jpeg_height in initial_setup in jcmaster.c,
* but image_width and image_height can come from arbitrary data,
* and we need some space for multiplication by block_size.
*/
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
#ifdef DCT_SCALING_SUPPORTED
/* Compute actual JPEG image dimensions and DCT scaling choices. */
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/1 scaling */
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
cinfo->min_DCT_h_scaled_size = 1;
cinfo->min_DCT_v_scaled_size = 1;
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/2 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
cinfo->min_DCT_h_scaled_size = 2;
cinfo->min_DCT_v_scaled_size = 2;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/3 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
cinfo->min_DCT_h_scaled_size = 3;
cinfo->min_DCT_v_scaled_size = 3;
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/4 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
cinfo->min_DCT_h_scaled_size = 4;
cinfo->min_DCT_v_scaled_size = 4;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/5 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
cinfo->min_DCT_h_scaled_size = 5;
cinfo->min_DCT_v_scaled_size = 5;
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/6 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
cinfo->min_DCT_h_scaled_size = 6;
cinfo->min_DCT_v_scaled_size = 6;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/7 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
cinfo->min_DCT_h_scaled_size = 7;
cinfo->min_DCT_v_scaled_size = 7;
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/8 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
cinfo->min_DCT_h_scaled_size = 8;
cinfo->min_DCT_v_scaled_size = 8;
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/9 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
cinfo->min_DCT_h_scaled_size = 9;
cinfo->min_DCT_v_scaled_size = 9;
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/10 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
cinfo->min_DCT_h_scaled_size = 10;
cinfo->min_DCT_v_scaled_size = 10;
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/11 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
cinfo->min_DCT_h_scaled_size = 11;
cinfo->min_DCT_v_scaled_size = 11;
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/12 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
cinfo->min_DCT_h_scaled_size = 12;
cinfo->min_DCT_v_scaled_size = 12;
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/13 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
cinfo->min_DCT_h_scaled_size = 13;
cinfo->min_DCT_v_scaled_size = 13;
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/14 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
cinfo->min_DCT_h_scaled_size = 14;
cinfo->min_DCT_v_scaled_size = 14;
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/15 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
cinfo->min_DCT_h_scaled_size = 15;
cinfo->min_DCT_v_scaled_size = 15;
} else {
/* Provide block_size/16 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
cinfo->min_DCT_h_scaled_size = 16;
cinfo->min_DCT_v_scaled_size = 16;
}
#else /* !DCT_SCALING_SUPPORTED */
/* Hardwire it to "no scaling" */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
cinfo->min_DCT_h_scaled_size = DCTSIZE;
cinfo->min_DCT_v_scaled_size = DCTSIZE;
#endif /* DCT_SCALING_SUPPORTED */
}
/* /*
* Master selection of compression modules. * Master selection of compression modules.
* This is done once at the start of processing an image. We determine * This is done once at the start of processing an image. We determine
@@ -37,7 +199,7 @@ jinit_compress_master (j_compress_ptr cinfo)
if (cinfo->data_precision != BITS_IN_JSAMPLE) if (cinfo->data_precision != BITS_IN_JSAMPLE)
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
/* Sanity check on image dimensions */ /* Sanity check on input image dimensions */
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 || if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
cinfo->input_components <= 0) cinfo->input_components <= 0)
ERREXIT(cinfo, JERR_EMPTY_IMAGE); ERREXIT(cinfo, JERR_EMPTY_IMAGE);
@@ -48,6 +210,9 @@ jinit_compress_master (j_compress_ptr cinfo)
if ((long) jd_samplesperrow != samplesperrow) if ((long) jd_samplesperrow != samplesperrow)
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
/* Compute JPEG image dimensions and related values. */
jpeg_calc_jpeg_dimensions(cinfo);
/* Initialize master control (includes parameter checking/processing) */ /* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, FALSE /* full compression */); jinit_c_master_control(cinfo, FALSE /* full compression */);

View File

@@ -2,7 +2,7 @@
* jcmarker.c * jcmarker.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding. * Modified 2003-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -471,7 +471,6 @@ emit_adobe_app14 (j_compress_ptr cinfo)
break; break;
default: default:
emit_byte(cinfo, 0); /* Color transform = 0 */ emit_byte(cinfo, 0); /* Color transform = 0 */
break;
} }
} }
@@ -702,9 +701,8 @@ jinit_marker_writer (j_compress_ptr cinfo)
my_marker_ptr marker; my_marker_ptr marker;
/* Create the subobject */ /* Create the subobject */
marker = (my_marker_ptr) marker = (my_marker_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_marker_writer));
SIZEOF(my_marker_writer));
cinfo->marker = &marker->pub; cinfo->marker = &marker->pub;
/* Initialize method pointers */ /* Initialize method pointers */
marker->pub.write_file_header = write_file_header; marker->pub.write_file_header = write_file_header;

View File

@@ -2,7 +2,7 @@
* jcmaster.c * jcmaster.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding. * Modified 2003-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -43,191 +43,13 @@ typedef my_comp_master * my_master_ptr;
* Support routines that do various essential calculations. * Support routines that do various essential calculations.
*/ */
/*
* Compute JPEG image dimensions and related values.
* NOTE: this is exported for possible use by application.
* Hence it mustn't do anything that can't be done twice.
*/
GLOBAL(void)
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
#ifdef DCT_SCALING_SUPPORTED
/* Sanity check on input image dimensions to prevent overflow in
* following calculation.
* We do check jpeg_width and jpeg_height in initial_setup below,
* but image_width and image_height can come from arbitrary data,
* and we need some space for multiplication by block_size.
*/
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
/* Compute actual JPEG image dimensions and DCT scaling choices. */
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/1 scaling */
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
cinfo->min_DCT_h_scaled_size = 1;
cinfo->min_DCT_v_scaled_size = 1;
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/2 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
cinfo->min_DCT_h_scaled_size = 2;
cinfo->min_DCT_v_scaled_size = 2;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/3 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
cinfo->min_DCT_h_scaled_size = 3;
cinfo->min_DCT_v_scaled_size = 3;
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/4 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
cinfo->min_DCT_h_scaled_size = 4;
cinfo->min_DCT_v_scaled_size = 4;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/5 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
cinfo->min_DCT_h_scaled_size = 5;
cinfo->min_DCT_v_scaled_size = 5;
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/6 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
cinfo->min_DCT_h_scaled_size = 6;
cinfo->min_DCT_v_scaled_size = 6;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/7 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
cinfo->min_DCT_h_scaled_size = 7;
cinfo->min_DCT_v_scaled_size = 7;
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/8 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
cinfo->min_DCT_h_scaled_size = 8;
cinfo->min_DCT_v_scaled_size = 8;
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/9 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
cinfo->min_DCT_h_scaled_size = 9;
cinfo->min_DCT_v_scaled_size = 9;
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/10 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
cinfo->min_DCT_h_scaled_size = 10;
cinfo->min_DCT_v_scaled_size = 10;
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/11 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
cinfo->min_DCT_h_scaled_size = 11;
cinfo->min_DCT_v_scaled_size = 11;
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/12 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
cinfo->min_DCT_h_scaled_size = 12;
cinfo->min_DCT_v_scaled_size = 12;
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/13 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
cinfo->min_DCT_h_scaled_size = 13;
cinfo->min_DCT_v_scaled_size = 13;
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/14 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
cinfo->min_DCT_h_scaled_size = 14;
cinfo->min_DCT_v_scaled_size = 14;
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/15 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
cinfo->min_DCT_h_scaled_size = 15;
cinfo->min_DCT_v_scaled_size = 15;
} else {
/* Provide block_size/16 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
cinfo->min_DCT_h_scaled_size = 16;
cinfo->min_DCT_v_scaled_size = 16;
}
#else /* !DCT_SCALING_SUPPORTED */
/* Hardwire it to "no scaling" */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
cinfo->min_DCT_h_scaled_size = DCTSIZE;
cinfo->min_DCT_v_scaled_size = DCTSIZE;
#endif /* DCT_SCALING_SUPPORTED */
}
LOCAL(void) LOCAL(void)
jpeg_calc_trans_dimensions (j_compress_ptr cinfo) initial_setup (j_compress_ptr cinfo)
{
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
}
LOCAL(void)
initial_setup (j_compress_ptr cinfo, boolean transcode_only)
/* Do computations that are needed before master selection phase */ /* Do computations that are needed before master selection phase */
{ {
int ci, ssize; int ci, ssize;
jpeg_component_info *compptr; jpeg_component_info *compptr;
if (transcode_only)
jpeg_calc_trans_dimensions(cinfo);
else
jpeg_calc_jpeg_dimensions(cinfo);
/* Sanity check on block_size */ /* Sanity check on block_size */
if (cinfo->block_size < 1 || cinfo->block_size > 16) if (cinfo->block_size < 1 || cinfo->block_size > 16)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size); ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
@@ -240,7 +62,7 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
case 5: cinfo->natural_order = jpeg_natural_order5; break; case 5: cinfo->natural_order = jpeg_natural_order5; break;
case 6: cinfo->natural_order = jpeg_natural_order6; break; case 6: cinfo->natural_order = jpeg_natural_order6; break;
case 7: cinfo->natural_order = jpeg_natural_order7; break; case 7: cinfo->natural_order = jpeg_natural_order7; break;
default: cinfo->natural_order = jpeg_natural_order; break; default: cinfo->natural_order = jpeg_natural_order;
} }
/* Derive lim_Se from block_size */ /* Derive lim_Se from block_size */
@@ -292,18 +114,22 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
*/ */
ssize = 1; ssize = 1;
#ifdef DCT_SCALING_SUPPORTED #ifdef DCT_SCALING_SUPPORTED
if (! cinfo->raw_data_in)
while (cinfo->min_DCT_h_scaled_size * ssize <= while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) && (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) { (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2; ssize = ssize * 2;
} }
#endif #endif
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize; compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
ssize = 1; ssize = 1;
#ifdef DCT_SCALING_SUPPORTED #ifdef DCT_SCALING_SUPPORTED
if (! cinfo->raw_data_in)
while (cinfo->min_DCT_v_scaled_size * ssize <= while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) && (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) { (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2; ssize = ssize * 2;
} }
#endif #endif
@@ -414,13 +240,9 @@ validate_script (j_compress_ptr cinfo)
* out-of-range reconstructed DC values during the first DC scan, * out-of-range reconstructed DC values during the first DC scan,
* which might cause problems for some decoders. * which might cause problems for some decoders.
*/ */
#if BITS_IN_JSAMPLE == 8
#define MAX_AH_AL 10
#else
#define MAX_AH_AL 13
#endif
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) Ah < 0 || Ah > (cinfo->data_precision > 8 ? 13 : 10) ||
Al < 0 || Al > (cinfo->data_precision > 8 ? 13 : 10))
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
if (Ss == 0) { if (Ss == 0) {
if (Se != 0) /* DC and AC together not OK */ if (Se != 0) /* DC and AC together not OK */
@@ -802,9 +624,8 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
{ {
my_master_ptr master; my_master_ptr master;
master = (my_master_ptr) master = (my_master_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_comp_master));
SIZEOF(my_comp_master));
cinfo->master = &master->pub; cinfo->master = &master->pub;
master->pub.prepare_for_pass = prepare_for_pass; master->pub.prepare_for_pass = prepare_for_pass;
master->pub.pass_startup = pass_startup; master->pub.pass_startup = pass_startup;
@@ -812,7 +633,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
master->pub.is_last_pass = FALSE; master->pub.is_last_pass = FALSE;
/* Validate parameters, determine derived values */ /* Validate parameters, determine derived values */
initial_setup(cinfo, transcode_only); initial_setup(cinfo);
if (cinfo->scan_info != NULL) { if (cinfo->scan_info != NULL) {
#ifdef C_MULTISCAN_FILES_SUPPORTED #ifdef C_MULTISCAN_FILES_SUPPORTED

138
jcomapi.c
View File

@@ -2,6 +2,7 @@
* jcomapi.c * jcomapi.c
* *
* Copyright (C) 1994-1997, Thomas G. Lane. * Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -104,3 +105,140 @@ jpeg_alloc_huff_table (j_common_ptr cinfo)
tbl->sent_table = FALSE; /* make sure this is false in any new table */ tbl->sent_table = FALSE; /* make sure this is false in any new table */
return tbl; return tbl;
} }
/*
* Set up the standard Huffman tables (cf. JPEG standard section K.3).
* IMPORTANT: these are only valid for 8-bit data precision!
* (Would jutils.c be a more reasonable place to put this?)
*/
GLOBAL(JHUFF_TBL *)
jpeg_std_huff_table (j_common_ptr cinfo, boolean isDC, int tblno)
{
JHUFF_TBL **htblptr, *htbl;
const UINT8 *bits, *val;
int nsymbols, len;
static const UINT8 bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
if (cinfo->is_decompressor) {
if (isDC)
htblptr = ((j_decompress_ptr) cinfo)->dc_huff_tbl_ptrs;
else
htblptr = ((j_decompress_ptr) cinfo)->ac_huff_tbl_ptrs;
} else {
if (isDC)
htblptr = ((j_compress_ptr) cinfo)->dc_huff_tbl_ptrs;
else
htblptr = ((j_compress_ptr) cinfo)->ac_huff_tbl_ptrs;
}
switch (tblno) {
case 0:
if (isDC) {
bits = bits_dc_luminance;
val = val_dc_luminance;
} else {
bits = bits_ac_luminance;
val = val_ac_luminance;
}
break;
case 1:
if (isDC) {
bits = bits_dc_chrominance;
val = val_dc_chrominance;
} else {
bits = bits_ac_chrominance;
val = val_ac_chrominance;
}
break;
default:
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
return NULL; /* avoid compiler warnings for uninitialized variables */
}
if (htblptr[tblno] == NULL)
htblptr[tblno] = jpeg_alloc_huff_table(cinfo);
htbl = htblptr[tblno];
/* Copy the number-of-symbols-of-each-code-length counts */
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
/* Validate the counts. We do this here mainly so we can copy the right
* number of symbols from the val[] array, without risking marching off
* the end of memory. jxhuff.c will do a more thorough test later.
*/
nsymbols = 0;
for (len = 1; len <= 16; len++)
nsymbols += bits[len];
if (nsymbols > 256)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
if (nsymbols > 0)
MEMCOPY(htbl->huffval, val, nsymbols * SIZEOF(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
htbl->sent_table = FALSE;
return htbl;
}

View File

@@ -1,4 +1,5 @@
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 9x or NT. */
/* This file also works for Borland C++ 32-bit (bcc32) on Windows 9x or NT. */
/* see jconfig.txt for explanations */ /* see jconfig.txt for explanations */
#define HAVE_PROTOTYPES #define HAVE_PROTOTYPES

111
jcparam.c
View File

@@ -2,7 +2,7 @@
* jcparam.c * jcparam.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding. * Modified 2003-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -162,112 +162,23 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
/* /*
* Huffman table setup routines * Reset standard Huffman tables
*/ */
LOCAL(void)
add_huff_table (j_compress_ptr cinfo,
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
{
int nsymbols, len;
if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
/* Copy the number-of-symbols-of-each-code-length counts */
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
/* Validate the counts. We do this here mainly so we can copy the right
* number of symbols from the val[] array, without risking marching off
* the end of memory. jchuff.c will do a more thorough test later.
*/
nsymbols = 0;
for (len = 1; len <= 16; len++)
nsymbols += bits[len];
if (nsymbols < 1 || nsymbols > 256)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
(*htblptr)->sent_table = FALSE;
}
LOCAL(void) LOCAL(void)
std_huff_tables (j_compress_ptr cinfo) std_huff_tables (j_compress_ptr cinfo)
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
{ {
static const UINT8 bits_dc_luminance[17] = if (cinfo->dc_huff_tbl_ptrs[0] != NULL)
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; (void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 0);
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] = if (cinfo->ac_huff_tbl_ptrs[0] != NULL)
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; (void) jpeg_std_huff_table((j_common_ptr) cinfo, FALSE, 0);
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] = if (cinfo->dc_huff_tbl_ptrs[1] != NULL)
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; (void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 1);
static const UINT8 val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
static const UINT8 bits_ac_chrominance[17] = if (cinfo->ac_huff_tbl_ptrs[1] != NULL)
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; (void) jpeg_std_huff_table((j_common_ptr) cinfo, FALSE, 1);
static const UINT8 val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
bits_dc_luminance, val_dc_luminance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
bits_ac_luminance, val_ac_luminance);
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
bits_dc_chrominance, val_dc_chrominance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
bits_ac_chrominance, val_ac_chrominance);
} }
@@ -306,7 +217,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
cinfo->data_precision = BITS_IN_JSAMPLE; cinfo->data_precision = BITS_IN_JSAMPLE;
/* Set up two quantization tables using default quality of 75 */ /* Set up two quantization tables using default quality of 75 */
jpeg_set_quality(cinfo, 75, TRUE); jpeg_set_quality(cinfo, 75, TRUE);
/* Set up two Huffman tables */ /* Reset standard Huffman tables */
std_huff_tables(cinfo); std_huff_tables(cinfo);
/* Initialize default arithmetic coding conditioning */ /* Initialize default arithmetic coding conditioning */

View File

@@ -2,7 +2,7 @@
* jctrans.c * jctrans.c
* *
* Copyright (C) 1995-1998, Thomas G. Lane. * Copyright (C) 1995-1998, Thomas G. Lane.
* Modified 2000-2013 by Guido Vollbeding. * Modified 2000-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -85,12 +85,15 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
jpeg_set_defaults(dstinfo); jpeg_set_defaults(dstinfo);
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
* Fix it to get the right header markers for the image colorspace. * Fix it to get the right header markers for the image colorspace.
* Note: Entropy table assignment in jpeg_set_colorspace depends * Note: Entropy table assignment in jpeg_set_colorspace
* on color_transform. * depends on color_transform.
* Adaption is also required for setting the appropriate
* entropy coding mode dependent on image data precision.
*/ */
dstinfo->color_transform = srcinfo->color_transform; dstinfo->color_transform = srcinfo->color_transform;
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
dstinfo->data_precision = srcinfo->data_precision; dstinfo->data_precision = srcinfo->data_precision;
dstinfo->arith_code = srcinfo->data_precision > 8 ? TRUE : FALSE;
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
/* Copy the source's quantization tables. */ /* Copy the source's quantization tables. */
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
@@ -157,6 +160,18 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
} }
LOCAL(void)
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
}
/* /*
* Master selection of compression modules for transcoding. * Master selection of compression modules for transcoding.
* This substitutes for jcinit.c's initialization of the full compressor. * This substitutes for jcinit.c's initialization of the full compressor.
@@ -166,6 +181,9 @@ LOCAL(void)
transencode_master_selection (j_compress_ptr cinfo, transencode_master_selection (j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays) jvirt_barray_ptr * coef_arrays)
{ {
/* Do computations that are needed before master selection phase */
jpeg_calc_trans_dimensions(cinfo);
/* Initialize master control (includes parameter checking/processing) */ /* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, TRUE /* transcode only */); jinit_c_master_control(cinfo, TRUE /* transcode only */);

View File

@@ -1,7 +1,7 @@
/* /*
* jdarith.c * jdarith.c
* *
* Developed 1997-2013 by Guido Vollbeding. * Developed 1997-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -94,7 +94,7 @@ get_byte (j_decompress_ptr cinfo)
* (instead of fixed) with the bit shift counter CT. * (instead of fixed) with the bit shift counter CT.
* Thus, we also need only one (variable instead of * Thus, we also need only one (variable instead of
* fixed size) shift for the LPS/MPS decision, and * fixed size) shift for the LPS/MPS decision, and
* we can get away with any renormalization update * we can do away with any renormalization update
* of C (except for new data insertion, of course). * of C (except for new data insertion, of course).
* *
* I've also introduced a new scheme for accessing * I've also introduced a new scheme for accessing
@@ -280,7 +280,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if ((m = arith_decode(cinfo, st)) != 0) { if ((m = arith_decode(cinfo, st)) != 0) {
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */ st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (arith_decode(cinfo, st)) { while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) { if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE); WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */ entropy->ct = -1; /* magnitude overflow */
return TRUE; return TRUE;
@@ -370,7 +370,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
st = entropy->ac_stats[tbl] + st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217); (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) { while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) { if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE); WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */ entropy->ct = -1; /* magnitude overflow */
return TRUE; return TRUE;
@@ -404,7 +404,8 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{ {
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st; unsigned char *st;
int p1, blkn; JCOEF p1;
int blkn;
/* Process restart marker if needed */ /* Process restart marker if needed */
if (cinfo->restart_interval) { if (cinfo->restart_interval) {
@@ -440,7 +441,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
JCOEFPTR thiscoef; JCOEFPTR thiscoef;
unsigned char *st; unsigned char *st;
int tbl, k, kex; int tbl, k, kex;
int p1, m1; JCOEF p1, m1;
const int * natural_order; const int * natural_order;
/* Process restart marker if needed */ /* Process restart marker if needed */
@@ -459,7 +460,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
tbl = cinfo->cur_comp_info[0]->ac_tbl_no; tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */ m1 = -p1; /* -1 in the bit position being coded */
/* Establish EOBx (previous stage end-of-block) index */ /* Establish EOBx (previous stage end-of-block) index */
kex = cinfo->Se; kex = cinfo->Se;
@@ -555,7 +556,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if ((m = arith_decode(cinfo, st)) != 0) { if ((m = arith_decode(cinfo, st)) != 0) {
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */ st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (arith_decode(cinfo, st)) { while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) { if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE); WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */ entropy->ct = -1; /* magnitude overflow */
return TRUE; return TRUE;
@@ -612,7 +613,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
st = entropy->ac_stats[tbl] + st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217); (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) { while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) { if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE); WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */ entropy->ct = -1; /* magnitude overflow */
return TRUE; return TRUE;
@@ -766,9 +767,8 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
arith_entropy_ptr entropy; arith_entropy_ptr entropy;
int i; int i;
entropy = (arith_entropy_ptr) entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_decoder));
SIZEOF(arith_entropy_decoder));
cinfo->entropy = &entropy->pub; cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass; entropy->pub.start_pass = start_pass;
entropy->pub.finish_pass = finish_pass; entropy->pub.finish_pass = finish_pass;
@@ -785,8 +785,8 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
if (cinfo->progressive_mode) { if (cinfo->progressive_mode) {
/* Create progression status table */ /* Create progression status table */
int *coef_bit_ptr, ci; int *coef_bit_ptr, ci;
cinfo->coef_bits = (int (*)[DCTSIZE2]) cinfo->coef_bits = (int (*)[DCTSIZE2]) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * DCTSIZE2 * SIZEOF(int)); cinfo->num_components * DCTSIZE2 * SIZEOF(int));
coef_bit_ptr = & cinfo->coef_bits[0][0]; coef_bit_ptr = & cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++) for (ci = 0; ci < cinfo->num_components; ci++)

View File

@@ -2,7 +2,7 @@
* jdatadst.c * jdatadst.c
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2012 by Guido Vollbeding. * Modified 2009-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -46,7 +46,7 @@ typedef struct {
struct jpeg_destination_mgr pub; /* public fields */ struct jpeg_destination_mgr pub; /* public fields */
unsigned char ** outbuffer; /* target buffer */ unsigned char ** outbuffer; /* target buffer */
unsigned long * outsize; size_t * outsize;
unsigned char * newbuffer; /* newly allocated buffer */ unsigned char * newbuffer; /* newly allocated buffer */
JOCTET * buffer; /* start of buffer */ JOCTET * buffer; /* start of buffer */
size_t bufsize; size_t bufsize;
@@ -66,9 +66,8 @@ init_destination (j_compress_ptr cinfo)
my_dest_ptr dest = (my_dest_ptr) cinfo->dest; my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
/* Allocate the output buffer --- it will be released when done with image */ /* Allocate the output buffer --- it will be released when done with image */
dest->buffer = (JOCTET *) dest->buffer = (JOCTET *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
dest->pub.next_output_byte = dest->buffer; dest->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
@@ -131,7 +130,7 @@ empty_mem_output_buffer (j_compress_ptr cinfo)
nextbuffer = (JOCTET *) malloc(nextsize); nextbuffer = (JOCTET *) malloc(nextsize);
if (nextbuffer == NULL) if (nextbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 11);
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize); MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
@@ -170,9 +169,9 @@ term_destination (j_compress_ptr cinfo)
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
ERREXIT(cinfo, JERR_FILE_WRITE); ERREXIT(cinfo, JERR_FILE_WRITE);
} }
fflush(dest->outfile); JFFLUSH(dest->outfile);
/* Make sure we wrote the output file OK */ /* Make sure we wrote the output file OK */
if (ferror(dest->outfile)) if (JFERROR(dest->outfile))
ERREXIT(cinfo, JERR_FILE_WRITE); ERREXIT(cinfo, JERR_FILE_WRITE);
} }
@@ -204,9 +203,8 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
* sizes may be different. Caveat programmer. * sizes may be different. Caveat programmer.
*/ */
if (cinfo->dest == NULL) { /* first time for this JPEG object? */ if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *) cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_destination_mgr));
SIZEOF(my_destination_mgr));
} }
dest = (my_dest_ptr) cinfo->dest; dest = (my_dest_ptr) cinfo->dest;
@@ -233,7 +231,7 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
GLOBAL(void) GLOBAL(void)
jpeg_mem_dest (j_compress_ptr cinfo, jpeg_mem_dest (j_compress_ptr cinfo,
unsigned char ** outbuffer, unsigned long * outsize) unsigned char ** outbuffer, size_t * outsize)
{ {
my_mem_dest_ptr dest; my_mem_dest_ptr dest;
@@ -244,9 +242,8 @@ jpeg_mem_dest (j_compress_ptr cinfo,
* can be written to the same buffer without re-executing jpeg_mem_dest. * can be written to the same buffer without re-executing jpeg_mem_dest.
*/ */
if (cinfo->dest == NULL) { /* first time for this JPEG object? */ if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *) cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_mem_destination_mgr));
SIZEOF(my_mem_destination_mgr));
} }
dest = (my_mem_dest_ptr) cinfo->dest; dest = (my_mem_dest_ptr) cinfo->dest;

View File

@@ -2,7 +2,7 @@
* jdatasrc.c * jdatasrc.c
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2011 by Guido Vollbeding. * Modified 2009-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -156,21 +156,23 @@ METHODDEF(void)
skip_input_data (j_decompress_ptr cinfo, long num_bytes) skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{ {
struct jpeg_source_mgr * src = cinfo->src; struct jpeg_source_mgr * src = cinfo->src;
size_t nbytes;
/* Just a dumb implementation for now. Could use fseek() except /* Just a dumb implementation for now. Could use fseek() except
* it doesn't work on pipes. Not clear that being smart is worth * it doesn't work on pipes. Not clear that being smart is worth
* any trouble anyway --- large skips are infrequent. * any trouble anyway --- large skips are infrequent.
*/ */
if (num_bytes > 0) { if (num_bytes > 0) {
while (num_bytes > (long) src->bytes_in_buffer) { nbytes = (size_t) num_bytes;
num_bytes -= (long) src->bytes_in_buffer; while (nbytes > src->bytes_in_buffer) {
nbytes -= src->bytes_in_buffer;
(void) (*src->fill_input_buffer) (cinfo); (void) (*src->fill_input_buffer) (cinfo);
/* note we assume that fill_input_buffer will never return FALSE, /* note we assume that fill_input_buffer will never return FALSE,
* so suspension need not be handled. * so suspension need not be handled.
*/ */
} }
src->next_input_byte += (size_t) num_bytes; src->next_input_byte += nbytes;
src->bytes_in_buffer -= (size_t) num_bytes; src->bytes_in_buffer -= nbytes;
} }
} }
@@ -219,13 +221,11 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
* manager serially with the same JPEG object. Caveat programmer. * manager serially with the same JPEG object. Caveat programmer.
*/ */
if (cinfo->src == NULL) { /* first time for this JPEG object? */ if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *) cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_source_mgr));
SIZEOF(my_source_mgr));
src = (my_src_ptr) cinfo->src; src = (my_src_ptr) cinfo->src;
src->buffer = (JOCTET *) src->buffer = (JOCTET *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
INPUT_BUF_SIZE * SIZEOF(JOCTET));
} }
src = (my_src_ptr) cinfo->src; src = (my_src_ptr) cinfo->src;
@@ -247,7 +247,7 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
GLOBAL(void) GLOBAL(void)
jpeg_mem_src (j_decompress_ptr cinfo, jpeg_mem_src (j_decompress_ptr cinfo,
unsigned char * inbuffer, unsigned long insize) const unsigned char * inbuffer, size_t insize)
{ {
struct jpeg_source_mgr * src; struct jpeg_source_mgr * src;
@@ -259,9 +259,8 @@ jpeg_mem_src (j_decompress_ptr cinfo,
* the first one. * the first one.
*/ */
if (cinfo->src == NULL) { /* first time for this JPEG object? */ if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *) cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(struct jpeg_source_mgr));
SIZEOF(struct jpeg_source_mgr));
} }
src = cinfo->src; src = cinfo->src;
@@ -270,6 +269,6 @@ jpeg_mem_src (j_decompress_ptr cinfo,
src->skip_input_data = skip_input_data; src->skip_input_data = skip_input_data;
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
src->term_source = term_source; src->term_source = term_source;
src->bytes_in_buffer = (size_t) insize; src->bytes_in_buffer = insize;
src->next_input_byte = (JOCTET *) inbuffer; src->next_input_byte = (const JOCTET *) inbuffer;
} }

141
jdcolor.c
View File

@@ -2,7 +2,7 @@
* jdcolor.c * jdcolor.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011-2013 by Guido Vollbeding. * Modified 2011-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -14,6 +14,12 @@
#include "jpeglib.h" #include "jpeglib.h"
#if RANGE_BITS < 2
/* Deliberate syntax err */
Sorry, this code requires 2 or more range extension bits.
#endif
/* Private subobject */ /* Private subobject */
typedef struct { typedef struct {
@@ -25,9 +31,6 @@ typedef struct {
INT32 * Cr_g_tab; /* => table for Cr to G conversion */ INT32 * Cr_g_tab; /* => table for Cr to G conversion */
INT32 * Cb_g_tab; /* => table for Cb to G conversion */ INT32 * Cb_g_tab; /* => table for Cb to G conversion */
JSAMPLE * range_limit; /* pointer to normal sample range limit table, */
/* or extended sample range limit table for BG_YCC */
/* Private state for RGB->Y conversion */ /* Private state for RGB->Y conversion */
INT32 * rgb_y_tab; /* => table for RGB to Y conversion */ INT32 * rgb_y_tab; /* => table for RGB to Y conversion */
} my_color_deconverter; } my_color_deconverter;
@@ -121,30 +124,22 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
INT32 x; INT32 x;
SHIFT_TEMPS SHIFT_TEMPS
cconvert->Cr_r_tab = (int *) cconvert->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
(MAXJSAMPLE+1) * SIZEOF(int)); cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
cconvert->Cb_b_tab = (int *) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, cconvert->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
(MAXJSAMPLE+1) * SIZEOF(int)); ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cr_g_tab = (INT32 *) cconvert->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->range_limit = cinfo->sample_range_limit;
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 1.402 * x */ /* Cr=>R value is nearest int to 1.402 * x */
cconvert->Cr_r_tab[i] = (int) cconvert->Cr_r_tab[i] = (int) DESCALE(FIX(1.402) * x, SCALEBITS);
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
/* Cb=>B value is nearest int to 1.772 * x */ /* Cb=>B value is nearest int to 1.772 * x */
cconvert->Cb_b_tab[i] = (int) cconvert->Cb_b_tab[i] = (int) DESCALE(FIX(1.772) * x, SCALEBITS);
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
/* Cr=>G value is scaled-up -0.714136286 * x */ /* Cr=>G value is scaled-up -0.714136286 * x */
cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x; cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
/* Cb=>G value is scaled-up -0.344136286 * x */ /* Cb=>G value is scaled-up -0.344136286 * x */
@@ -163,52 +158,28 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
INT32 x; INT32 x;
SHIFT_TEMPS SHIFT_TEMPS
cconvert->Cr_r_tab = (int *) cconvert->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
(MAXJSAMPLE+1) * SIZEOF(int)); cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
cconvert->Cb_b_tab = (int *) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, cconvert->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
(MAXJSAMPLE+1) * SIZEOF(int)); ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cr_g_tab = (INT32 *) cconvert->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->range_limit = (JSAMPLE *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 2.804 * x */ /* Cr=>R value is nearest int to 2.804 * x */
cconvert->Cr_r_tab[i] = (int) cconvert->Cr_r_tab[i] = (int) DESCALE(FIX(2.804) * x, SCALEBITS);
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
/* Cb=>B value is nearest int to 3.544 * x */ /* Cb=>B value is nearest int to 3.544 * x */
cconvert->Cb_b_tab[i] = (int) cconvert->Cb_b_tab[i] = (int) DESCALE(FIX(3.544) * x, SCALEBITS);
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
/* Cr=>G value is scaled-up -1.428272572 * x */ /* Cr=>G value is scaled-up -1.428272572 * x */
cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x; cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
/* Cb=>G value is scaled-up -0.688272572 * x */ /* Cb=>G value is scaled-up -0.688272572 * x */
/* We also add in ONE_HALF so that need not do it in inner loop */ /* We also add in ONE_HALF so that need not do it in inner loop */
cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF; cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;
} }
/* Cb and Cr portions can extend to double range in wide gamut case,
* so we prepare an appropriate extended range limit table.
*/
/* First segment of range limit table: limit[x] = 0 for x < 0 */
MEMZERO(cconvert->range_limit, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
cconvert->range_limit += 2 * (MAXJSAMPLE+1);
/* Main part of range limit table: limit[x] = x */
for (i = 0; i <= MAXJSAMPLE; i++)
cconvert->range_limit[i] = (JSAMPLE) i;
/* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
for (; i < 3 * (MAXJSAMPLE+1); i++)
cconvert->range_limit[i] = MAXJSAMPLE;
} }
@@ -218,6 +189,7 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
* Note that we change from noninterleaved, one-plane-per-component format * Note that we change from noninterleaved, one-plane-per-component format
* to interleaved-pixel format. The output buffer is therefore three times * to interleaved-pixel format. The output buffer is therefore three times
* as wide as the input buffer. * as wide as the input buffer.
*
* A starting row offset is provided only for the input buffer. The caller * A starting row offset is provided only for the input buffer. The caller
* can easily adjust the passed output_buf value to accommodate any row * can easily adjust the passed output_buf value to accommodate any row
* offset required on that side. * offset required on that side.
@@ -235,7 +207,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
register JDIMENSION col; register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width; JDIMENSION num_cols = cinfo->output_width;
/* copy these pointers into registers if possible */ /* copy these pointers into registers if possible */
register JSAMPLE * range_limit = cconvert->range_limit; register JSAMPLE * range_limit = cinfo->sample_range_limit;
register int * Crrtab = cconvert->Cr_r_tab; register int * Crrtab = cconvert->Cr_r_tab;
register int * Cbbtab = cconvert->Cb_b_tab; register int * Cbbtab = cconvert->Cb_b_tab;
register INT32 * Crgtab = cconvert->Cr_g_tab; register INT32 * Crgtab = cconvert->Cr_g_tab;
@@ -281,9 +253,8 @@ build_rgb_y_table (j_decompress_ptr cinfo)
INT32 i; INT32 i;
/* Allocate and fill in the conversion tables. */ /* Allocate and fill in the conversion tables. */
cconvert->rgb_y_tab = rgb_y_tab = (INT32 *) cconvert->rgb_y_tab = rgb_y_tab = (INT32 *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, TABLE_SIZE * SIZEOF(INT32));
(TABLE_SIZE * SIZEOF(INT32)));
for (i = 0; i <= MAXJSAMPLE; i++) { for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i; rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i;
@@ -303,8 +274,8 @@ rgb_gray_convert (j_decompress_ptr cinfo,
JSAMPARRAY output_buf, int num_rows) JSAMPARRAY output_buf, int num_rows)
{ {
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_y_tab;
register int r, g, b; register int r, g, b;
register INT32 * ctab = cconvert->rgb_y_tab;
register JSAMPROW outptr; register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2; register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col; register JDIMENSION col;
@@ -330,6 +301,7 @@ rgb_gray_convert (j_decompress_ptr cinfo,
/* /*
* Convert some rows of samples to the output colorspace.
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation * [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
* (inverse color transform). * (inverse color transform).
* This can be seen as an adaption of the general YCbCr->RGB * This can be seen as an adaption of the general YCbCr->RGB
@@ -381,8 +353,8 @@ rgb1_gray_convert (j_decompress_ptr cinfo,
JSAMPARRAY output_buf, int num_rows) JSAMPARRAY output_buf, int num_rows)
{ {
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_y_tab;
register int r, g, b; register int r, g, b;
register INT32 * ctab = cconvert->rgb_y_tab;
register JSAMPROW outptr; register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2; register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col; register JDIMENSION col;
@@ -413,6 +385,7 @@ rgb1_gray_convert (j_decompress_ptr cinfo,
/* /*
* Convert some rows of samples to the output colorspace.
* No colorspace change, but conversion from separate-planes * No colorspace change, but conversion from separate-planes
* to interleaved representation. * to interleaved representation.
*/ */
@@ -447,6 +420,7 @@ rgb_convert (j_decompress_ptr cinfo,
/* /*
* Color conversion for no colorspace change: just copy the data, * Color conversion for no colorspace change: just copy the data,
* converting from separate-planes to interleaved representation. * converting from separate-planes to interleaved representation.
* We assume out_color_components == num_components.
*/ */
METHODDEF(void) METHODDEF(void)
@@ -454,20 +428,21 @@ null_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows) JSAMPARRAY output_buf, int num_rows)
{ {
int ci;
register int nc = cinfo->num_components;
register JSAMPROW outptr; register JSAMPROW outptr;
register JSAMPROW inptr; register JSAMPROW inptr;
register JDIMENSION col; register JDIMENSION count;
register int num_comps = cinfo->num_components;
JDIMENSION num_cols = cinfo->output_width; JDIMENSION num_cols = cinfo->output_width;
int ci;
while (--num_rows >= 0) { while (--num_rows >= 0) {
for (ci = 0; ci < nc; ci++) { /* It seems fastest to make a separate pass for each component. */
for (ci = 0; ci < num_comps; ci++) {
inptr = input_buf[ci][input_row]; inptr = input_buf[ci][input_row];
outptr = output_buf[0] + ci; outptr = output_buf[0] + ci;
for (col = 0; col < num_cols; col++) { for (count = num_cols; count > 0; count--) {
*outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ *outptr = *inptr++; /* don't need GETJSAMPLE() here */
outptr += nc; outptr += num_comps;
} }
} }
input_row++; input_row++;
@@ -521,9 +496,10 @@ gray_rgb_convert (j_decompress_ptr cinfo,
/* /*
* Adobe-style YCCK->CMYK conversion. * Convert some rows of samples to the output colorspace.
* We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same * This version handles Adobe-style YCCK->CMYK conversion,
* conversion as above, while passing K (black) unchanged. * where we convert YCbCr to R=1-C, G=1-M, and B=1-Y using the
* same conversion as above, while passing K (black) unchanged.
* We assume build_ycc_rgb_table has been called. * We assume build_ycc_rgb_table has been called.
*/ */
@@ -594,9 +570,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
my_cconvert_ptr cconvert; my_cconvert_ptr cconvert;
int ci; int ci;
cconvert = (my_cconvert_ptr) cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_deconverter));
SIZEOF(my_color_deconverter));
cinfo->cconvert = &cconvert->pub; cinfo->cconvert = &cconvert->pub;
cconvert->pub.start_pass = start_pass_dcolor; cconvert->pub.start_pass = start_pass_dcolor;
@@ -624,7 +599,6 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
default: /* JCS_UNKNOWN can be anything */ default: /* JCS_UNKNOWN can be anything */
if (cinfo->num_components < 1) if (cinfo->num_components < 1)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
break;
} }
/* Support color transform only for RGB colorspaces */ /* Support color transform only for RGB colorspaces */
@@ -701,7 +675,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
case JCS_BG_RGB: case JCS_BG_RGB:
cinfo->out_color_components = RGB_PIXELSIZE; cinfo->out_color_components = RGB_PIXELSIZE;
if (cinfo->jpeg_color_space == JCS_BG_RGB) { if (cinfo->jpeg_color_space != JCS_BG_RGB)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
switch (cinfo->color_transform) { switch (cinfo->color_transform) {
case JCT_NONE: case JCT_NONE:
cconvert->pub.color_convert = rgb_convert; cconvert->pub.color_convert = rgb_convert;
@@ -712,8 +687,6 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
default: default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
} }
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break; break;
case JCS_CMYK: case JCS_CMYK:
@@ -731,14 +704,12 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
} }
break; break;
default: default: /* permit null conversion to same output space */
/* Permit null conversion to same output space */ if (cinfo->out_color_space != cinfo->jpeg_color_space)
if (cinfo->out_color_space == cinfo->jpeg_color_space) { /* unsupported non-null conversion */
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
cinfo->out_color_components = cinfo->num_components; cinfo->out_color_components = cinfo->num_components;
cconvert->pub.color_convert = null_convert; cconvert->pub.color_convert = null_convert;
} else /* unsupported non-null conversion */
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
} }
if (cinfo->quantize_colors) if (cinfo->quantize_colors)

36
jdct.h
View File

@@ -2,6 +2,7 @@
* jdct.h * jdct.h
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -78,13 +79,15 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
* be quite far out of range if the input data is corrupt, so a bulletproof * be quite far out of range if the input data is corrupt, so a bulletproof
* range-limiting step is required. We use a mask-and-table-lookup method * range-limiting step is required. We use a mask-and-table-lookup method
* to do the combined operations quickly. See the comments with * to do the combined operations quickly, assuming that RANGE_CENTER
* (defined in jpegint.h) is a power of 2. See the comments with
* prepare_range_limit_table (in jdmaster.c) for more info. * prepare_range_limit_table (in jdmaster.c) for more info.
*/ */
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) #define RANGE_MASK (RANGE_CENTER * 2 - 1)
#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ #define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
/* Short forms of external names for systems with brain-damaged linkers. */ /* Short forms of external names for systems with brain-damaged linkers. */
@@ -355,13 +358,6 @@ EXTERN(void) jpeg_idct_1x2
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) #define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
/* Descale and correctly round an INT32 value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. /* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
* This macro is used only when the two inputs will actually be no more than * This macro is used only when the two inputs will actually be no more than
* 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
@@ -391,3 +387,23 @@ EXTERN(void) jpeg_idct_1x2
#ifndef MULTIPLY16V16 /* default definition */ #ifndef MULTIPLY16V16 /* default definition */
#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) #define MULTIPLY16V16(var1,var2) ((var1) * (var2))
#endif #endif
/* Like RIGHT_SHIFT, but applies to a DCTELEM.
* We assume that int right shift is unsigned if INT32 right shift is.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define ISHIFT_TEMPS DCTELEM ishift_temp;
#if BITS_IN_JSAMPLE == 8
#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
#else
#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
#endif
#define IRIGHT_SHIFT(x,shft) \
((ishift_temp = (x)) < 0 ? \
(ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
(ishift_temp >> (shft)))
#else
#define ISHIFT_TEMPS
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif

View File

@@ -2,7 +2,7 @@
* jdhuff.c * jdhuff.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2006-2013 by Guido Vollbeding. * Modified 2006-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -341,13 +341,12 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
htbl = htbl =
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
if (htbl == NULL) if (htbl == NULL)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); htbl = jpeg_std_huff_table((j_common_ptr) cinfo, isDC, tblno);
/* Allocate a workspace if we haven't already done so. */ /* Allocate a workspace if we haven't already done so. */
if (*pdtbl == NULL) if (*pdtbl == NULL)
*pdtbl = (d_derived_tbl *) *pdtbl = (d_derived_tbl *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(d_derived_tbl));
SIZEOF(d_derived_tbl));
dtbl = *pdtbl; dtbl = *pdtbl;
dtbl->pub = htbl; /* fill in back link */ dtbl->pub = htbl; /* fill in back link */
@@ -763,7 +762,8 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
ASSIGN_STATE(entropy->saved, state); ASSIGN_STATE(entropy->saved, state);
} }
/* Account for restart interval (no-op if not using restarts) */ /* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--; entropy->restarts_to_go--;
return TRUE; return TRUE;
@@ -799,10 +799,6 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/ */
if (! entropy->insufficient_data) { if (! entropy->insufficient_data) {
Se = cinfo->Se;
Al = cinfo->Al;
natural_order = cinfo->natural_order;
/* Load up working state. /* Load up working state.
* We can avoid loading/saving bitread state if in an EOB run. * We can avoid loading/saving bitread state if in an EOB run.
*/ */
@@ -814,6 +810,9 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
EOBRUN--; /* ...process it now (we do nothing) */ EOBRUN--; /* ...process it now (we do nothing) */
else { else {
BITREAD_LOAD_STATE(cinfo, entropy->bitstate); BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
Se = cinfo->Se;
Al = cinfo->Al;
natural_order = cinfo->natural_order;
block = MCU_data[0]; block = MCU_data[0];
tbl = entropy->ac_derived_tbl; tbl = entropy->ac_derived_tbl;
@@ -850,7 +849,8 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
} }
/* Account for restart interval (no-op if not using restarts) */ /* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--; entropy->restarts_to_go--;
return TRUE; return TRUE;
@@ -867,7 +867,8 @@ METHODDEF(boolean)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{ {
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int p1, blkn; JCOEF p1;
int blkn;
BITREAD_STATE_VARS; BITREAD_STATE_VARS;
/* Process restart marker if needed; may have to suspend */ /* Process restart marker if needed; may have to suspend */
@@ -899,7 +900,8 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* Completed MCU, so update state */ /* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo, entropy->bitstate); BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
/* Account for restart interval (no-op if not using restarts) */ /* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--; entropy->restarts_to_go--;
return TRUE; return TRUE;
@@ -916,7 +918,8 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r; register int s, k, r;
unsigned int EOBRUN; unsigned int EOBRUN;
int Se, p1, m1; int Se;
JCOEF p1, m1;
const int * natural_order; const int * natural_order;
JBLOCKROW block; JBLOCKROW block;
JCOEFPTR thiscoef; JCOEFPTR thiscoef;
@@ -938,7 +941,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Se = cinfo->Se; Se = cinfo->Se;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */ m1 = -p1; /* -1 in the bit position being coded */
natural_order = cinfo->natural_order; natural_order = cinfo->natural_order;
/* Load up working state */ /* Load up working state */
@@ -1048,7 +1051,8 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
} }
/* Account for restart interval (no-op if not using restarts) */ /* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--; entropy->restarts_to_go--;
return TRUE; return TRUE;
@@ -1183,7 +1187,8 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
ASSIGN_STATE(entropy->saved, state); ASSIGN_STATE(entropy->saved, state);
} }
/* Account for restart interval (no-op if not using restarts) */ /* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--; entropy->restarts_to_go--;
return TRUE; return TRUE;
@@ -1307,7 +1312,8 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
ASSIGN_STATE(entropy->saved, state); ASSIGN_STATE(entropy->saved, state);
} }
/* Account for restart interval (no-op if not using restarts) */ /* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--; entropy->restarts_to_go--;
return TRUE; return TRUE;
@@ -1344,11 +1350,11 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
goto bad; goto bad;
} }
if (cinfo->Al > 13) { /* need not check for < 0 */ if (cinfo->Al > 13) { /* need not check for < 0 */
/* Arguably the maximum Al value should be less than 13 for 8-bit precision, /* Arguably the maximum Al value should be less than 13 for 8-bit
* but the spec doesn't say so, and we try to be liberal about what we * precision, but the spec doesn't say so, and we try to be liberal
* accept. Note: large Al values could result in out-of-range DC * about what we accept. Note: large Al values could result in
* coefficients during early scans, leading to bizarre displays due to * out-of-range DC coefficients during early scans, leading to bizarre
* overflows in the IDCT math. But we won't crash. * displays due to overflows in the IDCT math. But we won't crash.
*/ */
bad: bad:
ERREXIT4(cinfo, JERR_BAD_PROGRESSION, ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
@@ -1452,7 +1458,8 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
compptr = cinfo->cur_comp_info[ci]; compptr = cinfo->cur_comp_info[ci];
/* Precalculate which table to use for each block */ /* Precalculate which table to use for each block */
entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no]; entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; entropy->ac_cur_tbls[blkn] = /* AC needs no table when not present */
cinfo->lim_Se ? entropy->ac_derived_tbls[compptr->ac_tbl_no] : NULL;
/* Decide whether we really care about the coefficient values */ /* Decide whether we really care about the coefficient values */
if (compptr->component_needed) { if (compptr->component_needed) {
ci = compptr->DCT_v_scaled_size; ci = compptr->DCT_v_scaled_size;
@@ -1495,7 +1502,6 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
if (ci <= 0 || ci > 8) ci = 8; if (ci <= 0 || ci > 8) ci = 8;
if (i <= 0 || i > 8) i = 8; if (i <= 0 || i > 8) i = 8;
entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1]; entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1];
break;
} }
} else { } else {
entropy->coef_limit[blkn] = 0; entropy->coef_limit[blkn] = 0;
@@ -1523,9 +1529,8 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
huff_entropy_ptr entropy; huff_entropy_ptr entropy;
int i; int i;
entropy = (huff_entropy_ptr) entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_decoder));
SIZEOF(huff_entropy_decoder));
cinfo->entropy = &entropy->pub; cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass_huff_decoder; entropy->pub.start_pass = start_pass_huff_decoder;
entropy->pub.finish_pass = finish_pass_huff; entropy->pub.finish_pass = finish_pass_huff;
@@ -1533,8 +1538,8 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
if (cinfo->progressive_mode) { if (cinfo->progressive_mode) {
/* Create progression status table */ /* Create progression status table */
int *coef_bit_ptr, ci; int *coef_bit_ptr, ci;
cinfo->coef_bits = (int (*)[DCTSIZE2]) cinfo->coef_bits = (int (*)[DCTSIZE2]) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * DCTSIZE2 * SIZEOF(int)); cinfo->num_components * DCTSIZE2 * SIZEOF(int));
coef_bit_ptr = & cinfo->coef_bits[0][0]; coef_bit_ptr = & cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++) for (ci = 0; ci < cinfo->num_components; ci++)
@@ -1546,7 +1551,7 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
entropy->derived_tbls[i] = NULL; entropy->derived_tbls[i] = NULL;
} }
} else { } else {
/* Mark tables unallocated */ /* Mark derived tables unallocated */
for (i = 0; i < NUM_HUFF_TBLS; i++) { for (i = 0; i < NUM_HUFF_TBLS; i++) {
entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
} }

View File

@@ -2,7 +2,7 @@
* jdmainct.c * jdmainct.c
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2012 by Guido Vollbeding. * Modified 2002-2016 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -26,8 +26,8 @@
* trivial. Its responsibility is to provide context rows for upsampling/ * trivial. Its responsibility is to provide context rows for upsampling/
* rescaling, and doing this in an efficient fashion is a bit tricky. * rescaling, and doing this in an efficient fashion is a bit tricky.
* *
* Postprocessor input data is counted in "row groups". A row group * Postprocessor input data is counted in "row groups". A row group is
* is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) * defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)
* sample rows of each component. (We require DCT_scaled_size values to be * sample rows of each component. (We require DCT_scaled_size values to be
* chosen such that these numbers are integers. In practice DCT_scaled_size * chosen such that these numbers are integers. In practice DCT_scaled_size
* values will likely be powers of two, so we actually have the stronger * values will likely be powers of two, so we actually have the stronger
@@ -37,8 +37,8 @@
* applying). * applying).
* *
* The coefficient controller will deliver data to us one iMCU row at a time; * The coefficient controller will deliver data to us one iMCU row at a time;
* each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or * each iMCU row contains v_samp_factor * DCT_v_scaled_size sample rows, or
* exactly min_DCT_scaled_size row groups. (This amount of data corresponds * exactly min_DCT_v_scaled_size row groups. (This amount of data corresponds
* to one row of MCUs when the image is fully interleaved.) Note that the * to one row of MCUs when the image is fully interleaved.) Note that the
* number of sample rows varies across components, but the number of row * number of sample rows varies across components, but the number of row
* groups does not. Some garbage sample rows may be included in the last iMCU * groups does not. Some garbage sample rows may be included in the last iMCU
@@ -75,7 +75,7 @@
* We could do this most simply by copying data around in our buffer, but * We could do this most simply by copying data around in our buffer, but
* that'd be very slow. We can avoid copying any data by creating a rather * that'd be very slow. We can avoid copying any data by creating a rather
* strange pointer structure. Here's how it works. We allocate a workspace * strange pointer structure. Here's how it works. We allocate a workspace
* consisting of M+2 row groups (where M = min_DCT_scaled_size is the number * consisting of M+2 row groups (where M = min_DCT_v_scaled_size is the number
* of row groups per iMCU row). We create two sets of redundant pointers to * of row groups per iMCU row). We create two sets of redundant pointers to
* the workspace. Labeling the physical row groups 0 to M+1, the synthesized * the workspace. Labeling the physical row groups 0 to M+1, the synthesized
* pointer lists look like this: * pointer lists look like this:
@@ -100,11 +100,11 @@
* the first or last sample row as necessary (this is cheaper than copying * the first or last sample row as necessary (this is cheaper than copying
* sample rows around). * sample rows around).
* *
* This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that * This scheme breaks down if M < 2, ie, min_DCT_v_scaled_size is 1. In that
* situation each iMCU row provides only one row group so the buffering logic * situation each iMCU row provides only one row group so the buffering logic
* must be different (eg, we must read two iMCU rows before we can emit the * must be different (eg, we must read two iMCU rows before we can emit the
* first row group). For now, we simply do not support providing context * first row group). For now, we simply do not support providing context
* rows when min_DCT_scaled_size is 1. That combination seems unlikely to * rows when min_DCT_v_scaled_size is 1. That combination seems unlikely to
* be worth providing --- if someone wants a 1/8th-size preview, they probably * be worth providing --- if someone wants a 1/8th-size preview, they probably
* want it quick and dirty, so a context-free upsampler is sufficient. * want it quick and dirty, so a context-free upsampler is sufficient.
*/ */
@@ -118,17 +118,18 @@ typedef struct {
/* Pointer to allocated workspace (M or M+2 row groups). */ /* Pointer to allocated workspace (M or M+2 row groups). */
JSAMPARRAY buffer[MAX_COMPONENTS]; JSAMPARRAY buffer[MAX_COMPONENTS];
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
/* Remaining fields are only used in the context case. */ /* Remaining fields are only used in the context case. */
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
/* These are the master pointers to the funny-order pointer lists. */ /* These are the master pointers to the funny-order pointer lists. */
JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
int whichptr; /* indicates which pointer set is now in use */ int whichptr; /* indicates which pointer set is now in use */
int context_state; /* process_data state machine status */ int context_state; /* process_data state machine status */
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
} my_main_controller; } my_main_controller;
@@ -195,7 +196,7 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
LOCAL(void) LOCAL(void)
make_funny_pointers (j_decompress_ptr cinfo) make_funny_pointers (j_decompress_ptr cinfo)
/* Create the funny pointer lists discussed in the comments above. /* Create the funny pointer lists discussed in the comments above.
* The actual workspace is already allocated (in main->buffer), * The actual workspace is already allocated (in mainp->buffer),
* and the space for the pointer lists is allocated too. * and the space for the pointer lists is allocated too.
* This routine just fills in the curiously ordered lists. * This routine just fills in the curiously ordered lists.
* This will be repeated at the beginning of each pass. * This will be repeated at the beginning of each pass.
@@ -317,12 +318,12 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
mainp->context_state = CTX_PREPARE_FOR_IMCU; mainp->context_state = CTX_PREPARE_FOR_IMCU;
mainp->iMCU_row_ctr = 0; mainp->iMCU_row_ctr = 0;
mainp->buffer_full = FALSE; /* Mark buffer empty */
} else { } else {
/* Simple case with no context needed */ /* Simple case with no context needed */
mainp->pub.process_data = process_data_simple_main; mainp->pub.process_data = process_data_simple_main;
mainp->rowgroup_ctr = mainp->rowgroups_avail; /* Mark buffer empty */
} }
mainp->buffer_full = FALSE; /* Mark buffer empty */
mainp->rowgroup_ctr = 0;
break; break;
#ifdef QUANT_2PASS_SUPPORTED #ifdef QUANT_2PASS_SUPPORTED
case JBUF_CRANK_DEST: case JBUF_CRANK_DEST:
@@ -348,17 +349,14 @@ process_data_simple_main (j_decompress_ptr cinfo,
JDIMENSION out_rows_avail) JDIMENSION out_rows_avail)
{ {
my_main_ptr mainp = (my_main_ptr) cinfo->main; my_main_ptr mainp = (my_main_ptr) cinfo->main;
JDIMENSION rowgroups_avail;
/* Read input data if we haven't filled the main buffer yet */ /* Read input data if we haven't filled the main buffer yet */
if (! mainp->buffer_full) { if (mainp->rowgroup_ctr >= mainp->rowgroups_avail) {
if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer)) if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
return; /* suspension forced, can do nothing more */ return; /* suspension forced, can do nothing more */
mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ mainp->rowgroup_ctr = 0; /* OK, we have an iMCU row to work with */
} }
/* There are always min_DCT_scaled_size row groups in an iMCU row. */
rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
/* Note: at the bottom of the image, we may pass extra garbage row groups /* Note: at the bottom of the image, we may pass extra garbage row groups
* to the postprocessor. The postprocessor has to check for bottom * to the postprocessor. The postprocessor has to check for bottom
* of image anyway (at row resolution), so no point in us doing it too. * of image anyway (at row resolution), so no point in us doing it too.
@@ -366,14 +364,8 @@ process_data_simple_main (j_decompress_ptr cinfo,
/* Feed the postprocessor */ /* Feed the postprocessor */
(*cinfo->post->post_process_data) (cinfo, mainp->buffer, (*cinfo->post->post_process_data) (cinfo, mainp->buffer,
&mainp->rowgroup_ctr, rowgroups_avail, &mainp->rowgroup_ctr, mainp->rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail); output_buf, out_row_ctr, out_rows_avail);
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
if (mainp->rowgroup_ctr >= rowgroups_avail) {
mainp->buffer_full = FALSE;
mainp->rowgroup_ctr = 0;
}
} }
@@ -498,7 +490,9 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
ngroups = cinfo->min_DCT_v_scaled_size + 2; ngroups = cinfo->min_DCT_v_scaled_size + 2;
} else { } else {
/* There are always min_DCT_v_scaled_size row groups in an iMCU row. */
ngroups = cinfo->min_DCT_v_scaled_size; ngroups = cinfo->min_DCT_v_scaled_size;
mainp->rowgroups_avail = (JDIMENSION) ngroups;
} }
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;

View File

@@ -2,7 +2,7 @@
* jdmarker.c * jdmarker.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2009-2013 by Guido Vollbeding. * Modified 2009-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -496,8 +496,6 @@ get_dht (j_decompress_ptr cinfo)
if (count > 256 || ((INT32) count) > length) if (count > 256 || ((INT32) count) > length)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
INPUT_BYTE(cinfo, huffval[i], return FALSE); INPUT_BYTE(cinfo, huffval[i], return FALSE);
@@ -517,7 +515,8 @@ get_dht (j_decompress_ptr cinfo)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); if (count > 0)
MEMCOPY((*htblptr)->huffval, huffval, count * SIZEOF(UINT8));
} }
if (length != 0) if (length != 0)
@@ -577,14 +576,14 @@ get_dqt (j_decompress_ptr cinfo)
count = DCTSIZE2; count = DCTSIZE2;
} }
switch (count) { switch ((int) count) {
case (2*2): natural_order = jpeg_natural_order2; break; case (2*2): natural_order = jpeg_natural_order2; break;
case (3*3): natural_order = jpeg_natural_order3; break; case (3*3): natural_order = jpeg_natural_order3; break;
case (4*4): natural_order = jpeg_natural_order4; break; case (4*4): natural_order = jpeg_natural_order4; break;
case (5*5): natural_order = jpeg_natural_order5; break; case (5*5): natural_order = jpeg_natural_order5; break;
case (6*6): natural_order = jpeg_natural_order6; break; case (6*6): natural_order = jpeg_natural_order6; break;
case (7*7): natural_order = jpeg_natural_order7; break; case (7*7): natural_order = jpeg_natural_order7; break;
default: natural_order = jpeg_natural_order; break; default: natural_order = jpeg_natural_order;
} }
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
@@ -784,7 +783,6 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
default: default:
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
GETJOCTET(data[5]), (int) totallen); GETJOCTET(data[5]), (int) totallen);
break;
} }
} else { } else {
/* Start of APP0 does not match "JFIF" or "JFXX", or too short */ /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
@@ -858,7 +856,6 @@ get_interesting_appn (j_decompress_ptr cinfo)
default: default:
/* can't get here unless jpeg_save_markers chooses wrong processor */ /* can't get here unless jpeg_save_markers chooses wrong processor */
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
break;
} }
/* skip any remaining data -- could be lots */ /* skip any remaining data -- could be lots */
@@ -964,7 +961,6 @@ save_marker (j_decompress_ptr cinfo)
default: default:
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
(int) (data_length + length)); (int) (data_length + length));
break;
} }
/* skip any remaining data -- could be lots */ /* skip any remaining data -- could be lots */
@@ -1240,7 +1236,6 @@ read_markers (j_decompress_ptr cinfo)
* ought to change! * ought to change!
*/ */
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
break;
} }
/* Successfully processed marker, so reset state variable */ /* Successfully processed marker, so reset state variable */
cinfo->unread_marker = 0; cinfo->unread_marker = 0;
@@ -1416,9 +1411,8 @@ jinit_marker_reader (j_decompress_ptr cinfo)
int i; int i;
/* Create subobject in permanent pool */ /* Create subobject in permanent pool */
marker = (my_marker_ptr) marker = (my_marker_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_marker_reader));
SIZEOF(my_marker_reader));
cinfo->marker = &marker->pub; cinfo->marker = &marker->pub;
/* Initialize public method pointers */ /* Initialize public method pointers */
marker->pub.reset_marker_reader = reset_marker_reader; marker->pub.reset_marker_reader = reset_marker_reader;

View File

@@ -2,7 +2,7 @@
* jdmaster.c * jdmaster.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2002-2013 by Guido Vollbeding. * Modified 2002-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -45,11 +45,23 @@ LOCAL(boolean)
use_merged_upsample (j_decompress_ptr cinfo) use_merged_upsample (j_decompress_ptr cinfo)
{ {
#ifdef UPSAMPLE_MERGING_SUPPORTED #ifdef UPSAMPLE_MERGING_SUPPORTED
/* Merging is the equivalent of plain box-filter upsampling */ /* Merging is the equivalent of plain box-filter upsampling. */
if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) /* The following condition is only needed if fancy shall select
* a different upsampling method. In our current implementation
* fancy only affects the DCT scaling, thus we can use fancy
* upsampling and merged upsample simultaneously, in particular
* with scaled DCT sizes larger than the default DCTSIZE.
*/
#if 0
if (cinfo->do_fancy_upsampling)
return FALSE;
#endif
if (cinfo->CCIR601_sampling)
return FALSE; return FALSE;
/* jdmerge.c only supports YCC=>RGB color conversion */ /* jdmerge.c only supports YCC=>RGB color conversion */
if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || if ((cinfo->jpeg_color_space != JCS_YCbCr &&
cinfo->jpeg_color_space != JCS_BG_YCC) ||
cinfo->num_components != 3 ||
cinfo->out_color_space != JCS_RGB || cinfo->out_color_space != JCS_RGB ||
cinfo->out_color_components != RGB_PIXELSIZE || cinfo->out_color_components != RGB_PIXELSIZE ||
cinfo->color_transform) cinfo->color_transform)
@@ -92,7 +104,7 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
*/ */
{ {
#ifdef IDCT_SCALING_SUPPORTED #ifdef IDCT_SCALING_SUPPORTED
int ci; int ci, ssize;
jpeg_component_info *compptr; jpeg_component_info *compptr;
#endif #endif
@@ -112,17 +124,21 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
*/ */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) { ci++, compptr++) {
int ssize = 1; ssize = 1;
if (! cinfo->raw_data_out)
while (cinfo->min_DCT_h_scaled_size * ssize <= while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) && (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) { (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2; ssize = ssize * 2;
} }
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize; compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
ssize = 1; ssize = 1;
if (! cinfo->raw_data_out)
while (cinfo->min_DCT_v_scaled_size * ssize <= while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) && (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) { (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2; ssize = ssize * 2;
} }
compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize; compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
@@ -132,13 +148,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2; compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2) else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2; compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
}
/* Recompute downsampled dimensions of components; /* Recompute downsampled dimensions of components;
* application needs to know these if using raw downsampled data. * application needs to know these if using raw downsampled data.
*/ */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Size in samples, after IDCT scaling */ /* Size in samples, after IDCT scaling */
compptr->downsampled_width = (JDIMENSION) compptr->downsampled_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * jdiv_round_up((long) cinfo->image_width *
@@ -160,8 +173,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
break; break;
case JCS_RGB: case JCS_RGB:
case JCS_BG_RGB: case JCS_BG_RGB:
#if RGB_PIXELSIZE != 3
cinfo->out_color_components = RGB_PIXELSIZE; cinfo->out_color_components = RGB_PIXELSIZE;
break; break;
#endif /* else share code with YCbCr */
case JCS_YCbCr: case JCS_YCbCr:
case JCS_BG_YCC: case JCS_BG_YCC:
cinfo->out_color_components = 3; cinfo->out_color_components = 3;
@@ -172,7 +187,6 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
break; break;
default: /* else must be same colorspace as in file */ default: /* else must be same colorspace as in file */
cinfo->out_color_components = cinfo->num_components; cinfo->out_color_components = cinfo->num_components;
break;
} }
cinfo->output_components = (cinfo->quantize_colors ? 1 : cinfo->output_components = (cinfo->quantize_colors ? 1 :
cinfo->out_color_components); cinfo->out_color_components);
@@ -199,30 +213,20 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
* These processes all use a common table prepared by the routine below. * These processes all use a common table prepared by the routine below.
* *
* For most steps we can mathematically guarantee that the initial value * For most steps we can mathematically guarantee that the initial value
* of x is within MAXJSAMPLE+1 of the legal range, so a table running from * of x is within 2*(MAXJSAMPLE+1) of the legal range, so a table running
* -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial * from -2*(MAXJSAMPLE+1) to 3*MAXJSAMPLE+2 is sufficient. But for the
* limiting step (just after the IDCT), a wildly out-of-range value is * initial limiting step (just after the IDCT), a wildly out-of-range value
* possible if the input data is corrupt. To avoid any chance of indexing * is possible if the input data is corrupt. To avoid any chance of indexing
* off the end of memory and getting a bad-pointer trap, we perform the * off the end of memory and getting a bad-pointer trap, we perform the
* post-IDCT limiting thus: * post-IDCT limiting thus:
* x = range_limit[x & MASK]; * x = (sample_range_limit - SUBSET)[(x + CENTER) & MASK];
* where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
* samples. Under normal circumstances this is more than enough range and * samples. Under normal circumstances this is more than enough range and
* a correct output will be generated; with bogus input data the mask will * a correct output will be generated; with bogus input data the mask will
* cause wraparound, and we will safely generate a bogus-but-in-range output. * cause wraparound, and we will safely generate a bogus-but-in-range output.
* For the post-IDCT step, we want to convert the data from signed to unsigned * For the post-IDCT step, we want to convert the data from signed to unsigned
* representation by adding CENTERJSAMPLE at the same time that we limit it. * representation by adding CENTERJSAMPLE at the same time that we limit it.
* So the post-IDCT limiting table ends up looking like this: * This is accomplished with SUBSET = CENTER - CENTERJSAMPLE.
* CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
* MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
* 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
* 0,1,...,CENTERJSAMPLE-1
* Negative inputs select values from the upper half of the table after
* masking.
*
* We can save some space by overlapping the start of the post-IDCT table
* with the simpler range limiting table. The post-IDCT table begins at
* sample_range_limit + CENTERJSAMPLE.
* *
* Note that the table is allocated in near data space on PCs; it's small * Note that the table is allocated in near data space on PCs; it's small
* enough and used often enough to justify this. * enough and used often enough to justify this.
@@ -235,25 +239,18 @@ prepare_range_limit_table (j_decompress_ptr cinfo)
JSAMPLE * table; JSAMPLE * table;
int i; int i;
table = (JSAMPLE *) table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, JPOOL_IMAGE, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE));
(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); /* First segment of range limit table: limit[x] = 0 for x < 0 */
table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE));
table += RANGE_CENTER; /* allow negative subscripts of table */
cinfo->sample_range_limit = table; cinfo->sample_range_limit = table;
/* First segment of "simple" table: limit[x] = 0 for x < 0 */ /* Main part of range limit table: limit[x] = x */
MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
/* Main part of "simple" table: limit[x] = x */
for (i = 0; i <= MAXJSAMPLE; i++) for (i = 0; i <= MAXJSAMPLE; i++)
table[i] = (JSAMPLE) i; table[i] = (JSAMPLE) i;
table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
/* End of simple table, rest of first half of post-IDCT table */ for (; i <= MAXJSAMPLE + RANGE_CENTER; i++)
for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
table[i] = MAXJSAMPLE; table[i] = MAXJSAMPLE;
/* Second half of post-IDCT table */
MEMZERO(table + (2 * (MAXJSAMPLE+1)),
(2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
} }
@@ -530,9 +527,8 @@ jinit_master_decompress (j_decompress_ptr cinfo)
{ {
my_master_ptr master; my_master_ptr master;
master = (my_master_ptr) master = (my_master_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_decomp_master));
SIZEOF(my_decomp_master));
cinfo->master = &master->pub; cinfo->master = &master->pub;
master->pub.prepare_for_output_pass = prepare_for_output_pass; master->pub.prepare_for_output_pass = prepare_for_output_pass;
master->pub.finish_output_pass = finish_output_pass; master->pub.finish_output_pass = finish_output_pass;

View File

@@ -2,7 +2,7 @@
* jdmerge.c * jdmerge.c
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2013 by Guido Vollbeding. * Modified 2013-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -24,7 +24,7 @@
* multiplications needed for color conversion. * multiplications needed for color conversion.
* *
* This file currently provides implementations for the following cases: * This file currently provides implementations for the following cases:
* YCbCr => RGB color conversion only. * YCC => RGB color conversion only (YCbCr or BG_YCC).
* Sampling ratios of 2h1v or 2h2v. * Sampling ratios of 2h1v or 2h2v.
* No scaling needed at upsample time. * No scaling needed at upsample time.
* Corner-aligned (non-CCIR601) sampling alignment. * Corner-aligned (non-CCIR601) sampling alignment.
@@ -40,6 +40,12 @@
#ifdef UPSAMPLE_MERGING_SUPPORTED #ifdef UPSAMPLE_MERGING_SUPPORTED
#if RANGE_BITS < 2
/* Deliberate syntax err */
Sorry, this code requires 2 or more range extension bits.
#endif
/* Private subobject */ /* Private subobject */
typedef struct { typedef struct {
@@ -76,40 +82,35 @@ typedef my_upsampler * my_upsample_ptr;
/* /*
* Initialize tables for YCC->RGB colorspace conversion. * Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion.
* This is taken directly from jdcolor.c; see that file for more info. * This is taken directly from jdcolor.c; see that file for more info.
*/ */
LOCAL(void) LOCAL(void)
build_ycc_rgb_table (j_decompress_ptr cinfo) build_ycc_rgb_table (j_decompress_ptr cinfo)
/* Normal case, sYCC */
{ {
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
int i; int i;
INT32 x; INT32 x;
SHIFT_TEMPS SHIFT_TEMPS
upsample->Cr_r_tab = (int *) upsample->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
(MAXJSAMPLE+1) * SIZEOF(int)); upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
upsample->Cb_b_tab = (int *) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, upsample->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
(MAXJSAMPLE+1) * SIZEOF(int)); ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cr_g_tab = (INT32 *) upsample->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 1.402 * x */ /* Cr=>R value is nearest int to 1.402 * x */
upsample->Cr_r_tab[i] = (int) upsample->Cr_r_tab[i] = (int) DESCALE(FIX(1.402) * x, SCALEBITS);
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
/* Cb=>B value is nearest int to 1.772 * x */ /* Cb=>B value is nearest int to 1.772 * x */
upsample->Cb_b_tab[i] = (int) upsample->Cb_b_tab[i] = (int) DESCALE(FIX(1.772) * x, SCALEBITS);
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
/* Cr=>G value is scaled-up -0.714136286 * x */ /* Cr=>G value is scaled-up -0.714136286 * x */
upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x; upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
/* Cb=>G value is scaled-up -0.344136286 * x */ /* Cb=>G value is scaled-up -0.344136286 * x */
@@ -119,6 +120,40 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
} }
LOCAL(void)
build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
/* Wide gamut case, bg-sYCC */
{
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
int i;
INT32 x;
SHIFT_TEMPS
upsample->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 2.804 * x */
upsample->Cr_r_tab[i] = (int) DESCALE(FIX(2.804) * x, SCALEBITS);
/* Cb=>B value is nearest int to 3.544 * x */
upsample->Cb_b_tab[i] = (int) DESCALE(FIX(3.544) * x, SCALEBITS);
/* Cr=>G value is scaled-up -1.428272572 * x */
upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
/* Cb=>G value is scaled-up -0.688272572 * x */
/* We also add in ONE_HALF so that need not do it in inner loop */
upsample->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;
}
}
/* /*
* Initialize for an upsampling pass. * Initialize for an upsampling pass.
*/ */
@@ -372,10 +407,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
{ {
my_upsample_ptr upsample; my_upsample_ptr upsample;
upsample = (my_upsample_ptr) upsample = (my_upsample_ptr) (*cinfo->mem->alloc_small)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_upsampler));
SIZEOF(my_upsampler)); cinfo->upsample = &upsample->pub;
cinfo->upsample = (struct jpeg_upsampler *) upsample;
upsample->pub.start_pass = start_pass_merged_upsample; upsample->pub.start_pass = start_pass_merged_upsample;
upsample->pub.need_context_rows = FALSE; upsample->pub.need_context_rows = FALSE;
@@ -385,9 +419,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
upsample->pub.upsample = merged_2v_upsample; upsample->pub.upsample = merged_2v_upsample;
upsample->upmethod = h2v2_merged_upsample; upsample->upmethod = h2v2_merged_upsample;
/* Allocate a spare row buffer */ /* Allocate a spare row buffer */
upsample->spare_row = (JSAMPROW) upsample->spare_row = (JSAMPROW) (*cinfo->mem->alloc_large)
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE,
(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE))); (size_t) upsample->out_row_width * SIZEOF(JSAMPLE));
} else { } else {
upsample->pub.upsample = merged_1v_upsample; upsample->pub.upsample = merged_1v_upsample;
upsample->upmethod = h2v1_merged_upsample; upsample->upmethod = h2v1_merged_upsample;
@@ -395,6 +429,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
upsample->spare_row = NULL; upsample->spare_row = NULL;
} }
if (cinfo->jpeg_color_space == JCS_BG_YCC)
build_bg_ycc_rgb_table(cinfo);
else
build_ycc_rgb_table(cinfo); build_ycc_rgb_table(cinfo);
} }

View File

@@ -2,7 +2,7 @@
* jdsample.c * jdsample.c
* *
* Copyright (C) 1991-1996, Thomas G. Lane. * Copyright (C) 1991-1996, Thomas G. Lane.
* Modified 2002-2008 by Guido Vollbeding. * Modified 2002-2015 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -296,13 +296,12 @@ jinit_upsampler (j_decompress_ptr cinfo)
my_upsample_ptr upsample; my_upsample_ptr upsample;
int ci; int ci;
jpeg_component_info * compptr; jpeg_component_info * compptr;
boolean need_buffer;
int h_in_group, v_in_group, h_out_group, v_out_group; int h_in_group, v_in_group, h_out_group, v_out_group;
upsample = (my_upsample_ptr) upsample = (my_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_upsampler)); SIZEOF(my_upsampler));
cinfo->upsample = (struct jpeg_upsampler *) upsample; cinfo->upsample = &upsample->pub;
upsample->pub.start_pass = start_pass_upsample; upsample->pub.start_pass = start_pass_upsample;
upsample->pub.upsample = sep_upsample; upsample->pub.upsample = sep_upsample;
upsample->pub.need_context_rows = FALSE; /* until we find out differently */ upsample->pub.need_context_rows = FALSE; /* until we find out differently */
@@ -325,17 +324,17 @@ jinit_upsampler (j_decompress_ptr cinfo)
h_out_group = cinfo->max_h_samp_factor; h_out_group = cinfo->max_h_samp_factor;
v_out_group = cinfo->max_v_samp_factor; v_out_group = cinfo->max_v_samp_factor;
upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
need_buffer = TRUE;
if (! compptr->component_needed) { if (! compptr->component_needed) {
/* Don't bother to upsample an uninteresting component. */ /* Don't bother to upsample an uninteresting component. */
upsample->methods[ci] = noop_upsample; upsample->methods[ci] = noop_upsample;
need_buffer = FALSE; continue; /* don't need to allocate buffer */
} else if (h_in_group == h_out_group && v_in_group == v_out_group) { }
if (h_in_group == h_out_group && v_in_group == v_out_group) {
/* Fullsize components can be processed without any work. */ /* Fullsize components can be processed without any work. */
upsample->methods[ci] = fullsize_upsample; upsample->methods[ci] = fullsize_upsample;
need_buffer = FALSE; continue; /* don't need to allocate buffer */
} else if (h_in_group * 2 == h_out_group && }
v_in_group == v_out_group) { if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) {
/* Special case for 2h1v upsampling */ /* Special case for 2h1v upsampling */
upsample->methods[ci] = h2v1_upsample; upsample->methods[ci] = h2v1_upsample;
} else if (h_in_group * 2 == h_out_group && } else if (h_in_group * 2 == h_out_group &&
@@ -350,7 +349,6 @@ jinit_upsampler (j_decompress_ptr cinfo)
upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
} else } else
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
if (need_buffer) {
upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE, ((j_common_ptr) cinfo, JPOOL_IMAGE,
(JDIMENSION) jround_up((long) cinfo->output_width, (JDIMENSION) jround_up((long) cinfo->output_width,
@@ -358,4 +356,3 @@ jinit_upsampler (j_decompress_ptr cinfo)
(JDIMENSION) cinfo->max_v_samp_factor); (JDIMENSION) cinfo->max_v_samp_factor);
} }
} }
}

View File

@@ -2,7 +2,7 @@
* jerror.c * jerror.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2012 by Guido Vollbeding. * Modified 2012-2015 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -19,16 +19,16 @@
* These routines are used by both the compression and decompression code. * These routines are used by both the compression and decompression code.
*/ */
#ifdef USE_WINDOWS_MESSAGEBOX
#include <windows.h>
#endif
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ /* this is not a core library module, so it doesn't define JPEG_INTERNALS */
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jversion.h" #include "jversion.h"
#include "jerror.h" #include "jerror.h"
#ifdef USE_WINDOWS_MESSAGEBOX
#include <windows.h>
#endif
#ifndef EXIT_FAILURE /* define exit() codes if not provided */ #ifndef EXIT_FAILURE /* define exit() codes if not provided */
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
#endif #endif

View File

@@ -2,7 +2,7 @@
* jerror.h * jerror.h
* *
* Copyright (C) 1994-1997, Thomas G. Lane. * Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2012 by Guido Vollbeding. * Modified 1997-2018 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -84,7 +84,7 @@ JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error") JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") JMESSAGE(JERR_HUFF_CLEN_OUTOFBOUNDS, "Huffman code size table out of bounds")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")

View File

@@ -2,7 +2,7 @@
* jfdctflt.c * jfdctflt.c
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2003-2009 by Guido Vollbeding. * Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -48,12 +48,14 @@
*/ */
#if DCTSIZE != 8 #if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif #endif
/* /*
* Perform the forward DCT on one block of samples. * Perform the forward DCT on one block of samples.
*
* cK represents cos(K*pi/16).
*/ */
GLOBAL(void) GLOBAL(void)
@@ -89,7 +91,7 @@ jpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col
tmp11 = tmp1 + tmp2; tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2; tmp12 = tmp1 - tmp2;
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
dataptr[4] = tmp10 - tmp11; dataptr[4] = tmp10 - tmp11;

View File

@@ -2,7 +2,7 @@
* jfdctfst.c * jfdctfst.c
* *
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2003-2009 by Guido Vollbeding. * Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -44,7 +44,7 @@
*/ */
#if DCTSIZE != 8 #if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif #endif
@@ -109,6 +109,8 @@
/* /*
* Perform the forward DCT on one block of samples. * Perform the forward DCT on one block of samples.
*
* cK represents cos(K*pi/16).
*/ */
GLOBAL(void) GLOBAL(void)
@@ -145,7 +147,7 @@ jpeg_fdct_ifast (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp11 = tmp1 + tmp2; tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2; tmp12 = tmp1 - tmp2;
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
dataptr[4] = tmp10 - tmp11; dataptr[4] = tmp10 - tmp11;

View File

@@ -2,7 +2,7 @@
* jfdctint.c * jfdctint.c
* *
* Copyright (C) 1991-1996, Thomas G. Lane. * Copyright (C) 1991-1996, Thomas G. Lane.
* Modification developed 2003-2013 by Guido Vollbeding. * Modification developed 2003-2018 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -194,7 +194,7 @@ jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
@@ -367,7 +367,7 @@ jpeg_fdct_7x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]); tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);
z1 = tmp0 + tmp2; z1 = tmp0 + tmp2;
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS); ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);
tmp3 += tmp3; tmp3 += tmp3;
@@ -503,7 +503,7 @@ jpeg_fdct_6x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[2] = (DCTELEM) dataptr[2] = (DCTELEM)
@@ -618,7 +618,7 @@ jpeg_fdct_5x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]); tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1)); ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1));
tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */ tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */
@@ -724,7 +724,7 @@ jpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2)); ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2)); dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2));
@@ -818,7 +818,7 @@ jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]); tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2)); ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2));
dataptr[2] = (DCTELEM) dataptr[2] = (DCTELEM)
@@ -876,7 +876,7 @@ jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
GLOBAL(void) GLOBAL(void)
jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{ {
INT32 tmp0, tmp1, tmp2, tmp3; DCTELEM tmp0, tmp1, tmp2, tmp3;
JSAMPROW elemptr; JSAMPROW elemptr;
/* Pre-zero output coefficient block. */ /* Pre-zero output coefficient block. */
@@ -904,13 +904,13 @@ jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
*/ */
/* Column 0 */ /* Column 0 */
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4); data[DCTSIZE*0] = (tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4;
data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp2) << 4); data[DCTSIZE*1] = (tmp0 - tmp2) << 4;
/* Column 1 */ /* Column 1 */
data[DCTSIZE*0+1] = (DCTELEM) ((tmp1 + tmp3) << 4); data[DCTSIZE*0+1] = (tmp1 + tmp3) << 4;
data[DCTSIZE*1+1] = (DCTELEM) ((tmp1 - tmp3) << 4); data[DCTSIZE*1+1] = (tmp1 - tmp3) << 4;
} }
@@ -921,14 +921,17 @@ jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
GLOBAL(void) GLOBAL(void)
jpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) jpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{ {
DCTELEM dcval;
/* Pre-zero output coefficient block. */ /* Pre-zero output coefficient block. */
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
dcval = GETJSAMPLE(sample_data[0][start_col]);
/* We leave the result scaled up by an overall factor of 8. */ /* We leave the result scaled up by an overall factor of 8. */
/* We must also scale the output by (8/1)**2 = 2**6. */ /* We must also scale the output by (8/1)**2 = 2**6. */
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
data[0] = (DCTELEM) data[0] = (dcval - CENTERJSAMPLE) << 6;
((GETJSAMPLE(sample_data[0][start_col]) - CENTERJSAMPLE) << 6);
} }
@@ -976,7 +979,7 @@ jpeg_fdct_9x9 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
z1 = tmp0 + tmp2 + tmp3; z1 = tmp0 + tmp2 + tmp3;
z2 = tmp1 + tmp4; z2 = tmp1 + tmp4;
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1); dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1);
dataptr[6] = (DCTELEM) dataptr[6] = (DCTELEM)
DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)), /* c6 */ DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)), /* c6 */
@@ -1130,7 +1133,7 @@ jpeg_fdct_10x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]); tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1); ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1);
tmp12 += tmp12; tmp12 += tmp12;
@@ -1291,7 +1294,7 @@ jpeg_fdct_11x11 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]); tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]);
tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]); tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1); ((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1);
tmp5 += tmp5; tmp5 += tmp5;
@@ -1480,7 +1483,7 @@ jpeg_fdct_12x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]); tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]); tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE); dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE);
dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15); dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15);
dataptr[4] = (DCTELEM) dataptr[4] = (DCTELEM)
@@ -1641,7 +1644,7 @@ jpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]); tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]);
tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]); tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE); (tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE);
tmp6 += tmp6; tmp6 += tmp6;
@@ -1848,7 +1851,7 @@ jpeg_fdct_14x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]); tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]); tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
(tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE); (tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE);
tmp13 += tmp13; tmp13 += tmp13;
@@ -2047,7 +2050,7 @@ jpeg_fdct_15x15 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
z1 = tmp0 + tmp4 + tmp5; z1 = tmp0 + tmp4 + tmp5;
z2 = tmp1 + tmp3 + tmp6; z2 = tmp1 + tmp3 + tmp6;
z3 = tmp2 + tmp7; z3 = tmp2 + tmp7;
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE); dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE);
z3 += z3; z3 += z3;
dataptr[6] = (DCTELEM) dataptr[6] = (DCTELEM)
@@ -2234,7 +2237,7 @@ jpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]); tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);
tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]); tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM) dataptr[4] = (DCTELEM)
@@ -2443,7 +2446,7 @@ jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]); tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);
tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]); tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM) dataptr[4] = (DCTELEM)
@@ -2624,7 +2627,7 @@ jpeg_fdct_14x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]); tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]); tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS);
tmp13 += tmp13; tmp13 += tmp13;
@@ -2786,7 +2789,7 @@ jpeg_fdct_12x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]); tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]); tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS); dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS);
@@ -2922,7 +2925,7 @@ jpeg_fdct_10x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]); tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS);
tmp12 += tmp12; tmp12 += tmp12;
@@ -3057,7 +3060,7 @@ jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1)); ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1)); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1));
@@ -3192,7 +3195,7 @@ jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1)); ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[2] = (DCTELEM) dataptr[2] = (DCTELEM)
@@ -3258,78 +3261,84 @@ jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
GLOBAL(void) GLOBAL(void)
jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{ {
INT32 tmp0, tmp1; DCTELEM tmp0, tmp2, tmp10, tmp12, tmp4, tmp5;
INT32 tmp10, tmp11; INT32 tmp1, tmp3, tmp11, tmp13;
DCTELEM *dataptr; INT32 z1, z2, z3;
JSAMPROW elemptr; JSAMPROW elemptr;
int ctr;
SHIFT_TEMPS SHIFT_TEMPS
/* Pre-zero output coefficient block. */ /* Pre-zero output coefficient block. */
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
/* Pass 1: process rows. /* Pass 1: process rows.
* Note results are scaled up by sqrt(8) compared to a true DCT; * Note results are scaled up by sqrt(8) compared to a true DCT.
* furthermore, we scale the results by 2**PASS1_BITS.
* We must also scale the output by (8/4)*(8/2) = 2**3, which we add here.
* 4-point FDCT kernel, * 4-point FDCT kernel,
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
*/ */
dataptr = data; /* Row 0 */
for (ctr = 0; ctr < 2; ctr++) { elemptr = sample_data[0] + start_col;
elemptr = sample_data[ctr] + start_col;
/* Even part */ /* Even part */
tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]); tmp4 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]); tmp5 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); tmp0 = tmp4 + tmp5;
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); tmp2 = tmp4 - tmp5;
/* Apply unsigned->signed conversion */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3));
/* Odd part */ /* Odd part */
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ z2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
z3 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
/* Add fudge factor here for final descale. */ /* Add fudge factor here for final descale. */
tmp0 += ONE << (CONST_BITS-PASS1_BITS-4); z1 += ONE << (CONST_BITS-3-1);
tmp1 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
dataptr[1] = (DCTELEM) /* Row 1 */
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ elemptr = sample_data[1] + start_col;
CONST_BITS-PASS1_BITS-3);
dataptr[3] = (DCTELEM)
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
CONST_BITS-PASS1_BITS-3);
dataptr += DCTSIZE; /* advance pointer to next row */ /* Even part */
}
tmp4 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
tmp5 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
tmp10 = tmp4 + tmp5;
tmp12 = tmp4 - tmp5;
/* Odd part */
z2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
z3 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp11 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp13 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
/* Pass 2: process columns. /* Pass 2: process columns.
* We remove the PASS1_BITS scaling, but leave the results scaled up * We leave the results scaled up by an overall factor of 8.
* by an overall factor of 8. * We must also scale the output by (8/4)*(8/2) = 2**3.
*/ */
dataptr = data; /* Column 0 */
for (ctr = 0; ctr < 4; ctr++) { /* Apply unsigned->signed conversion. */
/* Even part */ data[DCTSIZE*0] = (tmp0 + tmp10 - 8 * CENTERJSAMPLE) << 3;
data[DCTSIZE*1] = (tmp0 - tmp10) << 3;
/* Add fudge factor here for final descale. */ /* Column 1 */
tmp0 = dataptr[DCTSIZE*0] + (ONE << (PASS1_BITS-1)); data[DCTSIZE*0+1] = (DCTELEM) RIGHT_SHIFT(tmp1 + tmp11, CONST_BITS-3);
tmp1 = dataptr[DCTSIZE*1]; data[DCTSIZE*1+1] = (DCTELEM) RIGHT_SHIFT(tmp1 - tmp11, CONST_BITS-3);
dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS); /* Column 2 */
data[DCTSIZE*0+2] = (tmp2 + tmp12) << 3;
data[DCTSIZE*1+2] = (tmp2 - tmp12) << 3;
/* Odd part */ /* Column 3 */
data[DCTSIZE*0+3] = (DCTELEM) RIGHT_SHIFT(tmp3 + tmp13, CONST_BITS-3);
dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS); data[DCTSIZE*1+3] = (DCTELEM) RIGHT_SHIFT(tmp3 - tmp13, CONST_BITS-3);
dataptr++; /* advance pointer to next column */
}
} }
@@ -3342,7 +3351,7 @@ jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
GLOBAL(void) GLOBAL(void)
jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{ {
INT32 tmp0, tmp1; DCTELEM tmp0, tmp1;
JSAMPROW elemptr; JSAMPROW elemptr;
/* Pre-zero output coefficient block. */ /* Pre-zero output coefficient block. */
@@ -3359,12 +3368,12 @@ jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
/* Even part */ /* Even part */
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); data[0] = (tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5;
/* Odd part */ /* Odd part */
data[1] = (DCTELEM) ((tmp0 - tmp1) << 5); data[1] = (tmp0 - tmp1) << 5;
} }
@@ -3417,7 +3426,7 @@ jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
@@ -3607,7 +3616,7 @@ jpeg_fdct_7x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]); tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);
z1 = tmp0 + tmp2; z1 = tmp0 + tmp2;
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS); ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);
tmp3 += tmp3; tmp3 += tmp3;
@@ -3789,7 +3798,7 @@ jpeg_fdct_6x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[2] = (DCTELEM) dataptr[2] = (DCTELEM)
@@ -3938,7 +3947,7 @@ jpeg_fdct_5x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]); tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS); ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS);
tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */ tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */
@@ -4081,7 +4090,7 @@ jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1)); ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1)); dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1));
@@ -4220,7 +4229,7 @@ jpeg_fdct_3x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]); tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1)); ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[2] = (DCTELEM) dataptr[2] = (DCTELEM)
@@ -4309,7 +4318,6 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
/* Pass 1: process rows. /* Pass 1: process rows.
* Note results are scaled up by sqrt(8) compared to a true DCT. * Note results are scaled up by sqrt(8) compared to a true DCT.
* We must also scale the output by (8/2)*(8/4) = 2**3, which we add here.
*/ */
dataptr = data; dataptr = data;
@@ -4321,18 +4329,19 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp0 = GETJSAMPLE(elemptr[0]); tmp0 = GETJSAMPLE(elemptr[0]);
tmp1 = GETJSAMPLE(elemptr[1]); tmp1 = GETJSAMPLE(elemptr[1]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3); dataptr[0] = (DCTELEM) (tmp0 + tmp1 - 2 * CENTERJSAMPLE);
/* Odd part */ /* Odd part */
dataptr[1] = (DCTELEM) ((tmp0 - tmp1) << 3); dataptr[1] = (DCTELEM) (tmp0 - tmp1);
dataptr += DCTSIZE; /* advance pointer to next row */ dataptr += DCTSIZE; /* advance pointer to next row */
} }
/* Pass 2: process columns. /* Pass 2: process columns.
* We leave the results scaled up by an overall factor of 8. * We leave the results scaled up by an overall factor of 8.
* We must also scale the output by (8/2)*(8/4) = 2**3.
* 4-point FDCT kernel, * 4-point FDCT kernel,
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
*/ */
@@ -4347,21 +4356,21 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3]; tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2]; tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
dataptr[DCTSIZE*0] = (DCTELEM) (tmp0 + tmp1); dataptr[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1) << 3);
dataptr[DCTSIZE*2] = (DCTELEM) (tmp0 - tmp1); dataptr[DCTSIZE*2] = (DCTELEM) ((tmp0 - tmp1) << 3);
/* Odd part */ /* Odd part */
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
/* Add fudge factor here for final descale. */ /* Add fudge factor here for final descale. */
tmp0 += ONE << (CONST_BITS-1); tmp0 += ONE << (CONST_BITS-3-1);
dataptr[DCTSIZE*1] = (DCTELEM) dataptr[DCTSIZE*1] = (DCTELEM)
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
CONST_BITS); CONST_BITS-3);
dataptr[DCTSIZE*3] = (DCTELEM) dataptr[DCTSIZE*3] = (DCTELEM)
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
CONST_BITS); CONST_BITS-3);
dataptr++; /* advance pointer to next column */ dataptr++; /* advance pointer to next column */
} }
@@ -4377,7 +4386,7 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
GLOBAL(void) GLOBAL(void)
jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{ {
INT32 tmp0, tmp1; DCTELEM tmp0, tmp1;
/* Pre-zero output coefficient block. */ /* Pre-zero output coefficient block. */
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
@@ -4394,12 +4403,12 @@ jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp0 = GETJSAMPLE(sample_data[0][start_col]); tmp0 = GETJSAMPLE(sample_data[0][start_col]);
tmp1 = GETJSAMPLE(sample_data[1][start_col]); tmp1 = GETJSAMPLE(sample_data[1][start_col]);
/* Apply unsigned->signed conversion */ /* Apply unsigned->signed conversion. */
data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); data[DCTSIZE*0] = (tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5;
/* Odd part */ /* Odd part */
data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5); data[DCTSIZE*1] = (tmp0 - tmp1) << 5;
} }
#endif /* DCT_SCALING_SUPPORTED */ #endif /* DCT_SCALING_SUPPORTED */

View File

@@ -2,7 +2,7 @@
* jidctflt.c * jidctflt.c
* *
* Copyright (C) 1994-1998, Thomas G. Lane. * Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2010 by Guido Vollbeding. * Modified 2010-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -50,7 +50,7 @@
*/ */
#if DCTSIZE != 8 #if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif #endif
@@ -63,6 +63,8 @@
/* /*
* Perform dequantization and inverse DCT on one block of coefficients. * Perform dequantization and inverse DCT on one block of coefficients.
*
* cK represents cos(K*pi/16).
*/ */
GLOBAL(void) GLOBAL(void)
@@ -77,7 +79,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
FLOAT_MULT_TYPE * quantptr; FLOAT_MULT_TYPE * quantptr;
FAST_FLOAT * wsptr; FAST_FLOAT * wsptr;
JSAMPROW outptr; JSAMPROW outptr;
JSAMPLE *range_limit = cinfo->sample_range_limit; JSAMPLE *range_limit = IDCT_range_limit(cinfo);
int ctr; int ctr;
FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
@@ -186,13 +188,14 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Apply signed->unsigned and prepare float->int conversion */ /* Prepare range-limit and float->int conversion */
z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5); z5 = wsptr[0] + (((FAST_FLOAT) RANGE_CENTER) + ((FAST_FLOAT) 0.5));
tmp10 = z5 + wsptr[4]; tmp10 = z5 + wsptr[4];
tmp11 = z5 - wsptr[4]; tmp11 = z5 - wsptr[4];
tmp13 = wsptr[2] + wsptr[6]; tmp13 = wsptr[2] + wsptr[6];
tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; tmp12 = (wsptr[2] - wsptr[6]) *
((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
tmp0 = tmp10 + tmp13; tmp0 = tmp10 + tmp13;
tmp3 = tmp10 - tmp13; tmp3 = tmp10 - tmp13;
@@ -206,27 +209,27 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
z11 = wsptr[1] + wsptr[7]; z11 = wsptr[1] + wsptr[7];
z12 = wsptr[1] - wsptr[7]; z12 = wsptr[1] - wsptr[7];
tmp7 = z11 + z13; tmp7 = z11 + z13; /* phase 5 */
tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */ tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */ tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
tmp6 = tmp12 - tmp7; tmp6 = tmp12 - tmp7; /* phase 2 */
tmp5 = tmp11 - tmp6; tmp5 = tmp11 - tmp6;
tmp4 = tmp10 - tmp5; tmp4 = tmp10 - tmp5;
/* Final output stage: float->int conversion and range-limit */ /* Final output stage: float->int conversion and range-limit */
outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK]; outptr[0] = range_limit[(int) (tmp0 + tmp7) & RANGE_MASK];
outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK]; outptr[7] = range_limit[(int) (tmp0 - tmp7) & RANGE_MASK];
outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK]; outptr[1] = range_limit[(int) (tmp1 + tmp6) & RANGE_MASK];
outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK]; outptr[6] = range_limit[(int) (tmp1 - tmp6) & RANGE_MASK];
outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK]; outptr[2] = range_limit[(int) (tmp2 + tmp5) & RANGE_MASK];
outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK]; outptr[5] = range_limit[(int) (tmp2 - tmp5) & RANGE_MASK];
outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK]; outptr[3] = range_limit[(int) (tmp3 + tmp4) & RANGE_MASK];
outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK]; outptr[4] = range_limit[(int) (tmp3 - tmp4) & RANGE_MASK];
wsptr += DCTSIZE; /* advance pointer to next row */ wsptr += DCTSIZE; /* advance pointer to next row */
} }

View File

@@ -2,6 +2,7 @@
* jidctfst.c * jidctfst.c
* *
* Copyright (C) 1994-1998, Thomas G. Lane. * Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2015-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -45,7 +46,7 @@
*/ */
#if DCTSIZE != 8 #if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif #endif
@@ -133,35 +134,10 @@
#endif #endif
/* Like DESCALE, but applies to a DCTELEM and produces an int.
* We assume that int right shift is unsigned if INT32 right shift is.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define ISHIFT_TEMPS DCTELEM ishift_temp;
#if BITS_IN_JSAMPLE == 8
#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
#else
#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
#endif
#define IRIGHT_SHIFT(x,shft) \
((ishift_temp = (x)) < 0 ? \
(ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
(ishift_temp >> (shft)))
#else
#define ISHIFT_TEMPS
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif
#ifdef USE_ACCURATE_ROUNDING
#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
#else
#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n))
#endif
/* /*
* Perform dequantization and inverse DCT on one block of coefficients. * Perform dequantization and inverse DCT on one block of coefficients.
*
* cK represents cos(K*pi/16).
*/ */
GLOBAL(void) GLOBAL(void)
@@ -180,7 +156,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
int ctr; int ctr;
int workspace[DCTSIZE2]; /* buffers data between passes */ int workspace[DCTSIZE2]; /* buffers data between passes */
SHIFT_TEMPS /* for DESCALE */ SHIFT_TEMPS /* for DESCALE */
ISHIFT_TEMPS /* for IDESCALE */ ISHIFT_TEMPS /* for IRIGHT_SHIFT */
/* Pass 1: process columns from input, store into work array. */ /* Pass 1: process columns from input, store into work array. */
@@ -253,12 +229,12 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */
tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */
tmp6 = tmp12 - tmp7; /* phase 2 */ tmp6 = tmp12 - tmp7; /* phase 2 */
tmp5 = tmp11 - tmp6; tmp5 = tmp11 - tmp6;
tmp4 = tmp10 + tmp5; tmp4 = tmp10 - tmp5;
wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
@@ -266,21 +242,28 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); wsptr[DCTSIZE*3] = (int) (tmp3 + tmp4);
wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); wsptr[DCTSIZE*4] = (int) (tmp3 - tmp4);
inptr++; /* advance pointers to next column */ inptr++; /* advance pointers to next column */
quantptr++; quantptr++;
wsptr++; wsptr++;
} }
/* Pass 2: process rows from work array, store into output array. */ /* Pass 2: process rows from work array, store into output array.
/* Note that we must descale the results by a factor of 8 == 2**3, */ * Note that we must descale the results by a factor of 8 == 2**3,
/* and also undo the PASS1_BITS scaling. */ * and also undo the PASS1_BITS scaling.
*/
wsptr = workspace; wsptr = workspace;
for (ctr = 0; ctr < DCTSIZE; ctr++) { for (ctr = 0; ctr < DCTSIZE; ctr++) {
outptr = output_buf[ctr] + output_col; outptr = output_buf[ctr] + output_col;
/* Add range center and fudge factor for final descale and range-limit. */
z5 = (DCTELEM) wsptr[0] +
((((DCTELEM) RANGE_CENTER) << (PASS1_BITS+3)) +
(1 << (PASS1_BITS+2)));
/* Rows of zeroes can be exploited in the same way as we did with columns. /* Rows of zeroes can be exploited in the same way as we did with columns.
* However, the column calculation has created many nonzero AC terms, so * However, the column calculation has created many nonzero AC terms, so
* the simplification applies less often (typically 5% to 10% of the time). * the simplification applies less often (typically 5% to 10% of the time).
@@ -293,7 +276,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */ /* AC terms all zero */
JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) JSAMPLE dcval = range_limit[(int) IRIGHT_SHIFT(z5, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[0] = dcval; outptr[0] = dcval;
@@ -312,12 +295,12 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); tmp10 = z5 + (DCTELEM) wsptr[4];
tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); tmp11 = z5 - (DCTELEM) wsptr[4];
tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); tmp13 = (DCTELEM) wsptr[2] + (DCTELEM) wsptr[6];
tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6],
- tmp13; FIX_1_414213562) - tmp13; /* 2*c4 */
tmp0 = tmp10 + tmp13; tmp0 = tmp10 + tmp13;
tmp3 = tmp10 - tmp13; tmp3 = tmp10 - tmp13;
@@ -335,30 +318,30 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */
tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */
tmp6 = tmp12 - tmp7; /* phase 2 */ tmp6 = tmp12 - tmp7; /* phase 2 */
tmp5 = tmp11 - tmp6; tmp5 = tmp11 - tmp6;
tmp4 = tmp10 + tmp5; tmp4 = tmp10 - tmp5;
/* Final output stage: scale down by a factor of 8 and range-limit */ /* Final output stage: scale down by a factor of 8 and range-limit */
outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp7, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) outptr[7] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp7, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp1 + tmp6, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) outptr[6] = range_limit[(int) IRIGHT_SHIFT(tmp1 - tmp6, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) outptr[2] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp5, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) outptr[5] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp5, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) outptr[3] = range_limit[(int) IRIGHT_SHIFT(tmp3 + tmp4, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) outptr[4] = range_limit[(int) IRIGHT_SHIFT(tmp3 - tmp4, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
wsptr += DCTSIZE; /* advance pointer to next row */ wsptr += DCTSIZE; /* advance pointer to next row */

View File

@@ -2,7 +2,7 @@
* jidctint.c * jidctint.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2013 by Guido Vollbeding. * Modification developed 2002-2018 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -166,6 +166,7 @@
/* /*
* Perform dequantization and inverse DCT on one block of coefficients. * Perform dequantization and inverse DCT on one block of coefficients.
* *
* Optimized algorithm with 12 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/16). * cK represents sqrt(2) * cos(K*pi/16).
*/ */
@@ -230,13 +231,6 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6). * The rotator is c(-6).
*/ */
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS; z2 <<= CONST_BITS;
@@ -247,6 +241,13 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3; tmp0 = z2 + z3;
tmp1 = z2 - z3; tmp1 = z2 - z3;
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
tmp10 = tmp0 + tmp2; tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2; tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3; tmp11 = tmp1 + tmp3;
@@ -306,6 +307,12 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr = workspace; wsptr = workspace;
for (ctr = 0; ctr < DCTSIZE; ctr++) { for (ctr = 0; ctr < DCTSIZE; ctr++) {
outptr = output_buf[ctr] + output_col; outptr = output_buf[ctr] + output_col;
/* Add range center and fudge factor for final descale and range-limit. */
z2 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
/* Rows of zeroes can be exploited in the same way as we did with columns. /* Rows of zeroes can be exploited in the same way as we did with columns.
* However, the column calculation has created many nonzero AC terms, so * However, the column calculation has created many nonzero AC terms, so
* the simplification applies less often (typically 5% to 10% of the time). * the simplification applies less often (typically 5% to 10% of the time).
@@ -318,7 +325,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */ /* AC terms all zero */
JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3) JSAMPLE dcval = range_limit[(int) RIGHT_SHIFT(z2, PASS1_BITS+3)
& RANGE_MASK]; & RANGE_MASK];
outptr[0] = dcval; outptr[0] = dcval;
@@ -339,6 +346,11 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6). * The rotator is c(-6).
*/ */
z3 = (INT32) wsptr[4];
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
z2 = (INT32) wsptr[2]; z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6]; z3 = (INT32) wsptr[6];
@@ -346,13 +358,6 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
/* Add fudge factor here for final descale. */
z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
z3 = (INT32) wsptr[4];
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
tmp10 = tmp0 + tmp2; tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2; tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3; tmp11 = tmp1 + tmp3;
@@ -424,7 +429,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* /*
* Perform dequantization and inverse DCT on one block of coefficients, * Perform dequantization and inverse DCT on one block of coefficients,
* producing a 7x7 output block. * producing a reduced-size 7x7 output block.
* *
* Optimized algorithm with 12 multiplications in the 1-D kernel. * Optimized algorithm with 12 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/14). * cK represents sqrt(2) * cos(K*pi/14).
@@ -508,8 +513,10 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp13 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp13 <<= CONST_BITS; tmp13 <<= CONST_BITS;
z1 = (INT32) wsptr[2]; z1 = (INT32) wsptr[2];
@@ -644,8 +651,10 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[4]; tmp2 = (INT32) wsptr[4];
tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
@@ -763,8 +772,10 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp12 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp12 <<= CONST_BITS; tmp12 <<= CONST_BITS;
tmp0 = (INT32) wsptr[2]; tmp0 = (INT32) wsptr[2];
tmp1 = (INT32) wsptr[4]; tmp1 = (INT32) wsptr[4];
@@ -875,8 +886,10 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp2 = (INT32) wsptr[2]; tmp2 = (INT32) wsptr[2];
tmp10 = (tmp0 + tmp2) << CONST_BITS; tmp10 = (tmp0 + tmp2) << CONST_BITS;
@@ -972,8 +985,10 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[2]; tmp2 = (INT32) wsptr[2];
tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
@@ -1014,11 +1029,11 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col) JSAMPARRAY output_buf, JDIMENSION output_col)
{ {
INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
ISLOW_MULT_TYPE * quantptr; ISLOW_MULT_TYPE * quantptr;
JSAMPROW outptr; JSAMPROW outptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo); JSAMPLE *range_limit = IDCT_range_limit(cinfo);
SHIFT_TEMPS ISHIFT_TEMPS
/* Pass 1: process columns from input. */ /* Pass 1: process columns from input. */
@@ -1027,8 +1042,8 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Column 0 */ /* Column 0 */
tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]); tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp4 += ONE << 2; tmp4 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
tmp0 = tmp4 + tmp5; tmp0 = tmp4 + tmp5;
tmp2 = tmp4 - tmp5; tmp2 = tmp4 - tmp5;
@@ -1045,14 +1060,14 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Row 0 */ /* Row 0 */
outptr = output_buf[0] + output_col; outptr = output_buf[0] + output_col;
outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
/* Row 1 */ /* Row 1 */
outptr = output_buf[1] + output_col; outptr = output_buf[1] + output_col;
outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK]; outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK];
outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK]; outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK];
} }
@@ -1069,17 +1084,21 @@ jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col) JSAMPARRAY output_buf, JDIMENSION output_col)
{ {
int dcval; DCTELEM dcval;
ISLOW_MULT_TYPE * quantptr; ISLOW_MULT_TYPE * quantptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo); JSAMPLE *range_limit = IDCT_range_limit(cinfo);
SHIFT_TEMPS ISHIFT_TEMPS
/* 1x1 is trivial: just take the DC coefficient divided by 8. */ /* 1x1 is trivial: just take the DC coefficient divided by 8. */
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
dcval = (int) DESCALE((INT32) dcval, 3);
output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
/* Add range center and fudge factor for descale and range-limit. */
dcval += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
output_buf[0][output_col] =
range_limit[(int) IRIGHT_SHIFT(dcval, 3) & RANGE_MASK];
} }
@@ -1178,8 +1197,10 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
z1 = (INT32) wsptr[2]; z1 = (INT32) wsptr[2];
@@ -1361,8 +1382,10 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS; z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4]; z4 = (INT32) wsptr[4];
z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
@@ -1451,7 +1474,7 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* /*
* Perform dequantization and inverse DCT on one block of coefficients, * Perform dequantization and inverse DCT on one block of coefficients,
* producing a 11x11 output block. * producing an 11x11 output block.
* *
* Optimized algorithm with 24 multiplications in the 1-D kernel. * Optimized algorithm with 24 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/22). * cK represents sqrt(2) * cos(K*pi/22).
@@ -1554,8 +1577,10 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp10 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp10 <<= CONST_BITS; tmp10 <<= CONST_BITS;
z1 = (INT32) wsptr[2]; z1 = (INT32) wsptr[2];
@@ -1758,8 +1783,10 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS; z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4]; z4 = (INT32) wsptr[4];
@@ -1979,8 +2006,10 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS; z1 <<= CONST_BITS;
z2 = (INT32) wsptr[2]; z2 = (INT32) wsptr[2];
@@ -2206,8 +2235,10 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS; z1 <<= CONST_BITS;
z4 = (INT32) wsptr[4]; z4 = (INT32) wsptr[4];
z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
@@ -2438,8 +2469,10 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS; z1 <<= CONST_BITS;
z2 = (INT32) wsptr[2]; z2 = (INT32) wsptr[2];
@@ -2591,7 +2624,7 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
/* Add fudge factor here for final descale. */ /* Add fudge factor here for final descale. */
tmp0 += 1 << (CONST_BITS-PASS1_BITS-1); tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
@@ -2689,8 +2722,10 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
z1 = (INT32) wsptr[4]; z1 = (INT32) wsptr[4];
@@ -2886,13 +2921,6 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6). * The rotator is c(-6).
*/ */
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS; z2 <<= CONST_BITS;
@@ -2903,6 +2931,13 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3; tmp0 = z2 + z3;
tmp1 = z2 - z3; tmp1 = z2 - z3;
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
tmp10 = tmp0 + tmp2; tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2; tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3; tmp11 = tmp1 + tmp3;
@@ -2964,8 +2999,10 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
z1 = (INT32) wsptr[4]; z1 = (INT32) wsptr[4];
@@ -3182,8 +3219,10 @@ jpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS; z1 <<= CONST_BITS;
z4 = (INT32) wsptr[4]; z4 = (INT32) wsptr[4];
z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
@@ -3366,8 +3405,10 @@ jpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS; z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4]; z4 = (INT32) wsptr[4];
@@ -3542,8 +3583,10 @@ jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS; z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4]; z4 = (INT32) wsptr[4];
z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
@@ -3632,7 +3675,7 @@ jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* /*
* Perform dequantization and inverse DCT on one block of coefficients, * Perform dequantization and inverse DCT on one block of coefficients,
* producing a 8x4 output block. * producing an 8x4 output block.
* *
* 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows). * 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
*/ */
@@ -3707,6 +3750,15 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6). * The rotator is c(-6).
*/ */
/* Add range center and fudge factor for final descale and range-limit. */
z2 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z3 = (INT32) wsptr[4];
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
z2 = (INT32) wsptr[2]; z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6]; z3 = (INT32) wsptr[6];
@@ -3714,13 +3766,6 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
/* Add fudge factor here for final descale. */
z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
z3 = (INT32) wsptr[4];
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
tmp10 = tmp0 + tmp2; tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2; tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3; tmp11 = tmp1 + tmp3;
@@ -3790,7 +3835,7 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* /*
* Perform dequantization and inverse DCT on one block of coefficients, * Perform dequantization and inverse DCT on one block of coefficients,
* producing a reduced-size 6x3 output block. * producing a 6x3 output block.
* *
* 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows). * 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).
*/ */
@@ -3852,8 +3897,10 @@ jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[4]; tmp2 = (INT32) wsptr[4];
tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
@@ -3954,8 +4001,8 @@ jpeg_idct_4x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = wsptr[0] + (ONE << 2); tmp0 = wsptr[0] + ((((INT32) RANGE_CENTER) << 3) + (ONE << 2));
tmp2 = wsptr[2]; tmp2 = wsptr[2];
tmp10 = (tmp0 + tmp2) << CONST_BITS; tmp10 = (tmp0 + tmp2) << CONST_BITS;
@@ -4003,11 +4050,11 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col) JSAMPARRAY output_buf, JDIMENSION output_col)
{ {
INT32 tmp0, tmp1; DCTELEM tmp0, tmp1;
ISLOW_MULT_TYPE * quantptr; ISLOW_MULT_TYPE * quantptr;
JSAMPROW outptr; JSAMPROW outptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo); JSAMPLE *range_limit = IDCT_range_limit(cinfo);
SHIFT_TEMPS ISHIFT_TEMPS
/* Pass 1: empty. */ /* Pass 1: empty. */
@@ -4019,8 +4066,8 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]); tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]);
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 += ONE << 2; tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
/* Odd part */ /* Odd part */
@@ -4028,14 +4075,14 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Final output stage */ /* Final output stage */
outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
} }
/* /*
* Perform dequantization and inverse DCT on one block of coefficients, * Perform dequantization and inverse DCT on one block of coefficients,
* producing a 8x16 output block. * producing an 8x16 output block.
* *
* 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows). * 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
*/ */
@@ -4174,6 +4221,15 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6). * The rotator is c(-6).
*/ */
/* Add range center and fudge factor for final descale and range-limit. */
z2 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
z3 = (INT32) wsptr[4];
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
z2 = (INT32) wsptr[2]; z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6]; z3 = (INT32) wsptr[6];
@@ -4181,13 +4237,6 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
/* Add fudge factor here for final descale. */
z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
z3 = (INT32) wsptr[4];
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
tmp10 = tmp0 + tmp2; tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2; tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3; tmp11 = tmp1 + tmp3;
@@ -4377,8 +4426,10 @@ jpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp23 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp23 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp23 <<= CONST_BITS; tmp23 <<= CONST_BITS;
z1 = (INT32) wsptr[2]; z1 = (INT32) wsptr[2];
@@ -4558,8 +4609,10 @@ jpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp10 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp10 <<= CONST_BITS; tmp10 <<= CONST_BITS;
tmp12 = (INT32) wsptr[4]; tmp12 = (INT32) wsptr[4];
tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */ tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */
@@ -4716,8 +4769,10 @@ jpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp12 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp12 <<= CONST_BITS; tmp12 <<= CONST_BITS;
tmp13 = (INT32) wsptr[2]; tmp13 = (INT32) wsptr[2];
tmp14 = (INT32) wsptr[4]; tmp14 = (INT32) wsptr[4];
@@ -4829,13 +4884,6 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6). * The rotator is c(-6).
*/ */
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS; z2 <<= CONST_BITS;
@@ -4846,6 +4894,13 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3; tmp0 = z2 + z3;
tmp1 = z2 - z3; tmp1 = z2 - z3;
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
tmp10 = tmp0 + tmp2; tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2; tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3; tmp11 = tmp1 + tmp3;
@@ -4908,8 +4963,10 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp2 = (INT32) wsptr[2]; tmp2 = (INT32) wsptr[2];
tmp10 = (tmp0 + tmp2) << CONST_BITS; tmp10 = (tmp0 + tmp2) << CONST_BITS;
@@ -4947,7 +5004,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* /*
* Perform dequantization and inverse DCT on one block of coefficients, * Perform dequantization and inverse DCT on one block of coefficients,
* producing a reduced-size 3x6 output block. * producing a 3x6 output block.
* *
* 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows). * 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows).
*/ */
@@ -5021,8 +5078,10 @@ jpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = (INT32) wsptr[0] +
((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
(ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS; tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[2]; tmp2 = (INT32) wsptr[2];
tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
@@ -5117,8 +5176,10 @@ jpeg_idct_2x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp10 = wsptr[0] + (ONE << (CONST_BITS+2)); tmp10 = wsptr[0] +
((((INT32) RANGE_CENTER) << (CONST_BITS+3)) +
(ONE << (CONST_BITS+2)));
/* Odd part */ /* Odd part */
@@ -5148,10 +5209,10 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col) JSAMPARRAY output_buf, JDIMENSION output_col)
{ {
INT32 tmp0, tmp1; DCTELEM tmp0, tmp1;
ISLOW_MULT_TYPE * quantptr; ISLOW_MULT_TYPE * quantptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo); JSAMPLE *range_limit = IDCT_range_limit(cinfo);
SHIFT_TEMPS ISHIFT_TEMPS
/* Process 1 column from input, store into output array. */ /* Process 1 column from input, store into output array. */
@@ -5160,8 +5221,8 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */ /* Even part */
tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
/* Add fudge factor here for final descale. */ /* Add range center and fudge factor for final descale and range-limit. */
tmp0 += ONE << 2; tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
/* Odd part */ /* Odd part */
@@ -5169,10 +5230,10 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Final output stage */ /* Final output stage */
output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) output_buf[0][output_col] =
& RANGE_MASK]; range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) output_buf[1][output_col] =
& RANGE_MASK]; range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
} }
#endif /* IDCT_SCALING_SUPPORTED */ #endif /* IDCT_SCALING_SUPPORTED */

View File

@@ -2,6 +2,7 @@
* jinclude.h * jinclude.h
* *
* Copyright (C) 1991-1994, Thomas G. Lane. * Copyright (C) 1991-1994, Thomas G. Lane.
* Modified 2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -83,9 +84,14 @@
* The modules that use fread() and fwrite() always invoke them through * The modules that use fread() and fwrite() always invoke them through
* these macros. On some systems you may need to twiddle the argument casts. * these macros. On some systems you may need to twiddle the argument casts.
* CAUTION: argument order is different from underlying functions! * CAUTION: argument order is different from underlying functions!
*
* Furthermore, macros are provided for fflush() and ferror() in order
* to facilitate adaption by applications using an own FILE class.
*/ */
#define JFREAD(file,buf,sizeofbuf) \ #define JFREAD(file,buf,sizeofbuf) \
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
#define JFWRITE(file,buf,sizeofbuf) \ #define JFWRITE(file,buf,sizeofbuf) \
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
#define JFFLUSH(file) fflush(file)
#define JFERROR(file) ferror(file)

View File

@@ -2,7 +2,7 @@
* jmemmgr.c * jmemmgr.c
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011-2012 by Guido Vollbeding. * Modified 2011-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -130,7 +130,7 @@ typedef struct {
jvirt_barray_ptr virt_barray_list; jvirt_barray_ptr virt_barray_list;
/* This counts total space obtained from jpeg_get_small/large */ /* This counts total space obtained from jpeg_get_small/large */
long total_space_allocated; size_t total_space_allocated;
/* alloc_sarray and alloc_barray set this value for use by virtual /* alloc_sarray and alloc_barray set this value for use by virtual
* array routines. * array routines.
@@ -195,7 +195,7 @@ print_mem_stats (j_common_ptr cinfo, int pool_id)
* This is helpful because message parm array can't handle longs. * This is helpful because message parm array can't handle longs.
*/ */
fprintf(stderr, "Freeing pool %d, total space = %ld\n", fprintf(stderr, "Freeing pool %d, total space = %ld\n",
pool_id, mem->total_space_allocated); pool_id, (long) mem->total_space_allocated);
for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
lhdr_ptr = lhdr_ptr->hdr.next) { lhdr_ptr = lhdr_ptr->hdr.next) {
@@ -260,11 +260,11 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
{ {
my_mem_ptr mem = (my_mem_ptr) cinfo->mem; my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
small_pool_ptr hdr_ptr, prev_hdr_ptr; small_pool_ptr hdr_ptr, prev_hdr_ptr;
char * data_ptr;
size_t odd_bytes, min_request, slop; size_t odd_bytes, min_request, slop;
char * data_ptr;
/* Check for unsatisfiable request (do now to ensure no overflow below) */ /* Check for unsatisfiable request (do now to ensure no overflow below) */
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) if (sizeofobject > (size_t) MAX_ALLOC_CHUNK - SIZEOF(small_pool_hdr))
out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
@@ -293,8 +293,8 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
else else
slop = extra_pool_slop[pool_id]; slop = extra_pool_slop[pool_id];
/* Don't ask for more than MAX_ALLOC_CHUNK */ /* Don't ask for more than MAX_ALLOC_CHUNK */
if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) if (slop > (size_t) MAX_ALLOC_CHUNK - min_request)
slop = (size_t) (MAX_ALLOC_CHUNK-min_request); slop = (size_t) MAX_ALLOC_CHUNK - min_request;
/* Try to get space, if fail reduce slop and try again */ /* Try to get space, if fail reduce slop and try again */
for (;;) { for (;;) {
hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
@@ -348,7 +348,7 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
size_t odd_bytes; size_t odd_bytes;
/* Check for unsatisfiable request (do now to ensure no overflow below) */ /* Check for unsatisfiable request (do now to ensure no overflow below) */
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) if (sizeofobject > (size_t) MAX_ALLOC_CHUNK - SIZEOF(large_pool_hdr))
out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
@@ -416,15 +416,14 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
/* Get space for row pointers (small object) */ /* Get space for row pointers (small object) */
result = (JSAMPARRAY) alloc_small(cinfo, pool_id, result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
(size_t) (numrows * SIZEOF(JSAMPROW))); (size_t) numrows * SIZEOF(JSAMPROW));
/* Get the rows themselves (large objects) */ /* Get the rows themselves (large objects) */
currow = 0; currow = 0;
while (currow < numrows) { while (currow < numrows) {
rowsperchunk = MIN(rowsperchunk, numrows - currow); rowsperchunk = MIN(rowsperchunk, numrows - currow);
workspace = (JSAMPROW) alloc_large(cinfo, pool_id, workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow (size_t) rowsperchunk * (size_t) samplesperrow * SIZEOF(JSAMPLE));
* SIZEOF(JSAMPLE)));
for (i = rowsperchunk; i > 0; i--) { for (i = rowsperchunk; i > 0; i--) {
result[currow++] = workspace; result[currow++] = workspace;
workspace += samplesperrow; workspace += samplesperrow;
@@ -464,15 +463,14 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
/* Get space for row pointers (small object) */ /* Get space for row pointers (small object) */
result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
(size_t) (numrows * SIZEOF(JBLOCKROW))); (size_t) numrows * SIZEOF(JBLOCKROW));
/* Get the rows themselves (large objects) */ /* Get the rows themselves (large objects) */
currow = 0; currow = 0;
while (currow < numrows) { while (currow < numrows) {
rowsperchunk = MIN(rowsperchunk, numrows - currow); rowsperchunk = MIN(rowsperchunk, numrows - currow);
workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow (size_t) rowsperchunk * (size_t) blocksperrow * SIZEOF(JBLOCK));
* SIZEOF(JBLOCK)));
for (i = rowsperchunk; i > 0; i--) { for (i = rowsperchunk; i > 0; i--) {
result[currow++] = workspace; result[currow++] = workspace;
workspace += blocksperrow; workspace += blocksperrow;
@@ -585,8 +583,8 @@ realize_virt_arrays (j_common_ptr cinfo)
/* Allocate the in-memory buffers for any unrealized virtual arrays */ /* Allocate the in-memory buffers for any unrealized virtual arrays */
{ {
my_mem_ptr mem = (my_mem_ptr) cinfo->mem; my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
long space_per_minheight, maximum_space, avail_mem; long bytesperrow, space_per_minheight, maximum_space;
long minheights, max_minheights; long avail_mem, minheights, max_minheights;
jvirt_sarray_ptr sptr; jvirt_sarray_ptr sptr;
jvirt_barray_ptr bptr; jvirt_barray_ptr bptr;
@@ -598,18 +596,16 @@ realize_virt_arrays (j_common_ptr cinfo)
maximum_space = 0; maximum_space = 0;
for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
if (sptr->mem_buffer == NULL) { /* if not realized yet */ if (sptr->mem_buffer == NULL) { /* if not realized yet */
space_per_minheight += (long) sptr->maxaccess * bytesperrow = (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
(long) sptr->samplesperrow * SIZEOF(JSAMPLE); space_per_minheight += (long) sptr->maxaccess * bytesperrow;
maximum_space += (long) sptr->rows_in_array * maximum_space += (long) sptr->rows_in_array * bytesperrow;
(long) sptr->samplesperrow * SIZEOF(JSAMPLE);
} }
} }
for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
if (bptr->mem_buffer == NULL) { /* if not realized yet */ if (bptr->mem_buffer == NULL) { /* if not realized yet */
space_per_minheight += (long) bptr->maxaccess * bytesperrow = (long) bptr->blocksperrow * SIZEOF(JBLOCK);
(long) bptr->blocksperrow * SIZEOF(JBLOCK); space_per_minheight += (long) bptr->maxaccess * bytesperrow;
maximum_space += (long) bptr->rows_in_array * maximum_space += (long) bptr->rows_in_array * bytesperrow;
(long) bptr->blocksperrow * SIZEOF(JBLOCK);
} }
} }
@@ -618,7 +614,7 @@ realize_virt_arrays (j_common_ptr cinfo)
/* Determine amount of memory to actually use; this is system-dependent. */ /* Determine amount of memory to actually use; this is system-dependent. */
avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space, avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
mem->total_space_allocated); (long) mem->total_space_allocated);
/* If the maximum space needed is available, make all the buffers full /* If the maximum space needed is available, make all the buffers full
* height; otherwise parcel it out with the same number of minheights * height; otherwise parcel it out with the same number of minheights
@@ -694,7 +690,7 @@ do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
long bytesperrow, file_offset, byte_count, rows, thisrow, i; long bytesperrow, file_offset, byte_count, rows, thisrow, i;
bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE); bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
file_offset = ptr->cur_start_row * bytesperrow; file_offset = (long) ptr->cur_start_row * bytesperrow;
/* Loop to read or write each allocation chunk in mem_buffer */ /* Loop to read or write each allocation chunk in mem_buffer */
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
/* One chunk, but check for short chunk at end of buffer */ /* One chunk, but check for short chunk at end of buffer */
@@ -727,7 +723,7 @@ do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
long bytesperrow, file_offset, byte_count, rows, thisrow, i; long bytesperrow, file_offset, byte_count, rows, thisrow, i;
bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK); bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
file_offset = ptr->cur_start_row * bytesperrow; file_offset = (long) ptr->cur_start_row * bytesperrow;
/* Loop to read or write each allocation chunk in mem_buffer */ /* Loop to read or write each allocation chunk in mem_buffer */
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
/* One chunk, but check for short chunk at end of buffer */ /* One chunk, but check for short chunk at end of buffer */

View File

@@ -2,6 +2,7 @@
* jmemnobs.c * jmemnobs.c
* *
* Copyright (C) 1992-1996, Thomas G. Lane. * Copyright (C) 1992-1996, Thomas G. Lane.
* Modified 2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -12,7 +13,7 @@
* This is very portable in the sense that it'll compile on almost anything, * This is very portable in the sense that it'll compile on almost anything,
* but you'd better have lots of main memory (or virtual memory) if you want * but you'd better have lots of main memory (or virtual memory) if you want
* to process big images. * to process big images.
* Note that the max_memory_to_use option is ignored by this implementation. * Note that the max_memory_to_use option is respected by this implementation.
*/ */
#define JPEG_INTERNALS #define JPEG_INTERNALS
@@ -66,13 +67,16 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
/* /*
* This routine computes the total memory space available for allocation. * This routine computes the total memory space available for allocation.
* Here we always say, "we got all you want bud!"
*/ */
GLOBAL(long) GLOBAL(long)
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
long max_bytes_needed, long already_allocated) long max_bytes_needed, long already_allocated)
{ {
if (cinfo->mem->max_memory_to_use)
return cinfo->mem->max_memory_to_use - already_allocated;
/* Here we say, "we got all you want bud!" */
return max_bytes_needed; return max_bytes_needed;
} }

View File

@@ -2,7 +2,7 @@
* jpegint.h * jpegint.h
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2013 by Guido Vollbeding. * Modified 1997-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -260,6 +260,19 @@ struct jpeg_color_quantizer {
}; };
/* Definition of range extension bits for decompression processes.
* See the comments with prepare_range_limit_table (in jdmaster.c)
* for more info.
* The recommended default value for normal applications is 2.
* Applications with special requirements may use a different value.
* For example, Ghostscript wants to use 3 for proper handling of
* wacky images with oversize coefficient values.
*/
#define RANGE_BITS 2
#define RANGE_CENTER (CENTERJSAMPLE << RANGE_BITS)
/* Miscellaneous useful macros */ /* Miscellaneous useful macros */
#undef MAX #undef MAX
@@ -289,6 +302,13 @@ struct jpeg_color_quantizer {
#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) #define RIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif #endif
/* Descale and correctly round an INT32 value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + ((INT32) 1 << ((n)-1)), n)
/* Short forms of external names for systems with brain-damaged linkers. */ /* Short forms of external names for systems with brain-damaged linkers. */

View File

@@ -2,7 +2,7 @@
* jpeglib.h * jpeglib.h
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2013 by Guido Vollbeding. * Modified 2002-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -39,7 +39,7 @@ extern "C" {
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ #define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
#define JPEG_LIB_VERSION_MAJOR 9 #define JPEG_LIB_VERSION_MAJOR 9
#define JPEG_LIB_VERSION_MINOR 1 #define JPEG_LIB_VERSION_MINOR 4
/* Various constants determining the sizes of things. /* Various constants determining the sizes of things.
@@ -411,8 +411,8 @@ struct jpeg_compress_struct {
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ 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 /* The coefficient controller receives data in units of MCU rows as defined
* for fully interleaved scans (whether the JPEG file is interleaved or not). * 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 * There are v_samp_factor * DCT_v_scaled_size sample rows of each component
* "iMCU" (interleaved MCU) row. * in an "iMCU" (interleaved MCU) row.
*/ */
/* /*
@@ -909,6 +909,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
#define jpeg_suppress_tables jSuppressTables #define jpeg_suppress_tables jSuppressTables
#define jpeg_alloc_quant_table jAlcQTable #define jpeg_alloc_quant_table jAlcQTable
#define jpeg_alloc_huff_table jAlcHTable #define jpeg_alloc_huff_table jAlcHTable
#define jpeg_std_huff_table jStdHTable
#define jpeg_start_compress jStrtCompress #define jpeg_start_compress jStrtCompress
#define jpeg_write_scanlines jWrtScanlines #define jpeg_write_scanlines jWrtScanlines
#define jpeg_finish_compress jFinCompress #define jpeg_finish_compress jFinCompress
@@ -977,10 +978,10 @@ EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
/* Data source and destination managers: memory buffers. */ /* Data source and destination managers: memory buffers. */
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
unsigned char ** outbuffer, unsigned char ** outbuffer,
unsigned long * outsize)); size_t * outsize));
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
unsigned char * inbuffer, const unsigned char * inbuffer,
unsigned long insize)); size_t insize));
/* Default parameter setup for compression */ /* Default parameter setup for compression */
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
@@ -1005,6 +1006,8 @@ EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
boolean suppress)); boolean suppress));
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_std_huff_table JPP((j_common_ptr cinfo,
boolean isDC, int tblno));
/* Main entry points for compression */ /* Main entry points for compression */
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,

View File

@@ -1,4 +1,4 @@
.TH JPEGTRAN 1 "13 September 2013" .TH JPEGTRAN 1 "28 August 2019"
.SH NAME .SH NAME
jpegtran \- lossless transformation of JPEG files jpegtran \- lossless transformation of JPEG files
.SH SYNOPSIS .SH SYNOPSIS
@@ -19,6 +19,10 @@ for example from baseline JPEG to progressive JPEG or vice versa. It can also
perform some rearrangements of the image data, for example turning an image perform some rearrangements of the image data, for example turning an image
from landscape to portrait format by rotation. from landscape to portrait format by rotation.
.PP .PP
For EXIF files and JPEG files containing Exif data, you may prefer to use
.B exiftran
instead.
.PP
.B jpegtran .B jpegtran
works by rearranging the compressed data (DCT coefficients), without works by rearranging the compressed data (DCT coefficients), without
ever fully decoding the image. Therefore, its transformations are lossless: ever fully decoding the image. Therefore, its transformations are lossless:
@@ -28,7 +32,11 @@ followed by
.B cjpeg .B cjpeg
to accomplish the same conversion. But by the same token, to accomplish the same conversion. But by the same token,
.B jpegtran .B jpegtran
cannot perform lossy operations such as changing the image quality. cannot perform lossy operations such as changing the image quality. However,
while the image data is losslessly transformed, metadata can be removed. See
the
.B \-copy
option for specifics.
.PP .PP
.B jpegtran .B jpegtran
reads the named JPEG/JFIF file, or the standard input if no file is reads the named JPEG/JFIF file, or the standard input if no file is
@@ -159,13 +167,22 @@ this does not hold for the given crop parameters, we silently move the upper
left corner up and/or left to make it so, simultaneously increasing the left corner up and/or left to make it so, simultaneously increasing the
region dimensions to keep the lower right crop corner unchanged. (Thus, the region dimensions to keep the lower right crop corner unchanged. (Thus, the
output image covers at least the requested region, but may cover more.) output image covers at least the requested region, but may cover more.)
The adjustment of the region dimensions may be optionally disabled. The adjustment of the region dimensions may be optionally disabled by
attaching an 'f' character ("force") to the width or height number.
.PP
The image can be losslessly cropped by giving the switch: The image can be losslessly cropped by giving the switch:
.TP .TP
.B \-crop WxH+X+Y .B \-crop WxH+X+Y
Crop to a rectangular subarea of width W, height H starting at point X,Y. Crop to a rectangular subarea of width W, height H starting at point X,Y.
.PP .PP
Crop extension: The width or height parameters can be made larger than the
source image. In this case the extra area is filled in with zero (neutral
gray). A larger width parameter has two more options: Attaching an 'f'
character ("flatten") to the width number will fill in the extra area with
the DC of the adjacent block, instead of gray out. Attaching an 'r'
character ("reflect") to the width number will fill in the extra area with
repeated reflections of the source region, instead of gray out.
.PP
A complementary lossless-wipe option is provided to discard (gray out) data A complementary lossless-wipe option is provided to discard (gray out) data
inside a given image region while losslessly preserving what is outside: inside a given image region while losslessly preserving what is outside:
.TP .TP
@@ -173,6 +190,23 @@ inside a given image region while losslessly preserving what is outside:
Wipe (gray out) a rectangular subarea of width W, height H starting at point Wipe (gray out) a rectangular subarea of width W, height H starting at point
X,Y. X,Y.
.PP .PP
Attaching an 'f' character ("flatten") to the width number will fill the
region with the average of adjacent blocks, instead of gray out. In case
the wipe region and outside area form two horizontally adjacent rectangles,
attaching an 'r' character ("reflect") to the width number will fill the
region with repeated reflections of the outside area, instead of gray out.
.PP
Another option is lossless-drop, which replaces data at a given image
position by another image:
.TP
.B \-drop +X+Y filename
Drop another image
.PP
Both source images must have the same subsampling values. It is best if
they also have the same quantization, otherwise quantization adaption occurs.
The trim option can be used with the drop option to requantize the drop file
to the source file.
.PP
Other not-strictly-lossless transformation switches are: Other not-strictly-lossless transformation switches are:
.TP .TP
.B \-grayscale .B \-grayscale
@@ -206,16 +240,17 @@ such as comment blocks:
.TP .TP
.B \-copy none .B \-copy none
Copy no extra markers from source file. This setting suppresses all Copy no extra markers from source file. This setting suppresses all
comments and other excess baggage present in the source file. comments and other metadata in the source file.
.TP .TP
.B \-copy comments .B \-copy comments
Copy only comment markers. This setting copies comments from the source file, Copy only comment markers. This setting copies comments from the source file,
but discards any other inessential (for image display) data. but discards any other metadata.
.TP .TP
.B \-copy all .B \-copy all
Copy all extra markers. This setting preserves miscellaneous markers Copy all extra markers. This setting preserves metadata
found in the source file, such as JFIF thumbnails, Exif data, and Photoshop found in the source file, such as JFIF thumbnails, Exif data, and Photoshop
settings. In some files these extra markers can be sizable. settings. In some files these extra markers can be sizable. Note that this
option will copy thumbnails as-is; they will not be transformed.
.IP .IP
The default behavior is The default behavior is
.BR "\-copy comments" . .BR "\-copy comments" .

View File

@@ -1,7 +1,7 @@
/* /*
* jpegtran.c * jpegtran.c
* *
* Copyright (C) 1995-2013, Thomas G. Lane, Guido Vollbeding. * Copyright (C) 1995-2019, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -37,6 +37,7 @@
static const char * progname; /* program name for error messages */ static const char * progname; /* program name for error messages */
static char * outfilename; /* for -outfile switch */ static char * outfilename; /* for -outfile switch */
static char * dropfilename; /* for -drop switch */
static char * scaleoption; /* -scale switch */ static char * scaleoption; /* -scale switch */
static JCOPY_OPTION copyoption; /* -copy switch */ static JCOPY_OPTION copyoption; /* -copy switch */
static jpeg_transform_info transformoption; /* image transformation options */ static jpeg_transform_info transformoption; /* image transformation options */
@@ -66,6 +67,7 @@ usage (void)
fprintf(stderr, "Switches for modifying the image:\n"); fprintf(stderr, "Switches for modifying the image:\n");
#if TRANSFORMS_SUPPORTED #if TRANSFORMS_SUPPORTED
fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n"); fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n");
fprintf(stderr, " -drop +X+Y filename Drop another image\n");
fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n"); fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n");
fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n");
fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n"); fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n");
@@ -76,6 +78,7 @@ usage (void)
fprintf(stderr, " -transpose Transpose image\n"); fprintf(stderr, " -transpose Transpose image\n");
fprintf(stderr, " -transverse Transverse transpose image\n"); fprintf(stderr, " -transverse Transverse transpose image\n");
fprintf(stderr, " -trim Drop non-transformable edge blocks\n"); fprintf(stderr, " -trim Drop non-transformable edge blocks\n");
fprintf(stderr, " with -drop: Requantize drop file to source file\n");
fprintf(stderr, " -wipe WxH+X+Y Wipe (gray out) a rectangular subarea\n"); fprintf(stderr, " -wipe WxH+X+Y Wipe (gray out) a rectangular subarea\n");
#endif #endif
fprintf(stderr, "Switches for advanced users:\n"); fprintf(stderr, "Switches for advanced users:\n");
@@ -188,7 +191,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
#if TRANSFORMS_SUPPORTED #if TRANSFORMS_SUPPORTED
if (++argn >= argc) /* advance to next argument */ if (++argn >= argc) /* advance to next argument */
usage(); usage();
if (transformoption.crop /* reject multiple crop/wipe requests */ || if (transformoption.crop /* reject multiple crop/drop/wipe requests */ ||
! jtransform_parse_crop_spec(&transformoption, argv[argn])) { ! jtransform_parse_crop_spec(&transformoption, argv[argn])) {
fprintf(stderr, "%s: bogus -crop argument '%s'\n", fprintf(stderr, "%s: bogus -crop argument '%s'\n",
progname, argv[argn]); progname, argv[argn]);
@@ -198,6 +201,26 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
select_transform(JXFORM_NONE); /* force an error */ select_transform(JXFORM_NONE); /* force an error */
#endif #endif
} else if (keymatch(arg, "drop", 2)) {
#if TRANSFORMS_SUPPORTED
if (++argn >= argc) /* advance to next argument */
usage();
if (transformoption.crop /* reject multiple crop/drop/wipe requests */ ||
! jtransform_parse_crop_spec(&transformoption, argv[argn]) ||
transformoption.crop_width_set != JCROP_UNSET ||
transformoption.crop_height_set != JCROP_UNSET) {
fprintf(stderr, "%s: bogus -drop argument '%s'\n",
progname, argv[argn]);
exit(EXIT_FAILURE);
}
if (++argn >= argc) /* advance to next argument */
usage();
dropfilename = argv[argn];
select_transform(JXFORM_DROP);
#else
select_transform(JXFORM_NONE); /* force an error */
#endif
} else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
/* Enable debug printouts. */ /* Enable debug printouts. */
/* On first -d, print version identification */ /* On first -d, print version identification */
@@ -342,7 +365,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
#if TRANSFORMS_SUPPORTED #if TRANSFORMS_SUPPORTED
if (++argn >= argc) /* advance to next argument */ if (++argn >= argc) /* advance to next argument */
usage(); usage();
if (transformoption.crop /* reject multiple crop/wipe requests */ || if (transformoption.crop /* reject multiple crop/drop/wipe requests */ ||
! jtransform_parse_crop_spec(&transformoption, argv[argn])) { ! jtransform_parse_crop_spec(&transformoption, argv[argn])) {
fprintf(stderr, "%s: bogus -wipe argument '%s'\n", fprintf(stderr, "%s: bogus -wipe argument '%s'\n",
progname, argv[argn]); progname, argv[argn]);
@@ -386,8 +409,14 @@ int
main (int argc, char **argv) main (int argc, char **argv)
{ {
struct jpeg_decompress_struct srcinfo; struct jpeg_decompress_struct srcinfo;
struct jpeg_error_mgr jsrcerr;
#if TRANSFORMS_SUPPORTED
struct jpeg_decompress_struct dropinfo;
struct jpeg_error_mgr jdroperr;
FILE * drop_file;
#endif
struct jpeg_compress_struct dstinfo; struct jpeg_compress_struct dstinfo;
struct jpeg_error_mgr jsrcerr, jdsterr; struct jpeg_error_mgr jdsterr;
#ifdef PROGRESS_REPORT #ifdef PROGRESS_REPORT
struct cdjpeg_progress_mgr progress; struct cdjpeg_progress_mgr progress;
#endif #endif
@@ -427,7 +456,7 @@ main (int argc, char **argv)
* values read here are mostly ignored; we will rescan the switches after * values read here are mostly ignored; we will rescan the switches after
* opening the input file. Also note that most of the switches affect the * opening the input file. Also note that most of the switches affect the
* destination JPEG object, so we parse into that and then copy over what * destination JPEG object, so we parse into that and then copy over what
* needs to affects the source too. * needs to affect the source too.
*/ */
file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE); file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);
@@ -469,6 +498,21 @@ main (int argc, char **argv)
fp = read_stdin(); fp = read_stdin();
} }
#if TRANSFORMS_SUPPORTED
/* Open the drop file. */
if (dropfilename != NULL) {
if ((drop_file = fopen(dropfilename, READ_BINARY)) == NULL) {
fprintf(stderr, "%s: can't open %s for reading\n", progname, dropfilename);
exit(EXIT_FAILURE);
}
dropinfo.err = jpeg_std_error(&jdroperr);
jpeg_create_decompress(&dropinfo);
jpeg_stdio_src(&dropinfo, drop_file);
} else {
drop_file = NULL;
}
#endif
#ifdef PROGRESS_REPORT #ifdef PROGRESS_REPORT
start_progress_monitor((j_common_ptr) &dstinfo, &progress); start_progress_monitor((j_common_ptr) &dstinfo, &progress);
#endif #endif
@@ -488,6 +532,17 @@ main (int argc, char **argv)
&srcinfo.scale_num, &srcinfo.scale_denom) < 1) &srcinfo.scale_num, &srcinfo.scale_denom) < 1)
usage(); usage();
#if TRANSFORMS_SUPPORTED
if (dropfilename != NULL) {
(void) jpeg_read_header(&dropinfo, TRUE);
transformoption.crop_width = dropinfo.image_width;
transformoption.crop_width_set = JCROP_POS;
transformoption.crop_height = dropinfo.image_height;
transformoption.crop_height_set = JCROP_POS;
transformoption.drop_ptr = &dropinfo;
}
#endif
/* Any space needed by a transform option must be requested before /* Any space needed by a transform option must be requested before
* jpeg_read_coefficients so that memory allocation will be done right. * jpeg_read_coefficients so that memory allocation will be done right.
*/ */
@@ -503,6 +558,12 @@ main (int argc, char **argv)
/* Read source file as DCT coefficients */ /* Read source file as DCT coefficients */
src_coef_arrays = jpeg_read_coefficients(&srcinfo); src_coef_arrays = jpeg_read_coefficients(&srcinfo);
#if TRANSFORMS_SUPPORTED
if (dropfilename != NULL) {
transformoption.drop_coef_arrays = jpeg_read_coefficients(&dropinfo);
}
#endif
/* Initialize destination compression parameters from source values */ /* Initialize destination compression parameters from source values */
jpeg_copy_critical_parameters(&srcinfo, &dstinfo); jpeg_copy_critical_parameters(&srcinfo, &dstinfo);
@@ -560,18 +621,34 @@ main (int argc, char **argv)
/* Finish compression and release memory */ /* Finish compression and release memory */
jpeg_finish_compress(&dstinfo); jpeg_finish_compress(&dstinfo);
jpeg_destroy_compress(&dstinfo); jpeg_destroy_compress(&dstinfo);
#if TRANSFORMS_SUPPORTED
if (dropfilename != NULL) {
(void) jpeg_finish_decompress(&dropinfo);
jpeg_destroy_decompress(&dropinfo);
}
#endif
(void) jpeg_finish_decompress(&srcinfo); (void) jpeg_finish_decompress(&srcinfo);
jpeg_destroy_decompress(&srcinfo); jpeg_destroy_decompress(&srcinfo);
/* Close output file, if we opened it */ /* Close output file, if we opened it */
if (fp != stdout) if (fp != stdout)
fclose(fp); fclose(fp);
#if TRANSFORMS_SUPPORTED
if (drop_file != NULL)
fclose(drop_file);
#endif
#ifdef PROGRESS_REPORT #ifdef PROGRESS_REPORT
end_progress_monitor((j_common_ptr) &dstinfo); end_progress_monitor((j_common_ptr) &dstinfo);
#endif #endif
/* All done. */ /* All done. */
exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS); #if TRANSFORMS_SUPPORTED
if (dropfilename != NULL)
exit(jsrcerr.num_warnings + jdroperr.num_warnings +
jdsterr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
#endif
exit(jsrcerr.num_warnings + jdsterr.num_warnings ?
EXIT_WARNING : EXIT_SUCCESS);
return 0; /* suppress no-return-value warnings */ return 0; /* suppress no-return-value warnings */
} }

View File

@@ -2,7 +2,7 @@
* jutils.c * jutils.c
* *
* Copyright (C) 1991-1996, Thomas G. Lane. * Copyright (C) 1991-1996, Thomas G. Lane.
* Modified 2009-2011 by Guido Vollbeding. * Modified 2009-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -185,7 +185,7 @@ jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
{ {
register JSAMPROW inptr, outptr; register JSAMPROW inptr, outptr;
#ifdef FMEMCOPY #ifdef FMEMCOPY
register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); register size_t count = (size_t) num_cols * SIZEOF(JSAMPLE);
#else #else
register JDIMENSION count; register JDIMENSION count;
#endif #endif
@@ -213,7 +213,7 @@ jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
/* Copy a row of coefficient blocks from one place to another. */ /* Copy a row of coefficient blocks from one place to another. */
{ {
#ifdef FMEMCOPY #ifdef FMEMCOPY
FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); FMEMCOPY(output_row, input_row, (size_t) num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
#else #else
register JCOEFPTR inptr, outptr; register JCOEFPTR inptr, outptr;
register long count; register long count;

View File

@@ -1,7 +1,7 @@
/* /*
* jversion.h * jversion.h
* *
* Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
@@ -9,6 +9,6 @@
*/ */
#define JVERSION "9a 19-Jan-2014" #define JVERSION "9d 12-Jan-2020"
#define JCOPYRIGHT "Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding" #define JCOPYRIGHT "Copyright (C) 2020, Thomas G. Lane, Guido Vollbeding"

10
libjpeg.pc.in Normal file
View File

@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libjpeg
Description: Reads and writes JPEG files
Version: @JPEG_LIB_VERSION_MAJOR@.@JPEG_LIB_VERSION_MINOR@.0
Libs: -L${libdir} -ljpeg
Cflags: -I${includedir}

View File

@@ -1,6 +1,6 @@
USING THE IJG JPEG LIBRARY USING THE IJG JPEG LIBRARY
Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding. Copyright (C) 1994-2019, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software. This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file. For conditions of distribution and use, see the accompanying README file.
@@ -2591,8 +2591,8 @@ different sizes. If the image dimensions are not a multiple of the MCU size,
you must also pad the data correctly (usually, this is done by replicating you must also pad the data correctly (usually, this is done by replicating
the last column and/or row). The data must be padded to a multiple of a DCT the last column and/or row). The data must be padded to a multiple of a DCT
block in each component: that is, each downsampled row must contain a block in each component: that is, each downsampled row must contain a
multiple of block_size valid samples, and there must be a multiple of multiple of DCT_h_scaled_size valid samples, and there must be a multiple of
block_size sample rows for each component. (For applications such as DCT_v_scaled_size sample rows for each component. (For applications such as
conversion of digital TV images, the standard image size is usually a conversion of digital TV images, the standard image size is usually a
multiple of the DCT block size, so that no padding need actually be done.) multiple of the DCT block size, so that no padding need actually be done.)
@@ -2602,8 +2602,6 @@ jpeg_write_scanlines(). Before calling jpeg_start_compress(), you must do
the following: the following:
* Set cinfo->raw_data_in to TRUE. (It is set FALSE by jpeg_set_defaults().) * Set cinfo->raw_data_in to TRUE. (It is set FALSE by jpeg_set_defaults().)
This notifies the library that you will be supplying raw data. This notifies the library that you will be supplying raw data.
Furthermore, set cinfo->do_fancy_downsampling to FALSE if you want to use
real downsampled data. (It is set TRUE by jpeg_set_defaults().)
* Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace() * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace()
call is a good idea. Note that since color conversion is bypassed, call is a good idea. Note that since color conversion is bypassed,
in_color_space is ignored, except that jpeg_set_defaults() uses it to in_color_space is ignored, except that jpeg_set_defaults() uses it to
@@ -2620,23 +2618,25 @@ The scanlines count passed to and returned from jpeg_write_raw_data is
measured in terms of the component with the largest v_samp_factor. measured in terms of the component with the largest v_samp_factor.
jpeg_write_raw_data() processes one MCU row per call, which is to say jpeg_write_raw_data() processes one MCU row per call, which is to say
v_samp_factor*block_size sample rows of each component. The passed num_lines v_samp_factor*min_DCT_v_scaled_size sample rows of each component. The passed
value must be at least max_v_samp_factor*block_size, and the return value num_lines value must be at least max_v_samp_factor*min_DCT_v_scaled_size, and
will be exactly that amount (or possibly some multiple of that amount, in the return value will be exactly that amount (or possibly some multiple of
future library versions). This is true even on the last call at the bottom that amount, in future library versions). This is true even on the last call
of the image; don't forget to pad your data as necessary. at the bottom of the image; don't forget to pad your data as necessary.
The required dimensions of the supplied data can be computed for each The required dimensions of the supplied data can be computed for each
component as component as
cinfo->comp_info[i].width_in_blocks*block_size samples per row cinfo->comp_info[i].width_in_blocks *
cinfo->comp_info[i].height_in_blocks*block_size rows in image cinfo->comp_info[i].DCT_h_scaled_size samples per row
cinfo->comp_info[i].height_in_blocks *
cinfo->comp_info[i].DCT_v_scaled_size rows in image
after jpeg_start_compress() has initialized those fields. If the valid data after jpeg_start_compress() has initialized those fields. If the valid data
is smaller than this, it must be padded appropriately. For some sampling is smaller than this, it must be padded appropriately. For some sampling
factors and image sizes, additional dummy DCT blocks are inserted to make factors and image sizes, additional dummy DCT blocks are inserted to make
the image a multiple of the MCU dimensions. The library creates such dummy the image a multiple of the MCU dimensions. The library creates such dummy
blocks itself; it does not read them from your supplied data. Therefore you blocks itself; it does not read them from your supplied data. Therefore you
need never pad by more than block_size samples. An example may help here. need never pad by more than DCT_scaled_size samples.
Assume 2h2v downsampling of YCbCr data, that is An example may help here. Assume 2h2v downsampling of YCbCr data, that is
cinfo->comp_info[0].h_samp_factor = 2 for Y cinfo->comp_info[0].h_samp_factor = 2 for Y
cinfo->comp_info[0].v_samp_factor = 2 cinfo->comp_info[0].v_samp_factor = 2
cinfo->comp_info[1].h_samp_factor = 1 for Cb cinfo->comp_info[1].h_samp_factor = 1 for Cb
@@ -2662,27 +2662,26 @@ destination module suspends, jpeg_write_raw_data() will return 0.
In this case the same data rows must be passed again on the next call. In this case the same data rows must be passed again on the next call.
Decompression with raw data output implies bypassing all postprocessing. Decompression with raw data output implies bypassing all postprocessing:
You must deal with the color space and sampling factors present in the you cannot ask for color quantization, for instance. More seriously, you
incoming file. If your application only handles, say, 2h1v YCbCr data, must deal with the color space and sampling factors present in the incoming
you must check for and fail on other color spaces or other sampling factors. file. If your application only handles, say, 2h1v YCbCr data, you must
check for and fail on other color spaces or other sampling factors.
The library will not convert to a different color space for you. The library will not convert to a different color space for you.
To obtain raw data output, set cinfo->raw_data_out = TRUE before To obtain raw data output, set cinfo->raw_data_out = TRUE before
jpeg_start_decompress() (it is set FALSE by jpeg_read_header()). Be sure to jpeg_start_decompress() (it is set FALSE by jpeg_read_header()). Be sure to
verify that the color space and sampling factors are ones you can handle. verify that the color space and sampling factors are ones you can handle.
Furthermore, set cinfo->do_fancy_upsampling = FALSE if you want to get real
downsampled data (it is set TRUE by jpeg_read_header()).
Then call jpeg_read_raw_data() in place of jpeg_read_scanlines(). The Then call jpeg_read_raw_data() in place of jpeg_read_scanlines(). The
decompression process is otherwise the same as usual. decompression process is otherwise the same as usual.
jpeg_read_raw_data() returns one MCU row per call, and thus you must pass a jpeg_read_raw_data() returns one MCU row per call, and thus you must pass a
buffer of at least max_v_samp_factor*block_size scanlines (scanline counting buffer of at least max_v_samp_factor*min_DCT_v_scaled_size scanlines (scanline
is the same as for raw-data compression). The buffer you pass must be large counting is the same as for raw-data compression). The buffer you pass must
enough to hold the actual data plus padding to DCT-block boundaries. As with be large enough to hold the actual data plus padding to DCT-block boundaries.
compression, any entirely dummy DCT blocks are not processed so you need not As with compression, any entirely dummy DCT blocks are not processed so you
allocate space for them, but the total scanline count includes them. The need not allocate space for them, but the total scanline count includes them.
above example of computing buffer dimensions for raw-data compression is The above example of computing buffer dimensions for raw-data compression is
equally valid for decompression. equally valid for decompression.
Input suspension is supported with raw-data decompression: if the data source Input suspension is supported with raw-data decompression: if the data source

5002
ltmain.sh

File diff suppressed because it is too large Load Diff

33
makeasln.v15 Normal file
View File

@@ -0,0 +1,33 @@
<EFBFBD><EFBFBD><EFBFBD>
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cjpeg", "cjpeg.vcxproj", "{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "djpeg", "djpeg.vcxproj", "{11043137-B453-4DFA-9010-4D2B9DC1545C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpegtran", "jpegtran.vcxproj", "{025BAC50-51B5-4FFE-BC47-3F920BB4047E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdjpgcom", "rdjpgcom.vcxproj", "{C81513DB-78DC-46BC-BC98-82E745203976}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrjpgcom", "wrjpgcom.vcxproj", "{B57065D4-DDDA-4668-BAF5-2D49270C973C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

49
makeasln.v16 Normal file
View File

@@ -0,0 +1,49 @@
<EFBFBD><EFBFBD><EFBFBD>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.329
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cjpeg", "cjpeg.vcxproj", "{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "djpeg", "djpeg.vcxproj", "{11043137-B453-4DFA-9010-4D2B9DC1545C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpegtran", "jpegtran.vcxproj", "{025BAC50-51B5-4FFE-BC47-3F920BB4047E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdjpgcom", "rdjpgcom.vcxproj", "{C81513DB-78DC-46BC-BC98-82E745203976}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrjpgcom", "wrjpgcom.vcxproj", "{B57065D4-DDDA-4668-BAF5-2D49270C973C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|x64.ActiveCfg = Release|x64
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|x64.Build.0 = Release|x64
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|x64.ActiveCfg = Release|x64
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|x64.Build.0 = Release|x64
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|x64.ActiveCfg = Release|x64
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|x64.Build.0 = Release|x64
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|x64.ActiveCfg = Release|x64
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|x64.Build.0 = Release|x64
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|x64.ActiveCfg = Release|x64
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2F6B4B1E-5D02-475F-B2FE-EA2D9E697E54}
EndGlobalSection
EndGlobal

View File

@@ -33,8 +33,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ".\cjpeg" # PROP BASE Target_Dir ".\cjpeg"
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\cjpeg\Release" # PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\cjpeg\Release" # PROP Intermediate_Dir ".\Release\cjpeg"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir ".\cjpeg" # PROP Target_Dir ".\cjpeg"
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c

69
makecfil.v15 Normal file
View File

@@ -0,0 +1,69 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cderror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdjpeg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdbmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdgif.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdppm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdrle.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdswitch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdtarga.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

69
makecfil.v16 Normal file
View File

@@ -0,0 +1,69 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cderror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdjpeg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdbmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdgif.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdppm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdrle.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdswitch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdtarga.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

78
makecvcx.v15 Normal file
View File

@@ -0,0 +1,78 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cjpeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="cderror.h" />
<ClInclude Include="cdjpeg.h" />
<ClInclude Include="jconfig.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c" />
<ClCompile Include="cjpeg.c" />
<ClCompile Include="rdbmp.c" />
<ClCompile Include="rdgif.c" />
<ClCompile Include="rdppm.c" />
<ClCompile Include="rdrle.c" />
<ClCompile Include="rdswitch.c" />
<ClCompile Include="rdtarga.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

117
makecvcx.v16 Normal file
View File

@@ -0,0 +1,117 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cjpeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="cderror.h" />
<ClInclude Include="cdjpeg.h" />
<ClInclude Include="jconfig.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c" />
<ClCompile Include="cjpeg.c" />
<ClCompile Include="rdbmp.c" />
<ClCompile Include="rdgif.c" />
<ClCompile Include="rdppm.c" />
<ClCompile Include="rdrle.c" />
<ClCompile Include="rdswitch.c" />
<ClCompile Include="rdtarga.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -33,8 +33,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ".\djpeg" # PROP BASE Target_Dir ".\djpeg"
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\djpeg\Release" # PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\djpeg\Release" # PROP Intermediate_Dir ".\Release\djpeg"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir ".\djpeg" # PROP Target_Dir ".\djpeg"
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c

69
makedfil.v15 Normal file
View File

@@ -0,0 +1,69 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cderror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdjpeg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="djpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdcolmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrbmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrgif.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrppm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrrle.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrtarga.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

69
makedfil.v16 Normal file
View File

@@ -0,0 +1,69 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cderror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdjpeg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="djpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdcolmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrbmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrgif.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrppm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrrle.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wrtarga.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

78
makedvcx.v15 Normal file
View File

@@ -0,0 +1,78 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{11043137-B453-4DFA-9010-4D2B9DC1545C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>djpeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="cderror.h" />
<ClInclude Include="cdjpeg.h" />
<ClInclude Include="jconfig.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c" />
<ClCompile Include="djpeg.c" />
<ClCompile Include="rdcolmap.c" />
<ClCompile Include="wrbmp.c" />
<ClCompile Include="wrgif.c" />
<ClCompile Include="wrppm.c" />
<ClCompile Include="wrrle.c" />
<ClCompile Include="wrtarga.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

117
makedvcx.v16 Normal file
View File

@@ -0,0 +1,117 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{11043137-B453-4DFA-9010-4D2B9DC1545C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>djpeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="cderror.h" />
<ClInclude Include="cdjpeg.h" />
<ClInclude Include="jconfig.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c" />
<ClCompile Include="djpeg.c" />
<ClCompile Include="rdcolmap.c" />
<ClCompile Include="wrbmp.c" />
<ClCompile Include="wrgif.c" />
<ClCompile Include="wrppm.c" />
<ClCompile Include="wrrle.c" />
<ClCompile Include="wrtarga.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -60,25 +60,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -137,12 +137,14 @@ clean:
test: cjpeg djpeg jpegtran test: cjpeg djpeg jpegtran
$(RM) testout* $(RM) testout*
./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
./djpeg -dct int -gif -outfile testout.gif testorig.jpg
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
./cjpeg -dct int -outfile testout.jpg testimg.ppm ./cjpeg -dct int -outfile testout.jpg testimg.ppm
./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
./jpegtran -outfile testoutt.jpg testprog.jpg ./jpegtran -outfile testoutt.jpg testprog.jpg
cmp testimg.ppm testout.ppm cmp testimg.ppm testout.ppm
cmp testimg.gif testout.gif
cmp testimg.bmp testout.bmp cmp testimg.bmp testout.bmp
cmp testimg.jpg testout.jpg cmp testimg.jpg testout.jpg
cmp testimg.ppm testoutp.ppm cmp testimg.ppm testoutp.ppm

245
makefile.b32 Normal file
View File

@@ -0,0 +1,245 @@
# Makefile for Independent JPEG Group's software
# This makefile is suitable for Borland C on MS-DOS.
# It works with Borland C++ 32-bit for DOS, revision 5.0 or later.
# Thanks to Tom Wright and Ge' Weijers (original DOS) and
# Joe Slater for adding 32-bit additions (needed for Borland
# revision 5.5).
# Read installation instructions before saying "make" !!
# The name of your C compiler:
CC= bcc32
# You may need to adjust these cc options:
CFLAGS= -O2 -w-par -w-stu -w-ccc -w-rch -w-aus
# -w-par suppresses warnings about unused function parameters
# -w-stu suppresses warnings about incomplete structures
# -w-ccc suppresses warnings about compile-time-constant conditions
# -w-rch suppresses warnings about unreachable code
# Generally, we recommend defining any configuration symbols in jconfig.h,
# NOT via -D switches here.
# Link-time cc options:
LDFLAGS=
# -lc case-significant link
# Put here the object file name for the correct system-dependent memory
# manager file.
# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
SYSDEPMEM= jmemnobs.obj
SYSDEPMEMLIB= +jmemnobs.obj
# End of configurable options.
# source files: JPEG library proper
LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
jquant2.c jutils.c jmemmgr.c
# memmgr back ends: compile only one of these into a working library
SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
# files included by source files
INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
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.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression
COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
# compression library object files
CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
# decompression library object files
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
jdmerge.obj
# These objectfiles are included in libjpeg.lib
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
# object files for sample applications (excluding library files)
COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
rdswitch.obj cdjpeg.obj
DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
rdcolmap.obj cdjpeg.obj
TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
libjpeg.lib: $(LIBOBJECTS)
- del libjpeg.lib
tlib libjpeg.lib /E /C @&&|
+jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj +jcparam.obj &
+jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj &
+jcprepct.obj +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj &
+jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj &
+jdapistd.obj +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj &
+jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj +jdcoefct.obj &
+jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj &
+jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj +jdmerge.obj &
+jaricom.obj +jcomapi.obj +jutils.obj +jerror.obj +jmemmgr.obj &
$(SYSDEPMEMLIB)
|
cjpeg.exe: $(COBJECTS) libjpeg.lib
$(CC) $(LDFLAGS) -ecjpeg.exe $(COBJECTS) libjpeg.lib
djpeg.exe: $(DOBJECTS) libjpeg.lib
$(CC) $(LDFLAGS) -edjpeg.exe $(DOBJECTS) libjpeg.lib
jpegtran.exe: $(TROBJECTS) libjpeg.lib
$(CC) $(LDFLAGS) -ejpegtran.exe $(TROBJECTS) libjpeg.lib
rdjpgcom.exe: rdjpgcom.c
$(CC) $(CFLAGS) rdjpgcom.c
wrjpgcom.exe: wrjpgcom.c
$(CC) $(CFLAGS) wrjpgcom.c
# This "{}" syntax allows Borland Make to "batch" source files.
# In this way, each run of the compiler can build many modules.
.c.obj:
$(CC) $(CFLAGS) -c{ $<}
jconfig.h: jconfig.txt
echo You must prepare a system-dependent jconfig.h file.
echo Please read the installation directions in install.txt.
exit 1
clean:
- del *.obj
- del libjpeg.lib
- del cjpeg.exe
- del djpeg.exe
- del jpegtran.exe
- del rdjpgcom.exe
- del wrjpgcom.exe
- del testout*.*
test: cjpeg.exe djpeg.exe jpegtran.exe
- del testout*.*
djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
djpeg -dct int -gif -outfile testout.gif testorig.jpg
djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
cjpeg -dct int -outfile testout.jpg testimg.ppm
djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
jpegtran -outfile testoutt.jpg testprog.jpg
echo n > n.tmp
comp testimg.ppm testout.ppm < n.tmp
comp testimg.gif testout.gif < n.tmp
comp testimg.bmp testout.bmp < n.tmp
comp testimg.jpg testout.jpg < n.tmp
comp testimg.ppm testoutp.ppm < n.tmp
comp testimgp.jpg testoutp.jpg < n.tmp
comp testorig.jpg testoutt.jpg < n.tmp
del n.tmp
jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
jmemdosa.obj: jmemdosa.asm
tasm /mx jmemdosa.asm

View File

@@ -87,25 +87,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -195,6 +195,7 @@ clean:
test: cjpeg.exe djpeg.exe jpegtran.exe test: cjpeg.exe djpeg.exe jpegtran.exe
- del testout*.* - del testout*.*
djpeg -dct int -ppm -outfile testout.ppm testorig.jpg djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
djpeg -dct int -gif -outfile testout.gif testorig.jpg
djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
cjpeg -dct int -outfile testout.jpg testimg.ppm cjpeg -dct int -outfile testout.jpg testimg.ppm
djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
@@ -202,6 +203,7 @@ test: cjpeg.exe djpeg.exe jpegtran.exe
jpegtran -outfile testoutt.jpg testprog.jpg jpegtran -outfile testoutt.jpg testprog.jpg
!if $d(DOS) !if $d(DOS)
fc /b testimg.ppm testout.ppm fc /b testimg.ppm testout.ppm
fc /b testimg.gif testout.gif
fc /b testimg.bmp testout.bmp fc /b testimg.bmp testout.bmp
fc /b testimg.jpg testout.jpg fc /b testimg.jpg testout.jpg
fc /b testimg.ppm testoutp.ppm fc /b testimg.ppm testoutp.ppm
@@ -210,6 +212,7 @@ test: cjpeg.exe djpeg.exe jpegtran.exe
!else !else
echo n > n.tmp echo n > n.tmp
comp testimg.ppm testout.ppm < n.tmp comp testimg.ppm testout.ppm < n.tmp
comp testimg.gif testout.gif < n.tmp
comp testimg.bmp testout.bmp < n.tmp comp testimg.bmp testout.bmp < n.tmp
comp testimg.jpg testout.jpg < n.tmp comp testimg.jpg testout.jpg < n.tmp
comp testimg.ppm testoutp.ppm < n.tmp comp testimg.ppm testoutp.ppm < n.tmp

View File

@@ -60,25 +60,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -143,12 +143,14 @@ clean:
test: cjpeg.exe djpeg.exe jpegtran.exe test: cjpeg.exe djpeg.exe jpegtran.exe
$(RM) testout*.* $(RM) testout*.*
./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
./djpeg -dct int -gif -outfile testout.gif testorig.jpg
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
./cjpeg -dct int -outfile testout.jpg testimg.ppm ./cjpeg -dct int -outfile testout.jpg testimg.ppm
./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
./jpegtran -outfile testoutt.jpg testprog.jpg ./jpegtran -outfile testoutt.jpg testprog.jpg
fc /b testimg.ppm testout.ppm fc /b testimg.ppm testout.ppm
fc /b testimg.gif testout.gif
fc /b testimg.bmp testout.bmp fc /b testimg.bmp testout.bmp
fc /b testimg.jpg testout.jpg fc /b testimg.jpg testout.jpg
fc /b testimg.ppm testoutp.ppm fc /b testimg.ppm testoutp.ppm

View File

@@ -61,25 +61,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -137,12 +137,14 @@ clean:
test: cjpeg djpeg jpegtran test: cjpeg djpeg jpegtran
-$(RM) testout*.* -$(RM) testout*.*
djpeg -dct int -ppm -outfile testout.ppm testorig.jpg djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
djpeg -dct int -gif -outfile testout.gif testorig.jpg
djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
cjpeg -dct int -outfile testout.jpg testimg.ppm cjpeg -dct int -outfile testout.jpg testimg.ppm
djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
jpegtran -outfile testoutt.jpg testprog.jpg jpegtran -outfile testoutt.jpg testprog.jpg
cmp testimg.ppm testout.ppm cmp testimg.ppm testout.ppm
cmp testimg.gif testout.gif
cmp testimg.bmp testout.bmp cmp testimg.bmp testout.bmp
cmp testimg.jpg testout.jpg cmp testimg.jpg testout.jpg
cmp testimg.ppm testoutp.ppm cmp testimg.ppm testoutp.ppm

View File

@@ -58,25 +58,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -170,12 +170,14 @@ clean:
test: cjpeg.exe djpeg.exe jpegtran.exe test: cjpeg.exe djpeg.exe jpegtran.exe
del testout*.* del testout*.*
djpeg -dct int -ppm -outfile testout.ppm testorig.jpg djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
djpeg -dct int -gif -outfile testout.gif testorig.jpg
djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
cjpeg -dct int -outfile testout.jpg testimg.ppm cjpeg -dct int -outfile testout.jpg testimg.ppm
djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
jpegtran -outfile testoutt.jpg testprog.jpg jpegtran -outfile testoutt.jpg testprog.jpg
fc /b testimg.ppm testout.ppm fc /b testimg.ppm testout.ppm
fc /b testimg.gif testout.gif
fc /b testimg.bmp testout.bmp fc /b testimg.bmp testout.bmp
fc /b testimg.jpg testout.jpg fc /b testimg.jpg testout.jpg
fc /b testimg.ppm testoutp.ppm fc /b testimg.ppm testoutp.ppm

View File

@@ -47,25 +47,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -141,12 +141,14 @@ clean :
test : cjpeg.exe djpeg.exe jpegtran.exe test : cjpeg.exe djpeg.exe jpegtran.exe
mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
mcr sys$disk:[]djpeg -dct int -gif -outfile testout.gif testorig.jpg
mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm
mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg
- Backup /Compare/Log testimg.ppm testout.ppm - Backup /Compare/Log testimg.ppm testout.ppm
- Backup /Compare/Log testimg.gif testout.gif
- Backup /Compare/Log testimg.bmp testout.bmp - Backup /Compare/Log testimg.bmp testout.bmp
- Backup /Compare/Log testimg.jpg testout.jpg - Backup /Compare/Log testimg.jpg testout.jpg
- Backup /Compare/Log testimg.ppm testoutp.ppm - Backup /Compare/Log testimg.ppm testoutp.ppm

View File

@@ -69,25 +69,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -175,12 +175,14 @@ clean:
test: cjpeg djpeg jpegtran test: cjpeg djpeg jpegtran
-$(RM) testout*.* -$(RM) testout*.*
djpeg -dct int -ppm -outfile testout.ppm testorig.jpg djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
djpeg -dct int -gif -outfile testout.gif testorig.jpg
djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
cjpeg -dct int -outfile testout.jpg testimg.ppm cjpeg -dct int -outfile testout.jpg testimg.ppm
djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
jpegtran -outfile testoutt.jpg testprog.jpg jpegtran -outfile testoutt.jpg testprog.jpg
cmp testimg.ppm testout.ppm cmp testimg.ppm testout.ppm
cmp testimg.gif testout.gif
cmp testimg.bmp testout.bmp cmp testimg.bmp testout.bmp
cmp testimg.jpg testout.jpg cmp testimg.jpg testout.jpg
cmp testimg.ppm testoutp.ppm cmp testimg.ppm testoutp.ppm

View File

@@ -64,25 +64,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -151,12 +151,14 @@ clean:
test: cjpeg djpeg jpegtran test: cjpeg djpeg jpegtran
$(RM) testout* $(RM) testout*
./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
./djpeg -dct int -gif -outfile testout.gif testorig.jpg
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
./cjpeg -dct int -outfile testout.jpg testimg.ppm ./cjpeg -dct int -outfile testout.jpg testimg.ppm
./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
./jpegtran -outfile testoutt.jpg testprog.jpg ./jpegtran -outfile testoutt.jpg testprog.jpg
cmp testimg.ppm testout.ppm cmp testimg.ppm testout.ppm
cmp testimg.gif testout.gif
cmp testimg.bmp testout.bmp cmp testimg.bmp testout.bmp
cmp testimg.jpg testout.jpg cmp testimg.jpg testout.jpg
cmp testimg.ppm testoutp.ppm cmp testimg.ppm testoutp.ppm

View File

@@ -57,25 +57,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -154,32 +154,74 @@ setup-vc6:
ren makewdep.vc6 wrjpgcom.dep ren makewdep.vc6 wrjpgcom.dep
ren makewdsp.vc6 wrjpgcom.dsp ren makewdsp.vc6 wrjpgcom.dsp
setup-v10: setupcopy-vc6:
copy /y jconfig.vc jconfig.h
copy /y makejdsw.vc6 jpeg.dsw
copy /y makeadsw.vc6 apps.dsw
copy /y makejmak.vc6 jpeg.mak
copy /y makejdep.vc6 jpeg.dep
copy /y makejdsp.vc6 jpeg.dsp
copy /y makecmak.vc6 cjpeg.mak
copy /y makecdep.vc6 cjpeg.dep
copy /y makecdsp.vc6 cjpeg.dsp
copy /y makedmak.vc6 djpeg.mak
copy /y makeddep.vc6 djpeg.dep
copy /y makeddsp.vc6 djpeg.dsp
copy /y maketmak.vc6 jpegtran.mak
copy /y maketdep.vc6 jpegtran.dep
copy /y maketdsp.vc6 jpegtran.dsp
copy /y makermak.vc6 rdjpgcom.mak
copy /y makerdep.vc6 rdjpgcom.dep
copy /y makerdsp.vc6 rdjpgcom.dsp
copy /y makewmak.vc6 wrjpgcom.mak
copy /y makewdep.vc6 wrjpgcom.dep
copy /y makewdsp.vc6 wrjpgcom.dsp
setup-v16:
ren jconfig.vc jconfig.h ren jconfig.vc jconfig.h
ren makejsln.v10 jpeg.sln ren makejsln.v16 jpeg.sln
ren makeasln.v10 apps.sln ren makeasln.v16 apps.sln
ren makejvcx.v10 jpeg.vcxproj ren makejvcx.v16 jpeg.vcxproj
ren makejfil.v10 jpeg.vcxproj.filters ren makejfil.v16 jpeg.vcxproj.filters
ren makecvcx.v10 cjpeg.vcxproj ren makecvcx.v16 cjpeg.vcxproj
ren makecfil.v10 cjpeg.vcxproj.filters ren makecfil.v16 cjpeg.vcxproj.filters
ren makedvcx.v10 djpeg.vcxproj ren makedvcx.v16 djpeg.vcxproj
ren makedfil.v10 djpeg.vcxproj.filters ren makedfil.v16 djpeg.vcxproj.filters
ren maketvcx.v10 jpegtran.vcxproj ren maketvcx.v16 jpegtran.vcxproj
ren maketfil.v10 jpegtran.vcxproj.filters ren maketfil.v16 jpegtran.vcxproj.filters
ren makervcx.v10 rdjpgcom.vcxproj ren makervcx.v16 rdjpgcom.vcxproj
ren makerfil.v10 rdjpgcom.vcxproj.filters ren makerfil.v16 rdjpgcom.vcxproj.filters
ren makewvcx.v10 wrjpgcom.vcxproj ren makewvcx.v16 wrjpgcom.vcxproj
ren makewfil.v10 wrjpgcom.vcxproj.filters ren makewfil.v16 wrjpgcom.vcxproj.filters
setupcopy-v16:
copy /y jconfig.vc jconfig.h
copy /y makejsln.v16 jpeg.sln
copy /y makeasln.v16 apps.sln
copy /y makejvcx.v16 jpeg.vcxproj
copy /y makejfil.v16 jpeg.vcxproj.filters
copy /y makecvcx.v16 cjpeg.vcxproj
copy /y makecfil.v16 cjpeg.vcxproj.filters
copy /y makedvcx.v16 djpeg.vcxproj
copy /y makedfil.v16 djpeg.vcxproj.filters
copy /y maketvcx.v16 jpegtran.vcxproj
copy /y maketfil.v16 jpegtran.vcxproj.filters
copy /y makervcx.v16 rdjpgcom.vcxproj
copy /y makerfil.v16 rdjpgcom.vcxproj.filters
copy /y makewvcx.v16 wrjpgcom.vcxproj
copy /y makewfil.v16 wrjpgcom.vcxproj.filters
test: test:
IF EXIST testout* $(RM) testout* IF EXIST testout* $(RM) testout*
.\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg .\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
.\djpeg -dct int -gif -outfile testout.gif testorig.jpg
.\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg .\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
.\cjpeg -dct int -outfile testout.jpg testimg.ppm .\cjpeg -dct int -outfile testout.jpg testimg.ppm
.\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg .\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
.\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm .\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
.\jpegtran -outfile testoutt.jpg testprog.jpg .\jpegtran -outfile testoutt.jpg testprog.jpg
fc /b testimg.ppm testout.ppm fc /b testimg.ppm testout.ppm
fc /b testimg.gif testout.gif
fc /b testimg.bmp testout.bmp fc /b testimg.bmp testout.bmp
fc /b testimg.jpg testout.jpg fc /b testimg.jpg testout.jpg
fc /b testimg.ppm testoutp.ppm fc /b testimg.ppm testoutp.ppm
@@ -187,19 +229,55 @@ test:
fc /b testorig.jpg testoutt.jpg fc /b testorig.jpg testoutt.jpg
test-build: test-build:
IF EXIST testout* $(RM) testout* IF EXIST .\Release\testout* $(RM) .\Release\testout*
.\djpeg\Release\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg .\Release\djpeg -dct int -ppm -outfile .\Release\testout.ppm testorig.jpg
.\djpeg\Release\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg .\Release\djpeg -dct int -gif -outfile .\Release\testout.gif testorig.jpg
.\cjpeg\Release\cjpeg -dct int -outfile testout.jpg testimg.ppm .\Release\djpeg -dct int -bmp -colors 256 -outfile .\Release\testout.bmp testorig.jpg
.\djpeg\Release\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg .\Release\cjpeg -dct int -outfile .\Release\testout.jpg testimg.ppm
.\cjpeg\Release\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm .\Release\djpeg -dct int -ppm -outfile .\Release\testoutp.ppm testprog.jpg
.\jpegtran\Release\jpegtran -outfile testoutt.jpg testprog.jpg .\Release\cjpeg -dct int -progressive -opt -outfile .\Release\testoutp.jpg testimg.ppm
fc /b testimg.ppm testout.ppm .\Release\jpegtran -outfile .\Release\testoutt.jpg testprog.jpg
fc /b testimg.bmp testout.bmp fc /b testimg.ppm .\Release\testout.ppm
fc /b testimg.jpg testout.jpg fc /b testimg.gif .\Release\testout.gif
fc /b testimg.ppm testoutp.ppm fc /b testimg.bmp .\Release\testout.bmp
fc /b testimgp.jpg testoutp.jpg fc /b testimg.jpg .\Release\testout.jpg
fc /b testorig.jpg testoutt.jpg fc /b testimg.ppm .\Release\testoutp.ppm
fc /b testimgp.jpg .\Release\testoutp.jpg
fc /b testorig.jpg .\Release\testoutt.jpg
test-32:
IF EXIST .\Release\testout* $(RM) .\Release\testout*
.\Release\Win32\djpeg -dct int -ppm -outfile .\Release\testout.ppm testorig.jpg
.\Release\Win32\djpeg -dct int -gif -outfile .\Release\testout.gif testorig.jpg
.\Release\Win32\djpeg -dct int -bmp -colors 256 -outfile .\Release\testout.bmp testorig.jpg
.\Release\Win32\cjpeg -dct int -outfile .\Release\testout.jpg testimg.ppm
.\Release\Win32\djpeg -dct int -ppm -outfile .\Release\testoutp.ppm testprog.jpg
.\Release\Win32\cjpeg -dct int -progressive -opt -outfile .\Release\testoutp.jpg testimg.ppm
.\Release\Win32\jpegtran -outfile .\Release\testoutt.jpg testprog.jpg
fc /b testimg.ppm .\Release\testout.ppm
fc /b testimg.gif .\Release\testout.gif
fc /b testimg.bmp .\Release\testout.bmp
fc /b testimg.jpg .\Release\testout.jpg
fc /b testimg.ppm .\Release\testoutp.ppm
fc /b testimgp.jpg .\Release\testoutp.jpg
fc /b testorig.jpg .\Release\testoutt.jpg
test-64:
IF EXIST .\Release\testout* $(RM) .\Release\testout*
.\Release\x64\djpeg -dct int -ppm -outfile .\Release\testout.ppm testorig.jpg
.\Release\x64\djpeg -dct int -gif -outfile .\Release\testout.gif testorig.jpg
.\Release\x64\djpeg -dct int -bmp -colors 256 -outfile .\Release\testout.bmp testorig.jpg
.\Release\x64\cjpeg -dct int -outfile .\Release\testout.jpg testimg.ppm
.\Release\x64\djpeg -dct int -ppm -outfile .\Release\testoutp.ppm testprog.jpg
.\Release\x64\cjpeg -dct int -progressive -opt -outfile .\Release\testoutp.jpg testimg.ppm
.\Release\x64\jpegtran -outfile .\Release\testoutt.jpg testprog.jpg
fc /b testimg.ppm .\Release\testout.ppm
fc /b testimg.gif .\Release\testout.gif
fc /b testimg.bmp .\Release\testout.bmp
fc /b testimg.jpg .\Release\testout.jpg
fc /b testimg.ppm .\Release\testoutp.ppm
fc /b testimgp.jpg .\Release\testoutp.jpg
fc /b testorig.jpg .\Release\testoutt.jpg
jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h

351
makefile.vs Normal file
View File

@@ -0,0 +1,351 @@
# Makefile for Independent JPEG Group's software
# This makefile is for Microsoft Visual C++ on Windows NT (and 95?).
# It builds the IJG library as a statically linkable library (.LIB),
# and builds the sample applications as console-mode apps.
# Thanks to Xingong Chang, Raymond Everly and others.
# Read installation instructions before saying "nmake" !!
# To build an optimized library without debug info, say "nmake nodebug=1".
# Pull in standard variable definitions
#!include <win32.mak>
# You may want to adjust these compiler options:
CFLAGS= $(cflags) $(cdebug) $(cvars) -I.
# Generally, we recommend defining any configuration symbols in jconfig.h,
# NOT via -D switches here.
# Link-time options:
LDFLAGS= $(ldebug) $(conlflags)
# To link any special libraries, add the necessary commands here.
LDLIBS= $(conlibs)
# Put here the object file name for the correct system-dependent memory
# manager file. For NT we suggest jmemnobs.obj, which expects the OS to
# provide adequate virtual memory.
SYSDEPMEM= jmemnobs.obj
# miscellaneous OS-dependent stuff
# file deletion command
RM= del
# End of configurable options.
# source files: JPEG library proper
LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
jquant2.c jutils.c jmemmgr.c
# memmgr back ends: compile only one of these into a working library
SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
# files included by source files
INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
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.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression
COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
# compression library object files
CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
# decompression library object files
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
jdmerge.obj
# These objectfiles are included in libjpeg.lib
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
# object files for sample applications (excluding library files)
COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
rdswitch.obj cdjpeg.obj
DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
rdcolmap.obj cdjpeg.obj
TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
# Template command for compiling .c to .obj
.c.obj:
$(cc) $(CFLAGS) $*.c
all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
libjpeg.lib: $(LIBOBJECTS)
$(RM) libjpeg.lib
lib -out:libjpeg.lib $(LIBOBJECTS)
cjpeg.exe: $(COBJECTS) libjpeg.lib
$(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS)
djpeg.exe: $(DOBJECTS) libjpeg.lib
$(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS)
jpegtran.exe: $(TROBJECTS) libjpeg.lib
$(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS)
rdjpgcom.exe: rdjpgcom.obj
$(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS)
wrjpgcom.exe: wrjpgcom.obj
$(link) $(LDFLAGS) -out:wrjpgcom.exe wrjpgcom.obj $(LDLIBS)
clean:
$(RM) *.obj *.exe libjpeg.lib
$(RM) testout*
setup-vc6:
ren jconfig.vc jconfig.h
ren makejdsw.vc6 jpeg.dsw
ren makeadsw.vc6 apps.dsw
ren makejmak.vc6 jpeg.mak
ren makejdep.vc6 jpeg.dep
ren makejdsp.vc6 jpeg.dsp
ren makecmak.vc6 cjpeg.mak
ren makecdep.vc6 cjpeg.dep
ren makecdsp.vc6 cjpeg.dsp
ren makedmak.vc6 djpeg.mak
ren makeddep.vc6 djpeg.dep
ren makeddsp.vc6 djpeg.dsp
ren maketmak.vc6 jpegtran.mak
ren maketdep.vc6 jpegtran.dep
ren maketdsp.vc6 jpegtran.dsp
ren makermak.vc6 rdjpgcom.mak
ren makerdep.vc6 rdjpgcom.dep
ren makerdsp.vc6 rdjpgcom.dsp
ren makewmak.vc6 wrjpgcom.mak
ren makewdep.vc6 wrjpgcom.dep
ren makewdsp.vc6 wrjpgcom.dsp
setupcopy-vc6:
copy /y jconfig.vc jconfig.h
copy /y makejdsw.vc6 jpeg.dsw
copy /y makeadsw.vc6 apps.dsw
copy /y makejmak.vc6 jpeg.mak
copy /y makejdep.vc6 jpeg.dep
copy /y makejdsp.vc6 jpeg.dsp
copy /y makecmak.vc6 cjpeg.mak
copy /y makecdep.vc6 cjpeg.dep
copy /y makecdsp.vc6 cjpeg.dsp
copy /y makedmak.vc6 djpeg.mak
copy /y makeddep.vc6 djpeg.dep
copy /y makeddsp.vc6 djpeg.dsp
copy /y maketmak.vc6 jpegtran.mak
copy /y maketdep.vc6 jpegtran.dep
copy /y maketdsp.vc6 jpegtran.dsp
copy /y makermak.vc6 rdjpgcom.mak
copy /y makerdep.vc6 rdjpgcom.dep
copy /y makerdsp.vc6 rdjpgcom.dsp
copy /y makewmak.vc6 wrjpgcom.mak
copy /y makewdep.vc6 wrjpgcom.dep
copy /y makewdsp.vc6 wrjpgcom.dsp
setup-v16:
ren jconfig.vc jconfig.h
ren makejsln.v16 jpeg.sln
ren makeasln.v16 apps.sln
ren makejvcx.v16 jpeg.vcxproj
ren makejfil.v16 jpeg.vcxproj.filters
ren makecvcx.v16 cjpeg.vcxproj
ren makecfil.v16 cjpeg.vcxproj.filters
ren makedvcx.v16 djpeg.vcxproj
ren makedfil.v16 djpeg.vcxproj.filters
ren maketvcx.v16 jpegtran.vcxproj
ren maketfil.v16 jpegtran.vcxproj.filters
ren makervcx.v16 rdjpgcom.vcxproj
ren makerfil.v16 rdjpgcom.vcxproj.filters
ren makewvcx.v16 wrjpgcom.vcxproj
ren makewfil.v16 wrjpgcom.vcxproj.filters
setupcopy-v16:
copy /y jconfig.vc jconfig.h
copy /y makejsln.v16 jpeg.sln
copy /y makeasln.v16 apps.sln
copy /y makejvcx.v16 jpeg.vcxproj
copy /y makejfil.v16 jpeg.vcxproj.filters
copy /y makecvcx.v16 cjpeg.vcxproj
copy /y makecfil.v16 cjpeg.vcxproj.filters
copy /y makedvcx.v16 djpeg.vcxproj
copy /y makedfil.v16 djpeg.vcxproj.filters
copy /y maketvcx.v16 jpegtran.vcxproj
copy /y maketfil.v16 jpegtran.vcxproj.filters
copy /y makervcx.v16 rdjpgcom.vcxproj
copy /y makerfil.v16 rdjpgcom.vcxproj.filters
copy /y makewvcx.v16 wrjpgcom.vcxproj
copy /y makewfil.v16 wrjpgcom.vcxproj.filters
test:
IF EXIST testout* $(RM) testout*
.\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
.\djpeg -dct int -gif -outfile testout.gif testorig.jpg
.\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
.\cjpeg -dct int -outfile testout.jpg testimg.ppm
.\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
.\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
.\jpegtran -outfile testoutt.jpg testprog.jpg
fc /b testimg.ppm testout.ppm
fc /b testimg.gif testout.gif
fc /b testimg.bmp testout.bmp
fc /b testimg.jpg testout.jpg
fc /b testimg.ppm testoutp.ppm
fc /b testimgp.jpg testoutp.jpg
fc /b testorig.jpg testoutt.jpg
test-build:
IF EXIST .\Release\testout* $(RM) .\Release\testout*
.\Release\djpeg -dct int -ppm -outfile .\Release\testout.ppm testorig.jpg
.\Release\djpeg -dct int -gif -outfile .\Release\testout.gif testorig.jpg
.\Release\djpeg -dct int -bmp -colors 256 -outfile .\Release\testout.bmp testorig.jpg
.\Release\cjpeg -dct int -outfile .\Release\testout.jpg testimg.ppm
.\Release\djpeg -dct int -ppm -outfile .\Release\testoutp.ppm testprog.jpg
.\Release\cjpeg -dct int -progressive -opt -outfile .\Release\testoutp.jpg testimg.ppm
.\Release\jpegtran -outfile .\Release\testoutt.jpg testprog.jpg
fc /b testimg.ppm .\Release\testout.ppm
fc /b testimg.gif .\Release\testout.gif
fc /b testimg.bmp .\Release\testout.bmp
fc /b testimg.jpg .\Release\testout.jpg
fc /b testimg.ppm .\Release\testoutp.ppm
fc /b testimgp.jpg .\Release\testoutp.jpg
fc /b testorig.jpg .\Release\testoutt.jpg
test-32:
IF EXIST .\Release\testout* $(RM) .\Release\testout*
.\Release\Win32\djpeg -dct int -ppm -outfile .\Release\testout.ppm testorig.jpg
.\Release\Win32\djpeg -dct int -gif -outfile .\Release\testout.gif testorig.jpg
.\Release\Win32\djpeg -dct int -bmp -colors 256 -outfile .\Release\testout.bmp testorig.jpg
.\Release\Win32\cjpeg -dct int -outfile .\Release\testout.jpg testimg.ppm
.\Release\Win32\djpeg -dct int -ppm -outfile .\Release\testoutp.ppm testprog.jpg
.\Release\Win32\cjpeg -dct int -progressive -opt -outfile .\Release\testoutp.jpg testimg.ppm
.\Release\Win32\jpegtran -outfile .\Release\testoutt.jpg testprog.jpg
fc /b testimg.ppm .\Release\testout.ppm
fc /b testimg.gif .\Release\testout.gif
fc /b testimg.bmp .\Release\testout.bmp
fc /b testimg.jpg .\Release\testout.jpg
fc /b testimg.ppm .\Release\testoutp.ppm
fc /b testimgp.jpg .\Release\testoutp.jpg
fc /b testorig.jpg .\Release\testoutt.jpg
test-64:
IF EXIST .\Release\testout* $(RM) .\Release\testout*
.\Release\x64\djpeg -dct int -ppm -outfile .\Release\testout.ppm testorig.jpg
.\Release\x64\djpeg -dct int -gif -outfile .\Release\testout.gif testorig.jpg
.\Release\x64\djpeg -dct int -bmp -colors 256 -outfile .\Release\testout.bmp testorig.jpg
.\Release\x64\cjpeg -dct int -outfile .\Release\testout.jpg testimg.ppm
.\Release\x64\djpeg -dct int -ppm -outfile .\Release\testoutp.ppm testprog.jpg
.\Release\x64\cjpeg -dct int -progressive -opt -outfile .\Release\testoutp.jpg testimg.ppm
.\Release\x64\jpegtran -outfile .\Release\testoutt.jpg testprog.jpg
fc /b testimg.ppm .\Release\testout.ppm
fc /b testimg.gif .\Release\testout.gif
fc /b testimg.bmp .\Release\testout.bmp
fc /b testimg.jpg .\Release\testout.jpg
fc /b testimg.ppm .\Release\testoutp.ppm
fc /b testimgp.jpg .\Release\testoutp.jpg
fc /b testorig.jpg .\Release\testoutt.jpg
jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h

View File

@@ -59,25 +59,25 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h &
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 & DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 &
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt & wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt &
coderules.txt filelist.txt change.log coderules.txt filelist.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc & MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 &
makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 & makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc &
makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 & makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 &
makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 & makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 &
maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 & makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 &
makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 & makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 &
makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 & makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 &
makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 & makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 &
makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st & maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 &
makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas & makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st &
makefile.mms makefile.vms makvms.opt makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat & CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat &
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas & jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas &
jconfig.vms jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp & CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp &
missing ar-lib missing ar-lib
OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg & TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg &
testimgp.jpg testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) & DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) &
$(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
# library object files common to compression and decompression # library object files common to compression and decompression
@@ -145,6 +145,7 @@ clean: .SYMBOLIC
test: cjpeg.exe djpeg.exe jpegtran.exe .SYMBOLIC test: cjpeg.exe djpeg.exe jpegtran.exe .SYMBOLIC
- del testout*.* - del testout*.*
djpeg -dct int -ppm -outfile testout.ppm testorig.jpg djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
djpeg -dct int -gif -outfile testout.gif testorig.jpg
djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
cjpeg -dct int -outfile testout.jpg testimg.ppm cjpeg -dct int -outfile testout.jpg testimg.ppm
djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
@@ -152,6 +153,7 @@ test: cjpeg.exe djpeg.exe jpegtran.exe .SYMBOLIC
jpegtran -outfile testoutt.jpg testprog.jpg jpegtran -outfile testoutt.jpg testprog.jpg
!ifeq SYSTEM DOS !ifeq SYSTEM DOS
fc /b testimg.ppm testout.ppm fc /b testimg.ppm testout.ppm
fc /b testimg.gif testout.gif
fc /b testimg.bmp testout.bmp fc /b testimg.bmp testout.bmp
fc /b testimg.jpg testout.jpg fc /b testimg.jpg testout.jpg
fc /b testimg.ppm testoutp.ppm fc /b testimg.ppm testoutp.ppm
@@ -160,6 +162,7 @@ test: cjpeg.exe djpeg.exe jpegtran.exe .SYMBOLIC
!else !else
echo n > n.tmp echo n > n.tmp
comp testimg.ppm testout.ppm < n.tmp comp testimg.ppm testout.ppm < n.tmp
comp testimg.gif testout.gif < n.tmp
comp testimg.bmp testout.bmp < n.tmp comp testimg.bmp testout.bmp < n.tmp
comp testimg.jpg testout.jpg < n.tmp comp testimg.jpg testout.jpg < n.tmp
comp testimg.ppm testoutp.ppm < n.tmp comp testimg.ppm testoutp.ppm < n.tmp

View File

@@ -34,7 +34,7 @@ RSC=rc.exe
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\Release" # PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\Release" # PROP Intermediate_Dir ".\Release\jpeg"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c

186
makejfil.v15 Normal file
View File

@@ -0,0 +1,186 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jdct.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmemsys.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcdctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jchuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcomapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcparam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcprepct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jctrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatadst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatasrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jddctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdhuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmerge.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdpostct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemnobs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jutils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

186
makejfil.v16 Normal file
View File

@@ -0,0 +1,186 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jdct.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmemsys.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcdctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jchuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcomapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcparam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcprepct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jctrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatadst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatasrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jddctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdhuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmerge.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdpostct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemnobs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jutils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

17
makejsln.v15 Normal file
View File

@@ -0,0 +1,17 @@
<EFBFBD><EFBFBD><EFBFBD>
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "jpeg.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

25
makejsln.v16 Normal file
View File

@@ -0,0 +1,25 @@
<EFBFBD><EFBFBD><EFBFBD>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.329
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "jpeg.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.ActiveCfg = Release|x64
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F3829CB8-BF87-4A30-B5D3-E3ADB548485D}
EndGlobalSection
EndGlobal

111
makejvcx.v15 Normal file
View File

@@ -0,0 +1,111 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jcarith.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jctrans.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdarith.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jdtrans.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jmemnobs.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>jpeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

150
makejvcx.v16 Normal file
View File

@@ -0,0 +1,150 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jcarith.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jctrans.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdarith.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jdtrans.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jmemnobs.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>jpeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -33,8 +33,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ".\rdjpgcom" # PROP BASE Target_Dir ".\rdjpgcom"
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\rdjpgcom\Release" # PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\rdjpgcom\Release" # PROP Intermediate_Dir ".\Release\rdjpgcom"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir ".\rdjpgcom" # PROP Target_Dir ".\rdjpgcom"
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c

30
makerfil.v15 Normal file
View File

@@ -0,0 +1,30 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="rdjpgcom.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

30
makerfil.v16 Normal file
View File

@@ -0,0 +1,30 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="rdjpgcom.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

64
makervcx.v15 Normal file
View File

@@ -0,0 +1,64 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C81513DB-78DC-46BC-BC98-82E745203976}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rdjpgcom</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jinclude.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="rdjpgcom.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

102
makervcx.v16 Normal file
View File

@@ -0,0 +1,102 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C81513DB-78DC-46BC-BC98-82E745203976}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rdjpgcom</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jinclude.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="rdjpgcom.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -33,8 +33,8 @@ RSC=rc.exe
# PROP BASE Target_Dir ".\jpegtran" # PROP BASE Target_Dir ".\jpegtran"
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\jpegtran\Release" # PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\jpegtran\Release" # PROP Intermediate_Dir ".\Release\jpegtran"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir ".\jpegtran" # PROP Target_Dir ".\jpegtran"
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c

63
maketfil.v15 Normal file
View File

@@ -0,0 +1,63 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cderror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdjpeg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="transupp.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jpegtran.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdswitch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="transupp.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

63
maketfil.v16 Normal file
View File

@@ -0,0 +1,63 @@
<EFBFBD><EFBFBD><EFBFBD><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cderror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdjpeg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="transupp.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cdjpeg.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jpegtran.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rdswitch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="transupp.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

Some files were not shown because too many files have changed in this diff Show More