Compare commits
212 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dedd1ae9a | ||
|
|
df3337ce8a | ||
|
|
38ccf8532d | ||
|
|
7b99172528 | ||
|
|
13b0944e9b | ||
|
|
83f2144655 | ||
|
|
bdf7986e7c | ||
|
|
eadc3c0f91 | ||
|
|
ae79fdbc2d | ||
|
|
c773d10b65 | ||
|
|
2093c6380d | ||
|
|
3d1dd07d54 | ||
|
|
995c831c5e | ||
|
|
cbda81a01d | ||
|
|
4bf3b585ef | ||
|
|
e238603c37 | ||
|
|
45d48291f9 | ||
|
|
ff95aa6d36 | ||
|
|
d90c9a2564 | ||
|
|
8e2bba9e02 | ||
|
|
8c2b9fa744 | ||
|
|
64586cd185 | ||
|
|
e16eaed09c | ||
|
|
f12c7db429 | ||
|
|
bf5a12db42 | ||
|
|
12fc3eaf63 | ||
|
|
49597877a4 | ||
|
|
991c2fcae7 | ||
|
|
4ea16c0603 | ||
|
|
377add7ae9 | ||
|
|
a51ada6706 | ||
|
|
ef663e333e | ||
|
|
be09b20a40 | ||
|
|
9ca2364694 | ||
|
|
3dc1bc2ded | ||
|
|
1a2219ec26 | ||
|
|
b6f097f729 | ||
|
|
d3e320fee7 | ||
|
|
830d5fccf4 | ||
|
|
4132b1d552 | ||
|
|
f9bdeb62e2 | ||
|
|
e728ed7a36 | ||
|
|
a644fb05a7 | ||
|
|
86d8c0aa26 | ||
|
|
fb096fff78 | ||
|
|
14ecb539df | ||
|
|
09271951d9 | ||
|
|
7bac07bf12 | ||
|
|
0f413b2207 | ||
|
|
97f8ec4b60 | ||
|
|
1e6b5b4884 | ||
|
|
ae19bf6f15 | ||
|
|
e885a8bf41 | ||
|
|
0b7d4ed792 | ||
|
|
10a094f0e6 | ||
|
|
f8b77c44f1 | ||
|
|
048990944f | ||
|
|
d3c7eff53d | ||
|
|
0248dd9aeb | ||
|
|
7e0b499ee7 | ||
|
|
f19caa5e67 | ||
|
|
0a1f68edeb | ||
|
|
8f870c297d | ||
|
|
f66a2b08a2 | ||
|
|
485cd80811 | ||
|
|
a9a7b22443 | ||
|
|
3cd2e503c6 | ||
|
|
fe7936c603 | ||
|
|
252dbc9fad | ||
|
|
5df6c2372d | ||
|
|
ca3cebbaef | ||
|
|
4425702a6a | ||
|
|
968c8bbc00 | ||
|
|
8f0d62cb92 | ||
|
|
0c6a271f97 | ||
|
|
3bddd467c4 | ||
|
|
4df84bf859 | ||
|
|
748fda3834 | ||
|
|
aa91179eac | ||
|
|
03c3c9be67 | ||
|
|
c3f4ac0b6e | ||
|
|
a93881b109 | ||
|
|
4924e49ad0 | ||
|
|
687244b90e | ||
|
|
9abc855552 | ||
|
|
10d15cbe44 | ||
|
|
0fd8be5d0c | ||
|
|
26b208d8b7 | ||
|
|
8b014d7f5d | ||
|
|
ea1978896e | ||
|
|
c9327685dd | ||
|
|
65d05c1d92 | ||
|
|
ca5e7d184e | ||
|
|
b9b1ca30ca | ||
|
|
10e75a71da | ||
|
|
051dd5a4ab | ||
|
|
6afd256e98 | ||
|
|
d86e4d914c | ||
|
|
1e2f298f94 | ||
|
|
8a26fdea23 | ||
|
|
23071bcba5 | ||
|
|
68fef83ed9 | ||
|
|
2f272d519f | ||
|
|
6f8c66880e | ||
|
|
45ff6e2745 | ||
|
|
fb18e856e4 | ||
|
|
315123fa3e | ||
|
|
6a3477c29f | ||
|
|
6533b6e023 | ||
|
|
268ef884d8 | ||
|
|
4614871092 | ||
|
|
feb9dce665 | ||
|
|
52a19f25d5 | ||
|
|
f26914b93a | ||
|
|
079b4346bc | ||
|
|
6f52592267 | ||
|
|
8ff1f254f3 | ||
|
|
211de3b963 | ||
|
|
ec84a6bdbf | ||
|
|
0a945a1770 | ||
|
|
6aa6a0a768 | ||
|
|
4d5fc18f58 | ||
|
|
e7b699d653 | ||
|
|
327184fbee | ||
|
|
ce1546eb90 | ||
|
|
971d851844 | ||
|
|
bd17e2a5d6 | ||
|
|
101f09a3d1 | ||
|
|
bf0fab9aa1 | ||
|
|
f4253a7cdd | ||
|
|
34d59e71d6 | ||
|
|
60fa0600c0 | ||
|
|
60cddeb849 | ||
|
|
21d66837a0 | ||
|
|
411dcf5666 | ||
|
|
87581b8188 | ||
|
|
1bf1a14d71 | ||
|
|
4f4428185b | ||
|
|
2a46aeece8 | ||
|
|
83e9cd5e36 | ||
|
|
a1e9878b31 | ||
|
|
0c0f304e8d | ||
|
|
e54fb0bf95 | ||
|
|
1536192e92 | ||
|
|
321ad51314 | ||
|
|
132b5fdd6d | ||
|
|
fc5dc4fa19 | ||
|
|
021da085a7 | ||
|
|
e2816648d8 | ||
|
|
6c0e1fc72e | ||
|
|
0ba6826d20 | ||
|
|
a21a01c60d | ||
|
|
353332b015 | ||
|
|
adfd23393c | ||
|
|
dae4474117 | ||
|
|
8ece7fef15 | ||
|
|
62aaa7e7c1 | ||
|
|
8443e529e9 | ||
|
|
5d20b7e662 | ||
|
|
79ecd1b16e | ||
|
|
f1418c76a8 | ||
|
|
9a6b8dca7e | ||
|
|
db838bdb73 | ||
|
|
ba82ddf6ca | ||
|
|
1aea5fa182 | ||
|
|
afa937e62b | ||
|
|
73de982473 | ||
|
|
cdc8ac3eb1 | ||
|
|
3a63184474 | ||
|
|
61e51f98e2 | ||
|
|
720e161083 | ||
|
|
e673a1764a | ||
|
|
16ed1f5387 | ||
|
|
a2d19e1981 | ||
|
|
6e8b69d35f | ||
|
|
6e075fcfae | ||
|
|
2e7b76b28c | ||
|
|
f25c071eb7 | ||
|
|
59c1a252d5 | ||
|
|
c7fbf2961a | ||
|
|
3cba8db08f | ||
|
|
3a65ef478b | ||
|
|
8629988742 | ||
|
|
d07a0a6479 | ||
|
|
6a8b33d3cd | ||
|
|
995a3e14ee | ||
|
|
dc5db14a33 | ||
|
|
b28e287f93 | ||
|
|
99313388cc | ||
|
|
0747ad2b12 | ||
|
|
eea7215525 | ||
|
|
a2e6a9dd47 | ||
|
|
018fc42974 | ||
|
|
7311830680 | ||
|
|
35c4719638 | ||
|
|
65d0317346 | ||
|
|
5eb84ff97f | ||
|
|
dedc42e268 | ||
|
|
2ae181c7b8 | ||
|
|
59a3938b2e | ||
|
|
49dcbfbf13 | ||
|
|
5557fd2217 | ||
|
|
2fb0831aeb | ||
|
|
ba0ce39b70 | ||
|
|
b22e883a5f | ||
|
|
aa026fbf36 | ||
|
|
8a418b2bb8 | ||
|
|
5f33883e0e | ||
|
|
213a72aaea | ||
|
|
da5a1fe760 | ||
|
|
0ca44258fc | ||
|
|
c87530727a |
327
BUILDING.txt
Normal file
327
BUILDING.txt
Normal file
@@ -0,0 +1,327 @@
|
||||
*******************************************************************************
|
||||
** Building on Unix Platforms, Cygwin, and MinGW
|
||||
*******************************************************************************
|
||||
|
||||
==================
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- autoconf 2.56 or later
|
||||
-- automake 1.7 or later
|
||||
-- libtool 1.4 or later
|
||||
* If using MinGW, these can be obtained by installing the MSYS DTK
|
||||
|
||||
-- NASM
|
||||
* 0.98 or later is required for a 32-bit build
|
||||
* NASM 2.05 or later is required for a 64-bit build
|
||||
* NASM 2.07 or later is required for a 64-bit build on OS/X. This can be
|
||||
obtained from MacPorts (http://www.macports.org/).
|
||||
|
||||
The NASM 2.05 RPMs do not work on older Linux systems, such as Enterprise
|
||||
Linux 4. On such systems, you can easily build and install NASM 2.05
|
||||
from the source RPM by executing the following as root:
|
||||
|
||||
ARCH=`uname -m`
|
||||
wget http://www.nasm.us/pub/nasm/releasebuilds/2.05.01/nasm-2.05.01-1.src.rpm
|
||||
rpmbuild --rebuild nasm-2.05.01-1.src.rpm
|
||||
rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-2.05.01-1.$ARCH.rpm
|
||||
|
||||
NOTE: NASM build will fail if texinfo is not installed.
|
||||
|
||||
-- GCC v4.1 or later recommended for best performance
|
||||
|
||||
======================
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
|
||||
OS X, and Solaris/x86 systems (on Solaris, this generates a 32-bit library.
|
||||
See below for 64-bit build instructions.)
|
||||
|
||||
cd libjpeg-turbo
|
||||
autoreconf -fiv
|
||||
sh ./configure
|
||||
make
|
||||
|
||||
NOTE: Running autoreconf is only necessary if building libjpeg-turbo from the
|
||||
SVN repository.
|
||||
|
||||
This will generate the following files under .libs/
|
||||
|
||||
libjpeg.a
|
||||
Static link library for libjpeg-turbo
|
||||
|
||||
libjpeg.so.62.0.0 (Linux, Solaris)
|
||||
libjpeg.62.dylib (OS X)
|
||||
libjpeg-62.dll (MinGW)
|
||||
cygjpeg-62.dll (Cygwin)
|
||||
Shared library for libjpeg-turbo
|
||||
|
||||
libjpeg.so (Linux, Solaris)
|
||||
libjpeg.dylib (OS X)
|
||||
libjpeg.dll.a (Cygwin, MinGW)
|
||||
Development stub for libjpeg-turbo shared library
|
||||
|
||||
libturbojpeg.a
|
||||
Static link library for TurboJPEG/OSS
|
||||
|
||||
libturbojpeg.so (Linux, Solaris)
|
||||
libturbojpeg.dylib (OS X)
|
||||
Shared library and development stub for TurboJPEG/OSS
|
||||
|
||||
libturbojpeg.dll (MinGW)
|
||||
cygturbojpeg.dll (Cygwin)
|
||||
Shared library for TurboJPEG/OSS
|
||||
|
||||
libturbojpeg.dll.a (Cygwin, MinGW)
|
||||
Development stub for TurboJPEG/OSS shared library
|
||||
|
||||
========================
|
||||
Installing libjpeg-turbo
|
||||
========================
|
||||
|
||||
If you intend to install these libraries and the associated header files, then
|
||||
replace 'make' in the instructions above with
|
||||
|
||||
make install prefix={base dir} libdir={library directory}
|
||||
|
||||
For example,
|
||||
|
||||
make install prefix=/usr/local libdir=/usr/local/lib64
|
||||
|
||||
will install the header files in /usr/local/include and the library files in
|
||||
/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
|
||||
is to install the header files in /opt/libjpeg-turbo/include and the library
|
||||
files in /opt/libjpeg-turbo/lib.
|
||||
|
||||
NOTE: You can specify a prefix of /usr and a libdir of, for instance,
|
||||
/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
|
||||
however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
|
||||
overwriting it. It is recommended that you instead install libjpeg-turbo into
|
||||
a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
|
||||
to force applications to use libjpeg-turbo instead of libjpeg. See
|
||||
README-turbo.txt for more information.
|
||||
|
||||
=============
|
||||
Build Recipes
|
||||
=============
|
||||
|
||||
32-bit Library Build on 64-bit Linux
|
||||
------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Library Build on 64-bit OS/X
|
||||
-----------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm
|
||||
|
||||
to the configure command line. NASM 2.07 or later from MacPorts must be
|
||||
installed.
|
||||
|
||||
|
||||
32-bit Library Build on 64-bit OS/X
|
||||
-----------------------------------
|
||||
|
||||
Add
|
||||
|
||||
CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Backward-Compatible Library Build on 64-bit OS/X
|
||||
-------------------------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3' \
|
||||
CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4'
|
||||
|
||||
to the configure command line. The OS X 10.4 SDK must be installed.
|
||||
|
||||
|
||||
32-bit Backward-Compatible Library Build on OS/X
|
||||
------------------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3 -m32' \
|
||||
CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3 -m32' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -m32'
|
||||
|
||||
to the configure command line. The OS X 10.4 SDK must be installed.
|
||||
|
||||
|
||||
64-bit Library Build on 64-bit Solaris
|
||||
--------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
32-bit Library Build on 64-bit FreeBSD
|
||||
--------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \
|
||||
CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32'
|
||||
|
||||
to the configure command line. NASM 2.07 or later from FreeBSD ports must be
|
||||
installed.
|
||||
|
||||
|
||||
MinGW Build on Cygwin
|
||||
---------------------
|
||||
|
||||
Add
|
||||
|
||||
--host mingw32
|
||||
|
||||
to the configure command line. This will produce libraries which do not
|
||||
depend on cygwin1.dll or other Cygwin DLL's.
|
||||
|
||||
|
||||
Sun Studio
|
||||
----------
|
||||
|
||||
Add
|
||||
|
||||
CC=cc CXX=CC
|
||||
|
||||
to the configure command line. libjpeg-turbo will automatically be built with
|
||||
the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
|
||||
|
||||
To build a 64-bit version of libjpeg-turbo using Sun Studio, add
|
||||
|
||||
--host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
|
||||
CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Building on Windows (Visual C++)
|
||||
*******************************************************************************
|
||||
|
||||
==================
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- GNU Make v3.7 or later
|
||||
* Can be found in MSYS (http://www.mingw.org/download.shtml) or
|
||||
Cygwin (http://www.cygwin.com/)
|
||||
|
||||
-- Windows SDK for Windows Server 2008 and .NET Framework 3.5 (or a later
|
||||
version)
|
||||
|
||||
http://msdn.microsoft.com/en-us/windows/dd146047.aspx
|
||||
|
||||
* The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
|
||||
everything necessary to build libjpeg-turbo. If you do not already have
|
||||
Visual C++ installed, then this is the recommended solution. Also tested
|
||||
with Microsoft Visual C++ 2008 Express Edition (both are free downloads.)
|
||||
* Add the compiler and SDK binary directories (for instance,
|
||||
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
|
||||
c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
|
||||
c:\Program Files\Microsoft SDKs\Windows\v6.1\bin)
|
||||
to the system or user PATH environment variable prior to building
|
||||
libjpeg-turbo.
|
||||
* Add the compiler and SDK include directories (for instance,
|
||||
c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
|
||||
c:\Program Files\Microsoft SDKs\Windows\v6.1\include)
|
||||
to the system or user INCLUDE environment variable prior to building
|
||||
libjpeg-turbo.
|
||||
* Add the compiler library directory (for instance,
|
||||
c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
|
||||
c:\Program Files\Microsoft SDKs\Windows\v6.1\lib)
|
||||
to the system or user LIB environment variable prior to building
|
||||
libjpeg-turbo.
|
||||
|
||||
-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
|
||||
a 64-bit build)
|
||||
|
||||
======================
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
cd libjpeg-turbo
|
||||
make -f win/Makefile
|
||||
|
||||
This will generate the following files under libjpeg-turbo\windows\:
|
||||
|
||||
jpeg-static.lib Static link library for libjpeg-turbo
|
||||
jpeg62.dll Shared library for libjpeg-turbo
|
||||
jpeg.lib Development stub for libjpeg-turbo shared library
|
||||
turbojpeg-static.lib Static link library for TurboJPEG/OSS
|
||||
turbojpeg.dll Shared library for TurboJPEG/OSS
|
||||
turbojpeg.lib Development stub for TurboJPEG/OSS shared library
|
||||
|
||||
If a 64-bit Windows platform is detected, then the build system will attempt
|
||||
to build a 64-bit version of libjpeg-turbo. You can override this by running
|
||||
|
||||
make -f win/Makefile WIN64=no
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Creating Release Packages
|
||||
*******************************************************************************
|
||||
|
||||
The following commands can be used to create various types of release packages:
|
||||
|
||||
make rpm
|
||||
|
||||
Create RedHat-style binary RPM package. Requires RPM v4 or later.
|
||||
|
||||
make srpm
|
||||
|
||||
This runs 'make dist' to create a pristine source tarball, then creates a
|
||||
RedHat-style source RPM package from the tarball. Requires RPM v4 or later.
|
||||
|
||||
make deb
|
||||
|
||||
Create Debian-style binary package. Requires dpkg.
|
||||
|
||||
make dmg
|
||||
|
||||
Create Macintosh package/disk image. This requires the PackageMaker
|
||||
application, which must be installed in /Developer/Applications/Utilities.
|
||||
|
||||
make udmg
|
||||
|
||||
On 64-bit OS X systems, this creates a version of the Macintosh package and
|
||||
disk image which contains universal i386/x86-64 binaries. The 32-bit fork of
|
||||
these binaries is backward compatible with OS X 10.4 and later. The 64-bit
|
||||
fork can be made backward compatible as well by using the instructions in
|
||||
the "Build Recipes" section. OS X 10.4 compatibility SDK required.
|
||||
|
||||
make nsi
|
||||
|
||||
When using MinGW, this creates a Win32 installer for the GCC version of the
|
||||
libjpeg-turbo SDK. This requires the Nullsoft Install System
|
||||
(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
|
||||
|
||||
make -f win/Makefile nsi
|
||||
|
||||
This creates a Win32 installer for the Visual C++ version of the
|
||||
libjpeg-turbo SDK. This requires the Nullsoft Install System
|
||||
(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
|
||||
40
ChangeLog.txt
Normal file
40
ChangeLog.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
Significant changes since 0.0.93
|
||||
================================
|
||||
|
||||
[1] 2983700: Further FreeBSD build tweaks (no longer necessary to specify
|
||||
--host when configuring on a 64-bit system)
|
||||
|
||||
[2] Created sym. links in the Unix/Linux packages so that the TurboJPEG
|
||||
include file can always be found in /opt/libjpeg-turbo/include, the 32-bit
|
||||
static libraries can always be found in /opt/libjpeg-turbo/lib32, and the
|
||||
64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64.
|
||||
|
||||
[3] The Unix/Linux distribution packages now include the libjpeg run-time
|
||||
programs (cjpeg, etc.) and man pages.
|
||||
|
||||
[4] Created a 32-bit supplementary package for amd64 Debian systems which
|
||||
contains just the 32-bit libjpeg-turbo libraries.
|
||||
|
||||
[5] Moved the libraries from */lib32 to */lib in the i386 Debian package.
|
||||
|
||||
[6] Include distribution package for Cygwin
|
||||
|
||||
[7] No longer necessary to specify --without-simd on non-x86 architectures, and
|
||||
unit tests now work on those architectures.
|
||||
|
||||
|
||||
Significant changes since 0.0.91
|
||||
================================
|
||||
|
||||
[1] 2982659, Fixed x86-64 build on FreeBSD systems
|
||||
|
||||
[2] 2988188: Added support for Windows 64-bit systems
|
||||
|
||||
|
||||
Significant changes since 0.0.90
|
||||
================================
|
||||
|
||||
[1] Added documentation to .deb packages
|
||||
|
||||
[2] 2968313: Fixed data corruption issues when decompressing large JPEG images
|
||||
and/or using buffered I/O with the libjpeg-turbo decompressor
|
||||
504
LGPL.txt
Normal file
504
LGPL.txt
Normal file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
53
LICENSE.txt
Normal file
53
LICENSE.txt
Normal file
@@ -0,0 +1,53 @@
|
||||
wxWindows Library Licence, Version 3.1
|
||||
======================================
|
||||
|
||||
Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
WXWINDOWS LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxWindows Library Licence, applying
|
||||
either version 3.1 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version
|
||||
3.1 of the Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under your own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
|
||||
|
||||
211
Makefile.am
Normal file
211
Makefile.am
Normal file
@@ -0,0 +1,211 @@
|
||||
lib_LTLIBRARIES = libjpeg.la libturbojpeg.la
|
||||
libjpeg_la_LDFLAGS = -version-number 62:0:0 -no-undefined
|
||||
libturbojpeg_la_LDFLAGS = -avoid-version -no-undefined
|
||||
include_HEADERS = jerror.h jmorecfg.h jpeglib.h turbojpeg.h
|
||||
nodist_include_HEADERS = jconfig.h
|
||||
|
||||
HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
|
||||
jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h
|
||||
|
||||
libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
|
||||
jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
|
||||
jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
|
||||
jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
|
||||
jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
|
||||
jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
|
||||
jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
|
||||
|
||||
libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \
|
||||
turbojpeg-mapfile
|
||||
|
||||
if VERSION_SCRIPT
|
||||
|
||||
libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/turbojpeg-mapfile
|
||||
|
||||
endif
|
||||
|
||||
if WITH_SIMD
|
||||
|
||||
SUBDIRS = simd
|
||||
libjpeg_la_LIBADD = simd/libsimd.la
|
||||
libturbojpeg_la_LIBADD = simd/libsimd.la
|
||||
|
||||
else
|
||||
|
||||
libjpeg_la_SOURCES += jsimd_none.c
|
||||
|
||||
endif
|
||||
|
||||
TSTHDRS = rrutil.h rrtimer.h
|
||||
|
||||
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
noinst_PROGRAMS = jpgtest jpegut
|
||||
|
||||
jpgtest_SOURCES = $(TSTHDRS) jpgtest.cxx bmp.h bmp.c
|
||||
|
||||
jpgtest_LDADD = libturbojpeg.la
|
||||
|
||||
jpegut_SOURCES = $(TSTHDRS) jpegut.c bmp.h bmp.c
|
||||
|
||||
jpegut_LDADD = libturbojpeg.la
|
||||
|
||||
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
|
||||
rdppm.c rdswitch.c rdtarga.c
|
||||
|
||||
cjpeg_LDADD = libjpeg.la
|
||||
|
||||
cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
|
||||
djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
|
||||
wrbmp.c wrgif.c wrppm.c wrtarga.c
|
||||
|
||||
djpeg_LDADD = libjpeg.la
|
||||
|
||||
djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
|
||||
jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
|
||||
|
||||
jpegtran_LDADD = libjpeg.la
|
||||
|
||||
rdjpgcom_SOURCES = rdjpgcom.c
|
||||
|
||||
rdjpgcom_LDADD = libjpeg.la
|
||||
|
||||
wrjpgcom_SOURCES = wrjpgcom.c
|
||||
|
||||
wrjpgcom_LDADD = libjpeg.la
|
||||
|
||||
|
||||
dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
|
||||
|
||||
DOCS= README install.doc usage.doc wizard.doc example.c libjpeg.doc \
|
||||
structure.doc coderules.doc filelist.doc jconfig.doc change.log \
|
||||
README-turbo.txt rdrle.c wrrle.c LICENSE.txt LGPL.txt BUILDING.txt \
|
||||
ChangeLog.txt
|
||||
|
||||
TESTFILES= testorig.jpg testorig.ppm testimg.bmp testimgflt.jpg \
|
||||
testimgfst.jpg testimgint.jpg testimgp.jpg testimgfst.ppm testimgint.ppm \
|
||||
testimg-nosimd.bmp testimgfst-nosimd.ppm testorig-nosimd.ppm \
|
||||
testimgflt-nosimd.jpg testimgint-nosimd.jpg testimgfst-nosimd.jpg \
|
||||
testimgp-nosimd.jpg
|
||||
|
||||
EXTRA_DIST = win release $(DOCS) $(TESTFILES)
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
|
||||
|
||||
if WITH_SIMD
|
||||
|
||||
test: testclean cjpeg djpeg jpegtran jpegut
|
||||
./jpegut
|
||||
./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
|
||||
./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
|
||||
./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
|
||||
cmp $(srcdir)/testimgint.jpg testoutint.jpg
|
||||
cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
|
||||
cmp $(srcdir)/testimgflt.jpg testoutflt.jpg
|
||||
./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
|
||||
./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
|
||||
./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
|
||||
cmp $(srcdir)/testimgint.ppm testoutint.ppm
|
||||
cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
|
||||
cmp $(srcdir)/testorig.ppm testoutflt.ppm
|
||||
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
|
||||
cmp $(srcdir)/testimg.bmp testout.bmp
|
||||
./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
|
||||
cmp $(srcdir)/testimgp.jpg testoutp.jpg
|
||||
./jpegtran -outfile testoutt.jpg testoutp.jpg
|
||||
cmp $(srcdir)/testimgint.jpg testoutt.jpg
|
||||
|
||||
else
|
||||
|
||||
test: testclean cjpeg djpeg jpegtran jpegut
|
||||
./jpegut
|
||||
./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig-nosimd.ppm
|
||||
./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig-nosimd.ppm
|
||||
./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig-nosimd.ppm
|
||||
cmp $(srcdir)/testimgint-nosimd.jpg testoutint.jpg
|
||||
cmp $(srcdir)/testimgfst-nosimd.jpg testoutfst.jpg
|
||||
cmp $(srcdir)/testimgflt-nosimd.jpg testoutflt.jpg
|
||||
./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
|
||||
./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
|
||||
./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
|
||||
cmp $(srcdir)/testimgint.ppm testoutint.ppm
|
||||
cmp $(srcdir)/testimgfst-nosimd.ppm testoutfst.ppm
|
||||
cmp $(srcdir)/testorig-nosimd.ppm testoutflt.ppm
|
||||
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
|
||||
cmp $(srcdir)/testimg-nosimd.bmp testout.bmp
|
||||
./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig-nosimd.ppm
|
||||
cmp $(srcdir)/testimgp-nosimd.jpg testoutp.jpg
|
||||
./jpegtran -outfile testoutt.jpg testoutp.jpg
|
||||
cmp $(srcdir)/testimgint-nosimd.jpg testoutt.jpg
|
||||
|
||||
endif
|
||||
|
||||
testclean:
|
||||
rm -f testout*
|
||||
rm -f *_GRAYQ[0-9]*.bmp
|
||||
rm -f *_GRAYQ[0-9]*.ppm
|
||||
rm -f *_GRAYQ[0-9]*.jpg
|
||||
rm -f *_420Q[0-9]*.bmp
|
||||
rm -f *_420Q[0-9]*.ppm
|
||||
rm -f *_420Q[0-9]*.jpg
|
||||
rm -f *_422Q[0-9]*.bmp
|
||||
rm -f *_422Q[0-9]*.ppm
|
||||
rm -f *_422Q[0-9]*.jpg
|
||||
rm -f *_444Q[0-9]*.bmp
|
||||
rm -f *_444Q[0-9]*.ppm
|
||||
rm -f *_444Q[0-9]*.jpg
|
||||
|
||||
rpm: all
|
||||
sh $(srcdir)/release/makerpm ${PACKAGE_NAME} ${VERSION} ${BUILD} \
|
||||
${RPMARCH} ${srcdir}
|
||||
|
||||
srpm: dist-gzip
|
||||
sh $(srcdir)/release/makesrpm ${PACKAGE_NAME} ${VERSION} ${BUILD} ${srcdir}
|
||||
|
||||
deb: all
|
||||
sh $(srcdir)/release/makedpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
|
||||
${DEBARCH} ${srcdir}
|
||||
|
||||
if X86_64
|
||||
|
||||
udmg: all
|
||||
sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
|
||||
${srcdir} universal
|
||||
|
||||
endif
|
||||
|
||||
dmg: all
|
||||
sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} ${srcdir}
|
||||
|
||||
if X86_64
|
||||
|
||||
sunpkg: all
|
||||
sh $(srcdir)/release/makesunpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
|
||||
${DEBARCH} ${srcdir} $(CC) $(CXX) combined
|
||||
|
||||
nsi: all
|
||||
makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo-gcc64 \
|
||||
-DWLIBDIR=.libs -DWSRCDIR=$(srcdir) -DWBLDDIR=. -DWHDRDIR=. -DWIN64 \
|
||||
-DPLATFORM="GCC 64-bit" -DGCC $(srcdir)/release/libjpeg-turbo.nsi
|
||||
|
||||
else
|
||||
|
||||
sunpkg: all
|
||||
sh $(srcdir)/release/makesunpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
|
||||
${DEBARCH} ${srcdir} $(CC) $(CXX)
|
||||
|
||||
nsi: all
|
||||
makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo-gcc \
|
||||
-DWLIBDIR=.libs -DWSRCDIR=$(srcdir) -DWBLDDIR=. -DWHDRDIR=. \
|
||||
-DPLATFORM="GCC" -DGCC $(srcdir)/release/libjpeg-turbo.nsi
|
||||
|
||||
endif
|
||||
|
||||
cygwinpkg: all
|
||||
sh $(srcdir)/release/makecygwinpkg ${PACKAGE_NAME} ${VERSION} ${srcdir}
|
||||
7
README
7
README
@@ -1,3 +1,10 @@
|
||||
libjpeg-turbo note: This is the legacy document from the original libjpeg v6b
|
||||
release, which is included for reference. The Internet addresses given below
|
||||
are likely non-functional. For more information about the libjpeg project,
|
||||
please see http://www.ijg.org. For more information about libjpeg-turbo,
|
||||
please see http://libjpeg-turbo.virtualgl.org.
|
||||
|
||||
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
|
||||
202
README-turbo.txt
Executable file
202
README-turbo.txt
Executable file
@@ -0,0 +1,202 @@
|
||||
*******************************************************************************
|
||||
** Background
|
||||
*******************************************************************************
|
||||
|
||||
libjpeg-turbo is a high-speed version of libjpeg for x86 and x86-64 processors
|
||||
which uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG
|
||||
compression and decompression. libjpeg-turbo is generally 2-4x as fast
|
||||
as the unmodified version of libjpeg, all else being equal.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
|
||||
the TigerVNC and VirtualGL projects made numerous enhancements to the codec,
|
||||
including improved support for Mac OS X, 64-bit support, support for 32-bit
|
||||
and big endian pixel formats, accelerated Huffman encoding/decoding, and
|
||||
various bug fixes. The goal was to produce a fully open source codec that
|
||||
could replace the partially closed source TurboJPEG/IPP codec used by VirtualGL
|
||||
and TurboVNC. libjpeg-turbo generally performs in the range of 80-120% of
|
||||
TurboJPEG/IPP. It is faster in some areas but slower in others.
|
||||
|
||||
It was decided to split libjpeg-turbo into a separate SDK so that other
|
||||
projects could take advantage of this technology. The libjpeg-turbo shared
|
||||
libraries can be used as drop-in replacements for libjpeg on most systems.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** License
|
||||
*******************************************************************************
|
||||
|
||||
Some of the optimizations to the Huffman encoder/decoder were borrowed from
|
||||
VirtualGL, and thus the libjpeg-turbo distribution, as a whole, falls under the
|
||||
wxWindows Library Licence, Version 3.1. A copy of this license can be found in
|
||||
this directory under LICENSE.txt. The wxWindows Library License is based on
|
||||
the LGPL but includes provisions which allow the Library to be statically
|
||||
linked into proprietary libraries and applications without requiring the
|
||||
resulting binaries to be distributed under the terms of the LGPL.
|
||||
|
||||
The rest of the source code, apart from these modifications, falls under a less
|
||||
restrictive, BSD-style license (see README.)
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Using libjpeg-turbo
|
||||
*******************************************************************************
|
||||
|
||||
=============================
|
||||
Replacing libjpeg at Run Time
|
||||
=============================
|
||||
|
||||
If a Unix application is dynamically linked with libjpeg, then you can replace
|
||||
libjpeg with libjpeg-turbo at run time by manipulating the LD_LIBRARY_PATH.
|
||||
For instance:
|
||||
|
||||
[Using libjpeg]
|
||||
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
|
||||
real 0m0.392s
|
||||
user 0m0.074s
|
||||
sys 0m0.020s
|
||||
|
||||
[Using libjpeg-turbo]
|
||||
> export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH
|
||||
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
|
||||
real 0m0.109s
|
||||
user 0m0.029s
|
||||
sys 0m0.010s
|
||||
|
||||
NOTE: {lib} can be lib, lib32, lib64, or lib/64, depending on the O/S and
|
||||
architecture.
|
||||
|
||||
System administrators can also replace the libjpeg sym links in /usr/{lib} with
|
||||
links to the libjpeg dynamic library located in /opt/libjpeg-turbo/{lib}. This
|
||||
will effectively accelerate every dynamically linked libjpeg application on the
|
||||
system.
|
||||
|
||||
The Windows distribution of the libjpeg-turbo SDK installs jpeg62.dll into
|
||||
c:\libjpeg-turbo\bin, and the PATH environment variable can be modified such
|
||||
that this directory is searched before any others that might contain
|
||||
jpeg62.dll. However, if jpeg62.dll also exists in an application's install
|
||||
directory, then Windows will load the application's version of it first. Thus,
|
||||
if an application ships with jpeg62.dll, then back up the application's version
|
||||
of jpeg62.dll and copy c:\libjpeg-turbo\bin\jpeg62.dll into the application's
|
||||
install directory to accelerate it.
|
||||
|
||||
The version of jpeg62.dll distributed in the libjpeg-turbo SDK requires the
|
||||
Visual C++ 2008 C run time DLL (msvcr90.dll). This library ships with more
|
||||
recent versions of Windows, but users of older versions can obtain it from the
|
||||
Visual C++ 2008 Redistributable Package, which is available as a free download
|
||||
from Microsoft's web site.
|
||||
|
||||
NOTE: Features of libjpeg which require passing a C run time structure, such
|
||||
as a file handle, from an application to libjpeg will probably not work with
|
||||
the distributed version of jpeg62.dll unless the application is also built to
|
||||
use the Visual C++ 2008 C run time DLL. In particular, this affects
|
||||
jpeg_stdio_dest() and jpeg_stdio_src().
|
||||
|
||||
Mac applications typically embed their own copies of libjpeg.62.dylib inside
|
||||
the (hidden) application bundle, so it is not possible to globally replace
|
||||
libjpeg on OS X systems. If an application uses a shared library version of
|
||||
libjpeg, then it may be possible to replace the application's version of it.
|
||||
This would generally involve copying libjpeg.62.dylib into the appropriate
|
||||
place in the application bundle and using install_name_tool to repoint the
|
||||
dylib to the new directory. This requires an advanced knowledge of OS X and
|
||||
would not survive an upgrade or a re-install of the application. Thus, it is
|
||||
not recommended for most users.
|
||||
|
||||
=======================
|
||||
Replacing TurboJPEG/IPP
|
||||
=======================
|
||||
|
||||
libjpeg-turbo is a drop-in replacement for the TurboJPEG/IPP SDK used by
|
||||
VirtualGL 2.1.x and TurboVNC 0.6 (and prior.) libjpeg-turbo contains a wrapper
|
||||
library (TurboJPEG/OSS) that emulates the TurboJPEG API using libjpeg-turbo
|
||||
instead of the closed source Intel Performance Primitives. You can replace the
|
||||
TurboJPEG/IPP package on Linux systems with the libjpeg-turbo package in order
|
||||
to make existing releases of VirtualGL 2.1.x and TurboVNC use the new codec at
|
||||
run time. Note that the 64-bit libjpeg-turbo packages contain only 64-bit
|
||||
binaries, whereas the TurboJPEG/IPP 64-bit packages contained both 64-bit and
|
||||
32-bit binaries. Thus, to replace a TurboJPEG/IPP 64-bit package, install
|
||||
both the 64-bit and 32-bit versions of libjpeg-turbo.
|
||||
|
||||
You can also build the VirtualGL 2.1.x and TurboVNC 0.6 source code with
|
||||
the libjpeg-turbo SDK instead of TurboJPEG/IPP. It should work identically.
|
||||
libjpeg-turbo also includes static library versions of TurboJPEG/OSS, which
|
||||
are used to build TurboVNC 1.0 and later.
|
||||
|
||||
========================================
|
||||
Using libjpeg-turbo in Your Own Programs
|
||||
========================================
|
||||
|
||||
For the most part, libjpeg-turbo should work identically to libjpeg, so in
|
||||
most cases, an application can be built against libjpeg and then run against
|
||||
libjpeg-turbo. On Unix systems, you can build against libjpeg-turbo instead
|
||||
of libjpeg by setting
|
||||
|
||||
CPATH=/opt/libjpeg-turbo/include
|
||||
and
|
||||
LIBRARY_PATH=/opt/libjpeg-turbo/{lib}
|
||||
|
||||
({lib} = lib32 or lib64, depending on whether you are building a 32-bit or a
|
||||
64-bit application.)
|
||||
|
||||
If using Cygwin, then set
|
||||
|
||||
CPATH=/cygdrive/c/libjpeg-turbo-gcc[64]/include
|
||||
and
|
||||
LIBRARY_PATH=/cygdrive/c/libjpeg-turbo-gcc[64]/lib
|
||||
|
||||
If using MinGW, then set
|
||||
|
||||
CPATH=/c/libjpeg-turbo-gcc[64]/include
|
||||
and
|
||||
LIBRARY_PATH=/c/libjpeg-turbo-gcc[64]/lib
|
||||
|
||||
Building against libjpeg-turbo is useful, for instance, if you want to build an
|
||||
application that leverages the libjpeg-turbo colorspace extensions (see below.)
|
||||
On Linux and Solaris systems, you would still need to manipulate the
|
||||
LD_LIBRARY_PATH or sym links appropriately to use libjpeg-turbo at run time.
|
||||
On such systems, you can pass -R /opt/libjpeg-turbo/{lib} to the linker to
|
||||
force the use of libjpeg-turbo at run time rather than libjpeg (also useful if
|
||||
you want to leverage the colorspace extensions), or you can link against the
|
||||
libjpeg-turbo static library.
|
||||
|
||||
To force a Linux, Solaris, or MinGW application to link against the static
|
||||
version of libjpeg-turbo, you can use the following linker options:
|
||||
|
||||
-Wl,-Bstatic -ljpeg -Wl,-Bdynamic
|
||||
|
||||
On OS X, simply add /opt/libjpeg-turbo/lib/libjpeg.a to the linker command
|
||||
line (this also works on Linux and Solaris.)
|
||||
|
||||
To build Visual C++ applications using libjpeg-turbo, add
|
||||
c:\libjpeg-turbo[64]\include to your system or user INCLUDE environment
|
||||
variable and c:\libjpeg-turbo[64]\lib to your system or user LIB environment
|
||||
variable, and then link against either jpeg.lib (to use jpeg62.dll) or
|
||||
jpeg-static.lib (to use the static version of libjpeg-turbo.)
|
||||
|
||||
=====================
|
||||
Colorspace Extensions
|
||||
=====================
|
||||
|
||||
libjpeg-turbo includes extensions which allow JPEG images to be compressed
|
||||
directly from (and decompressed directly to) buffers which use BGR, BGRA,
|
||||
RGBA, ABGR, and ARGB pixel ordering. This is implemented with six new
|
||||
colorspace constants:
|
||||
|
||||
JCS_EXT_RGB /* red/green/blue */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
JCS_EXT_BGR /* blue/green/red */
|
||||
JCS_EXT_BGRX /* blue/green/red/x */
|
||||
JCS_EXT_XBGR /* x/blue/green/red */
|
||||
JCS_EXT_XRGB /* x/red/green/blue */
|
||||
|
||||
Setting cinfo.in_color_space (compression) or cinfo.out_color_space
|
||||
(decompression) to one of these values will cause libjpeg-turbo to read the
|
||||
red, green, and blue values from (or write them to) the appropriate position in
|
||||
the pixel when YUV conversion is performed.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a version of libjpeg
|
||||
that doesn't support them will result in a "Bogus input colorspace" error.
|
||||
136
acinclude.m4
Normal file
136
acinclude.m4
Normal file
@@ -0,0 +1,136 @@
|
||||
# AC_PROG_NASM
|
||||
# --------------------------
|
||||
# Check that NASM exists and determine flags
|
||||
AC_DEFUN([AC_PROG_NASM],[
|
||||
|
||||
AC_CHECK_PROGS(NASM, [nasm nasmw])
|
||||
test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])
|
||||
|
||||
AC_MSG_CHECKING([for object file format of host system])
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | interix*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='Win64-COFF'
|
||||
;;
|
||||
*)
|
||||
objfmt='Win32-COFF'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
msdosdjgpp* | go32*)
|
||||
objfmt='COFF'
|
||||
;;
|
||||
os2-emx*) # not tested
|
||||
objfmt='MSOMF' # obj
|
||||
;;
|
||||
linux*coff* | linux*oldld*)
|
||||
objfmt='COFF' # ???
|
||||
;;
|
||||
linux*aout*)
|
||||
objfmt='a.out'
|
||||
;;
|
||||
linux*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='ELF64'
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd* | netbsd* | openbsd*)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
|
||||
objfmt='BSD-a.out'
|
||||
else
|
||||
case "$host_cpu" in
|
||||
x86_64 | amd64)
|
||||
objfmt='ELF64'
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
solaris* | sunos* | sysv* | sco*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='ELF64'
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
darwin* | rhapsody* | nextstep* | openstep* | macos*)
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
objfmt='Mach-O64'
|
||||
;;
|
||||
*)
|
||||
objfmt='Mach-O'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
objfmt='ELF ?'
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_RESULT([$objfmt])
|
||||
if test "$objfmt" = 'ELF ?'; then
|
||||
objfmt='ELF'
|
||||
AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
|
||||
case "$objfmt" in
|
||||
MSOMF) NAFLAGS='-fobj -DOBJ32';;
|
||||
Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
|
||||
Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
|
||||
COFF) NAFLAGS='-fcoff -DCOFF';;
|
||||
a.out) NAFLAGS='-faout -DAOUT';;
|
||||
BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
|
||||
ELF) NAFLAGS='-felf -DELF';;
|
||||
ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
|
||||
RDF) NAFLAGS='-frdf -DRDF';;
|
||||
Mach-O) NAFLAGS='-fmacho -DMACHO';;
|
||||
Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
|
||||
esac
|
||||
AC_MSG_RESULT([$NAFLAGS])
|
||||
AC_SUBST([NAFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
|
||||
cat > conftest.asm <<EOF
|
||||
[%line __oline__ "configure"
|
||||
section .text
|
||||
global _main,main
|
||||
_main:
|
||||
main: xor eax,eax
|
||||
ret
|
||||
]EOF
|
||||
try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
|
||||
if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.asm >&AC_FD_CC
|
||||
rm -rf conftest*
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether the linker accepts assembler output])
|
||||
try_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC'
|
||||
if AC_TRY_EVAL(try_nasm) && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
rm -rf conftest*
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([configuration problem: maybe object file format mismatch.])
|
||||
fi
|
||||
|
||||
])
|
||||
36
ansi2knr.1
36
ansi2knr.1
@@ -1,36 +0,0 @@
|
||||
.TH ANSI2KNR 1 "19 Jan 1996"
|
||||
.SH NAME
|
||||
ansi2knr \- convert ANSI C to Kernighan & Ritchie C
|
||||
.SH SYNOPSIS
|
||||
.I ansi2knr
|
||||
[--varargs] input_file [output_file]
|
||||
.SH DESCRIPTION
|
||||
If no output_file is supplied, output goes to stdout.
|
||||
.br
|
||||
There are no error messages.
|
||||
.sp
|
||||
.I ansi2knr
|
||||
recognizes function definitions by seeing a non-keyword identifier at the left
|
||||
margin, followed by a left parenthesis, with a right parenthesis as the last
|
||||
character on the line, and with a left brace as the first token on the
|
||||
following line (ignoring possible intervening comments). It will recognize a
|
||||
multi-line header provided that no intervening line ends with a left or right
|
||||
brace or a semicolon. These algorithms ignore whitespace and comments, except
|
||||
that the function name must be the first thing on the line.
|
||||
.sp
|
||||
The following constructs will confuse it:
|
||||
.br
|
||||
- Any other construct that starts at the left margin and follows the
|
||||
above syntax (such as a macro or function call).
|
||||
.br
|
||||
- Some macros that tinker with the syntax of the function header.
|
||||
.sp
|
||||
The --varargs switch is obsolete, and is recognized only for
|
||||
backwards compatibility. The present version of
|
||||
.I ansi2knr
|
||||
will always attempt to convert a ... argument to va_alist and va_dcl.
|
||||
.SH AUTHOR
|
||||
L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
|
||||
continues to maintain the current version; most of the code in the current
|
||||
version is his work. ansi2knr also includes contributions by Francois
|
||||
Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.
|
||||
693
ansi2knr.c
693
ansi2knr.c
@@ -1,693 +0,0 @@
|
||||
/* ansi2knr.c */
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||
|
||||
/*
|
||||
ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY. No author or distributor accepts responsibility to anyone for the
|
||||
consequences of using it or for whether it serves any particular purpose or
|
||||
works at all, unless he says so in writing. Refer to the GNU General Public
|
||||
License (the "GPL") for full details.
|
||||
|
||||
Everyone is granted permission to copy, modify and redistribute ansi2knr,
|
||||
but only under the conditions described in the GPL. A copy of this license
|
||||
is supposed to have been given to you along with ansi2knr so you can know
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT.
|
||||
[In the IJG distribution, the GPL appears below, not in a separate file.]
|
||||
Among other things, the copyright notice and this notice must be preserved
|
||||
on all copies.
|
||||
|
||||
We explicitly state here what we believe is already implied by the GPL: if
|
||||
the ansi2knr program is distributed as a separate set of sources and a
|
||||
separate executable file which are aggregated on a storage medium together
|
||||
with another program, this in itself does not bring the other program under
|
||||
the GPL, nor does the mere fact that such a program or the procedures for
|
||||
constructing it invoke the ansi2knr executable bring any other part of the
|
||||
program under the GPL.
|
||||
*/
|
||||
|
||||
/*
|
||||
---------- Here is the GNU GPL file COPYLEFT, referred to above ----------
|
||||
----- These terms do NOT apply to the JPEG software itself; see README ------
|
||||
|
||||
GHOSTSCRIPT GENERAL PUBLIC LICENSE
|
||||
(Clarified 11 Feb 1988)
|
||||
|
||||
Copyright (C) 1988 Richard M. Stallman
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license, but changing it is not allowed. You can also use this wording
|
||||
to make the terms for other programs.
|
||||
|
||||
The license agreements of most software companies keep you at the
|
||||
mercy of those companies. By contrast, our general public license is
|
||||
intended to give everyone the right to share Ghostscript. To make sure
|
||||
that you get the rights we want you to have, we need to make
|
||||
restrictions that forbid anyone to deny you these rights or to ask you
|
||||
to surrender the rights. Hence this license agreement.
|
||||
|
||||
Specifically, we want to make sure that you have the right to give
|
||||
away copies of Ghostscript, that you receive source code or else can get
|
||||
it if you want it, that you can change Ghostscript or use pieces of it
|
||||
in new free programs, and that you know you can do these things.
|
||||
|
||||
To make sure that everyone has such rights, we have to forbid you to
|
||||
deprive anyone else of these rights. For example, if you distribute
|
||||
copies of Ghostscript, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must tell them their rights.
|
||||
|
||||
Also, for our own protection, we must make certain that everyone finds
|
||||
out that there is no warranty for Ghostscript. If Ghostscript is
|
||||
modified by someone else and passed on, we want its recipients to know
|
||||
that what they have is not what we distributed, so that any problems
|
||||
introduced by others will not reflect on our reputation.
|
||||
|
||||
Therefore we (Richard M. Stallman and the Free Software Foundation,
|
||||
Inc.) make the following terms which say what you must do to be allowed
|
||||
to distribute or change Ghostscript.
|
||||
|
||||
|
||||
COPYING POLICIES
|
||||
|
||||
1. You may copy and distribute verbatim copies of Ghostscript source
|
||||
code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy a valid copyright and license
|
||||
notice "Copyright (C) 1989 Aladdin Enterprises. All rights reserved.
|
||||
Distributed by Free Software Foundation, Inc." (or with whatever year is
|
||||
appropriate); keep intact the notices on all files that refer to this
|
||||
License Agreement and to the absence of any warranty; and give any other
|
||||
recipients of the Ghostscript program a copy of this License Agreement
|
||||
along with the program. You may charge a distribution fee for the
|
||||
physical act of transferring a copy.
|
||||
|
||||
2. You may modify your copy or copies of Ghostscript or any portion of
|
||||
it, and copy and distribute such modifications under the terms of
|
||||
Paragraph 1 above, provided that you also do the following:
|
||||
|
||||
a) cause the modified files to carry prominent notices stating
|
||||
that you changed the files and the date of any change; and
|
||||
|
||||
b) cause the whole of any work that you distribute or publish,
|
||||
that in whole or in part contains or is a derivative of Ghostscript
|
||||
or any part thereof, to be licensed at no charge to all third
|
||||
parties on terms identical to those contained in this License
|
||||
Agreement (except that you may choose to grant more extensive
|
||||
warranty protection to some or all third parties, at your option).
|
||||
|
||||
c) You may charge a distribution fee for the physical act of
|
||||
transferring a copy, and you may at your option offer warranty
|
||||
protection in exchange for a fee.
|
||||
|
||||
Mere aggregation of another unrelated program with this program (or its
|
||||
derivative) on a volume of a storage or distribution medium does not bring
|
||||
the other program under the scope of these terms.
|
||||
|
||||
3. You may copy and distribute Ghostscript (or a portion or derivative
|
||||
of it, under Paragraph 2) in object code or executable form under the
|
||||
terms of Paragraphs 1 and 2 above provided that you also do one of the
|
||||
following:
|
||||
|
||||
a) accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
b) accompany it with a written offer, valid for at least three
|
||||
years, to give any third party free (except for a nominal
|
||||
shipping charge) a complete machine-readable copy of the
|
||||
corresponding source code, to be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
c) accompany it with the information you received as to where the
|
||||
corresponding source code may be obtained. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form alone.)
|
||||
|
||||
For an executable file, complete source code means all the source code for
|
||||
all modules it contains; but, as a special exception, it need not include
|
||||
source code for modules which are standard libraries that accompany the
|
||||
operating system on which the executable file runs.
|
||||
|
||||
4. You may not copy, sublicense, distribute or transfer Ghostscript
|
||||
except as expressly provided under this License Agreement. Any attempt
|
||||
otherwise to copy, sublicense, distribute or transfer Ghostscript is
|
||||
void and your rights to use the program under this License agreement
|
||||
shall be automatically terminated. However, parties who have received
|
||||
computer software programs from you with this License Agreement will not
|
||||
have their licenses terminated so long as such parties remain in full
|
||||
compliance.
|
||||
|
||||
5. If you wish to incorporate parts of Ghostscript into other free
|
||||
programs whose distribution conditions are different, write to the Free
|
||||
Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not
|
||||
yet worked out a simple rule that can be stated here, but we will often
|
||||
permit this. We will be guided by the two goals of preserving the free
|
||||
status of all derivatives of our free software and of promoting the
|
||||
sharing and reuse of software.
|
||||
|
||||
Your comments and suggestions about our licensing policies and our
|
||||
software are welcome! Please contact the Free Software Foundation,
|
||||
Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
|
||||
NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
|
||||
WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD
|
||||
M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES
|
||||
PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH
|
||||
YOU. SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
|
||||
STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN
|
||||
ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
|
||||
GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
|
||||
ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
||||
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
||||
INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
|
||||
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU
|
||||
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM
|
||||
BY ANY OTHER PARTY.
|
||||
|
||||
-------------------- End of file COPYLEFT ------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
ansi2knr input_file [output_file]
|
||||
* If no output_file is supplied, output goes to stdout.
|
||||
* There are no error messages.
|
||||
*
|
||||
* ansi2knr recognizes function definitions by seeing a non-keyword
|
||||
* identifier at the left margin, followed by a left parenthesis,
|
||||
* with a right parenthesis as the last character on the line,
|
||||
* and with a left brace as the first token on the following line
|
||||
* (ignoring possible intervening comments).
|
||||
* It will recognize a multi-line header provided that no intervening
|
||||
* line ends with a left or right brace or a semicolon.
|
||||
* These algorithms ignore whitespace and comments, except that
|
||||
* the function name must be the first thing on the line.
|
||||
* The following constructs will confuse it:
|
||||
* - Any other construct that starts at the left margin and
|
||||
* follows the above syntax (such as a macro or function call).
|
||||
* - Some macros that tinker with the syntax of the function header.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The original and principal author of ansi2knr is L. Peter Deutsch
|
||||
* <ghost@aladdin.com>. Other authors are noted in the change history
|
||||
* that follows (in reverse chronological order):
|
||||
lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with
|
||||
compilers that don't understand void, as suggested by
|
||||
Tom Lane
|
||||
lpd 96-01-15 changed to require that the first non-comment token
|
||||
on the line following a function header be a left brace,
|
||||
to reduce sensitivity to macros, as suggested by Tom Lane
|
||||
<tgl@sss.pgh.pa.us>
|
||||
lpd 95-06-22 removed #ifndefs whose sole purpose was to define
|
||||
undefined preprocessor symbols as 0; changed all #ifdefs
|
||||
for configuration symbols to #ifs
|
||||
lpd 95-04-05 changed copyright notice to make it clear that
|
||||
including ansi2knr in a program does not bring the entire
|
||||
program under the GPL
|
||||
lpd 94-12-18 added conditionals for systems where ctype macros
|
||||
don't handle 8-bit characters properly, suggested by
|
||||
Francois Pinard <pinard@iro.umontreal.ca>;
|
||||
removed --varargs switch (this is now the default)
|
||||
lpd 94-10-10 removed CONFIG_BROKETS conditional
|
||||
lpd 94-07-16 added some conditionals to help GNU `configure',
|
||||
suggested by Francois Pinard <pinard@iro.umontreal.ca>;
|
||||
properly erase prototype args in function parameters,
|
||||
contributed by Jim Avera <jima@netcom.com>;
|
||||
correct error in writeblanks (it shouldn't erase EOLs)
|
||||
lpd 89-xx-xx original version
|
||||
*/
|
||||
|
||||
/* Most of the conditionals here are to make ansi2knr work with */
|
||||
/* or without the GNU configure machinery. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
||||
/*
|
||||
For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
|
||||
This will define HAVE_CONFIG_H and so, activate the following lines.
|
||||
*/
|
||||
|
||||
# if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# else
|
||||
# include <strings.h>
|
||||
# endif
|
||||
|
||||
#else /* not HAVE_CONFIG_H */
|
||||
|
||||
/* Otherwise do it the hard way */
|
||||
|
||||
# ifdef BSD
|
||||
# include <strings.h>
|
||||
# else
|
||||
# ifdef VMS
|
||||
extern int strlen(), strncmp();
|
||||
# else
|
||||
# include <string.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* not HAVE_CONFIG_H */
|
||||
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
/*
|
||||
malloc and free should be declared in stdlib.h,
|
||||
but if you've got a K&R compiler, they probably aren't.
|
||||
*/
|
||||
# ifdef MSDOS
|
||||
# include <malloc.h>
|
||||
# else
|
||||
# ifdef VMS
|
||||
extern char *malloc();
|
||||
extern void free();
|
||||
# else
|
||||
extern char *malloc();
|
||||
extern int free();
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The ctype macros don't always handle 8-bit characters correctly.
|
||||
* Compensate for this here.
|
||||
*/
|
||||
#ifdef isascii
|
||||
# undef HAVE_ISASCII /* just in case */
|
||||
# define HAVE_ISASCII 1
|
||||
#else
|
||||
#endif
|
||||
#if STDC_HEADERS || !HAVE_ISASCII
|
||||
# define is_ascii(c) 1
|
||||
#else
|
||||
# define is_ascii(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define is_space(c) (is_ascii(c) && isspace(c))
|
||||
#define is_alpha(c) (is_ascii(c) && isalpha(c))
|
||||
#define is_alnum(c) (is_ascii(c) && isalnum(c))
|
||||
|
||||
/* Scanning macros */
|
||||
#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
|
||||
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
|
||||
|
||||
/* Forward references */
|
||||
char *skipspace();
|
||||
int writeblanks();
|
||||
int test1();
|
||||
int convert1();
|
||||
|
||||
/* The main program */
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{ FILE *in, *out;
|
||||
#define bufsize 5000 /* arbitrary size */
|
||||
char *buf;
|
||||
char *line;
|
||||
char *more;
|
||||
/*
|
||||
* In previous versions, ansi2knr recognized a --varargs switch.
|
||||
* If this switch was supplied, ansi2knr would attempt to convert
|
||||
* a ... argument to va_alist and va_dcl; if this switch was not
|
||||
* supplied, ansi2knr would simply drop any such arguments.
|
||||
* Now, ansi2knr always does this conversion, and we only
|
||||
* check for this switch for backward compatibility.
|
||||
*/
|
||||
int convert_varargs = 1;
|
||||
|
||||
if ( argc > 1 && argv[1][0] == '-' )
|
||||
{ if ( !strcmp(argv[1], "--varargs") )
|
||||
{ convert_varargs = 1;
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
else
|
||||
{ fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
switch ( argc )
|
||||
{
|
||||
default:
|
||||
printf("Usage: ansi2knr input_file [output_file]\n");
|
||||
exit(0);
|
||||
case 2:
|
||||
out = stdout;
|
||||
break;
|
||||
case 3:
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL )
|
||||
{ fprintf(stderr, "Cannot open output file %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL )
|
||||
{ fprintf(stderr, "Cannot open input file %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
|
||||
buf = malloc(bufsize);
|
||||
line = buf;
|
||||
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
||||
{
|
||||
test: line += strlen(line);
|
||||
switch ( test1(buf) )
|
||||
{
|
||||
case 2: /* a function header */
|
||||
convert1(buf, out, 1, convert_varargs);
|
||||
break;
|
||||
case 1: /* a function */
|
||||
/* Check for a { at the start of the next line. */
|
||||
more = ++line;
|
||||
f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
|
||||
goto wl;
|
||||
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
|
||||
goto wl;
|
||||
switch ( *skipspace(more, 1) )
|
||||
{
|
||||
case '{':
|
||||
/* Definitely a function header. */
|
||||
convert1(buf, out, 0, convert_varargs);
|
||||
fputs(more, out);
|
||||
break;
|
||||
case 0:
|
||||
/* The next line was blank or a comment: */
|
||||
/* keep scanning for a non-comment. */
|
||||
line += strlen(line);
|
||||
goto f;
|
||||
default:
|
||||
/* buf isn't a function header, but */
|
||||
/* more might be. */
|
||||
fputs(buf, out);
|
||||
strcpy(buf, more);
|
||||
line = buf;
|
||||
goto test;
|
||||
}
|
||||
break;
|
||||
case -1: /* maybe the start of a function */
|
||||
if ( line != buf + (bufsize - 1) ) /* overflow check */
|
||||
continue;
|
||||
/* falls through */
|
||||
default: /* not a function */
|
||||
wl: fputs(buf, out);
|
||||
break;
|
||||
}
|
||||
line = buf;
|
||||
}
|
||||
if ( line != buf )
|
||||
fputs(buf, out);
|
||||
free(buf);
|
||||
fclose(out);
|
||||
fclose(in);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Skip over space and comments, in either direction. */
|
||||
char *
|
||||
skipspace(p, dir)
|
||||
register char *p;
|
||||
register int dir; /* 1 for forward, -1 for backward */
|
||||
{ for ( ; ; )
|
||||
{ while ( is_space(*p) )
|
||||
p += dir;
|
||||
if ( !(*p == '/' && p[dir] == '*') )
|
||||
break;
|
||||
p += dir; p += dir;
|
||||
while ( !(*p == '*' && p[dir] == '/') )
|
||||
{ if ( *p == 0 )
|
||||
return p; /* multi-line comment?? */
|
||||
p += dir;
|
||||
}
|
||||
p += dir; p += dir;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write blanks over part of a string.
|
||||
* Don't overwrite end-of-line characters.
|
||||
*/
|
||||
int
|
||||
writeblanks(start, end)
|
||||
char *start;
|
||||
char *end;
|
||||
{ char *p;
|
||||
for ( p = start; p < end; p++ )
|
||||
if ( *p != '\r' && *p != '\n' )
|
||||
*p = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test whether the string in buf is a function definition.
|
||||
* The string may contain and/or end with a newline.
|
||||
* Return as follows:
|
||||
* 0 - definitely not a function definition;
|
||||
* 1 - definitely a function definition;
|
||||
* 2 - definitely a function prototype (NOT USED);
|
||||
* -1 - may be the beginning of a function definition,
|
||||
* append another line and look again.
|
||||
* The reason we don't attempt to convert function prototypes is that
|
||||
* Ghostscript's declaration-generating macros look too much like
|
||||
* prototypes, and confuse the algorithms.
|
||||
*/
|
||||
int
|
||||
test1(buf)
|
||||
char *buf;
|
||||
{ register char *p = buf;
|
||||
char *bend;
|
||||
char *endfn;
|
||||
int contin;
|
||||
|
||||
if ( !isidfirstchar(*p) )
|
||||
return 0; /* no name at left margin */
|
||||
bend = skipspace(buf + strlen(buf) - 1, -1);
|
||||
switch ( *bend )
|
||||
{
|
||||
case ';': contin = 0 /*2*/; break;
|
||||
case ')': contin = 1; break;
|
||||
case '{': return 0; /* not a function */
|
||||
case '}': return 0; /* not a function */
|
||||
default: contin = -1;
|
||||
}
|
||||
while ( isidchar(*p) )
|
||||
p++;
|
||||
endfn = p;
|
||||
p = skipspace(p, 1);
|
||||
if ( *p++ != '(' )
|
||||
return 0; /* not a function */
|
||||
p = skipspace(p, 1);
|
||||
if ( *p == ')' )
|
||||
return 0; /* no parameters */
|
||||
/* Check that the apparent function name isn't a keyword. */
|
||||
/* We only need to check for keywords that could be followed */
|
||||
/* by a left parenthesis (which, unfortunately, is most of them). */
|
||||
{ static char *words[] =
|
||||
{ "asm", "auto", "case", "char", "const", "double",
|
||||
"extern", "float", "for", "if", "int", "long",
|
||||
"register", "return", "short", "signed", "sizeof",
|
||||
"static", "switch", "typedef", "unsigned",
|
||||
"void", "volatile", "while", 0
|
||||
};
|
||||
char **key = words;
|
||||
char *kp;
|
||||
int len = endfn - buf;
|
||||
|
||||
while ( (kp = *key) != 0 )
|
||||
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
|
||||
return 0; /* name is a keyword */
|
||||
key++;
|
||||
}
|
||||
}
|
||||
return contin;
|
||||
}
|
||||
|
||||
/* Convert a recognized function definition or header to K&R syntax. */
|
||||
int
|
||||
convert1(buf, out, header, convert_varargs)
|
||||
char *buf;
|
||||
FILE *out;
|
||||
int header; /* Boolean */
|
||||
int convert_varargs; /* Boolean */
|
||||
{ char *endfn;
|
||||
register char *p;
|
||||
char **breaks;
|
||||
unsigned num_breaks = 2; /* for testing */
|
||||
char **btop;
|
||||
char **bp;
|
||||
char **ap;
|
||||
char *vararg = 0;
|
||||
|
||||
/* Pre-ANSI implementations don't agree on whether strchr */
|
||||
/* is called strchr or index, so we open-code it here. */
|
||||
for ( endfn = buf; *(endfn++) != '('; )
|
||||
;
|
||||
top: p = endfn;
|
||||
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
|
||||
if ( breaks == 0 )
|
||||
{ /* Couldn't allocate break table, give up */
|
||||
fprintf(stderr, "Unable to allocate break table!\n");
|
||||
fputs(buf, out);
|
||||
return -1;
|
||||
}
|
||||
btop = breaks + num_breaks * 2 - 2;
|
||||
bp = breaks;
|
||||
/* Parse the argument list */
|
||||
do
|
||||
{ int level = 0;
|
||||
char *lp = NULL;
|
||||
char *rp;
|
||||
char *end = NULL;
|
||||
|
||||
if ( bp >= btop )
|
||||
{ /* Filled up break table. */
|
||||
/* Allocate a bigger one and start over. */
|
||||
free((char *)breaks);
|
||||
num_breaks <<= 1;
|
||||
goto top;
|
||||
}
|
||||
*bp++ = p;
|
||||
/* Find the end of the argument */
|
||||
for ( ; end == NULL; p++ )
|
||||
{ switch(*p)
|
||||
{
|
||||
case ',':
|
||||
if ( !level ) end = p;
|
||||
break;
|
||||
case '(':
|
||||
if ( !level ) lp = p;
|
||||
level++;
|
||||
break;
|
||||
case ')':
|
||||
if ( --level < 0 ) end = p;
|
||||
else rp = p;
|
||||
break;
|
||||
case '/':
|
||||
p = skipspace(p, 1) - 1;
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
/* Erase any embedded prototype parameters. */
|
||||
if ( lp )
|
||||
writeblanks(lp + 1, rp);
|
||||
p--; /* back up over terminator */
|
||||
/* Find the name being declared. */
|
||||
/* This is complicated because of procedure and */
|
||||
/* array modifiers. */
|
||||
for ( ; ; )
|
||||
{ p = skipspace(p - 1, -1);
|
||||
switch ( *p )
|
||||
{
|
||||
case ']': /* skip array dimension(s) */
|
||||
case ')': /* skip procedure args OR name */
|
||||
{ int level = 1;
|
||||
while ( level )
|
||||
switch ( *--p )
|
||||
{
|
||||
case ']': case ')': level++; break;
|
||||
case '[': case '(': level--; break;
|
||||
case '/': p = skipspace(p, -1) + 1; break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
|
||||
{ /* We found the name being declared */
|
||||
while ( !isidfirstchar(*p) )
|
||||
p = skipspace(p, 1) + 1;
|
||||
goto found;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
|
||||
{ if ( convert_varargs )
|
||||
{ *bp++ = "va_alist";
|
||||
vararg = p-2;
|
||||
}
|
||||
else
|
||||
{ p++;
|
||||
if ( bp == breaks + 1 ) /* sole argument */
|
||||
writeblanks(breaks[0], p);
|
||||
else
|
||||
writeblanks(bp[-1] - 1, p);
|
||||
bp--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ while ( isidchar(*p) ) p--;
|
||||
*bp++ = p+1;
|
||||
}
|
||||
p = end;
|
||||
}
|
||||
while ( *p++ == ',' );
|
||||
*bp = p;
|
||||
/* Make a special check for 'void' arglist */
|
||||
if ( bp == breaks+2 )
|
||||
{ p = skipspace(breaks[0], 1);
|
||||
if ( !strncmp(p, "void", 4) )
|
||||
{ p = skipspace(p+4, 1);
|
||||
if ( p == breaks[2] - 1 )
|
||||
{ bp = breaks; /* yup, pretend arglist is empty */
|
||||
writeblanks(breaks[0], p + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Put out the function name and left parenthesis. */
|
||||
p = buf;
|
||||
while ( p != endfn ) putc(*p, out), p++;
|
||||
/* Put out the declaration. */
|
||||
if ( header )
|
||||
{ fputs(");", out);
|
||||
for ( p = breaks[0]; *p; p++ )
|
||||
if ( *p == '\r' || *p == '\n' )
|
||||
putc(*p, out);
|
||||
}
|
||||
else
|
||||
{ for ( ap = breaks+1; ap < bp; ap += 2 )
|
||||
{ p = *ap;
|
||||
while ( isidchar(*p) )
|
||||
putc(*p, out), p++;
|
||||
if ( ap < bp - 1 )
|
||||
fputs(", ", out);
|
||||
}
|
||||
fputs(") ", out);
|
||||
/* Put out the argument declarations */
|
||||
for ( ap = breaks+2; ap <= bp; ap += 2 )
|
||||
(*ap)[-1] = ';';
|
||||
if ( vararg != 0 )
|
||||
{ *vararg = 0;
|
||||
fputs(breaks[0], out); /* any prior args */
|
||||
fputs("va_dcl", out); /* the final arg */
|
||||
fputs(bp[0], out);
|
||||
}
|
||||
else
|
||||
fputs(breaks[0], out);
|
||||
}
|
||||
free((char *)breaks);
|
||||
return 0;
|
||||
}
|
||||
370
bmp.c
Normal file
370
bmp.c
Normal file
@@ -0,0 +1,370 @@
|
||||
/* Copyright (C)2004 Landmark Graphics Corporation
|
||||
* Copyright (C)2005 Sun Microsystems, Inc.
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "./rrutil.h"
|
||||
#include "./bmp.h"
|
||||
|
||||
#ifndef BI_BITFIELDS
|
||||
#define BI_BITFIELDS 3L
|
||||
#endif
|
||||
#ifndef BI_RGB
|
||||
#define BI_RGB 0L
|
||||
#endif
|
||||
|
||||
#define BMPHDRSIZE 54
|
||||
typedef struct _bmphdr
|
||||
{
|
||||
unsigned short bfType;
|
||||
unsigned int bfSize;
|
||||
unsigned short bfReserved1, bfReserved2;
|
||||
unsigned int bfOffBits;
|
||||
|
||||
unsigned int biSize;
|
||||
int biWidth, biHeight;
|
||||
unsigned short biPlanes, biBitCount;
|
||||
unsigned int biCompression, biSizeImage;
|
||||
int biXPelsPerMeter, biYPelsPerMeter;
|
||||
unsigned int biClrUsed, biClrImportant;
|
||||
} bmphdr;
|
||||
|
||||
static const char *__bmperr="No error";
|
||||
|
||||
static const int ps[BMPPIXELFORMATS]={3, 4, 3, 4, 4, 4};
|
||||
static const int roffset[BMPPIXELFORMATS]={0, 0, 2, 2, 3, 1};
|
||||
static const int goffset[BMPPIXELFORMATS]={1, 1, 1, 1, 2, 2};
|
||||
static const int boffset[BMPPIXELFORMATS]={2, 2, 0, 0, 1, 3};
|
||||
|
||||
#define _throw(m) {__bmperr=m; retcode=-1; goto finally;}
|
||||
#define _unix(f) {if((f)==-1) _throw(strerror(errno));}
|
||||
#define _catch(f) {if((f)==-1) {retcode=-1; goto finally;}}
|
||||
|
||||
#define readme(fd, addr, size) \
|
||||
if((bytesread=read(fd, addr, (size)))==-1) _throw(strerror(errno)); \
|
||||
if(bytesread!=(size)) _throw("Read error");
|
||||
|
||||
void pixelconvert(unsigned char *srcbuf, enum BMPPIXELFORMAT srcformat,
|
||||
int srcpitch, unsigned char *dstbuf, enum BMPPIXELFORMAT dstformat, int dstpitch,
|
||||
int w, int h, int flip)
|
||||
{
|
||||
unsigned char *srcptr, *srcptr0, *dstptr, *dstptr0;
|
||||
int i, j;
|
||||
|
||||
srcptr=flip? &srcbuf[srcpitch*(h-1)]:srcbuf;
|
||||
for(j=0, dstptr=dstbuf; j<h; j++,
|
||||
srcptr+=flip? -srcpitch:srcpitch, dstptr+=dstpitch)
|
||||
{
|
||||
for(i=0, srcptr0=srcptr, dstptr0=dstptr; i<w; i++,
|
||||
srcptr0+=ps[srcformat], dstptr0+=ps[dstformat])
|
||||
{
|
||||
dstptr0[roffset[dstformat]]=srcptr0[roffset[srcformat]];
|
||||
dstptr0[goffset[dstformat]]=srcptr0[goffset[srcformat]];
|
||||
dstptr0[boffset[dstformat]]=srcptr0[boffset[srcformat]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int loadppm(int *fd, unsigned char **buf, int *w, int *h,
|
||||
enum BMPPIXELFORMAT f, int align, int dstbottomup, int ascii)
|
||||
{
|
||||
FILE *fs=NULL; int retcode=0, scalefactor, dstpitch;
|
||||
unsigned char *tempbuf=NULL; char temps[255], temps2[255];
|
||||
int numread=0, totalread=0, pixel[3], i, j;
|
||||
|
||||
if((fs=fdopen(*fd, "r"))==NULL) _throw(strerror(errno));
|
||||
|
||||
do
|
||||
{
|
||||
if(!fgets(temps, 255, fs)) _throw("Read error");
|
||||
if(strlen(temps)==0 || temps[0]=='\n') continue;
|
||||
if(sscanf(temps, "%s", temps2)==1 && temps2[1]=='#') continue;
|
||||
switch(totalread)
|
||||
{
|
||||
case 0:
|
||||
if((numread=sscanf(temps, "%d %d %d", w, h, &scalefactor))==EOF)
|
||||
_throw("Read error");
|
||||
break;
|
||||
case 1:
|
||||
if((numread=sscanf(temps, "%d %d", h, &scalefactor))==EOF)
|
||||
_throw("Read error");
|
||||
break;
|
||||
case 2:
|
||||
if((numread=sscanf(temps, "%d", &scalefactor))==EOF)
|
||||
_throw("Read error");
|
||||
break;
|
||||
}
|
||||
totalread+=numread;
|
||||
} while(totalread<3);
|
||||
if((*w)<1 || (*h)<1 || scalefactor<1) _throw("Corrupt PPM header");
|
||||
|
||||
dstpitch=(((*w)*ps[f])+(align-1))&(~(align-1));
|
||||
if((*buf=(unsigned char *)malloc(dstpitch*(*h)))==NULL)
|
||||
_throw("Memory allocation error");
|
||||
if(ascii)
|
||||
{
|
||||
for(j=0; j<*h; j++)
|
||||
{
|
||||
for(i=0; i<*w; i++)
|
||||
{
|
||||
if(fscanf(fs, "%d%d%d", &pixel[0], &pixel[1], &pixel[2])!=3)
|
||||
_throw("Read error");
|
||||
(*buf)[j*dstpitch+i*ps[f]+roffset[f]]=(unsigned char)(pixel[0]*255/scalefactor);
|
||||
(*buf)[j*dstpitch+i*ps[f]+goffset[f]]=(unsigned char)(pixel[1]*255/scalefactor);
|
||||
(*buf)[j*dstpitch+i*ps[f]+boffset[f]]=(unsigned char)(pixel[2]*255/scalefactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(scalefactor!=255)
|
||||
_throw("Binary PPMs must have 8-bit components");
|
||||
if((tempbuf=(unsigned char *)malloc((*w)*(*h)*3))==NULL)
|
||||
_throw("Memory allocation error");
|
||||
if(fread(tempbuf, (*w)*(*h)*3, 1, fs)!=1) _throw("Read error");
|
||||
pixelconvert(tempbuf, BMP_RGB, (*w)*3, *buf, f, dstpitch, *w, *h, dstbottomup);
|
||||
}
|
||||
|
||||
finally:
|
||||
if(fs) {fclose(fs); *fd=-1;}
|
||||
if(tempbuf) free(tempbuf);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
|
||||
int loadbmp(char *filename, unsigned char **buf, int *w, int *h,
|
||||
enum BMPPIXELFORMAT f, int align, int dstbottomup)
|
||||
{
|
||||
int fd=-1, bytesread, srcpitch, srcbottomup=1, srcps, dstpitch,
|
||||
retcode=0;
|
||||
unsigned char *tempbuf=NULL;
|
||||
bmphdr bh; int flags=O_RDONLY;
|
||||
|
||||
dstbottomup=dstbottomup? 1:0;
|
||||
#ifdef _WIN32
|
||||
flags|=O_BINARY;
|
||||
#endif
|
||||
if(!filename || !buf || !w || !h || f<0 || f>BMPPIXELFORMATS-1 || align<1)
|
||||
_throw("invalid argument to loadbmp()");
|
||||
if((align&(align-1))!=0)
|
||||
_throw("Alignment must be a power of 2");
|
||||
_unix(fd=open(filename, flags));
|
||||
|
||||
readme(fd, &bh.bfType, sizeof(unsigned short));
|
||||
if(!littleendian()) bh.bfType=byteswap16(bh.bfType);
|
||||
|
||||
if(bh.bfType==0x3650)
|
||||
{
|
||||
_catch(loadppm(&fd, buf, w, h, f, align, dstbottomup, 0));
|
||||
goto finally;
|
||||
}
|
||||
if(bh.bfType==0x3350)
|
||||
{
|
||||
_catch(loadppm(&fd, buf, w, h, f, align, dstbottomup, 1));
|
||||
goto finally;
|
||||
}
|
||||
|
||||
readme(fd, &bh.bfSize, sizeof(unsigned int));
|
||||
readme(fd, &bh.bfReserved1, sizeof(unsigned short));
|
||||
readme(fd, &bh.bfReserved2, sizeof(unsigned short));
|
||||
readme(fd, &bh.bfOffBits, sizeof(unsigned int));
|
||||
readme(fd, &bh.biSize, sizeof(unsigned int));
|
||||
readme(fd, &bh.biWidth, sizeof(int));
|
||||
readme(fd, &bh.biHeight, sizeof(int));
|
||||
readme(fd, &bh.biPlanes, sizeof(unsigned short));
|
||||
readme(fd, &bh.biBitCount, sizeof(unsigned short));
|
||||
readme(fd, &bh.biCompression, sizeof(unsigned int));
|
||||
readme(fd, &bh.biSizeImage, sizeof(unsigned int));
|
||||
readme(fd, &bh.biXPelsPerMeter, sizeof(int));
|
||||
readme(fd, &bh.biYPelsPerMeter, sizeof(int));
|
||||
readme(fd, &bh.biClrUsed, sizeof(unsigned int));
|
||||
readme(fd, &bh.biClrImportant, sizeof(unsigned int));
|
||||
|
||||
if(!littleendian())
|
||||
{
|
||||
bh.bfSize=byteswap(bh.bfSize);
|
||||
bh.bfOffBits=byteswap(bh.bfOffBits);
|
||||
bh.biSize=byteswap(bh.biSize);
|
||||
bh.biWidth=byteswap(bh.biWidth);
|
||||
bh.biHeight=byteswap(bh.biHeight);
|
||||
bh.biPlanes=byteswap16(bh.biPlanes);
|
||||
bh.biBitCount=byteswap16(bh.biBitCount);
|
||||
bh.biCompression=byteswap(bh.biCompression);
|
||||
bh.biSizeImage=byteswap(bh.biSizeImage);
|
||||
bh.biXPelsPerMeter=byteswap(bh.biXPelsPerMeter);
|
||||
bh.biYPelsPerMeter=byteswap(bh.biYPelsPerMeter);
|
||||
bh.biClrUsed=byteswap(bh.biClrUsed);
|
||||
bh.biClrImportant=byteswap(bh.biClrImportant);
|
||||
}
|
||||
|
||||
if(bh.bfType!=0x4d42 || bh.bfOffBits<BMPHDRSIZE
|
||||
|| bh.biWidth<1 || bh.biHeight==0)
|
||||
_throw("Corrupt bitmap header");
|
||||
if((bh.biBitCount!=24 && bh.biBitCount!=32) || bh.biCompression!=BI_RGB)
|
||||
_throw("Only uncompessed RGB bitmaps are supported");
|
||||
|
||||
*w=bh.biWidth; *h=bh.biHeight; srcps=bh.biBitCount/8;
|
||||
if(*h<0) {*h=-(*h); srcbottomup=0;}
|
||||
srcpitch=(((*w)*srcps)+3)&(~3);
|
||||
dstpitch=(((*w)*ps[f])+(align-1))&(~(align-1));
|
||||
|
||||
if(srcpitch*(*h)+bh.bfOffBits!=bh.bfSize) _throw("Corrupt bitmap header");
|
||||
if((tempbuf=(unsigned char *)malloc(srcpitch*(*h)))==NULL
|
||||
|| (*buf=(unsigned char *)malloc(dstpitch*(*h)))==NULL)
|
||||
_throw("Memory allocation error");
|
||||
if(lseek(fd, (long)bh.bfOffBits, SEEK_SET)!=(long)bh.bfOffBits)
|
||||
_throw(strerror(errno));
|
||||
_unix(bytesread=read(fd, tempbuf, srcpitch*(*h)));
|
||||
if(bytesread!=srcpitch*(*h)) _throw("Read error");
|
||||
|
||||
pixelconvert(tempbuf, BMP_BGR, srcpitch, *buf, f, dstpitch, *w, *h,
|
||||
srcbottomup!=dstbottomup);
|
||||
|
||||
finally:
|
||||
if(tempbuf) free(tempbuf);
|
||||
if(fd!=-1) close(fd);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
#define writeme(fd, addr, size) \
|
||||
if((byteswritten=write(fd, addr, (size)))==-1) _throw(strerror(errno)); \
|
||||
if(byteswritten!=(size)) _throw("Write error");
|
||||
|
||||
int saveppm(char *filename, unsigned char *buf, int w, int h,
|
||||
enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup)
|
||||
{
|
||||
FILE *fs=NULL; int retcode=0;
|
||||
unsigned char *tempbuf=NULL;
|
||||
|
||||
if((fs=fopen(filename, "wb"))==NULL) _throw(strerror(errno));
|
||||
if(fprintf(fs, "P6\n")<1) _throw("Write error");
|
||||
if(fprintf(fs, "%d %d\n", w, h)<1) _throw("Write error");
|
||||
if(fprintf(fs, "255\n")<1) _throw("Write error");
|
||||
|
||||
if((tempbuf=(unsigned char *)malloc(w*h*3))==NULL)
|
||||
_throw("Memory allocation error");
|
||||
|
||||
pixelconvert(buf, f, srcpitch, tempbuf, BMP_RGB, w*3, w, h,
|
||||
srcbottomup);
|
||||
|
||||
if((fwrite(tempbuf, w*h*3, 1, fs))!=1) _throw("Write error");
|
||||
|
||||
finally:
|
||||
if(tempbuf) free(tempbuf);
|
||||
if(fs) fclose(fs);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
int savebmp(char *filename, unsigned char *buf, int w, int h,
|
||||
enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup)
|
||||
{
|
||||
int fd=-1, byteswritten, dstpitch, retcode=0;
|
||||
int flags=O_RDWR|O_CREAT|O_TRUNC;
|
||||
unsigned char *tempbuf=NULL; char *temp;
|
||||
bmphdr bh; int mode;
|
||||
|
||||
#ifdef _WIN32
|
||||
flags|=O_BINARY; mode=_S_IREAD|_S_IWRITE;
|
||||
#else
|
||||
mode=S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
|
||||
#endif
|
||||
if(!filename || !buf || w<1 || h<1 || f<0 || f>BMPPIXELFORMATS-1 || srcpitch<0)
|
||||
_throw("bad argument to savebmp()");
|
||||
|
||||
if(srcpitch==0) srcpitch=w*ps[f];
|
||||
|
||||
if((temp=strrchr(filename, '.'))!=NULL)
|
||||
{
|
||||
if(!stricmp(temp, ".ppm"))
|
||||
return saveppm(filename, buf, w, h, f, srcpitch, srcbottomup);
|
||||
}
|
||||
|
||||
_unix(fd=open(filename, flags, mode));
|
||||
dstpitch=((w*3)+3)&(~3);
|
||||
|
||||
bh.bfType=0x4d42;
|
||||
bh.bfSize=BMPHDRSIZE+dstpitch*h;
|
||||
bh.bfReserved1=0; bh.bfReserved2=0;
|
||||
bh.bfOffBits=BMPHDRSIZE;
|
||||
bh.biSize=40;
|
||||
bh.biWidth=w; bh.biHeight=h;
|
||||
bh.biPlanes=0; bh.biBitCount=24;
|
||||
bh.biCompression=BI_RGB; bh.biSizeImage=0;
|
||||
bh.biXPelsPerMeter=0; bh.biYPelsPerMeter=0;
|
||||
bh.biClrUsed=0; bh.biClrImportant=0;
|
||||
|
||||
if(!littleendian())
|
||||
{
|
||||
bh.bfType=byteswap16(bh.bfType);
|
||||
bh.bfSize=byteswap(bh.bfSize);
|
||||
bh.bfOffBits=byteswap(bh.bfOffBits);
|
||||
bh.biSize=byteswap(bh.biSize);
|
||||
bh.biWidth=byteswap(bh.biWidth);
|
||||
bh.biHeight=byteswap(bh.biHeight);
|
||||
bh.biPlanes=byteswap16(bh.biPlanes);
|
||||
bh.biBitCount=byteswap16(bh.biBitCount);
|
||||
bh.biCompression=byteswap(bh.biCompression);
|
||||
bh.biSizeImage=byteswap(bh.biSizeImage);
|
||||
bh.biXPelsPerMeter=byteswap(bh.biXPelsPerMeter);
|
||||
bh.biYPelsPerMeter=byteswap(bh.biYPelsPerMeter);
|
||||
bh.biClrUsed=byteswap(bh.biClrUsed);
|
||||
bh.biClrImportant=byteswap(bh.biClrImportant);
|
||||
}
|
||||
|
||||
writeme(fd, &bh.bfType, sizeof(unsigned short));
|
||||
writeme(fd, &bh.bfSize, sizeof(unsigned int));
|
||||
writeme(fd, &bh.bfReserved1, sizeof(unsigned short));
|
||||
writeme(fd, &bh.bfReserved2, sizeof(unsigned short));
|
||||
writeme(fd, &bh.bfOffBits, sizeof(unsigned int));
|
||||
writeme(fd, &bh.biSize, sizeof(unsigned int));
|
||||
writeme(fd, &bh.biWidth, sizeof(int));
|
||||
writeme(fd, &bh.biHeight, sizeof(int));
|
||||
writeme(fd, &bh.biPlanes, sizeof(unsigned short));
|
||||
writeme(fd, &bh.biBitCount, sizeof(unsigned short));
|
||||
writeme(fd, &bh.biCompression, sizeof(unsigned int));
|
||||
writeme(fd, &bh.biSizeImage, sizeof(unsigned int));
|
||||
writeme(fd, &bh.biXPelsPerMeter, sizeof(int));
|
||||
writeme(fd, &bh.biYPelsPerMeter, sizeof(int));
|
||||
writeme(fd, &bh.biClrUsed, sizeof(unsigned int));
|
||||
writeme(fd, &bh.biClrImportant, sizeof(unsigned int));
|
||||
|
||||
if((tempbuf=(unsigned char *)malloc(dstpitch*h))==NULL)
|
||||
_throw("Memory allocation error");
|
||||
|
||||
pixelconvert(buf, f, srcpitch, tempbuf, BMP_BGR, dstpitch, w, h,
|
||||
!srcbottomup);
|
||||
|
||||
if((byteswritten=write(fd, tempbuf, dstpitch*h))!=dstpitch*h)
|
||||
_throw(strerror(errno));
|
||||
|
||||
finally:
|
||||
if(tempbuf) free(tempbuf);
|
||||
if(fd!=-1) close(fd);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
const char *bmpgeterr(void)
|
||||
{
|
||||
return __bmperr;
|
||||
}
|
||||
48
bmp.h
Normal file
48
bmp.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Copyright (C)2004 Landmark Graphics Corporation
|
||||
* Copyright (C)2005 Sun Microsystems, Inc.
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
// This provides rudimentary facilities for loading and saving true color
|
||||
// BMP and PPM files
|
||||
|
||||
#ifndef __BMP_H__
|
||||
#define __BMP_H__
|
||||
|
||||
#define BMPPIXELFORMATS 6
|
||||
enum BMPPIXELFORMAT {BMP_RGB=0, BMP_RGBA, BMP_BGR, BMP_BGRA, BMP_ABGR, BMP_ARGB};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// This will load a Windows bitmap from a file and return a buffer with the
|
||||
// specified pixel format, scanline alignment, and orientation. The width and
|
||||
// height are returned in w and h.
|
||||
|
||||
int loadbmp(char *filename, unsigned char **buf, int *w, int *h,
|
||||
enum BMPPIXELFORMAT f, int align, int dstbottomup);
|
||||
|
||||
// This will save a buffer with the specified pixel format, pitch, orientation,
|
||||
// width, and height as a 24-bit Windows bitmap or PPM (the filename determines
|
||||
// which format to use)
|
||||
|
||||
int savebmp(char *filename, unsigned char *buf, int w, int h,
|
||||
enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup);
|
||||
|
||||
const char *bmpgeterr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
402
ckconfig.c
402
ckconfig.c
@@ -1,402 +0,0 @@
|
||||
/*
|
||||
* ckconfig.c
|
||||
*
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is intended to help you determine how to configure the JPEG
|
||||
* software for installation on a particular system. The idea is to try to
|
||||
* compile and execute this program. If your compiler fails to compile the
|
||||
* program, make changes as indicated in the comments below. Once you can
|
||||
* compile the program, run it, and it will produce a "jconfig.h" file for
|
||||
* your system.
|
||||
*
|
||||
* As a general rule, each time you try to compile this program,
|
||||
* pay attention only to the *first* error message you get from the compiler.
|
||||
* Many C compilers will issue lots of spurious error messages once they
|
||||
* have gotten confused. Go to the line indicated in the first error message,
|
||||
* and read the comments preceding that line to see what to change.
|
||||
*
|
||||
* Almost all of the edits you may need to make to this program consist of
|
||||
* changing a line that reads "#define SOME_SYMBOL" to "#undef SOME_SYMBOL",
|
||||
* or vice versa. This is called defining or undefining that symbol.
|
||||
*/
|
||||
|
||||
|
||||
/* First we must see if your system has the include files we need.
|
||||
* We start out with the assumption that your system has all the ANSI-standard
|
||||
* include files. If you get any error trying to include one of these files,
|
||||
* undefine the corresponding HAVE_xxx symbol.
|
||||
*/
|
||||
|
||||
#define HAVE_STDDEF_H /* replace 'define' by 'undef' if error here */
|
||||
#ifdef HAVE_STDDEF_H /* next line will be skipped if you undef... */
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#define HAVE_STDLIB_H /* same thing for stdlib.h */
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h> /* If you ain't got this, you ain't got C. */
|
||||
|
||||
/* We have to see if your string functions are defined by
|
||||
* strings.h (old BSD convention) or string.h (everybody else).
|
||||
* We try the non-BSD convention first; define NEED_BSD_STRINGS
|
||||
* if the compiler says it can't find string.h.
|
||||
*/
|
||||
|
||||
#undef NEED_BSD_STRINGS
|
||||
|
||||
#ifdef NEED_BSD_STRINGS
|
||||
#include <strings.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* On some systems (especially older Unix machines), type size_t is
|
||||
* defined only in the include file <sys/types.h>. If you get a failure
|
||||
* on the size_t test below, try defining NEED_SYS_TYPES_H.
|
||||
*/
|
||||
|
||||
#undef NEED_SYS_TYPES_H /* start by assuming we don't need it */
|
||||
#ifdef NEED_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Usually type size_t is defined in one of the include files we've included
|
||||
* above. If not, you'll get an error on the "typedef size_t my_size_t;" line.
|
||||
* In that case, first try defining NEED_SYS_TYPES_H just above.
|
||||
* If that doesn't work, you'll have to search through your system library
|
||||
* to figure out which include file defines "size_t". Look for a line that
|
||||
* says "typedef something-or-other size_t;". Then, change the line below
|
||||
* that says "#include <someincludefile.h>" to instead include the file
|
||||
* you found size_t in, and define NEED_SPECIAL_INCLUDE. If you can't find
|
||||
* type size_t anywhere, try replacing "#include <someincludefile.h>" with
|
||||
* "typedef unsigned int size_t;".
|
||||
*/
|
||||
|
||||
#undef NEED_SPECIAL_INCLUDE /* assume we DON'T need it, for starters */
|
||||
|
||||
#ifdef NEED_SPECIAL_INCLUDE
|
||||
#include <someincludefile.h>
|
||||
#endif
|
||||
|
||||
typedef size_t my_size_t; /* The payoff: do we have size_t now? */
|
||||
|
||||
|
||||
/* The next question is whether your compiler supports ANSI-style function
|
||||
* prototypes. You need to know this in order to choose between using
|
||||
* makefile.ansi and using makefile.unix.
|
||||
* The #define line below is set to assume you have ANSI function prototypes.
|
||||
* If you get an error in this group of lines, undefine HAVE_PROTOTYPES.
|
||||
*/
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
int testfunction (int arg1, int * arg2); /* check prototypes */
|
||||
|
||||
struct methods_struct { /* check method-pointer declarations */
|
||||
int (*error_exit) (char *msgtext);
|
||||
int (*trace_message) (char *msgtext);
|
||||
int (*another_method) (void);
|
||||
};
|
||||
|
||||
int testfunction (int arg1, int * arg2) /* check definitions */
|
||||
{
|
||||
return arg2[arg1];
|
||||
}
|
||||
|
||||
int test2function (void) /* check void arg list */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "unsigned char" means.
|
||||
* If you get an error on the "unsigned char un_char;" line,
|
||||
* then undefine HAVE_UNSIGNED_CHAR.
|
||||
*/
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
unsigned char un_char;
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "unsigned short" means.
|
||||
* If you get an error on the "unsigned short un_short;" line,
|
||||
* then undefine HAVE_UNSIGNED_SHORT.
|
||||
*/
|
||||
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
unsigned short un_short;
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler understands type "void".
|
||||
* If you get an error anywhere in here, undefine HAVE_VOID.
|
||||
*/
|
||||
|
||||
#define HAVE_VOID
|
||||
|
||||
#ifdef HAVE_VOID
|
||||
/* Caution: a C++ compiler will insist on complete prototypes */
|
||||
typedef void * void_ptr; /* check void * */
|
||||
#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */
|
||||
typedef void (*void_func) (int a, int b);
|
||||
#else
|
||||
typedef void (*void_func) ();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PROTOTYPES /* check void function result */
|
||||
void test3function (void_ptr arg1, void_func arg2)
|
||||
#else
|
||||
void test3function (arg1, arg2)
|
||||
void_ptr arg1;
|
||||
void_func arg2;
|
||||
#endif
|
||||
{
|
||||
char * locptr = (char *) arg1; /* check casting to and from void * */
|
||||
arg1 = (void *) locptr;
|
||||
(*arg2) (1, 2); /* check call of fcn returning void */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "const" means.
|
||||
* If you get an error here, undefine HAVE_CONST.
|
||||
*/
|
||||
|
||||
#define HAVE_CONST
|
||||
|
||||
#ifdef HAVE_CONST
|
||||
static const int carray[3] = {1, 2, 3};
|
||||
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
int test4function (const int arg1)
|
||||
#else
|
||||
int test4function (arg1)
|
||||
const int arg1;
|
||||
#endif
|
||||
{
|
||||
return carray[arg1];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* If you get an error or warning about this structure definition,
|
||||
* define INCOMPLETE_TYPES_BROKEN.
|
||||
*/
|
||||
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifndef INCOMPLETE_TYPES_BROKEN
|
||||
typedef struct undefined_structure * undef_struct_ptr;
|
||||
#endif
|
||||
|
||||
|
||||
/* If you get an error about duplicate names,
|
||||
* define NEED_SHORT_EXTERNAL_NAMES.
|
||||
*/
|
||||
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
|
||||
#ifndef NEED_SHORT_EXTERNAL_NAMES
|
||||
|
||||
int possibly_duplicate_function ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int possibly_dupli_function ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* OK, that's it. You should not have to change anything beyond this
|
||||
* point in order to compile and execute this program. (You might get
|
||||
* some warnings, but you can ignore them.)
|
||||
* When you run the program, it will make a couple more tests that it
|
||||
* can do automatically, and then it will create jconfig.h and print out
|
||||
* any additional suggestions it has.
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
int is_char_signed (int arg)
|
||||
#else
|
||||
int is_char_signed (arg)
|
||||
int arg;
|
||||
#endif
|
||||
{
|
||||
if (arg == 189) { /* expected result for unsigned char */
|
||||
return 0; /* type char is unsigned */
|
||||
}
|
||||
else if (arg != -67) { /* expected result for signed char */
|
||||
printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n\n");
|
||||
}
|
||||
return 1; /* assume char is signed otherwise */
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
int is_shifting_signed (long arg)
|
||||
#else
|
||||
int is_shifting_signed (arg)
|
||||
long arg;
|
||||
#endif
|
||||
/* See whether right-shift on a long is signed or not. */
|
||||
{
|
||||
long res = arg >> 4;
|
||||
|
||||
if (res == -0x7F7E80CL) { /* expected result for signed shift */
|
||||
return 1; /* right shift is signed */
|
||||
}
|
||||
/* see if unsigned-shift hack will fix it. */
|
||||
/* we can't just test exact value since it depends on width of long... */
|
||||
res |= (~0L) << (32-4);
|
||||
if (res == -0x7F7E80CL) { /* expected result now? */
|
||||
return 0; /* right shift is unsigned */
|
||||
}
|
||||
printf("Right shift isn't acting as I expect it to.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n\n");
|
||||
return 0; /* try it with unsigned anyway */
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
int main (int argc, char ** argv)
|
||||
#else
|
||||
int main (argc, argv)
|
||||
int argc;
|
||||
char ** argv;
|
||||
#endif
|
||||
{
|
||||
char signed_char_check = (char) (-67);
|
||||
FILE *outfile;
|
||||
|
||||
/* Attempt to write jconfig.h */
|
||||
if ((outfile = fopen("jconfig.h", "w")) == NULL) {
|
||||
printf("Failed to write jconfig.h\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Write out all the info */
|
||||
fprintf(outfile, "/* jconfig.h --- generated by ckconfig.c */\n");
|
||||
fprintf(outfile, "/* see jconfig.doc for explanations */\n\n");
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
fprintf(outfile, "#define HAVE_PROTOTYPES\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef HAVE_PROTOTYPES\n");
|
||||
#endif
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
fprintf(outfile, "#define HAVE_UNSIGNED_CHAR\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef HAVE_UNSIGNED_CHAR\n");
|
||||
#endif
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
fprintf(outfile, "#define HAVE_UNSIGNED_SHORT\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef HAVE_UNSIGNED_SHORT\n");
|
||||
#endif
|
||||
#ifdef HAVE_VOID
|
||||
fprintf(outfile, "/* #define void char */\n");
|
||||
#else
|
||||
fprintf(outfile, "#define void char\n");
|
||||
#endif
|
||||
#ifdef HAVE_CONST
|
||||
fprintf(outfile, "/* #define const */\n");
|
||||
#else
|
||||
fprintf(outfile, "#define const\n");
|
||||
#endif
|
||||
if (is_char_signed((int) signed_char_check))
|
||||
fprintf(outfile, "#undef CHAR_IS_UNSIGNED\n");
|
||||
else
|
||||
fprintf(outfile, "#define CHAR_IS_UNSIGNED\n");
|
||||
#ifdef HAVE_STDDEF_H
|
||||
fprintf(outfile, "#define HAVE_STDDEF_H\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef HAVE_STDDEF_H\n");
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
fprintf(outfile, "#define HAVE_STDLIB_H\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef HAVE_STDLIB_H\n");
|
||||
#endif
|
||||
#ifdef NEED_BSD_STRINGS
|
||||
fprintf(outfile, "#define NEED_BSD_STRINGS\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef NEED_BSD_STRINGS\n");
|
||||
#endif
|
||||
#ifdef NEED_SYS_TYPES_H
|
||||
fprintf(outfile, "#define NEED_SYS_TYPES_H\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef NEED_SYS_TYPES_H\n");
|
||||
#endif
|
||||
fprintf(outfile, "#undef NEED_FAR_POINTERS\n");
|
||||
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
||||
fprintf(outfile, "#define NEED_SHORT_EXTERNAL_NAMES\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef NEED_SHORT_EXTERNAL_NAMES\n");
|
||||
#endif
|
||||
#ifdef INCOMPLETE_TYPES_BROKEN
|
||||
fprintf(outfile, "#define INCOMPLETE_TYPES_BROKEN\n");
|
||||
#else
|
||||
fprintf(outfile, "#undef INCOMPLETE_TYPES_BROKEN\n");
|
||||
#endif
|
||||
fprintf(outfile, "\n#ifdef JPEG_INTERNALS\n\n");
|
||||
if (is_shifting_signed(-0x7F7E80B1L))
|
||||
fprintf(outfile, "#undef RIGHT_SHIFT_IS_UNSIGNED\n");
|
||||
else
|
||||
fprintf(outfile, "#define RIGHT_SHIFT_IS_UNSIGNED\n");
|
||||
fprintf(outfile, "\n#endif /* JPEG_INTERNALS */\n");
|
||||
fprintf(outfile, "\n#ifdef JPEG_CJPEG_DJPEG\n\n");
|
||||
fprintf(outfile, "#define BMP_SUPPORTED /* BMP image file format */\n");
|
||||
fprintf(outfile, "#define GIF_SUPPORTED /* GIF image file format */\n");
|
||||
fprintf(outfile, "#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */\n");
|
||||
fprintf(outfile, "#undef RLE_SUPPORTED /* Utah RLE image file format */\n");
|
||||
fprintf(outfile, "#define TARGA_SUPPORTED /* Targa image file format */\n\n");
|
||||
fprintf(outfile, "#undef TWO_FILE_COMMANDLINE /* You may need this on non-Unix systems */\n");
|
||||
fprintf(outfile, "#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */\n");
|
||||
fprintf(outfile, "#undef DONT_USE_B_MODE\n");
|
||||
fprintf(outfile, "/* #define PROGRESS_REPORT */ /* optional */\n");
|
||||
fprintf(outfile, "\n#endif /* JPEG_CJPEG_DJPEG */\n");
|
||||
|
||||
/* Close the jconfig.h file */
|
||||
fclose(outfile);
|
||||
|
||||
/* User report */
|
||||
printf("Configuration check for Independent JPEG Group's software done.\n");
|
||||
printf("\nI have written the jconfig.h file for you.\n\n");
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
printf("You should use makefile.ansi as the starting point for your Makefile.\n");
|
||||
#else
|
||||
printf("You should use makefile.unix as the starting point for your Makefile.\n");
|
||||
#endif
|
||||
|
||||
#ifdef NEED_SPECIAL_INCLUDE
|
||||
printf("\nYou'll need to change jconfig.h to include the system include file\n");
|
||||
printf("that you found type size_t in, or add a direct definition of type\n");
|
||||
printf("size_t if that's what you used. Just add it to the end.\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
883
config.guess
vendored
883
config.guess
vendored
@@ -1,883 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit system type (host/target name).
|
||||
#
|
||||
# Only a few systems have been added to this list; please add others
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
PATH=$PATH:/.attbin ; export PATH
|
||||
fi
|
||||
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
fi
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
exit 0 ;;
|
||||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-cbm-sysv4
|
||||
exit 0;;
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc64:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hkmips:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
arm32:NetBSD:*:*)
|
||||
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
else
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
NILE:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
||||
# it's likely to be more like Solaris than SunOS4.
|
||||
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:*:*)
|
||||
case "`/usr/bin/arch -k`" in
|
||||
Series*|S4*)
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
|
||||
exit 0 ;;
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun*:*:4.2BSD:*)
|
||||
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
|
||||
case "`/bin/arch`" in
|
||||
sun3)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
;;
|
||||
sun4)
|
||||
echo sparc-sun-sunos${UNAME_RELEASE}
|
||||
;;
|
||||
esac
|
||||
exit 0 ;;
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:Mach:*:*)
|
||||
echo mips-dec-mach_bsd4.3
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
2020:CLIX:*:*)
|
||||
echo clipper-intergraph-clix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
int main (argc, argv) int argc; char **argv; {
|
||||
#if defined (host_mips) && defined (MIPSEB)
|
||||
#if defined (SYSTYPE_SYSV)
|
||||
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_SVR4)
|
||||
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
|
||||
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy \
|
||||
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
echo powerpc-harris-powerunix
|
||||
exit 0 ;;
|
||||
m88k:CX/UX:7*:*)
|
||||
echo m88k-harris-cxux7
|
||||
exit 0 ;;
|
||||
m88k:*:4*:R4*)
|
||||
echo m88k-motorola-sysv4
|
||||
exit 0 ;;
|
||||
m88k:*:3*:R3*)
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
||||
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
else
|
||||
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
||||
fi
|
||||
else echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit 0 ;;
|
||||
M88*:*:R3*:*)
|
||||
# Delta 88k system running SVR3
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
||||
echo m88k-tektronix-sysv3
|
||||
exit 0 ;;
|
||||
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
||||
echo m68k-tektronix-bsd
|
||||
exit 0 ;;
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
||||
exit 0 ;;
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
||||
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
||||
i?86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
puts("powerpc-ibm-aix3.2.5");
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
else
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:4)
|
||||
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
IBM_ARCH=powerpc
|
||||
fi
|
||||
if [ -x /usr/bin/oslevel ] ; then
|
||||
IBM_REV=`/usr/bin/oslevel`
|
||||
else
|
||||
IBM_REV=4.${UNAME_RELEASE}
|
||||
fi
|
||||
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
|
||||
exit 0 ;;
|
||||
*:AIX:*:*)
|
||||
echo rs6000-ibm-aix
|
||||
exit 0 ;;
|
||||
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
||||
echo romp-ibm-bsd4.4
|
||||
exit 0 ;;
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
||||
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
||||
exit 0 ;; # report: romp-ibm BSD 4.3
|
||||
*:BOSX:*:*)
|
||||
echo rs6000-bull-bosx
|
||||
exit 0 ;;
|
||||
DPX/2?00:B.O.S.:*:*)
|
||||
echo m68k-bull-sysv3
|
||||
exit 0 ;;
|
||||
9000/[34]??:4.3bsd:1.*:*)
|
||||
echo m68k-hp-bsd
|
||||
exit 0 ;;
|
||||
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
||||
echo m68k-hp-bsd4.4
|
||||
exit 0 ;;
|
||||
9000/[3478]??:HP-UX:*:*)
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
|
||||
9000/8?? ) HP_ARCH=hppa1.0 ;;
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
|
||||
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
|
||||
results, however. */
|
||||
if (CPU_IS_PA_RISC (cpu))
|
||||
{
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
||||
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
||||
}
|
||||
}
|
||||
else if (CPU_IS_HP_MC68K (cpu))
|
||||
puts ("m68k-hitachi-hiuxwe2");
|
||||
else puts ("unknown-hitachi-hiuxwe2");
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
echo hppa1.1-hp-bsd
|
||||
exit 0 ;;
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
hp8??:OSF1:*:*)
|
||||
echo hppa1.0-hp-osf
|
||||
exit 0 ;;
|
||||
i?86:OSF1:*:*)
|
||||
if [ -x /usr/sbin/sysversion ] ; then
|
||||
echo ${UNAME_MACHINE}-unknown-osf1mk
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-osf1
|
||||
fi
|
||||
exit 0 ;;
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*[A-Z]90:*:*:*)
|
||||
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
|
||||
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
F301:UNIX_System_V:*:*)
|
||||
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo i386-pc-cygwin32
|
||||
exit 0 ;;
|
||||
i*:MINGW*:*)
|
||||
echo i386-pc-mingw32
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin32
|
||||
exit 0 ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
ld_supported_emulations=`echo $ld_help_string \
|
||||
| sed -ne '/supported emulations:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported emulations: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_emulations" in
|
||||
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
|
||||
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
|
||||
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
sed 's/^ //' <<EOF >dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
|
||||
objdump --private-headers dummy | \
|
||||
grep ld.so.1 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "mips" ; then
|
||||
cat >dummy.c <<EOF
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __MIPSEB__
|
||||
printf ("%s-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
#ifdef __MIPSEL__
|
||||
printf ("%sel-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld)
|
||||
# or one that does not give us useful --help.
|
||||
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
|
||||
# If ld does not provide *any* "supported emulations:"
|
||||
# that means it is gnuoldld.
|
||||
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
|
||||
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
||||
|
||||
case "${UNAME_MACHINE}" in
|
||||
i?86)
|
||||
VENDOR=pc;
|
||||
;;
|
||||
*)
|
||||
VENDOR=unknown;
|
||||
;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
#include <features.h>
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
#else
|
||||
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
i?86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i?86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# I just have to hope. -- rms.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
echo i386-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit 0 ;;
|
||||
paragon:*:*:*)
|
||||
echo i860-intel-osf1
|
||||
exit 0 ;;
|
||||
i860:*:4.*:*) # i860-SVR4
|
||||
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
|
||||
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
|
||||
else # Add other i860-SVR4 vendors below as they are discovered.
|
||||
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
|
||||
fi
|
||||
exit 0 ;;
|
||||
mini*:CTIX:SYS*5:*)
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4 && exit 0 ;;
|
||||
m68*:LynxOS:2.*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i?86:LynxOS:2.*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
*:SINIX-*:*:*)
|
||||
if uname -p 2>/dev/null >/dev/null ; then
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
echo ${UNAME_MACHINE}-sni-sysv4
|
||||
else
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit 0 ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
echo hppa1.1-stratus-sysv4
|
||||
exit 0 ;;
|
||||
*:*:*:FTX*)
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
mc68*:A/UX:*:*)
|
||||
echo m68k-apple-aux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
news*:NEWS-OS:*:6*)
|
||||
echo mips-sony-newsos6
|
||||
exit 0 ;;
|
||||
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
#if !defined (ultrix)
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
#else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#echo '(Unable to guess system type)' 1>&2
|
||||
|
||||
exit 1
|
||||
954
config.sub
vendored
954
config.sub
vendored
@@ -1,954 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
# Each package is responsible for reporting which valid configurations
|
||||
# it does not support. The user should be able to distinguish
|
||||
# a failure to support a valid configuration from a meaningless
|
||||
# configuration.
|
||||
|
||||
# The goal of this file is to map all the various variations of a given
|
||||
# machine specification into a single specification in the form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or in some cases, the newer four-part form:
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
then
|
||||
echo Configuration name missing. 1>&2
|
||||
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
|
||||
echo "or $0 ALIAS" 1>&2
|
||||
echo where ALIAS is a recognized configuration type. 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# First pass through any local machine types.
|
||||
case $1 in
|
||||
*local*)
|
||||
echo $1
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# 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.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
linux-gnu*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
then os=`echo $1 | sed 's/.*-/-/'`
|
||||
else os=; fi
|
||||
;;
|
||||
esac
|
||||
|
||||
### Let's recognize common machines as not being operating systems so
|
||||
### that things like config.sub decstation-3100 work. We also
|
||||
### recognize some manufacturers as not being operating systems, so we
|
||||
### can provide default operating systems below.
|
||||
case $os in
|
||||
-sun*os*)
|
||||
# Prevent following clause from handling this invalid input.
|
||||
;;
|
||||
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
|
||||
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
|
||||
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
os=-sco3.2v4
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2.[4-9]*)
|
||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2v[4-9]*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-clix*)
|
||||
basic_machine=clipper-intergraph
|
||||
;;
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
-ptx*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
|
||||
;;
|
||||
-windowsnt*)
|
||||
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||
;;
|
||||
-psos*)
|
||||
os=-psos
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode aliases for certain CPU-COMPANY combinations.
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[3456]86)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
*-*-*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
|
||||
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
|
||||
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
altos | altos3068)
|
||||
basic_machine=m68k-altos
|
||||
;;
|
||||
am29k)
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
;;
|
||||
amiga | amiga-*)
|
||||
basic_machine=m68k-cbm
|
||||
;;
|
||||
amigaos | amigados)
|
||||
basic_machine=m68k-cbm
|
||||
os=-amigaos
|
||||
;;
|
||||
amigaunix | amix)
|
||||
basic_machine=m68k-cbm
|
||||
os=-sysv4
|
||||
;;
|
||||
apollo68)
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
;;
|
||||
balance)
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c2)
|
||||
basic_machine=c2-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c32)
|
||||
basic_machine=c32-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c34)
|
||||
basic_machine=c34-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c38)
|
||||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[ctj]90-cray)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
basic_machine=mips-dec
|
||||
;;
|
||||
delta | 3300 | motorola-3300 | motorola-delta \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
;;
|
||||
delta88)
|
||||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dpx20 | dpx20-*)
|
||||
basic_machine=rs6000-bull
|
||||
os=-bosx
|
||||
;;
|
||||
dpx2* | dpx2*-bull)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv3
|
||||
;;
|
||||
ebmon29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-ebmon
|
||||
;;
|
||||
elxsi)
|
||||
basic_machine=elxsi-elxsi
|
||||
os=-bsd
|
||||
;;
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
genix)
|
||||
basic_machine=ns32k-ns
|
||||
;;
|
||||
gmicro)
|
||||
basic_machine=tron-gmicro
|
||||
os=-sysv
|
||||
;;
|
||||
h3050r* | hiux*)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
h8300hms)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
;;
|
||||
hp300-*)
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp300bsd)
|
||||
basic_machine=m68k-hp
|
||||
os=-bsd
|
||||
;;
|
||||
hp300hpux)
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp9k2[0-9][0-9] | hp9k31[0-9])
|
||||
basic_machine=m68000-hp
|
||||
;;
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[3456]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[3456]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[3456]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[3456]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
-irix*)
|
||||
;;
|
||||
*)
|
||||
os=-irix4
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
isi68 | isi)
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
magnum | m3230)
|
||||
basic_machine=mips-mips
|
||||
os=-sysv
|
||||
;;
|
||||
merlin)
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
basic_machine=m68k-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news1000)
|
||||
basic_machine=m68030-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news-3600 | risc-news)
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
-nextstep* )
|
||||
;;
|
||||
-ns2*)
|
||||
os=-nextstep2
|
||||
;;
|
||||
*)
|
||||
os=-nextstep3
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
nh3000)
|
||||
basic_machine=m68k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nh[45]000)
|
||||
basic_machine=m88k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nindy960)
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
paragon)
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5)
|
||||
basic_machine=i586-intel
|
||||
;;
|
||||
pentiumpro | p6)
|
||||
basic_machine=i686-intel
|
||||
;;
|
||||
pentium-* | p5-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
k5)
|
||||
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
|
||||
basic_machine=i586-amd
|
||||
;;
|
||||
nexen)
|
||||
# We don't have specific support for Nexgen yet, so just call it a Pentium
|
||||
basic_machine=i586-nexgen
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=rs6000-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
sh)
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
;;
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
sun2os3)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun2os4)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun3os3)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun3os4)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4os3)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun4os4)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4sol2)
|
||||
basic_machine=sparc-sun
|
||||
os=-solaris2
|
||||
;;
|
||||
sun3 | sun3-*)
|
||||
basic_machine=m68k-sun
|
||||
;;
|
||||
sun4)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
symmetry)
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
ultra3)
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
;;
|
||||
vms)
|
||||
basic_machine=vax-dec
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks68)
|
||||
basic_machine=m68k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks29k)
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
;;
|
||||
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
rs6000)
|
||||
basic_machine=rs6000-ibm
|
||||
;;
|
||||
vax)
|
||||
basic_machine=vax-dec
|
||||
;;
|
||||
pdp11)
|
||||
basic_machine=pdp11-dec
|
||||
;;
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
basic_machine=orion-highlevel
|
||||
;;
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Here we canonicalize certain aliases for manufacturers.
|
||||
case $basic_machine in
|
||||
*-digital*)
|
||||
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
|
||||
;;
|
||||
*-commodore*)
|
||||
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode manufacturer-specific aliases for certain operating systems.
|
||||
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
-solaris)
|
||||
os=-solaris2
|
||||
;;
|
||||
-svr4*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-unixware*)
|
||||
os=-sysv4.2uw
|
||||
;;
|
||||
-gnu/linux*)
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||
;;
|
||||
# First accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
-sunos6*)
|
||||
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||
;;
|
||||
-osfrose*)
|
||||
os=-osfrose
|
||||
;;
|
||||
-osf*)
|
||||
os=-osf
|
||||
;;
|
||||
-utek*)
|
||||
os=-bsd
|
||||
;;
|
||||
-dynix*)
|
||||
os=-bsd
|
||||
;;
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
;;
|
||||
# Preserve the version number of sinix5.
|
||||
-sinix5.*)
|
||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||
;;
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-oss*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-svr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
-svr3)
|
||||
os=-sysv3
|
||||
;;
|
||||
-sysvr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
# Get rid of the `-' at the beginning of $os.
|
||||
os=`echo $os | sed 's/[^-]*-//'`
|
||||
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
||||
# Here we handle the default operating systems that come with various machines.
|
||||
# The value should be what the vendor currently ships out the door with their
|
||||
# machine or put another way, the most popular os provided with the machine.
|
||||
|
||||
# Note that if you're going to try to match "-MANUFACTURER" here (say,
|
||||
# "-sun"), then you have to tell the case statement up towards the top
|
||||
# that MANUFACTURER isn't an operating system. Otherwise, code above
|
||||
# will signal an error saying that MANUFACTURER isn't an operating
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
os=-ultrix4.2
|
||||
;;
|
||||
m68*-apollo)
|
||||
os=-domain
|
||||
;;
|
||||
i386-sun)
|
||||
os=-sunos4.0.2
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
sparc-* | *-sun)
|
||||
os=-sunos4.1.1
|
||||
;;
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
*-hitachi)
|
||||
os=-hiux
|
||||
;;
|
||||
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
|
||||
os=-sysv
|
||||
;;
|
||||
*-cbm)
|
||||
os=-amigaos
|
||||
;;
|
||||
*-dg)
|
||||
os=-dgux
|
||||
;;
|
||||
*-dolphin)
|
||||
os=-sysv3
|
||||
;;
|
||||
m68k-ccur)
|
||||
os=-rtu
|
||||
;;
|
||||
m88k-omron*)
|
||||
os=-luna
|
||||
;;
|
||||
*-next )
|
||||
os=-nextstep
|
||||
;;
|
||||
*-sequent)
|
||||
os=-ptx
|
||||
;;
|
||||
*-crds)
|
||||
os=-unos
|
||||
;;
|
||||
*-ns)
|
||||
os=-genix
|
||||
;;
|
||||
i370-*)
|
||||
os=-mvs
|
||||
;;
|
||||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
os=-rtu
|
||||
;;
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Here we handle the case where we know the os, and the CPU type, but not the
|
||||
# manufacturer. We pick the logical manufacturer.
|
||||
vendor=unknown
|
||||
case $basic_machine in
|
||||
*-unknown)
|
||||
case $os in
|
||||
-riscix*)
|
||||
vendor=acorn
|
||||
;;
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-hiux*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-unos*)
|
||||
vendor=crds
|
||||
;;
|
||||
-dgux*)
|
||||
vendor=dg
|
||||
;;
|
||||
-luna*)
|
||||
vendor=omron
|
||||
;;
|
||||
-genix*)
|
||||
vendor=ns
|
||||
;;
|
||||
-mvs*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $basic_machine$os
|
||||
186
configure.ac
Normal file
186
configure.ac
Normal file
@@ -0,0 +1,186 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.56])
|
||||
AC_INIT([libjpeg-turbo], [1.0.0])
|
||||
BUILD=`date +%Y%m%d`
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
||||
AC_PREFIX_DEFAULT(/opt/libjpeg-turbo)
|
||||
|
||||
# Always build with prototypes
|
||||
AC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes])
|
||||
# Don't use undefined types
|
||||
AC_DEFINE([INCOMPLETE_TYPES_BROKEN], 1, [Define if you want use complete types])
|
||||
|
||||
# Checks for programs.
|
||||
SAVED_CFLAGS=${CFLAGS}
|
||||
SAVED_CXXFLAGS=${CXXFLAGS}
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_LN_S
|
||||
|
||||
AC_MSG_CHECKING([whether the linker supports version scripts])
|
||||
VERSION_SCRIPT=no
|
||||
LDVER=`$LD --help </dev/null 2>&1 | grep "\-\-version-script"`
|
||||
if test "$LDVER"; then
|
||||
VERSION_SCRIPT=yes
|
||||
VERSION_SCRIPT_FLAG=-Wl,--version-script,
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
LDVER=`$LD --help </dev/null 2>&1 | grep "\-M"`
|
||||
if test "$LDVER"; then
|
||||
VERSION_SCRIPT=yes
|
||||
VERSION_SCRIPT_FLAG=-Wl,-M,
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
|
||||
AC_SUBST(VERSION_SCRIPT_FLAG)
|
||||
|
||||
if test "x${GCC}" = "xyes"; then
|
||||
if test "x${SAVED_CFLAGS}" = "x"; then
|
||||
CFLAGS=-O3
|
||||
fi
|
||||
if test "x${SAVED_CXXFLAGS}" = "x"; then
|
||||
CXXFLAGS=-O3
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
|
||||
if test "x${SUNCC}" = "xyes"; then
|
||||
if test "x${SAVED_CFLAGS}" = "x"; then
|
||||
CFLAGS=-xO5
|
||||
fi
|
||||
if test "x${SAVED_CXXFLAGS}" = "x"; then
|
||||
CXXFLAGS=-xO5
|
||||
fi
|
||||
fi
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
|
||||
AC_CHECK_HEADER([sys/types.h], AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you have sys/types.h]))
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_CHAR_UNSIGNED
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_TYPES([unsigned char, unsigned short])
|
||||
|
||||
AC_MSG_CHECKING([if right shift is signed])
|
||||
AC_TRY_RUN(
|
||||
[#include <stdio.h>
|
||||
int is_shifting_signed (long arg) {
|
||||
long res = arg >> 4;
|
||||
|
||||
if (res == -0x7F7E80CL)
|
||||
return 1; /* right shift is signed */
|
||||
|
||||
/* see if unsigned-shift hack will fix it. */
|
||||
/* we can't just test exact value since it depends on width of long... */
|
||||
res |= (~0L) << (32-4);
|
||||
if (res == -0x7F7E80CL)
|
||||
return 0; /* right shift is unsigned */
|
||||
|
||||
printf("Right shift isn't acting as I expect it to.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n\n");
|
||||
return 0; /* try it with unsigned anyway */
|
||||
}
|
||||
int main (void) {
|
||||
exit(is_shifting_signed(-0x7F7E80B1L));
|
||||
}],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
|
||||
[AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
|
||||
|
||||
# test whether global names are unique to at least 15 chars
|
||||
AC_MSG_CHECKING([for short external names])
|
||||
AC_TRY_LINK(
|
||||
[int possibly_duplicate_function () { return 0; }
|
||||
int possibly_dupli_function () { return 1; }], [ ],
|
||||
[AC_MSG_RESULT(ok)],
|
||||
[AC_MSG_RESULT(short)
|
||||
AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1, [Define if you need short function names])])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([memset memcpy], [],
|
||||
[AC_DEFINE([NEED_BSD_STRINGS], 1,
|
||||
[Define if you have BSD-like bzero and bcopy])])
|
||||
|
||||
# Set flags to indicate platform
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32* | interix*)
|
||||
is_win32=1
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL([IS_WIN32], [test "x$is_win32" = "x1"])
|
||||
|
||||
# SIMD is optional
|
||||
AC_ARG_WITH([simd],
|
||||
AC_HELP_STRING([--without-simd],[Omit accelerated SIMD routines.]))
|
||||
if test "x${with_simd}" != "xno"; then
|
||||
# Check if we're on a supported CPU
|
||||
AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])
|
||||
case "$host_cpu" in
|
||||
x86_64 | amd64)
|
||||
AC_MSG_RESULT([yes (x86_64)])
|
||||
AC_PROG_NASM
|
||||
simd_arch=x86_64
|
||||
;;
|
||||
i*86 | x86 | ia32)
|
||||
AC_MSG_RESULT([yes (i386)])
|
||||
AC_PROG_NASM
|
||||
simd_arch=i386
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no ("$host_cpu")])
|
||||
AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.])
|
||||
with_simd=no;
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x${with_simd}" != "xno"; then
|
||||
AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([WITH_SIMD], [test "x$with_simd" != "xno"])
|
||||
AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
|
||||
AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
|
||||
AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"])
|
||||
|
||||
case "$host_cpu" in
|
||||
x86_64)
|
||||
RPMARCH=x86_64
|
||||
DEBARCH=amd64
|
||||
;;
|
||||
i*86 | x86 | ia32)
|
||||
RPMARCH=i386
|
||||
DEBARCH=i386
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(RPMARCH)
|
||||
AC_SUBST(DEBARCH)
|
||||
AC_SUBST(BUILD)
|
||||
AC_SUBST(RM)
|
||||
|
||||
# jconfig.h is the file we use, but we have another before that to
|
||||
# fool autoheader. the reason is that we include this header in our
|
||||
# API headers, which can screw things up for users of the lib.
|
||||
# jconfig.h is a minimal version that allows this package to be built
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_HEADERS([jconfig.h])
|
||||
AC_CONFIG_FILES([Makefile simd/Makefile])
|
||||
AC_OUTPUT
|
||||
250
install-sh
250
install-sh
@@ -1,250 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
144
jccolor.c
144
jccolor.c
@@ -2,6 +2,8 @@
|
||||
* jccolor.c
|
||||
*
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009 D. R. Commander
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -11,6 +13,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
@@ -78,6 +81,74 @@ typedef my_color_converter * my_cconvert_ptr;
|
||||
#define TABLE_SIZE (8*(MAXJSAMPLE+1))
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
const unsigned char red_lut[256] = {
|
||||
0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 4 ,
|
||||
5 , 5 , 5 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 ,
|
||||
10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14,
|
||||
14, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19,
|
||||
19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 24,
|
||||
24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 28,
|
||||
29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33,
|
||||
33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 38, 38,
|
||||
38, 39, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43,
|
||||
43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48,
|
||||
48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52,
|
||||
53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57,
|
||||
57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 62, 62,
|
||||
62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 67,
|
||||
67, 67, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 71,
|
||||
72, 72, 72, 73, 73, 73, 74, 74, 74, 74, 75, 75, 75, 76, 76, 76
|
||||
};
|
||||
|
||||
const unsigned char green_lut[256] = {
|
||||
0 , 1 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 , 6 ,
|
||||
7 , 8 , 8 , 9 , 9 , 10 , 11 , 11 , 12 , 12 , 13 , 14 ,
|
||||
14 , 15 , 15 , 16 , 16 , 17 , 18 , 18 , 19 , 19 , 20 , 21 ,
|
||||
21 , 22 , 22 , 23 , 23 , 24 , 25 , 25 , 26 , 26 , 27 , 28 ,
|
||||
28 , 29 , 29 , 30 , 31 , 31 , 32 , 32 , 33 , 33 , 34 , 35 ,
|
||||
35 , 36 , 36 , 37 , 38 , 38 , 39 , 39 , 40 , 41 , 41 , 42 ,
|
||||
42 , 43 , 43 , 44 , 45 , 45 , 46 , 46 , 47 , 48 , 48 , 49 ,
|
||||
49 , 50 , 50 , 51 , 52 , 52 , 53 , 53 , 54 , 55 , 55 , 56 ,
|
||||
56 , 57 , 58 , 58 , 59 , 59 , 60 , 60 , 61 , 62 , 62 , 63 ,
|
||||
63 , 64 , 65 , 65 , 66 , 66 , 67 , 68 , 68 , 69 , 69 , 70 ,
|
||||
70 , 71 , 72 , 72 , 73 , 73 , 74 , 75 , 75 , 76 , 76 , 77 ,
|
||||
77 , 78 , 79 , 79 , 80 , 80 , 81 , 82 , 82 , 83 , 83 , 84 ,
|
||||
85 , 85 , 86 , 86 , 87 , 87 , 88 , 89 , 89 , 90 , 90 , 91 ,
|
||||
92 , 92 , 93 , 93 , 94 , 95 , 95 , 96 , 96 , 97 , 97 , 98 ,
|
||||
99 , 99 , 100, 100, 101, 102, 102, 103, 103, 104, 104, 105,
|
||||
106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 112, 112,
|
||||
113, 113, 114, 114, 115, 116, 116, 117, 117, 118, 119, 119,
|
||||
120, 120, 121, 122, 122, 123, 123, 124, 124, 125, 126, 126,
|
||||
127, 127, 128, 129, 129, 130, 130, 131, 131, 132, 133, 133,
|
||||
34, 134, 135, 136, 136, 137, 137, 138, 139, 139, 140, 140,
|
||||
141, 141, 142, 143, 143, 144, 144, 145, 146, 146, 147, 147,
|
||||
148, 149, 149, 150
|
||||
};
|
||||
|
||||
const unsigned char blue_lut[256] = {
|
||||
0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ,
|
||||
2 , 2 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 4 ,
|
||||
4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 ,
|
||||
5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 ,
|
||||
7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 ,
|
||||
9 , 9 , 9 , 9 , 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11,
|
||||
11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18,
|
||||
18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20,
|
||||
20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22,
|
||||
22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27,
|
||||
27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for RGB->YCC colorspace conversion.
|
||||
*/
|
||||
@@ -146,10 +217,10 @@ rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
inptr += RGB_PIXELSIZE;
|
||||
r = GETJSAMPLE(inptr[rgb_red[cinfo->in_color_space]]);
|
||||
g = GETJSAMPLE(inptr[rgb_green[cinfo->in_color_space]]);
|
||||
b = GETJSAMPLE(inptr[rgb_blue[cinfo->in_color_space]]);
|
||||
inptr += rgb_pixelsize[cinfo->in_color_space];
|
||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||
* must be too; we do not need an explicit range-limiting operation.
|
||||
* Hence the value being shifted is never negative, and we don't
|
||||
@@ -188,26 +259,36 @@ rgb_gray_convert (j_compress_ptr cinfo,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
#if BITS_IN_JSAMPLE != 8
|
||||
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||
#endif
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
JSAMPLE *maxoutptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
int rindex = rgb_red[cinfo->in_color_space];
|
||||
int gindex = rgb_green[cinfo->in_color_space];
|
||||
int bindex = rgb_blue[cinfo->in_color_space];
|
||||
int rgbstride = rgb_pixelsize[cinfo->in_color_space];
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr = output_buf[0][output_row];
|
||||
maxoutptr = &outptr[num_cols];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
inptr += RGB_PIXELSIZE;
|
||||
for (; outptr < maxoutptr; outptr++, inptr += rgbstride) {
|
||||
/* Y */
|
||||
outptr[col] = (JSAMPLE)
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
*outptr = red_lut[inptr[rindex]] + green_lut[inptr[gindex]]
|
||||
+ blue_lut[inptr[bindex]];
|
||||
#else
|
||||
*outptr = (JSAMPLE)
|
||||
((ctab[GETJSAMPLE(inptr[rindex])+R_Y_OFF]
|
||||
+ ctab[GETJSAMPLE(inptr[gindex])+G_Y_OFF]
|
||||
+ ctab[GETJSAMPLE(inptr[bindex])+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,11 +449,15 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
#if RGB_PIXELSIZE != 3
|
||||
if (cinfo->input_components != RGB_PIXELSIZE)
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
#endif /* else share code with YCbCr */
|
||||
|
||||
case JCS_YCbCr:
|
||||
if (cinfo->input_components != 3)
|
||||
@@ -398,7 +483,13 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_GRAYSCALE)
|
||||
cconvert->pub.color_convert = grayscale_convert;
|
||||
else if (cinfo->in_color_space == JCS_RGB) {
|
||||
else if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB) {
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = rgb_gray_convert;
|
||||
} else if (cinfo->in_color_space == JCS_YCbCr)
|
||||
@@ -408,9 +499,16 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
if (cinfo->num_components != 3)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3)
|
||||
if (cinfo->in_color_space == cinfo->jpeg_color_space &&
|
||||
rgb_pixelsize[cinfo->in_color_space] == 3)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
@@ -419,9 +517,19 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
case JCS_YCbCr:
|
||||
if (cinfo->num_components != 3)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_RGB) {
|
||||
if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB) {
|
||||
if (jsimd_can_rgb_ycc())
|
||||
cconvert->pub.color_convert = jsimd_rgb_ycc_convert;
|
||||
else {
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = rgb_ycc_convert;
|
||||
}
|
||||
} else if (cinfo->in_color_space == JCS_YCbCr)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else
|
||||
|
||||
471
jcdctmgr.c
471
jcdctmgr.c
@@ -2,6 +2,8 @@
|
||||
* jcdctmgr.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -15,15 +17,35 @@
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
#include "jsimddct.h"
|
||||
|
||||
|
||||
/* Private subobject for this module */
|
||||
|
||||
typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
|
||||
typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
|
||||
|
||||
typedef JMETHOD(void, convsamp_method_ptr,
|
||||
(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
DCTELEM * workspace));
|
||||
typedef JMETHOD(void, float_convsamp_method_ptr,
|
||||
(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
FAST_FLOAT *workspace));
|
||||
|
||||
typedef JMETHOD(void, quantize_method_ptr,
|
||||
(JCOEFPTR coef_block, DCTELEM * divisors,
|
||||
DCTELEM * workspace));
|
||||
typedef JMETHOD(void, float_quantize_method_ptr,
|
||||
(JCOEFPTR coef_block, FAST_FLOAT * divisors,
|
||||
FAST_FLOAT * workspace));
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_forward_dct pub; /* public fields */
|
||||
|
||||
/* Pointer to the DCT routine actually in use */
|
||||
forward_DCT_method_ptr do_dct;
|
||||
forward_DCT_method_ptr dct;
|
||||
convsamp_method_ptr convsamp;
|
||||
quantize_method_ptr quantize;
|
||||
|
||||
/* The actual post-DCT divisors --- not identical to the quant table
|
||||
* entries, because of scaling (especially for an unnormalized DCT).
|
||||
@@ -31,16 +53,144 @@ typedef struct {
|
||||
*/
|
||||
DCTELEM * divisors[NUM_QUANT_TBLS];
|
||||
|
||||
/* work area for FDCT subroutine */
|
||||
DCTELEM * workspace;
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
/* Same as above for the floating-point case. */
|
||||
float_DCT_method_ptr do_float_dct;
|
||||
float_DCT_method_ptr float_dct;
|
||||
float_convsamp_method_ptr float_convsamp;
|
||||
float_quantize_method_ptr float_quantize;
|
||||
FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
|
||||
FAST_FLOAT * float_workspace;
|
||||
#endif
|
||||
} my_fdct_controller;
|
||||
|
||||
typedef my_fdct_controller * my_fdct_ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Find the highest bit in an integer through binary search.
|
||||
*/
|
||||
LOCAL(int)
|
||||
flss (UINT16 val)
|
||||
{
|
||||
int bit;
|
||||
|
||||
bit = 16;
|
||||
|
||||
if (!val)
|
||||
return 0;
|
||||
|
||||
if (!(val & 0xff00)) {
|
||||
bit -= 8;
|
||||
val <<= 8;
|
||||
}
|
||||
if (!(val & 0xf000)) {
|
||||
bit -= 4;
|
||||
val <<= 4;
|
||||
}
|
||||
if (!(val & 0xc000)) {
|
||||
bit -= 2;
|
||||
val <<= 2;
|
||||
}
|
||||
if (!(val & 0x8000)) {
|
||||
bit -= 1;
|
||||
val <<= 1;
|
||||
}
|
||||
|
||||
return bit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute values to do a division using reciprocal.
|
||||
*
|
||||
* This implementation is based on an algorithm described in
|
||||
* "How to optimize for the Pentium family of microprocessors"
|
||||
* (http://www.agner.org/assem/).
|
||||
* More information about the basic algorithm can be found in
|
||||
* the paper "Integer Division Using Reciprocals" by Robert Alverson.
|
||||
*
|
||||
* The basic idea is to replace x/d by x * d^-1. In order to store
|
||||
* d^-1 with enough precision we shift it left a few places. It turns
|
||||
* out that this algoright gives just enough precision, and also fits
|
||||
* into DCTELEM:
|
||||
*
|
||||
* b = (the number of significant bits in divisor) - 1
|
||||
* r = (word size) + b
|
||||
* f = 2^r / divisor
|
||||
*
|
||||
* f will not be an integer for most cases, so we need to compensate
|
||||
* for the rounding error introduced:
|
||||
*
|
||||
* no fractional part:
|
||||
*
|
||||
* result = input >> r
|
||||
*
|
||||
* fractional part of f < 0.5:
|
||||
*
|
||||
* round f down to nearest integer
|
||||
* result = ((input + 1) * f) >> r
|
||||
*
|
||||
* fractional part of f > 0.5:
|
||||
*
|
||||
* round f up to nearest integer
|
||||
* result = (input * f) >> r
|
||||
*
|
||||
* This is the original algorithm that gives truncated results. But we
|
||||
* want properly rounded results, so we replace "input" with
|
||||
* "input + divisor/2".
|
||||
*
|
||||
* In order to allow SIMD implementations we also tweak the values to
|
||||
* allow the same calculation to be made at all times:
|
||||
*
|
||||
* dctbl[0] = f rounded to nearest integer
|
||||
* dctbl[1] = divisor / 2 (+ 1 if fractional part of f < 0.5)
|
||||
* dctbl[2] = 1 << ((word size) * 2 - r)
|
||||
* dctbl[3] = r - (word size)
|
||||
*
|
||||
* dctbl[2] is for stupid instruction sets where the shift operation
|
||||
* isn't member wise (e.g. MMX).
|
||||
*
|
||||
* The reason dctbl[2] and dctbl[3] reduce the shift with (word size)
|
||||
* is that most SIMD implementations have a "multiply and store top
|
||||
* half" operation.
|
||||
*
|
||||
* Lastly, we store each of the values in their own table instead
|
||||
* of in a consecutive manner, yet again in order to allow SIMD
|
||||
* routines.
|
||||
*/
|
||||
LOCAL(void)
|
||||
compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
|
||||
{
|
||||
UDCTELEM2 fq, fr;
|
||||
UDCTELEM c;
|
||||
int b, r;
|
||||
|
||||
b = flss(divisor) - 1;
|
||||
r = sizeof(DCTELEM) * 8 + b;
|
||||
|
||||
fq = ((UDCTELEM2)1 << r) / divisor;
|
||||
fr = ((UDCTELEM2)1 << r) % divisor;
|
||||
|
||||
c = divisor / 2; /* for rounding */
|
||||
|
||||
if (fr == 0) { /* divisor is power of two */
|
||||
/* fq will be one bit too large to fit in DCTELEM, so adjust */
|
||||
fq >>= 1;
|
||||
r--;
|
||||
} else if (fr <= (divisor / 2)) { /* fractional part is < 0.5 */
|
||||
c++;
|
||||
} else { /* fractional part is > 0.5 */
|
||||
fq++;
|
||||
}
|
||||
|
||||
dtbl[DCTSIZE2 * 0] = (DCTELEM) fq; /* reciprocal */
|
||||
dtbl[DCTSIZE2 * 1] = (DCTELEM) c; /* correction + roundfactor */
|
||||
dtbl[DCTSIZE2 * 2] = (DCTELEM) (1 << (sizeof(DCTELEM)*8*2 - r)); /* scale */
|
||||
dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
* Verify that all referenced Q-tables are present, and set up
|
||||
@@ -78,11 +228,11 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
if (fdct->divisors[qtblno] == NULL) {
|
||||
fdct->divisors[qtblno] = (DCTELEM *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
DCTSIZE2 * SIZEOF(DCTELEM));
|
||||
(DCTSIZE2 * 4) * SIZEOF(DCTELEM));
|
||||
}
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
|
||||
compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -112,14 +262,14 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
if (fdct->divisors[qtblno] == NULL) {
|
||||
fdct->divisors[qtblno] = (DCTELEM *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
DCTSIZE2 * SIZEOF(DCTELEM));
|
||||
(DCTSIZE2 * 4) * SIZEOF(DCTELEM));
|
||||
}
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
dtbl[i] = (DCTELEM)
|
||||
compute_reciprocal(
|
||||
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
||||
(INT32) aanscales[i]),
|
||||
CONST_BITS-3);
|
||||
CONST_BITS-3), &dtbl[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -168,6 +318,77 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load data into workspace, applying unsigned->signed conversion.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace)
|
||||
{
|
||||
register DCTELEM *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
register int elemr;
|
||||
|
||||
workspaceptr = workspace;
|
||||
for (elemr = 0; elemr < DCTSIZE; elemr++) {
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
#else
|
||||
{
|
||||
register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--)
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Quantize/descale the coefficients, and store into coef_blocks[].
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
{
|
||||
int i;
|
||||
DCTELEM temp;
|
||||
UDCTELEM recip, corr, shift;
|
||||
UDCTELEM2 product;
|
||||
JCOEFPTR output_ptr = coef_block;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
temp = workspace[i];
|
||||
recip = divisors[i + DCTSIZE2 * 0];
|
||||
corr = divisors[i + DCTSIZE2 * 1];
|
||||
shift = divisors[i + DCTSIZE2 * 3];
|
||||
|
||||
if (temp < 0) {
|
||||
temp = -temp;
|
||||
product = (UDCTELEM2)(temp + corr) * recip;
|
||||
product >>= shift + sizeof(DCTELEM)*8;
|
||||
temp = product;
|
||||
temp = -temp;
|
||||
} else {
|
||||
product = (UDCTELEM2)(temp + corr) * recip;
|
||||
product >>= shift + sizeof(DCTELEM)*8;
|
||||
temp = product;
|
||||
}
|
||||
|
||||
output_ptr[i] = (JCOEF) temp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Perform forward DCT on one or more blocks of a component.
|
||||
*
|
||||
@@ -185,16 +406,38 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||
forward_DCT_method_ptr do_dct = fdct->do_dct;
|
||||
DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
|
||||
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
|
||||
DCTELEM * workspace;
|
||||
JDIMENSION bi;
|
||||
|
||||
/* Make sure the compiler doesn't look up these every pass */
|
||||
forward_DCT_method_ptr do_dct = fdct->dct;
|
||||
convsamp_method_ptr do_convsamp = fdct->convsamp;
|
||||
quantize_method_ptr do_quantize = fdct->quantize;
|
||||
workspace = fdct->workspace;
|
||||
|
||||
sample_data += start_row; /* fold in the vertical offset once */
|
||||
|
||||
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
|
||||
/* Load data into workspace, applying unsigned->signed conversion */
|
||||
{ register DCTELEM *workspaceptr;
|
||||
(*do_convsamp) (sample_data, start_col, workspace);
|
||||
|
||||
/* Perform the DCT */
|
||||
(*do_dct) (workspace);
|
||||
|
||||
/* Quantize/descale the coefficients, and store into coef_blocks[] */
|
||||
(*do_quantize) (coef_blocks[bi], divisors, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace)
|
||||
{
|
||||
register FAST_FLOAT *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
register int elemr;
|
||||
|
||||
@@ -202,69 +445,47 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
for (elemr = 0; elemr < DCTSIZE; elemr++) {
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
#else
|
||||
{ register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--) {
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
}
|
||||
{
|
||||
register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--)
|
||||
*workspaceptr++ = (FAST_FLOAT)
|
||||
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Perform the DCT */
|
||||
(*do_dct) (workspace);
|
||||
|
||||
/* Quantize/descale the coefficients, and store into coef_blocks[] */
|
||||
{ register DCTELEM temp, qval;
|
||||
register int i;
|
||||
register JCOEFPTR output_ptr = coef_blocks[bi];
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
qval = divisors[i];
|
||||
temp = workspace[i];
|
||||
/* Divide the coefficient value by qval, ensuring proper rounding.
|
||||
* Since C does not specify the direction of rounding for negative
|
||||
* quotients, we have to force the dividend positive for portability.
|
||||
*
|
||||
* In most files, at least half of the output values will be zero
|
||||
* (at default quantization settings, more like three-quarters...)
|
||||
* so we should ensure that this case is fast. On many machines,
|
||||
* a comparison is enough cheaper than a divide to make a special test
|
||||
* a win. Since both inputs will be nonnegative, we need only test
|
||||
* for a < b to discover whether a/b is 0.
|
||||
* If your machine's division is fast enough, define FAST_DIVIDE.
|
||||
*/
|
||||
#ifdef FAST_DIVIDE
|
||||
#define DIVIDE_BY(a,b) a /= b
|
||||
#else
|
||||
#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
|
||||
#endif
|
||||
if (temp < 0) {
|
||||
temp = -temp;
|
||||
temp += qval>>1; /* for rounding */
|
||||
DIVIDE_BY(temp, qval);
|
||||
temp = -temp;
|
||||
} else {
|
||||
temp += qval>>1; /* for rounding */
|
||||
DIVIDE_BY(temp, qval);
|
||||
}
|
||||
output_ptr[i] = (JCOEF) temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
METHODDEF(void)
|
||||
quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace)
|
||||
{
|
||||
register FAST_FLOAT temp;
|
||||
register int i;
|
||||
register JCOEFPTR output_ptr = coef_block;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
/* Apply the quantization and scaling factor */
|
||||
temp = workspace[i] * divisors[i];
|
||||
|
||||
/* Round to nearest integer.
|
||||
* Since C does not specify the direction of rounding for negative
|
||||
* quotients, we have to force the dividend positive for portability.
|
||||
* The maximum coefficient size is +-16K (for 12-bit data), so this
|
||||
* code should work for either 16-bit or 32-bit ints.
|
||||
*/
|
||||
output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
@@ -275,62 +496,28 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||
float_DCT_method_ptr do_dct = fdct->do_float_dct;
|
||||
FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
|
||||
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
|
||||
FAST_FLOAT * workspace;
|
||||
JDIMENSION bi;
|
||||
|
||||
|
||||
/* Make sure the compiler doesn't look up these every pass */
|
||||
float_DCT_method_ptr do_dct = fdct->float_dct;
|
||||
float_convsamp_method_ptr do_convsamp = fdct->float_convsamp;
|
||||
float_quantize_method_ptr do_quantize = fdct->float_quantize;
|
||||
workspace = fdct->float_workspace;
|
||||
|
||||
sample_data += start_row; /* fold in the vertical offset once */
|
||||
|
||||
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
|
||||
/* Load data into workspace, applying unsigned->signed conversion */
|
||||
{ register FAST_FLOAT *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
register int elemr;
|
||||
|
||||
workspaceptr = workspace;
|
||||
for (elemr = 0; elemr < DCTSIZE; elemr++) {
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
#else
|
||||
{ register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--) {
|
||||
*workspaceptr++ = (FAST_FLOAT)
|
||||
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
(*do_convsamp) (sample_data, start_col, workspace);
|
||||
|
||||
/* Perform the DCT */
|
||||
(*do_dct) (workspace);
|
||||
|
||||
/* Quantize/descale the coefficients, and store into coef_blocks[] */
|
||||
{ register FAST_FLOAT temp;
|
||||
register int i;
|
||||
register JCOEFPTR output_ptr = coef_blocks[bi];
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
/* Apply the quantization and scaling factor */
|
||||
temp = workspace[i] * divisors[i];
|
||||
/* Round to nearest integer.
|
||||
* Since C does not specify the direction of rounding for negative
|
||||
* quotients, we have to force the dividend positive for portability.
|
||||
* The maximum coefficient size is +-16K (for 12-bit data), so this
|
||||
* code should work for either 16-bit or 32-bit ints.
|
||||
*/
|
||||
output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
|
||||
}
|
||||
}
|
||||
(*do_quantize) (coef_blocks[bi], divisors, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,23 +540,33 @@ jinit_forward_dct (j_compress_ptr cinfo)
|
||||
cinfo->fdct = (struct jpeg_forward_dct *) fdct;
|
||||
fdct->pub.start_pass = start_pass_fdctmgr;
|
||||
|
||||
/* First determine the DCT... */
|
||||
switch (cinfo->dct_method) {
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
case JDCT_ISLOW:
|
||||
fdct->pub.forward_DCT = forward_DCT;
|
||||
fdct->do_dct = jpeg_fdct_islow;
|
||||
if (jsimd_can_fdct_islow())
|
||||
fdct->dct = jsimd_fdct_islow;
|
||||
else
|
||||
fdct->dct = jpeg_fdct_islow;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
case JDCT_IFAST:
|
||||
fdct->pub.forward_DCT = forward_DCT;
|
||||
fdct->do_dct = jpeg_fdct_ifast;
|
||||
if (jsimd_can_fdct_ifast())
|
||||
fdct->dct = jsimd_fdct_ifast;
|
||||
else
|
||||
fdct->dct = jpeg_fdct_ifast;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
case JDCT_FLOAT:
|
||||
fdct->pub.forward_DCT = forward_DCT_float;
|
||||
fdct->do_float_dct = jpeg_fdct_float;
|
||||
if (jsimd_can_fdct_float())
|
||||
fdct->float_dct = jsimd_fdct_float;
|
||||
else
|
||||
fdct->float_dct = jpeg_fdct_float;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -377,6 +574,54 @@ jinit_forward_dct (j_compress_ptr cinfo)
|
||||
break;
|
||||
}
|
||||
|
||||
/* ...then the supporting stages. */
|
||||
switch (cinfo->dct_method) {
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
case JDCT_ISLOW:
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
case JDCT_IFAST:
|
||||
#endif
|
||||
#if defined(DCT_ISLOW_SUPPORTED) || defined(DCT_IFAST_SUPPORTED)
|
||||
if (jsimd_can_convsamp())
|
||||
fdct->convsamp = jsimd_convsamp;
|
||||
else
|
||||
fdct->convsamp = convsamp;
|
||||
if (jsimd_can_quantize())
|
||||
fdct->quantize = jsimd_quantize;
|
||||
else
|
||||
fdct->quantize = quantize;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
case JDCT_FLOAT:
|
||||
if (jsimd_can_convsamp_float())
|
||||
fdct->float_convsamp = jsimd_convsamp_float;
|
||||
else
|
||||
fdct->float_convsamp = convsamp_float;
|
||||
if (jsimd_can_quantize_float())
|
||||
fdct->float_quantize = jsimd_quantize_float;
|
||||
else
|
||||
fdct->float_quantize = quantize_float;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allocate workspace memory */
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
if (cinfo->dct_method == JDCT_FLOAT)
|
||||
fdct->float_workspace = (FAST_FLOAT *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(FAST_FLOAT) * DCTSIZE2);
|
||||
else
|
||||
#endif
|
||||
fdct->workspace = (DCTELEM *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(DCTELEM) * DCTSIZE2);
|
||||
|
||||
/* Mark divisor tables unallocated */
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
fdct->divisors[i] = NULL;
|
||||
|
||||
353
jchuff.c
353
jchuff.c
@@ -14,11 +14,33 @@
|
||||
* permanent JPEG objects only upon successful completion of an MCU.
|
||||
*/
|
||||
|
||||
/* Modifications:
|
||||
* Copyright (C)2007 Sun Microsystems, Inc.
|
||||
* Copyright (C)2009 D. R. Commander
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jchuff.h" /* Declarations shared with jcphuff.c */
|
||||
#include <limits.h>
|
||||
|
||||
static unsigned char jpeg_first_bit_table[65536];
|
||||
int jpeg_first_bit_table_init=0;
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
/* Expanded entropy encoder object for Huffman encoding.
|
||||
*
|
||||
@@ -27,7 +49,7 @@
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
INT32 put_buffer; /* current bit-accumulation buffer */
|
||||
size_t put_buffer; /* current bit-accumulation buffer */
|
||||
int put_bits; /* # of bits now in it */
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
} savable_state;
|
||||
@@ -159,6 +181,7 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
}
|
||||
|
||||
/* Initialize bit buffer to empty */
|
||||
|
||||
entropy->saved.put_buffer = 0;
|
||||
entropy->saved.put_bits = 0;
|
||||
|
||||
@@ -261,6 +284,15 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
dtbl->ehufco[i] = huffcode[p];
|
||||
dtbl->ehufsi[i] = huffsize[p];
|
||||
}
|
||||
|
||||
if(!jpeg_first_bit_table_init) {
|
||||
for(i = 0; i < 65536; i++) {
|
||||
int bit = 0, val = i;
|
||||
while (val) {val >>= 1; bit++;}
|
||||
jpeg_first_bit_table[i] = bit;
|
||||
}
|
||||
jpeg_first_bit_table_init = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +312,8 @@ dump_buffer (working_state * state)
|
||||
{
|
||||
struct jpeg_destination_mgr * dest = state->cinfo->dest;
|
||||
|
||||
dest->free_in_buffer = state->free_in_buffer;
|
||||
|
||||
if (! (*dest->empty_output_buffer) (state->cinfo))
|
||||
return FALSE;
|
||||
/* After a successful buffer dump, must reset buffer pointers */
|
||||
@@ -297,147 +331,250 @@ dump_buffer (working_state * state)
|
||||
* between calls, so 24 bits are sufficient.
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(boolean)
|
||||
emit_bits (working_state * state, unsigned int code, int size)
|
||||
/* Emit some bits; return TRUE if successful, FALSE if must suspend */
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding tightly. */
|
||||
register INT32 put_buffer = (INT32) code;
|
||||
register int put_bits = state->cur.put_bits;
|
||||
/***************************************************************/
|
||||
|
||||
/* if size is 0, caller used an invalid Huffman table entry */
|
||||
if (size == 0)
|
||||
ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
|
||||
|
||||
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
|
||||
|
||||
put_bits += size; /* new number of bits in buffer */
|
||||
|
||||
put_buffer <<= 24 - put_bits; /* align incoming bits */
|
||||
|
||||
put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
|
||||
|
||||
while (put_bits >= 8) {
|
||||
int c = (int) ((put_buffer >> 16) & 0xFF);
|
||||
|
||||
emit_byte(state, c, return FALSE);
|
||||
if (c == 0xFF) { /* need to stuff a zero byte? */
|
||||
emit_byte(state, 0, return FALSE);
|
||||
}
|
||||
put_buffer <<= 8;
|
||||
put_bits -= 8;
|
||||
#define EMIT_BYTE() { \
|
||||
if (0xFF == (*buffer++ = (unsigned char)(put_buffer >> (put_bits -= 8)))) \
|
||||
*buffer++ = 0; \
|
||||
}
|
||||
|
||||
state->cur.put_buffer = put_buffer; /* update state variables */
|
||||
state->cur.put_bits = put_bits;
|
||||
/***************************************************************/
|
||||
|
||||
return TRUE;
|
||||
#define DUMP_BITS_(code, size) { \
|
||||
put_bits += size; \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
if (put_bits > 7) \
|
||||
while(put_bits > 7) \
|
||||
EMIT_BYTE() \
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define CHECKBUF15() { \
|
||||
if (put_bits > 15) { \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECKBUF47() { \
|
||||
if (put_bits > 47) { \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECKBUF31() { \
|
||||
if (put_bits > 31) { \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
} \
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define DUMP_BITS_NOCHECK(code, size) { \
|
||||
put_bits += size; \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
}
|
||||
|
||||
#if __WORDSIZE==64 || defined(_WIN64)
|
||||
|
||||
#define DUMP_BITS(code, size) { \
|
||||
CHECKBUF47() \
|
||||
put_bits += size; \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define DUMP_BITS(code, size) { \
|
||||
put_bits += size; \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
CHECKBUF15() \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define DUMP_SINGLE_VALUE(ht, codevalue) { \
|
||||
size = ht->ehufsi[codevalue]; \
|
||||
code = ht->ehufco[codevalue]; \
|
||||
\
|
||||
DUMP_BITS(code, size) \
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define DUMP_VALUE_SLOW(ht, codevalue, t, nbits) { \
|
||||
size = ht->ehufsi[codevalue]; \
|
||||
code = ht->ehufco[codevalue]; \
|
||||
t &= ~(-1 << nbits); \
|
||||
DUMP_BITS_NOCHECK(code, size) \
|
||||
CHECKBUF15() \
|
||||
DUMP_BITS_NOCHECK(t, nbits) \
|
||||
CHECKBUF15() \
|
||||
}
|
||||
|
||||
int _max=0;
|
||||
|
||||
#if __WORDSIZE==64 || defined(_WIN64)
|
||||
|
||||
#define DUMP_VALUE(ht, codevalue, t, nbits) { \
|
||||
size = ht->ehufsi[codevalue]; \
|
||||
code = ht->ehufco[codevalue]; \
|
||||
t &= ~(-1 << nbits); \
|
||||
CHECKBUF31() \
|
||||
DUMP_BITS_NOCHECK(code, size) \
|
||||
DUMP_BITS_NOCHECK(t, nbits) \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define DUMP_VALUE(ht, codevalue, t, nbits) { \
|
||||
size = ht->ehufsi[codevalue]; \
|
||||
code = ht->ehufco[codevalue]; \
|
||||
t &= ~(-1 << nbits); \
|
||||
DUMP_BITS_NOCHECK(code, size) \
|
||||
CHECKBUF15() \
|
||||
DUMP_BITS_NOCHECK(t, nbits) \
|
||||
CHECKBUF15() \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define BUFSIZE (DCTSIZE2 * 2)
|
||||
|
||||
#define LOAD_BUFFER() { \
|
||||
if (state->free_in_buffer < BUFSIZE) { \
|
||||
localbuf = 1; \
|
||||
buffer = _buffer; \
|
||||
} \
|
||||
else buffer = state->next_output_byte; \
|
||||
}
|
||||
|
||||
#define STORE_BUFFER() { \
|
||||
if (localbuf) { \
|
||||
bytes = buffer - _buffer; \
|
||||
buffer = _buffer; \
|
||||
while (bytes > 0) { \
|
||||
bytestocopy = min(bytes, state->free_in_buffer); \
|
||||
MEMCOPY(state->next_output_byte, buffer, bytestocopy); \
|
||||
state->next_output_byte += bytestocopy; \
|
||||
buffer += bytestocopy; \
|
||||
state->free_in_buffer -= bytestocopy; \
|
||||
if (state->free_in_buffer == 0) \
|
||||
if (! dump_buffer(state)) return FALSE; \
|
||||
bytes -= bytestocopy; \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
state->free_in_buffer -= (buffer - state->next_output_byte); \
|
||||
state->next_output_byte = buffer; \
|
||||
} \
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
LOCAL(boolean)
|
||||
flush_bits (working_state * state)
|
||||
{
|
||||
if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
|
||||
return FALSE;
|
||||
unsigned char _buffer[BUFSIZE], *buffer;
|
||||
size_t put_buffer; int put_bits;
|
||||
size_t bytes, bytestocopy; int localbuf = 0;
|
||||
|
||||
put_buffer = state->cur.put_buffer;
|
||||
put_bits = state->cur.put_bits;
|
||||
LOAD_BUFFER()
|
||||
|
||||
DUMP_BITS_(0x7F, 7)
|
||||
|
||||
state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
|
||||
state->cur.put_bits = 0;
|
||||
STORE_BUFFER()
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Encode a single block's worth of coefficients */
|
||||
|
||||
LOCAL(boolean)
|
||||
encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
{
|
||||
register int temp, temp2;
|
||||
register int nbits;
|
||||
register int k, r, i;
|
||||
int temp, temp2;
|
||||
int nbits;
|
||||
int r, sflag, size, code;
|
||||
unsigned char _buffer[BUFSIZE], *buffer;
|
||||
size_t put_buffer; int put_bits;
|
||||
int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];
|
||||
size_t bytes, bytestocopy; int localbuf = 0;
|
||||
|
||||
put_buffer = state->cur.put_buffer;
|
||||
put_bits = state->cur.put_bits;
|
||||
LOAD_BUFFER()
|
||||
|
||||
/* Encode the DC coefficient difference per section F.1.2.1 */
|
||||
|
||||
temp = temp2 = block[0] - last_dc_val;
|
||||
|
||||
if (temp < 0) {
|
||||
temp = -temp; /* temp is abs value of input */
|
||||
/* For a negative input, want temp2 = bitwise complement of abs(input) */
|
||||
/* This code assumes we are on a two's complement machine */
|
||||
temp2--;
|
||||
}
|
||||
|
||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||
nbits = 0;
|
||||
while (temp) {
|
||||
nbits++;
|
||||
temp >>= 1;
|
||||
}
|
||||
/* Check for out-of-range coefficient values.
|
||||
* Since we're encoding a difference, the range limit is twice as much.
|
||||
*/
|
||||
if (nbits > MAX_COEF_BITS+1)
|
||||
ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
|
||||
|
||||
/* Emit the Huffman-coded symbol for the number of bits */
|
||||
if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
|
||||
return FALSE;
|
||||
|
||||
/* Emit that number of bits of the value, if positive, */
|
||||
/* or the complement of its magnitude, if negative. */
|
||||
if (nbits) /* emit_bits rejects calls with size 0 */
|
||||
if (! emit_bits(state, (unsigned int) temp2, nbits))
|
||||
return FALSE;
|
||||
sflag = temp >> 31;
|
||||
temp -= ((temp + temp) & sflag);
|
||||
temp2 += sflag;
|
||||
nbits = jpeg_first_bit_table[temp];
|
||||
DUMP_VALUE_SLOW(dctbl, nbits, temp2, nbits)
|
||||
|
||||
/* Encode the AC coefficients per section F.1.2.2 */
|
||||
|
||||
r = 0; /* r = run length of zeros */
|
||||
|
||||
for (k = 1; k < DCTSIZE2; k++) {
|
||||
if ((temp = block[jpeg_natural_order[k]]) == 0) {
|
||||
r++;
|
||||
} else {
|
||||
/* if run length > 15, must emit special run-length-16 codes (0xF0) */
|
||||
while (r > 15) {
|
||||
if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
|
||||
return FALSE;
|
||||
r -= 16;
|
||||
}
|
||||
#define innerloop(order) { \
|
||||
temp2 = *(JCOEF*)((unsigned char*)block + order); \
|
||||
if(temp2 == 0) r++; \
|
||||
else { \
|
||||
temp = (JCOEF)temp2; \
|
||||
sflag = temp >> 31; \
|
||||
temp = (temp ^ sflag) - sflag; \
|
||||
temp2 += sflag; \
|
||||
nbits = jpeg_first_bit_table[temp]; \
|
||||
for(; r > 15; r -= 16) DUMP_BITS(code_0xf0, size_0xf0) \
|
||||
sflag = (r << 4) + nbits; \
|
||||
DUMP_VALUE(actbl, sflag, temp2, nbits) \
|
||||
r = 0; \
|
||||
}}
|
||||
|
||||
temp2 = temp;
|
||||
if (temp < 0) {
|
||||
temp = -temp; /* temp is abs value of input */
|
||||
/* This code assumes we are on a two's complement machine */
|
||||
temp2--;
|
||||
}
|
||||
|
||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||
nbits = 1; /* there must be at least one 1 bit */
|
||||
while ((temp >>= 1))
|
||||
nbits++;
|
||||
/* Check for out-of-range coefficient values */
|
||||
if (nbits > MAX_COEF_BITS)
|
||||
ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
|
||||
|
||||
/* Emit Huffman symbol for run length / number of bits */
|
||||
i = (r << 4) + nbits;
|
||||
if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
|
||||
return FALSE;
|
||||
|
||||
/* Emit that number of bits of the value, if positive, */
|
||||
/* or the complement of its magnitude, if negative. */
|
||||
if (! emit_bits(state, (unsigned int) temp2, nbits))
|
||||
return FALSE;
|
||||
|
||||
r = 0;
|
||||
}
|
||||
}
|
||||
innerloop(2*1); innerloop(2*8); innerloop(2*16); innerloop(2*9);
|
||||
innerloop(2*2); innerloop(2*3); innerloop(2*10); innerloop(2*17);
|
||||
innerloop(2*24); innerloop(2*32); innerloop(2*25); innerloop(2*18);
|
||||
innerloop(2*11); innerloop(2*4); innerloop(2*5); innerloop(2*12);
|
||||
innerloop(2*19); innerloop(2*26); innerloop(2*33); innerloop(2*40);
|
||||
innerloop(2*48); innerloop(2*41); innerloop(2*34); innerloop(2*27);
|
||||
innerloop(2*20); innerloop(2*13); innerloop(2*6); innerloop(2*7);
|
||||
innerloop(2*14); innerloop(2*21); innerloop(2*28); innerloop(2*35);
|
||||
innerloop(2*42); innerloop(2*49); innerloop(2*56); innerloop(2*57);
|
||||
innerloop(2*50); innerloop(2*43); innerloop(2*36); innerloop(2*29);
|
||||
innerloop(2*22); innerloop(2*15); innerloop(2*23); innerloop(2*30);
|
||||
innerloop(2*37); innerloop(2*44); innerloop(2*51); innerloop(2*58);
|
||||
innerloop(2*59); innerloop(2*52); innerloop(2*45); innerloop(2*38);
|
||||
innerloop(2*31); innerloop(2*39); innerloop(2*46); innerloop(2*53);
|
||||
innerloop(2*60); innerloop(2*61); innerloop(2*54); innerloop(2*47);
|
||||
innerloop(2*55); innerloop(2*62); innerloop(2*63);
|
||||
|
||||
/* If the last coef(s) were zero, emit an end-of-block code */
|
||||
if (r > 0)
|
||||
if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
|
||||
return FALSE;
|
||||
if (r > 0) DUMP_SINGLE_VALUE(actbl, 0x0)
|
||||
|
||||
state->cur.put_buffer = put_buffer;
|
||||
state->cur.put_bits = put_bits;
|
||||
STORE_BUFFER()
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
48
jconfig.bcc
48
jconfig.bcc
@@ -1,48 +0,0 @@
|
||||
/* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#ifdef __MSDOS__
|
||||
#define NEED_FAR_POINTERS /* for small or medium memory model */
|
||||
#endif
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN /* this assumes you have -w-stu in CFLAGS */
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */
|
||||
#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */
|
||||
#define USE_FMEM /* Borland has _fmemcpy() and _fmemset() */
|
||||
#endif
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE
|
||||
#define USE_SETMODE /* Borland has setmode() */
|
||||
#ifdef __MSDOS__
|
||||
#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */
|
||||
#endif
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
44
jconfig.cfg
44
jconfig.cfg
@@ -1,44 +0,0 @@
|
||||
/* jconfig.cfg --- source file edited by configure script */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#undef HAVE_PROTOTYPES
|
||||
#undef HAVE_UNSIGNED_CHAR
|
||||
#undef HAVE_UNSIGNED_SHORT
|
||||
#undef void
|
||||
#undef const
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#undef HAVE_STDDEF_H
|
||||
#undef HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
/* Define this if you get warnings about undefined structures. */
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
#undef INLINE
|
||||
/* These are for configuring the JPEG memory manager. */
|
||||
#undef DEFAULT_MAX_MEM
|
||||
#undef NO_MKTEMP
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#undef TWO_FILE_COMMANDLINE
|
||||
#undef NEED_SIGNAL_CATCHER
|
||||
#undef DONT_USE_B_MODE
|
||||
|
||||
/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
|
||||
#undef PROGRESS_REPORT
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
38
jconfig.dj
38
jconfig.dj
@@ -1,38 +0,0 @@
|
||||
/* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#undef TWO_FILE_COMMANDLINE /* optional */
|
||||
#define USE_SETMODE /* Needed to make one-file style work in DJGPP */
|
||||
#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
49
jconfig.h.in
Normal file
49
jconfig.h.in
Normal file
@@ -0,0 +1,49 @@
|
||||
/* Define if your compiler supports prototypes */
|
||||
#undef HAVE_PROTOTYPES
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned char'. */
|
||||
#undef HAVE_UNSIGNED_CHAR
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned short'. */
|
||||
#undef HAVE_UNSIGNED_SHORT
|
||||
|
||||
/* Define if you want use complete types */
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
/* Define if you have BSD-like bzero and bcopy */
|
||||
#undef NEED_BSD_STRINGS
|
||||
|
||||
/* Define if you need short function names */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
|
||||
/* Define if you have sys/types.h */
|
||||
#undef NEED_SYS_TYPES_H
|
||||
|
||||
/* Define if shift is unsigned */
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
#undef WITH_SIMD
|
||||
|
||||
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
# undef __CHAR_UNSIGNED__
|
||||
#endif
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#undef inline
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
43
jconfig.mac
43
jconfig.mac
@@ -1,43 +0,0 @@
|
||||
/* jconfig.mac --- jconfig.h for CodeWarrior on Apple Macintosh */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#define USE_MAC_MEMMGR /* Define this if you use jmemmac.c */
|
||||
|
||||
#define ALIGN_TYPE long /* Needed for 680x0 Macs */
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define USE_CCOMMAND /* Command line reader for Macintosh */
|
||||
#define TWO_FILE_COMMANDLINE /* Binary I/O thru stdin/stdout doesn't work */
|
||||
|
||||
#undef NEED_SIGNAL_CATCHER
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
43
jconfig.manx
43
jconfig.manx
@@ -1,43 +0,0 @@
|
||||
/* jconfig.manx --- jconfig.h for Amiga systems using Manx Aztec C ver 5.x. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */
|
||||
|
||||
#define SHORTxSHORT_32 /* produces better DCT code with Aztec C */
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE
|
||||
#define NEED_SIGNAL_CATCHER
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#define signal_catcher _abort /* hack for Aztec C naming requirements */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
52
jconfig.mc6
52
jconfig.mc6
@@ -1,52 +0,0 @@
|
||||
/* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#define NEED_FAR_POINTERS /* for small or medium memory model */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */
|
||||
|
||||
#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */
|
||||
|
||||
#define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */
|
||||
|
||||
#define NEED_FHEAPMIN /* far heap management routines are broken */
|
||||
|
||||
#define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */
|
||||
/* Note: the above define is known to improve the code with Microsoft C 6.00A.
|
||||
* I do not know whether it is good for later compiler versions.
|
||||
* Please report any info on this point to jpeg-info@uunet.uu.net.
|
||||
*/
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE
|
||||
#define USE_SETMODE /* Microsoft has setmode() */
|
||||
#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
43
jconfig.sas
43
jconfig.sas
@@ -1,43 +0,0 @@
|
||||
/* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */
|
||||
|
||||
#define NO_MKTEMP /* SAS C doesn't have mktemp() */
|
||||
|
||||
#define SHORTxSHORT_32 /* produces better DCT code with SAS C */
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE
|
||||
#define NEED_SIGNAL_CATCHER
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
42
jconfig.st
42
jconfig.st
@@ -1,42 +0,0 @@
|
||||
/* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#define INCOMPLETE_TYPES_BROKEN /* suppress undefined-structure warnings */
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#define ALIGN_TYPE long /* apparently double is a weird size? */
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE /* optional -- undef if you like Unix style */
|
||||
/* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define
|
||||
* USE_SETMODE. Some Atari compilers require it, some do not.
|
||||
*/
|
||||
#define NEED_SIGNAL_CATCHER /* needed if you use jmemname.c */
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
37
jconfig.vms
37
jconfig.vms
@@ -1,37 +0,0 @@
|
||||
/* jconfig.vms --- jconfig.h for use on Digital VMS. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#define TWO_FILE_COMMANDLINE /* Needed on VMS */
|
||||
#undef NEED_SIGNAL_CATCHER
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
38
jconfig.wat
38
jconfig.wat
@@ -1,38 +0,0 @@
|
||||
/* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */
|
||||
/* see jconfig.doc for explanations */
|
||||
|
||||
#define HAVE_PROTOTYPES
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#define CHAR_IS_UNSIGNED
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
#ifdef JPEG_CJPEG_DJPEG
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
#undef TWO_FILE_COMMANDLINE /* optional */
|
||||
#define USE_SETMODE /* Needed to make one-file style work in Watcom */
|
||||
#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */
|
||||
#undef DONT_USE_B_MODE
|
||||
#undef PROGRESS_REPORT /* optional */
|
||||
|
||||
#endif /* JPEG_CJPEG_DJPEG */
|
||||
@@ -2,6 +2,7 @@
|
||||
* jcparam.c
|
||||
*
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -363,6 +364,12 @@ jpeg_default_colorspace (j_compress_ptr cinfo)
|
||||
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
jpeg_set_colorspace(cinfo, JCS_YCbCr);
|
||||
break;
|
||||
case JCS_YCbCr:
|
||||
|
||||
@@ -223,7 +223,6 @@ dump_buffer (phuff_entropy_ptr entropy)
|
||||
* between calls, so 24 bits are sufficient.
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
|
||||
/* Emit some bits, unless we are in gather mode */
|
||||
@@ -276,7 +275,6 @@ flush_bits (phuff_entropy_ptr entropy)
|
||||
* Emit (or just count) a Huffman symbol.
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* jcsample.c
|
||||
*
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -48,6 +49,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
/* Pointer to routine to downsample a single component */
|
||||
@@ -494,6 +496,9 @@ jinit_downsampler (j_compress_ptr cinfo)
|
||||
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
|
||||
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
|
||||
smoothok = FALSE;
|
||||
if (jsimd_can_h2v1_downsample())
|
||||
downsample->methods[ci] = jsimd_h2v1_downsample;
|
||||
else
|
||||
downsample->methods[ci] = h2v1_downsample;
|
||||
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
|
||||
compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
|
||||
@@ -503,6 +508,9 @@ jinit_downsampler (j_compress_ptr cinfo)
|
||||
downsample->pub.need_context_rows = TRUE;
|
||||
} else
|
||||
#endif
|
||||
if (jsimd_can_h2v2_downsample())
|
||||
downsample->methods[ci] = jsimd_h2v2_downsample;
|
||||
else
|
||||
downsample->methods[ci] = h2v2_downsample;
|
||||
} else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
|
||||
(cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
|
||||
|
||||
13
jdcoefct.c
13
jdcoefct.c
@@ -47,6 +47,9 @@ typedef struct {
|
||||
*/
|
||||
JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
|
||||
|
||||
/* Temporary workspace for one MCU */
|
||||
JCOEF * workspace;
|
||||
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
/* In multi-pass modes, we need a virtual block array for each component. */
|
||||
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
|
||||
@@ -471,13 +474,16 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
jpeg_component_info *compptr;
|
||||
inverse_DCT_method_ptr inverse_DCT;
|
||||
boolean first_row, last_row;
|
||||
JBLOCK workspace;
|
||||
JCOEF * workspace;
|
||||
int *coef_bits;
|
||||
JQUANT_TBL *quanttbl;
|
||||
INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
|
||||
int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
|
||||
int Al, pred;
|
||||
|
||||
/* Keep a local variable to avoid looking it up more than once */
|
||||
workspace = coef->workspace;
|
||||
|
||||
/* Force some input to be done if we are getting ahead of the input. */
|
||||
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
|
||||
! cinfo->inputctl->eoi_reached) {
|
||||
@@ -733,4 +739,9 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
|
||||
coef->pub.decompress_data = decompress_onepass;
|
||||
coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
|
||||
}
|
||||
|
||||
/* Allocate the workspace buffer */
|
||||
coef->workspace = (JCOEF *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(JCOEF) * DCTSIZE2);
|
||||
}
|
||||
|
||||
37
jdcolor.c
37
jdcolor.c
@@ -2,6 +2,8 @@
|
||||
* jdcolor.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -11,6 +13,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
@@ -146,12 +149,12 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
cb = GETJSAMPLE(inptr1[col]);
|
||||
cr = GETJSAMPLE(inptr2[col]);
|
||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
||||
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
|
||||
outptr[RGB_GREEN] = range_limit[y +
|
||||
outptr[rgb_red[cinfo->out_color_space]] = range_limit[y + Crrtab[cr]];
|
||||
outptr[rgb_green[cinfo->out_color_space]] = range_limit[y +
|
||||
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
|
||||
outptr += RGB_PIXELSIZE;
|
||||
outptr[rgb_blue[cinfo->out_color_space]] = range_limit[y + Cbbtab[cb]];
|
||||
outptr += rgb_pixelsize[cinfo->out_color_space];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,16 +222,21 @@ gray_rgb_convert (j_decompress_ptr cinfo,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, outptr;
|
||||
JSAMPLE *maxinptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
int rindex = rgb_red[cinfo->out_color_space];
|
||||
int gindex = rgb_green[cinfo->out_color_space];
|
||||
int bindex = rgb_blue[cinfo->out_color_space];
|
||||
int rgbstride = rgb_pixelsize[cinfo->out_color_space];
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = input_buf[0][input_row++];
|
||||
maxinptr = &inptr[num_cols];
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
for (; inptr < maxinptr; inptr++, outptr += rgbstride) {
|
||||
/* We can dispense with GETJSAMPLE() here */
|
||||
outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
|
||||
outptr += RGB_PIXELSIZE;
|
||||
outptr[rindex] = outptr[gindex] = outptr[bindex] = *inptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,13 +364,24 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
|
||||
if (cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
if (jsimd_can_ycc_rgb())
|
||||
cconvert->pub.color_convert = jsimd_ycc_rgb_convert;
|
||||
else {
|
||||
cconvert->pub.color_convert = ycc_rgb_convert;
|
||||
build_ycc_rgb_table(cinfo);
|
||||
}
|
||||
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
|
||||
cconvert->pub.color_convert = gray_rgb_convert;
|
||||
} else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
|
||||
} else if (cinfo->jpeg_color_space == cinfo->out_color_space &&
|
||||
rgb_pixelsize[cinfo->out_color_space] == 3) {
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
|
||||
16
jdct.h
16
jdct.h
@@ -23,18 +23,26 @@
|
||||
* have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
|
||||
* convention improves accuracy in integer implementations and saves some
|
||||
* work in floating-point ones.
|
||||
* Quantization of the output coefficients is done by jcdctmgr.c.
|
||||
* Quantization of the output coefficients is done by jcdctmgr.c. This
|
||||
* step requires an unsigned type and also one with twice the bits.
|
||||
*/
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
#ifndef WITH_SIMD
|
||||
typedef int DCTELEM; /* 16 or 32 bits is fine */
|
||||
typedef unsigned int UDCTELEM;
|
||||
typedef unsigned long long UDCTELEM2;
|
||||
#else
|
||||
typedef short DCTELEM; /* prefer 16 bit with SIMD for parellelism */
|
||||
typedef unsigned short UDCTELEM;
|
||||
typedef unsigned int UDCTELEM2;
|
||||
#endif
|
||||
#else
|
||||
typedef INT32 DCTELEM; /* must have 32 bits */
|
||||
typedef UINT32 UDCTELEM;
|
||||
typedef unsigned long long UDCTELEM2;
|
||||
#endif
|
||||
|
||||
typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
|
||||
typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
|
||||
|
||||
|
||||
/*
|
||||
* An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
|
||||
|
||||
17
jddctmgr.c
17
jddctmgr.c
@@ -2,6 +2,7 @@
|
||||
* jddctmgr.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -19,6 +20,7 @@
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
#include "jsimddct.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -105,10 +107,16 @@ start_pass (j_decompress_ptr cinfo)
|
||||
method = JDCT_ISLOW; /* jidctred uses islow-style table */
|
||||
break;
|
||||
case 2:
|
||||
if (jsimd_can_idct_2x2())
|
||||
method_ptr = jsimd_idct_2x2;
|
||||
else
|
||||
method_ptr = jpeg_idct_2x2;
|
||||
method = JDCT_ISLOW; /* jidctred uses islow-style table */
|
||||
break;
|
||||
case 4:
|
||||
if (jsimd_can_idct_4x4())
|
||||
method_ptr = jsimd_idct_4x4;
|
||||
else
|
||||
method_ptr = jpeg_idct_4x4;
|
||||
method = JDCT_ISLOW; /* jidctred uses islow-style table */
|
||||
break;
|
||||
@@ -117,18 +125,27 @@ start_pass (j_decompress_ptr cinfo)
|
||||
switch (cinfo->dct_method) {
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
case JDCT_ISLOW:
|
||||
if (jsimd_can_idct_islow())
|
||||
method_ptr = jsimd_idct_islow;
|
||||
else
|
||||
method_ptr = jpeg_idct_islow;
|
||||
method = JDCT_ISLOW;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
case JDCT_IFAST:
|
||||
if (jsimd_can_idct_ifast())
|
||||
method_ptr = jsimd_idct_ifast;
|
||||
else
|
||||
method_ptr = jpeg_idct_ifast;
|
||||
method = JDCT_IFAST;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
case JDCT_FLOAT:
|
||||
if (jsimd_can_idct_float())
|
||||
method_ptr = jsimd_idct_float;
|
||||
else
|
||||
method_ptr = jpeg_idct_float;
|
||||
method = JDCT_FLOAT;
|
||||
break;
|
||||
|
||||
246
jdhuff.c
246
jdhuff.c
@@ -14,6 +14,21 @@
|
||||
* storage only upon successful completion of an MCU.
|
||||
*/
|
||||
|
||||
/* Modifications:
|
||||
* Copyright (C)2007 Sun Microsystems, Inc.
|
||||
* Copyright (C)2009 D. R. Commander
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
@@ -234,7 +249,8 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
|
||||
* with that code.
|
||||
*/
|
||||
|
||||
MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
|
||||
for (i = 0; i < (1 << HUFF_LOOKAHEAD); i++)
|
||||
dtbl->lookup[i] = (HUFF_LOOKAHEAD + 1) << HUFF_LOOKAHEAD;
|
||||
|
||||
p = 0;
|
||||
for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
|
||||
@@ -243,8 +259,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
|
||||
/* Generate left-justified code followed by all possible bit sequences */
|
||||
lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
|
||||
for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
|
||||
dtbl->look_nbits[lookbits] = l;
|
||||
dtbl->look_sym[lookbits] = htbl->huffval[p];
|
||||
dtbl->lookup[lookbits] = (l << HUFF_LOOKAHEAD) | htbl->huffval[p];
|
||||
lookbits++;
|
||||
}
|
||||
}
|
||||
@@ -438,9 +453,10 @@ jpeg_huff_decode (bitread_working_state * state,
|
||||
* On some machines, a shift and add will be faster than a table lookup.
|
||||
*/
|
||||
|
||||
#define AVOID_TABLES
|
||||
#ifdef AVOID_TABLES
|
||||
|
||||
#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
|
||||
#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((-1)<<(s)) + 1)))
|
||||
|
||||
#else
|
||||
|
||||
@@ -498,47 +514,19 @@ process_restart (j_decompress_ptr cinfo)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decode and return one MCU's worth of Huffman-compressed coefficients.
|
||||
* The coefficients are reordered from zigzag order into natural array order,
|
||||
* but are not dequantized.
|
||||
*
|
||||
* The i'th block of the MCU is stored into the block pointed to by
|
||||
* MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
|
||||
* (Wholesale zeroing is usually a little faster than retail...)
|
||||
*
|
||||
* Returns FALSE if data source requested suspension. In that case no
|
||||
* changes have been made to permanent state. (Exception: some output
|
||||
* coefficients may already have been assigned. This is harmless for
|
||||
* this module, since we'll just re-assign them on the next call.)
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
LOCAL(boolean)
|
||||
decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
int blkn;
|
||||
BITREAD_STATE_VARS;
|
||||
int blkn;
|
||||
savable_state state;
|
||||
|
||||
/* Process restart marker if needed; may have to suspend */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
if (! process_restart(cinfo))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* If we've run out of data, just leave the MCU set to zeroes.
|
||||
* This way, we return uniform gray for the remainder of the segment.
|
||||
*/
|
||||
if (! entropy->pub.insufficient_data) {
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
/* Load up working state */
|
||||
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
||||
ASSIGN_STATE(state, entropy->saved);
|
||||
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
JBLOCKROW block = MCU_data[blkn];
|
||||
d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
|
||||
@@ -611,13 +599,197 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
k += 15;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Completed MCU, so update state */
|
||||
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
|
||||
ASSIGN_STATE(entropy->saved, state);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define ADD_BYTE { \
|
||||
int val0 = *(buffer++); \
|
||||
int val1 = *(buffer); \
|
||||
\
|
||||
bits_left += 8; \
|
||||
get_buffer = (get_buffer << 8) | (val0); \
|
||||
if (val0 == 0xFF) { \
|
||||
buffer++; \
|
||||
if (val1 != 0) { \
|
||||
buffer -= 2; \
|
||||
get_buffer &= ~0xFF; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#if __WORDSIZE == 64 || defined(_WIN64)
|
||||
|
||||
#define ENSURE_SHORT \
|
||||
if (bits_left < 16) { \
|
||||
ADD_BYTE ADD_BYTE ADD_BYTE ADD_BYTE ADD_BYTE ADD_BYTE \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define ENSURE_SHORT if (bits_left < 16) { ADD_BYTE ADD_BYTE }
|
||||
|
||||
#endif
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
#define HUFF_DECODE_FAST(symbol, size, htbl) { \
|
||||
ENSURE_SHORT \
|
||||
symbol = PEEK_BITS(HUFF_LOOKAHEAD); \
|
||||
symbol = htbl->lookup[symbol]; \
|
||||
size = symbol >> 8; \
|
||||
bits_left -= size; \
|
||||
symbol = symbol & ((1 << HUFF_LOOKAHEAD) - 1); \
|
||||
if (size == HUFF_LOOKAHEAD + 1) { \
|
||||
symbol = (get_buffer >> bits_left) & ((1 << (size)) - 1); \
|
||||
while (symbol > htbl->maxcode[size]) { \
|
||||
symbol <<= 1; \
|
||||
symbol |= GET_BITS(1); \
|
||||
size++; \
|
||||
} \
|
||||
symbol = htbl->pub->huffval[ (int) (symbol + htbl->valoffset[size]) ]; \
|
||||
} \
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
LOCAL(boolean)
|
||||
decode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
BITREAD_STATE_VARS;
|
||||
JOCTET *buffer;
|
||||
int blkn;
|
||||
savable_state state;
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
/* Load up working state */
|
||||
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
||||
buffer = (JOCTET *) br_state.next_input_byte;
|
||||
ASSIGN_STATE(state, entropy->saved);
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
JBLOCKROW block = MCU_data[blkn];
|
||||
d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
|
||||
d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];
|
||||
register int s, k, r, l;
|
||||
|
||||
HUFF_DECODE_FAST(s, l, dctbl);
|
||||
if (s) {
|
||||
ENSURE_SHORT
|
||||
r = GET_BITS(s);
|
||||
s = HUFF_EXTEND(r, s);
|
||||
}
|
||||
|
||||
if (entropy->dc_needed[blkn]) {
|
||||
int ci = cinfo->MCU_membership[blkn];
|
||||
s += state.last_dc_val[ci];
|
||||
state.last_dc_val[ci] = s;
|
||||
(*block)[0] = (JCOEF) s;
|
||||
}
|
||||
|
||||
if (entropy->ac_needed[blkn]) {
|
||||
|
||||
for (k = 1; k < DCTSIZE2; k++) {
|
||||
HUFF_DECODE_FAST(s, l, actbl);
|
||||
r = s >> 4;
|
||||
s &= 15;
|
||||
|
||||
if (s) {
|
||||
k += r;
|
||||
ENSURE_SHORT
|
||||
r = GET_BITS(s);
|
||||
s = HUFF_EXTEND(r, s);
|
||||
(*block)[jpeg_natural_order[k]] = (JCOEF) s;
|
||||
} else {
|
||||
if (r != 15) break;
|
||||
k += 15;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
for (k = 1; k < DCTSIZE2; k++) {
|
||||
HUFF_DECODE_FAST(s, l, actbl);
|
||||
r = s >> 4;
|
||||
s &= 15;
|
||||
|
||||
if (s) {
|
||||
k += r;
|
||||
ENSURE_SHORT
|
||||
DROP_BITS(s);
|
||||
} else {
|
||||
if (r != 15) break;
|
||||
k += 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);
|
||||
br_state.next_input_byte = buffer;
|
||||
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
|
||||
ASSIGN_STATE(entropy->saved, state);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decode and return one MCU's worth of Huffman-compressed coefficients.
|
||||
* The coefficients are reordered from zigzag order into natural array order,
|
||||
* but are not dequantized.
|
||||
*
|
||||
* The i'th block of the MCU is stored into the block pointed to by
|
||||
* MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
|
||||
* (Wholesale zeroing is usually a little faster than retail...)
|
||||
*
|
||||
* Returns FALSE if data source requested suspension. In that case no
|
||||
* changes have been made to permanent state. (Exception: some output
|
||||
* coefficients may already have been assigned. This is harmless for
|
||||
* this module, since we'll just re-assign them on the next call.)
|
||||
*/
|
||||
|
||||
#define BUFSIZE (DCTSIZE2 * 2)
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
int usefast = 1;
|
||||
|
||||
/* Process restart marker if needed; may have to suspend */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
if (! process_restart(cinfo))
|
||||
return FALSE;
|
||||
usefast = 0;
|
||||
}
|
||||
|
||||
if (cinfo->src->bytes_in_buffer < BUFSIZE * cinfo->blocks_in_MCU)
|
||||
usefast = 0;
|
||||
|
||||
/* If we've run out of data, just leave the MCU set to zeroes.
|
||||
* This way, we return uniform gray for the remainder of the segment.
|
||||
*/
|
||||
if (! entropy->pub.insufficient_data) {
|
||||
|
||||
if (usefast) {
|
||||
if (!decode_mcu_fast(cinfo, MCU_data)) return FALSE;
|
||||
}
|
||||
else {
|
||||
if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Account for restart interval (no-op if not using restarts) */
|
||||
|
||||
26
jdhuff.h
26
jdhuff.h
@@ -36,13 +36,17 @@ typedef struct {
|
||||
/* Link to public Huffman table (needed only in jpeg_huff_decode) */
|
||||
JHUFF_TBL *pub;
|
||||
|
||||
/* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
|
||||
/* Lookahead table: indexed by the next HUFF_LOOKAHEAD bits of
|
||||
* the input data stream. If the next Huffman code is no more
|
||||
* than HUFF_LOOKAHEAD bits long, we can obtain its length and
|
||||
* the corresponding symbol directly from these tables.
|
||||
* the corresponding symbol directly from this tables.
|
||||
*
|
||||
* The lower 8 bits of each table entry contain the number of
|
||||
* bits in the corresponding Huffman code, or HUFF_LOOKAHEAD + 1
|
||||
* if too long. The next 8 bits of each entry contain the
|
||||
* symbol.
|
||||
*/
|
||||
int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
|
||||
UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
|
||||
int lookup[1<<HUFF_LOOKAHEAD];
|
||||
} d_derived_tbl;
|
||||
|
||||
/* Expand a Huffman table definition into the derived format */
|
||||
@@ -69,9 +73,18 @@ EXTERN(void) jpeg_make_d_derived_tbl
|
||||
* necessary.
|
||||
*/
|
||||
|
||||
#if __WORDSIZE == 64 || defined(_WIN64)
|
||||
|
||||
typedef size_t bit_buf_type; /* type of bit-extraction buffer */
|
||||
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
|
||||
|
||||
#else
|
||||
|
||||
typedef INT32 bit_buf_type; /* type of bit-extraction buffer */
|
||||
#define BIT_BUF_SIZE 32 /* size of buffer in bits */
|
||||
|
||||
#endif
|
||||
|
||||
/* If long is > 32 bits on your machine, and shifting/masking longs is
|
||||
* reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
|
||||
* appropriately should be a win. Unfortunately we can't define the size
|
||||
@@ -183,11 +196,10 @@ EXTERN(boolean) jpeg_fill_bit_buffer
|
||||
} \
|
||||
} \
|
||||
look = PEEK_BITS(HUFF_LOOKAHEAD); \
|
||||
if ((nb = htbl->look_nbits[look]) != 0) { \
|
||||
if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
|
||||
DROP_BITS(nb); \
|
||||
result = htbl->look_sym[look]; \
|
||||
result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
|
||||
} else { \
|
||||
nb = HUFF_LOOKAHEAD+1; \
|
||||
slowlabel: \
|
||||
if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
|
||||
{ failaction; } \
|
||||
|
||||
21
jdmaster.c
21
jdmaster.c
@@ -2,6 +2,7 @@
|
||||
* jdmaster.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -49,8 +50,14 @@ use_merged_upsample (j_decompress_ptr cinfo)
|
||||
return FALSE;
|
||||
/* jdmerge.c only supports YCC=>RGB color conversion */
|
||||
if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
|
||||
cinfo->out_color_space != JCS_RGB ||
|
||||
cinfo->out_color_components != RGB_PIXELSIZE)
|
||||
(cinfo->out_color_space != JCS_RGB &&
|
||||
cinfo->out_color_space != JCS_EXT_RGB &&
|
||||
cinfo->out_color_space != JCS_EXT_RGBX &&
|
||||
cinfo->out_color_space != JCS_EXT_BGR &&
|
||||
cinfo->out_color_space != JCS_EXT_BGRX &&
|
||||
cinfo->out_color_space != JCS_EXT_XBGR &&
|
||||
cinfo->out_color_space != JCS_EXT_XRGB) ||
|
||||
cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space])
|
||||
return FALSE;
|
||||
/* and it only handles 2h1v or 2h2v sampling ratios */
|
||||
if (cinfo->comp_info[0].h_samp_factor != 2 ||
|
||||
@@ -175,10 +182,14 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
||||
cinfo->out_color_components = 1;
|
||||
break;
|
||||
case JCS_RGB:
|
||||
#if RGB_PIXELSIZE != 3
|
||||
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
|
||||
break;
|
||||
#endif /* else share code with YCbCr */
|
||||
case JCS_YCbCr:
|
||||
cinfo->out_color_components = 3;
|
||||
break;
|
||||
|
||||
67
jdmerge.c
67
jdmerge.c
@@ -2,6 +2,8 @@
|
||||
* jdmerge.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -35,6 +37,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
@@ -255,15 +258,15 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
|
||||
cblue = Cbbtab[cb];
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
outptr[RGB_RED] = range_limit[y + cred];
|
||||
outptr[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr += RGB_PIXELSIZE;
|
||||
outptr[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
outptr += rgb_pixelsize[cinfo->out_color_space];
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
outptr[RGB_RED] = range_limit[y + cred];
|
||||
outptr[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr += RGB_PIXELSIZE;
|
||||
outptr[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
outptr += rgb_pixelsize[cinfo->out_color_space];
|
||||
}
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
@@ -273,9 +276,9 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
outptr[RGB_RED] = range_limit[y + cred];
|
||||
outptr[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,24 +322,24 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
|
||||
cblue = Cbbtab[cb];
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
outptr0[RGB_RED] = range_limit[y + cred];
|
||||
outptr0[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr0[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr0[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr0[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr0[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
outptr0 += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
outptr0[RGB_RED] = range_limit[y + cred];
|
||||
outptr0[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr0[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr0[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr0[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr0[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
outptr0 += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
outptr1[RGB_RED] = range_limit[y + cred];
|
||||
outptr1[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr1[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr1[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr1[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr1[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
outptr1 += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
outptr1[RGB_RED] = range_limit[y + cred];
|
||||
outptr1[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr1[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr1[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr1[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr1[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
outptr1 += RGB_PIXELSIZE;
|
||||
}
|
||||
/* If image width is odd, do the last output column separately */
|
||||
@@ -347,13 +350,13 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
outptr0[RGB_RED] = range_limit[y + cred];
|
||||
outptr0[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr0[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr0[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr0[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr0[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
outptr1[RGB_RED] = range_limit[y + cred];
|
||||
outptr1[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr1[RGB_BLUE] = range_limit[y + cblue];
|
||||
outptr1[rgb_red[cinfo->out_color_space]] = range_limit[y + cred];
|
||||
outptr1[rgb_green[cinfo->out_color_space]] = range_limit[y + cgreen];
|
||||
outptr1[rgb_blue[cinfo->out_color_space]] = range_limit[y + cblue];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +385,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
|
||||
|
||||
if (cinfo->max_v_samp_factor == 2) {
|
||||
upsample->pub.upsample = merged_2v_upsample;
|
||||
if (jsimd_can_h2v2_merged_upsample())
|
||||
upsample->upmethod = jsimd_h2v2_merged_upsample;
|
||||
else
|
||||
upsample->upmethod = h2v2_merged_upsample;
|
||||
/* Allocate a spare row buffer */
|
||||
upsample->spare_row = (JSAMPROW)
|
||||
@@ -389,6 +395,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
|
||||
(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
|
||||
} else {
|
||||
upsample->pub.upsample = merged_1v_upsample;
|
||||
if (jsimd_can_h2v1_merged_upsample())
|
||||
upsample->upmethod = jsimd_h2v1_merged_upsample;
|
||||
else
|
||||
upsample->upmethod = h2v1_merged_upsample;
|
||||
/* No spare row needed */
|
||||
upsample->spare_row = NULL;
|
||||
|
||||
20
jdsample.c
20
jdsample.c
@@ -2,6 +2,7 @@
|
||||
* jdsample.c
|
||||
*
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -21,6 +22,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
/* Pointer to routine to upsample a single component */
|
||||
@@ -447,18 +449,32 @@ jinit_upsampler (j_decompress_ptr cinfo)
|
||||
} else if (h_in_group * 2 == h_out_group &&
|
||||
v_in_group == v_out_group) {
|
||||
/* Special cases for 2h1v upsampling */
|
||||
if (do_fancy && compptr->downsampled_width > 2)
|
||||
if (do_fancy && compptr->downsampled_width > 2) {
|
||||
if (jsimd_can_h2v1_fancy_upsample())
|
||||
upsample->methods[ci] = jsimd_h2v1_fancy_upsample;
|
||||
else
|
||||
upsample->methods[ci] = h2v1_fancy_upsample;
|
||||
} else {
|
||||
if (jsimd_can_h2v1_upsample())
|
||||
upsample->methods[ci] = jsimd_h2v1_upsample;
|
||||
else
|
||||
upsample->methods[ci] = h2v1_upsample;
|
||||
}
|
||||
} else if (h_in_group * 2 == h_out_group &&
|
||||
v_in_group * 2 == v_out_group) {
|
||||
/* Special cases for 2h2v upsampling */
|
||||
if (do_fancy && compptr->downsampled_width > 2) {
|
||||
if (jsimd_can_h2v2_fancy_upsample())
|
||||
upsample->methods[ci] = jsimd_h2v2_fancy_upsample;
|
||||
else
|
||||
upsample->methods[ci] = h2v2_fancy_upsample;
|
||||
upsample->pub.need_context_rows = TRUE;
|
||||
} else
|
||||
} else {
|
||||
if (jsimd_can_h2v2_upsample())
|
||||
upsample->methods[ci] = jsimd_h2v2_upsample;
|
||||
else
|
||||
upsample->methods[ci] = h2v2_upsample;
|
||||
}
|
||||
} else if ((h_out_group % h_in_group) == 0 &&
|
||||
(v_out_group % v_in_group) == 0) {
|
||||
/* Generic integral-factors upsampling method */
|
||||
|
||||
167
jmemansi.c
167
jmemansi.c
@@ -1,167 +0,0 @@
|
||||
/*
|
||||
* jmemansi.c
|
||||
*
|
||||
* Copyright (C) 1992-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file provides a simple generic implementation of the system-
|
||||
* dependent portion of the JPEG memory manager. This implementation
|
||||
* assumes that you have the ANSI-standard library routine tmpfile().
|
||||
* Also, the problem of determining the amount of memory available
|
||||
* is shoved onto the user.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||
|
||||
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
|
||||
extern void * malloc JPP((size_t size));
|
||||
extern void free JPP((void *ptr));
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET /* pre-ANSI systems may not define this; */
|
||||
#define SEEK_SET 0 /* if not, assume 0 is correct */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Memory allocation and freeing are controlled by the regular library
|
||||
* routines malloc() and free().
|
||||
*/
|
||||
|
||||
GLOBAL(void *)
|
||||
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void *) malloc(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
|
||||
{
|
||||
free(object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "Large" objects are treated the same as "small" ones.
|
||||
* NB: although we include FAR keywords in the routine declarations,
|
||||
* this file won't actually work in 80x86 small/medium model; at least,
|
||||
* you probably won't be able to process useful-size images in only 64KB.
|
||||
*/
|
||||
|
||||
GLOBAL(void FAR *)
|
||||
jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void FAR *) malloc(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
||||
{
|
||||
free(object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine computes the total memory space available for allocation.
|
||||
* It's impossible to do this in a portable way; our current solution is
|
||||
* to make the user tell us (with a default value set at compile time).
|
||||
* If you can actually get the available space, it's a good idea to subtract
|
||||
* a slop factor of 5% or so.
|
||||
*/
|
||||
|
||||
#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
|
||||
#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */
|
||||
#endif
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||
long max_bytes_needed, long already_allocated)
|
||||
{
|
||||
return cinfo->mem->max_memory_to_use - already_allocated;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Backing store (temporary file) management.
|
||||
* Backing store objects are only used when the value returned by
|
||||
* jpeg_mem_available is less than the total space needed. You can dispense
|
||||
* with these routines if you have plenty of virtual memory; see jmemnobs.c.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
if (fseek(info->temp_file, file_offset, SEEK_SET))
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
if (JFREAD(info->temp_file, buffer_address, byte_count)
|
||||
!= (size_t) byte_count)
|
||||
ERREXIT(cinfo, JERR_TFILE_READ);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
if (fseek(info->temp_file, file_offset, SEEK_SET))
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
if (JFWRITE(info->temp_file, buffer_address, byte_count)
|
||||
!= (size_t) byte_count)
|
||||
ERREXIT(cinfo, JERR_TFILE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
|
||||
{
|
||||
fclose(info->temp_file);
|
||||
/* Since this implementation uses tmpfile() to create the file,
|
||||
* no explicit file deletion is needed.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initial opening of a backing-store object.
|
||||
*
|
||||
* This version uses tmpfile(), which constructs a suitable file name
|
||||
* behind the scenes. We don't have to use info->temp_name[] at all;
|
||||
* indeed, we can't even find out the actual name of the temp file.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
if ((info->temp_file = tmpfile()) == NULL)
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, "");
|
||||
info->read_backing_store = read_backing_store;
|
||||
info->write_backing_store = write_backing_store;
|
||||
info->close_backing_store = close_backing_store;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* These routines take care of any system-dependent initialization and
|
||||
* cleanup required.
|
||||
*/
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_init (j_common_ptr cinfo)
|
||||
{
|
||||
return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_mem_term (j_common_ptr cinfo)
|
||||
{
|
||||
/* no work */
|
||||
}
|
||||
638
jmemdos.c
638
jmemdos.c
@@ -1,638 +0,0 @@
|
||||
/*
|
||||
* jmemdos.c
|
||||
*
|
||||
* Copyright (C) 1992-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file provides an MS-DOS-compatible implementation of the system-
|
||||
* dependent portion of the JPEG memory manager. Temporary data can be
|
||||
* stored in extended or expanded memory as well as in regular DOS files.
|
||||
*
|
||||
* If you use this file, you must be sure that NEED_FAR_POINTERS is defined
|
||||
* if you compile in a small-data memory model; it should NOT be defined if
|
||||
* you use a large-data memory model. This file is not recommended if you
|
||||
* are using a flat-memory-space 386 environment such as DJGCC or Watcom C.
|
||||
* Also, this code will NOT work if struct fields are aligned on greater than
|
||||
* 2-byte boundaries.
|
||||
*
|
||||
* Based on code contributed by Ge' Weijers.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If you have both extended and expanded memory, you may want to change the
|
||||
* order in which they are tried in jopen_backing_store. On a 286 machine
|
||||
* expanded memory is usually faster, since extended memory access involves
|
||||
* an expensive protected-mode-and-back switch. On 386 and better, extended
|
||||
* memory is usually faster. As distributed, the code tries extended memory
|
||||
* first (what? not everyone has a 386? :-).
|
||||
*
|
||||
* You can disable use of extended/expanded memory entirely by altering these
|
||||
* definitions or overriding them from the Makefile (eg, -DEMS_SUPPORTED=0).
|
||||
*/
|
||||
|
||||
#ifndef XMS_SUPPORTED
|
||||
#define XMS_SUPPORTED 1
|
||||
#endif
|
||||
#ifndef EMS_SUPPORTED
|
||||
#define EMS_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||
|
||||
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare these */
|
||||
extern void * malloc JPP((size_t size));
|
||||
extern void free JPP((void *ptr));
|
||||
extern char * getenv JPP((const char * name));
|
||||
#endif
|
||||
|
||||
#ifdef NEED_FAR_POINTERS
|
||||
|
||||
#ifdef __TURBOC__
|
||||
/* These definitions work for Borland C (Turbo C) */
|
||||
#include <alloc.h> /* need farmalloc(), farfree() */
|
||||
#define far_malloc(x) farmalloc(x)
|
||||
#define far_free(x) farfree(x)
|
||||
#else
|
||||
/* These definitions work for Microsoft C and compatible compilers */
|
||||
#include <malloc.h> /* need _fmalloc(), _ffree() */
|
||||
#define far_malloc(x) _fmalloc(x)
|
||||
#define far_free(x) _ffree(x)
|
||||
#endif
|
||||
|
||||
#else /* not NEED_FAR_POINTERS */
|
||||
|
||||
#define far_malloc(x) malloc(x)
|
||||
#define far_free(x) free(x)
|
||||
|
||||
#endif /* NEED_FAR_POINTERS */
|
||||
|
||||
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
||||
#define READ_BINARY "r"
|
||||
#else
|
||||
#define READ_BINARY "rb"
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSDOS_MEMMGR /* make sure user got configuration right */
|
||||
You forgot to define USE_MSDOS_MEMMGR in jconfig.h. /* deliberate syntax error */
|
||||
#endif
|
||||
|
||||
#if MAX_ALLOC_CHUNK >= 65535L /* make sure jconfig.h got this right */
|
||||
MAX_ALLOC_CHUNK should be less than 64K. /* deliberate syntax error */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Declarations for assembly-language support routines (see jmemdosa.asm).
|
||||
*
|
||||
* The functions are declared "far" as are all their pointer arguments;
|
||||
* this ensures the assembly source code will work regardless of the
|
||||
* compiler memory model. We assume "short" is 16 bits, "long" is 32.
|
||||
*/
|
||||
|
||||
typedef void far * XMSDRIVER; /* actually a pointer to code */
|
||||
typedef struct { /* registers for calling XMS driver */
|
||||
unsigned short ax, dx, bx;
|
||||
void far * ds_si;
|
||||
} XMScontext;
|
||||
typedef struct { /* registers for calling EMS driver */
|
||||
unsigned short ax, dx, bx;
|
||||
void far * ds_si;
|
||||
} EMScontext;
|
||||
|
||||
extern short far jdos_open JPP((short far * handle, char far * filename));
|
||||
extern short far jdos_close JPP((short handle));
|
||||
extern short far jdos_seek JPP((short handle, long offset));
|
||||
extern short far jdos_read JPP((short handle, void far * buffer,
|
||||
unsigned short count));
|
||||
extern short far jdos_write JPP((short handle, void far * buffer,
|
||||
unsigned short count));
|
||||
extern void far jxms_getdriver JPP((XMSDRIVER far *));
|
||||
extern void far jxms_calldriver JPP((XMSDRIVER, XMScontext far *));
|
||||
extern short far jems_available JPP((void));
|
||||
extern void far jems_calldriver JPP((EMScontext far *));
|
||||
|
||||
|
||||
/*
|
||||
* Selection of a file name for a temporary file.
|
||||
* This is highly system-dependent, and you may want to customize it.
|
||||
*/
|
||||
|
||||
static int next_file_num; /* to distinguish among several temp files */
|
||||
|
||||
LOCAL(void)
|
||||
select_file_name (char * fname)
|
||||
{
|
||||
const char * env;
|
||||
char * ptr;
|
||||
FILE * tfile;
|
||||
|
||||
/* Keep generating file names till we find one that's not in use */
|
||||
for (;;) {
|
||||
/* Get temp directory name from environment TMP or TEMP variable;
|
||||
* if none, use "."
|
||||
*/
|
||||
if ((env = (const char *) getenv("TMP")) == NULL)
|
||||
if ((env = (const char *) getenv("TEMP")) == NULL)
|
||||
env = ".";
|
||||
if (*env == '\0') /* null string means "." */
|
||||
env = ".";
|
||||
ptr = fname; /* copy name to fname */
|
||||
while (*env != '\0')
|
||||
*ptr++ = *env++;
|
||||
if (ptr[-1] != '\\' && ptr[-1] != '/')
|
||||
*ptr++ = '\\'; /* append backslash if not in env variable */
|
||||
/* Append a suitable file name */
|
||||
next_file_num++; /* advance counter */
|
||||
sprintf(ptr, "JPG%03d.TMP", next_file_num);
|
||||
/* Probe to see if file name is already in use */
|
||||
if ((tfile = fopen(fname, READ_BINARY)) == NULL)
|
||||
break;
|
||||
fclose(tfile); /* oops, it's there; close tfile & try again */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Near-memory allocation and freeing are controlled by the regular library
|
||||
* routines malloc() and free().
|
||||
*/
|
||||
|
||||
GLOBAL(void *)
|
||||
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void *) malloc(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
|
||||
{
|
||||
free(object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "Large" objects are allocated in far memory, if possible
|
||||
*/
|
||||
|
||||
GLOBAL(void FAR *)
|
||||
jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void FAR *) far_malloc(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
||||
{
|
||||
far_free(object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine computes the total memory space available for allocation.
|
||||
* It's impossible to do this in a portable way; our current solution is
|
||||
* to make the user tell us (with a default value set at compile time).
|
||||
* If you can actually get the available space, it's a good idea to subtract
|
||||
* a slop factor of 5% or so.
|
||||
*/
|
||||
|
||||
#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
|
||||
#define DEFAULT_MAX_MEM 300000L /* for total usage about 450K */
|
||||
#endif
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||
long max_bytes_needed, long already_allocated)
|
||||
{
|
||||
return cinfo->mem->max_memory_to_use - already_allocated;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Backing store (temporary file) management.
|
||||
* Backing store objects are only used when the value returned by
|
||||
* jpeg_mem_available is less than the total space needed. You can dispense
|
||||
* with these routines if you have plenty of virtual memory; see jmemnobs.c.
|
||||
*/
|
||||
|
||||
/*
|
||||
* For MS-DOS we support three types of backing storage:
|
||||
* 1. Conventional DOS files. We access these by direct DOS calls rather
|
||||
* than via the stdio package. This provides a bit better performance,
|
||||
* but the real reason is that the buffers to be read or written are FAR.
|
||||
* The stdio library for small-data memory models can't cope with that.
|
||||
* 2. Extended memory, accessed per the XMS V2.0 specification.
|
||||
* 3. Expanded memory, accessed per the LIM/EMS 4.0 specification.
|
||||
* You'll need copies of those specs to make sense of the related code.
|
||||
* The specs are available by Internet FTP from the SIMTEL archives
|
||||
* (oak.oakland.edu and its various mirror sites). See files
|
||||
* pub/msdos/microsoft/xms20.arc and pub/msdos/info/limems41.zip.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Access methods for a DOS file.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
read_file_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
if (jdos_seek(info->handle.file_handle, file_offset))
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
/* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
|
||||
if (byte_count > 65535L) /* safety check */
|
||||
ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
|
||||
if (jdos_read(info->handle.file_handle, buffer_address,
|
||||
(unsigned short) byte_count))
|
||||
ERREXIT(cinfo, JERR_TFILE_READ);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
write_file_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
if (jdos_seek(info->handle.file_handle, file_offset))
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
/* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
|
||||
if (byte_count > 65535L) /* safety check */
|
||||
ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
|
||||
if (jdos_write(info->handle.file_handle, buffer_address,
|
||||
(unsigned short) byte_count))
|
||||
ERREXIT(cinfo, JERR_TFILE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
close_file_store (j_common_ptr cinfo, backing_store_ptr info)
|
||||
{
|
||||
jdos_close(info->handle.file_handle); /* close the file */
|
||||
remove(info->temp_name); /* delete the file */
|
||||
/* If your system doesn't have remove(), try unlink() instead.
|
||||
* remove() is the ANSI-standard name for this function, but
|
||||
* unlink() was more common in pre-ANSI systems.
|
||||
*/
|
||||
TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(boolean)
|
||||
open_file_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
short handle;
|
||||
|
||||
select_file_name(info->temp_name);
|
||||
if (jdos_open((short far *) & handle, (char far *) info->temp_name)) {
|
||||
/* might as well exit since jpeg_open_backing_store will fail anyway */
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
|
||||
return FALSE;
|
||||
}
|
||||
info->handle.file_handle = handle;
|
||||
info->read_backing_store = read_file_store;
|
||||
info->write_backing_store = write_file_store;
|
||||
info->close_backing_store = close_file_store;
|
||||
TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
|
||||
return TRUE; /* succeeded */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Access methods for extended memory.
|
||||
*/
|
||||
|
||||
#if XMS_SUPPORTED
|
||||
|
||||
static XMSDRIVER xms_driver; /* saved address of XMS driver */
|
||||
|
||||
typedef union { /* either long offset or real-mode pointer */
|
||||
long offset;
|
||||
void far * ptr;
|
||||
} XMSPTR;
|
||||
|
||||
typedef struct { /* XMS move specification structure */
|
||||
long length;
|
||||
XMSH src_handle;
|
||||
XMSPTR src;
|
||||
XMSH dst_handle;
|
||||
XMSPTR dst;
|
||||
} XMSspec;
|
||||
|
||||
#define ODD(X) (((X) & 1L) != 0)
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
read_xms_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
XMScontext ctx;
|
||||
XMSspec spec;
|
||||
char endbuffer[2];
|
||||
|
||||
/* The XMS driver can't cope with an odd length, so handle the last byte
|
||||
* specially if byte_count is odd. We don't expect this to be common.
|
||||
*/
|
||||
|
||||
spec.length = byte_count & (~ 1L);
|
||||
spec.src_handle = info->handle.xms_handle;
|
||||
spec.src.offset = file_offset;
|
||||
spec.dst_handle = 0;
|
||||
spec.dst.ptr = buffer_address;
|
||||
|
||||
ctx.ds_si = (void far *) & spec;
|
||||
ctx.ax = 0x0b00; /* EMB move */
|
||||
jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
|
||||
if (ctx.ax != 1)
|
||||
ERREXIT(cinfo, JERR_XMS_READ);
|
||||
|
||||
if (ODD(byte_count)) {
|
||||
read_xms_store(cinfo, info, (void FAR *) endbuffer,
|
||||
file_offset + byte_count - 1L, 2L);
|
||||
((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
write_xms_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
XMScontext ctx;
|
||||
XMSspec spec;
|
||||
char endbuffer[2];
|
||||
|
||||
/* The XMS driver can't cope with an odd length, so handle the last byte
|
||||
* specially if byte_count is odd. We don't expect this to be common.
|
||||
*/
|
||||
|
||||
spec.length = byte_count & (~ 1L);
|
||||
spec.src_handle = 0;
|
||||
spec.src.ptr = buffer_address;
|
||||
spec.dst_handle = info->handle.xms_handle;
|
||||
spec.dst.offset = file_offset;
|
||||
|
||||
ctx.ds_si = (void far *) & spec;
|
||||
ctx.ax = 0x0b00; /* EMB move */
|
||||
jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
|
||||
if (ctx.ax != 1)
|
||||
ERREXIT(cinfo, JERR_XMS_WRITE);
|
||||
|
||||
if (ODD(byte_count)) {
|
||||
read_xms_store(cinfo, info, (void FAR *) endbuffer,
|
||||
file_offset + byte_count - 1L, 2L);
|
||||
endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L];
|
||||
write_xms_store(cinfo, info, (void FAR *) endbuffer,
|
||||
file_offset + byte_count - 1L, 2L);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
close_xms_store (j_common_ptr cinfo, backing_store_ptr info)
|
||||
{
|
||||
XMScontext ctx;
|
||||
|
||||
ctx.dx = info->handle.xms_handle;
|
||||
ctx.ax = 0x0a00;
|
||||
jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
|
||||
TRACEMS1(cinfo, 1, JTRC_XMS_CLOSE, info->handle.xms_handle);
|
||||
/* we ignore any error return from the driver */
|
||||
}
|
||||
|
||||
|
||||
LOCAL(boolean)
|
||||
open_xms_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
XMScontext ctx;
|
||||
|
||||
/* Get address of XMS driver */
|
||||
jxms_getdriver((XMSDRIVER far *) & xms_driver);
|
||||
if (xms_driver == NULL)
|
||||
return FALSE; /* no driver to be had */
|
||||
|
||||
/* Get version number, must be >= 2.00 */
|
||||
ctx.ax = 0x0000;
|
||||
jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
|
||||
if (ctx.ax < (unsigned short) 0x0200)
|
||||
return FALSE;
|
||||
|
||||
/* Try to get space (expressed in kilobytes) */
|
||||
ctx.dx = (unsigned short) ((total_bytes_needed + 1023L) >> 10);
|
||||
ctx.ax = 0x0900;
|
||||
jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
|
||||
if (ctx.ax != 1)
|
||||
return FALSE;
|
||||
|
||||
/* Succeeded, save the handle and away we go */
|
||||
info->handle.xms_handle = ctx.dx;
|
||||
info->read_backing_store = read_xms_store;
|
||||
info->write_backing_store = write_xms_store;
|
||||
info->close_backing_store = close_xms_store;
|
||||
TRACEMS1(cinfo, 1, JTRC_XMS_OPEN, ctx.dx);
|
||||
return TRUE; /* succeeded */
|
||||
}
|
||||
|
||||
#endif /* XMS_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Access methods for expanded memory.
|
||||
*/
|
||||
|
||||
#if EMS_SUPPORTED
|
||||
|
||||
/* The EMS move specification structure requires word and long fields aligned
|
||||
* at odd byte boundaries. Some compilers will align struct fields at even
|
||||
* byte boundaries. While it's usually possible to force byte alignment,
|
||||
* that causes an overall performance penalty and may pose problems in merging
|
||||
* JPEG into a larger application. Instead we accept some rather dirty code
|
||||
* here. Note this code would fail if the hardware did not allow odd-byte
|
||||
* word & long accesses, but all 80x86 CPUs do.
|
||||
*/
|
||||
|
||||
typedef void far * EMSPTR;
|
||||
|
||||
typedef union { /* EMS move specification structure */
|
||||
long length; /* It's easy to access first 4 bytes */
|
||||
char bytes[18]; /* Misaligned fields in here! */
|
||||
} EMSspec;
|
||||
|
||||
/* Macros for accessing misaligned fields */
|
||||
#define FIELD_AT(spec,offset,type) (*((type *) &(spec.bytes[offset])))
|
||||
#define SRC_TYPE(spec) FIELD_AT(spec,4,char)
|
||||
#define SRC_HANDLE(spec) FIELD_AT(spec,5,EMSH)
|
||||
#define SRC_OFFSET(spec) FIELD_AT(spec,7,unsigned short)
|
||||
#define SRC_PAGE(spec) FIELD_AT(spec,9,unsigned short)
|
||||
#define SRC_PTR(spec) FIELD_AT(spec,7,EMSPTR)
|
||||
#define DST_TYPE(spec) FIELD_AT(spec,11,char)
|
||||
#define DST_HANDLE(spec) FIELD_AT(spec,12,EMSH)
|
||||
#define DST_OFFSET(spec) FIELD_AT(spec,14,unsigned short)
|
||||
#define DST_PAGE(spec) FIELD_AT(spec,16,unsigned short)
|
||||
#define DST_PTR(spec) FIELD_AT(spec,14,EMSPTR)
|
||||
|
||||
#define EMSPAGESIZE 16384L /* gospel, see the EMS specs */
|
||||
|
||||
#define HIBYTE(W) (((W) >> 8) & 0xFF)
|
||||
#define LOBYTE(W) ((W) & 0xFF)
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
read_ems_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
EMScontext ctx;
|
||||
EMSspec spec;
|
||||
|
||||
spec.length = byte_count;
|
||||
SRC_TYPE(spec) = 1;
|
||||
SRC_HANDLE(spec) = info->handle.ems_handle;
|
||||
SRC_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE);
|
||||
SRC_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE);
|
||||
DST_TYPE(spec) = 0;
|
||||
DST_HANDLE(spec) = 0;
|
||||
DST_PTR(spec) = buffer_address;
|
||||
|
||||
ctx.ds_si = (void far *) & spec;
|
||||
ctx.ax = 0x5700; /* move memory region */
|
||||
jems_calldriver((EMScontext far *) & ctx);
|
||||
if (HIBYTE(ctx.ax) != 0)
|
||||
ERREXIT(cinfo, JERR_EMS_READ);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
write_ems_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
EMScontext ctx;
|
||||
EMSspec spec;
|
||||
|
||||
spec.length = byte_count;
|
||||
SRC_TYPE(spec) = 0;
|
||||
SRC_HANDLE(spec) = 0;
|
||||
SRC_PTR(spec) = buffer_address;
|
||||
DST_TYPE(spec) = 1;
|
||||
DST_HANDLE(spec) = info->handle.ems_handle;
|
||||
DST_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE);
|
||||
DST_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE);
|
||||
|
||||
ctx.ds_si = (void far *) & spec;
|
||||
ctx.ax = 0x5700; /* move memory region */
|
||||
jems_calldriver((EMScontext far *) & ctx);
|
||||
if (HIBYTE(ctx.ax) != 0)
|
||||
ERREXIT(cinfo, JERR_EMS_WRITE);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
close_ems_store (j_common_ptr cinfo, backing_store_ptr info)
|
||||
{
|
||||
EMScontext ctx;
|
||||
|
||||
ctx.ax = 0x4500;
|
||||
ctx.dx = info->handle.ems_handle;
|
||||
jems_calldriver((EMScontext far *) & ctx);
|
||||
TRACEMS1(cinfo, 1, JTRC_EMS_CLOSE, info->handle.ems_handle);
|
||||
/* we ignore any error return from the driver */
|
||||
}
|
||||
|
||||
|
||||
LOCAL(boolean)
|
||||
open_ems_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
EMScontext ctx;
|
||||
|
||||
/* Is EMS driver there? */
|
||||
if (! jems_available())
|
||||
return FALSE;
|
||||
|
||||
/* Get status, make sure EMS is OK */
|
||||
ctx.ax = 0x4000;
|
||||
jems_calldriver((EMScontext far *) & ctx);
|
||||
if (HIBYTE(ctx.ax) != 0)
|
||||
return FALSE;
|
||||
|
||||
/* Get version, must be >= 4.0 */
|
||||
ctx.ax = 0x4600;
|
||||
jems_calldriver((EMScontext far *) & ctx);
|
||||
if (HIBYTE(ctx.ax) != 0 || LOBYTE(ctx.ax) < 0x40)
|
||||
return FALSE;
|
||||
|
||||
/* Try to allocate requested space */
|
||||
ctx.ax = 0x4300;
|
||||
ctx.bx = (unsigned short) ((total_bytes_needed + EMSPAGESIZE-1L) / EMSPAGESIZE);
|
||||
jems_calldriver((EMScontext far *) & ctx);
|
||||
if (HIBYTE(ctx.ax) != 0)
|
||||
return FALSE;
|
||||
|
||||
/* Succeeded, save the handle and away we go */
|
||||
info->handle.ems_handle = ctx.dx;
|
||||
info->read_backing_store = read_ems_store;
|
||||
info->write_backing_store = write_ems_store;
|
||||
info->close_backing_store = close_ems_store;
|
||||
TRACEMS1(cinfo, 1, JTRC_EMS_OPEN, ctx.dx);
|
||||
return TRUE; /* succeeded */
|
||||
}
|
||||
|
||||
#endif /* EMS_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Initial opening of a backing-store object.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
/* Try extended memory, then expanded memory, then regular file. */
|
||||
#if XMS_SUPPORTED
|
||||
if (open_xms_store(cinfo, info, total_bytes_needed))
|
||||
return;
|
||||
#endif
|
||||
#if EMS_SUPPORTED
|
||||
if (open_ems_store(cinfo, info, total_bytes_needed))
|
||||
return;
|
||||
#endif
|
||||
if (open_file_store(cinfo, info, total_bytes_needed))
|
||||
return;
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, "");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* These routines take care of any system-dependent initialization and
|
||||
* cleanup required.
|
||||
*/
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_init (j_common_ptr cinfo)
|
||||
{
|
||||
next_file_num = 0; /* initialize temp file name generator */
|
||||
return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_mem_term (j_common_ptr cinfo)
|
||||
{
|
||||
/* Microsoft C, at least in v6.00A, will not successfully reclaim freed
|
||||
* blocks of size > 32Kbytes unless we give it a kick in the rear, like so:
|
||||
*/
|
||||
#ifdef NEED_FHEAPMIN
|
||||
_fheapmin();
|
||||
#endif
|
||||
}
|
||||
379
jmemdosa.asm
379
jmemdosa.asm
@@ -1,379 +0,0 @@
|
||||
;
|
||||
; jmemdosa.asm
|
||||
;
|
||||
; Copyright (C) 1992, Thomas G. Lane.
|
||||
; This file is part of the Independent JPEG Group's software.
|
||||
; For conditions of distribution and use, see the accompanying README file.
|
||||
;
|
||||
; This file contains low-level interface routines to support the MS-DOS
|
||||
; backing store manager (jmemdos.c). Routines are provided to access disk
|
||||
; files through direct DOS calls, and to access XMS and EMS drivers.
|
||||
;
|
||||
; This file should assemble with Microsoft's MASM or any compatible
|
||||
; assembler (including Borland's Turbo Assembler). If you haven't got
|
||||
; a compatible assembler, better fall back to jmemansi.c or jmemname.c.
|
||||
;
|
||||
; To minimize dependence on the C compiler's register usage conventions,
|
||||
; we save and restore all 8086 registers, even though most compilers only
|
||||
; require SI,DI,DS to be preserved. Also, we use only 16-bit-wide return
|
||||
; values, which everybody returns in AX.
|
||||
;
|
||||
; Based on code contributed by Ge' Weijers.
|
||||
;
|
||||
|
||||
JMEMDOSA_TXT segment byte public 'CODE'
|
||||
|
||||
assume cs:JMEMDOSA_TXT
|
||||
|
||||
public _jdos_open
|
||||
public _jdos_close
|
||||
public _jdos_seek
|
||||
public _jdos_read
|
||||
public _jdos_write
|
||||
public _jxms_getdriver
|
||||
public _jxms_calldriver
|
||||
public _jems_available
|
||||
public _jems_calldriver
|
||||
|
||||
;
|
||||
; short far jdos_open (short far * handle, char far * filename)
|
||||
;
|
||||
; Create and open a temporary file
|
||||
;
|
||||
_jdos_open proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov cx,0 ; normal file attributes
|
||||
lds dx,dword ptr [bp+10] ; get filename pointer
|
||||
mov ah,3ch ; create file
|
||||
int 21h
|
||||
jc open_err ; if failed, return error code
|
||||
lds bx,dword ptr [bp+6] ; get handle pointer
|
||||
mov word ptr [bx],ax ; save the handle
|
||||
xor ax,ax ; return zero for OK
|
||||
open_err: pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jdos_open endp
|
||||
|
||||
|
||||
;
|
||||
; short far jdos_close (short handle)
|
||||
;
|
||||
; Close the file handle
|
||||
;
|
||||
_jdos_close proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov bx,word ptr [bp+6] ; file handle
|
||||
mov ah,3eh ; close file
|
||||
int 21h
|
||||
jc close_err ; if failed, return error code
|
||||
xor ax,ax ; return zero for OK
|
||||
close_err: pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jdos_close endp
|
||||
|
||||
|
||||
;
|
||||
; short far jdos_seek (short handle, long offset)
|
||||
;
|
||||
; Set file position
|
||||
;
|
||||
_jdos_seek proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov bx,word ptr [bp+6] ; file handle
|
||||
mov dx,word ptr [bp+8] ; LS offset
|
||||
mov cx,word ptr [bp+10] ; MS offset
|
||||
mov ax,4200h ; absolute seek
|
||||
int 21h
|
||||
jc seek_err ; if failed, return error code
|
||||
xor ax,ax ; return zero for OK
|
||||
seek_err: pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jdos_seek endp
|
||||
|
||||
|
||||
;
|
||||
; short far jdos_read (short handle, void far * buffer, unsigned short count)
|
||||
;
|
||||
; Read from file
|
||||
;
|
||||
_jdos_read proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov bx,word ptr [bp+6] ; file handle
|
||||
lds dx,dword ptr [bp+8] ; buffer address
|
||||
mov cx,word ptr [bp+12] ; number of bytes
|
||||
mov ah,3fh ; read file
|
||||
int 21h
|
||||
jc read_err ; if failed, return error code
|
||||
cmp ax,word ptr [bp+12] ; make sure all bytes were read
|
||||
je read_ok
|
||||
mov ax,1 ; else return 1 for not OK
|
||||
jmp short read_err
|
||||
read_ok: xor ax,ax ; return zero for OK
|
||||
read_err: pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jdos_read endp
|
||||
|
||||
|
||||
;
|
||||
; short far jdos_write (short handle, void far * buffer, unsigned short count)
|
||||
;
|
||||
; Write to file
|
||||
;
|
||||
_jdos_write proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov bx,word ptr [bp+6] ; file handle
|
||||
lds dx,dword ptr [bp+8] ; buffer address
|
||||
mov cx,word ptr [bp+12] ; number of bytes
|
||||
mov ah,40h ; write file
|
||||
int 21h
|
||||
jc write_err ; if failed, return error code
|
||||
cmp ax,word ptr [bp+12] ; make sure all bytes written
|
||||
je write_ok
|
||||
mov ax,1 ; else return 1 for not OK
|
||||
jmp short write_err
|
||||
write_ok: xor ax,ax ; return zero for OK
|
||||
write_err: pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jdos_write endp
|
||||
|
||||
|
||||
;
|
||||
; void far jxms_getdriver (XMSDRIVER far *)
|
||||
;
|
||||
; Get the address of the XMS driver, or NULL if not available
|
||||
;
|
||||
_jxms_getdriver proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov ax,4300h ; call multiplex interrupt with
|
||||
int 2fh ; a magic cookie, hex 4300
|
||||
cmp al,80h ; AL should contain hex 80
|
||||
je xmsavail
|
||||
xor dx,dx ; no XMS driver available
|
||||
xor ax,ax ; return a nil pointer
|
||||
jmp short xmsavail_done
|
||||
xmsavail: mov ax,4310h ; fetch driver address with
|
||||
int 2fh ; another magic cookie
|
||||
mov dx,es ; copy address to dx:ax
|
||||
mov ax,bx
|
||||
xmsavail_done: les bx,dword ptr [bp+6] ; get pointer to return value
|
||||
mov word ptr es:[bx],ax
|
||||
mov word ptr es:[bx+2],dx
|
||||
pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jxms_getdriver endp
|
||||
|
||||
|
||||
;
|
||||
; void far jxms_calldriver (XMSDRIVER, XMScontext far *)
|
||||
;
|
||||
; The XMScontext structure contains values for the AX,DX,BX,SI,DS registers.
|
||||
; These are loaded, the XMS call is performed, and the new values of the
|
||||
; AX,DX,BX registers are written back to the context structure.
|
||||
;
|
||||
_jxms_calldriver proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
les bx,dword ptr [bp+10] ; get XMScontext pointer
|
||||
mov ax,word ptr es:[bx] ; load registers
|
||||
mov dx,word ptr es:[bx+2]
|
||||
mov si,word ptr es:[bx+6]
|
||||
mov ds,word ptr es:[bx+8]
|
||||
mov bx,word ptr es:[bx+4]
|
||||
call dword ptr [bp+6] ; call the driver
|
||||
mov cx,bx ; save returned BX for a sec
|
||||
les bx,dword ptr [bp+10] ; get XMScontext pointer
|
||||
mov word ptr es:[bx],ax ; put back ax,dx,bx
|
||||
mov word ptr es:[bx+2],dx
|
||||
mov word ptr es:[bx+4],cx
|
||||
pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jxms_calldriver endp
|
||||
|
||||
|
||||
;
|
||||
; short far jems_available (void)
|
||||
;
|
||||
; Have we got an EMS driver? (this comes straight from the EMS 4.0 specs)
|
||||
;
|
||||
_jems_available proc far
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
mov ax,3567h ; get interrupt vector 67h
|
||||
int 21h
|
||||
push cs
|
||||
pop ds
|
||||
mov di,000ah ; check offs 10 in returned seg
|
||||
lea si,ASCII_device_name ; against literal string
|
||||
mov cx,8
|
||||
cld
|
||||
repe cmpsb
|
||||
jne no_ems
|
||||
mov ax,1 ; match, it's there
|
||||
jmp short avail_done
|
||||
no_ems: xor ax,ax ; it's not there
|
||||
avail_done: pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
ret
|
||||
|
||||
ASCII_device_name db "EMMXXXX0"
|
||||
|
||||
_jems_available endp
|
||||
|
||||
|
||||
;
|
||||
; void far jems_calldriver (EMScontext far *)
|
||||
;
|
||||
; The EMScontext structure contains values for the AX,DX,BX,SI,DS registers.
|
||||
; These are loaded, the EMS trap is performed, and the new values of the
|
||||
; AX,DX,BX registers are written back to the context structure.
|
||||
;
|
||||
_jems_calldriver proc far
|
||||
push bp ; linkage
|
||||
mov bp,sp
|
||||
push si ; save all registers for safety
|
||||
push di
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
push es
|
||||
push ds
|
||||
les bx,dword ptr [bp+6] ; get EMScontext pointer
|
||||
mov ax,word ptr es:[bx] ; load registers
|
||||
mov dx,word ptr es:[bx+2]
|
||||
mov si,word ptr es:[bx+6]
|
||||
mov ds,word ptr es:[bx+8]
|
||||
mov bx,word ptr es:[bx+4]
|
||||
int 67h ; call the EMS driver
|
||||
mov cx,bx ; save returned BX for a sec
|
||||
les bx,dword ptr [bp+6] ; get EMScontext pointer
|
||||
mov word ptr es:[bx],ax ; put back ax,dx,bx
|
||||
mov word ptr es:[bx+2],dx
|
||||
mov word ptr es:[bx+4],cx
|
||||
pop ds ; restore registers and exit
|
||||
pop es
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
pop di
|
||||
pop si
|
||||
pop bp
|
||||
ret
|
||||
_jems_calldriver endp
|
||||
|
||||
JMEMDOSA_TXT ends
|
||||
|
||||
end
|
||||
289
jmemmac.c
289
jmemmac.c
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
* jmemmac.c
|
||||
*
|
||||
* Copyright (C) 1992-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* jmemmac.c provides an Apple Macintosh implementation of the system-
|
||||
* dependent portion of the JPEG memory manager.
|
||||
*
|
||||
* If you use jmemmac.c, then you must define USE_MAC_MEMMGR in the
|
||||
* JPEG_INTERNALS part of jconfig.h.
|
||||
*
|
||||
* jmemmac.c uses the Macintosh toolbox routines NewPtr and DisposePtr
|
||||
* instead of malloc and free. It accurately determines the amount of
|
||||
* memory available by using CompactMem. Notice that if left to its
|
||||
* own devices, this code can chew up all available space in the
|
||||
* application's zone, with the exception of the rather small "slop"
|
||||
* factor computed in jpeg_mem_available(). The application can ensure
|
||||
* that more space is left over by reducing max_memory_to_use.
|
||||
*
|
||||
* Large images are swapped to disk using temporary files and System 7.0+'s
|
||||
* temporary folder functionality.
|
||||
*
|
||||
* Note that jmemmac.c depends on two features of MacOS that were first
|
||||
* introduced in System 7: FindFolder and the FSSpec-based calls.
|
||||
* If your application uses jmemmac.c and is run under System 6 or earlier,
|
||||
* and the jpeg library decides it needs a temporary file, it will abort,
|
||||
* printing error messages about requiring System 7. (If no temporary files
|
||||
* are created, it will run fine.)
|
||||
*
|
||||
* If you want to use jmemmac.c in an application that might be used with
|
||||
* System 6 or earlier, then you should remove dependencies on FindFolder
|
||||
* and the FSSpec calls. You will need to replace FindFolder with some
|
||||
* other mechanism for finding a place to put temporary files, and you
|
||||
* should replace the FSSpec calls with their HFS equivalents:
|
||||
*
|
||||
* FSpDelete -> HDelete
|
||||
* FSpGetFInfo -> HGetFInfo
|
||||
* FSpCreate -> HCreate
|
||||
* FSpOpenDF -> HOpen *** Note: not HOpenDF ***
|
||||
* FSMakeFSSpec -> (fill in spec by hand.)
|
||||
*
|
||||
* (Use HOpen instead of HOpenDF. HOpen is just a glue-interface to PBHOpen,
|
||||
* which is on all HFS macs. HOpenDF is a System 7 addition which avoids the
|
||||
* ages-old problem of names starting with a period.)
|
||||
*
|
||||
* Contributed by Sam Bushell (jsam@iagu.on.net) and
|
||||
* Dan Gildor (gyld@in-touch.com).
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||
|
||||
#ifndef USE_MAC_MEMMGR /* make sure user got configuration right */
|
||||
You forgot to define USE_MAC_MEMMGR in jconfig.h. /* deliberate syntax error */
|
||||
#endif
|
||||
|
||||
#include <Memory.h> /* we use the MacOS memory manager */
|
||||
#include <Files.h> /* we use the MacOS File stuff */
|
||||
#include <Folders.h> /* we use the MacOS HFS stuff */
|
||||
#include <Script.h> /* for smSystemScript */
|
||||
#include <Gestalt.h> /* we use Gestalt to test for specific functionality */
|
||||
|
||||
#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */
|
||||
#define TEMP_FILE_NAME "JPG%03d.TMP"
|
||||
#endif
|
||||
|
||||
static int next_file_num; /* to distinguish among several temp files */
|
||||
|
||||
|
||||
/*
|
||||
* Memory allocation and freeing are controlled by the MacOS library
|
||||
* routines NewPtr() and DisposePtr(), which allocate fixed-address
|
||||
* storage. Unfortunately, the IJG library isn't smart enough to cope
|
||||
* with relocatable storage.
|
||||
*/
|
||||
|
||||
GLOBAL(void *)
|
||||
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void *) NewPtr(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
|
||||
{
|
||||
DisposePtr((Ptr) object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "Large" objects are treated the same as "small" ones.
|
||||
* NB: we include FAR keywords in the routine declarations simply for
|
||||
* consistency with the rest of the IJG code; FAR should expand to empty
|
||||
* on rational architectures like the Mac.
|
||||
*/
|
||||
|
||||
GLOBAL(void FAR *)
|
||||
jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void FAR *) NewPtr(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
||||
{
|
||||
DisposePtr((Ptr) object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine computes the total memory space available for allocation.
|
||||
*/
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||
long max_bytes_needed, long already_allocated)
|
||||
{
|
||||
long limit = cinfo->mem->max_memory_to_use - already_allocated;
|
||||
long slop, mem;
|
||||
|
||||
/* Don't ask for more than what application has told us we may use */
|
||||
if (max_bytes_needed > limit && limit > 0)
|
||||
max_bytes_needed = limit;
|
||||
/* Find whether there's a big enough free block in the heap.
|
||||
* CompactMem tries to create a contiguous block of the requested size,
|
||||
* and then returns the size of the largest free block (which could be
|
||||
* much more or much less than we asked for).
|
||||
* We add some slop to ensure we don't use up all available memory.
|
||||
*/
|
||||
slop = max_bytes_needed / 16 + 32768L;
|
||||
mem = CompactMem(max_bytes_needed + slop) - slop;
|
||||
if (mem < 0)
|
||||
mem = 0; /* sigh, couldn't even get the slop */
|
||||
/* Don't take more than the application says we can have */
|
||||
if (mem > limit && limit > 0)
|
||||
mem = limit;
|
||||
return mem;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Backing store (temporary file) management.
|
||||
* Backing store objects are only used when the value returned by
|
||||
* jpeg_mem_available is less than the total space needed. You can dispense
|
||||
* with these routines if you have plenty of virtual memory; see jmemnobs.c.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
long bytes = byte_count;
|
||||
long retVal;
|
||||
|
||||
if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
|
||||
retVal = FSRead ( info->temp_file, &bytes,
|
||||
(unsigned char *) buffer_address );
|
||||
if ( retVal != noErr || bytes != byte_count )
|
||||
ERREXIT(cinfo, JERR_TFILE_READ);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
long bytes = byte_count;
|
||||
long retVal;
|
||||
|
||||
if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
|
||||
retVal = FSWrite ( info->temp_file, &bytes,
|
||||
(unsigned char *) buffer_address );
|
||||
if ( retVal != noErr || bytes != byte_count )
|
||||
ERREXIT(cinfo, JERR_TFILE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
|
||||
{
|
||||
FSClose ( info->temp_file );
|
||||
FSpDelete ( &(info->tempSpec) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initial opening of a backing-store object.
|
||||
*
|
||||
* This version uses FindFolder to find the Temporary Items folder,
|
||||
* and puts the temporary file in there.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
short tmpRef, vRefNum;
|
||||
long dirID;
|
||||
FInfo finderInfo;
|
||||
FSSpec theSpec;
|
||||
Str255 fName;
|
||||
OSErr osErr;
|
||||
long gestaltResponse = 0;
|
||||
|
||||
/* Check that FSSpec calls are available. */
|
||||
osErr = Gestalt( gestaltFSAttr, &gestaltResponse );
|
||||
if ( ( osErr != noErr )
|
||||
|| !( gestaltResponse & (1<<gestaltHasFSSpecCalls) ) )
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, "- System 7.0 or later required");
|
||||
/* TO DO: add a proper error message to jerror.h. */
|
||||
|
||||
/* Check that FindFolder is available. */
|
||||
osErr = Gestalt( gestaltFindFolderAttr, &gestaltResponse );
|
||||
if ( ( osErr != noErr )
|
||||
|| !( gestaltResponse & (1<<gestaltFindFolderPresent) ) )
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, "- System 7.0 or later required.");
|
||||
/* TO DO: add a proper error message to jerror.h. */
|
||||
|
||||
osErr = FindFolder ( kOnSystemDisk, kTemporaryFolderType, kCreateFolder,
|
||||
&vRefNum, &dirID );
|
||||
if ( osErr != noErr )
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, "- temporary items folder unavailable");
|
||||
/* TO DO: Try putting the temp files somewhere else. */
|
||||
|
||||
/* Keep generating file names till we find one that's not in use */
|
||||
for (;;) {
|
||||
next_file_num++; /* advance counter */
|
||||
|
||||
sprintf(info->temp_name, TEMP_FILE_NAME, next_file_num);
|
||||
strcpy ( (Ptr)fName+1, info->temp_name );
|
||||
*fName = strlen (info->temp_name);
|
||||
osErr = FSMakeFSSpec ( vRefNum, dirID, fName, &theSpec );
|
||||
|
||||
if ( (osErr = FSpGetFInfo ( &theSpec, &finderInfo ) ) != noErr )
|
||||
break;
|
||||
}
|
||||
|
||||
osErr = FSpCreate ( &theSpec, '????', '????', smSystemScript );
|
||||
if ( osErr != noErr )
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
|
||||
|
||||
osErr = FSpOpenDF ( &theSpec, fsRdWrPerm, &(info->temp_file) );
|
||||
if ( osErr != noErr )
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
|
||||
|
||||
info->tempSpec = theSpec;
|
||||
|
||||
info->read_backing_store = read_backing_store;
|
||||
info->write_backing_store = write_backing_store;
|
||||
info->close_backing_store = close_backing_store;
|
||||
TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* These routines take care of any system-dependent initialization and
|
||||
* cleanup required.
|
||||
*/
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_init (j_common_ptr cinfo)
|
||||
{
|
||||
next_file_num = 0;
|
||||
|
||||
/* max_memory_to_use will be initialized to FreeMem()'s result;
|
||||
* the calling application might later reduce it, for example
|
||||
* to leave room to invoke multiple JPEG objects.
|
||||
* Note that FreeMem returns the total number of free bytes;
|
||||
* it may not be possible to allocate a single block of this size.
|
||||
*/
|
||||
return FreeMem();
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_mem_term (j_common_ptr cinfo)
|
||||
{
|
||||
/* no work */
|
||||
}
|
||||
162
jmemmgr.c
162
jmemmgr.c
@@ -57,22 +57,25 @@ extern char * getenv JPP((const char * name));
|
||||
* requirement, and we had better do so too.
|
||||
* There isn't any really portable way to determine the worst-case alignment
|
||||
* requirement. This module assumes that the alignment requirement is
|
||||
* multiples of sizeof(ALIGN_TYPE).
|
||||
* By default, we define ALIGN_TYPE as double. This is necessary on some
|
||||
* multiples of ALIGN_SIZE.
|
||||
* By default, we define ALIGN_SIZE as sizeof(double). This is necessary on some
|
||||
* workstations (where doubles really do need 8-byte alignment) and will work
|
||||
* fine on nearly everything. If your machine has lesser alignment needs,
|
||||
* you can save a few bytes by making ALIGN_TYPE smaller.
|
||||
* you can save a few bytes by making ALIGN_SIZE smaller.
|
||||
* The only place I know of where this will NOT work is certain Macintosh
|
||||
* 680x0 compilers that define double as a 10-byte IEEE extended float.
|
||||
* Doing 10-byte alignment is counterproductive because longwords won't be
|
||||
* aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have
|
||||
* aligned well. Put "#define ALIGN_SIZE 4" in jconfig.h if you have
|
||||
* such a compiler.
|
||||
*/
|
||||
|
||||
#ifndef ALIGN_TYPE /* so can override from jconfig.h */
|
||||
#define ALIGN_TYPE double
|
||||
#ifndef ALIGN_SIZE /* so can override from jconfig.h */
|
||||
#ifndef WITH_SIMD
|
||||
#define ALIGN_SIZE SIZEOF(double)
|
||||
#else
|
||||
#define ALIGN_SIZE 16 /* Most SIMD implementations require this */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* We allocate objects from "pools", where each pool is gotten with a single
|
||||
@@ -81,34 +84,24 @@ extern char * getenv JPP((const char * name));
|
||||
* header with a link to the next pool of the same class.
|
||||
* Small and large pool headers are identical except that the latter's
|
||||
* link pointer must be FAR on 80x86 machines.
|
||||
* Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE
|
||||
* field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple
|
||||
* of the alignment requirement of ALIGN_TYPE.
|
||||
*/
|
||||
|
||||
typedef union small_pool_struct * small_pool_ptr;
|
||||
typedef struct small_pool_struct * small_pool_ptr;
|
||||
|
||||
typedef union small_pool_struct {
|
||||
struct {
|
||||
typedef struct small_pool_struct {
|
||||
small_pool_ptr next; /* next in list of pools */
|
||||
size_t bytes_used; /* how many bytes already used within pool */
|
||||
size_t bytes_left; /* bytes still available in this pool */
|
||||
} hdr;
|
||||
ALIGN_TYPE dummy; /* included in union to ensure alignment */
|
||||
} small_pool_hdr;
|
||||
|
||||
typedef union large_pool_struct FAR * large_pool_ptr;
|
||||
typedef struct large_pool_struct FAR * large_pool_ptr;
|
||||
|
||||
typedef union large_pool_struct {
|
||||
struct {
|
||||
typedef struct large_pool_struct {
|
||||
large_pool_ptr next; /* next in list of pools */
|
||||
size_t bytes_used; /* how many bytes already used within pool */
|
||||
size_t bytes_left; /* bytes still available in this pool */
|
||||
} hdr;
|
||||
ALIGN_TYPE dummy; /* included in union to ensure alignment */
|
||||
} large_pool_hdr;
|
||||
|
||||
|
||||
/*
|
||||
* Here is the full definition of a memory manager object.
|
||||
*/
|
||||
@@ -129,7 +122,7 @@ typedef struct {
|
||||
jvirt_barray_ptr virt_barray_list;
|
||||
|
||||
/* 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
|
||||
* array routines.
|
||||
@@ -197,16 +190,16 @@ print_mem_stats (j_common_ptr cinfo, int pool_id)
|
||||
pool_id, mem->total_space_allocated);
|
||||
|
||||
for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
|
||||
lhdr_ptr = lhdr_ptr->hdr.next) {
|
||||
lhdr_ptr = lhdr_ptr->next) {
|
||||
fprintf(stderr, " Large chunk used %ld\n",
|
||||
(long) lhdr_ptr->hdr.bytes_used);
|
||||
(long) lhdr_ptr->bytes_used);
|
||||
}
|
||||
|
||||
for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
|
||||
shdr_ptr = shdr_ptr->hdr.next) {
|
||||
shdr_ptr = shdr_ptr->next) {
|
||||
fprintf(stderr, " Small chunk used %ld free %ld\n",
|
||||
(long) shdr_ptr->hdr.bytes_used,
|
||||
(long) shdr_ptr->hdr.bytes_left);
|
||||
(long) shdr_ptr->bytes_used,
|
||||
(long) shdr_ptr->bytes_left);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,6 +229,10 @@ out_of_memory (j_common_ptr cinfo, int which)
|
||||
* and we also distinguish the first pool of a class from later ones.
|
||||
* NOTE: the values given work fairly well on both 16- and 32-bit-int
|
||||
* machines, but may be too small if longs are 64 bits or more.
|
||||
*
|
||||
* Since we do not know what alignment malloc() gives us, we have to
|
||||
* allocate ALIGN_SIZE-1 extra space per pool to have room for alignment
|
||||
* adjustment.
|
||||
*/
|
||||
|
||||
static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
|
||||
@@ -260,33 +257,36 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
||||
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
||||
small_pool_ptr hdr_ptr, prev_hdr_ptr;
|
||||
char * data_ptr;
|
||||
size_t odd_bytes, min_request, slop;
|
||||
size_t min_request, slop;
|
||||
|
||||
/*
|
||||
* Round up the requested size to a multiple of ALIGN_SIZE in order
|
||||
* to assure alignment for the next object allocated in the same pool
|
||||
* and so that algorithms can straddle outside the proper area up
|
||||
* to the next alignment.
|
||||
*/
|
||||
sizeofobject = jround_up(sizeofobject, ALIGN_SIZE);
|
||||
|
||||
/* Check for unsatisfiable request (do now to ensure no overflow below) */
|
||||
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
|
||||
if ((SIZEOF(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) > MAX_ALLOC_CHUNK)
|
||||
out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
|
||||
|
||||
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
|
||||
odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
|
||||
if (odd_bytes > 0)
|
||||
sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
|
||||
|
||||
/* See if space is available in any existing pool */
|
||||
if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
|
||||
ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
|
||||
prev_hdr_ptr = NULL;
|
||||
hdr_ptr = mem->small_list[pool_id];
|
||||
while (hdr_ptr != NULL) {
|
||||
if (hdr_ptr->hdr.bytes_left >= sizeofobject)
|
||||
if (hdr_ptr->bytes_left >= sizeofobject)
|
||||
break; /* found pool with enough space */
|
||||
prev_hdr_ptr = hdr_ptr;
|
||||
hdr_ptr = hdr_ptr->hdr.next;
|
||||
hdr_ptr = hdr_ptr->next;
|
||||
}
|
||||
|
||||
/* Time to make a new pool? */
|
||||
if (hdr_ptr == NULL) {
|
||||
/* min_request is what we need now, slop is what will be leftover */
|
||||
min_request = sizeofobject + SIZEOF(small_pool_hdr);
|
||||
min_request = SIZEOF(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1;
|
||||
if (prev_hdr_ptr == NULL) /* first pool in class? */
|
||||
slop = first_pool_slop[pool_id];
|
||||
else
|
||||
@@ -305,20 +305,23 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
||||
}
|
||||
mem->total_space_allocated += min_request + slop;
|
||||
/* Success, initialize the new pool header and add to end of list */
|
||||
hdr_ptr->hdr.next = NULL;
|
||||
hdr_ptr->hdr.bytes_used = 0;
|
||||
hdr_ptr->hdr.bytes_left = sizeofobject + slop;
|
||||
hdr_ptr->next = NULL;
|
||||
hdr_ptr->bytes_used = 0;
|
||||
hdr_ptr->bytes_left = sizeofobject + slop;
|
||||
if (prev_hdr_ptr == NULL) /* first pool in class? */
|
||||
mem->small_list[pool_id] = hdr_ptr;
|
||||
else
|
||||
prev_hdr_ptr->hdr.next = hdr_ptr;
|
||||
prev_hdr_ptr->next = hdr_ptr;
|
||||
}
|
||||
|
||||
/* OK, allocate the object from the current pool */
|
||||
data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */
|
||||
data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */
|
||||
hdr_ptr->hdr.bytes_used += sizeofobject;
|
||||
hdr_ptr->hdr.bytes_left -= sizeofobject;
|
||||
data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */
|
||||
data_ptr += SIZEOF(small_pool_hdr); /* ...by skipping the header... */
|
||||
if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */
|
||||
data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;
|
||||
data_ptr += hdr_ptr->bytes_used; /* point to place for object */
|
||||
hdr_ptr->bytes_used += sizeofobject;
|
||||
hdr_ptr->bytes_left -= sizeofobject;
|
||||
|
||||
return (void *) data_ptr;
|
||||
}
|
||||
@@ -344,37 +347,45 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
||||
{
|
||||
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
||||
large_pool_ptr hdr_ptr;
|
||||
size_t odd_bytes;
|
||||
char FAR * data_ptr;
|
||||
|
||||
/*
|
||||
* Round up the requested size to a multiple of ALIGN_SIZE so that
|
||||
* algorithms can straddle outside the proper area up to the next
|
||||
* alignment.
|
||||
*/
|
||||
sizeofobject = jround_up(sizeofobject, ALIGN_SIZE);
|
||||
|
||||
/* Check for unsatisfiable request (do now to ensure no overflow below) */
|
||||
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
|
||||
if ((SIZEOF(large_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) > MAX_ALLOC_CHUNK)
|
||||
out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
|
||||
|
||||
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
|
||||
odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
|
||||
if (odd_bytes > 0)
|
||||
sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
|
||||
|
||||
/* Always make a new pool */
|
||||
if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
|
||||
ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
|
||||
|
||||
hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
|
||||
SIZEOF(large_pool_hdr));
|
||||
SIZEOF(large_pool_hdr) +
|
||||
ALIGN_SIZE - 1);
|
||||
if (hdr_ptr == NULL)
|
||||
out_of_memory(cinfo, 4); /* jpeg_get_large failed */
|
||||
mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
|
||||
mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr) + ALIGN_SIZE - 1;
|
||||
|
||||
/* Success, initialize the new pool header and add to list */
|
||||
hdr_ptr->hdr.next = mem->large_list[pool_id];
|
||||
hdr_ptr->next = mem->large_list[pool_id];
|
||||
/* We maintain space counts in each pool header for statistical purposes,
|
||||
* even though they are not needed for allocation.
|
||||
*/
|
||||
hdr_ptr->hdr.bytes_used = sizeofobject;
|
||||
hdr_ptr->hdr.bytes_left = 0;
|
||||
hdr_ptr->bytes_used = sizeofobject;
|
||||
hdr_ptr->bytes_left = 0;
|
||||
mem->large_list[pool_id] = hdr_ptr;
|
||||
|
||||
return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
|
||||
data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */
|
||||
data_ptr += SIZEOF(small_pool_hdr); /* ...by skipping the header... */
|
||||
if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */
|
||||
data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;
|
||||
|
||||
return (void FAR *) data_ptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -389,6 +400,10 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
||||
* this chunking of rows. The rowsperchunk value is left in the mem manager
|
||||
* object so that it can be saved away if this sarray is the workspace for
|
||||
* a virtual array.
|
||||
*
|
||||
* Since we are often upsampling with a factor 2, we align the size (not
|
||||
* the start) to 2 * ALIGN_SIZE so that the upsampling routines don't have
|
||||
* to be as careful about size.
|
||||
*/
|
||||
|
||||
METHODDEF(JSAMPARRAY)
|
||||
@@ -402,6 +417,11 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
|
||||
JDIMENSION rowsperchunk, currow, i;
|
||||
long ltemp;
|
||||
|
||||
/* Make sure each row is properly aligned */
|
||||
if ((ALIGN_SIZE % SIZEOF(JSAMPLE)) != 0)
|
||||
out_of_memory(cinfo, 5); /* safety check */
|
||||
samplesperrow = (JDIMENSION)jround_up(samplesperrow, (2 * ALIGN_SIZE) / SIZEOF(JSAMPLE));
|
||||
|
||||
/* Calculate max # of rows allowed in one allocation chunk */
|
||||
ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
|
||||
((long) samplesperrow * SIZEOF(JSAMPLE));
|
||||
@@ -450,6 +470,10 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
|
||||
JDIMENSION rowsperchunk, currow, i;
|
||||
long ltemp;
|
||||
|
||||
/* Make sure each row is properly aligned */
|
||||
if ((SIZEOF(JBLOCK) % ALIGN_SIZE) != 0)
|
||||
out_of_memory(cinfo, 6); /* safety check */
|
||||
|
||||
/* Calculate max # of rows allowed in one allocation chunk */
|
||||
ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
|
||||
((long) blocksperrow * SIZEOF(JBLOCK));
|
||||
@@ -584,8 +608,8 @@ realize_virt_arrays (j_common_ptr cinfo)
|
||||
/* Allocate the in-memory buffers for any unrealized virtual arrays */
|
||||
{
|
||||
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
||||
long space_per_minheight, maximum_space, avail_mem;
|
||||
long minheights, max_minheights;
|
||||
size_t space_per_minheight, maximum_space, avail_mem;
|
||||
size_t minheights, max_minheights;
|
||||
jvirt_sarray_ptr sptr;
|
||||
jvirt_barray_ptr bptr;
|
||||
|
||||
@@ -968,9 +992,9 @@ free_pool (j_common_ptr cinfo, int pool_id)
|
||||
mem->large_list[pool_id] = NULL;
|
||||
|
||||
while (lhdr_ptr != NULL) {
|
||||
large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;
|
||||
space_freed = lhdr_ptr->hdr.bytes_used +
|
||||
lhdr_ptr->hdr.bytes_left +
|
||||
large_pool_ptr next_lhdr_ptr = lhdr_ptr->next;
|
||||
space_freed = lhdr_ptr->bytes_used +
|
||||
lhdr_ptr->bytes_left +
|
||||
SIZEOF(large_pool_hdr);
|
||||
jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
|
||||
mem->total_space_allocated -= space_freed;
|
||||
@@ -982,9 +1006,9 @@ free_pool (j_common_ptr cinfo, int pool_id)
|
||||
mem->small_list[pool_id] = NULL;
|
||||
|
||||
while (shdr_ptr != NULL) {
|
||||
small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;
|
||||
space_freed = shdr_ptr->hdr.bytes_used +
|
||||
shdr_ptr->hdr.bytes_left +
|
||||
small_pool_ptr next_shdr_ptr = shdr_ptr->next;
|
||||
space_freed = shdr_ptr->bytes_used +
|
||||
shdr_ptr->bytes_left +
|
||||
SIZEOF(small_pool_hdr);
|
||||
jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
|
||||
mem->total_space_allocated -= space_freed;
|
||||
@@ -1041,16 +1065,16 @@ jinit_memory_mgr (j_common_ptr cinfo)
|
||||
* in common if and only if X is a power of 2, ie has only one one-bit.
|
||||
* Some compilers may give an "unreachable code" warning here; ignore it.
|
||||
*/
|
||||
if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)
|
||||
if ((ALIGN_SIZE & (ALIGN_SIZE-1)) != 0)
|
||||
ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
|
||||
/* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
|
||||
* a multiple of SIZEOF(ALIGN_TYPE).
|
||||
* a multiple of ALIGN_SIZE.
|
||||
* Again, an "unreachable code" warning may be ignored here.
|
||||
* But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
|
||||
*/
|
||||
test_mac = (size_t) MAX_ALLOC_CHUNK;
|
||||
if ((long) test_mac != MAX_ALLOC_CHUNK ||
|
||||
(MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)
|
||||
(MAX_ALLOC_CHUNK % ALIGN_SIZE) != 0)
|
||||
ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
|
||||
|
||||
max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
|
||||
|
||||
276
jmemname.c
276
jmemname.c
@@ -1,276 +0,0 @@
|
||||
/*
|
||||
* jmemname.c
|
||||
*
|
||||
* Copyright (C) 1992-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file provides a generic implementation of the system-dependent
|
||||
* portion of the JPEG memory manager. This implementation assumes that
|
||||
* you must explicitly construct a name for each temp file.
|
||||
* Also, the problem of determining the amount of memory available
|
||||
* is shoved onto the user.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||
|
||||
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
|
||||
extern void * malloc JPP((size_t size));
|
||||
extern void free JPP((void *ptr));
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET /* pre-ANSI systems may not define this; */
|
||||
#define SEEK_SET 0 /* if not, assume 0 is correct */
|
||||
#endif
|
||||
|
||||
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
||||
#define READ_BINARY "r"
|
||||
#define RW_BINARY "w+"
|
||||
#else
|
||||
#ifdef VMS /* VMS is very nonstandard */
|
||||
#define READ_BINARY "rb", "ctx=stm"
|
||||
#define RW_BINARY "w+b", "ctx=stm"
|
||||
#else /* standard ANSI-compliant case */
|
||||
#define READ_BINARY "rb"
|
||||
#define RW_BINARY "w+b"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Selection of a file name for a temporary file.
|
||||
* This is system-dependent!
|
||||
*
|
||||
* The code as given is suitable for most Unix systems, and it is easily
|
||||
* modified for most non-Unix systems. Some notes:
|
||||
* 1. The temp file is created in the directory named by TEMP_DIRECTORY.
|
||||
* The default value is /usr/tmp, which is the conventional place for
|
||||
* creating large temp files on Unix. On other systems you'll probably
|
||||
* want to change the file location. You can do this by editing the
|
||||
* #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h.
|
||||
*
|
||||
* 2. If you need to change the file name as well as its location,
|
||||
* you can override the TEMP_FILE_NAME macro. (Note that this is
|
||||
* actually a printf format string; it must contain %s and %d.)
|
||||
* Few people should need to do this.
|
||||
*
|
||||
* 3. mktemp() is used to ensure that multiple processes running
|
||||
* simultaneously won't select the same file names. If your system
|
||||
* doesn't have mktemp(), define NO_MKTEMP to do it the hard way.
|
||||
* (If you don't have <errno.h>, also define NO_ERRNO_H.)
|
||||
*
|
||||
* 4. You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c
|
||||
* will cause the temp files to be removed if you stop the program early.
|
||||
*/
|
||||
|
||||
#ifndef TEMP_DIRECTORY /* can override from jconfig.h or Makefile */
|
||||
#define TEMP_DIRECTORY "/usr/tmp/" /* recommended setting for Unix */
|
||||
#endif
|
||||
|
||||
static int next_file_num; /* to distinguish among several temp files */
|
||||
|
||||
#ifdef NO_MKTEMP
|
||||
|
||||
#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */
|
||||
#define TEMP_FILE_NAME "%sJPG%03d.TMP"
|
||||
#endif
|
||||
|
||||
#ifndef NO_ERRNO_H
|
||||
#include <errno.h> /* to define ENOENT */
|
||||
#endif
|
||||
|
||||
/* ANSI C specifies that errno is a macro, but on older systems it's more
|
||||
* likely to be a plain int variable. And not all versions of errno.h
|
||||
* bother to declare it, so we have to in order to be most portable. Thus:
|
||||
*/
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
select_file_name (char * fname)
|
||||
{
|
||||
FILE * tfile;
|
||||
|
||||
/* Keep generating file names till we find one that's not in use */
|
||||
for (;;) {
|
||||
next_file_num++; /* advance counter */
|
||||
sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
|
||||
if ((tfile = fopen(fname, READ_BINARY)) == NULL) {
|
||||
/* fopen could have failed for a reason other than the file not
|
||||
* being there; for example, file there but unreadable.
|
||||
* If <errno.h> isn't available, then we cannot test the cause.
|
||||
*/
|
||||
#ifdef ENOENT
|
||||
if (errno != ENOENT)
|
||||
continue;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
fclose(tfile); /* oops, it's there; close tfile & try again */
|
||||
}
|
||||
}
|
||||
|
||||
#else /* ! NO_MKTEMP */
|
||||
|
||||
/* Note that mktemp() requires the initial filename to end in six X's */
|
||||
#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */
|
||||
#define TEMP_FILE_NAME "%sJPG%dXXXXXX"
|
||||
#endif
|
||||
|
||||
LOCAL(void)
|
||||
select_file_name (char * fname)
|
||||
{
|
||||
next_file_num++; /* advance counter */
|
||||
sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
|
||||
mktemp(fname); /* make sure file name is unique */
|
||||
/* mktemp replaces the trailing XXXXXX with a unique string of characters */
|
||||
}
|
||||
|
||||
#endif /* NO_MKTEMP */
|
||||
|
||||
|
||||
/*
|
||||
* Memory allocation and freeing are controlled by the regular library
|
||||
* routines malloc() and free().
|
||||
*/
|
||||
|
||||
GLOBAL(void *)
|
||||
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void *) malloc(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
|
||||
{
|
||||
free(object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "Large" objects are treated the same as "small" ones.
|
||||
* NB: although we include FAR keywords in the routine declarations,
|
||||
* this file won't actually work in 80x86 small/medium model; at least,
|
||||
* you probably won't be able to process useful-size images in only 64KB.
|
||||
*/
|
||||
|
||||
GLOBAL(void FAR *)
|
||||
jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
|
||||
{
|
||||
return (void FAR *) malloc(sizeofobject);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
||||
{
|
||||
free(object);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine computes the total memory space available for allocation.
|
||||
* It's impossible to do this in a portable way; our current solution is
|
||||
* to make the user tell us (with a default value set at compile time).
|
||||
* If you can actually get the available space, it's a good idea to subtract
|
||||
* a slop factor of 5% or so.
|
||||
*/
|
||||
|
||||
#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
|
||||
#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */
|
||||
#endif
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||
long max_bytes_needed, long already_allocated)
|
||||
{
|
||||
return cinfo->mem->max_memory_to_use - already_allocated;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Backing store (temporary file) management.
|
||||
* Backing store objects are only used when the value returned by
|
||||
* jpeg_mem_available is less than the total space needed. You can dispense
|
||||
* with these routines if you have plenty of virtual memory; see jmemnobs.c.
|
||||
*/
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
if (fseek(info->temp_file, file_offset, SEEK_SET))
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
if (JFREAD(info->temp_file, buffer_address, byte_count)
|
||||
!= (size_t) byte_count)
|
||||
ERREXIT(cinfo, JERR_TFILE_READ);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
void FAR * buffer_address,
|
||||
long file_offset, long byte_count)
|
||||
{
|
||||
if (fseek(info->temp_file, file_offset, SEEK_SET))
|
||||
ERREXIT(cinfo, JERR_TFILE_SEEK);
|
||||
if (JFWRITE(info->temp_file, buffer_address, byte_count)
|
||||
!= (size_t) byte_count)
|
||||
ERREXIT(cinfo, JERR_TFILE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
|
||||
{
|
||||
fclose(info->temp_file); /* close the file */
|
||||
unlink(info->temp_name); /* delete the file */
|
||||
/* If your system doesn't have unlink(), use remove() instead.
|
||||
* remove() is the ANSI-standard name for this function, but if
|
||||
* your system was ANSI you'd be using jmemansi.c, right?
|
||||
*/
|
||||
TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initial opening of a backing-store object.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
||||
long total_bytes_needed)
|
||||
{
|
||||
select_file_name(info->temp_name);
|
||||
if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)
|
||||
ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
|
||||
info->read_backing_store = read_backing_store;
|
||||
info->write_backing_store = write_backing_store;
|
||||
info->close_backing_store = close_backing_store;
|
||||
TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* These routines take care of any system-dependent initialization and
|
||||
* cleanup required.
|
||||
*/
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_init (j_common_ptr cinfo)
|
||||
{
|
||||
next_file_num = 0; /* initialize temp file name generator */
|
||||
return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_mem_term (j_common_ptr cinfo)
|
||||
{
|
||||
/* no work */
|
||||
}
|
||||
@@ -69,9 +69,9 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
||||
* Here we always say, "we got all you want bud!"
|
||||
*/
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||
long max_bytes_needed, long already_allocated)
|
||||
GLOBAL(size_t)
|
||||
jpeg_mem_available (j_common_ptr cinfo, size_t min_bytes_needed,
|
||||
size_t max_bytes_needed, size_t already_allocated)
|
||||
{
|
||||
return max_bytes_needed;
|
||||
}
|
||||
|
||||
@@ -100,10 +100,10 @@ EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
|
||||
* Conversely, zero may be returned to always use the minimum amount of memory.
|
||||
*/
|
||||
|
||||
EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
|
||||
long min_bytes_needed,
|
||||
long max_bytes_needed,
|
||||
long already_allocated));
|
||||
EXTERN(size_t) jpeg_mem_available JPP((j_common_ptr cinfo,
|
||||
size_t min_bytes_needed,
|
||||
size_t max_bytes_needed,
|
||||
size_t already_allocated));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
51
jmorecfg.h
51
jmorecfg.h
@@ -2,6 +2,7 @@
|
||||
* jmorecfg.h
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -62,11 +63,11 @@ typedef unsigned char JSAMPLE;
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
|
||||
typedef char JSAMPLE;
|
||||
#ifdef CHAR_IS_UNSIGNED
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
#define GETJSAMPLE(value) ((int) (value))
|
||||
#else
|
||||
#define GETJSAMPLE(value) ((int) (value) & 0xFF)
|
||||
#endif /* CHAR_IS_UNSIGNED */
|
||||
#endif /* __CHAR_UNSIGNED__ */
|
||||
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
@@ -113,11 +114,11 @@ typedef unsigned char JOCTET;
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
|
||||
typedef char JOCTET;
|
||||
#ifdef CHAR_IS_UNSIGNED
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
#define GETJOCTET(value) (value)
|
||||
#else
|
||||
#define GETJOCTET(value) ((value) & 0xFF)
|
||||
#endif /* CHAR_IS_UNSIGNED */
|
||||
#endif /* __CHAR_UNSIGNED__ */
|
||||
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
@@ -134,11 +135,11 @@ typedef char JOCTET;
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
typedef unsigned char UINT8;
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
#ifdef CHAR_IS_UNSIGNED
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
typedef char UINT8;
|
||||
#else /* not CHAR_IS_UNSIGNED */
|
||||
#else /* not __CHAR_UNSIGNED__ */
|
||||
typedef short UINT8;
|
||||
#endif /* CHAR_IS_UNSIGNED */
|
||||
#endif /* __CHAR_UNSIGNED__ */
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
/* UINT16 must hold at least the values 0..65535. */
|
||||
@@ -316,31 +317,37 @@ typedef int boolean;
|
||||
#define RGB_BLUE 2 /* Offset of Blue */
|
||||
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
|
||||
|
||||
#define JPEG_NUMCS 12
|
||||
|
||||
static const int rgb_red[JPEG_NUMCS] = {
|
||||
-1, -1, RGB_RED, -1, -1, -1, 0, 0, 2, 2, 3, 1
|
||||
};
|
||||
|
||||
static const int rgb_green[JPEG_NUMCS] = {
|
||||
-1, -1, RGB_GREEN, -1, -1, -1, 1, 1, 1, 1, 2, 2
|
||||
};
|
||||
|
||||
static const int rgb_blue[JPEG_NUMCS] = {
|
||||
-1, -1, RGB_BLUE, -1, -1, -1, 2, 2, 0, 0, 1, 3
|
||||
};
|
||||
|
||||
static const int rgb_pixelsize[JPEG_NUMCS] = {
|
||||
-1, -1, RGB_PIXELSIZE, -1, -1, -1, 3, 4, 3, 4, 4, 4
|
||||
};
|
||||
|
||||
/* Definitions for speed-related optimizations. */
|
||||
|
||||
|
||||
/* If your compiler supports inline functions, define INLINE
|
||||
* as the inline keyword; otherwise define it as empty.
|
||||
*/
|
||||
|
||||
#ifndef INLINE
|
||||
#ifdef __GNUC__ /* for instance, GNU C knows about inline */
|
||||
#define INLINE __inline__
|
||||
#endif
|
||||
#ifndef INLINE
|
||||
#define INLINE /* default is to define it as empty */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
|
||||
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
|
||||
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
|
||||
*/
|
||||
|
||||
#ifndef MULTIPLIER
|
||||
#ifndef WITH_SIMD
|
||||
#define MULTIPLIER int /* type for fastest integer multiply */
|
||||
#else
|
||||
#define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
|
||||
|
||||
/* Utility routines in jutils.c */
|
||||
EXTERN(long) jdiv_round_up JPP((long a, long b));
|
||||
EXTERN(long) jround_up JPP((long a, long b));
|
||||
EXTERN(size_t) jround_up JPP((size_t a, size_t b));
|
||||
EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
|
||||
JSAMPARRAY output_array, int dest_row,
|
||||
int num_rows, JDIMENSION num_cols));
|
||||
|
||||
22
jpeglib.h
22
jpeglib.h
@@ -2,6 +2,7 @@
|
||||
* jpeglib.h
|
||||
*
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -13,6 +14,10 @@
|
||||
#ifndef JPEGLIB_H
|
||||
#define JPEGLIB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* First we include the configuration files that record how this
|
||||
* installation of the JPEG library is set up. jconfig.h can be
|
||||
@@ -203,13 +208,22 @@ struct jpeg_marker_struct {
|
||||
|
||||
/* Known color spaces. */
|
||||
|
||||
#define JCS_EXTENSIONS 1
|
||||
|
||||
typedef enum {
|
||||
JCS_UNKNOWN, /* error/unspecified */
|
||||
JCS_GRAYSCALE, /* monochrome */
|
||||
JCS_RGB, /* red/green/blue */
|
||||
JCS_RGB, /* red/green/blue as specified by the RGB_RED, RGB_GREEN,
|
||||
RGB_BLUE, and RGB_PIXELSIZE macros */
|
||||
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
|
||||
JCS_CMYK, /* C/M/Y/K */
|
||||
JCS_YCCK /* Y/Cb/Cr/K */
|
||||
JCS_YCCK, /* Y/Cb/Cr/K */
|
||||
JCS_EXT_RGB, /* red/green/blue */
|
||||
JCS_EXT_RGBX, /* red/green/blue/x */
|
||||
JCS_EXT_BGR, /* blue/green/red */
|
||||
JCS_EXT_BGRX, /* blue/green/red/x */
|
||||
JCS_EXT_XBGR, /* x/blue/green/red */
|
||||
JCS_EXT_XRGB /* x/red/green/blue */
|
||||
} J_COLOR_SPACE;
|
||||
|
||||
/* DCT/IDCT algorithm options. */
|
||||
@@ -1093,4 +1107,8 @@ struct jpeg_color_quantizer { long dummy; };
|
||||
#include "jerror.h" /* fetch error codes too */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* JPEGLIB_H */
|
||||
|
||||
387
jpegut.c
Normal file
387
jpegut.c
Normal file
@@ -0,0 +1,387 @@
|
||||
/* Copyright (C)2004 Landmark Graphics Corporation
|
||||
* Copyright (C)2005 Sun Microsystems, Inc.
|
||||
* Copyright (C)2009 D. R. Commander
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "./rrtimer.h"
|
||||
#include "./turbojpeg.h"
|
||||
|
||||
#define _catch(f) {if((f)==-1) {printf("TJPEG: %s\n", tjGetErrorStr()); bailout();}}
|
||||
|
||||
const char *_subnamel[NUMSUBOPT]={"4:4:4", "4:2:2", "4:2:0", "GRAY"};
|
||||
const char *_subnames[NUMSUBOPT]={"444", "422", "420", "GRAY"};
|
||||
|
||||
int exitstatus=0;
|
||||
#define bailout() {exitstatus=-1; goto finally;}
|
||||
|
||||
int pixels[9][3]=
|
||||
{
|
||||
{0, 255, 0},
|
||||
{255, 0, 255},
|
||||
{255, 255, 0},
|
||||
{0, 0, 255},
|
||||
{0, 255, 255},
|
||||
{255, 0, 0},
|
||||
{255, 255, 255},
|
||||
{0, 0, 0},
|
||||
{255, 0, 0}
|
||||
};
|
||||
|
||||
void initbuf(unsigned char *buf, int w, int h, int ps, int flags)
|
||||
{
|
||||
int roffset=(flags&TJ_BGR)?2:0, goffset=1, boffset=(flags&TJ_BGR)?0:2, i,
|
||||
_i, j;
|
||||
if(flags&TJ_ALPHAFIRST) {roffset++; goffset++; boffset++;}
|
||||
memset(buf, 0, w*h*ps);
|
||||
for(_i=0; _i<16; _i++)
|
||||
{
|
||||
if(flags&TJ_BOTTOMUP) i=h-_i-1; else i=_i;
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
buf[(w*i+j)*ps+roffset]=255;
|
||||
if(((_i/8)+(j/8))%2==0)
|
||||
{
|
||||
buf[(w*i+j)*ps+goffset]=255;
|
||||
buf[(w*i+j)*ps+boffset]=255;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(_i=16; _i<h; _i++)
|
||||
{
|
||||
if(flags&TJ_BOTTOMUP) i=h-_i-1; else i=_i;
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
if(((_i/8)+(j/8))%2!=0)
|
||||
{
|
||||
buf[(w*i+j)*ps+roffset]=255;
|
||||
buf[(w*i+j)*ps+goffset]=255;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dumpbuf(unsigned char *buf, int w, int h, int ps, int flags)
|
||||
{
|
||||
int roffset=(flags&TJ_BGR)?2:0, goffset=1, boffset=(flags&TJ_BGR)?0:2, i,
|
||||
j;
|
||||
for(i=0; i<h; i++)
|
||||
{
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
printf("%.3d/%.3d/%.3d ", buf[(w*i+j)*ps+roffset],
|
||||
buf[(w*i+j)*ps+roffset], buf[(w*i+j)*ps+roffset]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
int checkbuf(unsigned char *buf, int w, int h, int ps, int subsamp, int flags)
|
||||
{
|
||||
int roffset=(flags&TJ_BGR)?2:0, goffset=1, boffset=(flags&TJ_BGR)?0:2, i,
|
||||
_i, j;
|
||||
if(flags&TJ_ALPHAFIRST) {roffset++; goffset++; boffset++;}
|
||||
if(subsamp==TJ_GRAYSCALE)
|
||||
{
|
||||
for(_i=0; _i<16; _i++)
|
||||
{
|
||||
if(flags&TJ_BOTTOMUP) i=h-_i-1; else i=_i;
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
unsigned char r=buf[(w*i+j)*ps+roffset],
|
||||
g=buf[(w*i+j)*ps+goffset],
|
||||
b=buf[(w*i+j)*ps+boffset];
|
||||
if(((_i/8)+(j/8))%2==0)
|
||||
{
|
||||
if(r<253 || g<253 || b<253) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(r<74 || r>78 || g<74 || g>78 || b<74 || b>78) return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(_i=16; _i<h; _i++)
|
||||
{
|
||||
if(flags&TJ_BOTTOMUP) i=h-_i-1; else i=_i;
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
unsigned char r=buf[(w*i+j)*ps+roffset],
|
||||
g=buf[(w*i+j)*ps+goffset],
|
||||
b=buf[(w*i+j)*ps+boffset];
|
||||
if(((_i/8)+(j/8))%2==0)
|
||||
{
|
||||
if(r>2 || g>2 || b>2) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(r<224 || r>228 || g<224 || g>228 || b<224 || b>228) return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(_i=0; _i<16; _i++)
|
||||
{
|
||||
if(flags&TJ_BOTTOMUP) i=h-_i-1; else i=_i;
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
if(buf[(w*i+j)*ps+roffset]<253) return 0;
|
||||
if(((_i/8)+(j/8))%2==0)
|
||||
{
|
||||
if(buf[(w*i+j)*ps+goffset]<253) return 0;
|
||||
if(buf[(w*i+j)*ps+boffset]<253) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(buf[(w*i+j)*ps+goffset]>2) return 0;
|
||||
if(buf[(w*i+j)*ps+boffset]>2) return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(_i=16; _i<h; _i++)
|
||||
{
|
||||
if(flags&TJ_BOTTOMUP) i=h-_i-1; else i=_i;
|
||||
for(j=0; j<w; j++)
|
||||
{
|
||||
if(buf[(w*i+j)*ps+boffset]>2) return 0;
|
||||
if(((_i/8)+(j/8))%2==0)
|
||||
{
|
||||
if(buf[(w*i+j)*ps+roffset]>2) return 0;
|
||||
if(buf[(w*i+j)*ps+goffset]>2) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(buf[(w*i+j)*ps+roffset]<253) return 0;
|
||||
if(buf[(w*i+j)*ps+goffset]<253) return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void writejpeg(unsigned char *jpegbuf, unsigned long jpgbufsize, char *filename)
|
||||
{
|
||||
FILE *outfile=NULL;
|
||||
if((outfile=fopen(filename, "wb"))==NULL)
|
||||
{
|
||||
printf("ERROR: Could not open %s for writing.\n", filename);
|
||||
bailout();
|
||||
}
|
||||
if(fwrite(jpegbuf, jpgbufsize, 1, outfile)!=1)
|
||||
{
|
||||
printf("ERROR: Could not write to %s.\n", filename);
|
||||
bailout();
|
||||
}
|
||||
|
||||
finally:
|
||||
if(outfile) fclose(outfile);
|
||||
}
|
||||
|
||||
void gentestjpeg(tjhandle hnd, unsigned char *jpegbuf, unsigned long *size,
|
||||
int w, int h, int ps, char *basefilename, int subsamp, int qual, int flags)
|
||||
{
|
||||
char tempstr[1024]; unsigned char *bmpbuf=NULL;
|
||||
const char *pixformat; double t;
|
||||
|
||||
if(flags&TJ_BGR)
|
||||
{
|
||||
if(ps==3) pixformat="BGR";
|
||||
else {if(flags&TJ_ALPHAFIRST) pixformat="ABGR"; else pixformat="BGRA";}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ps==3) pixformat="RGB";
|
||||
else {if(flags&TJ_ALPHAFIRST) pixformat="ARGB"; else pixformat="RGBA";}
|
||||
}
|
||||
printf("%s %s -> %s Q%d ... ", pixformat,
|
||||
(flags&TJ_BOTTOMUP)?"Bottom-Up":"Top-Down ", _subnamel[subsamp], qual);
|
||||
|
||||
if((bmpbuf=(unsigned char *)malloc(w*h*ps+1))==NULL)
|
||||
{
|
||||
printf("ERROR: Could not allocate buffer\n"); bailout();
|
||||
}
|
||||
initbuf(bmpbuf, w, h, ps, flags);
|
||||
memset(jpegbuf, 0, TJBUFSIZE(w, h));
|
||||
|
||||
t=rrtime();
|
||||
_catch(tjCompress(hnd, bmpbuf, w, 0, h, ps, jpegbuf, size, subsamp, qual, flags));
|
||||
t=rrtime()-t;
|
||||
|
||||
sprintf(tempstr, "%s_enc_%s_%s_%sQ%d.jpg", basefilename, pixformat,
|
||||
(flags&TJ_BOTTOMUP)? "BU":"TD", _subnames[subsamp], qual);
|
||||
writejpeg(jpegbuf, *size, tempstr);
|
||||
printf("Done. %f ms\n Result in %s\n", t*1000., tempstr);
|
||||
|
||||
finally:
|
||||
if(bmpbuf) free(bmpbuf);
|
||||
}
|
||||
|
||||
void gentestbmp(tjhandle hnd, unsigned char *jpegbuf, unsigned long jpegsize,
|
||||
int w, int h, int ps, char *basefilename, int subsamp, int qual, int flags)
|
||||
{
|
||||
unsigned char *bmpbuf=NULL;
|
||||
const char *pixformat; int _w=0, _h=0; double t;
|
||||
|
||||
if(flags&TJ_BGR)
|
||||
{
|
||||
if(ps==3) pixformat="BGR";
|
||||
else {if(flags&TJ_ALPHAFIRST) pixformat="ABGR"; else pixformat="BGRA";}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ps==3) pixformat="RGB";
|
||||
else {if(flags&TJ_ALPHAFIRST) pixformat="ARGB"; else pixformat="RGBA";}
|
||||
}
|
||||
printf("JPEG -> %s %s ... ", pixformat, (flags&TJ_BOTTOMUP)?"Bottom-Up":"Top-Down ");
|
||||
|
||||
_catch(tjDecompressHeader(hnd, jpegbuf, jpegsize, &_w, &_h));
|
||||
if(_w!=w || _h!=h)
|
||||
{
|
||||
printf("Incorrect JPEG header\n"); bailout();
|
||||
}
|
||||
|
||||
if((bmpbuf=(unsigned char *)malloc(w*h*ps+1))==NULL)
|
||||
{
|
||||
printf("ERROR: Could not allocate buffer\n"); bailout();
|
||||
}
|
||||
memset(bmpbuf, 0, w*ps*h);
|
||||
|
||||
t=rrtime();
|
||||
_catch(tjDecompress(hnd, jpegbuf, jpegsize, bmpbuf, w, w*ps, h, ps, flags));
|
||||
t=rrtime()-t;
|
||||
|
||||
if(checkbuf(bmpbuf, w, h, ps, subsamp, flags)) printf("Passed.");
|
||||
else {printf("FAILED!"); dumpbuf(bmpbuf, w, h, ps, flags);}
|
||||
|
||||
printf(" %f ms\n\n", t*1000.);
|
||||
|
||||
finally:
|
||||
if(bmpbuf) free(bmpbuf);
|
||||
}
|
||||
|
||||
void dotest(int w, int h, int ps, int subsamp, char *basefilename)
|
||||
{
|
||||
tjhandle hnd=NULL, dhnd=NULL; unsigned char *jpegbuf=NULL;
|
||||
unsigned long size;
|
||||
|
||||
if((jpegbuf=(unsigned char *)malloc(TJBUFSIZE(w, h))) == NULL)
|
||||
{
|
||||
puts("ERROR: Could not allocate buffer."); bailout();
|
||||
}
|
||||
|
||||
if((hnd=tjInitCompress())==NULL)
|
||||
{printf("Error in tjInitCompress():\n%s\n", tjGetErrorStr()); bailout();}
|
||||
if((dhnd=tjInitDecompress())==NULL)
|
||||
{printf("Error in tjInitDecompress():\n%s\n", tjGetErrorStr()); bailout();}
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, 0);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, 0);
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_BGR);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_BGR);
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_BOTTOMUP);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_BOTTOMUP);
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_BGR|TJ_BOTTOMUP);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_BGR|TJ_BOTTOMUP);
|
||||
|
||||
if(ps==4)
|
||||
{
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST);
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST|TJ_BGR);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST|TJ_BGR);
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST|TJ_BOTTOMUP);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST|TJ_BOTTOMUP);
|
||||
|
||||
gentestjpeg(hnd, jpegbuf, &size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST|TJ_BGR|TJ_BOTTOMUP);
|
||||
gentestbmp(dhnd, jpegbuf, size, w, h, ps, basefilename, subsamp, 100, TJ_ALPHAFIRST|TJ_BGR|TJ_BOTTOMUP);
|
||||
}
|
||||
|
||||
finally:
|
||||
if(hnd) tjDestroy(hnd);
|
||||
if(dhnd) tjDestroy(dhnd);
|
||||
|
||||
if(jpegbuf) free(jpegbuf);
|
||||
}
|
||||
|
||||
#define MAXLENGTH 2048
|
||||
|
||||
void dotest1(void)
|
||||
{
|
||||
int i, j, i2; unsigned char *bmpbuf=NULL, *jpgbuf=NULL;
|
||||
tjhandle hnd=NULL; unsigned long size;
|
||||
if((hnd=tjInitCompress())==NULL)
|
||||
{printf("Error in tjInitCompress():\n%s\n", tjGetErrorStr()); bailout();}
|
||||
printf("Buffer size regression test\n");
|
||||
for(j=1; j<48; j++)
|
||||
{
|
||||
for(i=1; i<(j==1?MAXLENGTH:48); i++)
|
||||
{
|
||||
if(i%100==0) printf("%.4d x %.4d\b\b\b\b\b\b\b\b\b\b\b", i, j);
|
||||
if((bmpbuf=(unsigned char *)malloc(i*j*4))==NULL
|
||||
|| (jpgbuf=(unsigned char *)malloc(TJBUFSIZE(i, j)))==NULL)
|
||||
{
|
||||
printf("Memory allocation failure\n"); bailout();
|
||||
}
|
||||
memset(bmpbuf, 0, i*j*4);
|
||||
for(i2=0; i2<i*j; i2++)
|
||||
{
|
||||
bmpbuf[i2*4]=pixels[i2%9][2];
|
||||
bmpbuf[i2*4+1]=pixels[i2%9][1];
|
||||
bmpbuf[i2*2+2]=pixels[i2%9][0];
|
||||
}
|
||||
_catch(tjCompress(hnd, bmpbuf, i, i*4, j, 4,
|
||||
jpgbuf, &size, TJ_444, 100, TJ_BGR));
|
||||
free(bmpbuf); bmpbuf=NULL; free(jpgbuf); jpgbuf=NULL;
|
||||
|
||||
if((bmpbuf=(unsigned char *)malloc(j*i*4))==NULL
|
||||
|| (jpgbuf=(unsigned char *)malloc(TJBUFSIZE(j, i)))==NULL)
|
||||
{
|
||||
printf("Memory allocation failure\n"); bailout();
|
||||
}
|
||||
for(i2=0; i2<j*i*4; i2++)
|
||||
{
|
||||
if(i2%2==0) bmpbuf[i2]=0xFF;
|
||||
else bmpbuf[i2]=0;
|
||||
}
|
||||
_catch(tjCompress(hnd, bmpbuf, j, j*4, i, 4,
|
||||
jpgbuf, &size, TJ_444, 100, TJ_BGR));
|
||||
free(bmpbuf); bmpbuf=NULL; free(jpgbuf); jpgbuf=NULL;
|
||||
}
|
||||
}
|
||||
printf("Done. \n");
|
||||
|
||||
finally:
|
||||
if(bmpbuf) free(bmpbuf); if(jpgbuf) free(jpgbuf);
|
||||
if(hnd) tjDestroy(hnd);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
dotest(35, 41, 3, TJ_444, "test");
|
||||
dotest(35, 41, 4, TJ_444, "test");
|
||||
dotest(35, 41, 3, TJ_GRAYSCALE, "test");
|
||||
dotest(35, 41, 4, TJ_GRAYSCALE, "test");
|
||||
dotest1();
|
||||
|
||||
return exitstatus;
|
||||
}
|
||||
392
jpgtest.cxx
Normal file
392
jpgtest.cxx
Normal file
@@ -0,0 +1,392 @@
|
||||
/* Copyright (C)2004 Landmark Graphics Corporation
|
||||
* Copyright (C)2005, 2006 Sun Microsystems, Inc.
|
||||
* Copyright (C)2009 D. R. Commander
|
||||
*
|
||||
* This library is free software and may be redistributed and/or modified under
|
||||
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
|
||||
* any later version. The full license is in the LICENSE.txt file included
|
||||
* with this distribution.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* wxWindows Library License for more details.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "./bmp.h"
|
||||
#include "./rrutil.h"
|
||||
#include "./rrtimer.h"
|
||||
#include "./turbojpeg.h"
|
||||
|
||||
#define _catch(f) {if((f)==-1) {printf("Error in %s:\n%s\n", #f, tjGetErrorStr()); goto bailout;}}
|
||||
|
||||
int forcemmx=0, forcesse=0, forcesse2=0, forcesse3=0, fastupsample=0;
|
||||
const int _ps[BMPPIXELFORMATS]={3, 4, 3, 4, 4, 4};
|
||||
const int _flags[BMPPIXELFORMATS]={0, 0, TJ_BGR, TJ_BGR,
|
||||
TJ_BGR|TJ_ALPHAFIRST, TJ_ALPHAFIRST};
|
||||
const int _rindex[BMPPIXELFORMATS]={0, 0, 2, 2, 3, 1};
|
||||
const int _gindex[BMPPIXELFORMATS]={1, 1, 1, 1, 2, 2};
|
||||
const int _bindex[BMPPIXELFORMATS]={2, 2, 0, 0, 1, 3};
|
||||
const char *_pfname[]={"RGB", "RGBA", "BGR", "BGRA", "ABGR", "ARGB"};
|
||||
const char *_subnamel[NUMSUBOPT]={"4:4:4", "4:2:2", "4:2:0", "GRAY"};
|
||||
const char *_subnames[NUMSUBOPT]={"444", "422", "420", "GRAY"};
|
||||
|
||||
void printsigfig(double val, int figs)
|
||||
{
|
||||
char format[80];
|
||||
double _l=log10(val); int l;
|
||||
if(_l<0.)
|
||||
{
|
||||
l=(int)fabs(_l);
|
||||
sprintf(format, "%%%d.%df", figs+l+2, figs+l);
|
||||
}
|
||||
else
|
||||
{
|
||||
l=(int)_l+1;
|
||||
if(figs<=l) sprintf(format, "%%.0f");
|
||||
else sprintf(format, "%%%d.%df", figs+1, figs-l);
|
||||
}
|
||||
printf(format, val);
|
||||
}
|
||||
|
||||
void dotest(unsigned char *srcbuf, int w, int h, BMPPIXELFORMAT pf, int bu,
|
||||
int jpegsub, int qual, char *filename, int dotile, int useppm, int quiet)
|
||||
{
|
||||
char tempstr[1024];
|
||||
FILE *outfile; tjhandle hnd;
|
||||
unsigned char **jpegbuf=NULL, *rgbbuf=NULL;
|
||||
rrtimer timer; double elapsed;
|
||||
int jpgbufsize=0, i, j, tilesizex, tilesizey, numtilesx, numtilesy, ITER;
|
||||
unsigned long *comptilesize=NULL;
|
||||
int flags=(forcemmx?TJ_FORCEMMX:0)|(forcesse?TJ_FORCESSE:0)
|
||||
|(forcesse2?TJ_FORCESSE2:0)|(forcesse3?TJ_FORCESSE3:0)
|
||||
|(fastupsample?TJ_FASTUPSAMPLE:0);
|
||||
int ps=_ps[pf];
|
||||
int pitch=w*ps;
|
||||
|
||||
flags |= _flags[pf];
|
||||
if(bu) flags |= TJ_BOTTOMUP;
|
||||
|
||||
if((rgbbuf=(unsigned char *)malloc(pitch*h)) == NULL)
|
||||
{
|
||||
puts("ERROR: Could not allocate image buffer.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(!quiet) printf("\n>>>>> %s (%s) <--> JPEG %s Q%d <<<<<\n", _pfname[pf],
|
||||
bu?"Bottom-up":"Top-down", _subnamel[jpegsub], qual);
|
||||
if(dotile) {tilesizex=tilesizey=4;} else {tilesizex=w; tilesizey=h;}
|
||||
|
||||
do
|
||||
{
|
||||
tilesizex*=2; if(tilesizex>w) tilesizex=w;
|
||||
tilesizey*=2; if(tilesizey>h) tilesizey=h;
|
||||
numtilesx=(w+tilesizex-1)/tilesizex;
|
||||
numtilesy=(h+tilesizey-1)/tilesizey;
|
||||
if((comptilesize=(unsigned long *)malloc(sizeof(unsigned long)*numtilesx*numtilesy)) == NULL
|
||||
|| (jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)*numtilesx*numtilesy)) == NULL)
|
||||
{
|
||||
puts("ERROR: Could not allocate image buffers.");
|
||||
goto bailout;
|
||||
}
|
||||
memset(jpegbuf, 0, sizeof(unsigned char *)*numtilesx*numtilesy);
|
||||
for(i=0; i<numtilesx*numtilesy; i++)
|
||||
{
|
||||
if((jpegbuf[i]=(unsigned char *)malloc(TJBUFSIZE(tilesizex, tilesizey))) == NULL)
|
||||
{
|
||||
puts("ERROR: Could not allocate image buffers.");
|
||||
goto bailout;
|
||||
}
|
||||
}
|
||||
|
||||
// Compression test
|
||||
if(quiet) printf("%s\t%s\t%s\t%d\t", _pfname[pf], bu?"BU":"TD",
|
||||
_subnamel[jpegsub], qual);
|
||||
for(i=0; i<h; i++) memcpy(&rgbbuf[pitch*i], &srcbuf[w*ps*i], w*ps);
|
||||
if((hnd=tjInitCompress())==NULL)
|
||||
{
|
||||
printf("Error in tjInitCompress():\n%s\n", tjGetErrorStr());
|
||||
goto bailout;
|
||||
}
|
||||
_catch(tjCompress(hnd, rgbbuf, tilesizex, pitch, tilesizey, ps,
|
||||
jpegbuf[0], &comptilesize[0], jpegsub, qual, flags));
|
||||
ITER=0;
|
||||
timer.start();
|
||||
do
|
||||
{
|
||||
jpgbufsize=0; int tilen=0;
|
||||
for(i=0; i<h; i+=tilesizey)
|
||||
{
|
||||
for(j=0; j<w; j+=tilesizex)
|
||||
{
|
||||
int tempw=min(tilesizex, w-j), temph=min(tilesizey, h-i);
|
||||
_catch(tjCompress(hnd, &rgbbuf[pitch*i+j*ps], tempw, pitch,
|
||||
temph, ps, jpegbuf[tilen], &comptilesize[tilen], jpegsub, qual,
|
||||
flags));
|
||||
jpgbufsize+=comptilesize[tilen];
|
||||
tilen++;
|
||||
}
|
||||
}
|
||||
ITER++;
|
||||
} while((elapsed=timer.elapsed())<5.);
|
||||
_catch(tjDestroy(hnd));
|
||||
if(quiet)
|
||||
{
|
||||
if(tilesizex==w && tilesizey==h) printf("Full \t");
|
||||
else printf("%-4d %-4d\t", tilesizex, tilesizey);
|
||||
printsigfig((double)(w*h)/1000000.*(double)ITER/elapsed, 4);
|
||||
printf("\t");
|
||||
printsigfig((double)(w*h*ps)/(double)jpgbufsize, 4);
|
||||
printf("\t");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(tilesizex==w && tilesizey==h) printf("\nFull image\n");
|
||||
else printf("\nTile size: %d x %d\n", tilesizex, tilesizey);
|
||||
printf("C--> Frame rate: %f fps\n", (double)ITER/elapsed);
|
||||
printf(" Output image size: %d bytes\n", jpgbufsize);
|
||||
printf(" Compression ratio: %f:1\n",
|
||||
(double)(w*h*ps)/(double)jpgbufsize);
|
||||
printf(" Source throughput: %f Megapixels/sec\n",
|
||||
(double)(w*h)/1000000.*(double)ITER/elapsed);
|
||||
printf(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)jpgbufsize*8./1000000.*(double)ITER/elapsed);
|
||||
}
|
||||
if(tilesizex==w && tilesizey==h)
|
||||
{
|
||||
sprintf(tempstr, "%s_%sQ%d.jpg", filename, _subnames[jpegsub], qual);
|
||||
if((outfile=fopen(tempstr, "wb"))==NULL)
|
||||
{
|
||||
puts("ERROR: Could not open reference image");
|
||||
exit(1);
|
||||
}
|
||||
if(fwrite(jpegbuf[0], jpgbufsize, 1, outfile)!=1)
|
||||
{
|
||||
puts("ERROR: Could not write reference image");
|
||||
exit(1);
|
||||
}
|
||||
fclose(outfile);
|
||||
if(!quiet) printf("Reference image written to %s\n", tempstr);
|
||||
}
|
||||
|
||||
// Decompression test
|
||||
memset(rgbbuf, 127, pitch*h); // Grey image means decompressor did nothing
|
||||
if((hnd=tjInitDecompress())==NULL)
|
||||
{
|
||||
printf("Error in tjInitDecompress():\n%s\n", tjGetErrorStr());
|
||||
goto bailout;
|
||||
}
|
||||
_catch(tjDecompress(hnd, jpegbuf[0], jpgbufsize, rgbbuf, tilesizex, pitch,
|
||||
tilesizey, ps, flags));
|
||||
ITER=0;
|
||||
timer.start();
|
||||
do
|
||||
{
|
||||
int tilen=0;
|
||||
for(i=0; i<h; i+=tilesizey)
|
||||
{
|
||||
for(j=0; j<w; j+=tilesizex)
|
||||
{
|
||||
int tempw=min(tilesizex, w-j), temph=min(tilesizey, h-i);
|
||||
_catch(tjDecompress(hnd, jpegbuf[tilen], comptilesize[tilen],
|
||||
&rgbbuf[pitch*i+ps*j], tempw, pitch, temph, ps, flags));
|
||||
tilen++;
|
||||
}
|
||||
}
|
||||
ITER++;
|
||||
} while((elapsed=timer.elapsed())<5.);
|
||||
_catch(tjDestroy(hnd));
|
||||
if(quiet)
|
||||
{
|
||||
printsigfig((double)(w*h)/1000000.*(double)ITER/elapsed, 4);
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("D--> Frame rate: %f fps\n", (double)ITER/elapsed);
|
||||
printf(" Dest. throughput: %f Megapixels/sec\n",
|
||||
(double)(w*h)/1000000.*(double)ITER/elapsed);
|
||||
}
|
||||
if(tilesizex==w && tilesizey==h)
|
||||
sprintf(tempstr, "%s_%sQ%d_full.%s", filename, _subnames[jpegsub], qual,
|
||||
useppm?"ppm":"bmp");
|
||||
else sprintf(tempstr, "%s_%sQ%d_%dx%d.%s", filename, _subnames[jpegsub],
|
||||
qual, tilesizex, tilesizey, useppm?"ppm":"bmp");
|
||||
if(savebmp(tempstr, rgbbuf, w, h, pf, pitch, bu)==-1)
|
||||
{
|
||||
printf("ERROR saving bitmap: %s\n", bmpgeterr());
|
||||
goto bailout;
|
||||
}
|
||||
sprintf(strrchr(tempstr, '.'), "-err.%s", useppm?"ppm":"bmp");
|
||||
if(!quiet)
|
||||
printf("Computing compression error and saving to %s.\n", tempstr);
|
||||
if(jpegsub==TJ_GRAYSCALE)
|
||||
{
|
||||
for(j=0; j<h; j++)
|
||||
{
|
||||
for(i=0; i<w*ps; i+=ps)
|
||||
{
|
||||
int y=(int)((double)srcbuf[w*ps*j+i+_rindex[pf]]*0.299
|
||||
+ (double)srcbuf[w*ps*j+i+_gindex[pf]]*0.587
|
||||
+ (double)srcbuf[w*ps*j+i+_bindex[pf]]*0.114 + 0.5);
|
||||
if(y>255) y=255; if(y<0) y=0;
|
||||
rgbbuf[pitch*j+i+_rindex[pf]]=abs(rgbbuf[pitch*j+i+_rindex[pf]]-y);
|
||||
rgbbuf[pitch*j+i+_gindex[pf]]=abs(rgbbuf[pitch*j+i+_gindex[pf]]-y);
|
||||
rgbbuf[pitch*j+i+_bindex[pf]]=abs(rgbbuf[pitch*j+i+_bindex[pf]]-y);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j=0; j<h; j++) for(i=0; i<w*ps; i++)
|
||||
rgbbuf[pitch*j+i]=abs(rgbbuf[pitch*j+i]-srcbuf[w*ps*j+i]);
|
||||
}
|
||||
if(savebmp(tempstr, rgbbuf, w, h, pf, pitch, bu)==-1)
|
||||
{
|
||||
printf("ERROR saving bitmap: %s\n", bmpgeterr());
|
||||
goto bailout;
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
if(jpegbuf)
|
||||
{
|
||||
for(i=0; i<numtilesx*numtilesy; i++)
|
||||
{if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL;}
|
||||
free(jpegbuf); jpegbuf=NULL;
|
||||
}
|
||||
if(comptilesize) {free(comptilesize); comptilesize=NULL;}
|
||||
} while(tilesizex<w || tilesizey<h);
|
||||
|
||||
if(rgbbuf) {free(rgbbuf); rgbbuf=NULL;}
|
||||
return;
|
||||
|
||||
bailout:
|
||||
if(jpegbuf)
|
||||
{
|
||||
for(i=0; i<numtilesx*numtilesy; i++)
|
||||
{if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL;}
|
||||
free(jpegbuf); jpegbuf=NULL;
|
||||
}
|
||||
if(comptilesize) {free(comptilesize); comptilesize=NULL;}
|
||||
if(rgbbuf) {free(rgbbuf); rgbbuf=NULL;}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned char *bmpbuf=NULL; int w, h, i, useppm=0;
|
||||
int qual, dotile=0, quiet=0, hiqual=-1; char *temp;
|
||||
BMPPIXELFORMAT pf=BMP_BGR;
|
||||
int bu=0;
|
||||
|
||||
printf("\n");
|
||||
|
||||
if(argc<3)
|
||||
{
|
||||
printf("USAGE: %s <Inputfile (BMP|PPM)> <%% Quality>\n\n", argv[0]);
|
||||
printf(" [-tile]\n");
|
||||
printf(" Test performance of the codec when the image is encoded\n");
|
||||
printf(" as separate tiles of varying sizes.\n\n");
|
||||
printf(" [-forcemmx] [-forcesse] [-forcesse2] [-forcesse3]\n");
|
||||
printf(" Force MMX, SSE, or SSE2 code paths in Intel codec\n\n");
|
||||
printf(" [-rgb | -bgr | -rgba | -bgra | -abgr | -argb]\n");
|
||||
printf(" Test the specified color conversion path in the codec (default: BGR)\n\n");
|
||||
printf(" [-fastupsample]\n");
|
||||
printf(" Use fast, inaccurate upsampling code to perform 4:2:2 and 4:2:0\n");
|
||||
printf(" YUV decoding in libjpeg decompressor\n\n");
|
||||
printf(" [-quiet]\n");
|
||||
printf(" Output in tabular rather than verbose format\n\n");
|
||||
printf(" NOTE: If the quality is specified as a range, i.e. 90-100, a separate\n");
|
||||
printf(" test will be performed for all quality values in the range.\n");
|
||||
exit(1);
|
||||
}
|
||||
if((qual=atoi(argv[2]))<1 || qual>100)
|
||||
{
|
||||
puts("ERROR: Quality must be between 1 and 100.");
|
||||
exit(1);
|
||||
}
|
||||
if((temp=strchr(argv[2], '-'))!=NULL && strlen(temp)>1
|
||||
&& sscanf(&temp[1], "%d", &hiqual)==1 && hiqual>qual && hiqual>=1
|
||||
&& hiqual<=100) {}
|
||||
else hiqual=qual;
|
||||
|
||||
if(argc>3)
|
||||
{
|
||||
for(i=3; i<argc; i++)
|
||||
{
|
||||
if(!stricmp(argv[i], "-tile")) dotile=1;
|
||||
if(!stricmp(argv[i], "-forcesse3"))
|
||||
{
|
||||
printf("Using SSE3 code\n");
|
||||
forcesse3=1;
|
||||
}
|
||||
if(!stricmp(argv[i], "-forcesse2"))
|
||||
{
|
||||
printf("Using SSE2 code\n");
|
||||
forcesse2=1;
|
||||
}
|
||||
if(!stricmp(argv[i], "-forcesse"))
|
||||
{
|
||||
printf("Using SSE code\n");
|
||||
forcesse=1;
|
||||
}
|
||||
if(!stricmp(argv[i], "-forcemmx"))
|
||||
{
|
||||
printf("Using MMX code\n");
|
||||
forcemmx=1;
|
||||
}
|
||||
if(!stricmp(argv[i], "-fastupsample"))
|
||||
{
|
||||
printf("Using fast upsampling code\n");
|
||||
fastupsample=1;
|
||||
}
|
||||
if(!stricmp(argv[i], "-rgb")) pf=BMP_RGB;
|
||||
if(!stricmp(argv[i], "-rgba")) pf=BMP_RGBA;
|
||||
if(!stricmp(argv[i], "-bgr")) pf=BMP_BGR;
|
||||
if(!stricmp(argv[i], "-bgra")) pf=BMP_BGRA;
|
||||
if(!stricmp(argv[i], "-abgr")) pf=BMP_ABGR;
|
||||
if(!stricmp(argv[i], "-argb")) pf=BMP_ARGB;
|
||||
if(!stricmp(argv[i], "-bottomup")) bu=1;
|
||||
if(!stricmp(argv[i], "-quiet")) quiet=1;
|
||||
}
|
||||
}
|
||||
|
||||
if(loadbmp(argv[1], &bmpbuf, &w, &h, pf, 1, bu)==-1)
|
||||
{
|
||||
printf("ERROR loading bitmap: %s\n", bmpgeterr()); exit(1);
|
||||
}
|
||||
|
||||
temp=strrchr(argv[1], '.');
|
||||
if(temp!=NULL)
|
||||
{
|
||||
if(!stricmp(temp, ".ppm")) useppm=1;
|
||||
*temp='\0';
|
||||
}
|
||||
|
||||
if(quiet)
|
||||
{
|
||||
printf("All performance values in Mpixels/sec\n\n");
|
||||
printf("Bitmap\tBitmap\tJPEG\tJPEG\tTile Size\tCompr\tCompr\tDecomp\n");
|
||||
printf("Format\tOrder\tFormat\tQual\t X Y \tPerf \tRatio\tPerf\n\n");
|
||||
}
|
||||
|
||||
for(i=hiqual; i>=qual; i--)
|
||||
dotest(bmpbuf, w, h, pf, bu, TJ_GRAYSCALE, i, argv[1], dotile, useppm, quiet);
|
||||
if(quiet) printf("\n");
|
||||
for(i=hiqual; i>=qual; i--)
|
||||
dotest(bmpbuf, w, h, pf, bu, TJ_420, i, argv[1], dotile, useppm, quiet);
|
||||
if(quiet) printf("\n");
|
||||
for(i=hiqual; i>=qual; i--)
|
||||
dotest(bmpbuf, w, h, pf, bu, TJ_422, i, argv[1], dotile, useppm, quiet);
|
||||
if(quiet) printf("\n");
|
||||
for(i=hiqual; i>=qual; i--)
|
||||
dotest(bmpbuf, w, h, pf, bu, TJ_444, i, argv[1], dotile, useppm, quiet);
|
||||
|
||||
if(bmpbuf) free(bmpbuf);
|
||||
return 0;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
* jquant1.c
|
||||
*
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* Copyright (C) 2009, D. R. Commander
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -193,7 +194,10 @@ select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
|
||||
int total_colors, iroot, i, j;
|
||||
boolean changed;
|
||||
long temp;
|
||||
static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
|
||||
int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
|
||||
RGB_order[0] = rgb_green[cinfo->out_color_space];
|
||||
RGB_order[1] = rgb_red[cinfo->out_color_space];
|
||||
RGB_order[2] = rgb_blue[cinfo->out_color_space];
|
||||
|
||||
/* We can allocate at least the nc'th root of max_colors per component. */
|
||||
/* Compute floor(nc'th root of max_colors). */
|
||||
|
||||
35
jquant2.c
35
jquant2.c
@@ -2,6 +2,7 @@
|
||||
* jquant2.c
|
||||
*
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* Copyright (C) 2009, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -74,29 +75,10 @@
|
||||
#define G_SCALE 3 /* scale G distances by this much */
|
||||
#define B_SCALE 1 /* and B by this much */
|
||||
|
||||
/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined
|
||||
* in jmorecfg.h. As the code stands, it will do the right thing for R,G,B
|
||||
* and B,G,R orders. If you define some other weird order in jmorecfg.h,
|
||||
* you'll get compile errors until you extend this logic. In that case
|
||||
* you'll probably want to tweak the histogram sizes too.
|
||||
*/
|
||||
|
||||
#if RGB_RED == 0
|
||||
#define C0_SCALE R_SCALE
|
||||
#endif
|
||||
#if RGB_BLUE == 0
|
||||
#define C0_SCALE B_SCALE
|
||||
#endif
|
||||
#if RGB_GREEN == 1
|
||||
#define C1_SCALE G_SCALE
|
||||
#endif
|
||||
#if RGB_RED == 2
|
||||
#define C2_SCALE R_SCALE
|
||||
#endif
|
||||
#if RGB_BLUE == 2
|
||||
#define C2_SCALE B_SCALE
|
||||
#endif
|
||||
|
||||
static const int c_scales[3]={R_SCALE, G_SCALE, B_SCALE};
|
||||
#define C0_SCALE c_scales[rgb_red[cinfo->out_color_space]]
|
||||
#define C1_SCALE c_scales[rgb_green[cinfo->out_color_space]]
|
||||
#define C2_SCALE c_scales[rgb_blue[cinfo->out_color_space]]
|
||||
|
||||
/*
|
||||
* First we have the histogram data structure and routines for creating it.
|
||||
@@ -454,15 +436,16 @@ median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
|
||||
/* We want to break any ties in favor of green, then red, blue last.
|
||||
* This code does the right thing for R,G,B or B,G,R color orders only.
|
||||
*/
|
||||
#if RGB_RED == 0
|
||||
if (rgb_red[cinfo->out_color_space] == 0) {
|
||||
cmax = c1; n = 1;
|
||||
if (c0 > cmax) { cmax = c0; n = 0; }
|
||||
if (c2 > cmax) { n = 2; }
|
||||
#else
|
||||
}
|
||||
else {
|
||||
cmax = c1; n = 1;
|
||||
if (c2 > cmax) { cmax = c2; n = 2; }
|
||||
if (c0 > cmax) { n = 0; }
|
||||
#endif
|
||||
}
|
||||
/* Choose split point along selected axis, and update box bounds.
|
||||
* Current algorithm: split at halfway point.
|
||||
* (Since the box has been shrunk to minimum volume,
|
||||
|
||||
89
jsimd.h
Normal file
89
jsimd.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* jsimd.h
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||
|
||||
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
||||
#define jsimd_can_rgb_ycc jSCanRgbYcc
|
||||
#define jsimd_can_ycc_rgb jSCanYccRgb
|
||||
#define jsimd_rgb_ycc_convert jSRgbYccConv
|
||||
#define jsimd_ycc_rgb_convert jSYccRgbConv
|
||||
#define jsimd_can_h2v2_downsample jSCanH2V2Down
|
||||
#define jsimd_can_h2v1_downsample jSCanH2V1Down
|
||||
#define jsimd_h2v2_downsample jSH2V2Down
|
||||
#define jsimd_h2v1_downsample jSH2V1Down
|
||||
#define jsimd_can_h2v2_upsample jSCanH2V2Up
|
||||
#define jsimd_can_h2v1_upsample jSCanH2V1Up
|
||||
#define jsimd_h2v2_upsample jSH2V2Up
|
||||
#define jsimd_h2v1_upsample jSH2V1Up
|
||||
#define jsimd_can_h2v2_fancy_upsample jSCanH2V2FUp
|
||||
#define jsimd_can_h2v1_fancy_upsample jSCanH2V1FUp
|
||||
#define jsimd_h2v2_fancy_upsample jSH2V2FUp
|
||||
#define jsimd_h2v1_fancy_upsample jSH2V1FUp
|
||||
#define jsimd_can_h2v2_merged_upsample jSCanH2V2MUp
|
||||
#define jsimd_can_h2v1_merged_upsample jSCanH2V1MUp
|
||||
#define jsimd_h2v2_merged_upsample jSH2V2MUp
|
||||
#define jsimd_h2v1_merged_upsample jSH2V1MUp
|
||||
#endif /* NEED_SHORT_EXTERNAL_NAMES */
|
||||
|
||||
EXTERN(int) jsimd_can_rgb_ycc JPP((void));
|
||||
EXTERN(int) jsimd_can_ycc_rgb JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_rgb_ycc_convert
|
||||
JPP((j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows));
|
||||
EXTERN(void) jsimd_ycc_rgb_convert
|
||||
JPP((j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows));
|
||||
|
||||
EXTERN(int) jsimd_can_h2v2_downsample JPP((void));
|
||||
EXTERN(int) jsimd_can_h2v1_downsample JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_h2v2_downsample
|
||||
JPP((j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data));
|
||||
EXTERN(void) jsimd_h2v1_downsample
|
||||
JPP((j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data));
|
||||
|
||||
EXTERN(int) jsimd_can_h2v2_upsample JPP((void));
|
||||
EXTERN(int) jsimd_can_h2v1_upsample JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_h2v2_upsample
|
||||
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
|
||||
EXTERN(void) jsimd_h2v1_upsample
|
||||
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
|
||||
|
||||
EXTERN(int) jsimd_can_h2v2_fancy_upsample JPP((void));
|
||||
EXTERN(int) jsimd_can_h2v1_fancy_upsample JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_h2v2_fancy_upsample
|
||||
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
|
||||
EXTERN(void) jsimd_h2v1_fancy_upsample
|
||||
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
|
||||
|
||||
EXTERN(int) jsimd_can_h2v2_merged_upsample JPP((void));
|
||||
EXTERN(int) jsimd_can_h2v1_merged_upsample JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_h2v2_merged_upsample
|
||||
JPP((j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf));
|
||||
EXTERN(void) jsimd_h2v1_merged_upsample
|
||||
JPP((j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf));
|
||||
|
||||
299
jsimd_none.c
Normal file
299
jsimd_none.c
Normal file
@@ -0,0 +1,299 @@
|
||||
/*
|
||||
* jsimd_none.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
*
|
||||
* This file contains stubs for when there is no SIMD support available.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
#include "jdct.h"
|
||||
#include "jsimddct.h"
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_rgb_ycc (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_downsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_upsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_upsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_fancy_upsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_fancy_upsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_merged_upsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_merged_upsample (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_convsamp (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_convsamp_float (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
DCTELEM * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
FAST_FLOAT * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_islow (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_ifast (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_float (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_islow (DCTELEM * data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_ifast (DCTELEM * data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_float (FAST_FLOAT * data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_quantize (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_quantize_float (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,
|
||||
DCTELEM * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,
|
||||
FAST_FLOAT * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_2x2 (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_4x4 (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_islow (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_ifast (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_float (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
|
||||
101
jsimddct.h
Normal file
101
jsimddct.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* jsimddct.h
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||
|
||||
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
||||
#define jsimd_can_convsamp jSCanConv
|
||||
#define jsimd_can_convsamp_float jSCanConvF
|
||||
#define jsimd_convsamp jSConv
|
||||
#define jsimd_convsamp_float jSConvF
|
||||
#define jsimd_can_fdct_islow jSCanFDCTIS
|
||||
#define jsimd_can_fdct_ifast jSCanFDCTIF
|
||||
#define jsimd_can_fdct_float jSCanFDCTFl
|
||||
#define jsimd_fdct_islow jSFDCTIS
|
||||
#define jsimd_fdct_ifast jSFDCTIF
|
||||
#define jsimd_fdct_float jSFDCTFl
|
||||
#define jsimd_can_quantize jSCanQuant
|
||||
#define jsimd_can_quantize_float jSCanQuantF
|
||||
#define jsimd_quantize jSQuant
|
||||
#define jsimd_quantize_float jSQuantF
|
||||
#define jsimd_can_idct_2x2 jSCanIDCT22
|
||||
#define jsimd_can_idct_4x4 jSCanIDCT44
|
||||
#define jsimd_idct_2x2 jSIDCT22
|
||||
#define jsimd_idct_4x4 jSIDCT44
|
||||
#define jsimd_can_idct_islow jSCanIDCTIS
|
||||
#define jsimd_can_idct_ifast jSCanIDCTIF
|
||||
#define jsimd_can_idct_float jSCanIDCTFl
|
||||
#define jsimd_idct_islow jSIDCTIS
|
||||
#define jsimd_idct_ifast jSIDCTIF
|
||||
#define jsimd_idct_float jSIDCTFl
|
||||
#endif /* NEED_SHORT_EXTERNAL_NAMES */
|
||||
|
||||
EXTERN(int) jsimd_can_convsamp JPP((void));
|
||||
EXTERN(int) jsimd_can_convsamp_float JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_convsamp JPP((JSAMPARRAY sample_data,
|
||||
JDIMENSION start_col,
|
||||
DCTELEM * workspace));
|
||||
EXTERN(void) jsimd_convsamp_float JPP((JSAMPARRAY sample_data,
|
||||
JDIMENSION start_col,
|
||||
FAST_FLOAT * workspace));
|
||||
|
||||
EXTERN(int) jsimd_can_fdct_islow JPP((void));
|
||||
EXTERN(int) jsimd_can_fdct_ifast JPP((void));
|
||||
EXTERN(int) jsimd_can_fdct_float JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_fdct_islow JPP((DCTELEM * data));
|
||||
EXTERN(void) jsimd_fdct_ifast JPP((DCTELEM * data));
|
||||
EXTERN(void) jsimd_fdct_float JPP((FAST_FLOAT * data));
|
||||
|
||||
EXTERN(int) jsimd_can_quantize JPP((void));
|
||||
EXTERN(int) jsimd_can_quantize_float JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_quantize JPP((JCOEFPTR coef_block,
|
||||
DCTELEM * divisors,
|
||||
DCTELEM * workspace));
|
||||
EXTERN(void) jsimd_quantize_float JPP((JCOEFPTR coef_block,
|
||||
FAST_FLOAT * divisors,
|
||||
FAST_FLOAT * workspace));
|
||||
|
||||
EXTERN(int) jsimd_can_idct_2x2 JPP((void));
|
||||
EXTERN(int) jsimd_can_idct_4x4 JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_idct_2x2 JPP((j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col));
|
||||
EXTERN(void) jsimd_idct_4x4 JPP((j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col));
|
||||
|
||||
EXTERN(int) jsimd_can_idct_islow JPP((void));
|
||||
EXTERN(int) jsimd_can_idct_ifast JPP((void));
|
||||
EXTERN(int) jsimd_can_idct_float JPP((void));
|
||||
|
||||
EXTERN(void) jsimd_idct_islow JPP((j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col));
|
||||
EXTERN(void) jsimd_idct_ifast JPP((j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col));
|
||||
EXTERN(void) jsimd_idct_float JPP((j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col));
|
||||
|
||||
4
jutils.c
4
jutils.c
@@ -77,8 +77,8 @@ jdiv_round_up (long a, long b)
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(long)
|
||||
jround_up (long a, long b)
|
||||
GLOBAL(size_t)
|
||||
jround_up (size_t a, size_t b)
|
||||
/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
|
||||
/* Assumes a >= 0, b > 0 */
|
||||
{
|
||||
|
||||
38
makcjpeg.st
38
makcjpeg.st
@@ -1,38 +0,0 @@
|
||||
; Project file for Independent JPEG Group's software
|
||||
;
|
||||
; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
|
||||
; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de),
|
||||
; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de),
|
||||
; and Guido Vollbeding (guivol@esc.de).
|
||||
;
|
||||
; To use this file, rename it to cjpeg.prj.
|
||||
; If you are using Turbo C, change filenames beginning with "pc..." to "tc..."
|
||||
; Read installation instructions before trying to make the program!
|
||||
;
|
||||
;
|
||||
; * * * Output file * * *
|
||||
cjpeg.ttp
|
||||
;
|
||||
; * * * COMPILER OPTIONS * * *
|
||||
.C[-P] ; absolute calls
|
||||
.C[-M] ; and no string merging, folks
|
||||
.C[-w-cln] ; no "constant is long" warnings
|
||||
.C[-w-par] ; no "parameter xxxx unused"
|
||||
.C[-w-rch] ; no "unreachable code"
|
||||
.C[-wsig] ; warn if significant digits may be lost
|
||||
=
|
||||
; * * * * List of modules * * * *
|
||||
pcstart.o
|
||||
cjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h)
|
||||
cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
libjpeg.lib ; built by libjpeg.prj
|
||||
pcfltlib.lib ; floating point library
|
||||
; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED
|
||||
pcstdlib.lib ; standard library
|
||||
pcextlib.lib ; extended library
|
||||
38
makdjpeg.st
38
makdjpeg.st
@@ -1,38 +0,0 @@
|
||||
; Project file for Independent JPEG Group's software
|
||||
;
|
||||
; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
|
||||
; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de),
|
||||
; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de),
|
||||
; and Guido Vollbeding (guivol@esc.de).
|
||||
;
|
||||
; To use this file, rename it to djpeg.prj.
|
||||
; If you are using Turbo C, change filenames beginning with "pc..." to "tc..."
|
||||
; Read installation instructions before trying to make the program!
|
||||
;
|
||||
;
|
||||
; * * * Output file * * *
|
||||
djpeg.ttp
|
||||
;
|
||||
; * * * COMPILER OPTIONS * * *
|
||||
.C[-P] ; absolute calls
|
||||
.C[-M] ; and no string merging, folks
|
||||
.C[-w-cln] ; no "constant is long" warnings
|
||||
.C[-w-par] ; no "parameter xxxx unused"
|
||||
.C[-w-rch] ; no "unreachable code"
|
||||
.C[-wsig] ; warn if significant digits may be lost
|
||||
=
|
||||
; * * * * List of modules * * * *
|
||||
pcstart.o
|
||||
djpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h)
|
||||
cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdcolmap.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
wrppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
wrgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
wrtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
wrbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
wrrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
libjpeg.lib ; built by libjpeg.prj
|
||||
pcfltlib.lib ; floating point library
|
||||
; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED
|
||||
pcstdlib.lib ; standard library
|
||||
pcextlib.lib ; extended library
|
||||
828
makeapps.ds
828
makeapps.ds
@@ -1,828 +0,0 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=cjpeg - Win32
|
||||
!MESSAGE No configuration specified. Defaulting to cjpeg - Win32.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "cjpeg - Win32" && "$(CFG)" != "djpeg - Win32" &&\
|
||||
"$(CFG)" != "jpegtran - Win32" && "$(CFG)" != "rdjpgcom - Win32" &&\
|
||||
"$(CFG)" != "wrjpgcom - Win32"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "apps.mak" CFG="cjpeg - Win32"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "cjpeg - Win32" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "djpeg - Win32" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "jpegtran - Win32" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "rdjpgcom - Win32" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wrjpgcom - Win32" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "cjpeg - Win32"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "cjpeg - Win32"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "cjpeg\Release"
|
||||
# PROP BASE Intermediate_Dir "cjpeg\Release"
|
||||
# PROP BASE Target_Dir "cjpeg"
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "cjpeg\Release"
|
||||
# PROP Intermediate_Dir "cjpeg\Release"
|
||||
# PROP Target_Dir "cjpeg"
|
||||
OUTDIR=.\cjpeg\Release
|
||||
INTDIR=.\cjpeg\Release
|
||||
|
||||
ALL : "$(OUTDIR)\cjpeg.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cjpeg.obj"
|
||||
-@erase "$(INTDIR)\rdppm.obj"
|
||||
-@erase "$(INTDIR)\rdgif.obj"
|
||||
-@erase "$(INTDIR)\rdtarga.obj"
|
||||
-@erase "$(INTDIR)\rdrle.obj"
|
||||
-@erase "$(INTDIR)\rdbmp.obj"
|
||||
-@erase "$(INTDIR)\rdswitch.obj"
|
||||
-@erase "$(INTDIR)\cdjpeg.obj"
|
||||
-@erase "$(OUTDIR)\cjpeg.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
|
||||
/Fp"$(INTDIR)/cjpeg.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\cjpeg\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/cjpeg.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 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 /nologo /subsystem:console /machine:I386
|
||||
LINK32_FLAGS=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 /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)/cjpeg.pdb" /machine:I386 /out:"$(OUTDIR)/cjpeg.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cjpeg.obj" \
|
||||
"$(INTDIR)\rdppm.obj" \
|
||||
"$(INTDIR)\rdgif.obj" \
|
||||
"$(INTDIR)\rdtarga.obj" \
|
||||
"$(INTDIR)\rdrle.obj" \
|
||||
"$(INTDIR)\rdbmp.obj" \
|
||||
"$(INTDIR)\rdswitch.obj" \
|
||||
"$(INTDIR)\cdjpeg.obj" \
|
||||
|
||||
|
||||
"$(OUTDIR)\cjpeg.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "djpeg - Win32"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "djpeg\Release"
|
||||
# PROP BASE Intermediate_Dir "djpeg\Release"
|
||||
# PROP BASE Target_Dir "djpeg"
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "djpeg\Release"
|
||||
# PROP Intermediate_Dir "djpeg\Release"
|
||||
# PROP Target_Dir "djpeg"
|
||||
OUTDIR=.\djpeg\Release
|
||||
INTDIR=.\djpeg\Release
|
||||
|
||||
ALL : "$(OUTDIR)\djpeg.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\djpeg.obj"
|
||||
-@erase "$(INTDIR)\wrppm.obj"
|
||||
-@erase "$(INTDIR)\wrgif.obj"
|
||||
-@erase "$(INTDIR)\wrtarga.obj"
|
||||
-@erase "$(INTDIR)\wrrle.obj"
|
||||
-@erase "$(INTDIR)\wrbmp.obj"
|
||||
-@erase "$(INTDIR)\rdcolmap.obj"
|
||||
-@erase "$(INTDIR)\cdjpeg.obj"
|
||||
-@erase "$(OUTDIR)\djpeg.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
|
||||
/Fp"$(INTDIR)/djpeg.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\djpeg\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/djpeg.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 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 /nologo /subsystem:console /machine:I386
|
||||
LINK32_FLAGS=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 /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)/djpeg.pdb" /machine:I386 /out:"$(OUTDIR)/djpeg.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\djpeg.obj" \
|
||||
"$(INTDIR)\wrppm.obj" \
|
||||
"$(INTDIR)\wrgif.obj" \
|
||||
"$(INTDIR)\wrtarga.obj" \
|
||||
"$(INTDIR)\wrrle.obj" \
|
||||
"$(INTDIR)\wrbmp.obj" \
|
||||
"$(INTDIR)\rdcolmap.obj" \
|
||||
"$(INTDIR)\cdjpeg.obj" \
|
||||
|
||||
|
||||
"$(OUTDIR)\djpeg.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "jpegtran - Win32"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "jpegtran\Release"
|
||||
# PROP BASE Intermediate_Dir "jpegtran\Release"
|
||||
# PROP BASE Target_Dir "jpegtran"
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "jpegtran\Release"
|
||||
# PROP Intermediate_Dir "jpegtran\Release"
|
||||
# PROP Target_Dir "jpegtran"
|
||||
OUTDIR=.\jpegtran\Release
|
||||
INTDIR=.\jpegtran\Release
|
||||
|
||||
ALL : "$(OUTDIR)\jpegtran.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\jpegtran.obj"
|
||||
-@erase "$(INTDIR)\rdswitch.obj"
|
||||
-@erase "$(INTDIR)\cdjpeg.obj"
|
||||
-@erase "$(INTDIR)\transupp.obj"
|
||||
-@erase "$(OUTDIR)\jpegtran.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
|
||||
/Fp"$(INTDIR)/jpegtran.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\jpegtran\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/jpegtran.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 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 /nologo /subsystem:console /machine:I386
|
||||
LINK32_FLAGS=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 /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)/jpegtran.pdb" /machine:I386 /out:"$(OUTDIR)/jpegtran.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\jpegtran.obj" \
|
||||
"$(INTDIR)\rdswitch.obj" \
|
||||
"$(INTDIR)\cdjpeg.obj" \
|
||||
"$(INTDIR)\transupp.obj" \
|
||||
|
||||
|
||||
"$(OUTDIR)\jpegtran.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "rdjpgcom - Win32"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "rdjpgcom\Release"
|
||||
# PROP BASE Intermediate_Dir "rdjpgcom\Release"
|
||||
# PROP BASE Target_Dir "rdjpgcom"
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "rdjpgcom\Release"
|
||||
# PROP Intermediate_Dir "rdjpgcom\Release"
|
||||
# PROP Target_Dir "rdjpgcom"
|
||||
OUTDIR=.\rdjpgcom\Release
|
||||
INTDIR=.\rdjpgcom\Release
|
||||
|
||||
ALL : "$(OUTDIR)\rdjpgcom.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\rdjpgcom.obj"
|
||||
-@erase "$(OUTDIR)\rdjpgcom.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
|
||||
/Fp"$(INTDIR)/rdjpgcom.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\rdjpgcom\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/rdjpgcom.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 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 /nologo /subsystem:console /machine:I386
|
||||
LINK32_FLAGS=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 /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)/rdjpgcom.pdb" /machine:I386 /out:"$(OUTDIR)/rdjpgcom.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\rdjpgcom.obj"
|
||||
|
||||
"$(OUTDIR)\rdjpgcom.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "wrjpgcom - Win32"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "wrjpgcom\Release"
|
||||
# PROP BASE Intermediate_Dir "wrjpgcom\Release"
|
||||
# PROP BASE Target_Dir "wrjpgcom"
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "wrjpgcom\Release"
|
||||
# PROP Intermediate_Dir "wrjpgcom\Release"
|
||||
# PROP Target_Dir "wrjpgcom"
|
||||
OUTDIR=.\wrjpgcom\Release
|
||||
INTDIR=.\wrjpgcom\Release
|
||||
|
||||
ALL : "$(OUTDIR)\wrjpgcom.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\wrjpgcom.obj"
|
||||
-@erase "$(OUTDIR)\wrjpgcom.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\
|
||||
/Fp"$(INTDIR)/wrjpgcom.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\wrjpgcom\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/wrjpgcom.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 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 /nologo /subsystem:console /machine:I386
|
||||
LINK32_FLAGS=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 /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)/wrjpgcom.pdb" /machine:I386 /out:"$(OUTDIR)/wrjpgcom.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\wrjpgcom.obj"
|
||||
|
||||
"$(OUTDIR)\wrjpgcom.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "cjpeg - Win32"
|
||||
|
||||
!IF "$(CFG)" == "cjpeg - Win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="cjpeg.c"
|
||||
DEP_CPP_CJPEG=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
"jversion.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cjpeg.obj" : $(SOURCE) $(DEP_CPP_CJPEG) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="cdjpeg.c"
|
||||
DEP_CPP_CDJPE=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cdjpeg.obj" : $(SOURCE) $(DEP_CPP_CDJPE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdswitch.c"
|
||||
DEP_CPP_RDSWI=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdswitch.obj" : $(SOURCE) $(DEP_CPP_RDSWI) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdppm.c"
|
||||
DEP_CPP_RDPPM=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdppm.obj" : $(SOURCE) $(DEP_CPP_RDPPM) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdgif.c"
|
||||
DEP_CPP_RDGIF=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdgif.obj" : $(SOURCE) $(DEP_CPP_RDGIF) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdtarga.c"
|
||||
DEP_CPP_RDTAR=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdtarga.obj" : $(SOURCE) $(DEP_CPP_RDTAR) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdbmp.c"
|
||||
DEP_CPP_RDBMP=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdbmp.obj" : $(SOURCE) $(DEP_CPP_RDBMP) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdrle.c"
|
||||
DEP_CPP_RDRLE=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdrle.obj" : $(SOURCE) $(DEP_CPP_RDRLE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "djpeg - Win32"
|
||||
|
||||
!IF "$(CFG)" == "djpeg - Win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="djpeg.c"
|
||||
DEP_CPP_DJPEG=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
"jversion.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\djpeg.obj" : $(SOURCE) $(DEP_CPP_DJPEG) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="cdjpeg.c"
|
||||
DEP_CPP_CDJPE=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cdjpeg.obj" : $(SOURCE) $(DEP_CPP_CDJPE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdcolmap.c"
|
||||
DEP_CPP_RDCOL=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdcolmap.obj" : $(SOURCE) $(DEP_CPP_RDCOL) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="wrppm.c"
|
||||
DEP_CPP_WRPPM=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\wrppm.obj" : $(SOURCE) $(DEP_CPP_WRPPM) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="wrgif.c"
|
||||
DEP_CPP_WRGIF=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\wrgif.obj" : $(SOURCE) $(DEP_CPP_WRGIF) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="wrtarga.c"
|
||||
DEP_CPP_WRTAR=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\wrtarga.obj" : $(SOURCE) $(DEP_CPP_WRTAR) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="wrbmp.c"
|
||||
DEP_CPP_WRBMP=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\wrbmp.obj" : $(SOURCE) $(DEP_CPP_WRBMP) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="wrrle.c"
|
||||
DEP_CPP_WRRLE=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\wrrle.obj" : $(SOURCE) $(DEP_CPP_WRRLE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "jpegtran - Win32"
|
||||
|
||||
!IF "$(CFG)" == "jpegtran - Win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="jpegtran.c"
|
||||
DEP_CPP_JPEGT=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
"transupp.h"\
|
||||
"jversion.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\jpegtran.obj" : $(SOURCE) $(DEP_CPP_JPEGT) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="cdjpeg.c"
|
||||
DEP_CPP_CDJPE=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cdjpeg.obj" : $(SOURCE) $(DEP_CPP_CDJPE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdswitch.c"
|
||||
DEP_CPP_RDSWI=\
|
||||
"cdjpeg.h"\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jerror.h"\
|
||||
"cderror.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdswitch.obj" : $(SOURCE) $(DEP_CPP_RDSWI) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="transupp.c"
|
||||
DEP_CPP_TRANS=\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
"jpeglib.h"\
|
||||
"jmorecfg.h"\
|
||||
"jpegint.h"\
|
||||
"jerror.h"\
|
||||
"transupp.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\transupp.obj" : $(SOURCE) $(DEP_CPP_TRANS) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "rdjpgcom - Win32"
|
||||
|
||||
!IF "$(CFG)" == "rdjpgcom - Win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="rdjpgcom.c"
|
||||
DEP_CPP_RDJPG=\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\rdjpgcom.obj" : $(SOURCE) $(DEP_CPP_RDJPG) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "wrjpgcom - Win32"
|
||||
|
||||
!IF "$(CFG)" == "wrjpgcom - Win32"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="wrjpgcom.c"
|
||||
DEP_CPP_WRJPG=\
|
||||
"jinclude.h"\
|
||||
"jconfig.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\wrjpgcom.obj" : $(SOURCE) $(DEP_CPP_WRJPG) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
|
||||
214
makefile.ansi
214
makefile.ansi
@@ -1,214 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is suitable for Unix-like systems with ANSI-capable compilers.
|
||||
# If you have a non-ANSI compiler, makefile.unix is a better starting point.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= cc
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
CFLAGS= -O
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via -D switches here.
|
||||
|
||||
# Link-time cc options:
|
||||
LDFLAGS=
|
||||
|
||||
# To link any special libraries, add the necessary -l commands here.
|
||||
LDLIBS=
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For Unix this is usually jmemnobs.o, but you may want
|
||||
# to use jmemansi.o or jmemname.o if you have limited swap space.
|
||||
SYSDEPMEM= jmemnobs.o
|
||||
|
||||
# miscellaneous OS-dependent stuff
|
||||
# linker
|
||||
LN= $(CC)
|
||||
# file deletion command
|
||||
RM= rm -f
|
||||
# library (.a) file creation command
|
||||
AR= ar rc
|
||||
# second step in .a creation (use "touch" if not needed)
|
||||
AR2= ranlib
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o \
|
||||
jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o \
|
||||
jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o \
|
||||
jfdctint.o
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o \
|
||||
jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o \
|
||||
jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
|
||||
jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
|
||||
# These objectfiles are included in libjpeg.a
|
||||
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
|
||||
# object files for sample applications (excluding library files)
|
||||
COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
|
||||
cdjpeg.o
|
||||
DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
|
||||
cdjpeg.o
|
||||
TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
|
||||
|
||||
|
||||
all: libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
|
||||
libjpeg.a: $(LIBOBJECTS)
|
||||
$(RM) libjpeg.a
|
||||
$(AR) libjpeg.a $(LIBOBJECTS)
|
||||
$(AR2) libjpeg.a
|
||||
|
||||
cjpeg: $(COBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
djpeg: $(DOBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
jpegtran: $(TROBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
rdjpgcom: rdjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
|
||||
|
||||
wrjpgcom: wrjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
clean:
|
||||
$(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom
|
||||
$(RM) core testout*
|
||||
|
||||
test: cjpeg djpeg jpegtran
|
||||
$(RM) testout*
|
||||
./djpeg -dct int -ppm -outfile testout.ppm 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
|
||||
cmp testimg.ppm testout.ppm
|
||||
cmp testimg.bmp testout.bmp
|
||||
cmp testimg.jpg testout.jpg
|
||||
cmp testimg.ppm testoutp.ppm
|
||||
cmp testimgp.jpg testoutp.jpg
|
||||
cmp testorig.jpg testoutt.jpg
|
||||
|
||||
|
||||
jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcphuff.o: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdphuff.o: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
|
||||
jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctred.o: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
|
||||
rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
|
||||
wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
|
||||
cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
|
||||
rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
285
makefile.bcc
285
makefile.bcc
@@ -1,285 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is suitable for Borland C on MS-DOS or OS/2.
|
||||
# It works with Borland C++ for DOS, revision 3.0 or later,
|
||||
# and has been tested with Borland C++ for OS/2.
|
||||
# Watch out for optimization bugs in the OS/2 compilers --- see notes below!
|
||||
# Thanks to Tom Wright and Ge' Weijers (original DOS) and
|
||||
# Ken Porter (OS/2) for this file.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# Are we under DOS or OS/2?
|
||||
!if !$d(DOS) && !$d(OS2)
|
||||
!if $d(__OS2__)
|
||||
OS2=1
|
||||
!else
|
||||
DOS=1
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= bcc
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
!if $d(DOS)
|
||||
CFLAGS= -O2 -mm -w-par -w-stu -w-ccc -w-rch
|
||||
!else
|
||||
CFLAGS= -O1 -w-par -w-stu -w-ccc -w-rch
|
||||
!endif
|
||||
# -O2 enables full code optimization (for pre-3.0 Borland C++, use -O -G -Z).
|
||||
# -O2 is buggy in Borland OS/2 C++ revision 2.0, so use -O1 there for now.
|
||||
# If you have Borland OS/2 C++ revision 1.0, use -O or no optimization at all.
|
||||
# -mm selects medium memory model (near data, far code pointers; DOS only!)
|
||||
# -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:
|
||||
!if $d(DOS)
|
||||
LDFLAGS= -mm
|
||||
# memory model option here must match CFLAGS!
|
||||
!else
|
||||
LDFLAGS=
|
||||
# -lai full-screen app
|
||||
# -lc case-significant link
|
||||
!endif
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file.
|
||||
# For DOS, we recommend jmemdos.c and jmemdosa.asm.
|
||||
# For OS/2, we recommend jmemnobs.c (flat memory!)
|
||||
# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
|
||||
!if $d(DOS)
|
||||
SYSDEPMEM= jmemdos.obj jmemdosa.obj
|
||||
SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj
|
||||
!else
|
||||
SYSDEPMEM= jmemnobs.obj
|
||||
SYSDEPMEMLIB= +jmemnobs.obj
|
||||
!endif
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.obj jcapistd.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 jcphuff.obj \
|
||||
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdtrans.obj jdatasrc.obj \
|
||||
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdphuff.obj \
|
||||
jdmainct.obj jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj \
|
||||
jidctflt.obj jidctint.obj jidctred.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 +jctrans.obj +jcparam.obj +jdatadst.obj &
|
||||
+jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj +jcprepct.obj &
|
||||
+jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj +jcphuff.obj &
|
||||
+jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj &
|
||||
+jdapistd.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj +jdinput.obj &
|
||||
+jdmarker.obj +jdhuff.obj +jdphuff.obj +jdmainct.obj +jdcoefct.obj &
|
||||
+jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj &
|
||||
+jidctred.obj +jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj &
|
||||
+jdmerge.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
|
||||
!if $d(DOS)
|
||||
$(CC) -ms -O rdjpgcom.c
|
||||
!else
|
||||
$(CC) $(CFLAGS) rdjpgcom.c
|
||||
!endif
|
||||
|
||||
# On DOS, wrjpgcom needs large model so it can malloc a 64K chunk
|
||||
wrjpgcom.exe: wrjpgcom.c
|
||||
!if $d(DOS)
|
||||
$(CC) -ml -O wrjpgcom.c
|
||||
!else
|
||||
$(CC) $(CFLAGS) wrjpgcom.c
|
||||
!endif
|
||||
|
||||
# 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.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
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 -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
|
||||
!if $d(DOS)
|
||||
fc /b testimg.ppm testout.ppm
|
||||
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
|
||||
!else
|
||||
echo n > n.tmp
|
||||
comp testimg.ppm testout.ppm < 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
|
||||
!endif
|
||||
|
||||
|
||||
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
|
||||
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 jchuff.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
|
||||
jcphuff.obj: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.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
|
||||
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 jdhuff.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
|
||||
jdphuff.obj: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.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
|
||||
jidctred.obj: jidctred.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
|
||||
319
makefile.cfg
319
makefile.cfg
@@ -1,319 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# makefile.cfg is edited by configure to produce a custom Makefile.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# For compiling with source and object files in different directories.
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
# Where to install the programs and man pages.
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = $(exec_prefix)/bin
|
||||
libdir = $(exec_prefix)/lib
|
||||
includedir = $(prefix)/include
|
||||
binprefix =
|
||||
manprefix =
|
||||
manext = 1
|
||||
mandir = $(prefix)/man/man$(manext)
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= @CC@
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
CFLAGS= @CFLAGS@ @CPPFLAGS@ @INCLUDEFLAGS@
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via -D switches here.
|
||||
# However, any special defines for ansi2knr.c may be included here:
|
||||
ANSI2KNRFLAGS= @ANSI2KNRFLAGS@
|
||||
|
||||
# Link-time cc options:
|
||||
LDFLAGS= @LDFLAGS@
|
||||
|
||||
# To link any special libraries, add the necessary -l commands here.
|
||||
LDLIBS= @LIBS@
|
||||
|
||||
# If using GNU libtool, LIBTOOL references it; if not, LIBTOOL is empty.
|
||||
LIBTOOL = @LIBTOOL@
|
||||
# $(O) expands to "lo" if using libtool, plain "o" if not.
|
||||
# Similarly, $(A) expands to "la" or "a".
|
||||
O = @O@
|
||||
A = @A@
|
||||
|
||||
# Library version ID; libtool uses this for the shared library version number.
|
||||
# Note: we suggest this match the macro of the same name in jpeglib.h.
|
||||
JPEG_LIB_VERSION = @JPEG_LIB_VERSION@
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For Unix this is usually jmemnobs.o, but you may want
|
||||
# to use jmemansi.o or jmemname.o if you have limited swap space.
|
||||
SYSDEPMEM= @MEMORYMGR@
|
||||
|
||||
# miscellaneous OS-dependent stuff
|
||||
SHELL= /bin/sh
|
||||
# linker
|
||||
LN= @LN@
|
||||
# file deletion command
|
||||
RM= rm -f
|
||||
# directory creation command
|
||||
MKDIR= mkdir
|
||||
# library (.a) file creation command
|
||||
AR= ar rc
|
||||
# second step in .a creation (use "touch" if not needed)
|
||||
AR2= @RANLIB@
|
||||
# installation program
|
||||
INSTALL= @INSTALL@
|
||||
INSTALL_PROGRAM= @INSTALL_PROGRAM@
|
||||
INSTALL_LIB= @INSTALL_LIB@
|
||||
INSTALL_DATA= @INSTALL_DATA@
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.$(O) jutils.$(O) jerror.$(O) jmemmgr.$(O) $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.$(O) jcapistd.$(O) jctrans.$(O) jcparam.$(O) \
|
||||
jdatadst.$(O) jcinit.$(O) jcmaster.$(O) jcmarker.$(O) jcmainct.$(O) \
|
||||
jcprepct.$(O) jccoefct.$(O) jccolor.$(O) jcsample.$(O) jchuff.$(O) \
|
||||
jcphuff.$(O) jcdctmgr.$(O) jfdctfst.$(O) jfdctflt.$(O) \
|
||||
jfdctint.$(O)
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.$(O) jdapistd.$(O) jdtrans.$(O) jdatasrc.$(O) \
|
||||
jdmaster.$(O) jdinput.$(O) jdmarker.$(O) jdhuff.$(O) jdphuff.$(O) \
|
||||
jdmainct.$(O) jdcoefct.$(O) jdpostct.$(O) jddctmgr.$(O) \
|
||||
jidctfst.$(O) jidctflt.$(O) jidctint.$(O) jidctred.$(O) \
|
||||
jdsample.$(O) jdcolor.$(O) jquant1.$(O) jquant2.$(O) jdmerge.$(O)
|
||||
# These objectfiles are included in libjpeg.a
|
||||
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
|
||||
# object files for sample applications (excluding library files)
|
||||
COBJECTS= cjpeg.$(O) rdppm.$(O) rdgif.$(O) rdtarga.$(O) rdrle.$(O) \
|
||||
rdbmp.$(O) rdswitch.$(O) cdjpeg.$(O)
|
||||
DOBJECTS= djpeg.$(O) wrppm.$(O) wrgif.$(O) wrtarga.$(O) wrrle.$(O) \
|
||||
wrbmp.$(O) rdcolmap.$(O) cdjpeg.$(O)
|
||||
TROBJECTS= jpegtran.$(O) rdswitch.$(O) cdjpeg.$(O) transupp.$(O)
|
||||
|
||||
|
||||
all: @A2K_DEPS@ libjpeg.$(A) cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
|
||||
# Special compilation rules to support ansi2knr and libtool.
|
||||
.SUFFIXES: .lo .la
|
||||
|
||||
# How to compile with libtool.
|
||||
@COM_LT@.c.lo:
|
||||
@COM_LT@ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$*.c
|
||||
|
||||
# How to use ansi2knr, when not using libtool.
|
||||
@COM_A2K@.c.o:
|
||||
@COM_A2K@ ./ansi2knr $(srcdir)/$*.c knr/$*.c
|
||||
@COM_A2K@ $(CC) $(CFLAGS) -c knr/$*.c
|
||||
@COM_A2K@ $(RM) knr/$*.c
|
||||
|
||||
# How to use ansi2knr AND libtool.
|
||||
@COM_A2K@.c.lo:
|
||||
@COM_A2K@ ./ansi2knr $(srcdir)/$*.c knr/$*.c
|
||||
@COM_A2K@ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c knr/$*.c
|
||||
@COM_A2K@ $(RM) knr/$*.c
|
||||
|
||||
ansi2knr: ansi2knr.c
|
||||
$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr $(srcdir)/ansi2knr.c
|
||||
$(MKDIR) knr
|
||||
|
||||
# the library:
|
||||
|
||||
# without libtool:
|
||||
libjpeg.a: @A2K_DEPS@ $(LIBOBJECTS)
|
||||
$(RM) libjpeg.a
|
||||
$(AR) libjpeg.a $(LIBOBJECTS)
|
||||
$(AR2) libjpeg.a
|
||||
|
||||
# with libtool:
|
||||
libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
|
||||
$(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
|
||||
-rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
|
||||
|
||||
# sample programs:
|
||||
|
||||
cjpeg: $(COBJECTS) libjpeg.$(A)
|
||||
$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.$(A) $(LDLIBS)
|
||||
|
||||
djpeg: $(DOBJECTS) libjpeg.$(A)
|
||||
$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.$(A) $(LDLIBS)
|
||||
|
||||
jpegtran: $(TROBJECTS) libjpeg.$(A)
|
||||
$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.$(A) $(LDLIBS)
|
||||
|
||||
rdjpgcom: rdjpgcom.$(O)
|
||||
$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.$(O) $(LDLIBS)
|
||||
|
||||
wrjpgcom: wrjpgcom.$(O)
|
||||
$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.$(O) $(LDLIBS)
|
||||
|
||||
# Installation rules:
|
||||
|
||||
install: cjpeg djpeg jpegtran rdjpgcom wrjpgcom @FORCE_INSTALL_LIB@
|
||||
$(INSTALL_PROGRAM) cjpeg $(bindir)/$(binprefix)cjpeg
|
||||
$(INSTALL_PROGRAM) djpeg $(bindir)/$(binprefix)djpeg
|
||||
$(INSTALL_PROGRAM) jpegtran $(bindir)/$(binprefix)jpegtran
|
||||
$(INSTALL_PROGRAM) rdjpgcom $(bindir)/$(binprefix)rdjpgcom
|
||||
$(INSTALL_PROGRAM) wrjpgcom $(bindir)/$(binprefix)wrjpgcom
|
||||
$(INSTALL_DATA) $(srcdir)/cjpeg.1 $(mandir)/$(manprefix)cjpeg.$(manext)
|
||||
$(INSTALL_DATA) $(srcdir)/djpeg.1 $(mandir)/$(manprefix)djpeg.$(manext)
|
||||
$(INSTALL_DATA) $(srcdir)/jpegtran.1 $(mandir)/$(manprefix)jpegtran.$(manext)
|
||||
$(INSTALL_DATA) $(srcdir)/rdjpgcom.1 $(mandir)/$(manprefix)rdjpgcom.$(manext)
|
||||
$(INSTALL_DATA) $(srcdir)/wrjpgcom.1 $(mandir)/$(manprefix)wrjpgcom.$(manext)
|
||||
|
||||
install-lib: libjpeg.$(A) install-headers
|
||||
$(INSTALL_LIB) libjpeg.$(A) $(libdir)/$(binprefix)libjpeg.$(A)
|
||||
|
||||
install-headers: jconfig.h
|
||||
$(INSTALL_DATA) jconfig.h $(includedir)/jconfig.h
|
||||
$(INSTALL_DATA) $(srcdir)/jpeglib.h $(includedir)/jpeglib.h
|
||||
$(INSTALL_DATA) $(srcdir)/jmorecfg.h $(includedir)/jmorecfg.h
|
||||
$(INSTALL_DATA) $(srcdir)/jerror.h $(includedir)/jerror.h
|
||||
|
||||
clean:
|
||||
$(RM) *.o *.lo libjpeg.a libjpeg.la
|
||||
$(RM) cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
$(RM) ansi2knr core testout* config.log config.status
|
||||
$(RM) -r knr .libs _libs
|
||||
|
||||
distclean: clean
|
||||
$(RM) Makefile jconfig.h libtool config.cache
|
||||
|
||||
test: cjpeg djpeg jpegtran
|
||||
$(RM) testout*
|
||||
./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
|
||||
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
|
||||
./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
|
||||
./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
|
||||
./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
|
||||
./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
|
||||
cmp $(srcdir)/testimg.ppm testout.ppm
|
||||
cmp $(srcdir)/testimg.bmp testout.bmp
|
||||
cmp $(srcdir)/testimg.jpg testout.jpg
|
||||
cmp $(srcdir)/testimg.ppm testoutp.ppm
|
||||
cmp $(srcdir)/testimgp.jpg testoutp.jpg
|
||||
cmp $(srcdir)/testorig.jpg testoutt.jpg
|
||||
|
||||
check: test
|
||||
|
||||
# Mistake catcher:
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
# GNU Make likes to know which target names are not really files to be made:
|
||||
.PHONY: all install install-lib install-headers clean distclean test check
|
||||
|
||||
|
||||
jcapimin.$(O): jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcapistd.$(O): jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccoefct.$(O): jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccolor.$(O): jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcdctmgr.$(O): jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jchuff.$(O): jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcinit.$(O): jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmainct.$(O): jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmarker.$(O): jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmaster.$(O): jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcomapi.$(O): jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcparam.$(O): jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcphuff.$(O): jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcprepct.$(O): jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcsample.$(O): jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jctrans.$(O): jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapimin.$(O): jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapistd.$(O): jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdatadst.$(O): jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdatasrc.$(O): jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdcoefct.$(O): jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdcolor.$(O): jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jddctmgr.$(O): jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jdhuff.$(O): jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdinput.$(O): jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmainct.$(O): jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmarker.$(O): jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmaster.$(O): jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmerge.$(O): jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdphuff.$(O): jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdpostct.$(O): jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdsample.$(O): jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdtrans.$(O): jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jerror.$(O): jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
|
||||
jfdctflt.$(O): jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctfst.$(O): jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctint.$(O): jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctflt.$(O): jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctfst.$(O): jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctint.$(O): jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctred.$(O): jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jquant1.$(O): jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jquant2.$(O): jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jutils.$(O): jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jmemmgr.$(O): jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemansi.$(O): jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemname.$(O): jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemnobs.$(O): jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemdos.$(O): jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemmac.$(O): jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
cjpeg.$(O): cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
djpeg.$(O): djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
jpegtran.$(O): jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
|
||||
rdjpgcom.$(O): rdjpgcom.c jinclude.h jconfig.h
|
||||
wrjpgcom.$(O): wrjpgcom.c jinclude.h jconfig.h
|
||||
cdjpeg.$(O): cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdcolmap.$(O): rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdswitch.$(O): rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
transupp.$(O): transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
|
||||
rdppm.$(O): rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrppm.$(O): wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdgif.$(O): rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrgif.$(O): wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdtarga.$(O): rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrtarga.$(O): wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdbmp.$(O): rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrbmp.$(O): wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdrle.$(O): rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrrle.$(O): wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
220
makefile.dj
220
makefile.dj
@@ -1,220 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is for DJGPP (Delorie's GNU C port on MS-DOS), v2.0 or later.
|
||||
# Thanks to Frank J. Donahoe for this version.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= gcc
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
CFLAGS= -O2 -Wall -I.
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via -D switches here.
|
||||
|
||||
# Link-time cc options:
|
||||
LDFLAGS= -s
|
||||
|
||||
# To link any special libraries, add the necessary -l commands here.
|
||||
LDLIBS=
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For DJGPP this is usually jmemnobs.o, but you could
|
||||
# use jmemname.o if you want to use named temp files instead of swap space.
|
||||
SYSDEPMEM= jmemnobs.o
|
||||
|
||||
# miscellaneous OS-dependent stuff
|
||||
# linker
|
||||
LN= $(CC)
|
||||
# file deletion command
|
||||
RM= del
|
||||
# library (.a) file creation command
|
||||
AR= ar rc
|
||||
# second step in .a creation (use "touch" if not needed)
|
||||
AR2= ranlib
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o \
|
||||
jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o \
|
||||
jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o \
|
||||
jfdctint.o
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o \
|
||||
jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o \
|
||||
jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
|
||||
jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
|
||||
# These objectfiles are included in libjpeg.a
|
||||
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
|
||||
# object files for sample applications (excluding library files)
|
||||
COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
|
||||
cdjpeg.o
|
||||
DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
|
||||
cdjpeg.o
|
||||
TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
|
||||
|
||||
|
||||
all: libjpeg.a cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
|
||||
|
||||
libjpeg.a: $(LIBOBJECTS)
|
||||
$(RM) libjpeg.a
|
||||
$(AR) libjpeg.a $(LIBOBJECTS)
|
||||
$(AR2) libjpeg.a
|
||||
|
||||
cjpeg.exe: $(COBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o cjpeg.exe $(COBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
djpeg.exe: $(DOBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o djpeg.exe $(DOBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
jpegtran.exe: $(TROBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o jpegtran.exe $(TROBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
rdjpgcom.exe: rdjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o rdjpgcom.exe rdjpgcom.o $(LDLIBS)
|
||||
|
||||
wrjpgcom.exe: wrjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o wrjpgcom.exe wrjpgcom.o $(LDLIBS)
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
clean:
|
||||
$(RM) *.o
|
||||
$(RM) cjpeg.exe
|
||||
$(RM) djpeg.exe
|
||||
$(RM) jpegtran.exe
|
||||
$(RM) rdjpgcom.exe
|
||||
$(RM) wrjpgcom.exe
|
||||
$(RM) libjpeg.a
|
||||
$(RM) testout*.*
|
||||
|
||||
test: cjpeg.exe djpeg.exe jpegtran.exe
|
||||
$(RM) testout*.*
|
||||
./djpeg -dct int -ppm -outfile testout.ppm 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.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
|
||||
|
||||
|
||||
jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcphuff.o: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdphuff.o: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
|
||||
jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctred.o: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
|
||||
rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
|
||||
wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
|
||||
cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
|
||||
rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
214
makefile.manx
214
makefile.manx
@@ -1,214 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is for Amiga systems using Manx Aztec C ver 5.x.
|
||||
# Thanks to D.J. James (djjames@cup.portal.com) for this version.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= cc
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
# Uncomment for generic 68000 code (will work on any Amiga)
|
||||
ARCHFLAGS= -sn
|
||||
|
||||
# Uncomment for 68020/68030 code (faster, but won't run on 68000 CPU)
|
||||
#ARCHFLAGS= -c2
|
||||
|
||||
CFLAGS= -MC -MD $(ARCHFLAGS) -spfam -r4
|
||||
|
||||
# Link-time cc options:
|
||||
LDFLAGS= -g
|
||||
|
||||
# To link any special libraries, add the necessary -l commands here.
|
||||
LDLIBS= -lml -lcl
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For Amiga we recommend jmemname.o.
|
||||
SYSDEPMEM= jmemname.o
|
||||
|
||||
# miscellaneous OS-dependent stuff
|
||||
# linker
|
||||
LN= ln
|
||||
# file deletion command
|
||||
RM= delete quiet
|
||||
# library (.lib) file creation command
|
||||
AR= lb
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o \
|
||||
jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o \
|
||||
jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o \
|
||||
jfdctint.o
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o \
|
||||
jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o \
|
||||
jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
|
||||
jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
|
||||
# These objectfiles are included in libjpeg.lib
|
||||
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
|
||||
# object files for sample applications (excluding library files)
|
||||
COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
|
||||
cdjpeg.o
|
||||
DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
|
||||
cdjpeg.o
|
||||
TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
|
||||
|
||||
|
||||
all: libjpeg.lib cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
|
||||
libjpeg.lib: $(LIBOBJECTS)
|
||||
-$(RM) libjpeg.lib
|
||||
$(AR) libjpeg.lib $(LIBOBJECTS)
|
||||
|
||||
cjpeg: $(COBJECTS) libjpeg.lib
|
||||
$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.lib $(LDLIBS)
|
||||
|
||||
djpeg: $(DOBJECTS) libjpeg.lib
|
||||
$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.lib $(LDLIBS)
|
||||
|
||||
jpegtran: $(TROBJECTS) libjpeg.lib
|
||||
$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.lib $(LDLIBS)
|
||||
|
||||
rdjpgcom: rdjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
|
||||
|
||||
wrjpgcom: wrjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
clean:
|
||||
-$(RM) *.o cjpeg djpeg jpegtran libjpeg.lib rdjpgcom wrjpgcom
|
||||
-$(RM) core testout*.*
|
||||
|
||||
test: cjpeg djpeg jpegtran
|
||||
-$(RM) testout*.*
|
||||
djpeg -dct int -ppm -outfile testout.ppm 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
|
||||
cmp testimg.ppm testout.ppm
|
||||
cmp testimg.bmp testout.bmp
|
||||
cmp testimg.jpg testout.jpg
|
||||
cmp testimg.ppm testoutp.ppm
|
||||
cmp testimgp.jpg testoutp.jpg
|
||||
cmp testorig.jpg testoutt.jpg
|
||||
|
||||
|
||||
jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcphuff.o: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdphuff.o: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
|
||||
jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctred.o: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
|
||||
rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
|
||||
wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
|
||||
cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
|
||||
rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
249
makefile.mc6
249
makefile.mc6
@@ -1,249 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is for Microsoft C for MS-DOS, version 6.00A and up.
|
||||
# Use NMAKE, not Microsoft's brain-damaged MAKE.
|
||||
# Thanks to Alan Wright and Chris Turner of Olivetti Research Ltd.
|
||||
|
||||
# Read installation instructions before saying "nmake" !!
|
||||
|
||||
# You may need to adjust these compiler options:
|
||||
CFLAGS = -AM -Oecigt -Gs -W3
|
||||
# -AM medium memory model (or use -AS for small model, if you remove features)
|
||||
# -Oecigt -Gs maximum safe optimisation (-Ol has bugs in MSC 6.00A)
|
||||
# -W3 warning level 3
|
||||
# You might also want to add -G2 if you have an 80286, etc.
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via -D switches here.
|
||||
|
||||
# Jan-Herman Buining suggests the following switches for MS C 8.0 and a 486:
|
||||
# CFLAGS = /AM /f- /FPi87 /G3 /Gs /Gy /Ob1 /Oc /Oe /Og /Oi /Ol /On /Oo /Ot \
|
||||
# /OV4 /W3
|
||||
# except for jquant1.c, which must be compiled with /Oo- to avoid a compiler
|
||||
# crash.
|
||||
|
||||
# Ingar Steinsland suggests the following switches when building
|
||||
# a 16-bit Windows DLL:
|
||||
# CFLAGS = -ALw -Gsw -Zpe -W3 -O2 -Zi -Zd
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For DOS, we recommend jmemdos.c and jmemdosa.asm.
|
||||
# (But not for Windows; see install.doc if you use this makefile for Windows.)
|
||||
SYSDEPMEM= jmemdos.obj jmemdosa.obj
|
||||
# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
|
||||
SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.obj jcapistd.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 jcphuff.obj \
|
||||
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdtrans.obj jdatasrc.obj \
|
||||
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdphuff.obj \
|
||||
jdmainct.obj jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj \
|
||||
jidctflt.obj jidctint.obj jidctred.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
|
||||
|
||||
# need linker response file because file list > 128 chars
|
||||
RFILE = libjpeg.ans
|
||||
|
||||
|
||||
all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
|
||||
|
||||
libjpeg.lib: $(LIBOBJECTS) $(RFILE)
|
||||
del libjpeg.lib
|
||||
lib @$(RFILE)
|
||||
|
||||
# linker response file for building libjpeg.lib
|
||||
$(RFILE) : makefile
|
||||
del $(RFILE)
|
||||
echo libjpeg.lib >$(RFILE)
|
||||
# silly want-to-create-it prompt:
|
||||
echo y >>$(RFILE)
|
||||
echo +jcapimin.obj +jcapistd.obj +jctrans.obj +jcparam.obj & >>$(RFILE)
|
||||
echo +jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj & >>$(RFILE)
|
||||
echo +jcmainct.obj +jcprepct.obj +jccoefct.obj & >>$(RFILE)
|
||||
echo +jccolor.obj +jcsample.obj +jchuff.obj +jcphuff.obj & >>$(RFILE)
|
||||
echo +jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj & >>$(RFILE)
|
||||
echo +jfdctint.obj +jdapimin.obj +jdapistd.obj & >>$(RFILE)
|
||||
echo +jdtrans.obj +jdatasrc.obj +jdmaster.obj +jdinput.obj & >>$(RFILE)
|
||||
echo +jdmarker.obj +jdhuff.obj +jdphuff.obj +jdmainct.obj & >>$(RFILE)
|
||||
echo +jdcoefct.obj +jdpostct.obj +jddctmgr.obj & >>$(RFILE)
|
||||
echo +jidctfst.obj +jidctflt.obj +jidctint.obj & >>$(RFILE)
|
||||
echo +jidctred.obj +jdsample.obj +jdcolor.obj +jquant1.obj & >>$(RFILE)
|
||||
echo +jquant2.obj +jdmerge.obj +jcomapi.obj +jutils.obj & >>$(RFILE)
|
||||
echo +jerror.obj +jmemmgr.obj & >>$(RFILE)
|
||||
echo $(SYSDEPMEMLIB) ; >>$(RFILE)
|
||||
|
||||
cjpeg.exe: $(COBJECTS) libjpeg.lib
|
||||
echo $(COBJECTS) >cjpeg.lst
|
||||
link /STACK:4096 /EXEPACK @cjpeg.lst, cjpeg.exe, , libjpeg.lib, ;
|
||||
del cjpeg.lst
|
||||
|
||||
djpeg.exe: $(DOBJECTS) libjpeg.lib
|
||||
echo $(DOBJECTS) >djpeg.lst
|
||||
link /STACK:4096 /EXEPACK @djpeg.lst, djpeg.exe, , libjpeg.lib, ;
|
||||
del djpeg.lst
|
||||
|
||||
jpegtran.exe: $(TROBJECTS) libjpeg.lib
|
||||
link /STACK:4096 /EXEPACK $(TROBJECTS), jpegtran.exe, , libjpeg.lib, ;
|
||||
|
||||
rdjpgcom.exe: rdjpgcom.c
|
||||
$(CC) -AS -O -W3 rdjpgcom.c
|
||||
|
||||
# wrjpgcom needs large model so it can malloc a 64K chunk
|
||||
wrjpgcom.exe: wrjpgcom.c
|
||||
$(CC) -AL -O -W3 wrjpgcom.c
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
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 -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.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
|
||||
|
||||
|
||||
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
|
||||
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 jchuff.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
|
||||
jcphuff.obj: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.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
|
||||
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 jdhuff.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
|
||||
jdphuff.obj: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.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
|
||||
jidctred.obj: jidctred.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
|
||||
masm /mx $*;
|
||||
218
makefile.mms
218
makefile.mms
@@ -1,218 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is for use with MMS on Digital VMS systems.
|
||||
# Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)
|
||||
# and Tim Bell (tbell@netcom.com) for their help.
|
||||
|
||||
# Read installation instructions before saying "MMS" !!
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
CFLAGS= $(CFLAGS) /NoDebug /Optimize
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via /Define switches here.
|
||||
.ifdef ALPHA
|
||||
OPT=
|
||||
.else
|
||||
OPT= ,Sys$Disk:[]MAKVMS.OPT/Option
|
||||
.endif
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For Unix this is usually jmemnobs.o, but you may want
|
||||
# to use jmemansi.o or jmemname.o if you have limited swap space.
|
||||
SYSDEPMEM= jmemnobs.obj
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.obj jcapistd.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 jcphuff.obj \
|
||||
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdtrans.obj jdatasrc.obj \
|
||||
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdphuff.obj \
|
||||
jdmainct.obj jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj \
|
||||
jidctflt.obj jidctint.obj jidctred.obj jdsample.obj jdcolor.obj \
|
||||
jquant1.obj jquant2.obj jdmerge.obj
|
||||
# These objectfiles are included in libjpeg.olb
|
||||
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
|
||||
# objectfile lists with commas --- what a crock
|
||||
COBJLIST= cjpeg.obj,rdppm.obj,rdgif.obj,rdtarga.obj,rdrle.obj,rdbmp.obj,\
|
||||
rdswitch.obj,cdjpeg.obj
|
||||
DOBJLIST= djpeg.obj,wrppm.obj,wrgif.obj,wrtarga.obj,wrrle.obj,wrbmp.obj,\
|
||||
rdcolmap.obj,cdjpeg.obj
|
||||
TROBJLIST= jpegtran.obj,rdswitch.obj,cdjpeg.obj,transupp.obj
|
||||
LIBOBJLIST= jcapimin.obj,jcapistd.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,jcphuff.obj,\
|
||||
jcdctmgr.obj,jfdctfst.obj,jfdctflt.obj,jfdctint.obj,jdapimin.obj,\
|
||||
jdapistd.obj,jdtrans.obj,jdatasrc.obj,jdmaster.obj,jdinput.obj,\
|
||||
jdmarker.obj,jdhuff.obj,jdphuff.obj,jdmainct.obj,jdcoefct.obj,\
|
||||
jdpostct.obj,jddctmgr.obj,jidctfst.obj,jidctflt.obj,jidctint.obj,\
|
||||
jidctred.obj,jdsample.obj,jdcolor.obj,jquant1.obj,jquant2.obj,\
|
||||
jdmerge.obj,jcomapi.obj,jutils.obj,jerror.obj,jmemmgr.obj,$(SYSDEPMEM)
|
||||
|
||||
|
||||
.first
|
||||
@- Define /NoLog Sys Sys$Library
|
||||
|
||||
ALL : libjpeg.olb cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
|
||||
@ Continue
|
||||
|
||||
libjpeg.olb : $(LIBOBJECTS)
|
||||
Library /Create libjpeg.olb $(LIBOBJLIST)
|
||||
|
||||
cjpeg.exe : $(COBJECTS) libjpeg.olb
|
||||
$(LINK) $(LFLAGS) /Executable = cjpeg.exe $(COBJLIST),libjpeg.olb/Library$(OPT)
|
||||
|
||||
djpeg.exe : $(DOBJECTS) libjpeg.olb
|
||||
$(LINK) $(LFLAGS) /Executable = djpeg.exe $(DOBJLIST),libjpeg.olb/Library$(OPT)
|
||||
|
||||
jpegtran.exe : $(TROBJECTS) libjpeg.olb
|
||||
$(LINK) $(LFLAGS) /Executable = jpegtran.exe $(TROBJLIST),libjpeg.olb/Library$(OPT)
|
||||
|
||||
rdjpgcom.exe : rdjpgcom.obj
|
||||
$(LINK) $(LFLAGS) /Executable = rdjpgcom.exe rdjpgcom.obj$(OPT)
|
||||
|
||||
wrjpgcom.exe : wrjpgcom.obj
|
||||
$(LINK) $(LFLAGS) /Executable = wrjpgcom.exe wrjpgcom.obj$(OPT)
|
||||
|
||||
jconfig.h : jconfig.vms
|
||||
@- Copy jconfig.vms jconfig.h
|
||||
|
||||
clean :
|
||||
@- Set Protection = Owner:RWED *.*;-1
|
||||
@- Set Protection = Owner:RWED *.OBJ
|
||||
- Purge /NoLog /NoConfirm *.*
|
||||
- Delete /NoLog /NoConfirm *.OBJ;
|
||||
|
||||
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 -bmp -colors 256 -outfile testout.bmp testorig.jpg
|
||||
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:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
|
||||
mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg
|
||||
- Backup /Compare/Log testimg.ppm testout.ppm
|
||||
- Backup /Compare/Log testimg.bmp testout.bmp
|
||||
- Backup /Compare/Log testimg.jpg testout.jpg
|
||||
- Backup /Compare/Log testimg.ppm testoutp.ppm
|
||||
- Backup /Compare/Log testimgp.jpg testoutp.jpg
|
||||
- Backup /Compare/Log testorig.jpg testoutt.jpg
|
||||
|
||||
|
||||
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
|
||||
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 jchuff.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
|
||||
jcphuff.obj : jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.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
|
||||
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 jdhuff.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
|
||||
jdphuff.obj : jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.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
|
||||
jidctred.obj : jidctred.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
|
||||
252
makefile.sas
252
makefile.sas
@@ -1,252 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is for Amiga systems using SAS C 6.0 and up.
|
||||
# Thanks to Ed Hanway, Mark Rinfret, and Jim Zepeda.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= sc
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
# Uncomment the following lines for generic 680x0 version
|
||||
ARCHFLAGS= cpu=any
|
||||
SUFFIX=
|
||||
|
||||
# Uncomment the following lines for 68030-only version
|
||||
#ARCHFLAGS= cpu=68030
|
||||
#SUFFIX=.030
|
||||
|
||||
CFLAGS= nostackcheck data=near parms=register optimize $(ARCHFLAGS) \
|
||||
ignore=104 ignore=304 ignore=306
|
||||
# ignore=104 disables warnings for mismatched const qualifiers
|
||||
# ignore=304 disables warnings for variables being optimized out
|
||||
# ignore=306 disables warnings for the inlining of functions
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via define switches here.
|
||||
|
||||
# Link-time cc options:
|
||||
LDFLAGS= SC SD ND BATCH
|
||||
|
||||
# To link any special libraries, add the necessary commands here.
|
||||
LDLIBS= LIB:scm.lib LIB:sc.lib
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For Amiga we recommend jmemname.o.
|
||||
SYSDEPMEM= jmemname.o
|
||||
|
||||
# miscellaneous OS-dependent stuff
|
||||
# linker
|
||||
LN= slink
|
||||
# file deletion command
|
||||
RM= delete quiet
|
||||
# library (.lib) file creation command
|
||||
AR= oml
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o \
|
||||
jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o \
|
||||
jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o \
|
||||
jfdctint.o
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o \
|
||||
jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o \
|
||||
jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
|
||||
jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
|
||||
# These objectfiles are included in libjpeg.lib
|
||||
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
|
||||
# object files for sample applications (excluding library files)
|
||||
COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
|
||||
cdjpeg.o
|
||||
DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
|
||||
cdjpeg.o
|
||||
TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
|
||||
|
||||
|
||||
all: libjpeg.lib cjpeg$(SUFFIX) djpeg$(SUFFIX) jpegtran$(SUFFIX) rdjpgcom$(SUFFIX) wrjpgcom$(SUFFIX)
|
||||
|
||||
# note: do several AR steps to avoid command line length limitations
|
||||
|
||||
libjpeg.lib: $(LIBOBJECTS)
|
||||
-$(RM) libjpeg.lib
|
||||
$(AR) libjpeg.lib r $(CLIBOBJECTS)
|
||||
$(AR) libjpeg.lib r $(DLIBOBJECTS)
|
||||
$(AR) libjpeg.lib r $(COMOBJECTS)
|
||||
|
||||
cjpeg$(SUFFIX): $(COBJECTS) libjpeg.lib
|
||||
$(LN) <WITH <
|
||||
$(LDFLAGS)
|
||||
TO cjpeg$(SUFFIX)
|
||||
FROM LIB:c.o $(COBJECTS)
|
||||
LIB libjpeg.lib $(LDLIBS)
|
||||
<
|
||||
|
||||
djpeg$(SUFFIX): $(DOBJECTS) libjpeg.lib
|
||||
$(LN) <WITH <
|
||||
$(LDFLAGS)
|
||||
TO djpeg$(SUFFIX)
|
||||
FROM LIB:c.o $(DOBJECTS)
|
||||
LIB libjpeg.lib $(LDLIBS)
|
||||
<
|
||||
|
||||
jpegtran$(SUFFIX): $(TROBJECTS) libjpeg.lib
|
||||
$(LN) <WITH <
|
||||
$(LDFLAGS)
|
||||
TO jpegtran$(SUFFIX)
|
||||
FROM LIB:c.o $(TROBJECTS)
|
||||
LIB libjpeg.lib $(LDLIBS)
|
||||
<
|
||||
|
||||
rdjpgcom$(SUFFIX): rdjpgcom.o
|
||||
$(LN) <WITH <
|
||||
$(LDFLAGS)
|
||||
TO rdjpgcom$(SUFFIX)
|
||||
FROM LIB:c.o rdjpgcom.o
|
||||
LIB $(LDLIBS)
|
||||
<
|
||||
|
||||
wrjpgcom$(SUFFIX): wrjpgcom.o
|
||||
$(LN) <WITH <
|
||||
$(LDFLAGS)
|
||||
TO wrjpgcom$(SUFFIX)
|
||||
FROM LIB:c.o wrjpgcom.o
|
||||
LIB $(LDLIBS)
|
||||
<
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
clean:
|
||||
-$(RM) *.o cjpeg djpeg jpegtran cjpeg.030 djpeg.030 jpegtran.030
|
||||
-$(RM) rdjpgcom wrjpgcom rdjpgcom.030 wrjpgcom.030
|
||||
-$(RM) libjpeg.lib core testout*.*
|
||||
|
||||
test: cjpeg djpeg jpegtran
|
||||
-$(RM) testout*.*
|
||||
djpeg -dct int -ppm -outfile testout.ppm 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
|
||||
cmp testimg.ppm testout.ppm
|
||||
cmp testimg.bmp testout.bmp
|
||||
cmp testimg.jpg testout.jpg
|
||||
cmp testimg.ppm testoutp.ppm
|
||||
cmp testimgp.jpg testoutp.jpg
|
||||
cmp testorig.jpg testoutt.jpg
|
||||
|
||||
|
||||
jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcphuff.o: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdphuff.o: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
|
||||
jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctred.o: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
|
||||
rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
|
||||
wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
|
||||
cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
|
||||
rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
228
makefile.unix
228
makefile.unix
@@ -1,228 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is suitable for Unix-like systems with non-ANSI compilers.
|
||||
# If you have an ANSI compiler, makefile.ansi is a better starting point.
|
||||
|
||||
# Read installation instructions before saying "make" !!
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= cc
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
CFLAGS= -O
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via -D switches here.
|
||||
# However, any special defines for ansi2knr.c may be included here:
|
||||
ANSI2KNRFLAGS=
|
||||
|
||||
# Link-time cc options:
|
||||
LDFLAGS=
|
||||
|
||||
# To link any special libraries, add the necessary -l commands here.
|
||||
LDLIBS=
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. For Unix this is usually jmemnobs.o, but you may want
|
||||
# to use jmemansi.o or jmemname.o if you have limited swap space.
|
||||
SYSDEPMEM= jmemnobs.o
|
||||
|
||||
# miscellaneous OS-dependent stuff
|
||||
# linker
|
||||
LN= $(CC)
|
||||
# file deletion command
|
||||
RM= rm -f
|
||||
# file rename command
|
||||
MV= mv
|
||||
# library (.a) file creation command
|
||||
AR= ar rc
|
||||
# second step in .a creation (use "touch" if not needed)
|
||||
AR2= ranlib
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o \
|
||||
jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o \
|
||||
jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o \
|
||||
jfdctint.o
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o \
|
||||
jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o \
|
||||
jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
|
||||
jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
|
||||
# These objectfiles are included in libjpeg.a
|
||||
LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
|
||||
# object files for sample applications (excluding library files)
|
||||
COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
|
||||
cdjpeg.o
|
||||
DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
|
||||
cdjpeg.o
|
||||
TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
|
||||
|
||||
|
||||
all: ansi2knr libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom
|
||||
|
||||
# This rule causes ansi2knr to be invoked.
|
||||
.c.o:
|
||||
./ansi2knr $*.c T$*.c
|
||||
$(CC) $(CFLAGS) -c T$*.c
|
||||
$(RM) T$*.c $*.o
|
||||
$(MV) T$*.o $*.o
|
||||
|
||||
ansi2knr: ansi2knr.c
|
||||
$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
|
||||
|
||||
libjpeg.a: ansi2knr $(LIBOBJECTS)
|
||||
$(RM) libjpeg.a
|
||||
$(AR) libjpeg.a $(LIBOBJECTS)
|
||||
$(AR2) libjpeg.a
|
||||
|
||||
cjpeg: ansi2knr $(COBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
djpeg: ansi2knr $(DOBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
jpegtran: ansi2knr $(TROBJECTS) libjpeg.a
|
||||
$(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS)
|
||||
|
||||
rdjpgcom: rdjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
|
||||
|
||||
wrjpgcom: wrjpgcom.o
|
||||
$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
clean:
|
||||
$(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom
|
||||
$(RM) ansi2knr core testout*
|
||||
|
||||
test: cjpeg djpeg jpegtran
|
||||
$(RM) testout*
|
||||
./djpeg -dct int -ppm -outfile testout.ppm 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
|
||||
cmp testimg.ppm testout.ppm
|
||||
cmp testimg.bmp testout.bmp
|
||||
cmp testimg.jpg testout.jpg
|
||||
cmp testimg.ppm testoutp.ppm
|
||||
cmp testimgp.jpg testoutp.jpg
|
||||
cmp testorig.jpg testoutt.jpg
|
||||
|
||||
|
||||
jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcphuff.o: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
|
||||
jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
|
||||
jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdphuff.o: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
|
||||
jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
|
||||
jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jidctred.o: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
|
||||
jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
|
||||
jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
|
||||
cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
|
||||
jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
|
||||
rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
|
||||
wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
|
||||
cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
|
||||
rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
|
||||
211
makefile.vc
211
makefile.vc
@@ -1,211 +0,0 @@
|
||||
# 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= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.obj jcapistd.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 jcphuff.obj \
|
||||
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdtrans.obj jdatasrc.obj \
|
||||
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdphuff.obj \
|
||||
jdmainct.obj jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj \
|
||||
jidctflt.obj jidctint.obj jidctred.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*
|
||||
|
||||
test: cjpeg.exe djpeg.exe jpegtran.exe
|
||||
$(RM) testout*
|
||||
.\djpeg -dct int -ppm -outfile testout.ppm 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.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
|
||||
|
||||
|
||||
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
|
||||
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 jchuff.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
|
||||
jcphuff.obj: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.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
|
||||
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 jdhuff.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
|
||||
jdphuff.obj: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.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
|
||||
jidctred.obj: jidctred.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
|
||||
142
makefile.vms
142
makefile.vms
@@ -1,142 +0,0 @@
|
||||
$! Makefile for Independent JPEG Group's software
|
||||
$!
|
||||
$! This is a command procedure for Digital VMS systems that do not have MMS.
|
||||
$! It builds the JPEG software by brute force, recompiling everything whether
|
||||
$! or not it is necessary. It then runs the basic self-test.
|
||||
$! Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)
|
||||
$! and Tim Bell (tbell@netcom.com) for their help.
|
||||
$!
|
||||
$! Read installation instructions before running this!!
|
||||
$!
|
||||
$ If F$Mode () .eqs. "INTERACTIVE"
|
||||
$ Then
|
||||
$ VERIFY = F$Verify (0)
|
||||
$ Else
|
||||
$ VERIFY = F$Verify (1)
|
||||
$ EndIf
|
||||
$ On Control_Y Then GoTo End
|
||||
$ On Error Then GoTo End
|
||||
$
|
||||
$ If F$GetSyi ("HW_MODEL") .gt. 1023
|
||||
$ Then
|
||||
$ OPT = ""
|
||||
$ Else
|
||||
$ OPT = ",Sys$Disk:[]makvms.opt/Option"
|
||||
$ EndIf
|
||||
$
|
||||
$ DoCompile := CC /NoDebug /Optimize /NoList
|
||||
$!
|
||||
$ DoCompile jcapimin.c
|
||||
$ DoCompile jcapistd.c
|
||||
$ DoCompile jctrans.c
|
||||
$ DoCompile jcparam.c
|
||||
$ DoCompile jdatadst.c
|
||||
$ DoCompile jcinit.c
|
||||
$ DoCompile jcmaster.c
|
||||
$ DoCompile jcmarker.c
|
||||
$ DoCompile jcmainct.c
|
||||
$ DoCompile jcprepct.c
|
||||
$ DoCompile jccoefct.c
|
||||
$ DoCompile jccolor.c
|
||||
$ DoCompile jcsample.c
|
||||
$ DoCompile jchuff.c
|
||||
$ DoCompile jcphuff.c
|
||||
$ DoCompile jcdctmgr.c
|
||||
$ DoCompile jfdctfst.c
|
||||
$ DoCompile jfdctflt.c
|
||||
$ DoCompile jfdctint.c
|
||||
$ DoCompile jdapimin.c
|
||||
$ DoCompile jdapistd.c
|
||||
$ DoCompile jdtrans.c
|
||||
$ DoCompile jdatasrc.c
|
||||
$ DoCompile jdmaster.c
|
||||
$ DoCompile jdinput.c
|
||||
$ DoCompile jdmarker.c
|
||||
$ DoCompile jdhuff.c
|
||||
$ DoCompile jdphuff.c
|
||||
$ DoCompile jdmainct.c
|
||||
$ DoCompile jdcoefct.c
|
||||
$ DoCompile jdpostct.c
|
||||
$ DoCompile jddctmgr.c
|
||||
$ DoCompile jidctfst.c
|
||||
$ DoCompile jidctflt.c
|
||||
$ DoCompile jidctint.c
|
||||
$ DoCompile jidctred.c
|
||||
$ DoCompile jdsample.c
|
||||
$ DoCompile jdcolor.c
|
||||
$ DoCompile jquant1.c
|
||||
$ DoCompile jquant2.c
|
||||
$ DoCompile jdmerge.c
|
||||
$ DoCompile jcomapi.c
|
||||
$ DoCompile jutils.c
|
||||
$ DoCompile jerror.c
|
||||
$ DoCompile jmemmgr.c
|
||||
$ DoCompile jmemnobs.c
|
||||
$!
|
||||
$ Library /Create libjpeg.olb jcapimin.obj,jcapistd.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,jcphuff.obj,jcdctmgr.obj,jfdctfst.obj,jfdctflt.obj, -
|
||||
jfdctint.obj,jdapimin.obj,jdapistd.obj,jdtrans.obj,jdatasrc.obj, -
|
||||
jdmaster.obj,jdinput.obj,jdmarker.obj,jdhuff.obj,jdphuff.obj, -
|
||||
jdmainct.obj,jdcoefct.obj,jdpostct.obj,jddctmgr.obj,jidctfst.obj, -
|
||||
jidctflt.obj,jidctint.obj,jidctred.obj,jdsample.obj,jdcolor.obj, -
|
||||
jquant1.obj,jquant2.obj,jdmerge.obj,jcomapi.obj,jutils.obj, -
|
||||
jerror.obj,jmemmgr.obj,jmemnobs.obj
|
||||
$!
|
||||
$ DoCompile cjpeg.c
|
||||
$ DoCompile rdppm.c
|
||||
$ DoCompile rdgif.c
|
||||
$ DoCompile rdtarga.c
|
||||
$ DoCompile rdrle.c
|
||||
$ DoCompile rdbmp.c
|
||||
$ DoCompile rdswitch.c
|
||||
$ DoCompile cdjpeg.c
|
||||
$!
|
||||
$ Link /NoMap /Executable = cjpeg.exe cjpeg.obj,rdppm.obj,rdgif.obj, -
|
||||
rdtarga.obj,rdrle.obj,rdbmp.obj,rdswitch.obj,cdjpeg.obj,libjpeg.olb/Library'OPT'
|
||||
$!
|
||||
$ DoCompile djpeg.c
|
||||
$ DoCompile wrppm.c
|
||||
$ DoCompile wrgif.c
|
||||
$ DoCompile wrtarga.c
|
||||
$ DoCompile wrrle.c
|
||||
$ DoCompile wrbmp.c
|
||||
$ DoCompile rdcolmap.c
|
||||
$ DoCompile cdjpeg.c
|
||||
$!
|
||||
$ Link /NoMap /Executable = djpeg.exe djpeg.obj,wrppm.obj,wrgif.obj, -
|
||||
wrtarga.obj,wrrle.obj,wrbmp.obj,rdcolmap.obj,cdjpeg.obj,libjpeg.olb/Library'OPT'
|
||||
$!
|
||||
$ DoCompile jpegtran.c
|
||||
$ DoCompile rdswitch.c
|
||||
$ DoCompile cdjpeg.c
|
||||
$ DoCompile transupp.c
|
||||
$!
|
||||
$ Link /NoMap /Executable = jpegtran.exe jpegtran.obj,rdswitch.obj, -
|
||||
cdjpeg.obj,transupp.obj,libjpeg.olb/Library'OPT'
|
||||
$!
|
||||
$ DoCompile rdjpgcom.c
|
||||
$ Link /NoMap /Executable = rdjpgcom.exe rdjpgcom.obj'OPT'
|
||||
$!
|
||||
$ DoCompile wrjpgcom.c
|
||||
$ Link /NoMap /Executable = wrjpgcom.exe wrjpgcom.obj'OPT'
|
||||
$!
|
||||
$! Run the self-test
|
||||
$!
|
||||
$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm 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:[]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:[]jpegtran -outfile testoutt.jpg testprog.jpg
|
||||
$ Backup /Compare/Log testimg.ppm testout.ppm
|
||||
$ Backup /Compare/Log testimg.bmp testout.bmp
|
||||
$ Backup /Compare/Log testimg.jpg testout.jpg
|
||||
$ Backup /Compare/Log testimg.ppm testoutp.ppm
|
||||
$ Backup /Compare/Log testimgp.jpg testoutp.jpg
|
||||
$ Backup /Compare/Log testorig.jpg testoutt.jpg
|
||||
$!
|
||||
$End:
|
||||
$ If Verify Then Set Verify
|
||||
$ Exit
|
||||
233
makefile.wat
233
makefile.wat
@@ -1,233 +0,0 @@
|
||||
# Makefile for Independent JPEG Group's software
|
||||
|
||||
# This makefile is suitable for Watcom C/C++ 10.0 on MS-DOS (using
|
||||
# dos4g extender), OS/2, and Windows NT console mode.
|
||||
# Thanks to Janos Haide, jhaide@btrvtech.com.
|
||||
|
||||
# Read installation instructions before saying "wmake" !!
|
||||
|
||||
# Uncomment line for desired system
|
||||
SYSTEM=DOS
|
||||
#SYSTEM=OS2
|
||||
#SYSTEM=NT
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= wcl386
|
||||
|
||||
# You may need to adjust these cc options:
|
||||
CFLAGS= -4r -ort -wx -zq -bt=$(SYSTEM)
|
||||
# Caution: avoid -ol or -ox; these generate bad code with 10.0 or 10.0a.
|
||||
# Generally, we recommend defining any configuration symbols in jconfig.h,
|
||||
# NOT via -D switches here.
|
||||
|
||||
# Link-time cc options:
|
||||
!ifeq SYSTEM DOS
|
||||
LDFLAGS= -zq -l=dos4g
|
||||
!else ifeq SYSTEM OS2
|
||||
LDFLAGS= -zq -l=os2v2
|
||||
!else ifeq SYSTEM NT
|
||||
LDFLAGS= -zq -l=nt
|
||||
!endif
|
||||
|
||||
# Put here the object file name for the correct system-dependent memory
|
||||
# manager file. jmemnobs should work fine for dos4g or OS/2 environment.
|
||||
SYSDEPMEM= jmemnobs.obj
|
||||
|
||||
# End of configurable options.
|
||||
|
||||
|
||||
# source files: JPEG library proper
|
||||
LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c &
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c &
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c &
|
||||
jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c &
|
||||
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c &
|
||||
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c &
|
||||
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.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= jchuff.h jdhuff.h 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.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 &
|
||||
wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc &
|
||||
coderules.doc filelist.doc change.log
|
||||
MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc &
|
||||
makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds &
|
||||
makeapps.ds 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 ltconfig ltmain.sh
|
||||
OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
|
||||
TESTFILES= testorig.jpg testimg.ppm 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= jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
|
||||
# compression library object files
|
||||
CLIBOBJECTS= jcapimin.obj jcapistd.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 jcphuff.obj &
|
||||
jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
|
||||
# decompression library object files
|
||||
DLIBOBJECTS= jdapimin.obj jdapistd.obj jdtrans.obj jdatasrc.obj &
|
||||
jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdphuff.obj &
|
||||
jdmainct.obj jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj &
|
||||
jidctflt.obj jidctint.obj jidctred.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
|
||||
* wlib -n libjpeg.lib $(LIBOBJECTS)
|
||||
|
||||
cjpeg.exe: $(COBJECTS) libjpeg.lib
|
||||
$(CC) $(LDFLAGS) $(COBJECTS) libjpeg.lib
|
||||
|
||||
djpeg.exe: $(DOBJECTS) libjpeg.lib
|
||||
$(CC) $(LDFLAGS) $(DOBJECTS) libjpeg.lib
|
||||
|
||||
jpegtran.exe: $(TROBJECTS) libjpeg.lib
|
||||
$(CC) $(LDFLAGS) $(TROBJECTS) libjpeg.lib
|
||||
|
||||
rdjpgcom.exe: rdjpgcom.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) rdjpgcom.c
|
||||
|
||||
wrjpgcom.exe: wrjpgcom.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) wrjpgcom.c
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
jconfig.h: jconfig.doc
|
||||
echo You must prepare a system-dependent jconfig.h file.
|
||||
echo Please read the installation directions in install.doc.
|
||||
exit 1
|
||||
|
||||
clean: .SYMBOLIC
|
||||
- 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 .SYMBOLIC
|
||||
- del testout*.*
|
||||
djpeg -dct int -ppm -outfile testout.ppm 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
|
||||
!ifeq SYSTEM DOS
|
||||
fc /b testimg.ppm testout.ppm
|
||||
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
|
||||
!else
|
||||
echo n > n.tmp
|
||||
comp testimg.ppm testout.ppm < 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
|
||||
!endif
|
||||
|
||||
|
||||
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
|
||||
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 jchuff.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
|
||||
jcphuff.obj: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.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
|
||||
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 jdhuff.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
|
||||
jdphuff.obj: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.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
|
||||
jidctred.obj: jidctred.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
|
||||
1046
makelib.ds
1046
makelib.ds
File diff suppressed because it is too large
Load Diff
213
makeproj.mac
213
makeproj.mac
@@ -1,213 +0,0 @@
|
||||
--
|
||||
-- makeproj.mac
|
||||
--
|
||||
-- This AppleScript builds Code Warrior PRO Release 2 project files for the
|
||||
-- libjpeg library as well as the test programs 'cjpeg', 'djpeg', 'jpegtran'.
|
||||
-- (We'd distribute real project files, except they're not text
|
||||
-- and would create maintenance headaches.)
|
||||
--
|
||||
-- The script then compiles and links the library and the test programs.
|
||||
-- NOTE: if you haven't already created a 'jconfig.h' file, the script
|
||||
-- automatically copies 'jconfig.mac' to 'jconfig.h'.
|
||||
--
|
||||
-- To use this script, you must have AppleScript 1.1 or later installed
|
||||
-- and a suitable AppleScript editor like Script Editor or Script Debugger
|
||||
-- (http://www.latenightsw.com). Open this file with your AppleScript
|
||||
-- editor and execute the "run" command to build the projects.
|
||||
--
|
||||
-- Thanks to Dan Sears and Don Agro for this script.
|
||||
-- Questions about this script can be addressed to dogpark@interlog.com
|
||||
--
|
||||
|
||||
on run
|
||||
|
||||
choose folder with prompt ">>> Select IJG source folder <<<"
|
||||
set ijg_folder to result
|
||||
|
||||
choose folder with prompt ">>> Select MetroWerks folder <<<"
|
||||
set cw_folder to result
|
||||
|
||||
-- if jconfig.h doesn't already exist, copy jconfig.mac
|
||||
|
||||
tell application "Finder"
|
||||
if not (exists file "jconfig.h" of ijg_folder) then
|
||||
duplicate {file "jconfig.mac" of folder ijg_folder}
|
||||
select file "jconfig.mac copy" of folder ijg_folder
|
||||
set name of selection to "jconfig.h"
|
||||
end if
|
||||
end tell
|
||||
|
||||
tell application "CodeWarrior IDE 2.1"
|
||||
with timeout of 10000 seconds
|
||||
|
||||
-- create libjpeg project
|
||||
|
||||
activate
|
||||
Create Project (ijg_folder as string) & "libjpeg.proj"
|
||||
Set Preferences of panel "Target Settings" to {Target Name:"libjpeg"}
|
||||
Set Preferences of panel "PPC Project" to {File Name:"libjpeg"}
|
||||
Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
|
||||
Set Preferences of panel "PPC Project" to {Project Type:library}
|
||||
Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
|
||||
Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
|
||||
Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
|
||||
Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
|
||||
|
||||
Add Files (ijg_folder as string) & "jcapimin.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcapistd.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jctrans.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcparam.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdatadst.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcinit.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcmaster.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcmarker.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcmainct.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcprepct.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jccoefct.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jccolor.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcsample.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jchuff.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcphuff.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcdctmgr.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jfdctfst.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jfdctflt.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jfdctint.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdapimin.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdapistd.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdtrans.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdatasrc.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdmaster.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdinput.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdmarker.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdhuff.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdphuff.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdmainct.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdcoefct.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdpostct.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jddctmgr.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jidctfst.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jidctflt.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jidctint.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jidctred.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdsample.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdcolor.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jquant1.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jquant2.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jdmerge.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jcomapi.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jutils.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jerror.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jmemmgr.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "jmemmac.c" To Segment 1
|
||||
|
||||
-- compile and link the library
|
||||
|
||||
Make Project
|
||||
Close Project
|
||||
|
||||
-- create cjpeg project
|
||||
|
||||
activate
|
||||
Create Project (ijg_folder as string) & "cjpeg.proj"
|
||||
Set Preferences of panel "Target Settings" to {Target Name:"cjpeg"}
|
||||
Set Preferences of panel "PPC Project" to {File Name:"cjpeg"}
|
||||
Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
|
||||
Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
|
||||
Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
|
||||
Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
|
||||
Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
|
||||
|
||||
Add Files (ijg_folder as string) & "cjpeg.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdppm.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdgif.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdtarga.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdrle.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdbmp.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
|
||||
|
||||
Add Files (ijg_folder as string) & "libjpeg" To Segment 2
|
||||
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
|
||||
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
|
||||
|
||||
-- compile and link cjpeg
|
||||
|
||||
Make Project
|
||||
Close Project
|
||||
|
||||
-- create djpeg project
|
||||
|
||||
activate
|
||||
Create Project (ijg_folder as string) & "djpeg.proj"
|
||||
Set Preferences of panel "Target Settings" to {Target Name:"djpeg"}
|
||||
Set Preferences of panel "PPC Project" to {File Name:"djpeg"}
|
||||
Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
|
||||
Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
|
||||
Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
|
||||
Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
|
||||
Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
|
||||
|
||||
Add Files (ijg_folder as string) & "djpeg.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "wrppm.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "wrgif.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "wrtarga.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "wrrle.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "wrbmp.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdcolmap.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
|
||||
|
||||
Add Files (ijg_folder as string) & "libjpeg" To Segment 2
|
||||
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
|
||||
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
|
||||
|
||||
-- compile and link djpeg
|
||||
|
||||
Make Project
|
||||
Close Project
|
||||
|
||||
-- create jpegtran project
|
||||
|
||||
activate
|
||||
Create Project (ijg_folder as string) & "jpegtran.proj"
|
||||
Set Preferences of panel "Target Settings" to {Target Name:"jpegtran"}
|
||||
Set Preferences of panel "PPC Project" to {File Name:"jpegtran"}
|
||||
Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
|
||||
Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
|
||||
Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
|
||||
Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
|
||||
Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
|
||||
|
||||
Add Files (ijg_folder as string) & "jpegtran.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
|
||||
Add Files (ijg_folder as string) & "transupp.c" To Segment 1
|
||||
|
||||
Add Files (ijg_folder as string) & "libjpeg" To Segment 2
|
||||
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
|
||||
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
|
||||
Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
|
||||
|
||||
-- compile and link jpegtran
|
||||
|
||||
Make Project
|
||||
Close Project
|
||||
|
||||
quit
|
||||
|
||||
end timeout
|
||||
end tell
|
||||
end run
|
||||
70
makljpeg.st
70
makljpeg.st
@@ -1,70 +0,0 @@
|
||||
; Project file for Independent JPEG Group's software
|
||||
;
|
||||
; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
|
||||
; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de),
|
||||
; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de),
|
||||
; and Guido Vollbeding (guivol@esc.de).
|
||||
;
|
||||
; To use this file, rename it to libjpeg.prj.
|
||||
; Read installation instructions before trying to make the program!
|
||||
;
|
||||
;
|
||||
; * * * Output file * * *
|
||||
libjpeg.lib
|
||||
;
|
||||
; * * * COMPILER OPTIONS * * *
|
||||
.C[-P] ; absolute calls
|
||||
.C[-M] ; and no string merging, folks
|
||||
.C[-w-cln] ; no "constant is long" warnings
|
||||
.C[-w-par] ; no "parameter xxxx unused"
|
||||
.C[-w-rch] ; no "unreachable code"
|
||||
.C[-wsig] ; warn if significant digits may be lost
|
||||
.L[-J] ; link new Obj-format (so we get a library)
|
||||
=
|
||||
; * * * * List of modules * * * *
|
||||
jcapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jccoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jccolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcdctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jchuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jchuff.h)
|
||||
jcinit.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcomapi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcparam.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcphuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jchuff.h)
|
||||
jcprepct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jcsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jctrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdatadst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h)
|
||||
jdatasrc.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h)
|
||||
jdcoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdcolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jddctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jdhuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdhuff.h)
|
||||
jdinput.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdmerge.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdphuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdhuff.h)
|
||||
jdpostct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jdtrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jerror.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jversion.h,jerror.h)
|
||||
jfdctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jfdctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jfdctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jidctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jidctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jidctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jidctred.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
|
||||
jquant1.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jquant2.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jutils.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
|
||||
jmemmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h)
|
||||
jmemansi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h)
|
||||
32
maktjpeg.st
32
maktjpeg.st
@@ -1,32 +0,0 @@
|
||||
; Project file for Independent JPEG Group's software
|
||||
;
|
||||
; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
|
||||
; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de),
|
||||
; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de),
|
||||
; and Guido Vollbeding (guivol@esc.de).
|
||||
;
|
||||
; To use this file, rename it to jpegtran.prj.
|
||||
; If you are using Turbo C, change filenames beginning with "pc..." to "tc..."
|
||||
; Read installation instructions before trying to make the program!
|
||||
;
|
||||
;
|
||||
; * * * Output file * * *
|
||||
jpegtran.ttp
|
||||
;
|
||||
; * * * COMPILER OPTIONS * * *
|
||||
.C[-P] ; absolute calls
|
||||
.C[-M] ; and no string merging, folks
|
||||
.C[-w-cln] ; no "constant is long" warnings
|
||||
.C[-w-par] ; no "parameter xxxx unused"
|
||||
.C[-w-rch] ; no "unreachable code"
|
||||
.C[-wsig] ; warn if significant digits may be lost
|
||||
=
|
||||
; * * * * List of modules * * * *
|
||||
pcstart.o
|
||||
jpegtran.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h)
|
||||
cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
|
||||
transupp.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h)
|
||||
libjpeg.lib ; built by libjpeg.prj
|
||||
pcstdlib.lib ; standard library
|
||||
pcextlib.lib ; extended library
|
||||
@@ -1,4 +0,0 @@
|
||||
! A pointer to the VAX/VMS C Run-Time Shareable Library.
|
||||
! This file is needed by makefile.mms and makefile.vms,
|
||||
! but only for the older VAX C compiler. DEC C does not need it.
|
||||
Sys$Library:VAXCRTL.EXE /Share
|
||||
12
release/Description.plist.tmpl
Normal file
12
release/Description.plist.tmpl
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IFPkgDescriptionDescription</key>
|
||||
<string>A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs</string>
|
||||
<key>IFPkgDescriptionTitle</key>
|
||||
<string>{__APPNAME}</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>{__VERSION}</string>
|
||||
</dict>
|
||||
</plist>
|
||||
44
release/Info.plist.tmpl
Executable file
44
release/Info.plist.tmpl
Executable file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>{__VERSION}, The libjpeg-turbo Project</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.libjpeg-turbo.libjpeg-turbo</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>{__VERSION}</string>
|
||||
<key>IFMajorVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>IFMinorVersion</key>
|
||||
<integer>{__BUILD}</integer>
|
||||
<key>IFPkgFlagAllowBackRev</key>
|
||||
<false/>
|
||||
<key>IFPkgFlagAuthorizationAction</key>
|
||||
<string>AdminAuthorization</string>
|
||||
<key>IFPkgFlagBackgroundAlignment</key>
|
||||
<string>topleft</string>
|
||||
<key>IFPkgFlagBackgroundScaling</key>
|
||||
<string>none</string>
|
||||
<key>IFPkgFlagDefaultLocation</key>
|
||||
<string>/</string>
|
||||
<key>IFPkgFlagFollowLinks</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagInstallFat</key>
|
||||
<false/>
|
||||
<key>IFPkgFlagIsRequired</key>
|
||||
<false/>
|
||||
<key>IFPkgFlagOverwritePermissions</key>
|
||||
<false/>
|
||||
<key>IFPkgFlagRelocatable</key>
|
||||
<false/>
|
||||
<key>IFPkgFlagRestartAction</key>
|
||||
<string>NoRestart</string>
|
||||
<key>IFPkgFlagRootVolumeOnly</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagUpdateInstalledLanguages</key>
|
||||
<false/>
|
||||
<key>IFPkgFormatVersion</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
</plist>
|
||||
465
release/License.rtf
Executable file
465
release/License.rtf
Executable file
@@ -0,0 +1,465 @@
|
||||
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf470
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 AndaleMono;\f2\froman\fcharset77 TimesNewRomanPSMT;
|
||||
}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
|
||||
\deftab720
|
||||
\pard\pardeftab720\qc
|
||||
|
||||
\f0\fs24 \cf0 wxWindows Library Licence, Version 3.1\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\qc
|
||||
\cf0 Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\qc
|
||||
\cf0 Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\qc
|
||||
\cf0 WXWINDOWS LIBRARY LICENCE\uc0\u8232 TERMS AND CONDITIONS FOR COPYING,\u8232 DISTRIBUTION AND MODIFICATION\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public Licence for more details.
|
||||
\f2 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 You should have received a copy of the GNU Library General Public Licence along with this software, usually in a file named COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 EXCEPTION NOTICE
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 1. As a special exception, the copyright holders of this library give permission for additional uses of the text contained in this release of the library as licenced under the wxWindows Library Licence, applying either version 3.1 of the Licence, or (at your option) any later version of the Licence as published by the copyright holders of version 3.1 of the Licence document.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 2. The exception is that you may use, copy, link, modify and distribute under your own terms, binary object code versions of works based on the Library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 3. If you copy code from files distributed under the terms of the GNU General Public Licence or the GNU Library General Public Licence into a copy of this library, as this licence permits, the exception does not apply to the code that you add in this way. To avoid misleading anyone as to the status of such modified files, you must delete this exception notice from such code and/or adjust the licensing conditions notice accordingly.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 4. If you write modifications of your own for this library, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, you must delete the exception notice from such code and/or adjust the licensing conditions notice accordingly.
|
||||
\f1 \
|
||||
\
|
||||
\
|
||||
\
|
||||
\
|
||||
\
|
||||
\pard\pardeftab720\qc
|
||||
|
||||
\f0 \cf0 GNU LESSER GENERAL PUBLIC LICENSE\uc0\u8232 Version 2.1, February 1999\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\qc
|
||||
\cf0 Copyright (C) 1991, 1999 Free Software Foundation, Inc.\uc0\u8232 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\
|
||||
\
|
||||
[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
|
||||
\f1 \
|
||||
\
|
||||
\pard\pardeftab720\qc
|
||||
|
||||
\f0 \cf0 Preamble\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
\pard\pardeftab720\qc
|
||||
\cf0 GNU LESSER GENERAL PUBLIC LICENSE\uc0\u8232 TERMS AND CONDITIONS FOR COPYING,\u8232 DISTRIBUTION AND MODIFICATION\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
|
||||
\f2 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
|
||||
\f0 \cf0 a) The modified work must itself be a software library.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a
|
||||
\f1 \
|
||||
|
||||
\f0 medium customarily used for software interchange.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not
|
||||
\f1 \
|
||||
|
||||
\f0 compelled to copy the source along with the object code.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative
|
||||
\f1 \
|
||||
|
||||
\f0 work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
|
||||
\f1 \
|
||||
\
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
|
||||
\f0 \cf0 a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
|
||||
\f0 \cf0 a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is
|
||||
\f1 \
|
||||
|
||||
\f0 implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
\f1 \
|
||||
\
|
||||
|
||||
\f0 Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
|
||||
\f1 \
|
||||
\page
|
||||
\f0 \
|
||||
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\qc
|
||||
|
||||
\f0 \cf0 NO WARRANTY\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
\f1 \
|
||||
\
|
||||
\pard\pardeftab720\qc
|
||||
|
||||
\f0 \cf0 END OF TERMS AND CONDITIONS\
|
||||
\page \
|
||||
How to Apply These Terms to Your New Libraries\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
\f1 \
|
||||
\
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
|
||||
\f0 \cf0 <one line to give the library's name and a brief idea of what it does.>\uc0\u8232 Copyright (C) <year> <name of author>\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 Also add information on how to contact you by electronic and paper mail.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f1 \cf0 \
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0 \cf0 You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
|
||||
\f1 \
|
||||
\
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
|
||||
\f0 \cf0 Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker.\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
\pard\pardeftab720\li720\ri0\ql\qnatural
|
||||
\cf0 <signature of Ty Coon>, 1 April 1990\uc0\u8232 Ty Coon, President of Vice\
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
\cf0 \
|
||||
That's all there is to it!
|
||||
\f1 \
|
||||
\
|
||||
}
|
||||
11
release/ReadMe.rtf
Normal file
11
release/ReadMe.rtf
Normal file
@@ -0,0 +1,11 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\margl1440\margr1440\vieww15200\viewh9600\viewkind0
|
||||
\deftab720
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0\fs24 \cf0 libjpeg-turbo is a high-speed version of libjpeg for x86 and x86-64 processors which uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG compression and decompression. libjpeg-turbo is generally 2-4x as fast as the unmodified version of libjpeg, all else being equal. libjpeg-turbo also includes a wrapper library for the TurboJPEG API used by VirtualGL and TurboVNC.\
|
||||
\
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but the TigerVNC and VirtualGL projects made numerous enhancements to the codec, including improved support for Mac OS X, 64-bit support, support for 32-bit and big endian pixel formats, accelerated Huffman encoding/decoding, and various bug fixes. The goal was to produce a fully open source codec that could replace the partially closed source TurboJPEG/IPP codec used by VirtualGL and TurboVNC. libjpeg-turbo generally performs in the range of 80-120% of TurboJPEG/IPP. It is faster in some areas but slower in others.\
|
||||
}
|
||||
17
release/Welcome.rtf
Executable file
17
release/Welcome.rtf
Executable file
@@ -0,0 +1,17 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
|
||||
\deftab720
|
||||
\pard\pardeftab720\ql\qnatural
|
||||
|
||||
\f0\fs24 \cf0 This installer will install the libjpeg-turbo SDK and run-time libraries onto your computer so that you can use libjpeg-turbo to build new applications or accelerate existing ones. To remove the libjpeg-turbo package, you can either use the "Uninstall libjpeg-turbo" application, which can be found in the same archive as this package, or you can run\
|
||||
\
|
||||
|
||||
\f1 /opt/libjpeg-turbo/bin/uninstall\
|
||||
|
||||
\f0 \
|
||||
from the command line.\
|
||||
\
|
||||
If TurboJPEG/IPP is currently installed, then it must be removed prior to installing libjpeg-turbo.\
|
||||
}
|
||||
1
release/copyright
Executable file
1
release/copyright
Executable file
@@ -0,0 +1 @@
|
||||
Use is subject to the terms of the wxWindows Library License, version 3.1
|
||||
23
release/deb-control.tmpl
Normal file
23
release/deb-control.tmpl
Normal file
@@ -0,0 +1,23 @@
|
||||
Package: {__PKGNAME}
|
||||
Version: {__VERSION}-{__BUILD}
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Architecture: {__ARCH}
|
||||
Essential: no
|
||||
Maintainer: The libjpeg-turbo Project [http://libjpeg-turbo.VirtualGL.org]
|
||||
Description: A toolkit for displaying OpenGL applications to thin clients
|
||||
libjpeg-turbo is a high-speed version of libjpeg for x86 and x86-64 processors
|
||||
which uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG
|
||||
compression and decompression. libjpeg-turbo is generally 2-4x as fast
|
||||
as the unmodified version of libjpeg, all else being equal. libjpeg-turbo
|
||||
also includes a wrapper library for the TurboJPEG API used by VirtualGL and
|
||||
TurboVNC.
|
||||
.
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
|
||||
the TigerVNC and VirtualGL projects made numerous enhancements to the codec,
|
||||
including improved support for Mac OS X, 64-bit support, support for 32-bit
|
||||
and big endian pixel formats, accelerated Huffman encoding/decoding, and
|
||||
various bug fixes. The goal was to produce a fully open source codec that
|
||||
could replace the partially closed source TurboJPEG/IPP codec used by
|
||||
VirtualGL and TurboVNC. libjpeg-turbo generally performs in the range of
|
||||
80-120% of TurboJPEG/IPP. It is faster in some areas but slower in others.
|
||||
126
release/libjpeg-turbo.nsi
Normal file
126
release/libjpeg-turbo.nsi
Normal file
@@ -0,0 +1,126 @@
|
||||
!include x64.nsh
|
||||
Name "libjpeg-turbo SDK for ${PLATFORM}"
|
||||
OutFile ${WBLDDIR}\${APPNAME}.exe
|
||||
InstallDir c:\${APPNAME}
|
||||
|
||||
SetCompressor bzip2
|
||||
|
||||
Page directory
|
||||
Page instfiles
|
||||
|
||||
UninstPage uninstConfirm
|
||||
UninstPage instfiles
|
||||
|
||||
Section "libjpeg-turbo SDK for ${PLATFORM} (required)"
|
||||
!ifdef WIN64
|
||||
${If} ${RunningX64}
|
||||
${DisableX64FSRedirection}
|
||||
${Endif}
|
||||
!endif
|
||||
SectionIn RO
|
||||
!ifdef GCC
|
||||
IfFileExists $SYSDIR/libturbojpeg.dll exists 0
|
||||
!else
|
||||
IfFileExists $SYSDIR/turbojpeg.dll exists 0
|
||||
!endif
|
||||
goto notexists
|
||||
exists:
|
||||
!ifdef GCC
|
||||
MessageBox MB_OK "An existing version of the libjpeg-turbo SDK for ${PLATFORM} is already installed. Please uninstall it first."
|
||||
!else
|
||||
MessageBox MB_OK "An existing version of the libjpeg-turbo SDK for ${PLATFORM} or the TurboJPEG SDK is already installed. Please uninstall it first."
|
||||
!endif
|
||||
quit
|
||||
|
||||
notexists:
|
||||
SetOutPath $SYSDIR
|
||||
!ifdef GCC
|
||||
File "${WLIBDIR}\libturbojpeg.dll"
|
||||
!else
|
||||
File "${WLIBDIR}\turbojpeg.dll"
|
||||
!endif
|
||||
SetOutPath $INSTDIR\bin
|
||||
!ifdef GCC
|
||||
File "/oname=libjpeg-62.dll" "${WLIBDIR}\libjpeg-*.dll"
|
||||
!else
|
||||
File "${WLIBDIR}\jpeg62.dll"
|
||||
!endif
|
||||
SetOutPath $INSTDIR\lib
|
||||
!ifdef GCC
|
||||
File "${WLIBDIR}\libturbojpeg.dll.a"
|
||||
File "${WLIBDIR}\libturbojpeg.a"
|
||||
File "${WLIBDIR}\libjpeg.dll.a"
|
||||
File "${WLIBDIR}\libjpeg.a"
|
||||
!else
|
||||
File "${WLIBDIR}\turbojpeg.lib"
|
||||
File "${WLIBDIR}\turbojpeg-static.lib"
|
||||
File "${WLIBDIR}\jpeg.lib"
|
||||
File "${WLIBDIR}\jpeg-static.lib"
|
||||
!endif
|
||||
SetOutPath $INSTDIR\include
|
||||
File "${WHDRDIR}\jconfig.h"
|
||||
File "${WSRCDIR}\jerror.h"
|
||||
File "${WSRCDIR}\jmorecfg.h"
|
||||
File "${WSRCDIR}\jpeglib.h"
|
||||
File "${WSRCDIR}\turbojpeg.h"
|
||||
SetOutPath $INSTDIR
|
||||
File "${WSRCDIR}\README"
|
||||
File "${WSRCDIR}\README-turbo.txt"
|
||||
File "${WSRCDIR}\libjpeg.doc"
|
||||
File "${WSRCDIR}\LGPL.txt"
|
||||
File "${WSRCDIR}\LICENSE.txt"
|
||||
|
||||
WriteRegStr HKLM "SOFTWARE\${APPNAME} ${VERSION}" "Install_Dir" "$INSTDIR"
|
||||
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "DisplayName" "libjpeg-turbo SDK v${VERSION} for ${PLATFORM}"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "UninstallString" '"$INSTDIR\uninstall_${VERSION}.exe"'
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoRepair" 1
|
||||
WriteUninstaller "uninstall_${VERSION}.exe"
|
||||
SectionEnd
|
||||
|
||||
Section "Uninstall"
|
||||
!ifdef WIN64
|
||||
${If} ${RunningX64}
|
||||
${DisableX64FSRedirection}
|
||||
${Endif}
|
||||
!endif
|
||||
|
||||
SetShellVarContext all
|
||||
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}"
|
||||
DeleteRegKey HKLM "SOFTWARE\${APPNAME} ${VERSION}"
|
||||
|
||||
!ifdef GCC
|
||||
Delete $INSTDIR\bin\libjpeg-62.dll
|
||||
Delete $SYSDIR\libturbojpeg.dll
|
||||
Delete $INSTDIR\lib\libturbojpeg.dll.a"
|
||||
Delete $INSTDIR\lib\libturbojpeg.a"
|
||||
Delete $INSTDIR\lib\libjpeg.dll.a"
|
||||
Delete $INSTDIR\lib\libjpeg.a"
|
||||
!else
|
||||
Delete $INSTDIR\bin\jpeg62.dll
|
||||
Delete $SYSDIR\turbojpeg.dll
|
||||
Delete $INSTDIR\lib\jpeg.lib
|
||||
Delete $INSTDIR\lib\jpeg-static.lib
|
||||
Delete $INSTDIR\lib\turbojpeg.lib
|
||||
Delete $INSTDIR\lib\turbojpeg-static.lib
|
||||
!endif
|
||||
Delete $INSTDIR\include\jconfig.h"
|
||||
Delete $INSTDIR\include\jerror.h"
|
||||
Delete $INSTDIR\include\jmorecfg.h"
|
||||
Delete $INSTDIR\include\jpeglib.h"
|
||||
Delete $INSTDIR\include\turbojpeg.h"
|
||||
Delete $INSTDIR\uninstall_${VERSION}.exe
|
||||
Delete $INSTDIR\README
|
||||
Delete $INSTDIR\README-turbo.txt
|
||||
Delete $INSTDIR\libjpeg.doc
|
||||
Delete $INSTDIR\LGPL.txt
|
||||
Delete $INSTDIR\LICENSE.txt
|
||||
|
||||
RMDir "$INSTDIR\include"
|
||||
RMDir "$INSTDIR\lib"
|
||||
RMDir "$INSTDIR\bin"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
SectionEnd
|
||||
107
release/libjpeg-turbo.spec
Normal file
107
release/libjpeg-turbo.spec
Normal file
@@ -0,0 +1,107 @@
|
||||
%ifarch x86_64
|
||||
%define __lib lib64
|
||||
%else
|
||||
%define __lib lib
|
||||
%endif
|
||||
|
||||
Summary: A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs
|
||||
Name: %{_name}
|
||||
Version: %{_version}
|
||||
Vendor: The libjpeg-turbo Project
|
||||
URL: http://libjpeg-turbo.virtualgl.org
|
||||
Group: System Environment/Libraries
|
||||
#-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
|
||||
Release: %{_build}
|
||||
License: wxWindows Library License, v3.1
|
||||
BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
|
||||
Prereq: /sbin/ldconfig
|
||||
Provides: %{name} = %{version}-%{release}, turbojpeg = 2.00
|
||||
Obsoletes: turbojpeg
|
||||
|
||||
%description
|
||||
libjpeg-turbo is a high-speed version of libjpeg for x86 and x86-64 processors
|
||||
which uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG
|
||||
compression and decompression. libjpeg-turbo is generally 2-4x as fast
|
||||
as the unmodified version of libjpeg, all else being equal. libjpeg-turbo also
|
||||
includes a wrapper library for the TurboJPEG API used by VirtualGL and
|
||||
TurboVNC.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
|
||||
the TigerVNC and VirtualGL projects made numerous enhancements to the codec,
|
||||
including improved support for Mac OS X, 64-bit support, support for 32-bit
|
||||
and big endian pixel formats, accelerated Huffman encoding/decoding, and
|
||||
various bug fixes. The goal was to produce a fully open source codec that
|
||||
could replace the partially closed source TurboJPEG/IPP codec used by VirtualGL
|
||||
and TurboVNC. libjpeg-turbo generally performs in the range of 80-120% of
|
||||
TurboJPEG/IPP. It is faster in some areas but slower in others.
|
||||
|
||||
#-->%prep
|
||||
#-->%setup -q
|
||||
|
||||
#-->%build
|
||||
#-->configure libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man --with-pic
|
||||
#-->make DESTDIR=$RPM_BUILD_ROOT libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man
|
||||
|
||||
%install
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man
|
||||
rm -f $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/*.la
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/%{__lib}
|
||||
mv $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/libturbojpeg.* $RPM_BUILD_ROOT/usr/%{__lib}
|
||||
/sbin/ldconfig -n $RPM_BUILD_ROOT/opt/%{name}/%{__lib}
|
||||
/sbin/ldconfig -n $RPM_BUILD_ROOT/usr/%{__lib}
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/include
|
||||
mv $RPM_BUILD_ROOT/opt/%{name}/include/turbojpeg.h $RPM_BUILD_ROOT/usr/include
|
||||
ln -fs /usr/include/turbojpeg.h $RPM_BUILD_ROOT/opt/%{name}/include/
|
||||
ln -fs /usr/%{__lib}/libturbojpeg.a $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/
|
||||
%ifarch x86_64
|
||||
%else
|
||||
ln -fs %{__lib} $RPM_BUILD_ROOT/opt/%{name}/lib32
|
||||
%endif
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc %{_srcdir}/README-turbo.txt %{_srcdir}/README %{_srcdir}/libjpeg.doc %{_srcdir}/usage.doc %{_srcdir}/LICENSE.txt %{_srcdir}/LGPL.txt
|
||||
%dir /opt/%{name}
|
||||
%dir /opt/%{name}/bin
|
||||
/opt/%{name}/bin/cjpeg
|
||||
/opt/%{name}/bin/djpeg
|
||||
/opt/%{name}/bin/jpegtran
|
||||
/opt/%{name}/bin/rdjpgcom
|
||||
/opt/%{name}/bin/wrjpgcom
|
||||
%dir /opt/%{name}/%{__lib}
|
||||
%ifarch x86_64
|
||||
%else
|
||||
/opt/%{name}/lib32
|
||||
%endif
|
||||
/opt/%{name}/%{__lib}/libjpeg.so.62.0.0
|
||||
/opt/%{name}/%{__lib}/libjpeg.so.62
|
||||
/opt/%{name}/%{__lib}/libjpeg.so
|
||||
/opt/%{name}/%{__lib}/libjpeg.a
|
||||
/opt/%{name}/%{__lib}/libturbojpeg.a
|
||||
/usr/%{__lib}/libturbojpeg.so
|
||||
/usr/%{__lib}/libturbojpeg.a
|
||||
/usr/include/turbojpeg.h
|
||||
%dir /opt/%{name}/include
|
||||
/opt/%{name}/include/jconfig.h
|
||||
/opt/%{name}/include/jerror.h
|
||||
/opt/%{name}/include/jmorecfg.h
|
||||
/opt/%{name}/include/jpeglib.h
|
||||
/opt/%{name}/include/turbojpeg.h
|
||||
%dir /opt/%{name}/man
|
||||
%dir /opt/%{name}/man/man1
|
||||
/opt/%{name}/man/man1/cjpeg.1*
|
||||
/opt/%{name}/man/man1/djpeg.1*
|
||||
/opt/%{name}/man/man1/jpegtran.1*
|
||||
/opt/%{name}/man/man1/rdjpgcom.1*
|
||||
/opt/%{name}/man/man1/wrjpgcom.1*
|
||||
|
||||
%changelog
|
||||
49
release/makecygwinpkg
Executable file
49
release/makecygwinpkg
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 <package name> <version> <source dir.>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -lt 3 ]; then usage $0; fi
|
||||
PACKAGE_NAME=$1
|
||||
VERSION=$2
|
||||
SRCDIR=$3
|
||||
|
||||
umask 022
|
||||
rm -f $PACKAGE_NAME-$VERSION-cygwin.tar.bz2
|
||||
TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX`
|
||||
__PWD=`pwd`
|
||||
make install DESTDIR=$TMPDIR/pkg mandir=/opt/$PACKAGE_NAME/man
|
||||
rm $TMPDIR/pkg/opt/$PACKAGE_NAME/lib/*.la
|
||||
DOCDIR=$TMPDIR/pkg/usr/share/doc/$PACKAGE_NAME-$VERSION
|
||||
mkdir -p $DOCDIR
|
||||
install -m 644 $SRCDIR/README-turbo.txt $DOCDIR
|
||||
install -m 644 $SRCDIR/README $DOCDIR
|
||||
install -m 644 $SRCDIR/libjpeg.doc $DOCDIR
|
||||
install -m 644 $SRCDIR/usage.doc $DOCDIR
|
||||
install -m 644 $SRCDIR/LICENSE.txt $DOCDIR
|
||||
install -m 644 $SRCDIR/LGPL.txt $DOCDIR
|
||||
ln -fs lib $TMPDIR/pkg/opt/$PACKAGE_NAME/lib32
|
||||
cd $TMPDIR/pkg
|
||||
tar cfj ../$PACKAGE_NAME-$VERSION-cygwin.tar.bz2 *
|
||||
cd $__PWD
|
||||
mv $TMPDIR/*.tar.bz2 .
|
||||
|
||||
exit 0
|
||||
94
release/makedpkg
Normal file
94
release/makedpkg
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
sudo rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 <package name> <version> <build> <DEB architecture> <source dir.>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
makedeb()
|
||||
{
|
||||
SUPPLEMENT=$1
|
||||
DIRNAME=$PACKAGE_NAME
|
||||
|
||||
if [ $SUPPLEMENT = 1 ]; then
|
||||
PACKAGE_NAME=$PACKAGE_NAME\32
|
||||
DEBARCH=amd64
|
||||
__LIB=lib32
|
||||
else
|
||||
__LIB=lib
|
||||
fi
|
||||
|
||||
umask 022
|
||||
rm -f $PACKAGE_NAME\_$DEBARCH.deb
|
||||
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
|
||||
mkdir $TMPDIR/DEBIAN
|
||||
(cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
|
||||
| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
|
||||
| sed s/{__ARCH}/$DEBARCH/g > $TMPDIR/DEBIAN/control)
|
||||
|
||||
make install prefix=$TMPDIR/opt/$DIRNAME libdir=$TMPDIR/opt/$DIRNAME/$__LIB mandir=$TMPDIR/opt/$DIRNAME/man
|
||||
rm -f $TMPDIR/opt/$DIRNAME/$__LIB/*.la
|
||||
|
||||
if [ $SUPPLEMENT = 1 ]; then
|
||||
rm -rf $TMPDIR/opt/$DIRNAME/include
|
||||
rm -rf $TMPDIR/opt/$DIRNAME/man
|
||||
rm -rf $TMPDIR/opt/$DIRNAME/bin
|
||||
fi
|
||||
|
||||
mkdir -p $TMPDIR/usr/$__LIB
|
||||
mv $TMPDIR/opt/$DIRNAME/$__LIB/libturbojpeg.* $TMPDIR/usr/$__LIB
|
||||
ln -fs /usr/$__LIB/libturbojpeg.a $TMPDIR/opt/$DIRNAME/$__LIB/
|
||||
/sbin/ldconfig -n $TMPDIR/opt/$DIRNAME/$__LIB
|
||||
/sbin/ldconfig -n $TMPDIR/usr/$__LIB
|
||||
|
||||
if [ ! $SUPPLEMENT = 1 ]; then
|
||||
if [ "$DEBARCH" = "amd64" ]; then
|
||||
ln -fs lib $TMPDIR/opt/$DIRNAME/lib64
|
||||
else
|
||||
if [ ! "$__LIB" = "lib32" ]; then
|
||||
ln -fs lib $TMPDIR/opt/$DIRNAME/lib32
|
||||
fi
|
||||
fi
|
||||
mkdir -p $TMPDIR/usr/include
|
||||
mv $TMPDIR/opt/$DIRNAME/include/turbojpeg.h $TMPDIR/usr/include
|
||||
ln -fs /usr/include/turbojpeg.h $TMPDIR/opt/$DIRNAME/include/
|
||||
mkdir -p $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
install -m 644 $SRCDIR/LICENSE.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
install -m 644 $SRCDIR/LGPL.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
install -m 644 $SRCDIR/README-turbo.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
install -m 644 $SRCDIR/README $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
install -m 644 $SRCDIR/libjpeg.doc $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
install -m 644 $SRCDIR/usage.doc $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
|
||||
fi
|
||||
|
||||
sudo chown -Rh root:root $TMPDIR/*
|
||||
dpkg -b $TMPDIR $PACKAGE_NAME\_$DEBARCH.deb
|
||||
}
|
||||
|
||||
if [ $# -lt 5 ]; then usage $0; fi
|
||||
PACKAGE_NAME=$1
|
||||
VERSION=$2
|
||||
BUILD=$3
|
||||
DEBARCH=$4
|
||||
SRCDIR=$5
|
||||
|
||||
makedeb 0
|
||||
if [ "$DEBARCH" = "i386" ]; then makedeb 1; fi
|
||||
|
||||
exit
|
||||
158
release/makemacpkg
Normal file
158
release/makemacpkg
Normal file
@@ -0,0 +1,158 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
sudo rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 <package name> <version> <build> <source dir.> [universal]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
UNIVERSAL=0
|
||||
|
||||
if [ $# -lt 4 ]; then usage $0; fi
|
||||
PACKAGE_NAME=$1
|
||||
VERSION=$2
|
||||
BUILD=$3
|
||||
SRCDIR=$4
|
||||
if [ $# -gt 4 ]; then
|
||||
if [ "$5" = "universal" ]; then UNIVERSAL=1; fi
|
||||
fi
|
||||
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||
|
||||
if [ -f $PACKAGE_NAME.dmg ]; then
|
||||
rm -f $PACKAGE_NAME.dmg
|
||||
fi
|
||||
|
||||
umask 022
|
||||
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
|
||||
PKGROOT=$TMPDIR/pkg/Package_Root
|
||||
mkdir -p $PKGROOT
|
||||
mkdir -p $PKGROOT/opt/$PACKAGE_NAME/bin
|
||||
make install DESTDIR=$PKGROOT mandir=/opt/$PACKAGE_NAME/man
|
||||
rm -f $PKGROOT/opt/$PACKAGE_NAME/lib/*.la
|
||||
mkdir -p $PKGROOT/usr/lib
|
||||
mv $PKGROOT/opt/$PACKAGE_NAME/lib/libturbojpeg.* $PKGROOT/usr/lib
|
||||
mkdir -p $PKGROOT/usr/include
|
||||
mv $PKGROOT/opt/$PACKAGE_NAME/include/turbojpeg.h $PKGROOT/usr/include
|
||||
|
||||
if [ $UNIVERSAL = 1 ]; then
|
||||
if [ ! -d $SRCDIR/osxx86 ]; then
|
||||
mkdir -p $SRCDIR/osxx86
|
||||
fi
|
||||
mkdir -p $TMPDIR/dist.x86
|
||||
pushd $SRCDIR/osxx86
|
||||
sh $SRCDIR/configure --with-pic \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
|
||||
CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -m32'
|
||||
make install DESTDIR=$TMPDIR/dist.x86
|
||||
popd
|
||||
if [ ! -h $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib -a \
|
||||
! -h $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib ]; then
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib
|
||||
elif [ ! -h $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib -a \
|
||||
! -h $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib ]; then
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib
|
||||
fi
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.a \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libturbojpeg.dylib \
|
||||
-arch x86_64 $PKGROOT/usr/lib/libturbojpeg.dylib \
|
||||
-output $PKGROOT/usr/lib/libturbojpeg.dylib
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libturbojpeg.a \
|
||||
-arch x86_64 $PKGROOT/usr/lib/libturbojpeg.a \
|
||||
-output $PKGROOT/usr/lib/libturbojpeg.a
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/cjpeg \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/cjpeg \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/bin/cjpeg
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/djpeg \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/djpeg \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/bin/djpeg
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/jpegtran \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/jpegtran \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/bin/jpegtran
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/rdjpgcom \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/rdjpgcom \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/bin/rdjpgcom
|
||||
lipo -create \
|
||||
-arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/wrjpgcom \
|
||||
-arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/wrjpgcom \
|
||||
-output $PKGROOT/opt/$PACKAGE_NAME/bin/wrjpgcom
|
||||
|
||||
fi
|
||||
|
||||
install_name_tool -id /opt/$PACKAGE_NAME/lib/libjpeg.62.dylib $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib
|
||||
install_name_tool -id libturbojpeg.dylib $PKGROOT/usr/lib/libturbojpeg.dylib
|
||||
|
||||
ln -fs /usr/include/turbojpeg.h $PKGROOT/opt/$PACKAGE_NAME/include/
|
||||
ln -fs /usr/lib/libturbojpeg.a $PKGROOT/opt/$PACKAGE_NAME/lib/
|
||||
ln -fs lib $PKGROOT/opt/$PACKAGE_NAME/lib32
|
||||
ln -fs lib $PKGROOT/opt/$PACKAGE_NAME/lib64
|
||||
|
||||
mkdir -p $PKGROOT/Library/Documentation/$PACKAGE_NAME
|
||||
chmod 1775 $PKGROOT/Library
|
||||
chmod 775 $PKGROOT/Library/Documentation
|
||||
mkdir -p $TMPDIR/pkg/Resources
|
||||
|
||||
(cat $SRCDIR/release/Description.plist.tmpl | sed s/{__VERSION}/$VERSION/g \
|
||||
| sed s/{__APPNAME}/$PACKAGE_NAME/g \
|
||||
> $TMPDIR/pkg/Description.plist)
|
||||
(cat $SRCDIR/release/Info.plist.tmpl | sed s/{__VERSION}/$VERSION/g \
|
||||
| sed s/{__BUILD}/$BUILD/g > $TMPDIR/pkg/Info.plist)
|
||||
(cat $SRCDIR/release/uninstall.sh.tmpl \
|
||||
| sed s/{__APPNAME}/$PACKAGE_NAME/g \
|
||||
> $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall)
|
||||
chmod 755 $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall
|
||||
|
||||
install -m 644 $SRCDIR/LICENSE.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/LICENSE.txt
|
||||
install -m 644 $SRCDIR/LGPL.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/LGPL.txt
|
||||
install -m 644 $SRCDIR/README-turbo.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/README-turbo.txt
|
||||
install -m 644 $SRCDIR/README $PKGROOT/Library/Documentation/$PACKAGE_NAME/README
|
||||
install -m 644 $SRCDIR/libjpeg.doc $PKGROOT/Library/Documentation/$PACKAGE_NAME/libjpeg.doc
|
||||
install -m 644 $SRCDIR/usage.doc $PKGROOT/Library/Documentation/$PACKAGE_NAME/usage.doc
|
||||
|
||||
sudo chown -R root:admin $PKGROOT
|
||||
sudo chown -R root:0 $PKGROOT/usr
|
||||
cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.rtf $TMPDIR/pkg/Resources/
|
||||
|
||||
mkdir $TMPDIR/dmg
|
||||
$PACKAGEMAKER -build -v -p $TMPDIR/dmg/$PACKAGE_NAME.pkg \
|
||||
-f $PKGROOT -r $TMPDIR/pkg/Resources \
|
||||
-i $TMPDIR/pkg/Info.plist -d $TMPDIR/pkg/Description.plist
|
||||
install -m 644 $SRCDIR/release/uninstall.applescript $TMPDIR
|
||||
sudo osacompile -t APPL -o "$TMPDIR/dmg/Uninstall $PACKAGE_NAME.app" $TMPDIR/uninstall.applescript
|
||||
sudo chown -R $USER "$TMPDIR/dmg/Uninstall $PACKAGE_NAME.app"
|
||||
hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \
|
||||
-srcfolder "$TMPDIR/dmg" \
|
||||
$TMPDIR/$PACKAGE_NAME.dmg
|
||||
cp $TMPDIR/$PACKAGE_NAME.dmg .
|
||||
|
||||
exit
|
||||
42
release/makerpm
Normal file
42
release/makerpm
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 <package name> <version> <build> <RPM architecture> <source dir.>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -lt 5 ]; then usage $0; fi
|
||||
PACKAGE_NAME=$1
|
||||
VERSION=$2
|
||||
BUILD=$3
|
||||
RPMARCH=$4
|
||||
SRCDIR=$5
|
||||
|
||||
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
|
||||
mkdir -p $TMPDIR/RPMS
|
||||
ln -fs `pwd` $TMPDIR/BUILD
|
||||
rm -f $PACKAGE_NAME.$RPMARCH.rpm
|
||||
rpmbuild -bb --define "_name $PACKAGE_NAME" \
|
||||
--define "_blddir $TMPDIR/buildroot" --define "_topdir $TMPDIR" \
|
||||
--define "_version $VERSION" --define "_build $BUILD" \
|
||||
--define "_srcdir $SRCDIR" --target $RPMARCH \
|
||||
$SRCDIR/release/libjpeg-turbo.spec
|
||||
cp $TMPDIR/RPMS/$RPMARCH/$PACKAGE_NAME-$VERSION-$BUILD.$RPMARCH.rpm $PACKAGE_NAME.$RPMARCH.rpm
|
||||
|
||||
exit
|
||||
51
release/makesrpm
Normal file
51
release/makesrpm
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 <package name> <version> <build> <RPM architecture> <source dir.>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -lt 4 ]; then usage $0; fi
|
||||
PACKAGE_NAME=$1
|
||||
VERSION=$2
|
||||
BUILD=$3
|
||||
SRCDIR=$4
|
||||
|
||||
TARBALL=$PACKAGE_NAME-$VERSION.tar.gz
|
||||
if [ ! -f ./$TARBALL ]; then
|
||||
echo ./$TARBALL does not exist. Run make dist-gzip first.
|
||||
exit -1
|
||||
fi
|
||||
|
||||
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
|
||||
mkdir -p $TMPDIR/RPMS
|
||||
mkdir -p $TMPDIR/SRPMS
|
||||
mkdir -p $TMPDIR/BUILD
|
||||
mkdir -p $TMPDIR/SOURCES
|
||||
mkdir -p $TMPDIR/SPECS
|
||||
rm -f $PACKAGE_NAME.src.rpm
|
||||
cp $TARBALL $TMPDIR/SOURCES
|
||||
cat $SRCDIR/release/libjpeg-turbo.spec | sed s/%{_name}/$PACKAGE_NAME/g \
|
||||
| sed s/%{_version}/$VERSION/g | sed s/%{_build}/$BUILD/g \
|
||||
| sed s/%{_blddir}/%{_tmppath}/g | sed s@%{_srcdir}/@@g \
|
||||
| sed s/#--\>//g >$TMPDIR/SPECS/libjpeg-turbo.spec
|
||||
rpmbuild -bs --define "_topdir $TMPDIR" $TMPDIR/SPECS/libjpeg-turbo.spec
|
||||
cp $TMPDIR/SRPMS/$PACKAGE_NAME-$VERSION-$BUILD.src.rpm $PACKAGE_NAME.src.rpm
|
||||
|
||||
exit
|
||||
133
release/makesunpkg
Normal file
133
release/makesunpkg
Normal file
@@ -0,0 +1,133 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 <package name> <version> <build> <package architecture> <source dir.> [combined]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
COMBINED=0
|
||||
|
||||
if [ $# -lt 4 ]; then usage $0; fi
|
||||
PACKAGE_NAME=$1
|
||||
VERSION=$2
|
||||
BUILD=$3
|
||||
PKGARCH=$4
|
||||
SRCDIR=$5
|
||||
CC=$6
|
||||
CXX=$7
|
||||
if [ $# -gt 7 ]; then
|
||||
if [ "$8" = "combined" ]; then COMBINED=1; fi
|
||||
fi
|
||||
|
||||
umask 022
|
||||
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
|
||||
rm -f $PACKAGE_NAME.pkg.bz2
|
||||
cp $SRCDIR/release/copyright $TMPDIR
|
||||
touch $TMPDIR/depend
|
||||
cat $SRCDIR/release/pkginfo.tmpl | sed s/{__VERSION}/$VERSION/g \
|
||||
| sed s/{__BUILD}/$BUILD/g | sed s/{__APPNAME}/$PACKAGE_NAME/g \
|
||||
| sed s/{__PKGNAME}/$PACKAGE_NAME/g > $TMPDIR/pkginfo
|
||||
|
||||
if [ "$PKGARCH" = "i386" ]; then
|
||||
__LIB=lib
|
||||
else
|
||||
__LIB=lib/$PKGARCH
|
||||
fi
|
||||
|
||||
# This mess is to work around a bug in /usr/ccs/bin/make
|
||||
if [ $COMBINED = 1 ]; then
|
||||
if [ ! -d $SRCDIR/solx86 ]; then
|
||||
mkdir -p $SRCDIR/solx86
|
||||
fi
|
||||
PWD=`pwd`
|
||||
cd $SRCDIR/solx86
|
||||
sh $SRCDIR/configure --with-pic CC=$CC CXX=$CXX CFLAGS= CXXFLAGS= LDFLAGS= host_alias=
|
||||
make install DESTDIR=$TMPDIR mandir=/opt/$PACKAGE_NAME/man AM_MAKEFLAGS="mandir=/opt/$PACKAGE_NAME/man"
|
||||
cd $PWD
|
||||
fi
|
||||
make install DESTDIR=$TMPDIR libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man AM_MAKEFLAGS="libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man"
|
||||
rm -f $TMPDIR/opt/$PACKAGE_NAME/$__LIB/*.la
|
||||
mkdir -p $TMPDIR/opt/$PACKAGE_NAME/doc
|
||||
cp $SRCDIR/LICENSE.txt $SRCDIR/LGPL.txt $SRCDIR/README-turbo.txt $SRCDIR/README $SRCDIR/libjpeg.doc $SRCDIR/usage.doc $TMPDIR/opt/$PACKAGE_NAME/doc
|
||||
chmod 644 $TMPDIR/opt/$PACKAGE_NAME/doc/*
|
||||
|
||||
cat >$TMPDIR/proto <<EOF
|
||||
i copyright
|
||||
i depend
|
||||
i pkginfo
|
||||
d none $PACKAGE_NAME 0755 root bin
|
||||
d none $PACKAGE_NAME/bin 0755 root bin
|
||||
f none $PACKAGE_NAME/bin/cjpeg 0755 root bin
|
||||
f none $PACKAGE_NAME/bin/djpeg 0755 root bin
|
||||
f none $PACKAGE_NAME/bin/jpegtran 0755 root bin
|
||||
f none $PACKAGE_NAME/bin/rdjpgcom 0755 root bin
|
||||
f none $PACKAGE_NAME/bin/wrjpgcom 0755 root bin
|
||||
d none $PACKAGE_NAME/lib 0755 root bin
|
||||
EOF
|
||||
if [ $COMBINED = 1 ]; then
|
||||
cat >>$TMPDIR/proto <<EOF
|
||||
f none $PACKAGE_NAME/lib/libjpeg.so.62.0.0 0755 root bin
|
||||
s none $PACKAGE_NAME/lib/libjpeg.so.62=libjpeg.so.62.0.0
|
||||
s none $PACKAGE_NAME/lib/libjpeg.so=libjpeg.so.62.0.0
|
||||
f none $PACKAGE_NAME/lib/libjpeg.a 0644 root bin
|
||||
f none $PACKAGE_NAME/lib/libturbojpeg.so 0755 root bin
|
||||
f none $PACKAGE_NAME/lib/libturbojpeg.a 0644 root bin
|
||||
EOF
|
||||
fi
|
||||
if [ "${__LIB}" != "lib" ]; then
|
||||
echo d none $PACKAGE_NAME/${__LIB} 0755 root bin >>$TMPDIR/proto
|
||||
echo s none $PACKAGE_NAME/lib64=${__LIB} >>$TMPDIR/proto
|
||||
echo s none $PACKAGE_NAME/lib/64=$PKGARCH >>$TMPDIR/proto
|
||||
fi
|
||||
cat >>$TMPDIR/proto <<EOF
|
||||
f none $PACKAGE_NAME/${__LIB}/libjpeg.so.62.0.0 0755 root bin
|
||||
s none $PACKAGE_NAME/${__LIB}/libjpeg.so.62=libjpeg.so.62.0.0
|
||||
s none $PACKAGE_NAME/${__LIB}/libjpeg.so=libjpeg.so.62.0.0
|
||||
f none $PACKAGE_NAME/${__LIB}/libjpeg.a 0644 root bin
|
||||
f none $PACKAGE_NAME/${__LIB}/libturbojpeg.so 0755 root bin
|
||||
f none $PACKAGE_NAME/${__LIB}/libturbojpeg.a 0644 root bin
|
||||
s none $PACKAGE_NAME/lib32=lib
|
||||
d none $PACKAGE_NAME/man 0755 root bin
|
||||
d none $PACKAGE_NAME/man/man1 0755 root bin
|
||||
d none $PACKAGE_NAME/man/man1/cjpeg.1 0644 root bin
|
||||
d none $PACKAGE_NAME/man/man1/djpeg.1 0644 root bin
|
||||
d none $PACKAGE_NAME/man/man1/jpegtran.1 0644 root bin
|
||||
d none $PACKAGE_NAME/man/man1/rdjpgcom.1 0644 root bin
|
||||
d none $PACKAGE_NAME/man/man1/wrjpgcom.1 0644 root bin
|
||||
d none $PACKAGE_NAME/include 0755 root bin
|
||||
f none $PACKAGE_NAME/include/jconfig.h 0644 root bin
|
||||
f none $PACKAGE_NAME/include/jerror.h 0644 root bin
|
||||
f none $PACKAGE_NAME/include/jmorecfg.h 0644 root bin
|
||||
f none $PACKAGE_NAME/include/jpeglib.h 0644 root bin
|
||||
f none $PACKAGE_NAME/include/turbojpeg.h 0644 root bin
|
||||
d none $PACKAGE_NAME/doc 0755 root bin
|
||||
f none $PACKAGE_NAME/doc/LGPL.txt 0644 root bin
|
||||
f none $PACKAGE_NAME/doc/libjpeg.doc 0644 root bin
|
||||
f none $PACKAGE_NAME/doc/LICENSE.txt 0644 root bin
|
||||
f none $PACKAGE_NAME/doc/README 0644 root bin
|
||||
f none $PACKAGE_NAME/doc/README-turbo.txt 0644 root bin
|
||||
f none $PACKAGE_NAME/doc/usage.doc 0644 root bin
|
||||
EOF
|
||||
|
||||
pkgmk -o -r $TMPDIR/opt -d $TMPDIR -a i386 -f $TMPDIR/proto
|
||||
pkgtrans -s $TMPDIR $TMPDIR/$PACKAGE_NAME.pkg $PACKAGE_NAME
|
||||
bzip2 $TMPDIR/$PACKAGE_NAME.pkg
|
||||
cp $TMPDIR/$PACKAGE_NAME.pkg.bz2 .
|
||||
|
||||
exit
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user