Imported Upstream version 3.0.1
[platform/upstream/libjpeg-turbo.git] / jsamplecomp.h
1 /*
2  * jsamplecomp.h
3  *
4  * Copyright (C) 2022, D. R. Commander.
5  * For conditions of distribution and use, see the accompanying README.ijg
6  * file.
7  */
8
9 /* In source files that must be compiled for multiple data precisions, we
10  * prefix all precision-dependent data types, macros, methods, fields, and
11  * function names with an underscore.  Including this file replaces those
12  * precision-independent tokens with their precision-dependent equivalents,
13  * based on the value of BITS_IN_JSAMPLE.
14  */
15
16 #ifndef JSAMPLECOMP_H
17 #define JSAMPLECOMP_H
18
19 #if BITS_IN_JSAMPLE == 16
20
21 /* Sample data types and macros (jmorecfg.h) */
22 #define _JSAMPLE  J16SAMPLE
23
24 #define _MAXJSAMPLE  MAXJ16SAMPLE
25 #define _CENTERJSAMPLE   CENTERJ16SAMPLE
26
27 #define _JSAMPROW  J16SAMPROW
28 #define _JSAMPARRAY  J16SAMPARRAY
29 #define _JSAMPIMAGE  J16SAMPIMAGE
30
31 /* External functions (jpeglib.h) */
32 #define _jpeg_write_scanlines  jpeg16_write_scanlines
33 #define _jpeg_read_scanlines  jpeg16_read_scanlines
34
35 /* Internal methods (jpegint.h) */
36
37 #ifdef C_LOSSLESS_SUPPORTED
38 /* Use the 16-bit method in the jpeg_c_main_controller structure. */
39 #define _process_data  process_data_16
40 /* Use the 16-bit method in the jpeg_c_prep_controller structure. */
41 #define _pre_process_data  pre_process_data_16
42 /* Use the 16-bit method in the jpeg_c_coef_controller structure. */
43 #define _compress_data  compress_data_16
44 /* Use the 16-bit method in the jpeg_color_converter structure. */
45 #define _color_convert  color_convert_16
46 /* Use the 16-bit method in the jpeg_downsampler structure. */
47 #define _downsample  downsample_16
48 #endif
49 #ifdef D_LOSSLESS_SUPPORTED
50 /* Use the 16-bit method in the jpeg_d_main_controller structure. */
51 #define _process_data  process_data_16
52 /* Use the 16-bit method in the jpeg_d_coef_controller structure. */
53 #define _decompress_data  decompress_data_16
54 /* Use the 16-bit method in the jpeg_d_post_controller structure. */
55 #define _post_process_data  post_process_data_16
56 /* Use the 16-bit method in the jpeg_upsampler structure. */
57 #define _upsample  upsample_16
58 /* Use the 16-bit method in the jpeg_color_converter structure. */
59 #define _color_convert  color_convert_16
60 #endif
61
62 /* Global internal functions (jpegint.h) */
63 #ifdef C_LOSSLESS_SUPPORTED
64 #define _jinit_c_main_controller  j16init_c_main_controller
65 #define _jinit_c_prep_controller  j16init_c_prep_controller
66 #define _jinit_color_converter  j16init_color_converter
67 #define _jinit_downsampler  j16init_downsampler
68 #define _jinit_c_diff_controller  j16init_c_diff_controller
69 #define _jinit_lossless_compressor  j16init_lossless_compressor
70 #endif
71
72 #ifdef D_LOSSLESS_SUPPORTED
73 #define _jinit_d_main_controller  j16init_d_main_controller
74 #define _jinit_d_post_controller  j16init_d_post_controller
75 #define _jinit_upsampler  j16init_upsampler
76 #define _jinit_color_deconverter  j16init_color_deconverter
77 #define _jinit_merged_upsampler  j16init_merged_upsampler
78 #define _jinit_d_diff_controller  j16init_d_diff_controller
79 #define _jinit_lossless_decompressor  j16init_lossless_decompressor
80 #endif
81
82 #if defined(C_LOSSLESS_SUPPORTED) || defined(D_LOSSLESS_SUPPORTED)
83 #define _jcopy_sample_rows  j16copy_sample_rows
84 #endif
85
86 /* Internal fields (cdjpeg.h) */
87
88 #if defined(C_LOSSLESS_SUPPORTED) || defined(D_LOSSLESS_SUPPORTED)
89 /* Use the 16-bit buffer in the cjpeg_source_struct and djpeg_dest_struct
90    structures. */
91 #define _buffer  buffer16
92 #endif
93
94 /* Image I/O functions (cdjpeg.h) */
95 #ifdef C_LOSSLESS_SUPPORTED
96 #define _jinit_read_gif  j16init_read_gif
97 #define _jinit_read_ppm  j16init_read_ppm
98 #endif
99
100 #ifdef D_LOSSLESS_SUPPORTED
101 #define _jinit_write_ppm  j16init_write_ppm
102 #endif
103
104 #elif BITS_IN_JSAMPLE == 12
105
106 /* Sample data types and macros (jmorecfg.h) */
107 #define _JSAMPLE  J12SAMPLE
108
109 #define _MAXJSAMPLE  MAXJ12SAMPLE
110 #define _CENTERJSAMPLE   CENTERJ12SAMPLE
111
112 #define _JSAMPROW  J12SAMPROW
113 #define _JSAMPARRAY  J12SAMPARRAY
114 #define _JSAMPIMAGE  J12SAMPIMAGE
115
116 /* External functions (jpeglib.h) */
117 #define _jpeg_write_scanlines  jpeg12_write_scanlines
118 #define _jpeg_write_raw_data  jpeg12_write_raw_data
119 #define _jpeg_read_scanlines  jpeg12_read_scanlines
120 #define _jpeg_skip_scanlines  jpeg12_skip_scanlines
121 #define _jpeg_crop_scanline  jpeg12_crop_scanline
122 #define _jpeg_read_raw_data  jpeg12_read_raw_data
123
124 /* Internal methods (jpegint.h) */
125
126 /* Use the 12-bit method in the jpeg_c_main_controller structure. */
127 #define _process_data  process_data_12
128 /* Use the 12-bit method in the jpeg_c_prep_controller structure. */
129 #define _pre_process_data  pre_process_data_12
130 /* Use the 12-bit method in the jpeg_c_coef_controller structure. */
131 #define _compress_data  compress_data_12
132 /* Use the 12-bit method in the jpeg_color_converter structure. */
133 #define _color_convert  color_convert_12
134 /* Use the 12-bit method in the jpeg_downsampler structure. */
135 #define _downsample  downsample_12
136 /* Use the 12-bit method in the jpeg_forward_dct structure. */
137 #define _forward_DCT  forward_DCT_12
138 /* Use the 12-bit method in the jpeg_d_main_controller structure. */
139 #define _process_data  process_data_12
140 /* Use the 12-bit method in the jpeg_d_coef_controller structure. */
141 #define _decompress_data  decompress_data_12
142 /* Use the 12-bit method in the jpeg_d_post_controller structure. */
143 #define _post_process_data  post_process_data_12
144 /* Use the 12-bit method in the jpeg_inverse_dct structure. */
145 #define _inverse_DCT_method_ptr  inverse_DCT_12_method_ptr
146 #define _inverse_DCT  inverse_DCT_12
147 /* Use the 12-bit method in the jpeg_upsampler structure. */
148 #define _upsample  upsample_12
149 /* Use the 12-bit method in the jpeg_color_converter structure. */
150 #define _color_convert  color_convert_12
151 /* Use the 12-bit method in the jpeg_color_quantizer structure. */
152 #define _color_quantize  color_quantize_12
153
154 /* Global internal functions (jpegint.h) */
155 #define _jinit_c_main_controller  j12init_c_main_controller
156 #define _jinit_c_prep_controller  j12init_c_prep_controller
157 #define _jinit_c_coef_controller  j12init_c_coef_controller
158 #define _jinit_color_converter  j12init_color_converter
159 #define _jinit_downsampler  j12init_downsampler
160 #define _jinit_forward_dct  j12init_forward_dct
161 #ifdef C_LOSSLESS_SUPPORTED
162 #define _jinit_c_diff_controller  j12init_c_diff_controller
163 #define _jinit_lossless_compressor  j12init_lossless_compressor
164 #endif
165
166 #define _jinit_d_main_controller  j12init_d_main_controller
167 #define _jinit_d_coef_controller  j12init_d_coef_controller
168 #define _jinit_d_post_controller  j12init_d_post_controller
169 #define _jinit_inverse_dct  j12init_inverse_dct
170 #define _jinit_upsampler  j12init_upsampler
171 #define _jinit_color_deconverter  j12init_color_deconverter
172 #define _jinit_1pass_quantizer  j12init_1pass_quantizer
173 #define _jinit_2pass_quantizer  j12init_2pass_quantizer
174 #define _jinit_merged_upsampler  j12init_merged_upsampler
175 #ifdef D_LOSSLESS_SUPPORTED
176 #define _jinit_d_diff_controller  j12init_d_diff_controller
177 #define _jinit_lossless_decompressor  j12init_lossless_decompressor
178 #endif
179
180 #define _jcopy_sample_rows  j12copy_sample_rows
181
182 /* Global internal functions (jdct.h) */
183 #define _jpeg_fdct_islow  jpeg12_fdct_islow
184 #define _jpeg_fdct_ifast  jpeg12_fdct_ifast
185
186 #define _jpeg_idct_islow  jpeg12_idct_islow
187 #define _jpeg_idct_ifast  jpeg12_idct_ifast
188 #define _jpeg_idct_float  jpeg12_idct_float
189 #define _jpeg_idct_7x7  jpeg12_idct_7x7
190 #define _jpeg_idct_6x6  jpeg12_idct_6x6
191 #define _jpeg_idct_5x5  jpeg12_idct_5x5
192 #define _jpeg_idct_4x4  jpeg12_idct_4x4
193 #define _jpeg_idct_3x3  jpeg12_idct_3x3
194 #define _jpeg_idct_2x2  jpeg12_idct_2x2
195 #define _jpeg_idct_1x1  jpeg12_idct_1x1
196 #define _jpeg_idct_9x9  jpeg12_idct_9x9
197 #define _jpeg_idct_10x10  jpeg12_idct_10x10
198 #define _jpeg_idct_11x11  jpeg12_idct_11x11
199 #define _jpeg_idct_12x12  jpeg12_idct_12x12
200 #define _jpeg_idct_13x13  jpeg12_idct_13x13
201 #define _jpeg_idct_14x14  jpeg12_idct_14x14
202 #define _jpeg_idct_15x15  jpeg12_idct_15x15
203 #define _jpeg_idct_16x16  jpeg12_idct_16x16
204
205 /* Internal fields (cdjpeg.h) */
206
207 /* Use the 12-bit buffer in the cjpeg_source_struct and djpeg_dest_struct
208    structures. */
209 #define _buffer  buffer12
210
211 /* Image I/O functions (cdjpeg.h) */
212 #define _jinit_read_gif  j12init_read_gif
213 #define _jinit_write_gif  j12init_write_gif
214 #define _jinit_read_ppm  j12init_read_ppm
215 #define _jinit_write_ppm  j12init_write_ppm
216
217 #define _read_color_map  read_color_map_12
218
219 #else /* BITS_IN_JSAMPLE */
220
221 /* Sample data types and macros (jmorecfg.h) */
222 #define _JSAMPLE  JSAMPLE
223
224 #define _MAXJSAMPLE  MAXJSAMPLE
225 #define _CENTERJSAMPLE   CENTERJSAMPLE
226
227 #define _JSAMPROW  JSAMPROW
228 #define _JSAMPARRAY  JSAMPARRAY
229 #define _JSAMPIMAGE  JSAMPIMAGE
230
231 /* External functions (jpeglib.h) */
232 #define _jpeg_write_scanlines  jpeg_write_scanlines
233 #define _jpeg_write_raw_data  jpeg_write_raw_data
234 #define _jpeg_read_scanlines  jpeg_read_scanlines
235 #define _jpeg_skip_scanlines  jpeg_skip_scanlines
236 #define _jpeg_crop_scanline  jpeg_crop_scanline
237 #define _jpeg_read_raw_data  jpeg_read_raw_data
238
239 /* Internal methods (jpegint.h) */
240
241 /* Use the 8-bit method in the jpeg_c_main_controller structure. */
242 #define _process_data  process_data
243 /* Use the 8-bit method in the jpeg_c_prep_controller structure. */
244 #define _pre_process_data  pre_process_data
245 /* Use the 8-bit method in the jpeg_c_coef_controller structure. */
246 #define _compress_data  compress_data
247 /* Use the 8-bit method in the jpeg_color_converter structure. */
248 #define _color_convert  color_convert
249 /* Use the 8-bit method in the jpeg_downsampler structure. */
250 #define _downsample  downsample
251 /* Use the 8-bit method in the jpeg_forward_dct structure. */
252 #define _forward_DCT  forward_DCT
253 /* Use the 8-bit method in the jpeg_d_main_controller structure. */
254 #define _process_data  process_data
255 /* Use the 8-bit method in the jpeg_d_coef_controller structure. */
256 #define _decompress_data  decompress_data
257 /* Use the 8-bit method in the jpeg_d_post_controller structure. */
258 #define _post_process_data  post_process_data
259 /* Use the 8-bit method in the jpeg_inverse_dct structure. */
260 #define _inverse_DCT_method_ptr  inverse_DCT_method_ptr
261 #define _inverse_DCT  inverse_DCT
262 /* Use the 8-bit method in the jpeg_upsampler structure. */
263 #define _upsample  upsample
264 /* Use the 8-bit method in the jpeg_color_converter structure. */
265 #define _color_convert  color_convert
266 /* Use the 8-bit method in the jpeg_color_quantizer structure. */
267 #define _color_quantize  color_quantize
268
269 /* Global internal functions (jpegint.h) */
270 #define _jinit_c_main_controller  jinit_c_main_controller
271 #define _jinit_c_prep_controller  jinit_c_prep_controller
272 #define _jinit_c_coef_controller  jinit_c_coef_controller
273 #define _jinit_color_converter  jinit_color_converter
274 #define _jinit_downsampler  jinit_downsampler
275 #define _jinit_forward_dct  jinit_forward_dct
276 #ifdef C_LOSSLESS_SUPPORTED
277 #define _jinit_c_diff_controller  jinit_c_diff_controller
278 #define _jinit_lossless_compressor  jinit_lossless_compressor
279 #endif
280
281 #define _jinit_d_main_controller  jinit_d_main_controller
282 #define _jinit_d_coef_controller  jinit_d_coef_controller
283 #define _jinit_d_post_controller  jinit_d_post_controller
284 #define _jinit_inverse_dct  jinit_inverse_dct
285 #define _jinit_upsampler  jinit_upsampler
286 #define _jinit_color_deconverter  jinit_color_deconverter
287 #define _jinit_1pass_quantizer  jinit_1pass_quantizer
288 #define _jinit_2pass_quantizer  jinit_2pass_quantizer
289 #define _jinit_merged_upsampler  jinit_merged_upsampler
290 #ifdef D_LOSSLESS_SUPPORTED
291 #define _jinit_d_diff_controller  jinit_d_diff_controller
292 #define _jinit_lossless_decompressor  jinit_lossless_decompressor
293 #endif
294
295 #define _jcopy_sample_rows  jcopy_sample_rows
296
297 /* Global internal functions (jdct.h) */
298 #define _jpeg_fdct_islow  jpeg_fdct_islow
299 #define _jpeg_fdct_ifast  jpeg_fdct_ifast
300
301 #define _jpeg_idct_islow  jpeg_idct_islow
302 #define _jpeg_idct_ifast  jpeg_idct_ifast
303 #define _jpeg_idct_float  jpeg_idct_float
304 #define _jpeg_idct_7x7  jpeg_idct_7x7
305 #define _jpeg_idct_6x6  jpeg_idct_6x6
306 #define _jpeg_idct_5x5  jpeg_idct_5x5
307 #define _jpeg_idct_4x4  jpeg_idct_4x4
308 #define _jpeg_idct_3x3  jpeg_idct_3x3
309 #define _jpeg_idct_2x2  jpeg_idct_2x2
310 #define _jpeg_idct_1x1  jpeg_idct_1x1
311 #define _jpeg_idct_9x9  jpeg_idct_9x9
312 #define _jpeg_idct_10x10  jpeg_idct_10x10
313 #define _jpeg_idct_11x11  jpeg_idct_11x11
314 #define _jpeg_idct_12x12  jpeg_idct_12x12
315 #define _jpeg_idct_13x13  jpeg_idct_13x13
316 #define _jpeg_idct_14x14  jpeg_idct_14x14
317 #define _jpeg_idct_15x15  jpeg_idct_15x15
318 #define _jpeg_idct_16x16  jpeg_idct_16x16
319
320 /* Internal fields (cdjpeg.h) */
321
322 /* Use the 8-bit buffer in the cjpeg_source_struct and djpeg_dest_struct
323    structures. */
324 #define _buffer  buffer
325
326 /* Image I/O functions (cdjpeg.h) */
327 #define _jinit_read_gif  jinit_read_gif
328 #define _jinit_write_gif  jinit_write_gif
329 #define _jinit_read_ppm  jinit_read_ppm
330 #define _jinit_write_ppm  jinit_write_ppm
331
332 #define _read_color_map  read_color_map
333
334 #endif /* BITS_IN_JSAMPLE */
335
336 #endif /* JSAMPLECOMP_H */