blob: 44a330d07164097a8e002ab5a383c5f80f955fd9 [file] [log] [blame]
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00001/*
2 * jpegint.h
3 *
Thomas G. Lane5ead57a1998-03-27 00:00:00 +00004 * Copyright (C) 1991-1997, Thomas G. Lane.
Guido Vollbeding5996a252009-06-27 00:00:00 +00005 * Modified 1997-2009 by Guido Vollbeding.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00006 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file provides common declarations for the various JPEG modules.
10 * These declarations are considered internal to the JPEG library; most
11 * applications using the library shouldn't need to include this file.
12 */
13
14
15/* Declarations for both compression & decompression */
16
DRC333e9182014-05-12 00:34:08 +000017typedef enum { /* Operating modes for buffer controllers */
18 JBUF_PASS_THRU, /* Plain stripwise operation */
19 /* Remaining modes require a full-image buffer to have been created */
20 JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
21 JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
22 JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000023} J_BUF_MODE;
24
Thomas G. Lanebc79e061995-08-02 00:00:00 +000025/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
DRCb7753512014-05-11 09:36:25 +000026#define CSTATE_START 100 /* after create_compress */
27#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
28#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
29#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
30#define DSTATE_START 200 /* after create_decompress */
31#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
32#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
33#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
34#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
35#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
36#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
37#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
38#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
39#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
40#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000041
42
43/* Declarations for compression modules */
44
45/* Master control module */
46struct jpeg_comp_master {
47 JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
48 JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
49 JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
50
51 /* State variables made visible to other modules */
DRCb7753512014-05-11 09:36:25 +000052 boolean call_pass_startup; /* True if pass_startup must be called */
53 boolean is_last_pass; /* True during last pass */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000054};
55
56/* Main buffer control (downsampled-data buffer) */
57struct jpeg_c_main_controller {
58 JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
59 JMETHOD(void, process_data, (j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +000060 JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
61 JDIMENSION in_rows_avail));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000062};
63
64/* Compression preprocessing (downsampling input buffer control) */
65struct jpeg_c_prep_controller {
66 JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
67 JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +000068 JSAMPARRAY input_buf,
69 JDIMENSION *in_row_ctr,
70 JDIMENSION in_rows_avail,
71 JSAMPIMAGE output_buf,
72 JDIMENSION *out_row_group_ctr,
73 JDIMENSION out_row_groups_avail));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000074};
75
76/* Coefficient buffer control */
77struct jpeg_c_coef_controller {
78 JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
Thomas G. Lanea8b67c41995-03-15 00:00:00 +000079 JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +000080 JSAMPIMAGE input_buf));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000081};
82
83/* Colorspace conversion */
84struct jpeg_color_converter {
85 JMETHOD(void, start_pass, (j_compress_ptr cinfo));
86 JMETHOD(void, color_convert, (j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +000087 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
88 JDIMENSION output_row, int num_rows));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000089};
90
91/* Downsampling */
92struct jpeg_downsampler {
93 JMETHOD(void, start_pass, (j_compress_ptr cinfo));
94 JMETHOD(void, downsample, (j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +000095 JSAMPIMAGE input_buf, JDIMENSION in_row_index,
96 JSAMPIMAGE output_buf,
97 JDIMENSION out_row_group_index));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000098
DRCb7753512014-05-11 09:36:25 +000099 boolean need_context_rows; /* TRUE if need rows above & below */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000100};
101
102/* Forward DCT (also controls coefficient quantization) */
103struct jpeg_forward_dct {
104 JMETHOD(void, start_pass, (j_compress_ptr cinfo));
105 /* perhaps this should be an array??? */
106 JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000107 jpeg_component_info * compptr,
108 JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
109 JDIMENSION start_row, JDIMENSION start_col,
110 JDIMENSION num_blocks));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000111};
112
113/* Entropy encoding */
114struct jpeg_entropy_encoder {
115 JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
116 JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
117 JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
118};
119
120/* Marker writing */
121struct jpeg_marker_writer {
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000122 JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
123 JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
124 JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
125 JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
126 JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
Thomas G. Lane5ead57a1998-03-27 00:00:00 +0000127 /* These routines are exported to allow insertion of extra markers */
128 /* Probably only COM and APPn markers should be written this way */
129 JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
DRCb7753512014-05-11 09:36:25 +0000130 unsigned int datalen));
Thomas G. Lane5ead57a1998-03-27 00:00:00 +0000131 JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000132};
133
134
135/* Declarations for decompression modules */
136
137/* Master control module */
138struct jpeg_decomp_master {
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000139 JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
140 JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000141
142 /* State variables made visible to other modules */
DRCb7753512014-05-11 09:36:25 +0000143 boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000144};
145
146/* Input control module */
147struct jpeg_input_controller {
148 JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
149 JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
150 JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
151 JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
152
153 /* State variables made visible to other modules */
DRCb7753512014-05-11 09:36:25 +0000154 boolean has_multiple_scans; /* True if file has multiple scans */
155 boolean eoi_reached; /* True when EOI has been consumed */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000156};
157
158/* Main buffer control (downsampled-data buffer) */
159struct jpeg_d_main_controller {
160 JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
161 JMETHOD(void, process_data, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000162 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
163 JDIMENSION out_rows_avail));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000164};
165
166/* Coefficient buffer control */
167struct jpeg_d_coef_controller {
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000168 JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
169 JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
170 JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
171 JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000172 JSAMPIMAGE output_buf));
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000173 /* Pointer to array of coefficient virtual arrays, or NULL if none */
174 jvirt_barray_ptr *coef_arrays;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000175};
176
177/* Decompression postprocessing (color quantization buffer control) */
178struct jpeg_d_post_controller {
179 JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
180 JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000181 JSAMPIMAGE input_buf,
182 JDIMENSION *in_row_group_ctr,
183 JDIMENSION in_row_groups_avail,
184 JSAMPARRAY output_buf,
185 JDIMENSION *out_row_ctr,
186 JDIMENSION out_rows_avail));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000187};
188
189/* Marker reading & parsing */
190struct jpeg_marker_reader {
191 JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
192 /* Read markers until SOS or EOI.
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000193 * Returns same codes as are defined for jpeg_consume_input:
194 * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000195 */
196 JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
197 /* Read a restart marker --- exported for use by entropy decoder only */
198 jpeg_marker_parser_method read_restart_marker;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000199
200 /* State of marker reader --- nominally internal, but applications
201 * supplying COM or APPn handlers might like to know the state.
202 */
DRCb7753512014-05-11 09:36:25 +0000203 boolean saw_SOI; /* found SOI? */
204 boolean saw_SOF; /* found SOF? */
205 int next_restart_num; /* next restart number expected (0-7) */
206 unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000207};
208
209/* Entropy decoding */
210struct jpeg_entropy_decoder {
211 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
212 JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000213 JBLOCKROW *MCU_data));
Thomas G. Lane5ead57a1998-03-27 00:00:00 +0000214
215 /* This is here to share code between baseline and progressive decoders; */
216 /* other modules probably should not use it */
DRCb7753512014-05-11 09:36:25 +0000217 boolean insufficient_data; /* set TRUE after emitting warning */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000218};
219
220/* Inverse DCT (also performs dequantization) */
221typedef JMETHOD(void, inverse_DCT_method_ptr,
DRCb7753512014-05-11 09:36:25 +0000222 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
223 JCOEFPTR coef_block,
224 JSAMPARRAY output_buf, JDIMENSION output_col));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000225
226struct jpeg_inverse_dct {
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000227 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000228 /* It is useful to allow each component to have a separate IDCT method. */
229 inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
230};
231
232/* Upsampling (note that upsampler must also call color converter) */
233struct jpeg_upsampler {
234 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
235 JMETHOD(void, upsample, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000236 JSAMPIMAGE input_buf,
237 JDIMENSION *in_row_group_ctr,
238 JDIMENSION in_row_groups_avail,
239 JSAMPARRAY output_buf,
240 JDIMENSION *out_row_ctr,
241 JDIMENSION out_rows_avail));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000242
DRCb7753512014-05-11 09:36:25 +0000243 boolean need_context_rows; /* TRUE if need rows above & below */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000244};
245
246/* Colorspace conversion */
247struct jpeg_color_deconverter {
248 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
249 JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000250 JSAMPIMAGE input_buf, JDIMENSION input_row,
251 JSAMPARRAY output_buf, int num_rows));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000252};
253
254/* Color quantization or color precision reduction */
255struct jpeg_color_quantizer {
256 JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
257 JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000258 JSAMPARRAY input_buf, JSAMPARRAY output_buf,
259 int num_rows));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000260 JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000261 JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000262};
263
264
265/* Miscellaneous useful macros */
266
267#undef MAX
DRCb7753512014-05-11 09:36:25 +0000268#define MAX(a,b) ((a) > (b) ? (a) : (b))
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000269#undef MIN
DRCb7753512014-05-11 09:36:25 +0000270#define MIN(a,b) ((a) < (b) ? (a) : (b))
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000271
272
273/* We assume that right shift corresponds to signed division by 2 with
274 * rounding towards minus infinity. This is correct for typical "arithmetic
275 * shift" instructions that shift in copies of the sign bit. But some
276 * C compilers implement >> with an unsigned shift. For these machines you
277 * must define RIGHT_SHIFT_IS_UNSIGNED.
278 * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
279 * It is only applied with constant shift counts. SHIFT_TEMPS must be
280 * included in the variables of any routine using RIGHT_SHIFT.
281 */
282
283#ifdef RIGHT_SHIFT_IS_UNSIGNED
DRCb7753512014-05-11 09:36:25 +0000284#define SHIFT_TEMPS INT32 shift_temp;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000285#define RIGHT_SHIFT(x,shft) \
DRCb7753512014-05-11 09:36:25 +0000286 ((shift_temp = (x)) < 0 ? \
287 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
288 (shift_temp >> (shft)))
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000289#else
290#define SHIFT_TEMPS
DRCb7753512014-05-11 09:36:25 +0000291#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000292#endif
293
294
295/* Short forms of external names for systems with brain-damaged linkers. */
296
297#ifdef NEED_SHORT_EXTERNAL_NAMES
DRCb7753512014-05-11 09:36:25 +0000298#define jinit_compress_master jICompress
299#define jinit_c_master_control jICMaster
300#define jinit_c_main_controller jICMainC
301#define jinit_c_prep_controller jICPrepC
302#define jinit_c_coef_controller jICCoefC
303#define jinit_color_converter jICColor
304#define jinit_downsampler jIDownsampler
305#define jinit_forward_dct jIFDCT
306#define jinit_huff_encoder jIHEncoder
307#define jinit_phuff_encoder jIPHEncoder
308#define jinit_arith_encoder jIAEncoder
309#define jinit_marker_writer jIMWriter
310#define jinit_master_decompress jIDMaster
311#define jinit_d_main_controller jIDMainC
312#define jinit_d_coef_controller jIDCoefC
313#define jinit_d_post_controller jIDPostC
314#define jinit_input_controller jIInCtlr
315#define jinit_marker_reader jIMReader
316#define jinit_huff_decoder jIHDecoder
317#define jinit_phuff_decoder jIPHDecoder
318#define jinit_arith_decoder jIADecoder
319#define jinit_inverse_dct jIIDCT
320#define jinit_upsampler jIUpsampler
321#define jinit_color_deconverter jIDColor
322#define jinit_1pass_quantizer jI1Quant
323#define jinit_2pass_quantizer jI2Quant
324#define jinit_merged_upsampler jIMUpsampler
325#define jinit_memory_mgr jIMemMgr
326#define jdiv_round_up jDivRound
327#define jround_up jRound
328#define jcopy_sample_rows jCopySamples
329#define jcopy_block_row jCopyBlocks
330#define jzero_far jZeroFar
331#define jpeg_zigzag_order jZIGTable
332#define jpeg_natural_order jZAGTable
333#define jpeg_aritab jAriTab
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000334#endif /* NEED_SHORT_EXTERNAL_NAMES */
335
336
337/* Compression module initialization routines */
Thomas G. Lane489583f1996-02-07 00:00:00 +0000338EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
339EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000340 boolean transcode_only));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000341EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000342 boolean need_full_buffer));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000343EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000344 boolean need_full_buffer));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000345EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000346 boolean need_full_buffer));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000347EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
348EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
349EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
350EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
351EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
Guido Vollbeding1e247ac1998-03-28 00:00:00 +0000352EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000353EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000354/* Decompression module initialization routines */
Thomas G. Lane489583f1996-02-07 00:00:00 +0000355EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
356EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000357 boolean need_full_buffer));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000358EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000359 boolean need_full_buffer));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000360EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
DRCb7753512014-05-11 09:36:25 +0000361 boolean need_full_buffer));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000362EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
363EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
364EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
365EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
Guido Vollbeding1e247ac1998-03-28 00:00:00 +0000366EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000367EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
368EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
369EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
370EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
371EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
372EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000373/* Memory manager initialization */
Thomas G. Lane489583f1996-02-07 00:00:00 +0000374EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000375
376/* Utility routines in jutils.c */
Thomas G. Lane489583f1996-02-07 00:00:00 +0000377EXTERN(long) jdiv_round_up JPP((long a, long b));
DRCa8eabfe2011-03-29 04:58:40 +0000378EXTERN(long) jround_up JPP((long a, long b));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000379EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
DRCb7753512014-05-11 09:36:25 +0000380 JSAMPARRAY output_array, int dest_row,
381 int num_rows, JDIMENSION num_cols));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000382EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
DRCb7753512014-05-11 09:36:25 +0000383 JDIMENSION num_blocks));
Thomas G. Lane489583f1996-02-07 00:00:00 +0000384EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000385/* Constant tables in jutils.c */
DRCb7753512014-05-11 09:36:25 +0000386#if 0 /* This table is not actually needed in v6a */
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000387extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
Thomas G. Lane5ead57a1998-03-27 00:00:00 +0000388#endif
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000389extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000390
Guido Vollbeding989630f2010-01-10 00:00:00 +0000391/* Arithmetic coding probability estimation tables in jaricom.c */
392extern const INT32 jpeg_aritab[];
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000393
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000394/* Suppress undefined-structure complaints if necessary. */
395
396#ifdef INCOMPLETE_TYPES_BROKEN
DRCb7753512014-05-11 09:36:25 +0000397#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000398struct jvirt_sarray_control { long dummy; };
399struct jvirt_barray_control { long dummy; };
400#endif
401#endif /* INCOMPLETE_TYPES_BROKEN */