kusano 7d535a
/*
kusano 7d535a
 * jdct.h
kusano 7d535a
 *
kusano 7d535a
 * Copyright (C) 1994-1996, Thomas G. Lane.
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 include file contains common declarations for the forward and
kusano 7d535a
 * inverse DCT modules.  These declarations are private to the DCT managers
kusano 7d535a
 * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
kusano 7d535a
 * The individual DCT algorithms are kept in separate files to ease 
kusano 7d535a
 * machine-dependent tuning (e.g., assembly coding).
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * A forward DCT routine is given a pointer to an input sample array and
kusano 7d535a
 * a pointer to a work area of type DCTELEM[]; the DCT is to be performed
kusano 7d535a
 * in-place in that buffer.  Type DCTELEM is int for 8-bit samples, INT32
kusano 7d535a
 * for 12-bit samples.  (NOTE: Floating-point DCT implementations use an
kusano 7d535a
 * array of type FAST_FLOAT, instead.)
kusano 7d535a
 * The input data is to be fetched from the sample array starting at a
kusano 7d535a
 * specified column.  (Any row offset needed will be applied to the array
kusano 7d535a
 * pointer before it is passed to the FDCT code.)
kusano 7d535a
 * Note that the number of samples fetched by the FDCT routine is
kusano 7d535a
 * DCT_h_scaled_size * DCT_v_scaled_size.
kusano 7d535a
 * The DCT outputs are returned scaled up by a factor of 8; they therefore
kusano 7d535a
 * have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This
kusano 7d535a
 * convention improves accuracy in integer implementations and saves some
kusano 7d535a
 * work in floating-point ones.
kusano 7d535a
 * Quantization of the output coefficients is done by jcdctmgr.c.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#if BITS_IN_JSAMPLE == 8
kusano 7d535a
typedef int DCTELEM;		/* 16 or 32 bits is fine */
kusano 7d535a
#else
kusano 7d535a
typedef INT32 DCTELEM;		/* must have 32 bits */
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data,
kusano 7d535a
					       JSAMPARRAY sample_data,
kusano 7d535a
					       JDIMENSION start_col));
kusano 7d535a
typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data,
kusano 7d535a
					     JSAMPARRAY sample_data,
kusano 7d535a
					     JDIMENSION start_col));
kusano 7d535a
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
kusano 7d535a
 * to an output sample array.  The routine must dequantize the input data as
kusano 7d535a
 * well as perform the IDCT; for dequantization, it uses the multiplier table
kusano 7d535a
 * pointed to by compptr->dct_table.  The output data is to be placed into the
kusano 7d535a
 * sample array starting at a specified column.  (Any row offset needed will
kusano 7d535a
 * be applied to the array pointer before it is passed to the IDCT code.)
kusano 7d535a
 * Note that the number of samples emitted by the IDCT routine is
kusano 7d535a
 * DCT_h_scaled_size * DCT_v_scaled_size.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * Each IDCT routine has its own ideas about the best dct_table element type.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
kusano 7d535a
#if BITS_IN_JSAMPLE == 8
kusano 7d535a
typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
kusano 7d535a
#define IFAST_SCALE_BITS  2	/* fractional bits in scale factors */
kusano 7d535a
#else
kusano 7d535a
typedef INT32 IFAST_MULT_TYPE;	/* need 32 bits for scaled quantizers */
kusano 7d535a
#define IFAST_SCALE_BITS  13	/* fractional bits in scale factors */
kusano 7d535a
#endif
kusano 7d535a
typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
kusano 7d535a
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * Each IDCT routine is responsible for range-limiting its results and
kusano 7d535a
 * converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could
kusano 7d535a
 * be quite far out of range if the input data is corrupt, so a bulletproof
kusano 7d535a
 * range-limiting step is required.  We use a mask-and-table-lookup method
kusano 7d535a
 * to do the combined operations quickly.  See the comments with
kusano 7d535a
 * prepare_range_limit_table (in jdmaster.c) for more info.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)
kusano 7d535a
kusano 7d535a
#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
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 jpeg_fdct_islow		jFDislow
kusano 7d535a
#define jpeg_fdct_ifast		jFDifast
kusano 7d535a
#define jpeg_fdct_float		jFDfloat
kusano 7d535a
#define jpeg_fdct_7x7		jFD7x7
kusano 7d535a
#define jpeg_fdct_6x6		jFD6x6
kusano 7d535a
#define jpeg_fdct_5x5		jFD5x5
kusano 7d535a
#define jpeg_fdct_4x4		jFD4x4
kusano 7d535a
#define jpeg_fdct_3x3		jFD3x3
kusano 7d535a
#define jpeg_fdct_2x2		jFD2x2
kusano 7d535a
#define jpeg_fdct_1x1		jFD1x1
kusano 7d535a
#define jpeg_fdct_9x9		jFD9x9
kusano 7d535a
#define jpeg_fdct_10x10		jFD10x10
kusano 7d535a
#define jpeg_fdct_11x11		jFD11x11
kusano 7d535a
#define jpeg_fdct_12x12		jFD12x12
kusano 7d535a
#define jpeg_fdct_13x13		jFD13x13
kusano 7d535a
#define jpeg_fdct_14x14		jFD14x14
kusano 7d535a
#define jpeg_fdct_15x15		jFD15x15
kusano 7d535a
#define jpeg_fdct_16x16		jFD16x16
kusano 7d535a
#define jpeg_fdct_16x8		jFD16x8
kusano 7d535a
#define jpeg_fdct_14x7		jFD14x7
kusano 7d535a
#define jpeg_fdct_12x6		jFD12x6
kusano 7d535a
#define jpeg_fdct_10x5		jFD10x5
kusano 7d535a
#define jpeg_fdct_8x4		jFD8x4
kusano 7d535a
#define jpeg_fdct_6x3		jFD6x3
kusano 7d535a
#define jpeg_fdct_4x2		jFD4x2
kusano 7d535a
#define jpeg_fdct_2x1		jFD2x1
kusano 7d535a
#define jpeg_fdct_8x16		jFD8x16
kusano 7d535a
#define jpeg_fdct_7x14		jFD7x14
kusano 7d535a
#define jpeg_fdct_6x12		jFD6x12
kusano 7d535a
#define jpeg_fdct_5x10		jFD5x10
kusano 7d535a
#define jpeg_fdct_4x8		jFD4x8
kusano 7d535a
#define jpeg_fdct_3x6		jFD3x6
kusano 7d535a
#define jpeg_fdct_2x4		jFD2x4
kusano 7d535a
#define jpeg_fdct_1x2		jFD1x2
kusano 7d535a
#define jpeg_idct_islow		jRDislow
kusano 7d535a
#define jpeg_idct_ifast		jRDifast
kusano 7d535a
#define jpeg_idct_float		jRDfloat
kusano 7d535a
#define jpeg_idct_7x7		jRD7x7
kusano 7d535a
#define jpeg_idct_6x6		jRD6x6
kusano 7d535a
#define jpeg_idct_5x5		jRD5x5
kusano 7d535a
#define jpeg_idct_4x4		jRD4x4
kusano 7d535a
#define jpeg_idct_3x3		jRD3x3
kusano 7d535a
#define jpeg_idct_2x2		jRD2x2
kusano 7d535a
#define jpeg_idct_1x1		jRD1x1
kusano 7d535a
#define jpeg_idct_9x9		jRD9x9
kusano 7d535a
#define jpeg_idct_10x10		jRD10x10
kusano 7d535a
#define jpeg_idct_11x11		jRD11x11
kusano 7d535a
#define jpeg_idct_12x12		jRD12x12
kusano 7d535a
#define jpeg_idct_13x13		jRD13x13
kusano 7d535a
#define jpeg_idct_14x14		jRD14x14
kusano 7d535a
#define jpeg_idct_15x15		jRD15x15
kusano 7d535a
#define jpeg_idct_16x16		jRD16x16
kusano 7d535a
#define jpeg_idct_16x8		jRD16x8
kusano 7d535a
#define jpeg_idct_14x7		jRD14x7
kusano 7d535a
#define jpeg_idct_12x6		jRD12x6
kusano 7d535a
#define jpeg_idct_10x5		jRD10x5
kusano 7d535a
#define jpeg_idct_8x4		jRD8x4
kusano 7d535a
#define jpeg_idct_6x3		jRD6x3
kusano 7d535a
#define jpeg_idct_4x2		jRD4x2
kusano 7d535a
#define jpeg_idct_2x1		jRD2x1
kusano 7d535a
#define jpeg_idct_8x16		jRD8x16
kusano 7d535a
#define jpeg_idct_7x14		jRD7x14
kusano 7d535a
#define jpeg_idct_6x12		jRD6x12
kusano 7d535a
#define jpeg_idct_5x10		jRD5x10
kusano 7d535a
#define jpeg_idct_4x8		jRD4x8
kusano 7d535a
#define jpeg_idct_3x6		jRD3x8
kusano 7d535a
#define jpeg_idct_2x4		jRD2x4
kusano 7d535a
#define jpeg_idct_1x2		jRD1x2
kusano 7d535a
#endif /* NEED_SHORT_EXTERNAL_NAMES */
kusano 7d535a
kusano 7d535a
/* Extern declarations for the forward and inverse DCT routines. */
kusano 7d535a
kusano 7d535a
EXTERN(void) jpeg_fdct_islow
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_ifast
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_float
kusano 7d535a
    JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_7x7
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_6x6
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_5x5
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_4x4
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_3x3
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_2x2
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_1x1
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_9x9
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_10x10
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_11x11
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_12x12
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_13x13
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_14x14
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_15x15
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_16x16
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_16x8
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_14x7
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_12x6
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_10x5
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_8x4
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_6x3
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_4x2
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_2x1
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_8x16
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_7x14
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_6x12
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_5x10
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_4x8
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_3x6
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_2x4
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
EXTERN(void) jpeg_fdct_1x2
kusano 7d535a
    JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
kusano 7d535a
kusano 7d535a
EXTERN(void) jpeg_idct_islow
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_ifast
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_float
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_7x7
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_6x6
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_5x5
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_4x4
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_3x3
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_2x2
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_1x1
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_9x9
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_10x10
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_11x11
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_12x12
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_13x13
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_14x14
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_15x15
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_16x16
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_16x8
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_14x7
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_12x6
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_10x5
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_8x4
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_6x3
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_4x2
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_2x1
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_8x16
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_7x14
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_6x12
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_5x10
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_4x8
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_3x6
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_2x4
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
EXTERN(void) jpeg_idct_1x2
kusano 7d535a
    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
kusano 7d535a
	 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
kusano 7d535a
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * Macros for handling fixed-point arithmetic; these are used by many
kusano 7d535a
 * but not all of the DCT/IDCT modules.
kusano 7d535a
 *
kusano 7d535a
 * All values are expected to be of type INT32.
kusano 7d535a
 * Fractional constants are scaled left by CONST_BITS bits.
kusano 7d535a
 * CONST_BITS is defined within each module using these macros,
kusano 7d535a
 * and may differ from one module to the next.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#define ONE	((INT32) 1)
kusano 7d535a
#define CONST_SCALE (ONE << CONST_BITS)
kusano 7d535a
kusano 7d535a
/* Convert a positive real constant to an integer scaled by CONST_SCALE.
kusano 7d535a
 * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
kusano 7d535a
 * thus causing a lot of useless floating-point operations at run time.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#define FIX(x)	((INT32) ((x) * CONST_SCALE + 0.5))
kusano 7d535a
kusano 7d535a
/* Descale and correctly round an INT32 value that's scaled by N bits.
kusano 7d535a
 * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
kusano 7d535a
 * the fudge factor is correct for either sign of X.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
kusano 7d535a
kusano 7d535a
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
kusano 7d535a
 * This macro is used only when the two inputs will actually be no more than
kusano 7d535a
 * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
kusano 7d535a
 * full 32x32 multiply.  This provides a useful speedup on many machines.
kusano 7d535a
 * Unfortunately there is no way to specify a 16x16->32 multiply portably
kusano 7d535a
 * in C, but some C compilers will do the right thing if you provide the
kusano 7d535a
 * correct combination of casts.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
kusano 7d535a
#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT16) (const)))
kusano 7d535a
#endif
kusano 7d535a
#ifdef SHORTxLCONST_32		/* known to work with Microsoft C 6.0 */
kusano 7d535a
#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT32) (const)))
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
#ifndef MULTIPLY16C16		/* default definition */
kusano 7d535a
#define MULTIPLY16C16(var,const)  ((var) * (const))
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
/* Same except both inputs are variables. */
kusano 7d535a
kusano 7d535a
#ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
kusano 7d535a
#define MULTIPLY16V16(var1,var2)  (((INT16) (var1)) * ((INT16) (var2)))
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
#ifndef MULTIPLY16V16		/* default definition */
kusano 7d535a
#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))
kusano 7d535a
#endif