diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
| commit | 386b7d3366f1359a265da207a9cafa3edf553b64 (patch) | |
| tree | c76120c2c138faed822e4ae386be6ef22a738a78 /all_pairs/source/cjpeg_wrbmp/jpeglib.h | |
| parent | 54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff) | |
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'all_pairs/source/cjpeg_wrbmp/jpeglib.h')
| -rw-r--r-- | all_pairs/source/cjpeg_wrbmp/jpeglib.h | 869 |
1 files changed, 869 insertions, 0 deletions
diff --git a/all_pairs/source/cjpeg_wrbmp/jpeglib.h b/all_pairs/source/cjpeg_wrbmp/jpeglib.h new file mode 100644 index 0000000..ab3fba3 --- /dev/null +++ b/all_pairs/source/cjpeg_wrbmp/jpeglib.h | |||
| @@ -0,0 +1,869 @@ | |||
| 1 | /* | ||
| 2 | |||
| 3 | This program is part of the TACLeBench benchmark suite. | ||
| 4 | Version V 1.x | ||
| 5 | |||
| 6 | Name: jpeglib.h | ||
| 7 | |||
| 8 | Author: Thomas G. Lane. | ||
| 9 | |||
| 10 | This file is part of the Independent JPEG Group's software. | ||
| 11 | For conditions of distribution and use, see the accompanying README file. | ||
| 12 | |||
| 13 | This file defines the application interface for the JPEG library. | ||
| 14 | Most applications using the library need only include this file, | ||
| 15 | and perhaps jerror.h if they want to know the exact error codes. | ||
| 16 | |||
| 17 | Source: Independent JPEG Group's software | ||
| 18 | |||
| 19 | Changes: no major functional changes | ||
| 20 | |||
| 21 | License: See the accompanying README file | ||
| 22 | */ | ||
| 23 | |||
| 24 | |||
| 25 | #ifndef JPEGLIB_H | ||
| 26 | #define JPEGLIB_H | ||
| 27 | |||
| 28 | typedef int CJPEG_WRBMP_FILE; | ||
| 29 | typedef unsigned int cjpeg_wrbmp_size_x; | ||
| 30 | |||
| 31 | /* | ||
| 32 | First we include the configuration files that record how this | ||
| 33 | installation of the JPEG library is set up. jconfig.h can be | ||
| 34 | generated automatically for many systems. jmorecfg.h contains | ||
| 35 | manual configuration options that most people need not worry about. | ||
| 36 | */ | ||
| 37 | |||
| 38 | #ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ | ||
| 39 | #include "jconfig.h" /* widely used configuration options */ | ||
| 40 | #endif | ||
| 41 | #include "jmorecfg.h" /* seldom changed options */ | ||
| 42 | |||
| 43 | /* Data structures for images (arrays of samples and of DCT coefficients). | ||
| 44 | On 80x86 machines, the image arrays are too big for near pointers, | ||
| 45 | but the pointer arrays can fit in near memory. | ||
| 46 | */ | ||
| 47 | |||
| 48 | typedef CJPEG_WRBMP_JSAMPLE CJPEG_WRBMP_FAR | ||
| 49 | *CJPEG_WRBMP_JSAMPROW; /* ptr to one image row of pixel samples. */ | ||
| 50 | typedef CJPEG_WRBMP_JSAMPROW | ||
| 51 | *CJPEG_WRBMP_JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ | ||
| 52 | typedef CJPEG_WRBMP_JSAMPARRAY | ||
| 53 | *CJPEG_WRBMP_JSAMPIMAGE; /* a 3-D sample array: top index is color */ | ||
| 54 | |||
| 55 | typedef CJPEG_WRBMP_JCOEF | ||
| 56 | CJPEG_WRBMP_JBLOCK[64]; /* one block of coefficients */ | ||
| 57 | typedef CJPEG_WRBMP_JBLOCK CJPEG_WRBMP_FAR | ||
| 58 | *CJPEG_WRBMP_JBLOCKROW; /* pointer to one row of coefficient blocks */ | ||
| 59 | typedef CJPEG_WRBMP_JBLOCKROW | ||
| 60 | *CJPEG_WRBMP_JBLOCKARRAY; /* a 2-D array of coefficient blocks */ | ||
| 61 | typedef CJPEG_WRBMP_JBLOCKARRAY | ||
| 62 | *CJPEG_WRBMP_JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ | ||
| 63 | |||
| 64 | typedef CJPEG_WRBMP_JCOEF CJPEG_WRBMP_FAR | ||
| 65 | *JCOEFPTR; /* useful in a couple of places */ | ||
| 66 | |||
| 67 | |||
| 68 | /* Types for JPEG compression parameters and working tables. */ | ||
| 69 | |||
| 70 | |||
| 71 | /* DCT coefficient quantization tables. */ | ||
| 72 | |||
| 73 | typedef struct { | ||
| 74 | /* This array gives the coefficient quantizers in natural array order | ||
| 75 | (not the zigzag order in which they are stored in a JPEG DQT marker). | ||
| 76 | CAUTION: IJG versions prior to v6a kept this array in zigzag order. | ||
| 77 | */ | ||
| 78 | CJPEG_WRBMP_UINT16 | ||
| 79 | quantval[64]; /* quantization step for each coefficient */ | ||
| 80 | /* This field is used only during compression. It's initialized FALSE when | ||
| 81 | the table is created, and set TRUE when it's been output to the file. | ||
| 82 | You could suppress output of a table by setting this to TRUE. | ||
| 83 | (See jpeg_suppress_tables for an example.) | ||
| 84 | */ | ||
| 85 | cjpeg_wrbmp_boolean sent_table; /* TRUE when table has been output */ | ||
| 86 | } CJPEG_WRBMP_JQUANT_TBL; | ||
| 87 | |||
| 88 | |||
| 89 | /* Huffman coding tables. */ | ||
| 90 | |||
| 91 | typedef struct { | ||
| 92 | /* These two fields directly represent the contents of a JPEG DHT marker */ | ||
| 93 | CJPEG_WRBMP_UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ | ||
| 94 | /* length k bits; bits[0] is unused */ | ||
| 95 | CJPEG_WRBMP_UINT8 | ||
| 96 | huffval[256]; /* The symbols, in order of incr code length */ | ||
| 97 | /* This field is used only during compression. It's initialized FALSE when | ||
| 98 | the table is created, and set TRUE when it's been output to the file. | ||
| 99 | You could suppress output of a table by setting this to TRUE. | ||
| 100 | (See jpeg_suppress_tables for an example.) | ||
| 101 | */ | ||
| 102 | cjpeg_wrbmp_boolean sent_table; /* TRUE when table has been output */ | ||
| 103 | } CJPEG_WRBMP_JHUFF_TBL; | ||
| 104 | |||
| 105 | |||
| 106 | /* Basic info about one component (color channel). */ | ||
| 107 | |||
| 108 | typedef struct { | ||
| 109 | /* These values are fixed over the whole image. */ | ||
| 110 | /* For compression, they must be supplied by parameter setup; */ | ||
| 111 | /* for decompression, they are read from the SOF marker. */ | ||
| 112 | int component_id; /* identifier for this component (0..255) */ | ||
| 113 | int component_index; /* its index in SOF or cinfo->comp_info[] */ | ||
| 114 | int h_samp_factor; /* horizontal sampling factor (1..4) */ | ||
| 115 | int v_samp_factor; /* vertical sampling factor (1..4) */ | ||
| 116 | int quant_tbl_no; /* quantization table selector (0..3) */ | ||
| 117 | /* These values may vary between scans. */ | ||
| 118 | /* For compression, they must be supplied by parameter setup; */ | ||
| 119 | /* for decompression, they are read from the SOS marker. */ | ||
| 120 | /* The decompressor output side may not use these variables. */ | ||
| 121 | int dc_tbl_no; /* DC entropy table selector (0..3) */ | ||
| 122 | int ac_tbl_no; /* AC entropy table selector (0..3) */ | ||
| 123 | |||
| 124 | /* Remaining fields should be treated as private by applications. */ | ||
| 125 | |||
| 126 | /* These values are computed during compression or decompression startup: */ | ||
| 127 | /* Component's size in DCT blocks. | ||
| 128 | Any dummy blocks added to complete an MCU are not counted; therefore | ||
| 129 | these values do not depend on whether a scan is interleaved or not. | ||
| 130 | */ | ||
| 131 | CJPEG_WRBMP_JDIMENSION width_in_blocks; | ||
| 132 | CJPEG_WRBMP_JDIMENSION height_in_blocks; | ||
| 133 | /* Size of a DCT block in samples. Always DCTSIZE for compression. | ||
| 134 | For decompression this is the size of the output from one DCT block, | ||
| 135 | reflecting any scaling we choose to apply during the IDCT step. | ||
| 136 | Values of 1,2,4,8 are likely to be supported. Note that different | ||
| 137 | components may receive different IDCT scalings. | ||
| 138 | */ | ||
| 139 | int DCT_scaled_size; | ||
| 140 | /* The downsampled dimensions are the component's actual, unpadded number | ||
| 141 | of samples at the main buffer (preprocessing/compression interface), thus | ||
| 142 | downsampled_width = ceil(image_width * Hi/Hmax) | ||
| 143 | and similarly for height. For decompression, IDCT scaling is included, so | ||
| 144 | downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE) | ||
| 145 | */ | ||
| 146 | CJPEG_WRBMP_JDIMENSION downsampled_width; /* actual width in samples */ | ||
| 147 | CJPEG_WRBMP_JDIMENSION downsampled_height; /* actual height in samples */ | ||
| 148 | /* This flag is used only for decompression. In cases where some of the | ||
| 149 | components will be ignored (eg grayscale output from YCbCr image), | ||
| 150 | we can skip most computations for the unused components. | ||
| 151 | */ | ||
| 152 | cjpeg_wrbmp_boolean | ||
| 153 | component_needed; /* do we need the value of this component? */ | ||
| 154 | |||
| 155 | /* These values are computed before starting a scan of the component. */ | ||
| 156 | /* The decompressor output side may not use these variables. */ | ||
| 157 | int MCU_width; /* number of blocks per MCU, horizontally */ | ||
| 158 | int MCU_height; /* number of blocks per MCU, vertically */ | ||
| 159 | int MCU_blocks; /* MCU_width * MCU_height */ | ||
| 160 | int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */ | ||
| 161 | int last_col_width; /* # of non-dummy blocks across in last MCU */ | ||
| 162 | int last_row_height; /* # of non-dummy blocks down in last MCU */ | ||
| 163 | |||
| 164 | /* Saved quantization table for component; NULL if none yet saved. | ||
| 165 | See jdinput.c comments about the need for this information. | ||
| 166 | This field is currently used only for decompression. | ||
| 167 | */ | ||
| 168 | CJPEG_WRBMP_JQUANT_TBL *quant_table; | ||
| 169 | |||
| 170 | /* Private per-component storage for DCT or IDCT subsystem. */ | ||
| 171 | void *dct_table; | ||
| 172 | } cjpeg_wrbmp_jpeg_component_info; | ||
| 173 | |||
| 174 | |||
| 175 | /* The script for encoding a multiple-scan file is an array of these: */ | ||
| 176 | |||
| 177 | typedef struct { | ||
| 178 | int comps_in_scan; /* number of components encoded in this scan */ | ||
| 179 | int component_index[4]; /* their SOF/comp_info[] indexes */ | ||
| 180 | int Ss, Se; /* progressive JPEG spectral selection parms */ | ||
| 181 | int Ah, Al; /* progressive JPEG successive approx. parms */ | ||
| 182 | } cjpeg_wrbmp_jpeg_scan_info; | ||
| 183 | |||
| 184 | /* The decompressor can save APPn and COM markers in a list of these: */ | ||
| 185 | |||
| 186 | typedef struct cjpeg_wrbmp_jpeg_marker_struct CJPEG_WRBMP_FAR | ||
| 187 | *jpeg_saved_marker_ptr; | ||
| 188 | |||
