mirror of
https://github.com/libjpeg-turbo/libjpeg-turbo
synced 2025-03-28 21:13:18 +00:00
Support 8-bit & 12-bit JPEGs using the same build
Partially implements #199 This commit also implements a request from #178 (the ability to compile the libjpeg example as a standalone program.)
This commit is contained in:
parent
fc562d11f0
commit
7fec5074f9
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -119,7 +119,7 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
pushd build
|
||||
cmake -G"Unix Makefiles" -DWITH_12BIT=1 \
|
||||
cmake -G"Unix Makefiles" -DWITH_12BIT=0 \
|
||||
-DCMAKE_C_FLAGS='--std=gnu90 -Wall -Werror -Wextra -Wpedantic -pedantic-errors -Wdouble-promotion -Wformat-overflow=2 -Wformat-security -Wformat-signedness -Wformat-truncation=2 -Wformat-y2k -Wmissing-include-dirs -Wshift-overflow=2 -Wswitch-bool -Wno-unused-parameter -Wuninitialized -Wstrict-overflow=2 -Wstringop-overflow=4 -Wstringop-truncation -Wduplicated-branches -Wduplicated-cond -Wdeclaration-after-statement -Wshadow -Wunsafe-loop-optimizations -Wundef -Wcast-align -Wno-clobbered -Wjump-misses-init -Wno-sign-compare -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wdisabled-optimization -Wno-overlength-strings' \
|
||||
..
|
||||
export NUMCPUS=`grep -c '^processor' /proc/cpuinfo`
|
||||
|
999
CMakeLists.txt
999
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
15
ChangeLog.md
15
ChangeLog.md
@ -1,3 +1,18 @@
|
||||
2.2 pre-beta
|
||||
============
|
||||
|
||||
### Significant changes relative to 2.1.3
|
||||
|
||||
1. By default, the build system now builds, packages, and tests a separate
|
||||
12-bit-per-component flavor of the libjpeg API library, cjpeg, djpeg, and
|
||||
jpegtran. The 12-bit-per-component libjpeg API library mangles the names of
|
||||
libjpeg API functions, data types, structures, and macros to enable calling
|
||||
applications to more easily support both 8-bit-per-component and
|
||||
12-bit-per-component JPEG images. (Refer to [libjpeg.txt](libjpeg.txt) for
|
||||
more details.) The `WITH_12BIT` CMake variable can be used to disable
|
||||
12-bit-per-component JPEG support.
|
||||
|
||||
|
||||
2.1.3
|
||||
=====
|
||||
|
||||
|
@ -43,7 +43,7 @@ User documentation:
|
||||
change.log Version-to-version change highlights.
|
||||
Programmer and internal documentation:
|
||||
libjpeg.txt How to use the JPEG library in your own programs.
|
||||
example.txt Sample code for calling the JPEG library.
|
||||
example.c Sample code for calling the JPEG library.
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
|
||||
|
4
cdjpeg.h
4
cdjpeg.h
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* Modified 2019 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2017, 2019, 2021, D. R. Commander.
|
||||
* Copyright (C) 2017, 2019, 2021-2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -16,7 +16,7 @@
|
||||
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
|
||||
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jerror.h" /* get library error codes too */
|
||||
#include "cderror.h" /* get application-specific error codes */
|
||||
|
||||
|
@ -90,6 +90,10 @@ if(WITH_JAVA)
|
||||
set(INST_DEFS ${INST_DEFS} -DJAVA)
|
||||
endif()
|
||||
|
||||
if(WITH_12BIT)
|
||||
set(INST_DEFS ${INST_DEFS} -D12BIT)
|
||||
endif()
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\")
|
||||
else()
|
||||
@ -109,10 +113,13 @@ configure_file(win/${INST_ID}/projectTargets-release.cmake.in
|
||||
if(WITH_JAVA)
|
||||
set(JAVA_DEPEND turbojpeg-java)
|
||||
endif()
|
||||
if(WITH_12BIT)
|
||||
set(12BIT_DEPEND jpeg12 jpeg12-static cjpeg12 djpeg12 jpeg12tran)
|
||||
endif()
|
||||
add_custom_target(installer
|
||||
makensis -nocd ${INST_DEFS} installer.nsi
|
||||
DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom
|
||||
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
|
||||
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND} ${12BIT_DEPEND}
|
||||
SOURCES installer.nsi)
|
||||
|
||||
endif() # WIN32
|
||||
@ -159,6 +166,10 @@ add_custom_target(tarball pkgscripts/maketarball
|
||||
|
||||
configure_file(release/libjpeg.pc.in pkgscripts/libjpeg.pc @ONLY)
|
||||
|
||||
if(WITH_12BIT)
|
||||
configure_file(release/libjpeg12.pc.in pkgscripts/libjpeg12.pc @ONLY)
|
||||
endif()
|
||||
|
||||
configure_file(release/libturbojpeg.pc.in pkgscripts/libturbojpeg.pc @ONLY)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
4
cmyk.h
4
cmyk.h
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* cmyk.h
|
||||
*
|
||||
* Copyright (C) 2017-2018, D. R. Commander.
|
||||
* Copyright (C) 2017-2018, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#include <jinclude.h>
|
||||
#define JPEG_INTERNALS
|
||||
#include <jpeglib.h>
|
||||
#include "jpeglibint.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
|
@ -1,33 +1,41 @@
|
||||
/*
|
||||
* example.txt
|
||||
* example.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* Copyright (C) 1992-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2017, 2019, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file illustrates how to use the IJG code as a subroutine library
|
||||
* to read or write JPEG image files. You should look at this code in
|
||||
* conjunction with the documentation file libjpeg.txt.
|
||||
*
|
||||
* This code will not do anything useful as-is, but it may be helpful as a
|
||||
* skeleton for constructing routines that call the JPEG library.
|
||||
* to read or write JPEG image files with 8-bit or 12-bit data precision. You
|
||||
* should look at this code in conjunction with the documentation file
|
||||
* libjpeg.txt.
|
||||
*
|
||||
* We present these routines in the same coding style used in the JPEG code
|
||||
* (ANSI function definitions, etc); but you are of course free to code your
|
||||
* routines in a different style if you prefer.
|
||||
*/
|
||||
|
||||
/* This example was part of the original libjpeg documentation and has been
|
||||
* unchanged since 1994. It is, as described in libjpeg.txt, "heavily
|
||||
* commented skeleton code for calling the JPEG library." It is not meant to
|
||||
* be compiled as a standalone program, since it has no main() function and
|
||||
* does not compress from/decompress to a real image buffer (corollary:
|
||||
* put_scanline_someplace() is not a real function.) First-time users of
|
||||
* libjpeg-turbo would be better served by looking at tjexample.c, which uses
|
||||
* the more straightforward TurboJPEG API, or at cjpeg.c and djpeg.c, which are
|
||||
* examples of libjpeg API usage that can be (and are) compiled into standalone
|
||||
* programs. Note that this example, as well as the examples in cjpeg.c and
|
||||
* djpeg.c, interleave disk I/O with JPEG compression/decompression, so none of
|
||||
* these examples is suitable for benchmarking purposes.
|
||||
/* First-time users of libjpeg-turbo might be better served by looking at
|
||||
* tjexample.c, which uses the more straightforward TurboJPEG API. Note that
|
||||
* this example, like cjpeg and djpeg, interleaves disk I/O with JPEG
|
||||
* compression/decompression, so it is not suitable for benchmarking purposes.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define strcasecmp stricmp
|
||||
#define strncasecmp strnicmp
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Include file for users of JPEG library.
|
||||
@ -38,6 +46,7 @@
|
||||
*/
|
||||
|
||||
#include "jpeglib.h"
|
||||
#include "jpeg12lib.h"
|
||||
|
||||
/*
|
||||
* <setjmp.h> is used for the optional error recovery mechanism shown in
|
||||
@ -72,17 +81,16 @@
|
||||
* RGB color and is described by:
|
||||
*/
|
||||
|
||||
extern JSAMPLE *image_buffer; /* Points to large array of R,G,B-order data */
|
||||
extern int image_height; /* Number of rows in image */
|
||||
extern int image_width; /* Number of columns in image */
|
||||
#define WIDTH 640 /* Number of columns in image */
|
||||
#define HEIGHT 480 /* Number of rows in image */
|
||||
|
||||
|
||||
/*
|
||||
* Sample routine for JPEG compression. We assume that the target file name
|
||||
* and a compression quality factor are passed in.
|
||||
* Sample routine for JPEG compression with 8-bit data precision. We assume
|
||||
* that the target file name and a compression quality factor are passed in.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
METHODDEF(void)
|
||||
write_JPEG_file(char *filename, int quality)
|
||||
{
|
||||
/* This struct contains the JPEG compression parameters and pointers to
|
||||
@ -103,8 +111,10 @@ write_JPEG_file(char *filename, int quality)
|
||||
struct jpeg_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE *outfile; /* target file */
|
||||
JSAMPARRAY image_buffer; /* Points to large array of R,G,B-order data */
|
||||
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
|
||||
int row_stride; /* physical row width in image buffer */
|
||||
int row, col;
|
||||
|
||||
/* Step 1: allocate and initialize JPEG compression object */
|
||||
|
||||
@ -136,8 +146,8 @@ write_JPEG_file(char *filename, int quality)
|
||||
/* First we supply a description of the input image.
|
||||
* Four fields of the cinfo struct must be filled in:
|
||||
*/
|
||||
cinfo.image_width = image_width; /* image width and height, in pixels */
|
||||
cinfo.image_height = image_height;
|
||||
cinfo.image_width = WIDTH; /* image width and height, in pixels */
|
||||
cinfo.image_height = HEIGHT;
|
||||
cinfo.input_components = 3; /* # of color components per pixel */
|
||||
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
|
||||
/* Now use the library's routine to set default compression parameters.
|
||||
@ -149,6 +159,8 @@ write_JPEG_file(char *filename, int quality)
|
||||
* Here we just illustrate the use of quality (quantization table) scaling:
|
||||
*/
|
||||
jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
|
||||
/* Use 4:4:4 subsampling (default is 4:2:0) */
|
||||
cinfo.comp_info[0].h_samp_factor = cinfo.comp_info[0].v_samp_factor = 1;
|
||||
|
||||
/* Step 4: Start compressor */
|
||||
|
||||
@ -157,7 +169,31 @@ write_JPEG_file(char *filename, int quality)
|
||||
*/
|
||||
jpeg_start_compress(&cinfo, TRUE);
|
||||
|
||||
/* Step 5: while (scan lines remain to be written) */
|
||||
/* Step 5: allocate and initialize image buffer */
|
||||
|
||||
row_stride = WIDTH * 3; /* JSAMPLEs per row in image_buffer */
|
||||
/* Make a sample array that will go away when done with image. Note that,
|
||||
* for the purposes of this example, we could also create a one-row-high
|
||||
* sample array and initialize it for each successive scanline written in the
|
||||
* scanline loop below.
|
||||
*/
|
||||
image_buffer = (*cinfo.mem->alloc_sarray)
|
||||
((j_common_ptr)&cinfo, JPOOL_IMAGE, row_stride, HEIGHT);
|
||||
|
||||
/* Initialize image buffer with a repeating pattern */
|
||||
for (row = 0; row < HEIGHT; row++) {
|
||||
for (col = 0; col < WIDTH; col++) {
|
||||
image_buffer[row][col * 3] =
|
||||
(col * (MAXJSAMPLE + 1) / WIDTH) % (MAXJSAMPLE + 1);
|
||||
image_buffer[row][col * 3 + 1] =
|
||||
(row * (MAXJSAMPLE + 1) / HEIGHT) % (MAXJSAMPLE + 1);
|
||||
image_buffer[row][col * 3 + 2] =
|
||||
(row * (MAXJSAMPLE + 1) / HEIGHT + col * (MAXJSAMPLE + 1) / WIDTH) %
|
||||
(MAXJSAMPLE + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 6: while (scan lines remain to be written) */
|
||||
/* jpeg_write_scanlines(...); */
|
||||
|
||||
/* Here we use the library's state variable cinfo.next_scanline as the
|
||||
@ -165,24 +201,22 @@ write_JPEG_file(char *filename, int quality)
|
||||
* To keep things simple, we pass one scanline per call; you can pass
|
||||
* more if you wish, though.
|
||||
*/
|
||||
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
|
||||
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
/* jpeg_write_scanlines expects an array of pointers to scanlines.
|
||||
* Here the array is only one element long, but you could pass
|
||||
* more than one scanline at a time if that's more convenient.
|
||||
*/
|
||||
row_pointer[0] = &image_buffer[cinfo.next_scanline * row_stride];
|
||||
row_pointer[0] = image_buffer[cinfo.next_scanline];
|
||||
(void)jpeg_write_scanlines(&cinfo, row_pointer, 1);
|
||||
}
|
||||
|
||||
/* Step 6: Finish compression */
|
||||
/* Step 7: Finish compression */
|
||||
|
||||
jpeg_finish_compress(&cinfo);
|
||||
/* After finish_compress, we can close the output file. */
|
||||
fclose(outfile);
|
||||
|
||||
/* Step 7: release JPEG compression object */
|
||||
/* Step 8: release JPEG compression object */
|
||||
|
||||
/* This is an important step since it will release a good deal of memory. */
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
@ -220,6 +254,76 @@ write_JPEG_file(char *filename, int quality)
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Sample routine for JPEG compression with 12-bit data precision. We assume
|
||||
* that the target file name and a compression quality factor are passed in.
|
||||
*/
|
||||
|
||||
#ifdef WITH_12BIT
|
||||
|
||||
METHODDEF(void)
|
||||
write_JPEG12_file(char *filename, int quality)
|
||||
{
|
||||
struct jpeg12_compress_struct cinfo;
|
||||
struct jpeg12_error_mgr jerr;
|
||||
FILE *outfile;
|
||||
J12SAMPARRAY image_buffer;
|
||||
J12SAMPROW row_pointer[1];
|
||||
int row_stride;
|
||||
int row, col;
|
||||
|
||||
cinfo.err = jpeg12_std_error(&jerr);
|
||||
jpeg12_create_compress(&cinfo);
|
||||
|
||||
if ((outfile = fopen(filename, "wb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
jpeg12_stdio_dest(&cinfo, outfile);
|
||||
|
||||
cinfo.image_width = WIDTH;
|
||||
cinfo.image_height = HEIGHT;
|
||||
cinfo.input_components = 3;
|
||||
cinfo.in_color_space = JCS_RGB;
|
||||
jpeg12_set_defaults(&cinfo);
|
||||
jpeg12_set_quality(&cinfo, quality, TRUE);
|
||||
cinfo.comp_info[0].h_samp_factor = cinfo.comp_info[0].v_samp_factor = 1;
|
||||
|
||||
jpeg12_start_compress(&cinfo, TRUE);
|
||||
|
||||
row_stride = WIDTH * 3;
|
||||
image_buffer = (*cinfo.mem->alloc_sarray)
|
||||
((j12_common_ptr)&cinfo, JPOOL_IMAGE, row_stride, HEIGHT);
|
||||
|
||||
/* Initialize image buffer with a repeating pattern */
|
||||
for (row = 0; row < HEIGHT; row++) {
|
||||
for (col = 0; col < WIDTH; col++) {
|
||||
image_buffer[row][col * 3] =
|
||||
(col * (MAXJ12SAMPLE + 1) / WIDTH) % (MAXJ12SAMPLE + 1);
|
||||
image_buffer[row][col * 3 + 1] =
|
||||
(row * (MAXJ12SAMPLE + 1) / HEIGHT) % (MAXJ12SAMPLE + 1);
|
||||
image_buffer[row][col * 3 + 2] =
|
||||
(row * (MAXJ12SAMPLE + 1) / HEIGHT +
|
||||
col * (MAXJ12SAMPLE + 1) / WIDTH) % (MAXJ12SAMPLE + 1);
|
||||
}
|
||||
}
|
||||
|
||||
row_stride = WIDTH * 3;
|
||||
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
row_pointer[0] = image_buffer[cinfo.next_scanline];
|
||||
(void)jpeg12_write_scanlines(&cinfo, row_pointer, 1);
|
||||
}
|
||||
|
||||
jpeg12_finish_compress(&cinfo);
|
||||
fclose(outfile);
|
||||
|
||||
jpeg12_destroy_compress(&cinfo);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/
|
||||
|
||||
@ -289,22 +393,23 @@ my_error_exit(j_common_ptr cinfo)
|
||||
|
||||
|
||||
METHODDEF(int) do_read_JPEG_file(struct jpeg_decompress_struct *cinfo,
|
||||
char *filename);
|
||||
char *infilename, char *outfilename);
|
||||
|
||||
/*
|
||||
* Sample routine for JPEG decompression. We assume that the source file name
|
||||
* is passed in. We want to return 1 on success, 0 on error.
|
||||
* Sample routine for JPEG decompression with 8-bit data precision. We assume
|
||||
* that the source file name is passed in. We want to return 1 on success, 0
|
||||
* on error.
|
||||
*/
|
||||
|
||||
GLOBAL(int)
|
||||
read_JPEG_file(char *filename)
|
||||
METHODDEF(int)
|
||||
read_JPEG_file(char *infilename, char *outfilename)
|
||||
{
|
||||
/* This struct contains the JPEG decompression parameters and pointers to
|
||||
* working space (which is allocated as needed by the JPEG library).
|
||||
*/
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
|
||||
return do_read_JPEG_file(&cinfo, filename);
|
||||
return do_read_JPEG_file(&cinfo, infilename, outfilename);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -316,7 +421,8 @@ read_JPEG_file(char *filename)
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *infilename,
|
||||
char *outfilename)
|
||||
{
|
||||
/* We use our private extension JPEG error handler.
|
||||
* Note that this struct must live as long as the main JPEG parameter
|
||||
@ -325,19 +431,29 @@ do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
struct my_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE *infile; /* source file */
|
||||
FILE *outfile; /* output file */
|
||||
JSAMPARRAY buffer; /* Output row buffer */
|
||||
int row_stride; /* physical row width in output buffer */
|
||||
|
||||
/* In this example we want to open the input file before doing anything else,
|
||||
* so that the setjmp() error recovery below can assume the file is open.
|
||||
/* In this example we want to open the input and output files before doing
|
||||
* anything else, so that the setjmp() error recovery below can assume the
|
||||
* files are open.
|
||||
*
|
||||
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
|
||||
* requires it in order to read binary files.
|
||||
* requires it in order to read/write binary files.
|
||||
*/
|
||||
|
||||
if ((infile = fopen(filename, "rb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", filename);
|
||||
if ((infile = fopen(infilename, "rb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", infilename);
|
||||
return 0;
|
||||
}
|
||||
if ((outfile = fopen(outfilename, "wb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", outfilename);
|
||||
fclose(infile);
|
||||
return 0;
|
||||
}
|
||||
/* emit header for raw PPM format */
|
||||
fprintf(outfile, "P6\n%d %d\n%d\n", WIDTH, HEIGHT, MAXJSAMPLE);
|
||||
|
||||
/* Step 1: allocate and initialize JPEG decompression object */
|
||||
|
||||
@ -351,6 +467,7 @@ do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
*/
|
||||
jpeg_destroy_decompress(cinfo);
|
||||
fclose(infile);
|
||||
fclose(outfile);
|
||||
return 0;
|
||||
}
|
||||
/* Now we can initialize the JPEG decompression object. */
|
||||
@ -392,7 +509,7 @@ do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
row_stride = cinfo->output_width * cinfo->output_components;
|
||||
/* Make a one-row-high sample array that will go away when done with image */
|
||||
buffer = (*cinfo->mem->alloc_sarray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
|
||||
/* Step 6: while (scan lines remain to be read) */
|
||||
/* jpeg_read_scanlines(...); */
|
||||
@ -406,8 +523,7 @@ do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
* more than one scanline at a time if that's more convenient.
|
||||
*/
|
||||
(void)jpeg_read_scanlines(cinfo, buffer, 1);
|
||||
/* Assume put_scanline_someplace wants a pointer and sample count. */
|
||||
put_scanline_someplace(buffer[0], row_stride);
|
||||
fwrite(buffer[0], 1, row_stride, outfile);
|
||||
}
|
||||
|
||||
/* Step 7: Finish decompression */
|
||||
@ -422,12 +538,13 @@ do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
/* This is an important step since it will release a good deal of memory. */
|
||||
jpeg_destroy_decompress(cinfo);
|
||||
|
||||
/* After finish_decompress, we can close the input file.
|
||||
/* After finish_decompress, we can close the input and output files.
|
||||
* Here we postpone it until after no more JPEG errors are possible,
|
||||
* so as to simplify the setjmp error logic above. (Actually, I don't
|
||||
* think that jpeg_destroy can do an error exit, but why assume anything...)
|
||||
*/
|
||||
fclose(infile);
|
||||
fclose(outfile);
|
||||
|
||||
/* At this point you may want to check to see whether any corrupt-data
|
||||
* warnings occurred (test whether jerr.pub.num_warnings is nonzero).
|
||||
@ -462,3 +579,202 @@ do_read_JPEG_file(struct jpeg_decompress_struct *cinfo, char *filename)
|
||||
* On some systems you may need to set up a signal handler to ensure that
|
||||
* temporary files are deleted if the program is interrupted. See libjpeg.txt.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef WITH_12BIT
|
||||
|
||||
struct my12_error_mgr {
|
||||
struct jpeg12_error_mgr pub;
|
||||
|
||||
jmp_buf setjmp_buffer;
|
||||
};
|
||||
|
||||
typedef struct my12_error_mgr *my12_error_ptr;
|
||||
|
||||
METHODDEF(void)
|
||||
my12_error_exit(j12_common_ptr cinfo)
|
||||
{
|
||||
my12_error_ptr myerr = (my12_error_ptr)cinfo->err;
|
||||
|
||||
(*cinfo->err->output_message) (cinfo);
|
||||
|
||||
longjmp(myerr->setjmp_buffer, 1);
|
||||
}
|
||||
|
||||
METHODDEF(int) do_read_JPEG12_file(struct jpeg12_decompress_struct *cinfo,
|
||||
char *infilename, char *outfilename);
|
||||
|
||||
/*
|
||||
* Sample routine for JPEG decompression with 12-bit data precision. We assume
|
||||
* that the source file name is passed in. We want to return 1 on success, 0
|
||||
* on error.
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
read_JPEG12_file(char *infilename, char *outfilename)
|
||||
{
|
||||
struct jpeg12_decompress_struct cinfo;
|
||||
|
||||
return do_read_JPEG12_file(&cinfo, infilename, outfilename);
|
||||
}
|
||||
|
||||
METHODDEF(int)
|
||||
do_read_JPEG12_file(struct jpeg12_decompress_struct *cinfo, char *infilename,
|
||||
char *outfilename)
|
||||
{
|
||||
struct my12_error_mgr jerr;
|
||||
FILE *infile;
|
||||
FILE *outfile;
|
||||
J12SAMPARRAY buffer;
|
||||
int row_stride;
|
||||
int col;
|
||||
|
||||
if ((infile = fopen(infilename, "rb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", infilename);
|
||||
return 0;
|
||||
}
|
||||
if ((outfile = fopen(outfilename, "wb")) == NULL) {
|
||||
fprintf(stderr, "can't open %s\n", outfilename);
|
||||
fclose(infile);
|
||||
return 0;
|
||||
}
|
||||
fprintf(outfile, "P6\n%d %d\n%d\n", WIDTH, HEIGHT, MAXJ12SAMPLE);
|
||||
|
||||
cinfo->err = jpeg12_std_error(&jerr.pub);
|
||||
jerr.pub.error_exit = my12_error_exit;
|
||||
if (setjmp(jerr.setjmp_buffer)) {
|
||||
jpeg12_destroy_decompress(cinfo);
|
||||
fclose(infile);
|
||||
fclose(outfile);
|
||||
return 0;
|
||||
}
|
||||
jpeg12_create_decompress(cinfo);
|
||||
|
||||
jpeg12_stdio_src(cinfo, infile);
|
||||
|
||||
(void)jpeg12_read_header(cinfo, TRUE);
|
||||
|
||||
(void)jpeg12_start_decompress(cinfo);
|
||||
|
||||
row_stride = cinfo->output_width * cinfo->output_components;
|
||||
buffer = (*cinfo->mem->alloc_sarray)
|
||||
((j12_common_ptr)cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
|
||||
while (cinfo->output_scanline < cinfo->output_height) {
|
||||
(void)jpeg12_read_scanlines(cinfo, buffer, 1);
|
||||
/* Swap MSB and LSB in each sample */
|
||||
for (col = 0; col < row_stride; col++)
|
||||
buffer[0][col] = ((buffer[0][col] & 0xFF) << 8) |
|
||||
((buffer[0][col] >> 8) & 0xFF);
|
||||
fwrite(buffer[0], 1, row_stride * sizeof(J12SAMPLE), outfile);
|
||||
}
|
||||
|
||||
(void)jpeg12_finish_decompress(cinfo);
|
||||
|
||||
jpeg12_destroy_decompress(cinfo);
|
||||
|
||||
fclose(infile);
|
||||
fclose(outfile);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
usage(const char *progname)
|
||||
{
|
||||
fprintf(stderr, "usage: %s compress [switches] outputfile[.jpg]\n",
|
||||
progname);
|
||||
fprintf(stderr, " %s decompress inputfile[.jpg] outputfile[.ppm]\n",
|
||||
progname);
|
||||
fprintf(stderr, "Switches (names may be abbreviated):\n");
|
||||
#ifdef WITH_12BIT
|
||||
fprintf(stderr, " -12bit Compress/decompress JPEG file with 12-bit data precision\n");
|
||||
#endif
|
||||
fprintf(stderr, " -quality N Compression quality (0..100; 5-95 is most useful range,\n");
|
||||
fprintf(stderr, " default is 75)\n");
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
typedef enum {
|
||||
COMPRESS,
|
||||
DECOMPRESS
|
||||
} EXAMPLE_MODE;
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int argn, quality = 75;
|
||||
#ifdef WITH_12BIT
|
||||
int _12bit = 0;
|
||||
#endif
|
||||
EXAMPLE_MODE mode;
|
||||
char *arg, *filename = NULL;
|
||||
|
||||
if (argc < 3)
|
||||
usage(argv[0]);
|
||||
|
||||
if (!strcasecmp(argv[1], "compress"))
|
||||
mode = COMPRESS;
|
||||
else if (!strcasecmp(argv[1], "decompress"))
|
||||
mode = DECOMPRESS;
|
||||
else
|
||||
usage(argv[0]);
|
||||
|
||||
for (argn = 2; argn < argc; argn++) {
|
||||
arg = argv[argn];
|
||||
if (*arg != '-') {
|
||||
filename = arg;
|
||||
/* Not a switch, must be a file name argument */
|
||||
break; /* done parsing switches */
|
||||
}
|
||||
arg++; /* advance past switch marker character */
|
||||
|
||||
#ifdef WITH_12BIT
|
||||
if (!strncasecmp(arg, "1", 1)) {
|
||||
_12bit = 1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!strncasecmp(arg, "q", 1)) {
|
||||
/* Quality rating (quantization table scaling factor). */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage(argv[0]);
|
||||
if (sscanf(argv[argn], "%d", &quality) < 1 || quality < 0 ||
|
||||
quality > 100)
|
||||
usage(argv[0]);
|
||||
if (quality < 1)
|
||||
quality = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename)
|
||||
usage(argv[0]);
|
||||
|
||||
if (mode == COMPRESS) {
|
||||
#ifdef WITH_12BIT
|
||||
if (_12bit)
|
||||
write_JPEG12_file(filename, quality);
|
||||
else
|
||||
#endif
|
||||
write_JPEG_file(filename, quality);
|
||||
} else if (mode == DECOMPRESS) {
|
||||
if (argc - argn < 2)
|
||||
usage(argv[0]);
|
||||
|
||||
#ifdef WITH_12BIT
|
||||
if (_12bit)
|
||||
read_JPEG12_file(argv[argn], argv[argn + 1]);
|
||||
else
|
||||
#endif
|
||||
read_JPEG_file(argv[argn], argv[argn + 1]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -22,7 +22,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jcapistd.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -17,7 +19,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@ -3,8 +3,8 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code and
|
||||
* information relevant to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/* We use a full-image coefficient buffer when doing Huffman optimization,
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009-2012, 2015, D. R. Commander.
|
||||
* Copyright (C) 2009-2012, 2015, 2022, D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2011, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2011, 2014-2015, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
#include "jsimddct.h"
|
||||
|
||||
|
2
jchuff.c
2
jchuff.c
@ -25,7 +25,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
#include <limits.h>
|
||||
|
4
jcicc.c
4
jcicc.c
@ -2,7 +2,7 @@
|
||||
* jcicc.c
|
||||
*
|
||||
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
|
||||
* Copyright (C) 2017, D. R. Commander.
|
||||
* Copyright (C) 2017, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
||||
|
4
jcinit.c
4
jcinit.c
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* Copyright (C) 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* Copyright (C) 2010, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2016, 2018, D. R. Commander.
|
||||
* Copyright (C) 2010, 2016, 2018, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/*
|
||||
|
34
jconfig.h.in
34
jconfig.h.in
@ -9,29 +9,39 @@
|
||||
/* libjpeg-turbo version in integer form */
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
/* Support arithmetic encoding when using 8-bit samples */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
/* Support arithmetic decoding when using 8-bit samples */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support in-memory source/destination managers */
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
/* Use accelerated SIMD routines when using 8-bit samples */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define "INT32" as int, not long, per Windows custom */
|
||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
typedef short INT16;
|
||||
typedef signed int INT32;
|
||||
#endif
|
||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
#else
|
||||
|
||||
/* Define if your (broken) compiler shifts signed values as if they were
|
||||
unsigned. */
|
||||
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
|
||||
|
||||
#endif
|
||||
|
@ -42,3 +42,32 @@
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
*/
|
||||
|
||||
#ifndef BITS_IN_JSAMPLE
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
#endif
|
||||
|
||||
#undef C_ARITH_CODING_SUPPORTED
|
||||
#undef D_ARITH_CODING_SUPPORTED
|
||||
#undef WITH_SIMD
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
#endif
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2008 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2018, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jstdhuff.c"
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
#include <limits.h>
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/* At present, jcsample.c can request context rows only for smoothing.
|
||||
|
@ -6,7 +6,7 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* Copyright (C) 2015, 2019, D. R. Commander.
|
||||
* Copyright (C) 2015, 2019, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdmaster.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
||||
|
@ -6,12 +6,13 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2020, Google, Inc.
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/* Block smoothing is only applicable for progressive JPEG, so: */
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Modified 2011 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, 2011-2012, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011-2012, 2014-2015, 2022, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
#include "jsimddct.h"
|
||||
#include "jpegcomp.h"
|
||||
|
4
jdhuff.c
4
jdhuff.c
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2016, 2018-2019, 2022, D. R. Commander.
|
||||
* Copyright (C) 2018, Matthias Räncker.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdhuff.h" /* Declarations shared with jdphuff.c */
|
||||
#include "jpegcomp.h"
|
||||
#include "jstdhuff.c"
|
||||
|
4
jdicc.c
4
jdicc.c
@ -2,7 +2,7 @@
|
||||
* jdicc.c
|
||||
*
|
||||
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
|
||||
* Copyright (C) 2017, D. R. Commander.
|
||||
* Copyright (C) 2017, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
|
@ -3,12 +3,14 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
typedef enum { /* JPEG marker codes */
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
#include "jdmaster.h"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2020, 2022, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdmerge.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
@ -4,13 +4,13 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* Copyright (C) 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdhuff.h" /* Declarations shared with jdhuff.c */
|
||||
#include <limits.h>
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
@ -3,12 +3,14 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/* Pointer to routine to upsample a single component */
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* Copyright (C) 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
|
3
jerror.c
3
jerror.c
@ -22,8 +22,9 @@
|
||||
*/
|
||||
|
||||
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jversion.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jfdctflt.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -37,7 +39,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* Modified 2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2014, D. R. Commander.
|
||||
* Copyright (C) 2014, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modification developed 2002-2018 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
|
||||
#ifdef IDCT_SCALING_SUPPORTED
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1600
|
||||
#include <stdint.h>
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1992-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2017-2018, D. R. Commander.
|
||||
* Copyright (C) 2017-2018, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||
|
||||
|
||||
|
22
jmorecfg.h
22
jmorecfg.h
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -14,6 +14,9 @@
|
||||
* optimizations. Most users will not need to touch this file.
|
||||
*/
|
||||
|
||||
#ifndef JMORECFG_H
|
||||
#define JMORECFG_H
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of components (color channels) allowed in JPEG image.
|
||||
@ -41,7 +44,6 @@
|
||||
* arrays is very slow on your hardware, you might want to change these.
|
||||
*/
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
/* JSAMPLE should be the smallest type that will hold the values 0..255.
|
||||
*/
|
||||
|
||||
@ -51,21 +53,15 @@ typedef unsigned char JSAMPLE;
|
||||
#define MAXJSAMPLE 255
|
||||
#define CENTERJSAMPLE 128
|
||||
|
||||
#endif /* BITS_IN_JSAMPLE == 8 */
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 12
|
||||
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
|
||||
/* J12SAMPLE should be the smallest type that will hold the values 0..4095.
|
||||
* On nearly all machines "short" will do nicely.
|
||||
*/
|
||||
|
||||
typedef short JSAMPLE;
|
||||
#define GETJSAMPLE(value) ((int)(value))
|
||||
typedef short J12SAMPLE;
|
||||
|
||||
#define MAXJSAMPLE 4095
|
||||
#define CENTERJSAMPLE 2048
|
||||
|
||||
#endif /* BITS_IN_JSAMPLE == 12 */
|
||||
#define MAXJ12SAMPLE 4095
|
||||
#define CENTERJ12SAMPLE 2048
|
||||
|
||||
|
||||
/* Representation of a DCT frequency coefficient.
|
||||
@ -380,3 +376,5 @@ static const int rgb_pixelsize[JPEG_NUMCS] = {
|
||||
#endif
|
||||
|
||||
#endif /* JPEG_INTERNAL_OPTIONS */
|
||||
|
||||
#endif /* JMORECFG_H */
|
||||
|
391
jpeg12int.h
Normal file
391
jpeg12int.h
Normal file
@ -0,0 +1,391 @@
|
||||
/*
|
||||
* jpeg12int.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015-2016, 2019, 2021-2022, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2021, Alex Richardson.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file provides common declarations for the various JPEG modules.
|
||||
* These declarations are considered internal to the JPEG library; most
|
||||
* applications using the library shouldn't need to include this file.
|
||||
*/
|
||||
|
||||
#ifndef JPEG12INT_H
|
||||
#define JPEG12INT_H
|
||||
|
||||
|
||||
#ifndef JPEGINT_H
|
||||
|
||||
/* Declarations for both compression & decompression */
|
||||
|
||||
typedef enum { /* Operating modes for buffer controllers */
|
||||
JBUF_PASS_THRU, /* Plain stripwise operation */
|
||||
/* Remaining modes require a full-image buffer to have been created */
|
||||
JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
|
||||
JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
|
||||
JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
|
||||
} J_BUF_MODE;
|
||||
|
||||
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
|
||||
#define CSTATE_START 100 /* after create_compress */
|
||||
#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
|
||||
#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
|
||||
#define CSTATE_WRCOEFS 103 /* jpeg12_write_coefficients done */
|
||||
#define DSTATE_START 200 /* after create_decompress */
|
||||
#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
|
||||
#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
|
||||
#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
|
||||
#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
|
||||
#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
|
||||
#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
|
||||
#define DSTATE_BUFIMAGE 207 /* expecting jpeg12_start_output */
|
||||
#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in
|
||||
jpeg12_finish_output */
|
||||
#define DSTATE_RDCOEFS 209 /* reading file in jpeg12_read_coefficients */
|
||||
#define DSTATE_STOPPING 210 /* looking for EOI in
|
||||
jpeg12_finish_decompress */
|
||||
|
||||
|
||||
/* JLONG must hold at least signed 32-bit values. */
|
||||
typedef long JLONG;
|
||||
|
||||
/* JUINTPTR must hold pointer values. */
|
||||
#ifdef __UINTPTR_TYPE__
|
||||
/*
|
||||
* __UINTPTR_TYPE__ is GNU-specific and available in GCC 4.6+ and Clang 3.0+.
|
||||
* Fortunately, that is sufficient to support the few architectures for which
|
||||
* sizeof(void *) != sizeof(size_t). The only other options would require C99
|
||||
* or Clang-specific builtins.
|
||||
*/
|
||||
typedef __UINTPTR_TYPE__ JUINTPTR;
|
||||
#else
|
||||
typedef size_t JUINTPTR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Left shift macro that handles a negative operand without causing any
|
||||
* sanitizer warnings
|
||||
*/
|
||||
|
||||
#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))
|
||||
|
||||
#endif /* JPEGINT_H */
|
||||
|
||||
|
||||
/* Declarations for compression modules */
|
||||
|
||||
/* Master control module */
|
||||
struct jpeg12_comp_master {
|
||||
void (*prepare_for_pass) (j12_compress_ptr cinfo);
|
||||
void (*pass_startup) (j12_compress_ptr cinfo);
|
||||
void (*finish_pass) (j12_compress_ptr cinfo);
|
||||
|
||||
/* State variables made visible to other modules */
|
||||
boolean call_pass_startup; /* True if pass_startup must be called */
|
||||
boolean is_last_pass; /* True during last pass */
|
||||
};
|
||||
|
||||
/* Main buffer control (downsampled-data buffer) */
|
||||
struct jpeg12_c_main_controller {
|
||||
void (*start_pass) (j12_compress_ptr cinfo, J_BUF_MODE pass_mode);
|
||||
void (*process_data) (j12_compress_ptr cinfo, J12SAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail);
|
||||
};
|
||||
|
||||
/* Compression preprocessing (downsampling input buffer control) */
|
||||
struct jpeg12_c_prep_controller {
|
||||
void (*start_pass) (j12_compress_ptr cinfo, J_BUF_MODE pass_mode);
|
||||
void (*pre_process_data) (j12_compress_ptr cinfo, J12SAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
|
||||
J12SAMPIMAGE output_buf,
|
||||
JDIMENSION *out_row_group_ctr,
|
||||
JDIMENSION out_row_groups_avail);
|
||||
};
|
||||
|
||||
/* Coefficient buffer control */
|
||||
struct jpeg12_c_coef_controller {
|
||||
void (*start_pass) (j12_compress_ptr cinfo, J_BUF_MODE pass_mode);
|
||||
boolean (*compress_data) (j12_compress_ptr cinfo, J12SAMPIMAGE input_buf);
|
||||
};
|
||||
|
||||
/* Colorspace conversion */
|
||||
struct jpeg12_color_converter {
|
||||
void (*start_pass) (j12_compress_ptr cinfo);
|
||||
void (*color_convert) (j12_compress_ptr cinfo, J12SAMPARRAY input_buf,
|
||||
J12SAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows);
|
||||
};
|
||||
|
||||
/* Downsampling */
|
||||
struct jpeg12_downsampler {
|
||||
void (*start_pass) (j12_compress_ptr cinfo);
|
||||
void (*downsample) (j12_compress_ptr cinfo, J12SAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_index, J12SAMPIMAGE output_buf,
|
||||
JDIMENSION out_row_group_index);
|
||||
|
||||
boolean need_context_rows; /* TRUE if need rows above & below */
|
||||
};
|
||||
|
||||
/* Forward DCT (also controls coefficient quantization) */
|
||||
struct jpeg12_forward_dct {
|
||||
void (*start_pass) (j12_compress_ptr cinfo);
|
||||
/* perhaps this should be an array??? */
|
||||
void (*forward_DCT) (j12_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
J12SAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
||||
JDIMENSION start_row, JDIMENSION start_col,
|
||||
JDIMENSION num_blocks);
|
||||
};
|
||||
|
||||
/* Entropy encoding */
|
||||
struct jpeg12_entropy_encoder {
|
||||
void (*start_pass) (j12_compress_ptr cinfo, boolean gather_statistics);
|
||||
boolean (*encode_mcu) (j12_compress_ptr cinfo, JBLOCKROW *MCU_data);
|
||||
void (*finish_pass) (j12_compress_ptr cinfo);
|
||||
};
|
||||
|
||||
/* Marker writing */
|
||||
struct jpeg12_marker_writer {
|
||||
void (*write_file_header) (j12_compress_ptr cinfo);
|
||||
void (*write_frame_header) (j12_compress_ptr cinfo);
|
||||
void (*write_scan_header) (j12_compress_ptr cinfo);
|
||||
void (*write_file_trailer) (j12_compress_ptr cinfo);
|
||||
void (*write_tables_only) (j12_compress_ptr cinfo);
|
||||
/* These routines are exported to allow insertion of extra markers */
|
||||
/* Probably only COM and APPn markers should be written this way */
|
||||
void (*write_marker_header) (j12_compress_ptr cinfo, int marker,
|
||||
unsigned int datalen);
|
||||
void (*write_marker_byte) (j12_compress_ptr cinfo, int val);
|
||||
};
|
||||
|
||||
|
||||
/* Declarations for decompression modules */
|
||||
|
||||
/* Master control module */
|
||||
struct jpeg12_decomp_master {
|
||||
void (*prepare_for_output_pass) (j12_decompress_ptr cinfo);
|
||||
void (*finish_output_pass) (j12_decompress_ptr cinfo);
|
||||
|
||||
/* State variables made visible to other modules */
|
||||
boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
|
||||
|
||||
/* Partial decompression variables */
|
||||
JDIMENSION first_iMCU_col;
|
||||
JDIMENSION last_iMCU_col;
|
||||
JDIMENSION first_MCU_col[MAX_COMPONENTS];
|
||||
JDIMENSION last_MCU_col[MAX_COMPONENTS];
|
||||
boolean jinit_upsampler_no_alloc;
|
||||
|
||||
/* Last iMCU row that was successfully decoded */
|
||||
JDIMENSION last_good_iMCU_row;
|
||||
};
|
||||
|
||||
/* Input control module */
|
||||
struct jpeg12_input_controller {
|
||||
int (*consume_input) (j12_decompress_ptr cinfo);
|
||||
void (*reset_input_controller) (j12_decompress_ptr cinfo);
|
||||
void (*start_input_pass) (j12_decompress_ptr cinfo);
|
||||
void (*finish_input_pass) (j12_decompress_ptr cinfo);
|
||||
|
||||
/* State variables made visible to other modules */
|
||||
boolean has_multiple_scans; /* True if file has multiple scans */
|
||||
boolean eoi_reached; /* True when EOI has been consumed */
|
||||
};
|
||||
|
||||
/* Main buffer control (downsampled-data buffer) */
|
||||
struct jpeg12_d_main_controller {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo, J_BUF_MODE pass_mode);
|
||||
void (*process_data) (j12_decompress_ptr cinfo, J12SAMPARRAY output_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
|
||||
};
|
||||
|
||||
/* Coefficient buffer control */
|
||||
struct jpeg12_d_coef_controller {
|
||||
void (*start_input_pass) (j12_decompress_ptr cinfo);
|
||||
int (*consume_data) (j12_decompress_ptr cinfo);
|
||||
void (*start_output_pass) (j12_decompress_ptr cinfo);
|
||||
int (*decompress_data) (j12_decompress_ptr cinfo, J12SAMPIMAGE output_buf);
|
||||
/* Pointer to array of coefficient virtual arrays, or NULL if none */
|
||||
jvirt_barray_ptr *coef_arrays;
|
||||
};
|
||||
|
||||
/* Decompression postprocessing (color quantization buffer control) */
|
||||
struct jpeg12_d_post_controller {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo, J_BUF_MODE pass_mode);
|
||||
void (*post_process_data) (j12_decompress_ptr cinfo, J12SAMPIMAGE input_buf,
|
||||
JDIMENSION *in_row_group_ctr,
|
||||
JDIMENSION in_row_groups_avail,
|
||||
J12SAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
||||
JDIMENSION out_rows_avail);
|
||||
};
|
||||
|
||||
/* Marker reading & parsing */
|
||||
struct jpeg12_marker_reader {
|
||||
void (*reset_marker_reader) (j12_decompress_ptr cinfo);
|
||||
/* Read markers until SOS or EOI.
|
||||
* Returns same codes as are defined for jpeg12_consume_input:
|
||||
* JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
|
||||
*/
|
||||
int (*read_markers) (j12_decompress_ptr cinfo);
|
||||
/* Read a restart marker --- exported for use by entropy decoder only */
|
||||
jpeg12_marker_parser_method read_restart_marker;
|
||||
|
||||
/* State of marker reader --- nominally internal, but applications
|
||||
* supplying COM or APPn handlers might like to know the state.
|
||||
*/
|
||||
boolean saw_SOI; /* found SOI? */
|
||||
boolean saw_SOF; /* found SOF? */
|
||||
int next_restart_num; /* next restart number expected (0-7) */
|
||||
unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
|
||||
};
|
||||
|
||||
/* Entropy decoding */
|
||||
struct jpeg12_entropy_decoder {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo);
|
||||
boolean (*decode_mcu) (j12_decompress_ptr cinfo, JBLOCKROW *MCU_data);
|
||||
|
||||
/* This is here to share code between baseline and progressive decoders; */
|
||||
/* other modules probably should not use it */
|
||||
boolean insufficient_data; /* set TRUE after emitting warning */
|
||||
};
|
||||
|
||||
/* Inverse DCT (also performs dequantization) */
|
||||
typedef void (*inverse_DCT_12_method_ptr) (j12_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr,
|
||||
JCOEFPTR coef_block,
|
||||
J12SAMPARRAY output_buf,
|
||||
JDIMENSION output_col);
|
||||
|
||||
struct jpeg12_inverse_dct {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo);
|
||||
/* It is useful to allow each component to have a separate IDCT method. */
|
||||
inverse_DCT_12_method_ptr inverse_DCT[MAX_COMPONENTS];
|
||||
};
|
||||
|
||||
/* Upsampling (note that upsampler must also call color converter) */
|
||||
struct jpeg12_upsampler {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo);
|
||||
void (*upsample) (j12_decompress_ptr cinfo, J12SAMPIMAGE input_buf,
|
||||
JDIMENSION *in_row_group_ctr,
|
||||
JDIMENSION in_row_groups_avail, J12SAMPARRAY output_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
|
||||
|
||||
boolean need_context_rows; /* TRUE if need rows above & below */
|
||||
};
|
||||
|
||||
/* Colorspace conversion */
|
||||
struct jpeg12_color_deconverter {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo);
|
||||
void (*color_convert) (j12_decompress_ptr cinfo, J12SAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, J12SAMPARRAY output_buf,
|
||||
int num_rows);
|
||||
};
|
||||
|
||||
/* Color quantization or color precision reduction */
|
||||
struct jpeg12_color_quantizer {
|
||||
void (*start_pass) (j12_decompress_ptr cinfo, boolean is_pre_scan);
|
||||
void (*color_quantize) (j12_decompress_ptr cinfo, J12SAMPARRAY input_buf,
|
||||
J12SAMPARRAY output_buf, int num_rows);
|
||||
void (*finish_pass) (j12_decompress_ptr cinfo);
|
||||
void (*new_color_map) (j12_decompress_ptr cinfo);
|
||||
};
|
||||
|
||||
|
||||
/* Miscellaneous useful macros */
|
||||
|
||||
#undef MAX
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#undef MIN
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
|
||||
/* We assume that right shift corresponds to signed division by 2 with
|
||||
* rounding towards minus infinity. This is correct for typical "arithmetic
|
||||
* shift" instructions that shift in copies of the sign bit. But some
|
||||
* C compilers implement >> with an unsigned shift. For these machines you
|
||||
* must define RIGHT_SHIFT_IS_UNSIGNED.
|
||||
* RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity.
|
||||
* It is only applied with constant shift counts. SHIFT_TEMPS must be
|
||||
* included in the variables of any routine using RIGHT_SHIFT.
|
||||
*/
|
||||
|
||||
#ifdef RIGHT_SHIFT_IS_UNSIGNED
|
||||
#define SHIFT_TEMPS JLONG shift_temp;
|
||||
#define RIGHT_SHIFT(x, shft) \
|
||||
((shift_temp = (x)) < 0 ? \
|
||||
(shift_temp >> (shft)) | ((~((JLONG)0)) << (32 - (shft))) : \
|
||||
(shift_temp >> (shft)))
|
||||
#else
|
||||
#define SHIFT_TEMPS
|
||||
#define RIGHT_SHIFT(x, shft) ((x) >> (shft))
|
||||
#endif
|
||||
|
||||
|
||||
/* Compression module initialization routines */
|
||||
EXTERN(void) j12init_compress_master(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_c_master_control(j12_compress_ptr cinfo,
|
||||
boolean transcode_only);
|
||||
EXTERN(void) j12init_c_main_controller(j12_compress_ptr cinfo,
|
||||
boolean need_full_buffer);
|
||||
EXTERN(void) j12init_c_prep_controller(j12_compress_ptr cinfo,
|
||||
boolean need_full_buffer);
|
||||
EXTERN(void) j12init_c_coef_controller(j12_compress_ptr cinfo,
|
||||
boolean need_full_buffer);
|
||||
EXTERN(void) j12init_color_converter(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_downsampler(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_forward_dct(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_huff_encoder(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_phuff_encoder(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_arith_encoder(j12_compress_ptr cinfo);
|
||||
EXTERN(void) j12init_marker_writer(j12_compress_ptr cinfo);
|
||||
/* Decompression module initialization routines */
|
||||
EXTERN(void) j12init_master_decompress(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_d_main_controller(j12_decompress_ptr cinfo,
|
||||
boolean need_full_buffer);
|
||||
EXTERN(void) j12init_d_coef_controller(j12_decompress_ptr cinfo,
|
||||
boolean need_full_buffer);
|
||||
EXTERN(void) j12init_d_post_controller(j12_decompress_ptr cinfo,
|
||||
boolean need_full_buffer);
|
||||
EXTERN(void) j12init_input_controller(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_marker_reader(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_huff_decoder(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_phuff_decoder(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_arith_decoder(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_inverse_dct(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_upsampler(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_color_deconverter(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_1pass_quantizer(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_2pass_quantizer(j12_decompress_ptr cinfo);
|
||||
EXTERN(void) j12init_merged_upsampler(j12_decompress_ptr cinfo);
|
||||
/* Memory manager initialization */
|
||||
EXTERN(void) j12init_memory_mgr(j12_common_ptr cinfo);
|
||||
|
||||
#ifndef JPEGINT_H
|
||||
/* Utility routines in jutils.c */
|
||||
EXTERN(long) j12div_round_up(long a, long b);
|
||||
EXTERN(long) j12round_up(long a, long b);
|
||||
#endif
|
||||
EXTERN(void) j12copy_sample_rows(J12SAMPARRAY input_array, int source_row,
|
||||
J12SAMPARRAY output_array, int dest_row,
|
||||
int num_rows, JDIMENSION num_cols);
|
||||
#ifndef JPEGINT_H
|
||||
EXTERN(void) j12copy_block_row(JBLOCKROW input_row, JBLOCKROW output_row,
|
||||
JDIMENSION num_blocks);
|
||||
EXTERN(void) j12zero_far(void *target, size_t bytestozero);
|
||||
/* Constant tables in jutils.c */
|
||||
#if 0 /* This table is not actually needed in v6a */
|
||||
extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
|
||||
#endif
|
||||
extern const int jpeg12_natural_order[]; /* zigzag coef order to natural
|
||||
order */
|
||||
|
||||
/* Arithmetic coding probability estimation tables in jaricom.c */
|
||||
extern const JLONG jpeg_aritab[];
|
||||
#endif
|
||||
|
||||
#endif /* JPEG12INT_H */
|
1153
jpeg12lib.h
Normal file
1153
jpeg12lib.h
Normal file
File diff suppressed because it is too large
Load Diff
15
jpegint.h
15
jpegint.h
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015-2016, 2019, 2021, D. R. Commander.
|
||||
* Copyright (C) 2015-2016, 2019, 2021-2022, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2021, Alex Richardson.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
@ -16,6 +16,11 @@
|
||||
* applications using the library shouldn't need to include this file.
|
||||
*/
|
||||
|
||||
#ifndef JPEGINT_H
|
||||
#define JPEGINT_H
|
||||
|
||||
|
||||
#ifndef JPEG12INT_H
|
||||
|
||||
/* Declarations for both compression & decompression */
|
||||
|
||||
@ -68,6 +73,8 @@ typedef size_t JUINTPTR;
|
||||
|
||||
#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))
|
||||
|
||||
#endif /* JPEG12INT_H */
|
||||
|
||||
|
||||
/* Declarations for compression modules */
|
||||
|
||||
@ -356,12 +363,15 @@ EXTERN(void) jinit_merged_upsampler(j_decompress_ptr cinfo);
|
||||
/* Memory manager initialization */
|
||||
EXTERN(void) jinit_memory_mgr(j_common_ptr cinfo);
|
||||
|
||||
#ifndef JPEG12INT_H
|
||||
/* Utility routines in jutils.c */
|
||||
EXTERN(long) jdiv_round_up(long a, long b);
|
||||
EXTERN(long) jround_up(long a, long b);
|
||||
#endif
|
||||
EXTERN(void) jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
|
||||
JSAMPARRAY output_array, int dest_row,
|
||||
int num_rows, JDIMENSION num_cols);
|
||||
#ifndef JPEG12INT_H
|
||||
EXTERN(void) jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row,
|
||||
JDIMENSION num_blocks);
|
||||
EXTERN(void) jzero_far(void *target, size_t bytestozero);
|
||||
@ -373,3 +383,6 @@ extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
|
||||
|
||||
/* Arithmetic coding probability estimation tables in jaricom.c */
|
||||
extern const JLONG jpeg_aritab[];
|
||||
#endif
|
||||
|
||||
#endif /* JPEGINT_H */
|
||||
|
10
jpeglib.h
10
jpeglib.h
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2002-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, 2022, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -70,6 +70,8 @@ typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
|
||||
typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
|
||||
typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
|
||||
|
||||
#ifndef JPEG12LIB_H
|
||||
|
||||
typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
|
||||
typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
|
||||
typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
|
||||
@ -264,6 +266,8 @@ typedef enum {
|
||||
JDITHER_FS /* Floyd-Steinberg error diffusion dither */
|
||||
} J_DITHER_MODE;
|
||||
|
||||
#endif /* JPEG12LIB_H */
|
||||
|
||||
|
||||
/* Common fields between JPEG compression and decompression master structs. */
|
||||
|
||||
@ -822,6 +826,8 @@ struct jpeg_source_mgr {
|
||||
* successful.
|
||||
*/
|
||||
|
||||
#ifndef JPEG12LIB_H
|
||||
|
||||
#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
|
||||
#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
|
||||
#define JPOOL_NUMPOOLS 2
|
||||
@ -829,6 +835,8 @@ struct jpeg_source_mgr {
|
||||
typedef struct jvirt_sarray_control *jvirt_sarray_ptr;
|
||||
typedef struct jvirt_barray_control *jvirt_barray_ptr;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
struct jpeg_memory_mgr {
|
||||
/* Method pointers */
|
||||
|
328
jpeglibint.h
Normal file
328
jpeglibint.h
Normal file
@ -0,0 +1,328 @@
|
||||
/*
|
||||
* jpeglibint.h
|
||||
*
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#ifndef JPEGLIBINT_H
|
||||
#define JPEGLIBINT_H
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 12
|
||||
|
||||
#include "jpeg12lib.h"
|
||||
|
||||
|
||||
/* Rename all external types and functions that are affected by JSAMPLE. */
|
||||
|
||||
#define JSAMPLE J12SAMPLE
|
||||
|
||||
#undef MAXJSAMPLE
|
||||
#define MAXJSAMPLE MAXJ12SAMPLE
|
||||
#undef CENTERJSAMPLE
|
||||
#define CENTERJSAMPLE CENTERJ12SAMPLE
|
||||
|
||||
#define JSAMPROW J12SAMPROW
|
||||
#define JSAMPARRAY J12SAMPARRAY
|
||||
#define JSAMPIMAGE J12SAMPIMAGE
|
||||
|
||||
#define jpeg_common_struct jpeg12_common_struct
|
||||
|
||||
#define j_common_ptr j12_common_ptr
|
||||
#define j_compress_ptr j12_compress_ptr
|
||||
#define j_decompress_ptr j12_decompress_ptr
|
||||
|
||||
#define jpeg_compress_struct jpeg12_compress_struct
|
||||
|
||||
#define jpeg_decompress_struct jpeg12_decompress_struct
|
||||
|
||||
#define jpeg_error_mgr jpeg12_error_mgr
|
||||
|
||||
#define jpeg_progress_mgr jpeg12_progress_mgr
|
||||
|
||||
#define jpeg_destination_mgr jpeg12_destination_mgr
|
||||
|
||||
#define jpeg_source_mgr jpeg12_source_mgr
|
||||
|
||||
#define jpeg_memory_mgr jpeg12_memory_mgr
|
||||
|
||||
#define jpeg_marker_parser_method jpeg12_marker_parser_method
|
||||
|
||||
#define jpeg_std_error jpeg12_std_error
|
||||
|
||||
#define jpeg_create_compress jpeg12_create_compress
|
||||
#define jpeg_create_decompress jpeg12_create_decompress
|
||||
#define jpeg_CreateCompress jpeg12_CreateCompress
|
||||
#define jpeg_CreateDecompress jpeg12_CreateDecompress
|
||||
#define jpeg_destroy_compress jpeg12_destroy_compress
|
||||
#define jpeg_destroy_decompress jpeg12_destroy_decompress
|
||||
|
||||
#define jpeg_stdio_dest jpeg12_stdio_dest
|
||||
#define jpeg_stdio_src jpeg12_stdio_src
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
#define jpeg_mem_dest jpeg12_mem_dest
|
||||
#define jpeg_mem_src jpeg12_mem_src
|
||||
#endif
|
||||
|
||||
#define jpeg_set_defaults jpeg12_set_defaults
|
||||
#define jpeg_set_colorspace jpeg12_set_colorspace
|
||||
#define jpeg_default_colorspace jpeg12_default_colorspace
|
||||
#define jpeg_set_quality jpeg12_set_quality
|
||||
#define jpeg_set_linear_quality jpeg12_set_linear_quality
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
#define jpeg_default_qtables jpeg12_default_qtables
|
||||
#endif
|
||||
#define jpeg_add_quant_table jpeg12_add_quant_table
|
||||
#define jpeg_quality_scaling jpeg12_quality_scaling
|
||||
#define jpeg_simple_progression jpeg12_simple_progression
|
||||
#define jpeg_suppress_tables jpeg12_suppress_tables
|
||||
#define jpeg_alloc_quant_table jpeg12_alloc_quant_table
|
||||
#define jpeg_alloc_huff_table jpeg12_alloc_huff_table
|
||||
|
||||
#define jpeg_start_compress jpeg12_start_compress
|
||||
#define jpeg_write_scanlines jpeg12_write_scanlines
|
||||
#define jpeg_finish_compress jpeg12_finish_compress
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
#define jpeg_calc_jpeg_dimensions jpeg12_calc_jpeg_dimensions
|
||||
#endif
|
||||
|
||||
#define jpeg_write_raw_data jpeg12_write_raw_data
|
||||
|
||||
#define jpeg_write_marker jpeg12_write_marker
|
||||
#define jpeg_write_m_header jpeg12_write_m_header
|
||||
#define jpeg_write_m_byte jpeg12_write_m_byte
|
||||
|
||||
#define jpeg_write_tables jpeg12_write_tables
|
||||
|
||||
#define jpeg_write_icc_profile jpeg12_write_icc_profile
|
||||
|
||||
#define jpeg_read_header jpeg12_read_header
|
||||
|
||||
#define jpeg_start_decompress jpeg12_start_decompress
|
||||
#define jpeg_read_scanlines jpeg12_read_scanlines
|
||||
#define jpeg_skip_scanlines jpeg12_skip_scanlines
|
||||
#define jpeg_crop_scanline jpeg12_crop_scanline
|
||||
#define jpeg_finish_decompress jpeg12_finish_decompress
|
||||
|
||||
#define jpeg_read_raw_data jpeg12_read_raw_data
|
||||
|
||||
#define jpeg_has_multiple_scans jpeg12_has_multiple_scans
|
||||
#define jpeg_start_output jpeg12_start_output
|
||||
#define jpeg_finish_output jpeg12_finish_output
|
||||
#define jpeg_input_complete jpeg12_input_complete
|
||||
#define jpeg_new_colormap jpeg12_new_colormap
|
||||
#define jpeg_consume_input jpeg12_consume_input
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80
|
||||
#define jpeg_core_output_dimensions jpeg12_core_output_dimensions
|
||||
#endif
|
||||
#define jpeg_calc_output_dimensions jpeg12_calc_output_dimensions
|
||||
|
||||
#define jpeg_save_markers jpeg12_save_markers
|
||||
|
||||
#define jpeg_set_marker_processor jpeg12_set_marker_processor
|
||||
|
||||
#define jpeg_read_coefficients jpeg12_read_coefficients
|
||||
#define jpeg_write_coefficients jpeg12_write_coefficients
|
||||
#define jpeg_copy_critical_parameters jpeg12_copy_critical_parameters
|
||||
|
||||
#define jpeg_abort_compress jpeg12_abort_compress
|
||||
#define jpeg_abort_decompress jpeg12_abort_decompress
|
||||
|
||||
#define jpeg_abort jpeg12_abort
|
||||
#define jpeg_destroy jpeg12_destroy
|
||||
|
||||
#define jpeg_resync_to_restart jpeg12_resync_to_restart
|
||||
|
||||
#define jpeg_read_icc_profile jpeg12_read_icc_profile
|
||||
|
||||
|
||||
/* Rename all internal types and functions that are affected by JSAMPLE. */
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#define jpeg_comp_master jpeg12_comp_master
|
||||
#define jpeg_c_main_controller jpeg12_c_main_controller
|
||||
#define jpeg_c_prep_controller jpeg12_c_prep_controller
|
||||
#define jpeg_c_coef_controller jpeg12_c_coef_controller
|
||||
#define jpeg_color_converter jpeg12_color_converter
|
||||
#define jpeg_downsampler jpeg12_downsampler
|
||||
#define jpeg_forward_dct jpeg12_forward_dct
|
||||
#define jpeg_entropy_encoder jpeg12_entropy_encoder
|
||||
#define jpeg_marker_writer jpeg12_marker_writer
|
||||
#define jpeg_decomp_master jpeg12_decomp_master
|
||||
#define jpeg_input_controller jpeg12_input_controller
|
||||
#define jpeg_d_main_controller jpeg12_d_main_controller
|
||||
#define jpeg_d_coef_controller jpeg12_d_coef_controller
|
||||
#define jpeg_d_post_controller jpeg12_d_post_controller
|
||||
#define jpeg_marker_reader jpeg12_marker_reader
|
||||
#define jpeg_entropy_decoder jpeg12_entropy_decoder
|
||||
#define inverse_DCT_method_ptr inverse_DCT_12_method_ptr
|
||||
#define jpeg_inverse_dct jpeg12_inverse_dct
|
||||
#define jpeg_upsampler jpeg12_upsampler
|
||||
#define jpeg_color_deconverter jpeg12_color_deconverter
|
||||
#define jpeg_color_quantizer jpeg12_color_quantizer
|
||||
|
||||
#define jinit_compress_master j12init_compress_master
|
||||
#define jinit_c_master_control j12init_c_master_control
|
||||
#define jinit_c_main_controller j12init_c_main_controller
|
||||
#define jinit_c_prep_controller j12init_c_prep_controller
|
||||
#define jinit_c_coef_controller j12init_c_coef_controller
|
||||
#define jinit_color_converter j12init_color_converter
|
||||
#define jinit_downsampler j12init_downsampler
|
||||
#define jinit_forward_dct j12init_forward_dct
|
||||
#define jinit_huff_encoder j12init_huff_encoder
|
||||
#define jinit_phuff_encoder j12init_phuff_encoder
|
||||
#define jinit_arith_encoder j12init_arith_encoder
|
||||
#define jinit_marker_writer j12init_marker_writer
|
||||
#define jinit_master_decompress j12init_master_decompress
|
||||
#define jinit_d_main_controller j12init_d_main_controller
|
||||
#define jinit_d_coef_controller j12init_d_coef_controller
|
||||
#define jinit_d_post_controller j12init_d_post_controller
|
||||
#define jinit_input_controller j12init_input_controller
|
||||
#define jinit_marker_reader j12init_marker_reader
|
||||
#define jinit_huff_decoder j12init_huff_decoder
|
||||
#define jinit_phuff_decoder j12init_phuff_decoder
|
||||
#define jinit_arith_decoder j12init_arith_decoder
|
||||
#define jinit_inverse_dct j12init_inverse_dct
|
||||
#define jinit_upsampler j12init_upsampler
|
||||
#define jinit_color_deconverter j12init_color_deconverter
|
||||
#define jinit_1pass_quantizer j12init_1pass_quantizer
|
||||
#define jinit_2pass_quantizer j12init_2pass_quantizer
|
||||
#define jinit_merged_upsampler j12init_merged_upsampler
|
||||
#define jinit_memory_mgr j12init_memory_mgr
|
||||
#define jdiv_round_up j12div_round_up
|
||||
#define jround_up j12round_up
|
||||
#define jcopy_sample_rows j12copy_sample_rows
|
||||
#define jcopy_block_row j12copy_block_row
|
||||
#define jzero_far j12zero_far
|
||||
|
||||
#define jpeg_natural_order jpeg12_natural_order
|
||||
|
||||
#define jpeg_make_c_derived_tbl jpeg12_make_c_derived_tbl
|
||||
#define jpeg_gen_optimal_table jpeg12_gen_optimal_table
|
||||
|
||||
#define jpeg_fdct_islow jpeg12_fdct_islow
|
||||
#define jpeg_fdct_ifast jpeg12_fdct_ifast
|
||||
#define jpeg_fdct_float jpeg12_fdct_float
|
||||
#define jpeg_idct_islow jpeg12_idct_islow
|
||||
#define jpeg_idct_ifast jpeg12_idct_ifast
|
||||
#define jpeg_idct_float jpeg12_idct_float
|
||||
#define jpeg_idct_7x7 jpeg12_idct_7x7
|
||||
#define jpeg_idct_6x6 jpeg12_idct_6x6
|
||||
#define jpeg_idct_5x5 jpeg12_idct_5x5
|
||||
#define jpeg_idct_4x4 jpeg12_idct_4x4
|
||||
#define jpeg_idct_3x3 jpeg12_idct_3x3
|
||||
#define jpeg_idct_2x2 jpeg12_idct_2x2
|
||||
#define jpeg_idct_1x1 jpeg12_idct_1x1
|
||||
#define jpeg_idct_9x9 jpeg12_idct_9x9
|
||||
#define jpeg_idct_10x10 jpeg12_idct_10x10
|
||||
#define jpeg_idct_11x11 jpeg12_idct_11x11
|
||||
#define jpeg_idct_12x12 jpeg12_idct_12x12
|
||||
#define jpeg_idct_13x13 jpeg12_idct_13x13
|
||||
#define jpeg_idct_14x14 jpeg12_idct_14x14
|
||||
#define jpeg_idct_15x15 jpeg12_idct_15x15
|
||||
#define jpeg_idct_16x16 jpeg12_idct_16x16
|
||||
|
||||
#define jpeg_make_d_derived_tbl jpeg12_make_d_derived_tbl
|
||||
#define jpeg_fill_bit_buffer jpeg12_fill_bit_buffer
|
||||
#define jpeg_huff_decode jpeg12_huff_decode
|
||||
|
||||
#define jpeg_std_message_table jpeg12_std_message_table
|
||||
|
||||
#define jpeg_get_small jpeg12_get_small
|
||||
#define jpeg_free_small jpeg12_free_small
|
||||
#define jpeg_get_large jpeg12_get_large
|
||||
#define jpeg_free_large jpeg12_free_large
|
||||
#define jpeg_mem_available jpeg12_mem_available
|
||||
#define jpeg_open_backing_store jpeg12_open_backing_store
|
||||
#define jpeg_mem_init jpeg12_mem_init
|
||||
#define jpeg_mem_term jpeg12_mem_term
|
||||
|
||||
#define jsimd_can_rgb_ycc j12simd_can_rgb_ycc
|
||||
#define jsimd_can_rgb_gray j12simd_can_rgb_gray
|
||||
#define jsimd_can_ycc_rgb j12simd_can_ycc_rgb
|
||||
#define jsimd_can_ycc_rgb565 j12simd_can_ycc_rgb565
|
||||
#define jsimd_c_can_null_convert j12simd_c_can_null_convert
|
||||
#define jsimd_rgb_ycc_convert j12simd_rgb_ycc_convert
|
||||
#define jsimd_rgb_gray_convert j12simd_rgb_gray_convert
|
||||
#define jsimd_ycc_rgb_convert j12simd_ycc_rgb_convert
|
||||
#define jsimd_ycc_rgb565_convert j12simd_ycc_rgb565_convert
|
||||
#define jsimd_c_null_convert j12simd_c_null_convert
|
||||
#define jsimd_can_h2v2_downsample j12simd_can_h2v2_downsample
|
||||
#define jsimd_can_h2v1_downsample j12simd_can_h2v1_downsample
|
||||
#define jsimd_h2v2_downsample j12simd_h2v2_downsample
|
||||
#define jsimd_can_h2v2_smooth_downsample j12simd_can_h2v2_smooth_downsample
|
||||
#define jsimd_h2v2_smooth_downsample j12simd_h2v2_smooth_downsample
|
||||
#define jsimd_h2v1_downsample j12simd_h2v1_downsample
|
||||
#define jsimd_can_h2v2_upsample j12simd_can_h2v2_upsample
|
||||
#define jsimd_can_h2v1_upsample j12simd_can_h2v1_upsample
|
||||
#define jsimd_can_int_upsample j12simd_can_int_upsample
|
||||
#define jsimd_h2v2_upsample j12simd_h2v2_upsample
|
||||
#define jsimd_h2v1_upsample j12simd_h2v1_upsample
|
||||
#define jsimd_int_upsample j12simd_int_upsample
|
||||
#define jsimd_can_h2v2_fancy_upsample j12simd_can_h2v2_fancy_upsample
|
||||
#define jsimd_can_h2v1_fancy_upsample j12simd_can_h2v1_fancy_upsample
|
||||
#define jsimd_can_h1v2_fancy_upsample j12simd_can_h1v2_fancy_upsample
|
||||
#define jsimd_h2v2_fancy_upsample j12simd_h2v2_fancy_upsample
|
||||
#define jsimd_h2v1_fancy_upsample j12simd_h2v1_fancy_upsample
|
||||
#define jsimd_h1v2_fancy_upsample j12simd_h1v2_fancy_upsample
|
||||
#define jsimd_can_h2v2_merged_upsample j12simd_can_h2v2_merged_upsample
|
||||
#define jsimd_can_h2v1_merged_upsample j12simd_can_h2v1_merged_upsample
|
||||
#define jsimd_h2v2_merged_upsample j12simd_h2v2_merged_upsample
|
||||
#define jsimd_h2v1_merged_upsample j12simd_h2v1_merged_upsample
|
||||
#define jsimd_can_huff_encode_one_block j12simd_can_huff_encode_one_block
|
||||
#define jsimd_huff_encode_one_block j12simd_huff_encode_one_block
|
||||
#define jsimd_can_encode_mcu_AC_first_prepare \
|
||||
j12simd_can_encode_mcu_AC_first_prepare
|
||||
#define jsimd_encode_mcu_AC_first_prepare \
|
||||
j12simd_encode_mcu_AC_first_prepare
|
||||
#define jsimd_can_encode_mcu_AC_refine_prepare \
|
||||
j12simd_can_encode_mcu_AC_refine_prepare
|
||||
#define jsimd_encode_mcu_AC_refine_prepare \
|
||||
j12simd_encode_mcu_AC_refine_prepare
|
||||
|
||||
#define jsimd_can_convsamp j12simd_can_convsamp
|
||||
#define jsimd_can_convsamp_float j12simd_can_convsamp_float
|
||||
#define jsimd_convsamp j12simd_convsamp
|
||||
#define jsimd_convsamp_float j12simd_convsamp_float
|
||||
#define jsimd_can_fdct_islow j12simd_can_fdct_islow
|
||||
#define jsimd_can_fdct_ifast j12simd_can_fdct_ifast
|
||||
#define jsimd_can_fdct_float j12simd_can_fdct_float
|
||||
#define jsimd_fdct_islow j12simd_fdct_islow
|
||||
#define jsimd_fdct_ifast j12simd_fdct_ifast
|
||||
#define jsimd_fdct_float j12simd_fdct_float
|
||||
#define jsimd_can_quantize j12simd_can_quantize
|
||||
#define jsimd_can_quantize_float j12simd_can_quantize_float
|
||||
#define jsimd_quantize j12simd_quantize
|
||||
#define jsimd_quantize_float j12simd_quantize_float
|
||||
#define jsimd_can_idct_2x2 j12simd_can_idct_2x2
|
||||
#define jsimd_can_idct_4x4 j12simd_can_idct_4x4
|
||||
#define jsimd_can_idct_6x6 j12simd_can_idct_6x6
|
||||
#define jsimd_can_idct_12x12 j12simd_can_idct_12x12
|
||||
#define jsimd_idct_2x2 j12simd_idct_2x2
|
||||
#define jsimd_idct_4x4 j12simd_idct_4x4
|
||||
#define jsimd_idct_6x6 j12simd_idct_6x6
|
||||
#define jsimd_idct_12x12 j12simd_idct_12x12
|
||||
#define jsimd_can_idct_islow j12simd_can_idct_islow
|
||||
#define jsimd_can_idct_ifast j12simd_can_idct_ifast
|
||||
#define jsimd_can_idct_float j12simd_can_idct_float
|
||||
#define jsimd_idct_islow j12simd_idct_islow
|
||||
#define jsimd_idct_ifast j12simd_idct_ifast
|
||||
#define jsimd_idct_float j12simd_idct_float
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
|
||||
|
||||
#else /* BITS_IN_JSAMPLE == 12 */
|
||||
|
||||
#include "jpeglib.h"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* JPEGLIBINT_H */
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2015, D. R. Commander.
|
||||
* Copyright (C) 2009, 2015, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
#ifdef QUANT_1PASS_SUPPORTED
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2014-2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2009, 2014-2015, 2020, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
#ifdef QUANT_2PASS_SUPPORTED
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* jsimd_none.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009-2011, 2014, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2014, 2022, D. R. Commander.
|
||||
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
|
||||
* Copyright (C) 2020, Arm Limited.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "jsimd.h"
|
||||
#include "jdct.h"
|
||||
#include "jsimddct.h"
|
||||
|
2
jutils.c
2
jutils.c
@ -16,7 +16,7 @@
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,7 +1,7 @@
|
||||
LIBJPEGTURBO_@JPEG_LIB_VERSION_DECIMAL@ {
|
||||
@MEM_SRCDST_FUNCTIONS@
|
||||
local:
|
||||
jsimd_*;
|
||||
@SIMD_FUNCTIONS@;
|
||||
jconst_*;
|
||||
};
|
||||
|
||||
|
62
libjpeg.txt
62
libjpeg.txt
@ -11,10 +11,11 @@ For conditions of distribution and use, see the accompanying README.ijg file.
|
||||
This file describes how to use the IJG JPEG library within an application
|
||||
program. Read it if you want to write a program that uses the library.
|
||||
|
||||
The file example.txt provides heavily commented skeleton code for calling the
|
||||
JPEG library. Also see jpeglib.h (the include file to be used by application
|
||||
programs) for full details about data structures and function parameter lists.
|
||||
The library source code, of course, is the ultimate reference.
|
||||
The file example.c provides heavily commented code for calling the JPEG
|
||||
library. Also see jpeglib.h and jpeg12lib.h (the include files to be used by
|
||||
application programs) for full details about data structures and function
|
||||
parameter lists. The library source code, of course, is the ultimate
|
||||
reference.
|
||||
|
||||
Note that there have been *major* changes from the application interface
|
||||
presented by IJG version 4 and earlier versions. The old design had several
|
||||
@ -29,6 +30,7 @@ TABLE OF CONTENTS
|
||||
|
||||
Overview:
|
||||
Functions provided by the library
|
||||
12-bit Data Precision
|
||||
Outline of typical usage
|
||||
Basic library usage:
|
||||
Data formats
|
||||
@ -99,9 +101,7 @@ use.) Unsupported ISO options include:
|
||||
* Lossless JPEG
|
||||
* DNL marker
|
||||
* Nonintegral subsampling ratios
|
||||
We support both 8- and 12-bit data precision, but this is a compile-time
|
||||
choice rather than a run-time choice; hence it is difficult to use both
|
||||
precisions in a single application.
|
||||
We support both 8- and 12-bit data precision.
|
||||
|
||||
By itself, the library handles only interchange JPEG datastreams --- in
|
||||
particular the widely used JFIF file format. The library can be used by
|
||||
@ -110,6 +110,38 @@ are embedded in more complex file formats. (For example, this library is
|
||||
used by the free LIBTIFF library to support JPEG compression in TIFF.)
|
||||
|
||||
|
||||
12-bit Data Precision
|
||||
---------------------
|
||||
|
||||
Support for JPEG images with 12-bit, rather than 8-bit, samples is provided
|
||||
through a separate library, API, and header file (jpeg12lib.h instead of
|
||||
jpeglib.h). Functions supporting 12-bit samples have a prefix of "jpeg12_"
|
||||
instead of "jpeg_" and use the following data types, structures, and macros:
|
||||
|
||||
* J12SAMPLE instead of JSAMPLE
|
||||
* J12SAMPROW instead of JSAMPROW
|
||||
* J12SAMPARRAY instead of JSAMPARRAY
|
||||
* J12SAMPIMAGE instead of JSAMPIMAGE
|
||||
* MAXJ12SAMPLE instead of MAXJSAMPLE
|
||||
* CENTERJ12SAMPLE instead of CENTERJSAMPLE
|
||||
* jpeg12_common_struct instead of jpeg_common_struct
|
||||
* j12_common_ptr instead of j_common_ptr
|
||||
* jpeg12_compress_struct instead of jpeg_compress_struct
|
||||
* j12_compress_ptr instead of j_compress_ptr
|
||||
* jpeg12_decompress_struct instead of jpeg_decompress_struct
|
||||
* j12_decompress_ptr instead of j_decompress_ptr
|
||||
* jpeg12_error_mgr instead of jpeg_error_mgr
|
||||
* jpeg12_progress_mgr instead of jpeg_progress_mgr
|
||||
* jpeg12_destination_mgr instead of jpeg_destination_mgr
|
||||
* jpeg12_source_mgr instead of jpeg_source_mgr
|
||||
* jpeg12_memory_mgr instead of jpeg_memory_mgr
|
||||
* jpeg12_marker_parser_method instead of jpeg_marker_parser_method
|
||||
|
||||
This allows both 8-bit and 12-bit precision to be used in a single application.
|
||||
(Refer to example.c). Arithmetic coding and SIMD acceleration are not
|
||||
currently implemented for 12-bit samples.
|
||||
|
||||
|
||||
Outline of typical usage
|
||||
------------------------
|
||||
|
||||
@ -402,16 +434,13 @@ this variable as the loop counter, so that the loop test looks like
|
||||
"while (cinfo.next_scanline < cinfo.image_height)".
|
||||
|
||||
Code for this step depends heavily on the way that you store the source data.
|
||||
example.txt shows the following code for the case of a full-size 2-D source
|
||||
example.c shows the following code for the case of a full-size 2-D source
|
||||
array containing 3-byte RGB pixels:
|
||||
|
||||
JSAMPROW row_pointer[1]; /* pointer to a single row */
|
||||
int row_stride; /* physical row width in buffer */
|
||||
|
||||
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
|
||||
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
row_pointer[0] = &image_buffer[cinfo.next_scanline * row_stride];
|
||||
row_pointer[0] = image_buffer[cinfo.next_scanline];
|
||||
jpeg_write_scanlines(&cinfo, row_pointer, 1);
|
||||
}
|
||||
|
||||
@ -1445,7 +1474,7 @@ When the default error handler is used, any error detected inside the JPEG
|
||||
routines will cause a message to be printed on stderr, followed by exit().
|
||||
You can supply your own error handling routines to override this behavior
|
||||
and to control the treatment of nonfatal warnings and trace/debug messages.
|
||||
The file example.txt illustrates the most common case, which is to have the
|
||||
The file example.c illustrates the most common case, which is to have the
|
||||
application regain control after an error rather than exiting.
|
||||
|
||||
The JPEG library never writes any message directly; it always goes through
|
||||
@ -1462,7 +1491,7 @@ You may, if you wish, simply replace the entire JPEG error handling module
|
||||
only replacing some of the routines depending on the behavior you need.
|
||||
This is accomplished by calling jpeg_std_error() as usual, but then overriding
|
||||
some of the method pointers in the jpeg_error_mgr struct, as illustrated by
|
||||
example.txt.
|
||||
example.c.
|
||||
|
||||
All of the error handling routines will receive a pointer to the JPEG object
|
||||
(a j_common_ptr which points to either a jpeg_compress_struct or a
|
||||
@ -1473,7 +1502,7 @@ additional data which is not known to the JPEG library or the standard error
|
||||
handler. The most convenient way to do this is to embed either the JPEG
|
||||
object or the jpeg_error_mgr struct in a larger structure that contains
|
||||
additional fields; then casting the passed pointer provides access to the
|
||||
additional fields. Again, see example.txt for one way to do it. (Beginning
|
||||
additional fields. Again, see example.c for one way to do it. (Beginning
|
||||
with IJG version 6b, there is also a void pointer "client_data" in each
|
||||
JPEG object, which the application can also use to find related data.
|
||||
The library does not touch client_data at all.)
|
||||
@ -3064,8 +3093,7 @@ BITS_IN_JSAMPLE as 12 rather than 8. Note that this causes JSAMPLE to be
|
||||
larger than a char, so it affects the surrounding application's image data.
|
||||
The sample applications cjpeg and djpeg can support 12-bit mode only for PPM
|
||||
and GIF file formats; you must disable the other file formats to compile a
|
||||
12-bit cjpeg or djpeg. At present, a 12-bit library can handle *only* 12-bit
|
||||
images, not both precisions.
|
||||
12-bit cjpeg or djpeg.
|
||||
|
||||
Note that a 12-bit library always compresses in Huffman optimization mode,
|
||||
in order to generate valid Huffman tables. This is necessary because our
|
||||
|
@ -47,12 +47,23 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
|
||||
!endif
|
||||
!ifdef GCC
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg-@SO_MAJOR_VERSION@.dll"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg12-@SO_MAJOR_VERSION@.dll"
|
||||
!endif
|
||||
!else
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg@SO_MAJOR_VERSION@.dll"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg12-@SO_MAJOR_VERSION@.dll"
|
||||
!endif
|
||||
!endif
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}cjpeg.exe"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}djpeg.exe"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpegtran.exe"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}cjpeg12.exe"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}djpeg12.exe"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg12tran.exe"
|
||||
!endif
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}tjbench.exe"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe"
|
||||
@ -62,14 +73,25 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libturbojpeg.a"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg.dll.a"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg.a"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg12.dll.a"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg12.a"
|
||||
!endif
|
||||
!else
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}turbojpeg.lib"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}turbojpeg-static.lib"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg.lib"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg-static.lib"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg12.lib"
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg12-static.lib"
|
||||
!endif
|
||||
!endif
|
||||
SetOutPath $INSTDIR\lib\pkgconfig
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\pkgscripts\libjpeg.pc"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\pkgscripts\libjpeg12.pc"
|
||||
!endif
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\pkgscripts\libturbojpeg.pc"
|
||||
SetOutPath $INSTDIR\lib\cmake\@CMAKE_PROJECT_NAME@
|
||||
File "@CMAKE_CURRENT_BINARY_DIR@\pkgscripts\@CMAKE_PROJECT_NAME@Config.cmake"
|
||||
@ -85,12 +107,15 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\jerror.h"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\jmorecfg.h"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\jpeglib.h"
|
||||
!ifdef 12BIT
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\jpeg12lib.h"
|
||||
!endif
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\turbojpeg.h"
|
||||
SetOutPath $INSTDIR\doc
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\README.ijg"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\README.md"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\LICENSE.md"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\example.txt"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\example.c"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\libjpeg.txt"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\structure.txt"
|
||||
File "@CMAKE_CURRENT_SOURCE_DIR@\usage.txt"
|
||||
@ -129,22 +154,39 @@ Section "Uninstall"
|
||||
|
||||
!ifdef GCC
|
||||
Delete $INSTDIR\bin\libjpeg-@SO_MAJOR_VERSION@.dll
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\bin\libjpeg12-@SO_MAJOR_VERSION@.dll
|
||||
!endif
|
||||
Delete $INSTDIR\bin\libturbojpeg.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
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\lib\libjpeg12.dll.a
|
||||
Delete $INSTDIR\lib\libjpeg12.a
|
||||
!endif
|
||||
!else
|
||||
Delete $INSTDIR\bin\jpeg@SO_MAJOR_VERSION@.dll
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\bin\jpeg12-@SO_MAJOR_VERSION@.dll
|
||||
!endif
|
||||
Delete $INSTDIR\bin\turbojpeg.dll
|
||||
Delete $SYSDIR\turbojpeg.dll
|
||||
Delete $INSTDIR\lib\jpeg.lib
|
||||
Delete $INSTDIR\lib\jpeg-static.lib
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\lib\jpeg12.lib
|
||||
Delete $INSTDIR\lib\jpeg12-static.lib
|
||||
!endif
|
||||
Delete $INSTDIR\lib\turbojpeg.lib
|
||||
Delete $INSTDIR\lib\turbojpeg-static.lib
|
||||
!endif
|
||||
Delete $INSTDIR\lib\pkgconfig\libjpeg.pc
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\lib\pkgconfig\libjpeg12.pc
|
||||
!endif
|
||||
Delete $INSTDIR\lib\pkgconfig\libturbojpeg.pc
|
||||
Delete $INSTDIR\lib\cmake\@CMAKE_PROJECT_NAME@\@CMAKE_PROJECT_NAME@Config.cmake
|
||||
Delete $INSTDIR\lib\cmake\@CMAKE_PROJECT_NAME@\@CMAKE_PROJECT_NAME@ConfigVersion.cmake
|
||||
@ -156,6 +198,11 @@ Section "Uninstall"
|
||||
Delete $INSTDIR\bin\cjpeg.exe
|
||||
Delete $INSTDIR\bin\djpeg.exe
|
||||
Delete $INSTDIR\bin\jpegtran.exe
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\bin\cjpeg12.exe
|
||||
Delete $INSTDIR\bin\djpeg12.exe
|
||||
Delete $INSTDIR\bin\jpeg12tran.exe
|
||||
!endif
|
||||
Delete $INSTDIR\bin\tjbench.exe
|
||||
Delete $INSTDIR\bin\rdjpgcom.exe
|
||||
Delete $INSTDIR\bin\wrjpgcom.exe
|
||||
@ -163,12 +210,15 @@ Section "Uninstall"
|
||||
Delete $INSTDIR\include\jerror.h
|
||||
Delete $INSTDIR\include\jmorecfg.h
|
||||
Delete $INSTDIR\include\jpeglib.h
|
||||
!ifdef 12BIT
|
||||
Delete $INSTDIR\include\jpeg12lib.h
|
||||
!endif
|
||||
Delete $INSTDIR\include\turbojpeg.h
|
||||
Delete $INSTDIR\uninstall_@VERSION@.exe
|
||||
Delete $INSTDIR\doc\README.ijg
|
||||
Delete $INSTDIR\doc\README.md
|
||||
Delete $INSTDIR\doc\LICENSE.md
|
||||
Delete $INSTDIR\doc\example.txt
|
||||
Delete $INSTDIR\doc\example.c
|
||||
Delete $INSTDIR\doc\libjpeg.txt
|
||||
Delete $INSTDIR\doc\structure.txt
|
||||
Delete $INSTDIR\doc\usage.txt
|
||||
|
10
release/libjpeg12.pc.in
Normal file
10
release/libjpeg12.pc.in
Normal file
@ -0,0 +1,10 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=@CMAKE_INSTALL_PREFIX@
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
|
||||
Name: libjpeg12
|
||||
Description: A 12-bit JPEG codec that provides the libjpeg API
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -ljpeg12
|
||||
Cflags: -I${includedir}
|
@ -9,6 +9,7 @@
|
||||
%define _enable_shared @ENABLE_SHARED@
|
||||
%define _with_turbojpeg @WITH_TURBOJPEG@
|
||||
%define _with_java @WITH_JAVA@
|
||||
%define _with_12bit @WITH_12BIT@
|
||||
|
||||
%if "%{?__isa_bits:1}" == "1"
|
||||
%define _bits %{__isa_bits}
|
||||
@ -174,6 +175,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_bindir}/cjpeg
|
||||
%{_bindir}/djpeg
|
||||
%{_bindir}/jpegtran
|
||||
%if "%{_with_12bit}" == "1"
|
||||
%{_bindir}/cjpeg12
|
||||
%{_bindir}/djpeg12
|
||||
%{_bindir}/jpeg12tran
|
||||
%endif
|
||||
%if "%{_with_turbojpeg}" == "1"
|
||||
%{_bindir}/tjbench
|
||||
%endif
|
||||
@ -186,12 +192,23 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
|
||||
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
|
||||
%{_libdir}/libjpeg.so
|
||||
%if "%{_with_12bit}" == "1"
|
||||
%{_libdir}/libjpeg12.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
|
||||
%{_libdir}/libjpeg12.so.@SO_MAJOR_VERSION@
|
||||
%{_libdir}/libjpeg12.so
|
||||
%endif
|
||||
%endif
|
||||
%if "%{_enable_static}" == "1"
|
||||
%{_libdir}/libjpeg.a
|
||||
%if "%{_with_12bit}" == "1"
|
||||
%{_libdir}/libjpeg12.a
|
||||
%endif
|
||||
%endif
|
||||
%dir %{_libdir}/pkgconfig
|
||||
%{_libdir}/pkgconfig/libjpeg.pc
|
||||
%if "%{_with_12bit}" == "1"
|
||||
%{_libdir}/pkgconfig/libjpeg12.pc
|
||||
%endif
|
||||
%dir %{_libdir}/cmake
|
||||
%dir %{_libdir}/cmake/@CMAKE_PROJECT_NAME@
|
||||
%{_libdir}/cmake/@CMAKE_PROJECT_NAME@
|
||||
@ -211,6 +228,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_includedir}/jerror.h
|
||||
%{_includedir}/jmorecfg.h
|
||||
%{_includedir}/jpeglib.h
|
||||
%if "%{_with_12bit}" == "1"
|
||||
%{_includedir}/jpeg12lib.h
|
||||
%endif
|
||||
%if "%{_with_turbojpeg}" == "1"
|
||||
%{_includedir}/turbojpeg.h
|
||||
%endif
|
||||
|
@ -23,6 +23,10 @@ foreach(src ${JPEG_SOURCES})
|
||||
set(JPEG_SRCS ${JPEG_SRCS} ../${src})
|
||||
endforeach()
|
||||
|
||||
foreach(src ${JPEG12_SOURCES})
|
||||
set(JPEG12_SRCS ${JPEG12_SRCS} ../${src})
|
||||
endforeach()
|
||||
|
||||
if(WITH_SIMD AND (MSVC_IDE OR XCODE))
|
||||
# This tells CMake that the "source" files haven't been generated yet
|
||||
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
|
||||
@ -60,36 +64,89 @@ if(MSVC)
|
||||
set_target_properties(jpeg PROPERTIES
|
||||
RUNTIME_OUTPUT_NAME jpeg${SO_MAJOR_VERSION})
|
||||
# The jsimd_*.c file is built using /MT, so this prevents a linker warning.
|
||||
set_target_properties(jpeg PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD")
|
||||
set_target_properties(jpeg PROPERTIES LINK_FLAGS
|
||||
"/NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD")
|
||||
elseif(MINGW)
|
||||
set_target_properties(jpeg PROPERTIES SUFFIX -${SO_MAJOR_VERSION}.dll)
|
||||
endif()
|
||||
|
||||
if(WITH_12BIT)
|
||||
if(WIN32)
|
||||
if(WITH_MEM_SRCDST)
|
||||
set(DEFFILE ../win/jpeg12-${SO_MAJOR_VERSION}-memsrcdst.def)
|
||||
else()
|
||||
set(DEFFILE ../win/jpeg12-${SO_MAJOR_VERSION}.def)
|
||||
endif()
|
||||
endif()
|
||||
add_library(jpeg12 SHARED ${JPEG12_SRCS} ${DEFFILE} ../jsimd_none.c)
|
||||
set_property(TARGET jpeg12 PROPERTY COMPILE_FLAGS "-DBITS_IN_JSAMPLE=12")
|
||||
|
||||
set_target_properties(jpeg12 PROPERTIES SOVERSION ${SO_MAJOR_VERSION}
|
||||
VERSION ${SO_MAJOR_VERSION}.${SO_AGE}.${SO_MINOR_VERSION})
|
||||
if(APPLE AND (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR
|
||||
CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.4))
|
||||
set_target_properties(jpeg12 PROPERTIES MACOSX_RPATH 1)
|
||||
endif()
|
||||
if(MAPFLAG)
|
||||
set_target_properties(jpeg12 PROPERTIES
|
||||
LINK_FLAGS "${MAPFLAG}${CMAKE_CURRENT_BINARY_DIR}/../libjpeg12.map")
|
||||
endif()
|
||||
if(MSVC)
|
||||
set_target_properties(jpeg12 PROPERTIES
|
||||
RUNTIME_OUTPUT_NAME jpeg12-${SO_MAJOR_VERSION})
|
||||
elseif(MINGW)
|
||||
set_target_properties(jpeg12 PROPERTIES SUFFIX -${SO_MAJOR_VERSION}.dll)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(USE_SETMODE "-DUSE_SETMODE")
|
||||
endif()
|
||||
if(WITH_12BIT)
|
||||
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
|
||||
else()
|
||||
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
|
||||
set(CJPEG_BMP_SOURCES ../rdbmp.c ../rdtarga.c)
|
||||
set(DJPEG_BMP_SOURCES ../wrbmp.c ../wrtarga.c)
|
||||
endif()
|
||||
|
||||
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdgif.c ../rdppm.c
|
||||
../rdswitch.c ${CJPEG_BMP_SOURCES})
|
||||
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdbmp.c ../rdgif.c ../rdppm.c
|
||||
../rdswitch.c ../rdtarga.c)
|
||||
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
|
||||
target_link_libraries(cjpeg jpeg)
|
||||
|
||||
add_executable(djpeg ../djpeg.c ../cdjpeg.c ../rdcolmap.c ../rdswitch.c
|
||||
../wrgif.c ../wrppm.c ${DJPEG_BMP_SOURCES})
|
||||
set_property(TARGET djpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
../wrbmp.c ../wrgif.c ../wrppm.c ../wrtarga.c)
|
||||
set_property(TARGET djpeg PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
|
||||
target_link_libraries(djpeg jpeg)
|
||||
|
||||
add_executable(jpegtran ../jpegtran.c ../cdjpeg.c ../rdswitch.c ../transupp.c)
|
||||
target_link_libraries(jpegtran jpeg)
|
||||
set_property(TARGET jpegtran PROPERTY COMPILE_FLAGS "${USE_SETMODE}")
|
||||
|
||||
if(WITH_12BIT)
|
||||
add_executable(cjpeg12 ../cjpeg.c ../cdjpeg.c ../rdgif.c ../rdppm.c
|
||||
../rdswitch.c)
|
||||
set_property(TARGET cjpeg12 PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=12 -DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
|
||||
target_link_libraries(cjpeg12 jpeg12)
|
||||
|
||||
add_executable(djpeg12 ../djpeg.c ../cdjpeg.c ../rdcolmap.c ../rdswitch.c
|
||||
../wrgif.c ../wrppm.c)
|
||||
set_property(TARGET djpeg12 PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=12 -DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
|
||||
target_link_libraries(djpeg12 jpeg12)
|
||||
|
||||
add_executable(jpeg12tran ../jpegtran.c ../cdjpeg.c ../rdswitch.c
|
||||
../transupp.c)
|
||||
target_link_libraries(jpeg12tran jpeg12)
|
||||
set_property(TARGET jpeg12tran PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=12 ${USE_SETMODE}")
|
||||
endif()
|
||||
|
||||
add_executable(example ../example.c)
|
||||
if(WITH_12BIT)
|
||||
target_link_libraries(example jpeg jpeg12)
|
||||
set_property(TARGET example PROPERTY COMPILE_FLAGS "-DWITH_12BIT")
|
||||
else()
|
||||
target_link_libraries(example jpeg)
|
||||
endif()
|
||||
|
||||
add_executable(jcstest ../jcstest.c)
|
||||
target_link_libraries(jcstest jpeg)
|
||||
|
||||
@ -105,3 +162,18 @@ if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
|
||||
install(FILES "$<TARGET_PDB_FILE:jpeg>"
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
|
||||
endif()
|
||||
|
||||
if(WITH_12BIT)
|
||||
install(TARGETS jpeg12 EXPORT ${CMAKE_PROJECT_NAME}Targets
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(TARGETS cjpeg12 djpeg12 jpeg12tran
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
|
||||
CMAKE_C_LINKER_SUPPORTS_PDB)
|
||||
install(FILES "$<TARGET_PDB_FILE:jpeg12>"
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -57,10 +57,7 @@ Within these limits, any set of compression parameters allowed by the JPEG
|
||||
spec should be readable for decompression. (We can be more restrictive about
|
||||
what formats we can generate.) Although the system design allows for all
|
||||
parameter values, some uncommon settings are not yet implemented and may
|
||||
never be; nonintegral sampling ratios are the prime example. Furthermore,
|
||||
we treat 8-bit vs. 12-bit data precision as a compile-time switch, not a
|
||||
run-time option, because most machines can store 8-bit pixels much more
|
||||
compactly than 12-bit.
|
||||
never be; nonintegral sampling ratios are the prime example.
|
||||
|
||||
By itself, the library handles only interchange JPEG datastreams --- in
|
||||
particular the widely used JFIF file format. The library can be used by
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpeglibint.h"
|
||||
#include "transupp.h" /* My own external interface */
|
||||
#include "jpegcomp.h"
|
||||
#include <ctype.h> /* to declare isdigit() */
|
||||
|
@ -53,7 +53,7 @@ extern void jpeg_mem_src_tj(j_decompress_ptr, const unsigned char *,
|
||||
#define IS_POW2(x) (((x) & (x - 1)) == 0)
|
||||
|
||||
|
||||
/* Error handling (based on example in example.txt) */
|
||||
/* Error handling (based on example in example.c) */
|
||||
|
||||
static THREAD_LOCAL char errStr[JMSG_LENGTH_MAX] = "No error";
|
||||
|
||||
@ -490,7 +490,7 @@ static tjhandle _tjInitCompress(tjinstance *this)
|
||||
unsigned char *buf = buffer;
|
||||
unsigned long size = 1;
|
||||
|
||||
/* This is also straight out of example.txt */
|
||||
/* This is also straight out of example.c */
|
||||
this->cinfo.err = jpeg_std_error(&this->jerr.pub);
|
||||
this->jerr.pub.error_exit = my_error_exit;
|
||||
this->jerr.pub.output_message = my_output_message;
|
||||
@ -1164,7 +1164,7 @@ static tjhandle _tjInitDecompress(tjinstance *this)
|
||||
{
|
||||
static unsigned char buffer[1];
|
||||
|
||||
/* This is also straight out of example.txt */
|
||||
/* This is also straight out of example.c */
|
||||
this->dinfo.err = jpeg_std_error(&this->jerr.pub);
|
||||
this->jerr.pub.error_exit = my_error_exit;
|
||||
this->jerr.pub.output_message = my_output_message;
|
||||
|
@ -15,6 +15,16 @@ set_target_properties(@CMAKE_PROJECT_NAME@::jpeg PROPERTIES
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg "${_IMPORT_PREFIX}/lib/libjpeg.dll.a" "${_IMPORT_PREFIX}/bin/libjpeg-62.dll" )
|
||||
|
||||
# Import target "@CMAKE_PROJECT_NAME@::jpeg12" for configuration "Release"
|
||||
set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg12 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(@CMAKE_PROJECT_NAME@::jpeg12 PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libjpeg12.dll.a"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libjpeg12-62.dll"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg12 )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg12 "${_IMPORT_PREFIX}/lib/libjpeg12.dll.a" "${_IMPORT_PREFIX}/bin/libjpeg12-62.dll" )
|
||||
|
||||
# Import target "@CMAKE_PROJECT_NAME@::turbojpeg" for configuration "Release"
|
||||
set_property(TARGET @CMAKE_PROJECT_NAME@::turbojpeg APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(@CMAKE_PROJECT_NAME@::turbojpeg PROPERTIES
|
||||
@ -45,5 +55,15 @@ set_target_properties(@CMAKE_PROJECT_NAME@::jpeg-static PROPERTIES
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg-static )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg-static "${_IMPORT_PREFIX}/lib/libjpeg.a" )
|
||||
|
||||
# Import target "@CMAKE_PROJECT_NAME@::jpeg12-static" for configuration "Release"
|
||||
set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg12-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(@CMAKE_PROJECT_NAME@::jpeg12-static PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libjpeg12.a"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg12-static )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg12-static "${_IMPORT_PREFIX}/lib/libjpeg12.a" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
|
@ -1,25 +0,0 @@
|
||||
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||
#cmakedefine WITH_SIMD
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define "INT32" as int, not long, per Windows custom */
|
||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
typedef short INT16;
|
||||
typedef signed int INT32;
|
||||
#endif
|
||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
108
win/jpeg12-62-memsrcdst.def
Normal file
108
win/jpeg12-62-memsrcdst.def
Normal file
@ -0,0 +1,108 @@
|
||||
EXPORTS
|
||||
j12copy_block_row @ 1 ;
|
||||
j12copy_sample_rows @ 2 ;
|
||||
j12div_round_up @ 3 ;
|
||||
j12init_1pass_quantizer @ 4 ;
|
||||
j12init_2pass_quantizer @ 5 ;
|
||||
j12init_c_coef_controller @ 6 ;
|
||||
j12init_c_main_controller @ 7 ;
|
||||
j12init_c_master_control @ 8 ;
|
||||
j12init_c_prep_controller @ 9 ;
|
||||
j12init_color_converter @ 10 ;
|
||||
j12init_color_deconverter @ 11 ;
|
||||
j12init_compress_master @ 12 ;
|
||||
j12init_d_coef_controller @ 13 ;
|
||||
j12init_d_main_controller @ 14 ;
|
||||
j12init_d_post_controller @ 15 ;
|
||||
j12init_downsampler @ 16 ;
|
||||
j12init_forward_dct @ 17 ;
|
||||
j12init_huff_decoder @ 18 ;
|
||||
j12init_huff_encoder @ 19 ;
|
||||
j12init_input_controller @ 20 ;
|
||||
j12init_inverse_dct @ 21 ;
|
||||
j12init_marker_reader @ 22 ;
|
||||
j12init_marker_writer @ 23 ;
|
||||
j12init_master_decompress @ 24 ;
|
||||
j12init_memory_mgr @ 25 ;
|
||||
j12init_merged_upsampler @ 26 ;
|
||||
j12init_phuff_decoder @ 27 ;
|
||||
j12init_phuff_encoder @ 28 ;
|
||||
j12init_upsampler @ 29 ;
|
||||
jpeg12_CreateCompress @ 30 ;
|
||||
jpeg12_CreateDecompress @ 31 ;
|
||||
jpeg12_abort @ 32 ;
|
||||
jpeg12_abort_compress @ 33 ;
|
||||
jpeg12_abort_decompress @ 34 ;
|
||||
jpeg12_add_quant_table @ 35 ;
|
||||
jpeg12_alloc_huff_table @ 36 ;
|
||||
jpeg12_alloc_quant_table @ 37 ;
|
||||
jpeg12_calc_output_dimensions @ 38 ;
|
||||
jpeg12_consume_input @ 39 ;
|
||||
jpeg12_copy_critical_parameters @ 40 ;
|
||||
jpeg12_default_colorspace @ 41 ;
|
||||
jpeg12_destroy @ 42 ;
|
||||
jpeg12_destroy_compress @ 43 ;
|
||||
jpeg12_destroy_decompress @ 44 ;
|
||||
jpeg12_fdct_float @ 45 ;
|
||||
jpeg12_fdct_ifast @ 46 ;
|
||||
jpeg12_fdct_islow @ 47 ;
|
||||
jpeg12_fill_bit_buffer @ 48 ;
|
||||
jpeg12_finish_compress @ 49 ;
|
||||
jpeg12_finish_decompress @ 50 ;
|
||||
jpeg12_finish_output @ 51 ;
|
||||
jpeg12_free_large @ 52 ;
|
||||
jpeg12_free_small @ 53 ;
|
||||
jpeg12_gen_optimal_table @ 54 ;
|
||||
jpeg12_get_large @ 55 ;
|
||||
jpeg12_get_small @ 56 ;
|
||||
jpeg12_has_multiple_scans @ 57 ;
|
||||
jpeg12_huff_decode @ 58 ;
|
||||
jpeg12_idct_1x1 @ 59 ;
|
||||
jpeg12_idct_2x2 @ 60 ;
|
||||
jpeg12_idct_4x4 @ 61 ;
|
||||
jpeg12_idct_float @ 62 ;
|
||||
jpeg12_idct_ifast @ 63 ;
|
||||
jpeg12_idct_islow @ 64 ;
|
||||
jpeg12_input_complete @ 65 ;
|
||||
jpeg12_make_c_derived_tbl @ 66 ;
|
||||
jpeg12_make_d_derived_tbl @ 67 ;
|
||||
jpeg12_mem_available @ 68 ;
|
||||
jpeg12_mem_init @ 69 ;
|
||||
jpeg12_mem_term @ 70 ;
|
||||
jpeg12_new_colormap @ 71 ;
|
||||
jpeg12_open_backing_store @ 72 ;
|
||||
jpeg12_quality_scaling @ 73 ;
|
||||
jpeg12_read_coefficients @ 74 ;
|
||||
jpeg12_read_header @ 75 ;
|
||||
jpeg12_read_raw_data @ 76 ;
|
||||
jpeg12_read_scanlines @ 77 ;
|
||||
jpeg12_resync_to_restart @ 78 ;
|
||||
jpeg12_save_markers @ 79 ;
|
||||
jpeg12_set_colorspace @ 80 ;
|
||||
jpeg12_set_defaults @ 81 ;
|
||||
jpeg12_set_linear_quality @ 82 ;
|
||||
jpeg12_set_marker_processor @ 83 ;
|
||||
jpeg12_set_quality @ 84 ;
|
||||
jpeg12_simple_progression @ 85 ;
|
||||
jpeg12_start_compress @ 86 ;
|
||||
jpeg12_start_decompress @ 87 ;
|
||||
jpeg12_start_output @ 88 ;
|
||||
jpeg12_std_error @ 89 ;
|
||||
jpeg12_stdio_dest @ 90 ;
|
||||
jpeg12_stdio_src @ 91 ;
|
||||
jpeg12_suppress_tables @ 92 ;
|
||||
jpeg12_write_coefficients @ 93 ;
|
||||
jpeg12_write_m_byte @ 94 ;
|
||||
jpeg12_write_m_header @ 95 ;
|
||||
jpeg12_write_marker @ 96 ;
|
||||
jpeg12_write_raw_data @ 97 ;
|
||||
jpeg12_write_scanlines @ 98 ;
|
||||
jpeg12_write_tables @ 99 ;
|
||||
j12round_up @ 100 ;
|
||||
j12zero_far @ 101 ;
|
||||
jpeg12_mem_dest @ 102 ;
|
||||
jpeg12_mem_src @ 103 ;
|
||||
jpeg12_skip_scanlines @ 104 ;
|
||||
jpeg12_crop_scanline @ 105 ;
|
||||
jpeg12_read_icc_profile @ 106 ;
|
||||
jpeg12_write_icc_profile @ 107 ;
|
106
win/jpeg12-62.def
Normal file
106
win/jpeg12-62.def
Normal file
@ -0,0 +1,106 @@
|
||||
EXPORTS
|
||||
j12copy_block_row @ 1 ;
|
||||
j12copy_sample_rows @ 2 ;
|
||||
j12div_round_up @ 3 ;
|
||||
j12init_1pass_quantizer @ 4 ;
|
||||
j12init_2pass_quantizer @ 5 ;
|
||||
j12init_c_coef_controller @ 6 ;
|
||||
j12init_c_main_controller @ 7 ;
|
||||
j12init_c_master_control @ 8 ;
|
||||
j12init_c_prep_controller @ 9 ;
|
||||
j12init_color_converter @ 10 ;
|
||||
j12init_color_deconverter @ 11 ;
|
||||
j12init_compress_master @ 12 ;
|
||||
j12init_d_coef_controller @ 13 ;
|
||||
j12init_d_main_controller @ 14 ;
|
||||
j12init_d_post_controller @ 15 ;
|
||||
j12init_downsampler @ 16 ;
|
||||
j12init_forward_dct @ 17 ;
|
||||
j12init_huff_decoder @ 18 ;
|
||||
j12init_huff_encoder @ 19 ;
|
||||
j12init_input_controller @ 20 ;
|
||||
j12init_inverse_dct @ 21 ;
|
||||
j12init_marker_reader @ 22 ;
|
||||
j12init_marker_writer @ 23 ;
|
||||
j12init_master_decompress @ 24 ;
|
||||
j12init_memory_mgr @ 25 ;
|
||||
j12init_merged_upsampler @ 26 ;
|
||||
j12init_phuff_decoder @ 27 ;
|
||||
j12init_phuff_encoder @ 28 ;
|
||||
j12init_upsampler @ 29 ;
|
||||
jpeg12_CreateCompress @ 30 ;
|
||||
jpeg12_CreateDecompress @ 31 ;
|
||||
jpeg12_abort @ 32 ;
|
||||
jpeg12_abort_compress @ 33 ;
|
||||
jpeg12_abort_decompress @ 34 ;
|
||||
jpeg12_add_quant_table @ 35 ;
|
||||
jpeg12_alloc_huff_table @ 36 ;
|
||||
jpeg12_alloc_quant_table @ 37 ;
|
||||
jpeg12_calc_output_dimensions @ 38 ;
|
||||
jpeg12_consume_input @ 39 ;
|
||||
jpeg12_copy_critical_parameters @ 40 ;
|
||||
jpeg12_default_colorspace @ 41 ;
|
||||
jpeg12_destroy @ 42 ;
|
||||
jpeg12_destroy_compress @ 43 ;
|
||||
jpeg12_destroy_decompress @ 44 ;
|
||||
jpeg12_fdct_float @ 45 ;
|
||||
jpeg12_fdct_ifast @ 46 ;
|
||||
jpeg12_fdct_islow @ 47 ;
|
||||
jpeg12_fill_bit_buffer @ 48 ;
|
||||
jpeg12_finish_compress @ 49 ;
|
||||
jpeg12_finish_decompress @ 50 ;
|
||||
jpeg12_finish_output @ 51 ;
|
||||
jpeg12_free_large @ 52 ;
|
||||
jpeg12_free_small @ 53 ;
|
||||
jpeg12_gen_optimal_table @ 54 ;
|
||||
jpeg12_get_large @ 55 ;
|
||||
jpeg12_get_small @ 56 ;
|
||||
jpeg12_has_multiple_scans @ 57 ;
|
||||
jpeg12_huff_decode @ 58 ;
|
||||
jpeg12_idct_1x1 @ 59 ;
|
||||
jpeg12_idct_2x2 @ 60 ;
|
||||
jpeg12_idct_4x4 @ 61 ;
|
||||
jpeg12_idct_float @ 62 ;
|
||||
jpeg12_idct_ifast @ 63 ;
|
||||
jpeg12_idct_islow @ 64 ;
|
||||
jpeg12_input_complete @ 65 ;
|
||||
jpeg12_make_c_derived_tbl @ 66 ;
|
||||
jpeg12_make_d_derived_tbl @ 67 ;
|
||||
jpeg12_mem_available @ 68 ;
|
||||
jpeg12_mem_init @ 69 ;
|
||||
jpeg12_mem_term @ 70 ;
|
||||
jpeg12_new_colormap @ 71 ;
|
||||
jpeg12_open_backing_store @ 72 ;
|
||||
jpeg12_quality_scaling @ 73 ;
|
||||
jpeg12_read_coefficients @ 74 ;
|
||||
jpeg12_read_header @ 75 ;
|
||||
jpeg12_read_raw_data @ 76 ;
|
||||
jpeg12_read_scanlines @ 77 ;
|
||||
jpeg12_resync_to_restart @ 78 ;
|
||||
jpeg12_save_markers @ 79 ;
|
||||
jpeg12_set_colorspace @ 80 ;
|
||||
jpeg12_set_defaults @ 81 ;
|
||||
jpeg12_set_linear_quality @ 82 ;
|
||||
jpeg12_set_marker_processor @ 83 ;
|
||||
jpeg12_set_quality @ 84 ;
|
||||
jpeg12_simple_progression @ 85 ;
|
||||
jpeg12_start_compress @ 86 ;
|
||||
jpeg12_start_decompress @ 87 ;
|
||||
jpeg12_start_output @ 88 ;
|
||||
jpeg12_std_error @ 89 ;
|
||||
jpeg12_stdio_dest @ 90 ;
|
||||
jpeg12_stdio_src @ 91 ;
|
||||
jpeg12_suppress_tables @ 92 ;
|
||||
jpeg12_write_coefficients @ 93 ;
|
||||
jpeg12_write_m_byte @ 94 ;
|
||||
jpeg12_write_m_header @ 95 ;
|
||||
jpeg12_write_marker @ 96 ;
|
||||
jpeg12_write_raw_data @ 97 ;
|
||||
jpeg12_write_scanlines @ 98 ;
|
||||
jpeg12_write_tables @ 99 ;
|
||||
j12round_up @ 100 ;
|
||||
j12zero_far @ 101 ;
|
||||
jpeg12_skip_scanlines @ 102 ;
|
||||
jpeg12_crop_scanline @ 103 ;
|
||||
jpeg12_read_icc_profile @ 104 ;
|
||||
jpeg12_write_icc_profile @ 105 ;
|
110
win/jpeg12-7-memsrcdst.def
Normal file
110
win/jpeg12-7-memsrcdst.def
Normal file
@ -0,0 +1,110 @@
|
||||
EXPORTS
|
||||
j12copy_block_row @ 1 ;
|
||||
j12copy_sample_rows @ 2 ;
|
||||
j12div_round_up @ 3 ;
|
||||
j12init_1pass_quantizer @ 4 ;
|
||||
j12init_2pass_quantizer @ 5 ;
|
||||
j12init_c_coef_controller @ 6 ;
|
||||
j12init_c_main_controller @ 7 ;
|
||||
j12init_c_master_control @ 8 ;
|
||||
j12init_c_prep_controller @ 9 ;
|
||||
j12init_color_converter @ 10 ;
|
||||
j12init_color_deconverter @ 11 ;
|
||||
j12init_compress_master @ 12 ;
|
||||
j12init_d_coef_controller @ 13 ;
|
||||
j12init_d_main_controller @ 14 ;
|
||||
j12init_d_post_controller @ 15 ;
|
||||
j12init_downsampler @ 16 ;
|
||||
j12init_forward_dct @ 17 ;
|
||||
j12init_huff_decoder @ 18 ;
|
||||
j12init_huff_encoder @ 19 ;
|
||||
j12init_input_controller @ 20 ;
|
||||
j12init_inverse_dct @ 21 ;
|
||||
j12init_marker_reader @ 22 ;
|
||||
j12init_marker_writer @ 23 ;
|
||||
j12init_master_decompress @ 24 ;
|
||||
j12init_memory_mgr @ 25 ;
|
||||
j12init_merged_upsampler @ 26 ;
|
||||
j12init_phuff_decoder @ 27 ;
|
||||
j12init_phuff_encoder @ 28 ;
|
||||
j12init_upsampler @ 29 ;
|
||||
jpeg12_CreateCompress @ 30 ;
|
||||
jpeg12_CreateDecompress @ 31 ;
|
||||
jpeg12_abort @ 32 ;
|
||||
jpeg12_abort_compress @ 33 ;
|
||||
jpeg12_abort_decompress @ 34 ;
|
||||
jpeg12_add_quant_table @ 35 ;
|
||||
jpeg12_alloc_huff_table @ 36 ;
|
||||
jpeg12_alloc_quant_table @ 37 ;
|
||||
jpeg12_calc_jpeg_dimensions @ 38 ;
|
||||
jpeg12_calc_output_dimensions @ 39 ;
|
||||
jpeg12_consume_input @ 40 ;
|
||||
jpeg12_copy_critical_parameters @ 41 ;
|
||||
jpeg12_default_colorspace @ 42 ;
|
||||
jpeg12_default_qtables @ 43 ;
|
||||
jpeg12_destroy @ 44 ;
|
||||
jpeg12_destroy_compress @ 45 ;
|
||||
jpeg12_destroy_decompress @ 46 ;
|
||||
jpeg12_fdct_float @ 47 ;
|
||||
jpeg12_fdct_ifast @ 48 ;
|
||||
jpeg12_fdct_islow @ 49 ;
|
||||
jpeg12_fill_bit_buffer @ 50 ;
|
||||
jpeg12_finish_compress @ 51 ;
|
||||
jpeg12_finish_decompress @ 52 ;
|
||||
jpeg12_finish_output @ 53 ;
|
||||
jpeg12_free_large @ 54 ;
|
||||
jpeg12_free_small @ 55 ;
|
||||
jpeg12_gen_optimal_table @ 56 ;
|
||||
jpeg12_get_large @ 57 ;
|
||||
jpeg12_get_small @ 58 ;
|
||||
jpeg12_has_multiple_scans @ 59 ;
|
||||
jpeg12_huff_decode @ 60 ;
|
||||
jpeg12_idct_1x1 @ 61 ;
|
||||
jpeg12_idct_2x2 @ 62 ;
|
||||
jpeg12_idct_4x4 @ 63 ;
|
||||
jpeg12_idct_float @ 64 ;
|
||||
jpeg12_idct_ifast @ 65 ;
|
||||
jpeg12_idct_islow @ 66 ;
|
||||
jpeg12_input_complete @ 67 ;
|
||||
jpeg12_make_c_derived_tbl @ 68 ;
|
||||
jpeg12_make_d_derived_tbl @ 69 ;
|
||||
jpeg12_mem_available @ 70 ;
|
||||
jpeg12_mem_init @ 71 ;
|
||||
jpeg12_mem_term @ 72 ;
|
||||
jpeg12_new_colormap @ 73 ;
|
||||
jpeg12_open_backing_store @ 74 ;
|
||||
jpeg12_quality_scaling @ 75 ;
|
||||
jpeg12_read_coefficients @ 76 ;
|
||||
jpeg12_read_header @ 77 ;
|
||||
jpeg12_read_raw_data @ 78 ;
|
||||
jpeg12_read_scanlines @ 79 ;
|
||||
jpeg12_resync_to_restart @ 80 ;
|
||||
jpeg12_save_markers @ 81 ;
|
||||
jpeg12_set_colorspace @ 82 ;
|
||||
jpeg12_set_defaults @ 83 ;
|
||||
jpeg12_set_linear_quality @ 84 ;
|
||||
jpeg12_set_marker_processor @ 85 ;
|
||||
jpeg12_set_quality @ 86 ;
|
||||
jpeg12_simple_progression @ 87 ;
|
||||
jpeg12_start_compress @ 88 ;
|
||||
jpeg12_start_decompress @ 89 ;
|
||||
jpeg12_start_output @ 90 ;
|
||||
jpeg12_std_error @ 91 ;
|
||||
jpeg12_stdio_dest @ 92 ;
|
||||
jpeg12_stdio_src @ 93 ;
|
||||
jpeg12_suppress_tables @ 94 ;
|
||||
jpeg12_write_coefficients @ 95 ;
|
||||
jpeg12_write_m_byte @ 96 ;
|
||||
jpeg12_write_m_header @ 97 ;
|
||||
jpeg12_write_marker @ 98 ;
|
||||
jpeg12_write_raw_data @ 99 ;
|
||||
jpeg12_write_scanlines @ 100 ;
|
||||
jpeg12_write_tables @ 101 ;
|
||||
j12round_up @ 102 ;
|
||||
j12zero_far @ 103 ;
|
||||
jpeg12_mem_dest @ 104 ;
|
||||
jpeg12_mem_src @ 105 ;
|
||||
jpeg12_skip_scanlines @ 106 ;
|
||||
jpeg12_crop_scanline @ 107 ;
|
||||
jpeg12_read_icc_profile @ 108 ;
|
||||
jpeg12_write_icc_profile @ 109 ;
|
108
win/jpeg12-7.def
Normal file
108
win/jpeg12-7.def
Normal file
@ -0,0 +1,108 @@
|
||||
EXPORTS
|
||||
j12copy_block_row @ 1 ;
|
||||
j12copy_sample_rows @ 2 ;
|
||||
j12div_round_up @ 3 ;
|
||||
j12init_1pass_quantizer @ 4 ;
|
||||
j12init_2pass_quantizer @ 5 ;
|
||||
j12init_c_coef_controller @ 6 ;
|
||||
j12init_c_main_controller @ 7 ;
|
||||
j12init_c_master_control @ 8 ;
|
||||
j12init_c_prep_controller @ 9 ;
|
||||
j12init_color_converter @ 10 ;
|
||||
j12init_color_deconverter @ 11 ;
|
||||
j12init_compress_master @ 12 ;
|
||||
j12init_d_coef_controller @ 13 ;
|
||||
j12init_d_main_controller @ 14 ;
|
||||
j12init_d_post_controller @ 15 ;
|
||||
j12init_downsampler @ 16 ;
|
||||
j12init_forward_dct @ 17 ;
|
||||
j12init_huff_decoder @ 18 ;
|
||||
j12init_huff_encoder @ 19 ;
|
||||
j12init_input_controller @ 20 ;
|
||||
j12init_inverse_dct @ 21 ;
|
||||
j12init_marker_reader @ 22 ;
|
||||
j12init_marker_writer @ 23 ;
|
||||
j12init_master_decompress @ 24 ;
|
||||
j12init_memory_mgr @ 25 ;
|
||||
j12init_merged_upsampler @ 26 ;
|
||||
j12init_phuff_decoder @ 27 ;
|
||||
j12init_phuff_encoder @ 28 ;
|
||||
j12init_upsampler @ 29 ;
|
||||
jpeg12_CreateCompress @ 30 ;
|
||||
jpeg12_CreateDecompress @ 31 ;
|
||||
jpeg12_abort @ 32 ;
|
||||
jpeg12_abort_compress @ 33 ;
|
||||
jpeg12_abort_decompress @ 34 ;
|
||||
jpeg12_add_quant_table @ 35 ;
|
||||
jpeg12_alloc_huff_table @ 36 ;
|
||||
jpeg12_alloc_quant_table @ 37 ;
|
||||
jpeg12_calc_jpeg_dimensions @ 38 ;
|
||||
jpeg12_calc_output_dimensions @ 39 ;
|
||||
jpeg12_consume_input @ 40 ;
|
||||
jpeg12_copy_critical_parameters @ 41 ;
|
||||
jpeg12_default_colorspace @ 42 ;
|
||||
jpeg12_default_qtables @ 43 ;
|
||||
jpeg12_destroy @ 44 ;
|
||||
jpeg12_destroy_compress @ 45 ;
|
||||
jpeg12_destroy_decompress @ 46 ;
|
||||
jpeg12_fdct_float @ 47 ;
|
||||
jpeg12_fdct_ifast @ 48 ;
|
||||
jpeg12_fdct_islow @ 49 ;
|
||||
jpeg12_fill_bit_buffer @ 50 ;
|
||||
jpeg12_finish_compress @ 51 ;
|
||||
jpeg12_finish_decompress @ 52 ;
|
||||
jpeg12_finish_output @ 53 ;
|
||||
jpeg12_free_large @ 54 ;
|
||||
jpeg12_free_small @ 55 ;
|
||||
jpeg12_gen_optimal_table @ 56 ;
|
||||
jpeg12_get_large @ 57 ;
|
||||
jpeg12_get_small @ 58 ;
|
||||
jpeg12_has_multiple_scans @ 59 ;
|
||||
jpeg12_huff_decode @ 60 ;
|
||||
jpeg12_idct_1x1 @ 61 ;
|
||||
jpeg12_idct_2x2 @ 62 ;
|
||||
jpeg12_idct_4x4 @ 63 ;
|
||||
jpeg12_idct_float @ 64 ;
|
||||
jpeg12_idct_ifast @ 65 ;
|
||||
jpeg12_idct_islow @ 66 ;
|
||||
jpeg12_input_complete @ 67 ;
|
||||
jpeg12_make_c_derived_tbl @ 68 ;
|
||||
jpeg12_make_d_derived_tbl @ 69 ;
|
||||
jpeg12_mem_available @ 70 ;
|
||||
jpeg12_mem_init @ 71 ;
|
||||
jpeg12_mem_term @ 72 ;
|
||||
jpeg12_new_colormap @ 73 ;
|
||||
jpeg12_open_backing_store @ 74 ;
|
||||
jpeg12_quality_scaling @ 75 ;
|
||||
jpeg12_read_coefficients @ 76 ;
|
||||
jpeg12_read_header @ 77 ;
|
||||
jpeg12_read_raw_data @ 78 ;
|
||||
jpeg12_read_scanlines @ 79 ;
|
||||
jpeg12_resync_to_restart @ 80 ;
|
||||
jpeg12_save_markers @ 81 ;
|
||||
jpeg12_set_colorspace @ 82 ;
|
||||
jpeg12_set_defaults @ 83 ;
|
||||
jpeg12_set_linear_quality @ 84 ;
|
||||
jpeg12_set_marker_processor @ 85 ;
|
||||
jpeg12_set_quality @ 86 ;
|
||||
jpeg12_simple_progression @ 87 ;
|
||||
jpeg12_start_compress @ 88 ;
|
||||
jpeg12_start_decompress @ 89 ;
|
||||
jpeg12_start_output @ 90 ;
|
||||
jpeg12_std_error @ 91 ;
|
||||
jpeg12_stdio_dest @ 92 ;
|
||||
jpeg12_stdio_src @ 93 ;
|
||||
jpeg12_suppress_tables @ 94 ;
|
||||
jpeg12_write_coefficients @ 95 ;
|
||||
jpeg12_write_m_byte @ 96 ;
|
||||
jpeg12_write_m_header @ 97 ;
|
||||
jpeg12_write_marker @ 98 ;
|
||||
jpeg12_write_raw_data @ 99 ;
|
||||
jpeg12_write_scanlines @ 100 ;
|
||||
jpeg12_write_tables @ 101 ;
|
||||
j12round_up @ 102 ;
|
||||
j12zero_far @ 103 ;
|
||||
jpeg12_skip_scanlines @ 104 ;
|
||||
jpeg12_crop_scanline @ 105 ;
|
||||
jpeg12_read_icc_profile @ 106 ;
|
||||
jpeg12_write_icc_profile @ 107 ;
|
111
win/jpeg12-8.def
Normal file
111
win/jpeg12-8.def
Normal file
@ -0,0 +1,111 @@
|
||||
EXPORTS
|
||||
j12copy_block_row @ 1 ;
|
||||
j12copy_sample_rows @ 2 ;
|
||||
j12div_round_up @ 3 ;
|
||||
j12init_1pass_quantizer @ 4 ;
|
||||
j12init_2pass_quantizer @ 5 ;
|
||||
j12init_c_coef_controller @ 6 ;
|
||||
j12init_c_main_controller @ 7 ;
|
||||
j12init_c_master_control @ 8 ;
|
||||
j12init_c_prep_controller @ 9 ;
|
||||
j12init_color_converter @ 10 ;
|
||||
j12init_color_deconverter @ 11 ;
|
||||
j12init_compress_master @ 12 ;
|
||||
j12init_d_coef_controller @ 13 ;
|
||||
j12init_d_main_controller @ 14 ;
|
||||
j12init_d_post_controller @ 15 ;
|
||||
j12init_downsampler @ 16 ;
|
||||
j12init_forward_dct @ 17 ;
|
||||
j12init_huff_decoder @ 18 ;
|
||||
j12init_huff_encoder @ 19 ;
|
||||
j12init_input_controller @ 20 ;
|
||||
j12init_inverse_dct @ 21 ;
|
||||
j12init_marker_reader @ 22 ;
|
||||
j12init_marker_writer @ 23 ;
|
||||
j12init_master_decompress @ 24 ;
|
||||
j12init_memory_mgr @ 25 ;
|
||||
j12init_merged_upsampler @ 26 ;
|
||||
j12init_phuff_decoder @ 27 ;
|
||||
j12init_phuff_encoder @ 28 ;
|
||||
j12init_upsampler @ 29 ;
|
||||
jpeg12_CreateCompress @ 30 ;
|
||||
jpeg12_CreateDecompress @ 31 ;
|
||||
jpeg12_abort @ 32 ;
|
||||
jpeg12_abort_compress @ 33 ;
|
||||
jpeg12_abort_decompress @ 34 ;
|
||||
jpeg12_add_quant_table @ 35 ;
|
||||
jpeg12_alloc_huff_table @ 36 ;
|
||||
jpeg12_alloc_quant_table @ 37 ;
|
||||
jpeg12_calc_jpeg_dimensions @ 38 ;
|
||||
jpeg12_calc_output_dimensions @ 39 ;
|
||||
jpeg12_consume_input @ 40 ;
|
||||
jpeg12_copy_critical_parameters @ 41 ;
|
||||
jpeg12_core_output_dimensions @ 42 ;
|
||||
jpeg12_default_colorspace @ 43 ;
|
||||
jpeg12_default_qtables @ 44 ;
|
||||
jpeg12_destroy @ 45 ;
|
||||
jpeg12_destroy_compress @ 46 ;
|
||||
jpeg12_destroy_decompress @ 47 ;
|
||||
jpeg12_fdct_float @ 48 ;
|
||||
jpeg12_fdct_ifast @ 49 ;
|
||||
jpeg12_fdct_islow @ 50 ;
|
||||
jpeg12_fill_bit_buffer @ 51 ;
|
||||
jpeg12_finish_compress @ 52 ;
|
||||
jpeg12_finish_decompress @ 53 ;
|
||||
jpeg12_finish_output @ 54 ;
|
||||
jpeg12_free_large @ 55 ;
|
||||
jpeg12_free_small @ 56 ;
|
||||
jpeg12_gen_optimal_table @ 57 ;
|
||||
jpeg12_get_large @ 58 ;
|
||||
jpeg12_get_small @ 59 ;
|
||||
jpeg12_has_multiple_scans @ 60 ;
|
||||
jpeg12_huff_decode @ 61 ;
|
||||
jpeg12_idct_1x1 @ 62 ;
|
||||
jpeg12_idct_2x2 @ 63 ;
|
||||
jpeg12_idct_4x4 @ 64 ;
|
||||
jpeg12_idct_float @ 65 ;
|
||||
jpeg12_idct_ifast @ 66 ;
|
||||
jpeg12_idct_islow @ 67 ;
|
||||
jpeg12_input_complete @ 68 ;
|
||||
jpeg12_make_c_derived_tbl @ 69 ;
|
||||
jpeg12_make_d_derived_tbl @ 70 ;
|
||||
jpeg12_mem_available @ 71 ;
|
||||
jpeg12_mem_dest @ 72 ;
|
||||
jpeg12_mem_init @ 73 ;
|
||||
jpeg12_mem_src @ 74 ;
|
||||
jpeg12_mem_term @ 75 ;
|
||||
jpeg12_new_colormap @ 76 ;
|
||||
jpeg12_open_backing_store @ 77 ;
|
||||
jpeg12_quality_scaling @ 78 ;
|
||||
jpeg12_read_coefficients @ 79 ;
|
||||
jpeg12_read_header @ 80 ;
|
||||
jpeg12_read_raw_data @ 81 ;
|
||||
jpeg12_read_scanlines @ 82 ;
|
||||
jpeg12_resync_to_restart @ 83 ;
|
||||
jpeg12_save_markers @ 84 ;
|
||||
jpeg12_set_colorspace @ 85 ;
|
||||
jpeg12_set_defaults @ 86 ;
|
||||
jpeg12_set_linear_quality @ 87 ;
|
||||
jpeg12_set_marker_processor @ 88 ;
|
||||
jpeg12_set_quality @ 89 ;
|
||||
jpeg12_simple_progression @ 90 ;
|
||||
jpeg12_start_compress @ 91 ;
|
||||
jpeg12_start_decompress @ 92 ;
|
||||
jpeg12_start_output @ 93 ;
|
||||
jpeg12_std_error @ 94 ;
|
||||
jpeg12_stdio_dest @ 95 ;
|
||||
jpeg12_stdio_src @ 96 ;
|
||||
jpeg12_suppress_tables @ 97 ;
|
||||
jpeg12_write_coefficients @ 98 ;
|
||||
jpeg12_write_m_byte @ 99 ;
|
||||
jpeg12_write_m_header @ 100 ;
|
||||
jpeg12_write_marker @ 101 ;
|
||||
jpeg12_write_raw_data @ 102 ;
|
||||
jpeg12_write_scanlines @ 103 ;
|
||||
jpeg12_write_tables @ 104 ;
|
||||
j12round_up @ 105 ;
|
||||
j12zero_far @ 106 ;
|
||||
jpeg12_skip_scanlines @ 107 ;
|
||||
jpeg12_crop_scanline @ 108 ;
|
||||
jpeg12_read_icc_profile @ 109 ;
|
||||
jpeg12_write_icc_profile @ 110 ;
|
@ -15,6 +15,16 @@ set_target_properties(@CMAKE_PROJECT_NAME@::jpeg PROPERTIES
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg "${_IMPORT_PREFIX}/lib/jpeg.lib" "${_IMPORT_PREFIX}/bin/jpeg62.dll" )
|
||||
|
||||
# Import target "@CMAKE_PROJECT_NAME@::jpeg12" for configuration "Release"
|
||||
set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg12 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(@CMAKE_PROJECT_NAME@::jpeg12 PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/jpeg12.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/jpeg12-62.dll"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg12 )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg12 "${_IMPORT_PREFIX}/lib/jpeg12.lib" "${_IMPORT_PREFIX}/bin/jpeg12-62.dll" )
|
||||
|
||||
# Import target "@CMAKE_PROJECT_NAME@::turbojpeg" for configuration "Release"
|
||||
set_property(TARGET @CMAKE_PROJECT_NAME@::turbojpeg APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(@CMAKE_PROJECT_NAME@::turbojpeg PROPERTIES
|
||||
@ -45,5 +55,15 @@ set_target_properties(@CMAKE_PROJECT_NAME@::jpeg-static PROPERTIES
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg-static )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg-static "${_IMPORT_PREFIX}/lib/jpeg-static.lib" )
|
||||
|
||||
# Import target "@CMAKE_PROJECT_NAME@::jpeg12-static" for configuration "Release"
|
||||
set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg12-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(@CMAKE_PROJECT_NAME@::jpeg12-static PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/jpeg12-static.lib"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg12-static )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg12-static "${_IMPORT_PREFIX}/lib/jpeg12-static.lib" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
|
Loading…
x
Reference in New Issue
Block a user