kusano 7d535a
/*
kusano 7d535a
 * jpegint.h
kusano 7d535a
 *
kusano 7d535a
 * Copyright (C) 1991-1997, Thomas G. Lane.
kusano 7d535a
 * Modified 1997-2011 by Guido Vollbeding.
kusano 7d535a
 * This file is part of the Independent JPEG Group's software.
kusano 7d535a
 * For conditions of distribution and use, see the accompanying README file.
kusano 7d535a
 *
kusano 7d535a
 * This file provides common declarations for the various JPEG modules.
kusano 7d535a
 * These declarations are considered internal to the JPEG library; most
kusano 7d535a
 * applications using the library shouldn't need to include this file.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* Declarations for both compression & decompression */
kusano 7d535a
kusano 7d535a
typedef enum {			/* Operating modes for buffer controllers */
kusano 7d535a
	JBUF_PASS_THRU,		/* Plain stripwise operation */
kusano 7d535a
	/* Remaining modes require a full-image buffer to have been created */
kusano 7d535a
	JBUF_SAVE_SOURCE,	/* Run source subobject only, save output */
kusano 7d535a
	JBUF_CRANK_DEST,	/* Run dest subobject only, using saved data */
kusano 7d535a
	JBUF_SAVE_AND_PASS	/* Run both subobjects, save output */
kusano 7d535a
} J_BUF_MODE;
kusano 7d535a
kusano 7d535a
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
kusano 7d535a
#define CSTATE_START	100	/* after create_compress */
kusano 7d535a
#define CSTATE_SCANNING	101	/* start_compress done, write_scanlines OK */
kusano 7d535a
#define CSTATE_RAW_OK	102	/* start_compress done, write_raw_data OK */
kusano 7d535a
#define CSTATE_WRCOEFS	103	/* jpeg_write_coefficients done */
kusano 7d535a
#define DSTATE_START	200	/* after create_decompress */
kusano 7d535a
#define DSTATE_INHEADER	201	/* reading header markers, no SOS yet */
kusano 7d535a
#define DSTATE_READY	202	/* found SOS, ready for start_decompress */
kusano 7d535a
#define DSTATE_PRELOAD	203	/* reading multiscan file in start_decompress*/
kusano 7d535a
#define DSTATE_PRESCAN	204	/* performing dummy pass for 2-pass quant */
kusano 7d535a
#define DSTATE_SCANNING	205	/* start_decompress done, read_scanlines OK */
kusano 7d535a
#define DSTATE_RAW_OK	206	/* start_decompress done, read_raw_data OK */
kusano 7d535a
#define DSTATE_BUFIMAGE	207	/* expecting jpeg_start_output */
kusano 7d535a
#define DSTATE_BUFPOST	208	/* looking for SOS/EOI in jpeg_finish_output */
kusano 7d535a
#define DSTATE_RDCOEFS	209	/* reading file in jpeg_read_coefficients */
kusano 7d535a
#define DSTATE_STOPPING	210	/* looking for EOI in jpeg_finish_decompress */
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* Declarations for compression modules */
kusano 7d535a
kusano 7d535a
/* Master control module */
kusano 7d535a
struct jpeg_comp_master {
kusano 7d535a
  JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
kusano 7d535a
kusano 7d535a
  /* State variables made visible to other modules */
kusano 7d535a
  boolean call_pass_startup;	/* True if pass_startup must be called */
kusano 7d535a
  boolean is_last_pass;		/* True during last pass */
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Main buffer control (downsampled-data buffer) */
kusano 7d535a
struct jpeg_c_main_controller {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
kusano 7d535a
  JMETHOD(void, process_data, (j_compress_ptr cinfo,
kusano 7d535a
			       JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
kusano 7d535a
			       JDIMENSION in_rows_avail));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Compression preprocessing (downsampling input buffer control) */
kusano 7d535a
struct jpeg_c_prep_controller {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
kusano 7d535a
  JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
kusano 7d535a
				   JSAMPARRAY input_buf,
kusano 7d535a
				   JDIMENSION *in_row_ctr,
kusano 7d535a
				   JDIMENSION in_rows_avail,
kusano 7d535a
				   JSAMPIMAGE output_buf,
kusano 7d535a
				   JDIMENSION *out_row_group_ctr,
kusano 7d535a
				   JDIMENSION out_row_groups_avail));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Coefficient buffer control */
kusano 7d535a
struct jpeg_c_coef_controller {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
kusano 7d535a
  JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
kusano 7d535a
				   JSAMPIMAGE input_buf));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Colorspace conversion */
kusano 7d535a
struct jpeg_color_converter {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, color_convert, (j_compress_ptr cinfo,
kusano 7d535a
				JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
kusano 7d535a
				JDIMENSION output_row, int num_rows));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Downsampling */
kusano 7d535a
struct jpeg_downsampler {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, downsample, (j_compress_ptr cinfo,
kusano 7d535a
			     JSAMPIMAGE input_buf, JDIMENSION in_row_index,
kusano 7d535a
			     JSAMPIMAGE output_buf,
kusano 7d535a
			     JDIMENSION out_row_group_index));
kusano 7d535a
kusano 7d535a
  boolean need_context_rows;	/* TRUE if need rows above & below */
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Forward DCT (also controls coefficient quantization) */
kusano 7d535a
typedef JMETHOD(void, forward_DCT_ptr,
kusano 7d535a
		(j_compress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
		 JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
kusano 7d535a
		 JDIMENSION start_row, JDIMENSION start_col,
kusano 7d535a
		 JDIMENSION num_blocks));
kusano 7d535a
kusano 7d535a
struct jpeg_forward_dct {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo));
kusano 7d535a
  /* It is useful to allow each component to have a separate FDCT method. */
kusano 7d535a
  forward_DCT_ptr forward_DCT[MAX_COMPONENTS];
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Entropy encoding */
kusano 7d535a
struct jpeg_entropy_encoder {
kusano 7d535a
  JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
kusano 7d535a
  JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
kusano 7d535a
  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Marker writing */
kusano 7d535a
struct jpeg_marker_writer {
kusano 7d535a
  JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
kusano 7d535a
  /* These routines are exported to allow insertion of extra markers */
kusano 7d535a
  /* Probably only COM and APPn markers should be written this way */
kusano 7d535a
  JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
kusano 7d535a
				      unsigned int datalen));
kusano 7d535a
  JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* Declarations for decompression modules */
kusano 7d535a
kusano 7d535a
/* Master control module */
kusano 7d535a
struct jpeg_decomp_master {
kusano 7d535a
  JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
kusano 7d535a
kusano 7d535a
  /* State variables made visible to other modules */
kusano 7d535a
  boolean is_dummy_pass;	/* True during 1st pass for 2-pass quant */
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Input control module */
kusano 7d535a
struct jpeg_input_controller {
kusano 7d535a
  JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
kusano 7d535a
kusano 7d535a
  /* State variables made visible to other modules */
kusano 7d535a
  boolean has_multiple_scans;	/* True if file has multiple scans */
kusano 7d535a
  boolean eoi_reached;		/* True when EOI has been consumed */
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Main buffer control (downsampled-data buffer) */
kusano 7d535a
struct jpeg_d_main_controller {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
kusano 7d535a
  JMETHOD(void, process_data, (j_decompress_ptr cinfo,
kusano 7d535a
			       JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
kusano 7d535a
			       JDIMENSION out_rows_avail));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Coefficient buffer control */
kusano 7d535a
struct jpeg_d_coef_controller {
kusano 7d535a
  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
kusano 7d535a
				 JSAMPIMAGE output_buf));
kusano 7d535a
  /* Pointer to array of coefficient virtual arrays, or NULL if none */
kusano 7d535a
  jvirt_barray_ptr *coef_arrays;
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Decompression postprocessing (color quantization buffer control) */
kusano 7d535a
struct jpeg_d_post_controller {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
kusano 7d535a
  JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
kusano 7d535a
				    JSAMPIMAGE input_buf,
kusano 7d535a
				    JDIMENSION *in_row_group_ctr,
kusano 7d535a
				    JDIMENSION in_row_groups_avail,
kusano 7d535a
				    JSAMPARRAY output_buf,
kusano 7d535a
				    JDIMENSION *out_row_ctr,
kusano 7d535a
				    JDIMENSION out_rows_avail));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Marker reading & parsing */
kusano 7d535a
struct jpeg_marker_reader {
kusano 7d535a
  JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
kusano 7d535a
  /* Read markers until SOS or EOI.
kusano 7d535a
   * Returns same codes as are defined for jpeg_consume_input:
kusano 7d535a
   * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
kusano 7d535a
   */
kusano 7d535a
  JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
kusano 7d535a
  /* Read a restart marker --- exported for use by entropy decoder only */
kusano 7d535a
  jpeg_marker_parser_method read_restart_marker;
kusano 7d535a
kusano 7d535a
  /* State of marker reader --- nominally internal, but applications
kusano 7d535a
   * supplying COM or APPn handlers might like to know the state.
kusano 7d535a
   */
kusano 7d535a
  boolean saw_SOI;		/* found SOI? */
kusano 7d535a
  boolean saw_SOF;		/* found SOF? */
kusano 7d535a
  int next_restart_num;		/* next restart number expected (0-7) */
kusano 7d535a
  unsigned int discarded_bytes;	/* # of bytes skipped looking for a marker */
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Entropy decoding */
kusano 7d535a
struct jpeg_entropy_decoder {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
kusano 7d535a
				JBLOCKROW *MCU_data));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Inverse DCT (also performs dequantization) */
kusano 7d535a
typedef JMETHOD(void, inverse_DCT_method_ptr,
kusano 7d535a
		(j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
		 JCOEFPTR coef_block,
kusano 7d535a
		 JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
kusano 7d535a
struct jpeg_inverse_dct {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  /* It is useful to allow each component to have a separate IDCT method. */
kusano 7d535a
  inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Upsampling (note that upsampler must also call color converter) */
kusano 7d535a
struct jpeg_upsampler {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, upsample, (j_decompress_ptr cinfo,
kusano 7d535a
			   JSAMPIMAGE input_buf,
kusano 7d535a
			   JDIMENSION *in_row_group_ctr,
kusano 7d535a
			   JDIMENSION in_row_groups_avail,
kusano 7d535a
			   JSAMPARRAY output_buf,
kusano 7d535a
			   JDIMENSION *out_row_ctr,
kusano 7d535a
			   JDIMENSION out_rows_avail));
kusano 7d535a
kusano 7d535a
  boolean need_context_rows;	/* TRUE if need rows above & below */
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Colorspace conversion */
kusano 7d535a
struct jpeg_color_deconverter {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
kusano 7d535a
				JSAMPIMAGE input_buf, JDIMENSION input_row,
kusano 7d535a
				JSAMPARRAY output_buf, int num_rows));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
/* Color quantization or color precision reduction */
kusano 7d535a
struct jpeg_color_quantizer {
kusano 7d535a
  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
kusano 7d535a
  JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
kusano 7d535a
				 JSAMPARRAY input_buf, JSAMPARRAY output_buf,
kusano 7d535a
				 int num_rows));
kusano 7d535a
  JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
kusano 7d535a
  JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
kusano 7d535a
};
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* Miscellaneous useful macros */
kusano 7d535a
kusano 7d535a
#undef MAX
kusano 7d535a
#define MAX(a,b)	((a) > (b) ? (a) : (b))
kusano 7d535a
#undef MIN
kusano 7d535a
#define MIN(a,b)	((a) < (b) ? (a) : (b))
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* We assume that right shift corresponds to signed division by 2 with
kusano 7d535a
 * rounding towards minus infinity.  This is correct for typical "arithmetic
kusano 7d535a
 * shift" instructions that shift in copies of the sign bit.  But some
kusano 7d535a
 * C compilers implement >> with an unsigned shift.  For these machines you
kusano 7d535a
 * must define RIGHT_SHIFT_IS_UNSIGNED.
kusano 7d535a
 * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
kusano 7d535a
 * It is only applied with constant shift counts.  SHIFT_TEMPS must be
kusano 7d535a
 * included in the variables of any routine using RIGHT_SHIFT.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#ifdef RIGHT_SHIFT_IS_UNSIGNED
kusano 7d535a
#define SHIFT_TEMPS	INT32 shift_temp;
kusano 7d535a
#define RIGHT_SHIFT(x,shft)  \
kusano 7d535a
	((shift_temp = (x)) < 0 ? \
kusano 7d535a
	 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
kusano 7d535a
	 (shift_temp >> (shft)))
kusano 7d535a
#else
kusano 7d535a
#define SHIFT_TEMPS
kusano 7d535a
#define RIGHT_SHIFT(x,shft)	((x) >> (shft))
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* Short forms of external names for systems with brain-damaged linkers. */
kusano 7d535a
kusano 7d535a
#ifdef NEED_SHORT_EXTERNAL_NAMES
kusano 7d535a
#define jinit_compress_master	jICompress
kusano 7d535a
#define jinit_c_master_control	jICMaster
kusano 7d535a
#define jinit_c_main_controller	jICMainC
kusano 7d535a
#define jinit_c_prep_controller	jICPrepC
kusano 7d535a
#define jinit_c_coef_controller	jICCoefC
kusano 7d535a
#define jinit_color_converter	jICColor
kusano 7d535a
#define jinit_downsampler	jIDownsampler
kusano 7d535a
#define jinit_forward_dct	jIFDCT
kusano 7d535a
#define jinit_huff_encoder	jIHEncoder
kusano 7d535a
#define jinit_arith_encoder	jIAEncoder
kusano 7d535a
#define jinit_marker_writer	jIMWriter
kusano 7d535a
#define jinit_master_decompress	jIDMaster
kusano 7d535a
#define jinit_d_main_controller	jIDMainC
kusano 7d535a
#define jinit_d_coef_controller	jIDCoefC
kusano 7d535a
#define jinit_d_post_controller	jIDPostC
kusano 7d535a
#define jinit_input_controller	jIInCtlr
kusano 7d535a
#define jinit_marker_reader	jIMReader
kusano 7d535a
#define jinit_huff_decoder	jIHDecoder
kusano 7d535a
#define jinit_arith_decoder	jIADecoder
kusano 7d535a
#define jinit_inverse_dct	jIIDCT
kusano 7d535a
#define jinit_upsampler		jIUpsampler
kusano 7d535a
#define jinit_color_deconverter	jIDColor
kusano 7d535a
#define jinit_1pass_quantizer	jI1Quant
kusano 7d535a
#define jinit_2pass_quantizer	jI2Quant
kusano 7d535a
#define jinit_merged_upsampler	jIMUpsampler
kusano 7d535a
#define jinit_memory_mgr	jIMemMgr
kusano 7d535a
#define jdiv_round_up		jDivRound
kusano 7d535a
#define jround_up		jRound
kusano 7d535a
#define jzero_far		jZeroFar
kusano 7d535a
#define jcopy_sample_rows	jCopySamples
kusano 7d535a
#define jcopy_block_row		jCopyBlocks
kusano 7d535a
#define jpeg_zigzag_order	jZIGTable
kusano 7d535a
#define jpeg_natural_order	jZAGTable
kusano 7d535a
#define jpeg_natural_order7	jZAG7Table
kusano 7d535a
#define jpeg_natural_order6	jZAG6Table
kusano 7d535a
#define jpeg_natural_order5	jZAG5Table
kusano 7d535a
#define jpeg_natural_order4	jZAG4Table
kusano 7d535a
#define jpeg_natural_order3	jZAG3Table
kusano 7d535a
#define jpeg_natural_order2	jZAG2Table
kusano 7d535a
#define jpeg_aritab		jAriTab
kusano 7d535a
#endif /* NEED_SHORT_EXTERNAL_NAMES */
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
kusano 7d535a
 * and coefficient-block arrays.  This won't work on 80x86 because the arrays
kusano 7d535a
 * are FAR and we're assuming a small-pointer memory model.  However, some
kusano 7d535a
 * DOS compilers provide far-pointer versions of memcpy() and memset() even
kusano 7d535a
 * in the small-model libraries.  These will be used if USE_FMEM is defined.
kusano 7d535a
 * Otherwise, the routines in jutils.c do it the hard way.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#ifndef NEED_FAR_POINTERS	/* normal case, same as regular macro */
kusano 7d535a
#define FMEMZERO(target,size)	MEMZERO(target,size)
kusano 7d535a
#else				/* 80x86 case */
kusano 7d535a
#ifdef USE_FMEM
kusano 7d535a
#define FMEMZERO(target,size)	_fmemset((void FAR *)(target), 0, (size_t)(size))
kusano 7d535a
#else
kusano 7d535a
EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
kusano 7d535a
#define FMEMZERO(target,size)	jzero_far(target, size)
kusano 7d535a
#endif
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* Compression module initialization routines */
kusano 7d535a
EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
kusano 7d535a
					 boolean transcode_only));
kusano 7d535a
EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
kusano 7d535a
					  boolean need_full_buffer));
kusano 7d535a
EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
kusano 7d535a
					  boolean need_full_buffer));
kusano 7d535a
EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
kusano 7d535a
					  boolean need_full_buffer));
kusano 7d535a
EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
kusano 7d535a
/* Decompression module initialization routines */
kusano 7d535a
EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
kusano 7d535a
					  boolean need_full_buffer));
kusano 7d535a
EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
kusano 7d535a
					  boolean need_full_buffer));
kusano 7d535a
EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
kusano 7d535a
					  boolean need_full_buffer));
kusano 7d535a
EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
kusano 7d535a
EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
kusano 7d535a
/* Memory manager initialization */
kusano 7d535a
EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
kusano 7d535a
kusano 7d535a
/* Utility routines in jutils.c */
kusano 7d535a
EXTERN(long) jdiv_round_up JPP((long a, long b));
kusano 7d535a
EXTERN(long) jround_up JPP((long a, long b));
kusano 7d535a
EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
kusano 7d535a
				    JSAMPARRAY output_array, int dest_row,
kusano 7d535a
				    int num_rows, JDIMENSION num_cols));
kusano 7d535a
EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
kusano 7d535a
				  JDIMENSION num_blocks));
kusano 7d535a
/* Constant tables in jutils.c */
kusano 7d535a
#if 0				/* This table is not actually needed in v6a */
kusano 7d535a
extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
kusano 7d535a
#endif
kusano 7d535a
extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
kusano 7d535a
extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */
kusano 7d535a
extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */
kusano 7d535a
extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */
kusano 7d535a
extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */
kusano 7d535a
extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */
kusano 7d535a
extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */
kusano 7d535a
kusano 7d535a
/* Arithmetic coding probability estimation tables in jaricom.c */
kusano 7d535a
extern const INT32 jpeg_aritab[];
kusano 7d535a
kusano 7d535a
/* Suppress undefined-structure complaints if necessary. */
kusano 7d535a
kusano 7d535a
#ifdef INCOMPLETE_TYPES_BROKEN
kusano 7d535a
#ifndef AM_MEMORY_MANAGER	/* only jmemmgr.c defines these */
kusano 7d535a
struct jvirt_sarray_control { long dummy; };
kusano 7d535a
struct jvirt_barray_control { long dummy; };
kusano 7d535a
#endif
kusano 7d535a
#endif /* INCOMPLETE_TYPES_BROKEN */