Merge documentation and wordsmithing changes from 1.2, including promotion of -arithmetic to a "switch for advanced users"
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@783 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
24
BUILDING.txt
24
BUILDING.txt
@@ -99,14 +99,14 @@ This will generate the following files under .libs/
|
||||
62, 7, or 8.
|
||||
|
||||
|
||||
libjpeg v7 or v8 Emulation
|
||||
--------------------------
|
||||
libjpeg v7 or v8 API/ABI Emulation
|
||||
----------------------------------
|
||||
|
||||
Add --with-jpeg7 to the configure command line to build a version of
|
||||
libjpeg-turbo that is compatible with libjpeg v7. Add --with-jpeg8 to the
|
||||
configure command to build a version of libjpeg-turbo that is compatible with
|
||||
libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
|
||||
emulation.
|
||||
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
|
||||
the configure command to build a version of libjpeg-turbo that is
|
||||
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
|
||||
on libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
Arithmetic Coding Support
|
||||
@@ -416,14 +416,14 @@ NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
|
||||
NMake.)
|
||||
|
||||
|
||||
libjpeg v7 or v8 Emulation
|
||||
--------------------------
|
||||
libjpeg v7 or v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
|
||||
Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
|
||||
libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the
|
||||
cmake command to build a version of libjpeg-turbo that is compatible with
|
||||
libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
|
||||
emulation.
|
||||
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
|
||||
to the cmake command to build a version of libjpeg-turbo that is
|
||||
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
|
||||
on libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
Arithmetic Coding Support
|
||||
|
||||
@@ -18,6 +18,8 @@ else()
|
||||
message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
|
||||
endif()
|
||||
|
||||
# This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning
|
||||
# in Visual Studio, and it always defaults to Debug when using NMake.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
@@ -25,7 +27,7 @@ endif()
|
||||
message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# This only works if building from the command line. There is currently no way
|
||||
# to set a variable's value based on the build type when using the MSVC IDE.
|
||||
# to set a variable's value based on the build type when using Visual Studio.
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(BUILD "${BUILD}d")
|
||||
endif()
|
||||
|
||||
19
README
19
README
@@ -1,7 +1,8 @@
|
||||
libjpeg-turbo note: This file is mostly taken from the libjpeg v8b README
|
||||
file, and it is included only for reference. Some parts of it may not apply to
|
||||
libjpeg-turbo. Please see README-turbo.txt for information specific to the
|
||||
turbo version.
|
||||
libjpeg-turbo note: This file contains portions of the libjpeg v6b and v8
|
||||
README files, with additional wordsmithing by The libjpeg-turbo Project.
|
||||
It is included only for reference, as some parts of it may not apply to
|
||||
libjpeg-turbo. Please see README-turbo.txt for information specific to
|
||||
libjpeg-turbo.
|
||||
|
||||
|
||||
The Independent JPEG Group's JPEG software
|
||||
@@ -62,7 +63,7 @@ OVERVIEW
|
||||
This package contains C software to implement JPEG image encoding, decoding,
|
||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG's strong suit is compressing
|
||||
photographic images or other types of images which have smooth color and
|
||||
photographic images or other types of images that have smooth color and
|
||||
brightness transitions between neighboring pixels. Images with sharp lines or
|
||||
other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
quality may have to be used to avoid visible compression artifacts with such
|
||||
@@ -256,8 +257,8 @@ ARCHIVE LOCATIONS
|
||||
The "official" archive site for this software is www.ijg.org.
|
||||
The most recent released version can always be found there in
|
||||
directory "files". This particular version will be archived as
|
||||
http://www.ijg.org/files/jpegsrc.v8b.tar.gz, and in Windows-compatible
|
||||
"zip" archive format as http://www.ijg.org/files/jpegsr8b.zip.
|
||||
http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible
|
||||
"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip.
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
@@ -274,7 +275,7 @@ FILE FORMAT WARS
|
||||
================
|
||||
|
||||
The ISO JPEG standards committee actually promotes different formats like
|
||||
"JPEG 2000" or "JPEG XR" which are incompatible with original DCT-based
|
||||
"JPEG 2000" or "JPEG XR", which are incompatible with original DCT-based
|
||||
JPEG. IJG therefore does not support these formats (see REFERENCES). Indeed,
|
||||
one of the original reasons for developing this free software was to help
|
||||
force convergence on common, interoperable format standards for JPEG files.
|
||||
@@ -286,4 +287,4 @@ image files indefinitely.)
|
||||
TO DO
|
||||
=====
|
||||
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@uc.ag.
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
||||
|
||||
@@ -10,16 +10,16 @@ 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 in
|
||||
2009, including improved support for Mac OS X, 64-bit support, support for
|
||||
32-bit and big endian pixel formats (RGBX, XBGR, etc.), 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.
|
||||
32-bit and big-endian pixel formats (RGBX, XBGR, etc.), 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 achieves 80-120%
|
||||
of the performance of TurboJPEG/IPP. It is faster in some areas but slower in
|
||||
others.
|
||||
|
||||
In early 2010, libjpeg-turbo spun off into its own independent project, with
|
||||
the goal of making high-speed JPEG compression/decompression technology
|
||||
available to a broader range of users and developers. The libjpeg-turbo shared
|
||||
libraries can be used as drop-in replacements for libjpeg on most systems.
|
||||
available to a broader range of users and developers.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
@@ -72,13 +72,13 @@ 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.
|
||||
links to the libjpeg-turbo dynamic library located in /opt/libjpeg-turbo/{lib}.
|
||||
This will effectively accelerate every application that uses the libjpeg
|
||||
dynamic library on the system.
|
||||
|
||||
The libjpeg-turbo SDK for Visual C++ installs the libjpeg-turbo DLL
|
||||
(jpeg62.dll, jpeg7.dll, or jpeg8.dll, depending on whether libjpeg v6b, v7, or
|
||||
v8 emulation is enabled) into c:\libjpeg-turbo[64]\bin, and the PATH
|
||||
(jpeg62.dll, jpeg7.dll, or jpeg8.dll, depending on whether it was built with
|
||||
libjpeg v6b, v7, or v8 emulation) into c:\libjpeg-turbo[64]\bin, and the PATH
|
||||
environment variable can be modified such that this directory is searched
|
||||
before any others that might contain a libjpeg DLL. However, if a libjpeg
|
||||
DLL exists in an application's install directory, then Windows will load this
|
||||
@@ -88,16 +88,16 @@ version of this DLL and copy c:\libjpeg-turbo[64]\bin\jpeg*.dll into the
|
||||
application's install directory to accelerate it.
|
||||
|
||||
The version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for
|
||||
Visual C++ requires the Visual C++ 2008 C run time DLL (msvcr90.dll).
|
||||
Visual C++ requires the Visual C++ 2008 C run-time DLL (msvcr90.dll).
|
||||
msvcr90.dll ships with more recent versions of Windows, but users of older
|
||||
Windows releases 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 that require passing a C run time structure, such
|
||||
NOTE: Features of libjpeg that require passing a C run-time structure, such
|
||||
as a file handle, from an application to libjpeg will probably not work with
|
||||
the version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for
|
||||
Visual C++, unless the application is also built to use the Visual C++ 2008 C
|
||||
run time DLL. In particular, this affects jpeg_stdio_dest() and
|
||||
run-time DLL. In particular, this affects jpeg_stdio_dest() and
|
||||
jpeg_stdio_src().
|
||||
|
||||
Mac applications typically embed their own copies of the libjpeg dylib inside
|
||||
@@ -117,7 +117,7 @@ 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
|
||||
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 0.x use the new codec
|
||||
at run time. Note that the 64-bit libjpeg-turbo packages contain only 64-bit
|
||||
@@ -128,7 +128,7 @@ 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.
|
||||
are used to build VirtualGL 2.2 and TurboVNC 1.0 and later.
|
||||
|
||||
========================================
|
||||
Using libjpeg-turbo in Your Own Programs
|
||||
@@ -208,24 +208,17 @@ that doesn't support them will result in a "Bogus input colorspace" error.
|
||||
libjpeg v7 and v8 API/ABI support
|
||||
=================================
|
||||
|
||||
libjpeg v7 and v8 added new features to the API/ABI, and, unfortunately, the
|
||||
compression and decompression structures were extended in a backward-
|
||||
incompatible manner to accommodate these features. Thus, programs that are
|
||||
With libjpeg v7 and v8, new features were added that necessitated extending the
|
||||
compression and decompression structures. Unfortunately, due to the exposed
|
||||
nature of those structures, extending them also necessitated breaking backward
|
||||
ABI compatibility with previous libjpeg releases. Thus, programs that are
|
||||
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
|
||||
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are still not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) have
|
||||
made the switch that it was desirable to provide support for the libjpeg v7/v8
|
||||
API/ABI in libjpeg-turbo.
|
||||
|
||||
Some of the libjpeg v7 and v8 features -- DCT scaling, to name one -- involve
|
||||
deep modifications to the code that cannot be accommodated by libjpeg-turbo
|
||||
without either breaking compatibility with libjpeg v6b or producing an
|
||||
unsupportable mess. In order to fully support libjpeg v8 with all of its
|
||||
features, we would have to essentially port the SIMD extensions to the libjpeg
|
||||
v8 code base and maintain two separate code trees. We are hesitant to do this
|
||||
until/unless the newer libjpeg code bases garner more community support and
|
||||
involvement and until/unless we have some notion of whether future libjpeg
|
||||
releases will also be backward-incompatible.
|
||||
API/ABI in libjpeg-turbo. Although libjpeg-turbo can now be configured as a
|
||||
drop-in replacement for libjpeg v7 or v8, it should be noted that not all of
|
||||
the features in libjpeg v7 and v8 are supported (see below.)
|
||||
|
||||
By passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an
|
||||
argument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version
|
||||
@@ -264,6 +257,16 @@ Not supported:
|
||||
|
||||
-- libjpeg: DCT scaling in compressor
|
||||
cinfo.scale_num and cinfo.scale_denom are silently ignored.
|
||||
There is no technical reason why DCT scaling cannot be supported, but
|
||||
without the SmartScale extension (see below), it would only be able to
|
||||
down-scale using ratios of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and 8/9,
|
||||
which is of limited usefulness.
|
||||
|
||||
-- libjpeg: SmartScale
|
||||
cinfo.block_size is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. It would be difficult to support this feature while
|
||||
retaining backward compatibility with libjpeg v6b.
|
||||
|
||||
-- libjpeg: IDCT scaling extensions in decompressor
|
||||
libjpeg-turbo still supports IDCT scaling with scaling factors of 1/2, 1/4,
|
||||
@@ -271,9 +274,14 @@ Not supported:
|
||||
|
||||
-- libjpeg: Fancy downsampling in compressor
|
||||
cinfo.do_fancy_downsampling is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
-- jpegtran: Scaling
|
||||
Seems to depend on the DCT scaling feature, which isn't supported.
|
||||
This requires both the DCT scaling and SmartScale features, which are not
|
||||
supported.
|
||||
|
||||
-- Lossless RGB JPEG files
|
||||
This requires the SmartScale feature, which is not supported.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
@@ -285,12 +293,13 @@ Restart Markers
|
||||
===============
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
in a way that makes libjpeg happy, so it is necessary to use the slow Huffman
|
||||
decoder when decompressing a JPEG image that has restart markers. This can
|
||||
cause the decompression performance to drop by as much as 20%, but the
|
||||
performance will still be much much greater than that of libjpeg v6b. Many
|
||||
consumer packages, such as PhotoShop, use restart markers when generating JPEG
|
||||
images, so images generated by those programs will experience this issue.
|
||||
in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
has restart markers. This can cause the decompression performance to drop by
|
||||
as much as 20%, but the performance will still be much greater than that of
|
||||
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
===============================================
|
||||
Fast Integer Forward DCT at High Quality Levels
|
||||
|
||||
16
cjpeg.1
16
cjpeg.1
@@ -1,4 +1,4 @@
|
||||
.TH CJPEG 1 "11 October 2010"
|
||||
.TH CJPEG 1 "31 January 2012"
|
||||
.SH NAME
|
||||
cjpeg \- compress an image file to a JPEG file
|
||||
.SH SYNOPSIS
|
||||
@@ -121,7 +121,7 @@ quality-sensitive applications, for which the artifacts generated by
|
||||
subsampling may be unacceptable.
|
||||
.PP
|
||||
The \fB-quality\fR option accepts a comma-separated list of parameters, which
|
||||
respectively refer to the quality levels which should be assigned to the
|
||||
respectively refer to the quality levels that should be assigned to the
|
||||
quantization table slots. If there are more q-table slots than parameters,
|
||||
then the last parameter is replicated. Thus, if only one quality parameter is
|
||||
given, this is used for both luminance and chrominance (slots 0 and 1,
|
||||
@@ -150,6 +150,12 @@ about the same --- often a little smaller.
|
||||
.PP
|
||||
Switches for advanced users:
|
||||
.TP
|
||||
.B \-arithmetic
|
||||
Use arithmetic coding.
|
||||
.B Caution:
|
||||
arithmetic coded JPEG is not yet widely implemented, so many decoders will be
|
||||
unable to view an arithmetic coded JPEG file at all.
|
||||
.TP
|
||||
.B \-dct int
|
||||
Use integer DCT method (default).
|
||||
.TP
|
||||
@@ -214,12 +220,6 @@ visibly blur the image, however.
|
||||
.PP
|
||||
Switches for wizards:
|
||||
.TP
|
||||
.B \-arithmetic
|
||||
Use arithmetic coding.
|
||||
.B Caution:
|
||||
arithmetic coded JPEG is not yet widely implemented, so many decoders will be
|
||||
unable to view an arithmetic coded JPEG file at all.
|
||||
.TP
|
||||
.B \-baseline
|
||||
Force baseline-compatible quantization tables to be generated. This clamps
|
||||
quantization values to 8 bits even at low quality settings. (This switch is
|
||||
|
||||
6
cjpeg.c
6
cjpeg.c
@@ -164,6 +164,9 @@ usage (void)
|
||||
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
|
||||
#endif
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
|
||||
#endif
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
fprintf(stderr, " -dct int Use integer DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
@@ -184,9 +187,6 @@ usage (void)
|
||||
fprintf(stderr, " -outfile name Specify name for output file\n");
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, "Switches for wizards:\n");
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
|
||||
#endif
|
||||
fprintf(stderr, " -baseline Force baseline quantization tables\n");
|
||||
fprintf(stderr, " -qtables file Use quantization tables given in file\n");
|
||||
fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
|
||||
|
||||
10
install.txt
10
install.txt
@@ -534,17 +534,17 @@ In general, it's worth trying the maximum optimization level of your compiler,
|
||||
and experimenting with any optional optimizations such as loop unrolling.
|
||||
(Unfortunately, far too many compilers have optimizer bugs ... be prepared to
|
||||
back off if the code fails self-test.) If you do any experimentation along
|
||||
these lines, please report the optimal settings to jpeg-info@uc.ag so we
|
||||
can mention them in future releases. Be sure to specify your machine
|
||||
and compiler version.
|
||||
these lines, please report the optimal settings to jpeg-info@jpegclub.org so
|
||||
we can mention them in future releases. Be sure to specify your machine and
|
||||
compiler version.
|
||||
|
||||
|
||||
HINTS FOR SPECIFIC SYSTEMS
|
||||
==========================
|
||||
|
||||
We welcome reports on changes needed for systems not mentioned here. Submit
|
||||
'em to jpeg-info@uc.ag. Also, if configure or ckconfig.c is wrong about how
|
||||
to configure the JPEG software for your system, please let us know.
|
||||
'em to jpeg-info@jpegclub.org. Also, if configure or ckconfig.c is wrong
|
||||
about how to configure the JPEG software for your system, please let us know.
|
||||
|
||||
|
||||
Acorn RISC OS:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH JPEGTRAN 1 "11 October 2010"
|
||||
.TH JPEGTRAN 1 "31 January 2012"
|
||||
.SH NAME
|
||||
jpegtran \- lossless transformation of JPEG files
|
||||
.SH SYNOPSIS
|
||||
@@ -184,7 +184,7 @@ comments and other excess baggage present in the source file.
|
||||
.TP
|
||||
.B \-copy comments
|
||||
Copy only comment markers. This setting copies comments from the source file
|
||||
but discards any other data which is inessential for image display.
|
||||
but discards any other data that is inessential for image display.
|
||||
.TP
|
||||
.B \-copy all
|
||||
Copy all extra markers. This setting preserves miscellaneous markers
|
||||
|
||||
@@ -78,14 +78,14 @@ usage (void)
|
||||
fprintf(stderr, " -trim Drop non-transformable edge blocks\n");
|
||||
#endif
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
|
||||
#endif
|
||||
fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
|
||||
fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
|
||||
fprintf(stderr, " -outfile name Specify name for output file\n");
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, "Switches for wizards:\n");
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
|
||||
#endif
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
|
||||
#endif
|
||||
|
||||
23
libjpeg.txt
23
libjpeg.txt
@@ -850,8 +850,9 @@ int jpeg_quality_scaling (int quality)
|
||||
premise of this routine collapses. Caveat user.
|
||||
|
||||
jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
|
||||
[libjpeg v7/v8 only] Set default quantization tables with linear
|
||||
q_scale_factor[] values (see below).
|
||||
[libjpeg v7+ API/ABI emulation only]
|
||||
Set default quantization tables with linear q_scale_factor[] values
|
||||
(see below).
|
||||
|
||||
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
||||
const unsigned int *basic_table,
|
||||
@@ -976,12 +977,13 @@ JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
|
||||
slot 1 for chrominance.
|
||||
|
||||
int q_scale_factor[NUM_QUANT_TBLS]
|
||||
[libjpeg v7+ only] Linear quantization scaling factors (0-100, default
|
||||
100) for use with jpeg_default_qtables().
|
||||
[libjpeg v7+ API/ABI emulation only]
|
||||
Linear quantization scaling factors (0-100, default 100)
|
||||
for use with jpeg_default_qtables().
|
||||
See rdswitch.c and cjpeg.c for an example of usage.
|
||||
Note that the q_scale_factor[] values use "linear" scales, so JPEG
|
||||
quality levels chosen by the user must be converted to these scales
|
||||
using jpeg_quality_scaling(). Here is an example which corresponds to
|
||||
using jpeg_quality_scaling(). Here is an example that corresponds to
|
||||
cjpeg -quality 90,70:
|
||||
|
||||
jpeg_set_defaults(cinfo);
|
||||
@@ -1012,11 +1014,12 @@ JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
|
||||
any need to mess with providing your own Huffman tables.
|
||||
|
||||
|
||||
[libjpeg v7+ only] The actual dimensions of the JPEG image that will be written
|
||||
to the file are given by the following fields. These are computed from the
|
||||
input image dimensions and the compression parameters by jpeg_start_compress().
|
||||
You can also call jpeg_calc_jpeg_dimensions() to obtain the values that will
|
||||
result from the current parameter settings.
|
||||
[libjpeg v7+ API/ABI emulation only]
|
||||
The actual dimensions of the JPEG image that will be written to the file are
|
||||
given by the following fields. These are computed from the input image
|
||||
dimensions and the compression parameters by jpeg_start_compress(). You can
|
||||
also call jpeg_calc_jpeg_dimensions() to obtain the values that will result
|
||||
from the current parameter settings.
|
||||
|
||||
JDIMENSION jpeg_width Actual dimensions of output image.
|
||||
JDIMENSION jpeg_height
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
IJG JPEG LIBRARY: SYSTEM ARCHITECTURE
|
||||
|
||||
Copyright (C) 1991-2009, Thomas G. Lane, Guido Vollbeding.
|
||||
Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
|
||||
This file is part of the Independent JPEG Group's software.
|
||||
For conditions of distribution and use, see the accompanying README file.
|
||||
|
||||
@@ -385,8 +385,9 @@ objects:
|
||||
|
||||
* Data destination manager: writes the output JPEG datastream to its final
|
||||
destination (e.g., a file). The destination manager supplied with the
|
||||
library knows how to write to a stdio stream; for other behaviors, the
|
||||
surrounding application may provide its own destination manager.
|
||||
library knows how to write to a stdio stream or to a memory buffer;
|
||||
for other behaviors, the surrounding application may provide its own
|
||||
destination manager.
|
||||
|
||||
* Memory manager: allocates and releases memory, controls virtual arrays
|
||||
(with backing store management, where required).
|
||||
@@ -504,9 +505,9 @@ objects:
|
||||
* Marker reading: decodes JPEG markers (except for RSTn).
|
||||
|
||||
* Data source manager: supplies the input JPEG datastream. The source
|
||||
manager supplied with the library knows how to read from a stdio stream;
|
||||
for other behaviors, the surrounding application may provide its own source
|
||||
manager.
|
||||
manager supplied with the library knows how to read from a stdio stream
|
||||
or from a memory buffer; for other behaviors, the surrounding application
|
||||
may provide its own source manager.
|
||||
|
||||
* Memory manager: same as for compression library.
|
||||
|
||||
@@ -586,8 +587,7 @@ as "((value) & 0xFF)" on signed-char machines and "((int) (value))" elsewhere.
|
||||
With these conventions, JSAMPLE values can be assumed to be >= 0. This helps
|
||||
simplify correct rounding during downsampling, etc. The JPEG standard's
|
||||
specification that sample values run from -128..127 is accommodated by
|
||||
subtracting 128 just as the sample value is copied into the source array for
|
||||
the DCT step (this will be an array of signed ints). Similarly, during
|
||||
subtracting 128 from the sample value in the DCT step. Similarly, during
|
||||
decompression the output of the IDCT step will be immediately shifted back to
|
||||
0..255. (NB: different values are required when 12-bit samples are in use.
|
||||
The code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be
|
||||
|
||||
16
usage.txt
16
usage.txt
@@ -131,7 +131,7 @@ quality-sensitive applications, for which the artifacts generated by
|
||||
subsampling may be unacceptable.
|
||||
|
||||
The -quality option accepts a comma-separated list of parameters, which
|
||||
respectively refer to the quality levels which should be assigned to the
|
||||
respectively refer to the quality levels that should be assigned to the
|
||||
quantization table slots. If there are more q-table slots than parameters,
|
||||
then the last parameter is replicated. Thus, if only one quality parameter is
|
||||
given, this is used for both luminance and chrominance (slots 0 and 1,
|
||||
@@ -157,6 +157,11 @@ file size is about the same --- often a little smaller.
|
||||
|
||||
Switches for advanced users:
|
||||
|
||||
-arithmetic Use arithmetic coding. CAUTION: arithmetic coded JPEG
|
||||
is not yet widely implemented, so many decoders will
|
||||
be unable to view an arithmetic coded JPEG file at
|
||||
all.
|
||||
|
||||
-dct int Use integer DCT method (default).
|
||||
-dct fast Use fast integer DCT (less accurate).
|
||||
-dct float Use floating-point DCT method.
|
||||
@@ -201,11 +206,6 @@ factor will visibly blur the image, however.
|
||||
|
||||
Switches for wizards:
|
||||
|
||||
-arithmetic Use arithmetic coding. CAUTION: arithmetic coded JPEG
|
||||
is not yet widely implemented, so many decoders will
|
||||
be unable to view an arithmetic coded JPEG file at
|
||||
all.
|
||||
|
||||
-baseline Force baseline-compatible quantization tables to be
|
||||
generated. This clamps quantization values to 8 bits
|
||||
even at low quality settings. (This switch is poorly
|
||||
@@ -447,9 +447,9 @@ To specify the coded JPEG representation used in the output file,
|
||||
jpegtran accepts a subset of the switches recognized by cjpeg:
|
||||
-optimize Perform optimization of entropy encoding parameters.
|
||||
-progressive Create progressive JPEG file.
|
||||
-arithmetic Use arithmetic coding.
|
||||
-restart N Emit a JPEG restart marker every N MCU rows, or every
|
||||
N MCU blocks if "B" is attached to the number.
|
||||
-arithmetic Use arithmetic coding.
|
||||
-scans file Use the scan script given in the specified text file.
|
||||
See the previous discussion of cjpeg for more details about these switches.
|
||||
If you specify none of these switches, you get a plain baseline-JPEG output
|
||||
@@ -527,7 +527,7 @@ markers, such as comment blocks:
|
||||
present in the source file.
|
||||
-copy comments Copy only comment markers. This setting copies
|
||||
comments from the source file but discards
|
||||
any other data which is inessential for image display.
|
||||
any other data that is inessential for image display.
|
||||
-copy all Copy all extra markers. This setting preserves
|
||||
miscellaneous markers found in the source file, such
|
||||
as JFIF thumbnails, Exif data, and Photoshop settings.
|
||||
|
||||
Reference in New Issue
Block a user