1 /* |
1 /* |
2 * jpegint.h |
2 * jpegint.h |
3 * |
3 * |
4 * Copyright (C) 1991-1997, Thomas G. Lane. |
4 * Copyright (C) 1991-1997, Thomas G. Lane. |
|
5 * Modified 1997-2009 by Guido Vollbeding. |
5 * This file is part of the Independent JPEG Group's software. |
6 * This file is part of the Independent JPEG Group's software. |
6 * For conditions of distribution and use, see the accompanying README file. |
7 * For conditions of distribution and use, see the accompanying README file. |
7 * |
8 * |
8 * This file provides common declarations for the various JPEG modules. |
9 * This file provides common declarations for the various JPEG modules. |
9 * These declarations are considered internal to the JPEG library; most |
10 * These declarations are considered internal to the JPEG library; most |
97 |
98 |
98 boolean need_context_rows; /* TRUE if need rows above & below */ |
99 boolean need_context_rows; /* TRUE if need rows above & below */ |
99 }; |
100 }; |
100 |
101 |
101 /* Forward DCT (also controls coefficient quantization) */ |
102 /* Forward DCT (also controls coefficient quantization) */ |
|
103 typedef JMETHOD(void, forward_DCT_ptr, |
|
104 (j_compress_ptr cinfo, jpeg_component_info * compptr, |
|
105 JSAMPARRAY sample_data, JBLOCKROW coef_blocks, |
|
106 JDIMENSION start_row, JDIMENSION start_col, |
|
107 JDIMENSION num_blocks)); |
|
108 |
102 struct jpeg_forward_dct { |
109 struct jpeg_forward_dct { |
103 JMETHOD(void, start_pass, (j_compress_ptr cinfo)); |
110 JMETHOD(void, start_pass, (j_compress_ptr cinfo)); |
104 /* perhaps this should be an array??? */ |
111 /* It is useful to allow each component to have a separate FDCT method. */ |
105 JMETHOD(void, forward_DCT, (j_compress_ptr cinfo, |
112 forward_DCT_ptr forward_DCT[MAX_COMPONENTS]; |
106 jpeg_component_info * compptr, |
|
107 JSAMPARRAY sample_data, JBLOCKROW coef_blocks, |
|
108 JDIMENSION start_row, JDIMENSION start_col, |
|
109 JDIMENSION num_blocks)); |
|
110 }; |
113 }; |
111 |
114 |
112 /* Entropy encoding */ |
115 /* Entropy encoding */ |
113 struct jpeg_entropy_encoder { |
116 struct jpeg_entropy_encoder { |
114 JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics)); |
117 JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics)); |
208 /* Entropy decoding */ |
211 /* Entropy decoding */ |
209 struct jpeg_entropy_decoder { |
212 struct jpeg_entropy_decoder { |
210 JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); |
213 JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); |
211 JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, |
214 JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, |
212 JBLOCKROW *MCU_data)); |
215 JBLOCKROW *MCU_data)); |
213 |
|
214 /* This is here to share code between baseline and progressive decoders; */ |
|
215 /* other modules probably should not use it */ |
|
216 boolean insufficient_data; /* set TRUE after emitting warning */ |
|
217 }; |
216 }; |
218 |
217 |
219 /* Inverse DCT (also performs dequantization) */ |
218 /* Inverse DCT (also performs dequantization) */ |
220 typedef JMETHOD(void, inverse_DCT_method_ptr, |
219 typedef JMETHOD(void, inverse_DCT_method_ptr, |
221 (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
220 (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
301 #define jinit_c_coef_controller jICCoefC |
300 #define jinit_c_coef_controller jICCoefC |
302 #define jinit_color_converter jICColor |
301 #define jinit_color_converter jICColor |
303 #define jinit_downsampler jIDownsampler |
302 #define jinit_downsampler jIDownsampler |
304 #define jinit_forward_dct jIFDCT |
303 #define jinit_forward_dct jIFDCT |
305 #define jinit_huff_encoder jIHEncoder |
304 #define jinit_huff_encoder jIHEncoder |
306 #define jinit_phuff_encoder jIPHEncoder |
305 #define jinit_arith_encoder jIAEncoder |
307 #define jinit_marker_writer jIMWriter |
306 #define jinit_marker_writer jIMWriter |
308 #define jinit_master_decompress jIDMaster |
307 #define jinit_master_decompress jIDMaster |
309 #define jinit_d_main_controller jIDMainC |
308 #define jinit_d_main_controller jIDMainC |
310 #define jinit_d_coef_controller jIDCoefC |
309 #define jinit_d_coef_controller jIDCoefC |
311 #define jinit_d_post_controller jIDPostC |
310 #define jinit_d_post_controller jIDPostC |
312 #define jinit_input_controller jIInCtlr |
311 #define jinit_input_controller jIInCtlr |
313 #define jinit_marker_reader jIMReader |
312 #define jinit_marker_reader jIMReader |
314 #define jinit_huff_decoder jIHDecoder |
313 #define jinit_huff_decoder jIHDecoder |
315 #define jinit_phuff_decoder jIPHDecoder |
314 #define jinit_arith_decoder jIADecoder |
316 #define jinit_inverse_dct jIIDCT |
315 #define jinit_inverse_dct jIIDCT |
317 #define jinit_upsampler jIUpsampler |
316 #define jinit_upsampler jIUpsampler |
318 #define jinit_color_deconverter jIDColor |
317 #define jinit_color_deconverter jIDColor |
319 #define jinit_1pass_quantizer jI1Quant |
318 #define jinit_1pass_quantizer jI1Quant |
320 #define jinit_2pass_quantizer jI2Quant |
319 #define jinit_2pass_quantizer jI2Quant |
325 #define jcopy_sample_rows jCopySamples |
324 #define jcopy_sample_rows jCopySamples |
326 #define jcopy_block_row jCopyBlocks |
325 #define jcopy_block_row jCopyBlocks |
327 #define jzero_far jZeroFar |
326 #define jzero_far jZeroFar |
328 #define jpeg_zigzag_order jZIGTable |
327 #define jpeg_zigzag_order jZIGTable |
329 #define jpeg_natural_order jZAGTable |
328 #define jpeg_natural_order jZAGTable |
|
329 #define jpeg_natural_order7 jZAGTable7 |
|
330 #define jpeg_natural_order6 jZAGTable6 |
|
331 #define jpeg_natural_order5 jZAGTable5 |
|
332 #define jpeg_natural_order4 jZAGTable4 |
|
333 #define jpeg_natural_order3 jZAGTable3 |
|
334 #define jpeg_natural_order2 jZAGTable2 |
|
335 #define jpeg_aritab jAriTab |
330 #endif /* NEED_SHORT_EXTERNAL_NAMES */ |
336 #endif /* NEED_SHORT_EXTERNAL_NAMES */ |
331 |
337 |
332 |
338 |
333 /* Compression module initialization routines */ |
339 /* Compression module initialization routines */ |
334 EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); |
340 EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); |
342 boolean need_full_buffer)); |
348 boolean need_full_buffer)); |
343 EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); |
349 EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); |
344 EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); |
350 EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); |
345 EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); |
351 EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); |
346 EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo)); |
352 EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo)); |
347 EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo)); |
353 EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo)); |
348 EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); |
354 EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); |
349 /* Decompression module initialization routines */ |
355 /* Decompression module initialization routines */ |
350 EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); |
356 EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); |
351 EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, |
357 EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, |
352 boolean need_full_buffer)); |
358 boolean need_full_buffer)); |
355 EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, |
361 EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, |
356 boolean need_full_buffer)); |
362 boolean need_full_buffer)); |
357 EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); |
363 EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); |
358 EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); |
364 EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); |
359 EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo)); |
365 EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo)); |
360 EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo)); |
366 EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo)); |
361 EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); |
367 EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); |
362 EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); |
368 EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); |
363 EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); |
369 EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); |
364 EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); |
370 EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); |
365 EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); |
371 EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); |
379 /* Constant tables in jutils.c */ |
385 /* Constant tables in jutils.c */ |
380 #if 0 /* This table is not actually needed in v6a */ |
386 #if 0 /* This table is not actually needed in v6a */ |
381 extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ |
387 extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ |
382 #endif |
388 #endif |
383 extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ |
389 extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ |
|
390 extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */ |
|
391 extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */ |
|
392 extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */ |
|
393 extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */ |
|
394 extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */ |
|
395 extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */ |
|
396 |
|
397 /* Arithmetic coding probability estimation tables in jaricom.c */ |
|
398 extern const INT32 jpeg_aritab[]; |
384 |
399 |
385 /* Suppress undefined-structure complaints if necessary. */ |
400 /* Suppress undefined-structure complaints if necessary. */ |
386 |
401 |
387 #ifdef INCOMPLETE_TYPES_BROKEN |
402 #ifdef INCOMPLETE_TYPES_BROKEN |
388 #ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ |
403 #ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ |