Commit 56d69eee authored by Davis King's avatar Davis King

Just removed some typedefs because they cause name conflicts in

visual studio 2010.  So I just replaced the uses of the typedef
with the actual type.
parent fa25ae78
......@@ -238,7 +238,7 @@ default_decompress_parms (j_decompress_ptr cinfo)
*/
GLOBAL(int)
jpeg_read_header (j_decompress_ptr cinfo, boolean require_image)
jpeg_read_header (j_decompress_ptr cinfo, int require_image)
{
int retcode;
......@@ -330,7 +330,7 @@ jpeg_consume_input (j_decompress_ptr cinfo)
* Have we finished reading the input file?
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_input_complete (j_decompress_ptr cinfo)
{
/* Check for valid jpeg object */
......@@ -345,7 +345,7 @@ jpeg_input_complete (j_decompress_ptr cinfo)
* Is there more than one scan?
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_has_multiple_scans (j_decompress_ptr cinfo)
{
/* Only valid after jpeg_read_header completes */
......@@ -365,7 +365,7 @@ jpeg_has_multiple_scans (j_decompress_ptr cinfo)
* a suspending data source is used.
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_finish_decompress (j_decompress_ptr cinfo)
{
if ((cinfo->global_state == DSTATE_SCANNING ||
......
......@@ -20,7 +20,7 @@
/* Forward declarations */
LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
LOCAL(int) output_pass_setup JPP((j_decompress_ptr cinfo));
/*
......@@ -34,7 +34,7 @@ LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
* a suspending data source is used.
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_start_decompress (j_decompress_ptr cinfo)
{
if (cinfo->global_state == DSTATE_READY) {
......@@ -91,7 +91,7 @@ jpeg_start_decompress (j_decompress_ptr cinfo)
* If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
*/
LOCAL(boolean)
LOCAL(int)
output_pass_setup (j_decompress_ptr cinfo)
{
if (cinfo->global_state != DSTATE_PRESCAN) {
......@@ -224,7 +224,7 @@ jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
* Initialize for an output pass in buffered-image mode.
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
{
if (cinfo->global_state != DSTATE_BUFIMAGE &&
......@@ -249,7 +249,7 @@ jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
* a suspending data source is used.
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_finish_output (j_decompress_ptr cinfo)
{
if ((cinfo->global_state == DSTATE_SCANNING ||
......
......@@ -27,7 +27,7 @@ typedef struct {
FILE * infile; /* source stream */
JOCTET * buffer; /* start of buffer */
boolean start_of_file; /* have we gotten any data yet? */
int start_of_file; /* have we gotten any data yet? */
} my_source_mgr;
typedef my_source_mgr * my_src_ptr;
......@@ -86,7 +86,7 @@ init_source (j_decompress_ptr cinfo)
* the front of the buffer rather than discarding it.
*/
METHODDEF(boolean)
METHODDEF(int)
fill_input_buffer (j_decompress_ptr cinfo)
{
my_src_ptr src = (my_src_ptr) cinfo->src;
......
......@@ -69,7 +69,7 @@ METHODDEF(int) decompress_data
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif
#ifdef BLOCK_SMOOTHING_SUPPORTED
LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
LOCAL(int) smoothing_ok JPP((j_decompress_ptr cinfo));
METHODDEF(int) decompress_smooth_data
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif
......@@ -401,11 +401,11 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
* more accurately than they really are.
*/
LOCAL(boolean)
LOCAL(int)
smoothing_ok (j_decompress_ptr cinfo)
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
boolean smoothing_useful = FALSE;
int smoothing_useful = FALSE;
int ci, coefi;
jpeg_component_info *compptr;
JQUANT_TBL * qtable;
......@@ -470,11 +470,11 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
JDIMENSION output_col;
jpeg_component_info *compptr;
inverse_DCT_method_ptr inverse_DCT;
boolean first_row, last_row;
int first_row, last_row;
JBLOCK workspace;
int *coef_bits;
JQUANT_TBL *quanttbl;
INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
long Q00,Q01,Q02,Q10,Q11,Q20, num;
int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
int Al, pred;
......@@ -673,7 +673,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
*/
GLOBAL(void)
jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
jinit_d_coef_controller (j_decompress_ptr cinfo, int need_full_buffer)
{
my_coef_ptr coef;
......
......@@ -21,8 +21,8 @@ typedef struct {
/* Private state for YCC->RGB conversion */
int * Cr_r_tab; /* => table for Cr to R conversion */
int * Cb_b_tab; /* => table for Cb to B conversion */
INT32 * Cr_g_tab; /* => table for Cr to G conversion */
INT32 * Cb_g_tab; /* => table for Cb to G conversion */
long * Cr_g_tab; /* => table for Cr to G conversion */
long * Cb_g_tab; /* => table for Cb to G conversion */
} my_color_deconverter;
typedef my_color_deconverter * my_cconvert_ptr;
......@@ -58,8 +58,8 @@ typedef my_color_deconverter * my_cconvert_ptr;
*/
#define SCALEBITS 16 /* speediest right-shift on some machines */
#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
#define ONE_HALF ((long) 1 << (SCALEBITS-1))
#define FIX(x) ((long) ((x) * (1L<<SCALEBITS) + 0.5))
/*
......@@ -71,7 +71,7 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
int i;
INT32 x;
long x;
SHIFT_TEMPS
cconvert->Cr_r_tab = (int *)
......@@ -80,12 +80,12 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
cconvert->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cr_g_tab = (INT32 *)
cconvert->Cr_g_tab = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *)
(MAXJSAMPLE+1) * SIZEOF(long));
cconvert->Cb_g_tab = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(long));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
......@@ -131,8 +131,8 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
register JSAMPLE * range_limit = cinfo->sample_range_limit;
register int * Crrtab = cconvert->Cr_r_tab;
register int * Cbbtab = cconvert->Cb_b_tab;
register INT32 * Crgtab = cconvert->Cr_g_tab;
register INT32 * Cbgtab = cconvert->Cb_g_tab;
register long * Crgtab = cconvert->Cr_g_tab;
register long * Cbgtab = cconvert->Cb_g_tab;
SHIFT_TEMPS
while (--num_rows >= 0) {
......@@ -256,8 +256,8 @@ ycck_cmyk_convert (j_decompress_ptr cinfo,
register JSAMPLE * range_limit = cinfo->sample_range_limit;
register int * Crrtab = cconvert->Cr_r_tab;
register int * Cbbtab = cconvert->Cb_b_tab;
register INT32 * Crgtab = cconvert->Cr_g_tab;
register INT32 * Cbgtab = cconvert->Cb_g_tab;
register long * Crgtab = cconvert->Cr_g_tab;
register long * Cbgtab = cconvert->Cb_g_tab;
SHIFT_TEMPS
while (--num_rows >= 0) {
......
......@@ -16,7 +16,7 @@
/*
* A forward DCT routine is given a pointer to a work area of type DCTELEM[];
* the DCT is to be performed in-place in that buffer. Type DCTELEM is int
* for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT
* for 8-bit samples, long for 12-bit samples. (NOTE: Floating-point DCT
* implementations use an array of type FAST_FLOAT, instead.)
* The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
* The DCT outputs are returned scaled up by a factor of 8; they therefore
......@@ -29,7 +29,7 @@
#if BITS_IN_JSAMPLE == 8
typedef int DCTELEM; /* 16 or 32 bits is fine */
#else
typedef INT32 DCTELEM; /* must have 32 bits */
typedef long DCTELEM; /* must have 32 bits */
#endif
typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
......@@ -58,7 +58,7 @@ typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
#else
typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
typedef long IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
#endif
typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
......@@ -122,13 +122,13 @@ EXTERN(void) jpeg_idct_1x1
* Macros for handling fixed-point arithmetic; these are used by many
* but not all of the DCT/IDCT modules.
*
* All values are expected to be of type INT32.
* All values are expected to be of type long.
* Fractional constants are scaled left by CONST_BITS bits.
* CONST_BITS is defined within each module using these macros,
* and may differ from one module to the next.
*/
#define ONE ((INT32) 1)
#define ONE ((long) 1)
#define CONST_SCALE (ONE << CONST_BITS)
/* Convert a positive real constant to an integer scaled by CONST_SCALE.
......@@ -136,16 +136,16 @@ EXTERN(void) jpeg_idct_1x1
* thus causing a lot of useless floating-point operations at run time.
*/
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
#define FIX(x) ((long) ((x) * CONST_SCALE + 0.5))
/* Descale and correctly round an INT32 value that's scaled by N bits.
/* Descale and correctly round an long value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
/* Multiply an long variable by an long constant to yield an long result.
* This macro is used only when the two inputs will actually be no more than
* 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
* full 32x32 multiply. This provides a useful speedup on many machines.
......@@ -155,10 +155,10 @@ EXTERN(void) jpeg_idct_1x1
*/
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const)))
#define MULTIPLY16C16(var,const) (((short) (var)) * ((short) (const)))
#endif
#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const)))
#define MULTIPLY16C16(var,const) (((short) (var)) * ((long) (const)))
#endif
#ifndef MULTIPLY16C16 /* default definition */
......@@ -168,7 +168,7 @@ EXTERN(void) jpeg_idct_1x1
/* Same except both inputs are variables. */
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2)))
#define MULTIPLY16V16(var1,var2) (((short) (var1)) * ((short) (var2)))
#endif
#ifndef MULTIPLY16V16 /* default definition */
......
......@@ -182,7 +182,7 @@ start_pass (j_decompress_ptr cinfo)
*/
IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
static const short aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
......@@ -197,8 +197,8 @@ start_pass (j_decompress_ptr cinfo)
for (i = 0; i < DCTSIZE2; i++) {
ifmtbl[i] = (IFAST_MULT_TYPE)
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
DESCALE(MULTIPLY16V16((long) qtbl->quantval[i],
(long) aanscales[i]),
CONST_BITS-IFAST_SCALE_BITS);
}
}
......
......@@ -71,8 +71,8 @@ typedef struct {
d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
/* Whether we care about the DC and AC coefficient values for each block */
boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
int dc_needed[D_MAX_BLOCKS_IN_MCU];
int ac_needed[D_MAX_BLOCKS_IN_MCU];
} huff_entropy_decoder;
typedef huff_entropy_decoder * huff_entropy_ptr;
......@@ -146,7 +146,7 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
*/
GLOBAL(void)
jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, int isDC, int tblno,
d_derived_tbl ** pdtbl)
{
JHUFF_TBL *htbl;
......@@ -204,7 +204,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
/* code is now 1 more than the last code used for codelength si; but
* it must still fit in si bits, since no code is allowed to be all ones.
*/
if (((INT32) code) >= (((INT32) 1) << si))
if (((long) code) >= (((long) 1) << si))
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
code <<= 1;
si++;
......@@ -218,7 +218,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
/* valoffset[l] = huffval[] index of 1st symbol of code length l,
* minus the minimum code of length l
*/
dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
dtbl->valoffset[l] = (long) p - (long) huffcode[p];
p += htbl->bits[l];
dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
} else {
......@@ -288,7 +288,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
#endif
GLOBAL(boolean)
GLOBAL(int)
jpeg_fill_bit_buffer (bitread_working_state * state,
register bit_buf_type get_buffer, register int bits_left,
int nbits)
......@@ -400,7 +400,7 @@ jpeg_huff_decode (bitread_working_state * state,
d_derived_tbl * htbl, int min_bits)
{
register int l = min_bits;
register INT32 code;
register long code;
/* HUFF_DECODE has determined that the code is at least min_bits */
/* bits long, so fetch that many bits in one swoop. */
......@@ -464,7 +464,7 @@ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
* Returns FALSE if must suspend.
*/
LOCAL(boolean)
LOCAL(int)
process_restart (j_decompress_ptr cinfo)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
......@@ -513,7 +513,7 @@ process_restart (j_decompress_ptr cinfo)
* this module, since we'll just re-assign them on the next call.)
*/
METHODDEF(boolean)
METHODDEF(int)
decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
......
......@@ -25,9 +25,9 @@
typedef struct {
/* Basic tables: (element [0] of each array is unused) */
INT32 maxcode[18]; /* largest code of length k (-1 if none) */
long maxcode[18]; /* largest code of length k (-1 if none) */
/* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
INT32 valoffset[17]; /* huffval[] offset for codes of length k */
long valoffset[17]; /* huffval[] offset for codes of length k */
/* valoffset[k] = huffval[] index of 1st symbol of code length k, less
* the smallest code of length k; so given a code of length k, the
* corresponding symbol is huffval[code + valoffset[k]]
......@@ -42,12 +42,12 @@ typedef struct {
* the corresponding symbol directly from these tables.
*/
int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
unsigned char look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
} d_derived_tbl;
/* Expand a Huffman table definition into the derived format */
EXTERN(void) jpeg_make_d_derived_tbl
JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
JPP((j_decompress_ptr cinfo, int isDC, int tblno,
d_derived_tbl ** pdtbl));
......@@ -69,7 +69,7 @@ EXTERN(void) jpeg_make_d_derived_tbl
* necessary.
*/
typedef INT32 bit_buf_type; /* type of bit-extraction buffer */
typedef long bit_buf_type; /* type of bit-extraction buffer */
#define BIT_BUF_SIZE 32 /* size of buffer in bits */
/* If long is > 32 bits on your machine, and shifting/masking longs is
......@@ -151,7 +151,7 @@ typedef struct { /* Bitreading working state within an MCU */
(bits_left -= (nbits))
/* Load up the bit buffer to a depth of at least nbits */
EXTERN(boolean) jpeg_fill_bit_buffer
EXTERN(int) jpeg_fill_bit_buffer
JPP((bitread_working_state * state, register bit_buf_type get_buffer,
register int bits_left, int nbits));
......
......@@ -21,7 +21,7 @@
typedef struct {
struct jpeg_input_controller pub; /* public fields */
boolean inheaders; /* TRUE until first SOS is reached */
int inheaders; /* TRUE until first SOS is reached */
} my_input_controller;
typedef my_input_controller * my_inputctl_ptr;
......
......@@ -117,7 +117,7 @@ typedef struct {
/* Pointer to allocated workspace (M or M+2 row groups). */
JSAMPARRAY buffer[MAX_COMPONENTS];
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
int buffer_full; /* Have we gotten an iMCU row from decoder? */
JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
/* Remaining fields are only used in the context case. */
......@@ -473,7 +473,7 @@ process_data_crank_post (j_decompress_ptr cinfo,
*/
GLOBAL(void)
jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
jinit_d_main_controller (j_decompress_ptr cinfo, int need_full_buffer)
{
my_main_ptr main;
int ci, rgroup, ngroups;
......
......@@ -151,7 +151,7 @@ typedef my_marker_reader * my_marker_ptr;
V = GETJOCTET(*next_input_byte++); )
/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
* V should be declared unsigned int or perhaps INT32.
* V should be declared unsigned int or perhaps long.
*/
#define INPUT_2BYTES(cinfo,V,action) \
MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
......@@ -193,7 +193,7 @@ typedef my_marker_reader * my_marker_ptr;
*/
LOCAL(boolean)
LOCAL(int)
get_soi (j_decompress_ptr cinfo)
/* Process an SOI marker */
{
......@@ -233,11 +233,11 @@ get_soi (j_decompress_ptr cinfo)
}
LOCAL(boolean)
get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
LOCAL(int)
get_sof (j_decompress_ptr cinfo, int is_prog, int is_arith)
/* Process a SOFn marker */
{
INT32 length;
long length;
int c, ci;
jpeg_component_info * compptr;
INPUT_VARS(cinfo);
......@@ -297,11 +297,11 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
}
LOCAL(boolean)
LOCAL(int)
get_sos (j_decompress_ptr cinfo)
/* Process a SOS marker */
{
INT32 length;
long length;
int i, ci, n, c, cc;
jpeg_component_info * compptr;
INPUT_VARS(cinfo);
......@@ -369,11 +369,11 @@ get_sos (j_decompress_ptr cinfo)
#ifdef D_ARITH_CODING_SUPPORTED
LOCAL(boolean)
LOCAL(int)
get_dac (j_decompress_ptr cinfo)
/* Process a DAC marker */
{
INT32 length;
long length;
int index, val;
INPUT_VARS(cinfo);
......@@ -392,10 +392,10 @@ get_dac (j_decompress_ptr cinfo)
ERREXIT1(cinfo, JERR_DAC_INDEX, index);
if (index >= NUM_ARITH_TBLS) { /* define AC table */
cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;
cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (unsigned char) val;
} else { /* define DC table */
cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);
cinfo->arith_dc_U[index] = (UINT8) (val >> 4);
cinfo->arith_dc_L[index] = (unsigned char) (val & 0x0F);
cinfo->arith_dc_U[index] = (unsigned char) (val >> 4);
if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
ERREXIT1(cinfo, JERR_DAC_VALUE, val);
}
......@@ -415,13 +415,13 @@ get_dac (j_decompress_ptr cinfo)
#endif /* D_ARITH_CODING_SUPPORTED */
LOCAL(boolean)
LOCAL(int)
get_dht (j_decompress_ptr cinfo)
/* Process a DHT marker */
{
INT32 length;
UINT8 bits[17];
UINT8 huffval[256];
long length;
unsigned char bits[17];
unsigned char huffval[256];
int i, index, count;
JHUFF_TBL **htblptr;
INPUT_VARS(cinfo);
......@@ -453,7 +453,7 @@ get_dht (j_decompress_ptr cinfo)
/* Here we just do minimal validation of the counts to avoid walking
* off the end of our table space. jdhuff.c will check more carefully.
*/
if (count > 256 || ((INT32) count) > length)
if (count > 256 || ((long) count) > length)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
for (i = 0; i < count; i++)
......@@ -486,11 +486,11 @@ get_dht (j_decompress_ptr cinfo)
}
LOCAL(boolean)
LOCAL(int)
get_dqt (j_decompress_ptr cinfo)
/* Process a DQT marker */
{
INT32 length;
long length;
int n, i, prec;
unsigned int tmp;
JQUANT_TBL *quant_ptr;
......@@ -519,7 +519,7 @@ get_dqt (j_decompress_ptr cinfo)
else
INPUT_BYTE(cinfo, tmp, return FALSE);
/* We convert the zigzag-order table to natural array order. */
quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;
quant_ptr->quantval[jpeg_natural_order[i]] = (unsigned short) tmp;
}
if (cinfo->err->trace_level >= 2) {
......@@ -544,11 +544,11 @@ get_dqt (j_decompress_ptr cinfo)
}
LOCAL(boolean)
LOCAL(int)
get_dri (j_decompress_ptr cinfo)
/* Process a DRI marker */
{
INT32 length;
long length;
unsigned int tmp;
INPUT_VARS(cinfo);
......@@ -582,13 +582,13 @@ get_dri (j_decompress_ptr cinfo)
LOCAL(void)
examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
unsigned int datalen, INT32 remaining)
unsigned int datalen, long remaining)
/* Examine first few bytes from an APP0.
* Take appropriate action if it is a JFIF marker.
* datalen is # of bytes at data[], remaining is length of rest of marker data.
*/
{
INT32 totallen = (INT32) datalen + remaining;
long totallen = (long) datalen + remaining;
if (datalen >= APP0_DATA_LEN &&
GETJOCTET(data[0]) == 0x4A &&
......@@ -622,7 +622,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
GETJOCTET(data[12]), GETJOCTET(data[13]));
totallen -= APP0_DATA_LEN;
if (totallen !=
((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))
((long)GETJOCTET(data[12]) * (long)GETJOCTET(data[13]) * (long) 3))
TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
} else if (datalen >= 6 &&
GETJOCTET(data[0]) == 0x4A &&
......@@ -658,7 +658,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
LOCAL(void)
examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
unsigned int datalen, INT32 remaining)
unsigned int datalen, long remaining)
/* Examine first few bytes from an APP14.
* Take appropriate action if it is an Adobe marker.
* datalen is # of bytes at data[], remaining is length of rest of marker data.
......@@ -679,7 +679,7 @@ examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
transform = GETJOCTET(data[11]);
TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
cinfo->saw_Adobe_marker = TRUE;
cinfo->Adobe_transform = (UINT8) transform;
cinfo->Adobe_transform = (unsigned char) transform;
} else {
/* Start of APP14 does not match "Adobe", or too short */
TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
......@@ -687,11 +687,11 @@ examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
}
METHODDEF(boolean)
METHODDEF(int)
get_interesting_appn (j_decompress_ptr cinfo)
/* Process an APP0 or APP14 marker without saving it */
{
INT32 length;
long length;
JOCTET b[APPN_DATA_LEN];
unsigned int i, numtoread;
INPUT_VARS(cinfo);
......@@ -735,7 +735,7 @@ get_interesting_appn (j_decompress_ptr cinfo)
#ifdef SAVE_MARKERS_SUPPORTED
METHODDEF(boolean)
METHODDEF(int)
save_marker (j_decompress_ptr cinfo)
/* Save an APPn or COM marker into the marker list */
{
......@@ -743,7 +743,7 @@ save_marker (j_decompress_ptr cinfo)
jpeg_saved_marker_ptr cur_marker = marker->cur_marker;
unsigned int bytes_read, data_length;
JOCTET FAR * data;
INT32 length = 0;
long length = 0;
INPUT_VARS(cinfo);
if (cur_marker == NULL) {
......@@ -764,7 +764,7 @@ save_marker (j_decompress_ptr cinfo)
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(struct jpeg_marker_struct) + limit);
cur_marker->next = NULL;
cur_marker->marker = (UINT8) cinfo->unread_marker;
cur_marker->marker = (unsigned char) cinfo->unread_marker;
cur_marker->original_length = (unsigned int) length;
cur_marker->data_length = limit;
/* data area is just beyond the jpeg_marker_struct */
......@@ -841,11 +841,11 @@ save_marker (j_decompress_ptr cinfo)
#endif /* SAVE_MARKERS_SUPPORTED */
METHODDEF(boolean)
METHODDEF(int)
skip_variable (j_decompress_ptr cinfo)
/* Skip over an unknown or uninteresting variable-length marker */
{
INT32 length;
long length;
INPUT_VARS(cinfo);
INPUT_2BYTES(cinfo, length, return FALSE);
......@@ -870,7 +870,7 @@ skip_variable (j_decompress_ptr cinfo)
* but it will never be 0 or FF.
*/
LOCAL(boolean)
LOCAL(int)
next_marker (j_decompress_ptr cinfo)
{
int c;
......@@ -917,7 +917,7 @@ next_marker (j_decompress_ptr cinfo)
}
LOCAL(boolean)
LOCAL(int)
first_marker (j_decompress_ptr cinfo)
/* Like next_marker, but used to obtain the initial SOI marker. */
/* For this marker, we do not allow preceding garbage or fill; otherwise,
......@@ -1109,7 +1109,7 @@ read_markers (j_decompress_ptr cinfo)
* it holds a marker which the decoder will be unable to read past.
*/
METHODDEF(boolean)
METHODDEF(int)
read_restart_marker (j_decompress_ptr cinfo)
{
/* Obtain a marker unless we already did. */
......@@ -1188,7 +1188,7 @@ read_restart_marker (j_decompress_ptr cinfo)
* any other marker would have to be bogus data in that case.
*/
GLOBAL(boolean)
GLOBAL(int)
jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
{
int marker = cinfo->unread_marker;
......
......@@ -23,7 +23,7 @@ typedef struct {
int pass_number; /* # of passes completed */
boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
int using_merged_upsample; /* TRUE if using merged upsample/cconvert */
/* Saved references to initialized quantizer modules,
* in case we need to switch modes.
......@@ -40,7 +40,7 @@ typedef my_decomp_master * my_master_ptr;
* CRUCIAL: this must match the actual capabilities of jdmerge.c!
*/
LOCAL(boolean)
LOCAL(int)
use_merged_upsample (j_decompress_ptr cinfo)
{
#ifdef UPSAMPLE_MERGING_SUPPORTED
......@@ -288,7 +288,7 @@ LOCAL(void)
master_selection (j_decompress_ptr cinfo)
{
my_master_ptr master = (my_master_ptr) cinfo->master;
boolean use_c_buffer;
int use_c_buffer;
long samplesperrow;
JDIMENSION jd_samplesperrow;
......
......@@ -52,8 +52,8 @@ typedef struct {
/* Private state for YCC->RGB conversion */
int * Cr_r_tab; /* => table for Cr to R conversion */
int * Cb_b_tab; /* => table for Cb to B conversion */
INT32 * Cr_g_tab; /* => table for Cr to G conversion */
INT32 * Cb_g_tab; /* => table for Cb to G conversion */
long * Cr_g_tab; /* => table for Cr to G conversion */
long * Cb_g_tab; /* => table for Cb to G conversion */
/* For 2:1 vertical sampling, we produce two output rows at a time.
* We need a "spare" row buffer to hold the second output row if the
......@@ -61,7 +61,7 @@ typedef struct {
* to discard the dummy last row if the image height is odd.
*/
JSAMPROW spare_row;
boolean spare_full; /* T if spare buffer is occupied */
int spare_full; /* T if spare buffer is occupied */
JDIMENSION out_row_width; /* samples per output row */
JDIMENSION rows_to_go; /* counts rows remaining in image */
......@@ -70,8 +70,8 @@ typedef struct {
typedef my_upsampler * my_upsample_ptr;
#define SCALEBITS 16 /* speediest right-shift on some machines */
#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
#define ONE_HALF ((long) 1 << (SCALEBITS-1))
#define FIX(x) ((long) ((x) * (1L<<SCALEBITS) + 0.5))
/*
......@@ -84,7 +84,7 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
{
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
int i;
INT32 x;
long x;
SHIFT_TEMPS
upsample->Cr_r_tab = (int *)
......@@ -93,12 +93,12 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
upsample->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cr_g_tab = (INT32 *)
upsample->Cr_g_tab = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *)
(MAXJSAMPLE+1) * SIZEOF(long));
upsample->Cb_g_tab = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(long));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
......@@ -237,8 +237,8 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
register JSAMPLE * range_limit = cinfo->sample_range_limit;
int * Crrtab = upsample->Cr_r_tab;
int * Cbbtab = upsample->Cb_b_tab;
INT32 * Crgtab = upsample->Cr_g_tab;
INT32 * Cbgtab = upsample->Cb_g_tab;
long * Crgtab = upsample->Cr_g_tab;
long * Cbgtab = upsample->Cb_g_tab;
SHIFT_TEMPS
inptr0 = input_buf[0][in_row_group_ctr];
......@@ -299,8 +299,8 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
register JSAMPLE * range_limit = cinfo->sample_range_limit;
int * Crrtab = upsample->Cr_r_tab;
int * Cbbtab = upsample->Cb_b_tab;
INT32 * Crgtab = upsample->Cr_g_tab;
INT32 * Cbgtab = upsample->Cb_g_tab;
long * Crgtab = upsample->Cr_g_tab;
long * Cbgtab = upsample->Cb_g_tab;
SHIFT_TEMPS
inptr00 = input_buf[0][in_row_group_ctr*2];
......
......@@ -74,13 +74,13 @@ typedef struct {
typedef phuff_entropy_decoder * phuff_entropy_ptr;
/* Forward declarations */
METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,
METHODDEF(int) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,
METHODDEF(int) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
METHODDEF(int) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
METHODDEF(int) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
JBLOCKROW *MCU_data));
......@@ -92,7 +92,7 @@ METHODDEF(void)
start_pass_phuff_decoder (j_decompress_ptr cinfo)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
boolean is_DC_band, bad;
int is_DC_band, bad;
int ci, coefi, tbl;
int *coef_bit_ptr;
jpeg_component_info * compptr;
......@@ -224,7 +224,7 @@ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
* Returns FALSE if must suspend.
*/
LOCAL(boolean)
LOCAL(int)
process_restart (j_decompress_ptr cinfo)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
......@@ -282,7 +282,7 @@ process_restart (j_decompress_ptr cinfo)
* or first pass of successive approximation).
*/
METHODDEF(boolean)
METHODDEF(int)
decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
......@@ -353,7 +353,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
* or first pass of successive approximation).
*/
METHODDEF(boolean)
METHODDEF(int)
decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
......@@ -438,7 +438,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
* is not very clear on the point.
*/
METHODDEF(boolean)
METHODDEF(int)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
......@@ -487,7 +487,7 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
* MCU decoding for AC successive approximation refinement scan.
*/
METHODDEF(boolean)
METHODDEF(int)
decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
......
......@@ -247,7 +247,7 @@ post_process_2pass (j_decompress_ptr cinfo,
*/
GLOBAL(void)
jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
jinit_d_post_controller (j_decompress_ptr cinfo, int need_full_buffer)
{
my_post_ptr post;
......
......@@ -54,8 +54,8 @@ typedef struct {
/* These arrays save pixel expansion factors so that int_expand need not
* recompute them each time. They are unused for other upsampling methods.
*/
UINT8 h_expand[MAX_COMPONENTS];
UINT8 v_expand[MAX_COMPONENTS];
unsigned char h_expand[MAX_COMPONENTS];
unsigned char v_expand[MAX_COMPONENTS];
} my_upsampler;
typedef my_upsampler * my_upsample_ptr;
......@@ -350,7 +350,7 @@ h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
#if BITS_IN_JSAMPLE == 8
register int thiscolsum, lastcolsum, nextcolsum;
#else
register INT32 thiscolsum, lastcolsum, nextcolsum;
register long thiscolsum, lastcolsum, nextcolsum;
#endif
register JDIMENSION colctr;
int inrow, outrow, v;
......@@ -401,7 +401,7 @@ jinit_upsampler (j_decompress_ptr cinfo)
my_upsample_ptr upsample;
int ci;
jpeg_component_info * compptr;
boolean need_buffer, do_fancy;
int need_buffer, do_fancy;
int h_in_group, v_in_group, h_out_group, v_out_group;
upsample = (my_upsample_ptr)
......@@ -463,8 +463,8 @@ jinit_upsampler (j_decompress_ptr cinfo)
(v_out_group % v_in_group) == 0) {
/* Generic integral-factors upsampling method */
upsample->methods[ci] = int_upsample;
upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);
upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
upsample->h_expand[ci] = (unsigned char) (h_out_group / h_in_group);
upsample->v_expand[ci] = (unsigned char) (v_out_group / v_in_group);
} else
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
if (need_buffer) {
......
......@@ -161,7 +161,7 @@ format_message (j_common_ptr cinfo, char * buffer)
const char * msgtext = NULL;
const char * msgptr;
char ch;
boolean isstring;
int isstring;
/* Look up message string in proper table */
if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
......
......@@ -218,21 +218,21 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Final output stage: scale down by a factor of 8 and range-limit */
outptr[0] = range_limit[(int) DESCALE((INT32) (tmp0 + tmp7), 3)
outptr[0] = range_limit[(int) DESCALE((long) (tmp0 + tmp7), 3)
& RANGE_MASK];
outptr[7] = range_limit[(int) DESCALE((INT32) (tmp0 - tmp7), 3)
outptr[7] = range_limit[(int) DESCALE((long) (tmp0 - tmp7), 3)
& RANGE_MASK];
outptr[1] = range_limit[(int) DESCALE((INT32) (tmp1 + tmp6), 3)
outptr[1] = range_limit[(int) DESCALE((long) (tmp1 + tmp6), 3)
& RANGE_MASK];
outptr[6] = range_limit[(int) DESCALE((INT32) (tmp1 - tmp6), 3)
outptr[6] = range_limit[(int) DESCALE((long) (tmp1 - tmp6), 3)
& RANGE_MASK];
outptr[2] = range_limit[(int) DESCALE((INT32) (tmp2 + tmp5), 3)
outptr[2] = range_limit[(int) DESCALE((long) (tmp2 + tmp5), 3)
& RANGE_MASK];
outptr[5] = range_limit[(int) DESCALE((INT32) (tmp2 - tmp5), 3)
outptr[5] = range_limit[(int) DESCALE((long) (tmp2 - tmp5), 3)
& RANGE_MASK];
outptr[4] = range_limit[(int) DESCALE((INT32) (tmp3 + tmp4), 3)
outptr[4] = range_limit[(int) DESCALE((long) (tmp3 + tmp4), 3)
& RANGE_MASK];
outptr[3] = range_limit[(int) DESCALE((INT32) (tmp3 - tmp4), 3)
outptr[3] = range_limit[(int) DESCALE((long) (tmp3 - tmp4), 3)
& RANGE_MASK];
wsptr += DCTSIZE; /* advance pointer to next row */
......
......@@ -89,10 +89,10 @@
*/
#if CONST_BITS == 8
#define FIX_1_082392200 ((INT32) 277) /* FIX(1.082392200) */
#define FIX_1_414213562 ((INT32) 362) /* FIX(1.414213562) */
#define FIX_1_847759065 ((INT32) 473) /* FIX(1.847759065) */
#define FIX_2_613125930 ((INT32) 669) /* FIX(2.613125930) */
#define FIX_1_082392200 ((long) 277) /* FIX(1.082392200) */
#define FIX_1_414213562 ((long) 362) /* FIX(1.414213562) */
#define FIX_1_847759065 ((long) 473) /* FIX(1.847759065) */
#define FIX_2_613125930 ((long) 669) /* FIX(2.613125930) */
#else
#define FIX_1_082392200 FIX(1.082392200)
#define FIX_1_414213562 FIX(1.414213562)
......@@ -112,7 +112,7 @@
#endif
/* Multiply a DCTELEM variable by an INT32 constant, and immediately
/* Multiply a DCTELEM variable by an long constant, and immediately
* descale to yield a DCTELEM result.
*/
......@@ -122,7 +122,7 @@
/* Dequantize a coefficient by multiplying it by the multiplier-table
* entry; produce a DCTELEM result. For 8-bit data a 16x16->16
* multiplication will do. For 12-bit data, the multiplier table is
* declared INT32, so a 32-bit multiply will be used.
* declared long, so a 32-bit multiply will be used.
*/
#if BITS_IN_JSAMPLE == 8
......@@ -134,7 +134,7 @@
/* Like DESCALE, but applies to a DCTELEM and produces an int.
* We assume that int right shift is unsigned if INT32 right shift is.
* We assume that int right shift is unsigned if long right shift is.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
......
......@@ -67,7 +67,7 @@
* they are represented to better-than-integral precision. These outputs
* require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
* with the recommended scaling. (To scale up 12-bit sample data further, an
* intermediate INT32 array would be needed.)
* intermediate long array would be needed.)
*
* To avoid overflow of the 32-bit intermediate results in pass 2, we must
* have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
......@@ -90,18 +90,18 @@
*/
#if CONST_BITS == 13
#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
#define FIX_0_298631336 ((long) 2446) /* FIX(0.298631336) */
#define FIX_0_390180644 ((long) 3196) /* FIX(0.390180644) */
#define FIX_0_541196100 ((long) 4433) /* FIX(0.541196100) */
#define FIX_0_765366865 ((long) 6270) /* FIX(0.765366865) */
#define FIX_0_899976223 ((long) 7373) /* FIX(0.899976223) */
#define FIX_1_175875602 ((long) 9633) /* FIX(1.175875602) */
#define FIX_1_501321110 ((long) 12299) /* FIX(1.501321110) */
#define FIX_1_847759065 ((long) 15137) /* FIX(1.847759065) */
#define FIX_1_961570560 ((long) 16069) /* FIX(1.961570560) */
#define FIX_2_053119869 ((long) 16819) /* FIX(2.053119869) */
#define FIX_2_562915447 ((long) 20995) /* FIX(2.562915447) */
#define FIX_3_072711026 ((long) 25172) /* FIX(3.072711026) */
#else
#define FIX_0_298631336 FIX(0.298631336)
#define FIX_0_390180644 FIX(0.390180644)
......@@ -118,7 +118,7 @@
#endif
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
/* Multiply an long variable by an long constant to yield an long result.
* For 8-bit samples with the recommended scaling, all the variable
* and constant values involved are no more than 16 bits wide, so a
* 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
......@@ -149,9 +149,9 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
INT32 tmp0, tmp1, tmp2, tmp3;
INT32 tmp10, tmp11, tmp12, tmp13;
INT32 z1, z2, z3, z4, z5;
long tmp0, tmp1, tmp2, tmp3;
long tmp10, tmp11, tmp12, tmp13;
long z1, z2, z3, z4, z5;
JCOEFPTR inptr;
ISLOW_MULT_TYPE * quantptr;
int * wsptr;
......@@ -288,7 +288,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */
JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
JSAMPLE dcval = range_limit[(int) DESCALE((long) wsptr[0], PASS1_BITS+3)
& RANGE_MASK];
outptr[0] = dcval;
......@@ -308,15 +308,15 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part: reverse the even part of the forward DCT. */
/* The rotator is sqrt(2)*c(-6). */
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
z2 = (long) wsptr[2];
z3 = (long) wsptr[6];
z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS;
tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS;
tmp0 = ((long) wsptr[0] + (long) wsptr[4]) << CONST_BITS;
tmp1 = ((long) wsptr[0] - (long) wsptr[4]) << CONST_BITS;
tmp10 = tmp0 + tmp3;
tmp13 = tmp0 - tmp3;
......@@ -327,10 +327,10 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
*/
tmp0 = (INT32) wsptr[7];
tmp1 = (INT32) wsptr[5];
tmp2 = (INT32) wsptr[3];
tmp3 = (INT32) wsptr[1];
tmp0 = (long) wsptr[7];
tmp1 = (long) wsptr[5];
tmp2 = (long) wsptr[3];
tmp3 = (long) wsptr[1];
z1 = tmp0 + tmp3;
z2 = tmp1 + tmp2;
......
......@@ -55,20 +55,20 @@
*/
#if CONST_BITS == 13
#define FIX_0_211164243 ((INT32) 1730) /* FIX(0.211164243) */
#define FIX_0_509795579 ((INT32) 4176) /* FIX(0.509795579) */
#define FIX_0_601344887 ((INT32) 4926) /* FIX(0.601344887) */
#define FIX_0_720959822 ((INT32) 5906) /* FIX(0.720959822) */
#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
#define FIX_0_850430095 ((INT32) 6967) /* FIX(0.850430095) */
#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
#define FIX_1_061594337 ((INT32) 8697) /* FIX(1.061594337) */
#define FIX_1_272758580 ((INT32) 10426) /* FIX(1.272758580) */
#define FIX_1_451774981 ((INT32) 11893) /* FIX(1.451774981) */
#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
#define FIX_2_172734803 ((INT32) 17799) /* FIX(2.172734803) */
#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
#define FIX_3_624509785 ((INT32) 29692) /* FIX(3.624509785) */
#define FIX_0_211164243 ((long) 1730) /* FIX(0.211164243) */
#define FIX_0_509795579 ((long) 4176) /* FIX(0.509795579) */
#define FIX_0_601344887 ((long) 4926) /* FIX(0.601344887) */
#define FIX_0_720959822 ((long) 5906) /* FIX(0.720959822) */
#define FIX_0_765366865 ((long) 6270) /* FIX(0.765366865) */
#define FIX_0_850430095 ((long) 6967) /* FIX(0.850430095) */
#define FIX_0_899976223 ((long) 7373) /* FIX(0.899976223) */
#define FIX_1_061594337 ((long) 8697) /* FIX(1.061594337) */
#define FIX_1_272758580 ((long) 10426) /* FIX(1.272758580) */
#define FIX_1_451774981 ((long) 11893) /* FIX(1.451774981) */
#define FIX_1_847759065 ((long) 15137) /* FIX(1.847759065) */
#define FIX_2_172734803 ((long) 17799) /* FIX(2.172734803) */
#define FIX_2_562915447 ((long) 20995) /* FIX(2.562915447) */
#define FIX_3_624509785 ((long) 29692) /* FIX(3.624509785) */
#else
#define FIX_0_211164243 FIX(0.211164243)
#define FIX_0_509795579 FIX(0.509795579)
......@@ -87,7 +87,7 @@
#endif
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
/* Multiply an long variable by an long constant to yield an long result.
* For 8-bit samples with the recommended scaling, all the variable
* and constant values involved are no more than 16 bits wide, so a
* 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
......@@ -119,8 +119,8 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
INT32 tmp0, tmp2, tmp10, tmp12;
INT32 z1, z2, z3, z4;
long tmp0, tmp2, tmp10, tmp12;
long z1, z2, z3, z4;
JCOEFPTR inptr;
ISLOW_MULT_TYPE * quantptr;
int * wsptr;
......@@ -202,7 +202,7 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */
JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
JSAMPLE dcval = range_limit[(int) DESCALE((long) wsptr[0], PASS1_BITS+3)
& RANGE_MASK];
outptr[0] = dcval;
......@@ -217,20 +217,20 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */
tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1);
tmp0 = ((long) wsptr[0]) << (CONST_BITS+1);
tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065)
+ MULTIPLY((INT32) wsptr[6], - FIX_0_765366865);
tmp2 = MULTIPLY((long) wsptr[2], FIX_1_847759065)
+ MULTIPLY((long) wsptr[6], - FIX_0_765366865);
tmp10 = tmp0 + tmp2;
tmp12 = tmp0 - tmp2;
/* Odd part */
z1 = (INT32) wsptr[7];
z2 = (INT32) wsptr[5];
z3 = (INT32) wsptr[3];
z4 = (INT32) wsptr[1];
z1 = (long) wsptr[7];
z2 = (long) wsptr[5];
z3 = (long) wsptr[3];
z4 = (long) wsptr[1];
tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
+ MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
......@@ -272,7 +272,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
INT32 tmp0, tmp10, z1;
long tmp0, tmp10, z1;
JCOEFPTR inptr;
ISLOW_MULT_TYPE * quantptr;
int * wsptr;
......@@ -334,7 +334,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
#ifndef NO_ZERO_ROW_TEST
if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
/* AC terms all zero */
JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
JSAMPLE dcval = range_limit[(int) DESCALE((long) wsptr[0], PASS1_BITS+3)
& RANGE_MASK];
outptr[0] = dcval;
......@@ -347,14 +347,14 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part */
tmp10 = ((INT32) wsptr[0]) << (CONST_BITS+2);
tmp10 = ((long) wsptr[0]) << (CONST_BITS+2);
/* Odd part */
tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
+ MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
+ MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
+ MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
tmp0 = MULTIPLY((long) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
+ MULTIPLY((long) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
+ MULTIPLY((long) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
+ MULTIPLY((long) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
/* Final output stage */
......@@ -390,7 +390,7 @@ jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
*/
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
dcval = (int) DESCALE((INT32) dcval, 3);
dcval = (int) DESCALE((long) dcval, 3);
output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
}
......
......@@ -156,9 +156,9 @@ struct jvirt_sarray_control {
JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
JDIMENSION cur_start_row; /* first logical row # in the buffer */
JDIMENSION first_undef_row; /* row # of first uninitialized row */
boolean pre_zero; /* pre-zero mode requested? */
boolean dirty; /* do current buffer contents need written? */
boolean b_s_open; /* is backing-store data valid? */
int pre_zero; /* pre-zero mode requested? */
int dirty; /* do current buffer contents need written? */
int b_s_open; /* is backing-store data valid? */
jvirt_sarray_ptr next; /* link to next virtual sarray control block */
backing_store_info b_s_info; /* System-dependent control info */
};
......@@ -172,9 +172,9 @@ struct jvirt_barray_control {
JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
JDIMENSION cur_start_row; /* first logical row # in the buffer */
JDIMENSION first_undef_row; /* row # of first uninitialized row */
boolean pre_zero; /* pre-zero mode requested? */
boolean dirty; /* do current buffer contents need written? */
boolean b_s_open; /* is backing-store data valid? */
int pre_zero; /* pre-zero mode requested? */
int dirty; /* do current buffer contents need written? */
int b_s_open; /* is backing-store data valid? */
jvirt_barray_ptr next; /* link to next virtual barray control block */
backing_store_info b_s_info; /* System-dependent control info */
};
......@@ -520,7 +520,7 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
METHODDEF(jvirt_sarray_ptr)
request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
request_virt_sarray (j_common_ptr cinfo, int pool_id, int pre_zero,
JDIMENSION samplesperrow, JDIMENSION numrows,
JDIMENSION maxaccess)
/* Request a virtual 2-D sample array */
......@@ -550,7 +550,7 @@ request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
METHODDEF(jvirt_barray_ptr)
request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
request_virt_barray (j_common_ptr cinfo, int pool_id, int pre_zero,
JDIMENSION blocksperrow, JDIMENSION numrows,
JDIMENSION maxaccess)
/* Request a virtual 2-D coefficient-block array */
......@@ -687,7 +687,7 @@ realize_virt_arrays (j_common_ptr cinfo)
LOCAL(void)
do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, int writing)
/* Do backing store read or write of a virtual sample array */
{
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
......@@ -720,7 +720,7 @@ do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
LOCAL(void)
do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, int writing)
/* Do backing store read or write of a virtual coefficient-block array */
{
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
......@@ -755,7 +755,7 @@ do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
METHODDEF(JSAMPARRAY)
access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
JDIMENSION start_row, JDIMENSION num_rows,
boolean writable)
int writable)
/* Access the part of a virtual sample array starting at start_row */
/* and extending for num_rows rows. writable is true if */
/* caller intends to modify the accessed area. */
......@@ -840,7 +840,7 @@ access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
METHODDEF(JBLOCKARRAY)
access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
JDIMENSION start_row, JDIMENSION num_rows,
boolean writable)
int writable)
/* Access the part of a virtual block array starting at start_row */
/* and extending for num_rows rows. writable is true if */
/* caller intends to modify the accessed area. */
......
......@@ -129,37 +129,12 @@ typedef char JOCTET;
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
/* unsigned char must hold at least the values 0..255. */
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char UINT8;
#else /* not HAVE_UNSIGNED_CHAR */
#ifdef CHAR_IS_UNSIGNED
typedef char UINT8;
#else /* not CHAR_IS_UNSIGNED */
typedef short UINT8;
#endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */
/* UINT16 must hold at least the values 0..65535. */
/* unsigned short must hold at least the values 0..65535. */
#ifdef HAVE_UNSIGNED_SHORT
typedef unsigned short UINT16;
#else /* not HAVE_UNSIGNED_SHORT */
typedef unsigned int UINT16;
#endif /* HAVE_UNSIGNED_SHORT */
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
typedef long INT32;
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
......@@ -223,9 +198,6 @@ typedef unsigned int JDIMENSION;
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
......
......@@ -48,8 +48,8 @@ struct jpeg_comp_master {
JMETHOD(void, finish_pass, (j_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 */
int call_pass_startup; /* True if pass_startup must be called */
int is_last_pass; /* True during last pass */
};
/* Main buffer control (downsampled-data buffer) */
......@@ -75,7 +75,7 @@ struct jpeg_c_prep_controller {
/* Coefficient buffer control */
struct jpeg_c_coef_controller {
JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
JMETHOD(int, compress_data, (j_compress_ptr cinfo,
JSAMPIMAGE input_buf));
};
......@@ -95,7 +95,7 @@ struct jpeg_downsampler {
JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index));
boolean need_context_rows; /* TRUE if need rows above & below */
int need_context_rows; /* TRUE if need rows above & below */
};
/* Forward DCT (also controls coefficient quantization) */
......@@ -111,8 +111,8 @@ struct jpeg_forward_dct {
/* Entropy encoding */
struct jpeg_entropy_encoder {
JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
JMETHOD(void, start_pass, (j_compress_ptr cinfo, int gather_statistics));
JMETHOD(int, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
};
......@@ -139,7 +139,7 @@ struct jpeg_decomp_master {
JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
/* State variables made visible to other modules */
boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
int is_dummy_pass; /* True during 1st pass for 2-pass quant */
};
/* Input control module */
......@@ -150,8 +150,8 @@ struct jpeg_input_controller {
JMETHOD(void, finish_input_pass, (j_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 */
int has_multiple_scans; /* True if file has multiple scans */
int eoi_reached; /* True when EOI has been consumed */
};
/* Main buffer control (downsampled-data buffer) */
......@@ -199,8 +199,8 @@ struct jpeg_marker_reader {
/* 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 saw_SOI; /* found SOI? */
int 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 */
};
......@@ -208,12 +208,12 @@ struct jpeg_marker_reader {
/* Entropy decoding */
struct jpeg_entropy_decoder {
JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
JMETHOD(int, decode_mcu, (j_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 */
int insufficient_data; /* set TRUE after emitting warning */
};
/* Inverse DCT (also performs dequantization) */
......@@ -239,7 +239,7 @@ struct jpeg_upsampler {
JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail));
boolean need_context_rows; /* TRUE if need rows above & below */
int need_context_rows; /* TRUE if need rows above & below */
};
/* Colorspace conversion */
......@@ -252,7 +252,7 @@ struct jpeg_color_deconverter {
/* Color quantization or color precision reduction */
struct jpeg_color_quantizer {
JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
JMETHOD(void, start_pass, (j_decompress_ptr cinfo, int is_pre_scan));
JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPARRAY output_buf,
int num_rows));
......@@ -274,16 +274,16 @@ struct jpeg_color_quantizer {
* 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 an INT32 quantity.
* RIGHT_SHIFT provides a proper signed right shift of an long 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 INT32 shift_temp;
#define SHIFT_TEMPS long shift_temp;
#define RIGHT_SHIFT(x,shft) \
((shift_temp = (x)) < 0 ? \
(shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
(shift_temp >> (shft)) | ((~((long) 0)) << (32-(shft))) : \
(shift_temp >> (shft)))
#else
#define SHIFT_TEMPS
......@@ -333,13 +333,13 @@ struct jpeg_color_quantizer {
/* Compression module initialization routines */
EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
boolean transcode_only));
int transcode_only));
EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
boolean need_full_buffer));
int need_full_buffer));
EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
boolean need_full_buffer));
int need_full_buffer));
EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
boolean need_full_buffer));
int need_full_buffer));
EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
......@@ -349,11 +349,11 @@ EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
/* Decompression module initialization routines */
EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
boolean need_full_buffer));
int need_full_buffer));
EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
boolean need_full_buffer));
int need_full_buffer));
EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
boolean need_full_buffer));
int need_full_buffer));
EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
......
......@@ -85,13 +85,13 @@ typedef struct {
* (not the zigzag order in which they are stored in a JPEG DQT marker).
* CAUTION: IJG versions prior to v6a kept this array in zigzag order.
*/
UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
unsigned short quantval[DCTSIZE2]; /* quantization step for each coefficient */
/* This field is used only during compression. It's initialized FALSE when
* the table is created, and set TRUE when it's been output to the file.
* You could suppress output of a table by setting this to TRUE.
* (See jpeg_suppress_tables for an example.)
*/
boolean sent_table; /* TRUE when table has been output */
int sent_table; /* TRUE when table has been output */
} JQUANT_TBL;
......@@ -99,15 +99,15 @@ typedef struct {
typedef struct {
/* These two fields directly represent the contents of a JPEG DHT marker */
UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
unsigned char bits[17]; /* bits[k] = # of symbols with codes of */
/* length k bits; bits[0] is unused */
UINT8 huffval[256]; /* The symbols, in order of incr code length */
unsigned char huffval[256]; /* The symbols, in order of incr code length */
/* This field is used only during compression. It's initialized FALSE when
* the table is created, and set TRUE when it's been output to the file.
* You could suppress output of a table by setting this to TRUE.
* (See jpeg_suppress_tables for an example.)
*/
boolean sent_table; /* TRUE when table has been output */
int sent_table; /* TRUE when table has been output */
} JHUFF_TBL;
......@@ -157,7 +157,7 @@ typedef struct {
* components will be ignored (eg grayscale output from YCbCr image),
* we can skip most computations for the unused components.
*/
boolean component_needed; /* do we need the value of this component? */
int component_needed; /* do we need the value of this component? */
/* These values are computed before starting a scan of the component. */
/* The decompressor output side may not use these variables. */
......@@ -194,7 +194,7 @@ typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
struct jpeg_marker_struct {
jpeg_saved_marker_ptr next; /* next in list, or NULL */
UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
unsigned char marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
unsigned int original_length; /* # bytes of data in the file */
unsigned int data_length; /* # bytes of data saved at data[] */
JOCTET FAR * data; /* the data contained in the marker */
......@@ -243,7 +243,7 @@ typedef enum {
struct jpeg_memory_mgr * mem; /* Memory manager module */\
struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
void * client_data; /* Available for use by application */\
boolean is_decompressor; /* So common code can tell which is which */\
int is_decompressor; /* So common code can tell which is which */\
int global_state /* For checking call sequence validity */
/* Routines that are to be used by both halves of the library are declared
......@@ -306,9 +306,9 @@ struct jpeg_compress_struct {
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
/* ptrs to Huffman coding tables, or NULL if not defined */
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
unsigned char arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
unsigned char arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
unsigned char arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
int num_scans; /* # of entries in scan_info array */
const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
......@@ -317,10 +317,10 @@ struct jpeg_compress_struct {
* set num_scans and scan_info to point to an array of scan definitions.
*/
boolean raw_data_in; /* TRUE=caller supplies downsampled data */
boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
boolean CCIR601_sampling; /* TRUE=first samples are cosited */
int raw_data_in; /* TRUE=caller supplies downsampled data */
int arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
int optimize_coding; /* TRUE=optimize entropy encoding parms */
int CCIR601_sampling; /* TRUE=first samples are cosited */
int smoothing_factor; /* 1..100, or 0 for no input smoothing */
J_DCT_METHOD dct_method; /* DCT algorithm selector */
......@@ -334,17 +334,17 @@ struct jpeg_compress_struct {
/* Parameters controlling emission of special markers. */
boolean write_JFIF_header; /* should a JFIF marker be written? */
UINT8 JFIF_major_version; /* What to write for the JFIF version number */
UINT8 JFIF_minor_version;
int write_JFIF_header; /* should a JFIF marker be written? */
unsigned char JFIF_major_version; /* What to write for the JFIF version number */
unsigned char JFIF_minor_version;
/* These three values are not used by the JPEG code, merely copied */
/* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
/* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
/* ratio is defined by X_density/Y_density even when density_unit=0. */
UINT8 density_unit; /* JFIF code for pixel size units */
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
boolean write_Adobe_marker; /* should an Adobe marker be written? */
unsigned char density_unit; /* JFIF code for pixel size units */
unsigned short X_density; /* Horizontal pixel density */
unsigned short Y_density; /* Vertical pixel density */
int write_Adobe_marker; /* should an Adobe marker be written? */
/* State variable: index of next scanline to be written to
* jpeg_write_scanlines(). Application may use this to control its
......@@ -360,7 +360,7 @@ struct jpeg_compress_struct {
/*
* These fields are computed during compression startup
*/
boolean progressive_mode; /* TRUE if scan script uses progressive mode */
int progressive_mode; /* TRUE if scan script uses progressive mode */
int max_h_samp_factor; /* largest h_samp_factor */
int max_v_samp_factor; /* largest v_samp_factor */
......@@ -433,22 +433,22 @@ struct jpeg_decompress_struct {
double output_gamma; /* image gamma wanted in output */
boolean buffered_image; /* TRUE=multiple output passes */
boolean raw_data_out; /* TRUE=downsampled data wanted */
int buffered_image; /* TRUE=multiple output passes */
int raw_data_out; /* TRUE=downsampled data wanted */
J_DCT_METHOD dct_method; /* IDCT algorithm selector */
boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
int do_fancy_upsampling; /* TRUE=apply fancy upsampling */
int do_block_smoothing; /* TRUE=apply interblock smoothing */
boolean quantize_colors; /* TRUE=colormapped output wanted */
int quantize_colors; /* TRUE=colormapped output wanted */
/* the following are ignored if not quantize_colors: */
J_DITHER_MODE dither_mode; /* type of color dithering to use */
boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
int two_pass_quantize; /* TRUE=use two-pass color quantization */
int desired_number_of_colors; /* max # colors to use in created colormap */
/* these are significant only in buffered-image mode: */
boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
boolean enable_external_quant;/* enable future use of external colormap */
boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
int enable_1pass_quant; /* enable future use of 1-pass quantizer */
int enable_external_quant;/* enable future use of external colormap */
int enable_2pass_quant; /* enable future use of 2-pass quantizer */
/* Description of actual output image that will be returned to application.
* These fields are computed by jpeg_start_decompress().
......@@ -535,29 +535,29 @@ struct jpeg_decompress_struct {
jpeg_component_info * comp_info;
/* comp_info[i] describes component that appears i'th in SOF */
boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
int progressive_mode; /* TRUE if SOFn specifies progressive mode */
int arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
unsigned char arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
unsigned char arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
unsigned char arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
/* These fields record data obtained from optional markers recognized by
* the JPEG library.
*/
boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
int saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
/* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
UINT8 JFIF_major_version; /* JFIF version number */
UINT8 JFIF_minor_version;
UINT8 density_unit; /* JFIF code for pixel size units */
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
UINT8 Adobe_transform; /* Color transform code from Adobe marker */
unsigned char JFIF_major_version; /* JFIF version number */
unsigned char JFIF_minor_version;
unsigned char density_unit; /* JFIF code for pixel size units */
unsigned short X_density; /* Horizontal pixel density */
unsigned short Y_density; /* Vertical pixel density */
int saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
unsigned char Adobe_transform; /* Color transform code from Adobe marker */
boolean CCIR601_sampling; /* TRUE=first samples are cosited */
int CCIR601_sampling; /* TRUE=first samples are cosited */
/* Aside from the specific data retained from APPn markers known to the
* library, the uninterpreted contents of any or all APPn and COM markers
......@@ -715,7 +715,7 @@ struct jpeg_destination_mgr {
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
JMETHOD(void, init_destination, (j_compress_ptr cinfo));
JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
JMETHOD(int, empty_output_buffer, (j_compress_ptr cinfo));
JMETHOD(void, term_destination, (j_compress_ptr cinfo));
};
......@@ -727,9 +727,9 @@ struct jpeg_source_mgr {
size_t bytes_in_buffer; /* # of bytes remaining in buffer */
JMETHOD(void, init_source, (j_decompress_ptr cinfo));
JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
JMETHOD(int, fill_input_buffer, (j_decompress_ptr cinfo));
JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
JMETHOD(int, resync_to_restart, (j_decompress_ptr cinfo, int desired));
JMETHOD(void, term_source, (j_decompress_ptr cinfo));
};
......@@ -767,13 +767,13 @@ struct jpeg_memory_mgr {
JDIMENSION numrows));
JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
int pre_zero,
JDIMENSION samplesperrow,
JDIMENSION numrows,
JDIMENSION maxaccess));
JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
int pool_id,
boolean pre_zero,
int pre_zero,
JDIMENSION blocksperrow,
JDIMENSION numrows,
JDIMENSION maxaccess));
......@@ -782,12 +782,12 @@ struct jpeg_memory_mgr {
jvirt_sarray_ptr ptr,
JDIMENSION start_row,
JDIMENSION num_rows,
boolean writable));
int writable));
JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
jvirt_barray_ptr ptr,
JDIMENSION start_row,
JDIMENSION num_rows,
boolean writable));
int writable));
JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
JMETHOD(void, self_destruct, (j_common_ptr cinfo));
......@@ -806,7 +806,7 @@ struct jpeg_memory_mgr {
/* Routine signature for application-supplied marker processing methods.
* Need not pass marker code since it is stored in cinfo->unread_marker.
*/
typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
typedef JMETHOD(int, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
/* Declarations for routines called by application.
......@@ -917,24 +917,24 @@ EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
J_COLOR_SPACE colorspace));
EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
boolean force_baseline));
int force_baseline));
EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
int scale_factor,
boolean force_baseline));
int force_baseline));
EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
int scale_factor,
boolean force_baseline));
int force_baseline));
EXTERN(int) jpeg_quality_scaling JPP((int quality));
EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
boolean suppress));
int suppress));
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
/* Main entry points for compression */
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
boolean write_all_tables));
int write_all_tables));
EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION num_lines));
......@@ -960,7 +960,7 @@ EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
/* Decompression startup: read start of JPEG datastream to see what's there */
EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
boolean require_image));
int require_image));
/* Return value is one of: */
#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
#define JPEG_HEADER_OK 1 /* Found valid image datastream */
......@@ -972,11 +972,11 @@ EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
*/
/* Main entry points for decompression */
EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION max_lines));
EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
......@@ -984,11 +984,11 @@ EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
JDIMENSION max_lines));
/* Additional entry points for buffered-image mode. */
EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
EXTERN(int) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_start_output JPP((j_decompress_ptr cinfo,
int scan_number));
EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_finish_output JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_input_complete JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
/* Return value is one of: */
......@@ -1034,7 +1034,7 @@ EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
/* Default restart-marker-resync procedure for use by data source modules */
EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
EXTERN(int) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
int desired));
......
......@@ -76,7 +76,7 @@
typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];
typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];
static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
static const unsigned char base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
/* Bayer's order-4 dither array. Generated by the code given in
* Stephen Hawley's article "Ordered Dithering" in Graphics Gems I.
* The values in this array must range from 0 to ODITHER_CELLS-1.
......@@ -125,11 +125,11 @@ static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
*/
#if BITS_IN_JSAMPLE == 8
typedef INT16 FSERROR; /* 16 bits should be enough */
typedef short FSERROR; /* 16 bits should be enough */
typedef int LOCFSERROR; /* use 'int' for calculation temps */
#else
typedef INT32 FSERROR; /* may need more than 16 bits */
typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */
typedef long FSERROR; /* may need more than 16 bits */
typedef long LOCFSERROR; /* be sure calculation temps are big enough */
#endif
typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */
......@@ -151,7 +151,7 @@ typedef struct {
* premultiplied as described above. Since colormap indexes must fit into
* JSAMPLEs, the entries of this array will too.
*/
boolean is_padded; /* is the colorindex padded for odither? */
int is_padded; /* is the colorindex padded for odither? */
int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */
......@@ -161,7 +161,7 @@ typedef struct {
/* Variables for Floyd-Steinberg dithering */
FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */
boolean on_odd_row; /* flag to remember which row we are on */
int on_odd_row; /* flag to remember which row we are on */
} my_cquantizer;
typedef my_cquantizer * my_cquantize_ptr;
......@@ -191,7 +191,7 @@ select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
int nc = cinfo->out_color_components; /* number of color components */
int max_colors = cinfo->desired_number_of_colors;
int total_colors, iroot, i, j;
boolean changed;
int changed;
long temp;
static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
......@@ -251,7 +251,7 @@ output_value (j_decompress_ptr , int , int j, int maxj)
* (Forcing the upper and lower values to the limits ensures that
* dithering can't produce a color outside the selected gamut.)
*/
return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);
return (int) (((long) j * MAXJSAMPLE + maxj/2) / maxj);
}
......@@ -261,7 +261,7 @@ largest_input_value (j_decompress_ptr , int , int j, int maxj)
/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
{
/* Breakpoints are halfway between values returned by output_value */
return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
return (int) (((long) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
}
......@@ -397,7 +397,7 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors)
{
ODITHER_MATRIX_PTR odither;
int j,k;
INT32 num,den;
long num,den;
odither = (ODITHER_MATRIX_PTR)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
......@@ -407,10 +407,10 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors)
* (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
* On 16-bit-int machine, be careful to avoid overflow.
*/
den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));
den = 2 * ODITHER_CELLS * ((long) (ncolors - 1));
for (j = 0; j < ODITHER_SIZE; j++) {
for (k = 0; k < ODITHER_SIZE; k++) {
num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
num = ((long) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
* MAXJSAMPLE;
/* Ensure round towards zero despite C's lack of consistency
* about rounding negative values in integer division...
......@@ -738,7 +738,7 @@ alloc_fs_workspace (j_decompress_ptr cinfo)
*/
METHODDEF(void)
start_pass_1_quant (j_decompress_ptr cinfo, boolean )
start_pass_1_quant (j_decompress_ptr cinfo, int )
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
size_t arraysize;
......
......@@ -144,7 +144,7 @@
#define C2_SHIFT (BITS_IN_JSAMPLE-HIST_C2_BITS)
typedef UINT16 histcell; /* histogram cell; prefer an unsigned type */
typedef unsigned short histcell; /* histogram cell; prefer an unsigned type */
typedef histcell FAR * histptr; /* for pointers to histogram cells */
......@@ -178,11 +178,11 @@ typedef hist2d * hist3d; /* type for top-level pointer */
*/
#if BITS_IN_JSAMPLE == 8
typedef INT16 FSERROR; /* 16 bits should be enough */
typedef short FSERROR; /* 16 bits should be enough */
typedef int LOCFSERROR; /* use 'int' for calculation temps */
#else
typedef INT32 FSERROR; /* may need more than 16 bits */
typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */
typedef long FSERROR; /* may need more than 16 bits */
typedef long LOCFSERROR; /* be sure calculation temps are big enough */
#endif
typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */
......@@ -200,11 +200,11 @@ typedef struct {
/* Variables for accumulating image statistics */
hist3d histogram; /* pointer to the histogram */
boolean needs_zeroed; /* TRUE if next pass must zero histogram */
int needs_zeroed; /* TRUE if next pass must zero histogram */
/* Variables for Floyd-Steinberg dithering */
FSERRPTR fserrors; /* accumulated errors */
boolean on_odd_row; /* flag to remember which row we are on */
int on_odd_row; /* flag to remember which row we are on */
int * error_limiter; /* table for clamping the applied error */
} my_cquantizer;
......@@ -261,7 +261,7 @@ typedef struct {
int c1min, c1max;
int c2min, c2max;
/* The volume (actually 2-norm) of the box */
INT32 volume;
long volume;
/* The number of nonzero histogram cells within this box */
long colorcount;
} box;
......@@ -296,7 +296,7 @@ find_biggest_volume (boxptr boxlist, int numboxes)
{
register boxptr boxp;
register int i;
register INT32 maxv = 0;
register long maxv = 0;
boxptr which = NULL;
for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
......@@ -319,7 +319,7 @@ update_box (j_decompress_ptr cinfo, boxptr boxp)
histptr histp;
int c0,c1,c2;
int c0min,c0max,c1min,c1max,c2min,c2max;
INT32 dist0,dist1,dist2;
long dist0,dist1,dist2;
long ccount;
c0min = boxp->c0min; c0max = boxp->c0max;
......@@ -658,8 +658,8 @@ find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
int maxc0, maxc1, maxc2;
int centerc0, centerc1, centerc2;
int i, x, ncolors;
INT32 minmaxdist, min_dist, max_dist, tdist;
INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
long minmaxdist, min_dist, max_dist, tdist;
long mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
/* Compute true coordinates of update box's upper corner and center.
* Actually we compute the coordinates of the center of the upper-corner
......@@ -783,15 +783,15 @@ find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
{
int ic0, ic1, ic2;
int i, icolor;
register INT32 * bptr; /* pointer into bestdist[] array */
register long * bptr; /* pointer into bestdist[] array */
JSAMPLE * cptr; /* pointer into bestcolor[] array */
INT32 dist0, dist1; /* initial distance values */
register INT32 dist2; /* current distance in inner loop */
INT32 xx0, xx1; /* distance increments */
register INT32 xx2;
INT32 inc0, inc1, inc2; /* initial values for increments */
long dist0, dist1; /* initial distance values */
register long dist2; /* current distance in inner loop */
long xx0, xx1; /* distance increments */
register long xx2;
long inc0, inc1, inc2; /* initial values for increments */
/* This array holds the distance to the nearest-so-far color for each cell */
INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
long bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
/* Initialize best-distance for each cell of the update box */
bptr = bestdist;
......@@ -1164,7 +1164,7 @@ finish_pass2 (j_decompress_ptr )
*/
METHODDEF(void)
start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
start_pass_2_quant (j_decompress_ptr cinfo, int is_pre_scan)
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment