Compare commits

...

28 Commits

Author SHA1 Message Date
DRC
a51ada6706 Use new e-mail alias
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@185 632fc199-4ca6-4c93-a231-07263d6284db
2010-05-11 00:39:45 +00:00
DRC
ef663e333e Only disable filesystem redirection in the 64-bit installers
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@184 632fc199-4ca6-4c93-a231-07263d6284db
2010-05-10 23:39:22 +00:00
DRC
be09b20a40 Handle cases in which MinGW inexplicably builds the DLL as libjpeg-0.dll instead of libjpeg-62.dll
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@183 632fc199-4ca6-4c93-a231-07263d6284db
2010-05-10 22:20:14 +00:00
DRC
9ca2364694 Use "make nsi" instead of "make dist" to be consistent with MinGW build
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@182 632fc199-4ca6-4c93-a231-07263d6284db
2010-05-10 22:19:24 +00:00
DRC
3dc1bc2ded Create separate packages for Win64 binaries
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@181 632fc199-4ca6-4c93-a231-07263d6284db
2010-05-10 22:18:10 +00:00
DRC
1a2219ec26 git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@180 632fc199-4ca6-4c93-a231-07263d6284db 2010-05-10 20:03:36 +00:00
DRC
b6f097f729 xmm6-xmm15 must also be preserved by the callee; Win64 should fully work now
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@179 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-23 15:41:34 +00:00
DRC
d3e320fee7 Win64 should fully work now
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@178 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-21 17:20:12 +00:00
DRC
830d5fccf4 Use 64-bit holding buffer on Win64 for increased performance
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@177 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-20 21:13:26 +00:00
DRC
4132b1d552 Updated (C)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@176 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-20 20:54:03 +00:00
DRC
f9bdeb62e2 Not sure why the cjpeg/djpeg image loaders got disabled, but re-enable them
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@175 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-20 19:16:06 +00:00
DRC
e728ed7a36 Win64 (mostly) works now
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@174 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-20 19:15:09 +00:00
DRC
a644fb05a7 Use correct filenames in headers
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@173 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-20 18:20:13 +00:00
DRC
86d8c0aa26 0.0.93
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@172 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-20 18:12:38 +00:00
DRC
fb096fff78 Only have to use 32-bit mov for r14, since it is populated from the stack
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@171 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-19 18:58:07 +00:00
DRC
14ecb539df Attempt to fix Win64 issues
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@170 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-17 21:57:25 +00:00
DRC
09271951d9 0.0.92
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@169 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-13 07:56:24 +00:00
DRC
7bac07bf12 Added FreeBSD build instructions
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@168 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-10 05:53:35 +00:00
DRC
0f413b2207 Fix x86-64 build on FreeBSD systems
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@167 632fc199-4ca6-4c93-a231-07263d6284db
2010-04-06 20:05:39 +00:00
DRC
97f8ec4b60 I'm not sure why, but this was necessary in order to return the 32-bit performance to the 0.0.90 baseline
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@165 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-20 22:38:53 +00:00
DRC
1e6b5b4884 Clarify license description
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@164 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-20 20:00:51 +00:00
DRC
ae19bf6f15 Add ChangeLog to repository
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@163 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-15 11:40:31 +00:00
DRC
e885a8bf41 Fix data corruption issues when decompressing large JPEG images and/or using buffered I/O. Specifically, decode_mcu_fast() can potentially process more than 1 MCU, so make sure there is enough space in the buffer to accommodate this case. Otherwise, the buffer pointer goes negative, and bad mojo ensues. Also, the fast decoder's method of handling unread markers doesn't make libjpeg's restart handler happy, so disable fast decode when restarts are used.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@162 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-15 11:34:58 +00:00
DRC
0b7d4ed792 Include ChangeLog.txt in dist
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@161 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-03 09:37:58 +00:00
DRC
10a094f0e6 Bump version number
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@160 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-03 09:36:31 +00:00
DRC
f8b77c44f1 Don't allow code path to be forced on a system that doesn't support it
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@159 632fc199-4ca6-4c93-a231-07263d6284db
2010-03-03 08:46:29 +00:00
DRC
048990944f Bleepin' Windows uses LLP64, not LP64
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@158 632fc199-4ca6-4c93-a231-07263d6284db
2010-02-26 23:01:19 +00:00
DRC
d3c7eff53d Oops. Debian users might like documentation as well.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@157 632fc199-4ca6-4c93-a231-07263d6284db
2010-02-25 20:14:10 +00:00
41 changed files with 209 additions and 103 deletions

View File

@@ -128,7 +128,8 @@ Add
--host x86_64-apple-darwin10.0.0 NASM=/opt/local/bin/nasm
to the configure command line. NASM 2.07 from MacPorts must be installed.
to the configure command line. NASM 2.07 or later from MacPorts must be
installed.
32-bit Library Build on 64-bit OS/X
@@ -166,6 +167,29 @@ Add
to the configure command line.
64-bit Library Build on 64-bit FreeBSD
--------------------------------------
Add
--host x86_64-unknown-freebsd
to the configure command line. NASM 2.07 or later from FreeBSD ports must be
installed.
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
---------------------
@@ -251,14 +275,10 @@ This will generate the following files under libjpeg-turbo\windows\:
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
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
NOTE: For unknown reasons, Win64 support doesn't work yet, so at the moment,
you have to run 'make -f win/Makefile WIN64=yes' to get a 64-bit build on
64-bit Windows. The paragraph above will apply once Win64 support is working.
make -f win/Makefile WIN64=no
*******************************************************************************
@@ -299,7 +319,7 @@ make nsi
libjpeg-turbo SDK. This requires the Nullsoft Install System
(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
make -f win/Makefile dist
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

15
ChangeLog.txt Normal file
View File

@@ -0,0 +1,15 @@
Significant changes since 0.0.91
================================
[1] Fixed x86-64 build on FreeBSD systems
[2] 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

View File

@@ -82,7 +82,8 @@ DISTMANS= 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
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
@@ -157,15 +158,20 @@ 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)
endif
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

View File

@@ -28,8 +28,13 @@ libraries can be used as drop-in replacements for libjpeg on most systems.
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 rest of the source code, apart from
these modifications, falls under a less restrictive license (see README.)
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.)
*******************************************************************************
@@ -133,15 +138,15 @@ of libjpeg by setting
If using Cygwin, then set
CPATH=/cygdrive/c/libjpeg-turbo-gcc/include
CPATH=/cygdrive/c/libjpeg-turbo-gcc[64]/include
and
LIBRARY_PATH=/cygdrive/c/libjpeg-turbo-gcc/lib
LIBRARY_PATH=/cygdrive/c/libjpeg-turbo-gcc[64]/lib
If using MinGW, then set
CPATH=/c/libjpeg-turbo-gcc/include
CPATH=/c/libjpeg-turbo-gcc[64]/include
and
LIBRARY_PATH=/c/libjpeg-turbo-gcc/lib
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.)
@@ -161,10 +166,10 @@ 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\include to your system or user INCLUDE environment variable
and c:\libjpeg-turbo\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.)
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

View File

@@ -44,7 +44,14 @@ case "$host_os" in
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
objfmt='BSD-a.out'
else
case "$host_cpu" in
x86_64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
fi
;;
solaris* | sunos* | sysv* | sco*)

View File

@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.56])
AC_INIT([libjpeg-turbo], [0.0.90])
AC_INIT([libjpeg-turbo], [0.0.93])
BUILD=`date +%Y%m%d`
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])

View File

@@ -49,7 +49,7 @@ int jpeg_first_bit_table_init=0;
*/
typedef struct {
long 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;
@@ -384,7 +384,7 @@ dump_buffer (working_state * state)
put_buffer = (put_buffer << size) | code; \
}
#if __WORDSIZE==64
#if __WORDSIZE==64 || defined(_WIN64)
#define DUMP_BITS(code, size) { \
CHECKBUF47() \
@@ -425,7 +425,7 @@ dump_buffer (working_state * state)
int _max=0;
#if __WORDSIZE==64
#if __WORDSIZE==64 || defined(_WIN64)
#define DUMP_VALUE(ht, codevalue, t, nbits) { \
size = ht->ehufsi[codevalue]; \
@@ -489,8 +489,8 @@ LOCAL(boolean)
flush_bits (working_state * state)
{
unsigned char _buffer[BUFSIZE], *buffer;
long put_buffer; int put_bits;
int bytes, bytestocopy, localbuf = 0;
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;
@@ -515,9 +515,9 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
int nbits;
int r, sflag, size, code;
unsigned char _buffer[BUFSIZE], *buffer;
long put_buffer; int put_bits;
size_t put_buffer; int put_bits;
int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];
int bytes, bytestocopy, localbuf = 0;
size_t bytes, bytestocopy; int localbuf = 0;
put_buffer = state->cur.put_buffer;
put_bits = state->cur.put_bits;

View File

@@ -628,7 +628,7 @@ decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/***************************************************************/
#if __WORDSIZE == 64
#if __WORDSIZE == 64 || defined(_WIN64)
#define ENSURE_SHORT \
if (bits_left < 16) { \
@@ -765,20 +765,25 @@ 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 (cinfo->src->bytes_in_buffer >= BUFSIZE) {
if (usefast) {
if (!decode_mcu_fast(cinfo, MCU_data)) return FALSE;
}
else {

View File

@@ -73,9 +73,9 @@ EXTERN(void) jpeg_make_d_derived_tbl
* necessary.
*/
#if __WORDSIZE == 64
#if __WORDSIZE == 64 || defined(_WIN64)
typedef long bit_buf_type; /* type of bit-extraction buffer */
typedef size_t bit_buf_type; /* type of bit-extraction buffer */
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
#else

View File

@@ -122,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.
@@ -317,8 +317,8 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
/* OK, allocate the object from the current pool */
data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */
data_ptr += SIZEOF(small_pool_hdr); /* ...by skipping the header... */
if ((unsigned long)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */
data_ptr += ALIGN_SIZE - (unsigned long)data_ptr % ALIGN_SIZE;
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;
@@ -382,8 +382,8 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */
data_ptr += SIZEOF(small_pool_hdr); /* ...by skipping the header... */
if ((unsigned long)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */
data_ptr += ALIGN_SIZE - (unsigned long)data_ptr % ALIGN_SIZE;
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;
}
@@ -420,7 +420,7 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
/* Make sure each row is properly aligned */
if ((ALIGN_SIZE % SIZEOF(JSAMPLE)) != 0)
out_of_memory(cinfo, 5); /* safety check */
samplesperrow = jround_up(samplesperrow, (2 * ALIGN_SIZE) / SIZEOF(JSAMPLE));
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)) /
@@ -608,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;

View File

@@ -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;
}

View File

@@ -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));
/*

View File

@@ -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));

View File

@@ -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 */
{

View File

@@ -1,3 +1,4 @@
!include x64.nsh
Name "libjpeg-turbo SDK for ${PLATFORM}"
OutFile ${WBLDDIR}\${APPNAME}.exe
InstallDir c:\${APPNAME}
@@ -11,6 +12,11 @@ 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
@@ -35,7 +41,7 @@ Section "libjpeg-turbo SDK for ${PLATFORM} (required)"
!endif
SetOutPath $INSTDIR\bin
!ifdef GCC
File "${WLIBDIR}\libjpeg-62.dll"
File "/oname=libjpeg-62.dll" "${WLIBDIR}\libjpeg-*.dll"
!else
File "${WLIBDIR}\jpeg62.dll"
!endif
@@ -74,6 +80,11 @@ Section "libjpeg-turbo SDK for ${PLATFORM} (required)"
SectionEnd
Section "Uninstall"
!ifdef WIN64
${If} ${RunningX64}
${DisableX64FSRedirection}
${Endif}
!endif
SetShellVarContext all

View File

@@ -49,6 +49,12 @@ mv $TMPDIR/opt/$PACKAGE_NAME/$__LIB/libturbojpeg.* $TMPDIR/usr/$__LIB
/sbin/ldconfig -n $TMPDIR/usr/$__LIB
mkdir -p $TMPDIR/usr/include
mv $TMPDIR/opt/$PACKAGE_NAME/include/turbojpeg.h $TMPDIR/usr/include
mkdir -p $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION
install -m 644 $SRCDIR/LICENSE.txt $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION
install -m 644 $SRCDIR/LGPL.txt $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION
install -m 644 $SRCDIR/README-turbo.txt $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION
install -m 644 $SRCDIR/README $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION
install -m 644 $SRCDIR/libjpeg.doc $TMPDIR/usr/share/doc/$PACKAGE_NAME-$VERSION
sudo chown -Rh root:root $TMPDIR/*
dpkg -b $TMPDIR $PACKAGE_NAME\_$DEBARCH.deb

View File

@@ -6,7 +6,7 @@ SUNW_PKGVERS=1.0
DESC=A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs
VENDOR=The libjpeg-turbo Project
HOTLINE=http://libjpeg-turbo.VirtualGL.org
EMAIL=dcommander@users.sourceforge.net
EMAIL=information@virtualgl.org
MAXINST=1
CATEGORY=application
BASEDIR=/opt

View File

@@ -1,5 +1,6 @@
/* Copyright (C)2004 Landmark Graphics Corporation
* Copyright (C)2005 Sun Microsystems, Inc.
* Copyright (C)2010 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)
@@ -49,7 +50,7 @@ static __inline int numprocs(void)
#ifdef _WIN32
DWORD_PTR ProcAff, SysAff, i; int count=0;
if(!GetProcessAffinityMask(GetCurrentProcess(), &ProcAff, &SysAff)) return(1);
for(i=0; i<sizeof(long)*8; i++) if(ProcAff&(1<<i)) count++;
for(i=0; i<sizeof(long*)*8; i++) if(ProcAff&(1LL<<i)) count++;
return(count);
#elif defined (__APPLE__)
return(1);

View File

@@ -1,5 +1,5 @@
;
; jcclrss2.asm - colorspace conversion (64-bit SSE2)
; jcclrss2-64.asm - colorspace conversion (64-bit SSE2)
;
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
@@ -70,7 +70,7 @@ EXTN(jsimd_rgb_ycc_convert_sse2):
pop rcx
mov rsi, r11
mov rax, r14
mov eax, r14d
test rax,rax
jle near .return
.rowloop:

View File

@@ -1,5 +1,5 @@
;
; jccolss2.asm - colorspace conversion (64-bit SSE2)
; jccolss2-64.asm - colorspace conversion (64-bit SSE2)
;
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.

View File

@@ -1,5 +1,5 @@
;
; jcqnts2f.asm - sample data conversion and quantization (64-bit SSE & SSE2)
; jcqnts2f-64.asm - sample data conversion and quantization (64-bit SSE & SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jcqnts2i.asm - sample data conversion and quantization (64-bit SSE2)
; jcqnts2i-64.asm - sample data conversion and quantization (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jcsamss2.asm - downsampling (64-bit SSE2)
; jcsamss2-64.asm - downsampling (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jdclrss2.asm - colorspace conversion (64-bit SSE2)
; jdclrss2-64.asm - colorspace conversion (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander
@@ -72,7 +72,7 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
pop rcx
mov rdi, r13
mov rax, r14
mov eax, r14d
test rax,rax
jle near .return
.rowloop:

View File

@@ -1,5 +1,5 @@
;
; jdcolss2.asm - colorspace conversion (64-bit SSE2)
; jdcolss2-64.asm - colorspace conversion (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jdmerss2.asm - merged upsampling/color conversion (64-bit SSE2)
; jdmerss2-64.asm - merged upsampling/color conversion (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jdmrgss2.asm - merged upsampling/color conversion (64-bit SSE2)
; jdmrgss2-64.asm - merged upsampling/color conversion (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander
@@ -521,10 +521,10 @@ EXTN(jsimd_h2v2_merged_upsample_sse2):
push rax
%ifdef WIN64
; rcx already parameter 1
mov rdx, rdi
mov r8, rax
mov r9, rbx
mov r8, rcx
mov r9, rdi
mov rcx, rax
mov rdx, rbx
%else
mov rdx, rcx
mov rcx, rdi
@@ -554,10 +554,10 @@ EXTN(jsimd_h2v2_merged_upsample_sse2):
push rax
%ifdef WIN64
; rcx already parameter 1
mov rdx, rdi
mov r8, rax
mov r9, rbx
mov r8, rcx
mov r9, rdi
mov rcx, rax
mov rdx, rbx
%else
mov rdx, rcx
mov rcx, rdi

View File

@@ -1,5 +1,5 @@
;
; jdsamss2.asm - upsampling (64-bit SSE2)
; jdsamss2-64.asm - upsampling (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jfss2fst.asm - fast integer FDCT (64-bit SSE2)
; jfss2fst-64.asm - fast integer FDCT (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jfss2int.asm - accurate integer FDCT (64-bit SSE2)
; jfss2int-64.asm - accurate integer FDCT (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jfsseflt.asm - floating-point FDCT (64-bit SSE)
; jfsseflt-64.asm - floating-point FDCT (64-bit SSE)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jiss2flt.asm - floating-point IDCT (64-bit SSE & SSE2)
; jiss2flt-64.asm - floating-point IDCT (64-bit SSE & SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jiss2fst.asm - fast integer IDCT (64-bit SSE2)
; jiss2fst-64.asm - fast integer IDCT (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jiss2int.asm - accurate integer IDCT (64-bit SSE2)
; jiss2int-64.asm - accurate integer IDCT (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -1,5 +1,5 @@
;
; jiss2red.asm - reduced-size IDCT (64-bit SSE2)
; jiss2red-64.asm - reduced-size IDCT (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander

View File

@@ -48,16 +48,16 @@ init_simd (void)
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCEMMX");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = JSIMD_MMX;
simd_support &= JSIMD_MMX;
env = getenv("JSIMD_FORCE3DNOW");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = JSIMD_3DNOW|JSIMD_MMX;
simd_support &= JSIMD_3DNOW|JSIMD_MMX;
env = getenv("JSIMD_FORCESSE");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = JSIMD_SSE|JSIMD_MMX;
simd_support &= JSIMD_SSE|JSIMD_MMX;
env = getenv("JSIMD_FORCESSE2");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = JSIMD_SSE2;
simd_support &= JSIMD_SSE2;
}
GLOBAL(int)

View File

@@ -24,7 +24,7 @@
* In the PIC cases, we have no guarantee that constants will keep
* their alignment. This macro allows us to verify it at runtime.
*/
#define IS_ALIGNED(ptr, order) (((unsigned long)ptr & ((1 << order) - 1)) == 0)
#define IS_ALIGNED(ptr, order) (((size_t)ptr & ((1 << order) - 1)) == 0)
#define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */

View File

@@ -2,6 +2,7 @@
; jsimdext.inc - common declarations
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2010 D. R. Commander
;
; Based on
; x86 SIMD extension for IJG JPEG library - version 1.02
@@ -310,6 +311,27 @@ const_base:
mov r13, r9
mov r14, [rax+48]
mov r15, [rax+56]
push rsi
push rdi
sub rsp, SIZEOF_XMMWORD
movlpd XMMWORD [rsp], xmm6
sub rsp, SIZEOF_XMMWORD
movlpd XMMWORD [rsp], xmm7
%endmacro
%imacro uncollect_args 0
movlpd xmm7, XMMWORD [rsp]
add rsp, SIZEOF_XMMWORD
movlpd xmm6, XMMWORD [rsp]
add rsp, SIZEOF_XMMWORD
pop rdi
pop rsi
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
%endmacro
%else
@@ -329,8 +351,6 @@ const_base:
mov r15, r9
%endmacro
%endif
%imacro uncollect_args 0
pop r15
pop r14
@@ -342,6 +362,8 @@ const_base:
%endif
%endif
; --------------------------------------------------------------------------
; Defines picked up from the C headers
;

View File

@@ -192,7 +192,8 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h,
j->cinfo.image_height-j->cinfo.next_scanline);
}
jpeg_finish_compress(&j->cinfo);
*size=TJBUFSIZE(j->cinfo.image_width, j->cinfo.image_height)-(j->jdms.free_in_buffer);
*size=TJBUFSIZE(j->cinfo.image_width, j->cinfo.image_height)
-(unsigned long)(j->jdms.free_in_buffer);
if(row_pointer) free(row_pointer);
return 0;

View File

@@ -229,11 +229,19 @@ $(ODIR)/jpegut.exe: $(ODIR)/jpegut.obj $(ODIR)/turbojpeg.lib
$(LINK) $(LDFLAGS) -out:$@ $^
dist: all
ifeq ($(WIN64), yes)
nsi: all
$(RM) $(ODIR)/libjpeg-turbo64.exe
makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo64 \
-DWLIBDIR=windows64 -DWSRCDIR=. -DWBLDDIR=windows64 -DWHDRDIR=win \
-DPLATFORM="Visual C++ 64-bit" -DWIN64 release/libjpeg-turbo.nsi
else
nsi: all
$(RM) $(ODIR)/libjpeg-turbo.exe
makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo \
-DWLIBDIR=windows -DWSRCDIR=. -DWBLDDIR=windows -DWHDRDIR=win \
-DPLATFORM="Visual C++" release/libjpeg-turbo.nsi
endif
test: testclean $(ODIR)/cjpeg.exe $(ODIR)/djpeg.exe $(ODIR)/jpegtran.exe \

View File

@@ -1,20 +1,19 @@
ODIR = windows
WIN64 = no
# Win64 doesn't work yet, for unknown reasons
#ifeq ($(PROCESSOR_ARCHITECTURE), AMD64)
# WIN64 = yes
#else
# ifeq ($(PROCESSOR_ARCHITEW6432), AMD64)
# WIN64 = yes
# endif
#endif
ifeq ($(PROCESSOR_ARCHITECTURE), AMD64)
WIN64 = yes
else
ifeq ($(PROCESSOR_ARCHITEW6432), AMD64)
WIN64 = yes
endif
endif
ifeq ($(WIN64), yes)
ODIR = windows64
endif
_DUMMY := $(shell mkdir -p $(ODIR))
VERSION = 0.0.90
VERSION = 0.0.93
CC = "cl" -nologo
CXX = "cl" -EHsc -nologo
@@ -27,8 +26,8 @@ ifeq ($(NASM),)
NASM = nasm
endif
CFLAGS = -W3 -wd4996 -Iwin -I.
CDEFINES = -DWIN32 -D_CRT_SECURE_NO_DEPRECATE
CFLAGS = -W3 -wd4996 -Iwin -I. -DBMP_SUPPORTED -DGIF_SUPPORTED \
-DPPM_SUPPORTED -DTARGA_SUPPORTED
ifeq ($(WIN64), yes)
NAFLAGS = -fwin64 -DWIN64 -DMSVC -D__x86_64__ -Iwin/
else