Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit 3c9a3b6

Browse files
author
ijd.org
committed
Imported from jpegsrc.v8a.tar.gz.
1 parent 9f51d19 commit 3c9a3b6

11 files changed

+111
-61
lines changed

README

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
The Independent JPEG Group's JPEG software
22
==========================================
33

4-
README for release 8 of 10-Jan-2010
5-
===================================
4+
README for release 8a of 28-Feb-2010
5+
====================================
66

77
This distribution contains the eighth public release of the Independent JPEG
88
Group's free JPEG software. You are welcome to redistribute this software and
@@ -254,8 +254,8 @@ ARCHIVE LOCATIONS
254254
The "official" archive site for this software is www.ijg.org.
255255
The most recent released version can always be found there in
256256
directory "files". This particular version will be archived as
257-
http://www.ijg.org/files/jpegsrc.v8.tar.gz, and in Windows-compatible
258-
"zip" archive format as http://www.ijg.org/files/jpegsr8.zip.
257+
http://www.ijg.org/files/jpegsrc.v8a.tar.gz, and in Windows-compatible
258+
"zip" archive format as http://www.ijg.org/files/jpegsr8a.zip.
259259

260260
The JPEG FAQ (Frequently Asked Questions) article is a source of some
261261
general information about JPEG.
@@ -318,7 +318,7 @@ image files indefinitely.)
318318
TO DO
319319
=====
320320

321-
Version 8.0 is the first release of a new generation JPEG standard
321+
Version 8 is the first release of a new generation JPEG standard
322322
to overcome the limitations of the original JPEG specification.
323323
More features are being prepared for coming releases...
324324

change.log

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
CHANGE LOG for Independent JPEG Group's JPEG software
22

33

4+
Version 8a 28-Feb-2010
5+
-----------------------
6+
7+
Writing tables-only datastreams via jpeg_write_tables works again.
8+
9+
Support 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.
10+
Thank to Brett Blackham for the suggestion.
11+
12+
Improve accuracy in floating point IDCT calculation.
13+
Thank to Robert Hooke for the hint.
14+
15+
416
Version 8 10-Jan-2010
517
----------------------
618

configure

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.65 for libjpeg 8.0.
3+
# Generated by GNU Autoconf 2.65 for libjpeg 8.0.1.
44
#
55
#
66
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -698,8 +698,8 @@ MAKEFLAGS=
698698
# Identity of this package.
699699
PACKAGE_NAME='libjpeg'
700700
PACKAGE_TARNAME='libjpeg'
701-
PACKAGE_VERSION='8.0'
702-
PACKAGE_STRING='libjpeg 8.0'
701+
PACKAGE_VERSION='8.0.1'
702+
PACKAGE_STRING='libjpeg 8.0.1'
703703
PACKAGE_BUGREPORT=''
704704
PACKAGE_URL=''
705705

@@ -1430,7 +1430,7 @@ if test "$ac_init_help" = "long"; then
14301430
# Omit some internal or obsolete options to make the list less imposing.
14311431
# This message is too long to be a string in the A/UX 3.1 sh.
14321432
cat <<_ACEOF
1433-
\`configure' configures libjpeg 8.0 to adapt to many kinds of systems.
1433+
\`configure' configures libjpeg 8.0.1 to adapt to many kinds of systems.
14341434
14351435
Usage: $0 [OPTION]... [VAR=VALUE]...
14361436
@@ -1501,7 +1501,7 @@ fi
15011501

15021502
if test -n "$ac_init_help"; then
15031503
case $ac_init_help in
1504-
short | recursive ) echo "Configuration of libjpeg 8.0:";;
1504+
short | recursive ) echo "Configuration of libjpeg 8.0.1:";;
15051505
esac
15061506
cat <<\_ACEOF
15071507
@@ -1608,7 +1608,7 @@ fi
16081608
test -n "$ac_init_help" && exit $ac_status
16091609
if $ac_init_version; then
16101610
cat <<\_ACEOF
1611-
libjpeg configure 8.0
1611+
libjpeg configure 8.0.1
16121612
generated by GNU Autoconf 2.65
16131613
16141614
Copyright (C) 2009 Free Software Foundation, Inc.
@@ -1973,7 +1973,7 @@ cat >config.log <<_ACEOF
19731973
This file contains any messages produced by compilers while
19741974
running configure, to aid debugging if configure makes a mistake.
19751975
1976-
It was created by libjpeg $as_me 8.0, which was
1976+
It was created by libjpeg $as_me 8.0.1, which was
19771977
generated by GNU Autoconf 2.65. Invocation command line was
19781978
19791979
$ $0 $@
@@ -2905,7 +2905,7 @@ fi
29052905
29062906
# Define the identity of the package.
29072907
PACKAGE='libjpeg'
2908-
VERSION='8.0'
2908+
VERSION='8.0.1'
29092909
29102910
29112911
cat >>confdefs.h <<_ACEOF
@@ -12675,7 +12675,7 @@ fi
1267512675
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libjpeg version number" >&5
1267612676
$as_echo_n "checking libjpeg version number... " >&6; }
1267712677
JPEG_LIB_VERSION=`sed -e '/^#define JPEG_LIB_VERSION/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`
12678-
JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION / 10`:`expr $JPEG_LIB_VERSION % 10`"
12678+
JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION / 10`:1"
1267912679
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JPEG_LIB_VERSION" >&5
1268012680
$as_echo "$JPEG_LIB_VERSION" >&6; }
1268112681
@@ -13215,7 +13215,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1321513215
# report actual input values of CONFIG_FILES etc. instead of their
1321613216
# values after options handling.
1321713217
ac_log="
13218-
This file was extended by libjpeg $as_me 8.0, which was
13218+
This file was extended by libjpeg $as_me 8.0.1, which was
1321913219
generated by GNU Autoconf 2.65. Invocation command line was
1322013220
1322113221
CONFIG_FILES = $CONFIG_FILES
@@ -13281,7 +13281,7 @@ _ACEOF
1328113281
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1328213282
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1328313283
ac_cs_version="\\
13284-
libjpeg config.status 8.0
13284+
libjpeg config.status 8.0.1
1328513285
configured by $0, generated by GNU Autoconf 2.65,
1328613286
with options \\"\$ac_cs_config\\"
1328713287

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Configure script for IJG libjpeg
66
#
77

8-
AC_INIT([libjpeg], [8.0])
8+
AC_INIT([libjpeg], [8.0.1])
99

1010
# Directory where autotools helper scripts lives.
1111
AC_CONFIG_AUX_DIR([.])
@@ -309,7 +309,7 @@ AC_SUBST(MEMORYMGR)
309309
# Extract the library version ID from jpeglib.h.
310310
AC_MSG_CHECKING([libjpeg version number])
311311
[JPEG_LIB_VERSION=`sed -e '/^#define JPEG_LIB_VERSION/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`]
312-
[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION / 10`:`expr $JPEG_LIB_VERSION % 10`"]
312+
[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION / 10`:1"]
313313
AC_MSG_RESULT([$JPEG_LIB_VERSION])
314314
AC_SUBST([JPEG_LIB_VERSION])
315315

jcapimin.c

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* jcapimin.c
33
*
44
* Copyright (C) 1994-1998, Thomas G. Lane.
5+
* Modified 2003-2010 by Guido Vollbeding.
56
* This file is part of the Independent JPEG Group's software.
67
* For conditions of distribution and use, see the accompanying README file.
78
*
@@ -73,6 +74,11 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
7374
cinfo->ac_huff_tbl_ptrs[i] = NULL;
7475
}
7576

77+
/* Must do it here for emit_dqt in case jpeg_write_tables is used */
78+
cinfo->block_size = DCTSIZE;
79+
cinfo->natural_order = jpeg_natural_order;
80+
cinfo->lim_Se = DCTSIZE2-1;
81+
7682
cinfo->script_space = NULL;
7783

7884
cinfo->input_gamma = 1.0; /* in case application forgets */

jcmaster.c

-4
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
187187
cinfo->min_DCT_v_scaled_size = DCTSIZE;
188188

189189
#endif /* DCT_SCALING_SUPPORTED */
190-
191-
cinfo->block_size = DCTSIZE;
192-
cinfo->natural_order = jpeg_natural_order;
193-
cinfo->lim_Se = DCTSIZE2-1;
194190
}
195191

196192

jddctmgr.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* jddctmgr.c
33
*
44
* Copyright (C) 1994-1996, Thomas G. Lane.
5+
* Modified 2002-2010 by Guido Vollbeding.
56
* This file is part of the Independent JPEG Group's software.
67
* For conditions of distribution and use, see the accompanying README file.
78
*
@@ -324,6 +325,7 @@ start_pass (j_decompress_ptr cinfo)
324325
* coefficients scaled by scalefactor[row]*scalefactor[col], where
325326
* scalefactor[0] = 1
326327
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
328+
* We apply a further scale factor of 1/8.
327329
*/
328330
FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
329331
int row, col;
@@ -337,7 +339,7 @@ start_pass (j_decompress_ptr cinfo)
337339
for (col = 0; col < DCTSIZE; col++) {
338340
fmtbl[i] = (FLOAT_MULT_TYPE)
339341
((double) qtbl->quantval[i] *
340-
aanscalefactor[row] * aanscalefactor[col]);
342+
aanscalefactor[row] * aanscalefactor[col] * 0.125);
341343
i++;
342344
}
343345
}

jidctflt.c

+25-32
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* jidctflt.c
33
*
44
* Copyright (C) 1994-1998, Thomas G. Lane.
5+
* Modified 2010 by Guido Vollbeding.
56
* This file is part of the Independent JPEG Group's software.
67
* For conditions of distribution and use, see the accompanying README file.
78
*
@@ -76,10 +77,9 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
7677
FLOAT_MULT_TYPE * quantptr;
7778
FAST_FLOAT * wsptr;
7879
JSAMPROW outptr;
79-
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
80+
JSAMPLE *range_limit = cinfo->sample_range_limit;
8081
int ctr;
8182
FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
82-
SHIFT_TEMPS
8383

8484
/* Pass 1: process columns from input, store into work array. */
8585

@@ -152,29 +152,28 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
152152
tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
153153

154154
z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
155-
tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
156-
tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
155+
tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
156+
tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
157157

158158
tmp6 = tmp12 - tmp7; /* phase 2 */
159159
tmp5 = tmp11 - tmp6;
160-
tmp4 = tmp10 + tmp5;
160+
tmp4 = tmp10 - tmp5;
161161

162162
wsptr[DCTSIZE*0] = tmp0 + tmp7;
163163
wsptr[DCTSIZE*7] = tmp0 - tmp7;
164164
wsptr[DCTSIZE*1] = tmp1 + tmp6;
165165
wsptr[DCTSIZE*6] = tmp1 - tmp6;
166166
wsptr[DCTSIZE*2] = tmp2 + tmp5;
167167
wsptr[DCTSIZE*5] = tmp2 - tmp5;
168-
wsptr[DCTSIZE*4] = tmp3 + tmp4;
169-
wsptr[DCTSIZE*3] = tmp3 - tmp4;
168+
wsptr[DCTSIZE*3] = tmp3 + tmp4;
169+
wsptr[DCTSIZE*4] = tmp3 - tmp4;
170170

171171
inptr++; /* advance pointers to next column */
172172
quantptr++;
173173
wsptr++;
174174
}
175175

176176
/* Pass 2: process rows from work array, store into output array. */
177-
/* Note that we must descale the results by a factor of 8 == 2**3. */
178177

179178
wsptr = workspace;
180179
for (ctr = 0; ctr < DCTSIZE; ctr++) {
@@ -187,8 +186,10 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
187186

188187
/* Even part */
189188

190-
tmp10 = wsptr[0] + wsptr[4];
191-
tmp11 = wsptr[0] - wsptr[4];
189+
/* Apply signed->unsigned and prepare float->int conversion */
190+
z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5);
191+
tmp10 = z5 + wsptr[4];
192+
tmp11 = z5 - wsptr[4];
192193

193194
tmp13 = wsptr[2] + wsptr[6];
194195
tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
@@ -209,31 +210,23 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
209210
tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
210211

211212
z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
212-
tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
213-
tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
213+
tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
214+
tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
214215

215216
tmp6 = tmp12 - tmp7;
216217
tmp5 = tmp11 - tmp6;
217-
tmp4 = tmp10 + tmp5;
218-
219-
/* Final output stage: scale down by a factor of 8 and range-limit */
220-
221-
outptr[0] = range_limit[(int) DESCALE((INT32) (tmp0 + tmp7), 3)
222-
& RANGE_MASK];
223-
outptr[7] = range_limit[(int) DESCALE((INT32) (tmp0 - tmp7), 3)
224-
& RANGE_MASK];
225-
outptr[1] = range_limit[(int) DESCALE((INT32) (tmp1 + tmp6), 3)
226-
& RANGE_MASK];
227-
outptr[6] = range_limit[(int) DESCALE((INT32) (tmp1 - tmp6), 3)
228-
& RANGE_MASK];
229-
outptr[2] = range_limit[(int) DESCALE((INT32) (tmp2 + tmp5), 3)
230-
& RANGE_MASK];
231-
outptr[5] = range_limit[(int) DESCALE((INT32) (tmp2 - tmp5), 3)
232-
& RANGE_MASK];
233-
outptr[4] = range_limit[(int) DESCALE((INT32) (tmp3 + tmp4), 3)
234-
& RANGE_MASK];
235-
outptr[3] = range_limit[(int) DESCALE((INT32) (tmp3 - tmp4), 3)
236-
& RANGE_MASK];
218+
tmp4 = tmp10 - tmp5;
219+
220+
/* Final output stage: float->int conversion and range-limit */
221+
222+
outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK];
223+
outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK];
224+
outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK];
225+
outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK];
226+
outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK];
227+
outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];
228+
outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];
229+
outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];
237230

238231
wsptr += DCTSIZE; /* advance pointer to next row */
239232
}

jpegtran.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* jpegtran.c
33
*
4-
* Copyright (C) 1995-2009, Thomas G. Lane, Guido Vollbeding.
4+
* Copyright (C) 1995-2010, Thomas G. Lane, Guido Vollbeding.
55
* This file is part of the Independent JPEG Group's software.
66
* For conditions of distribution and use, see the accompanying README file.
77
*
@@ -63,18 +63,20 @@ usage (void)
6363
#ifdef C_PROGRESSIVE_SUPPORTED
6464
fprintf(stderr, " -progressive Create progressive JPEG file\n");
6565
#endif
66-
#if TRANSFORMS_SUPPORTED
6766
fprintf(stderr, "Switches for modifying the image:\n");
67+
#if TRANSFORMS_SUPPORTED
6868
fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n");
6969
fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n");
7070
fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n");
7171
fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n");
7272
fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n");
73+
#endif
7374
fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
75+
#if TRANSFORMS_SUPPORTED
7476
fprintf(stderr, " -transpose Transpose image\n");
7577
fprintf(stderr, " -transverse Transverse transpose image\n");
7678
fprintf(stderr, " -trim Drop non-transformable edge blocks\n");
77-
#endif /* TRANSFORMS_SUPPORTED */
79+
#endif
7880
fprintf(stderr, "Switches for advanced users:\n");
7981
fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
8082
fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");

jversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
*/
1010

1111

12-
#define JVERSION "8 10-Jan-2010"
12+
#define JVERSION "8a 28-Feb-2010"
1313

1414
#define JCOPYRIGHT "Copyright (C) 2010, Thomas G. Lane, Guido Vollbeding"

0 commit comments

Comments
 (0)