1/*
2 * simd/jsimd.h
3 *
4 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5 * Copyright 2011 D. R. Commander
6 * Copyright (C) 2013-2014, MIPS Technologies, Inc., California
7 * Copyright (C) 2014 Linaro Limited
8 *
9 * Based on the x86 SIMD extension for IJG JPEG library,
10 * Copyright (C) 1999-2006, MIYASAKA Masaru.
11 * For conditions of distribution and use, see copyright notice in jsimdext.inc
12 *
13 */
14
15/* Bitmask for supported acceleration methods */
16
17#define JSIMD_NONE       0x00
18#define JSIMD_MMX        0x01
19#define JSIMD_3DNOW      0x02
20#define JSIMD_SSE        0x04
21#define JSIMD_SSE2       0x08
22#define JSIMD_ARM_NEON   0x10
23#define JSIMD_MIPS_DSPR2 0x20
24
25/* SIMD Ext: retrieve SIMD/CPU information */
26EXTERN(unsigned int) jpeg_simd_cpu_support (void);
27
28/* RGB & extended RGB --> YCC Colorspace Conversion */
29EXTERN(void) jsimd_rgb_ycc_convert_mmx
30        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
31         JDIMENSION output_row, int num_rows);
32EXTERN(void) jsimd_extrgb_ycc_convert_mmx
33        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
34         JDIMENSION output_row, int num_rows);
35EXTERN(void) jsimd_extrgbx_ycc_convert_mmx
36        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
37         JDIMENSION output_row, int num_rows);
38EXTERN(void) jsimd_extbgr_ycc_convert_mmx
39        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
40         JDIMENSION output_row, int num_rows);
41EXTERN(void) jsimd_extbgrx_ycc_convert_mmx
42        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
43         JDIMENSION output_row, int num_rows);
44EXTERN(void) jsimd_extxbgr_ycc_convert_mmx
45        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
46         JDIMENSION output_row, int num_rows);
47EXTERN(void) jsimd_extxrgb_ycc_convert_mmx
48        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
49         JDIMENSION output_row, int num_rows);
50
51extern const int jconst_rgb_ycc_convert_sse2[];
52EXTERN(void) jsimd_rgb_ycc_convert_sse2
53        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
54         JDIMENSION output_row, int num_rows);
55EXTERN(void) jsimd_extrgb_ycc_convert_sse2
56        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
57         JDIMENSION output_row, int num_rows);
58EXTERN(void) jsimd_extrgbx_ycc_convert_sse2
59        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
60         JDIMENSION output_row, int num_rows);
61EXTERN(void) jsimd_extbgr_ycc_convert_sse2
62        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
63         JDIMENSION output_row, int num_rows);
64EXTERN(void) jsimd_extbgrx_ycc_convert_sse2
65        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
66         JDIMENSION output_row, int num_rows);
67EXTERN(void) jsimd_extxbgr_ycc_convert_sse2
68        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
69         JDIMENSION output_row, int num_rows);
70EXTERN(void) jsimd_extxrgb_ycc_convert_sse2
71        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
72         JDIMENSION output_row, int num_rows);
73
74EXTERN(void) jsimd_rgb_ycc_convert_neon
75        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
76         JDIMENSION output_row, int num_rows);
77EXTERN(void) jsimd_extrgb_ycc_convert_neon
78        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
79         JDIMENSION output_row, int num_rows);
80EXTERN(void) jsimd_extrgbx_ycc_convert_neon
81        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
82         JDIMENSION output_row, int num_rows);
83EXTERN(void) jsimd_extbgr_ycc_convert_neon
84        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
85         JDIMENSION output_row, int num_rows);
86EXTERN(void) jsimd_extbgrx_ycc_convert_neon
87        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
88         JDIMENSION output_row, int num_rows);
89EXTERN(void) jsimd_extxbgr_ycc_convert_neon
90        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
91         JDIMENSION output_row, int num_rows);
92EXTERN(void) jsimd_extxrgb_ycc_convert_neon
93        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
94         JDIMENSION output_row, int num_rows);
95
96EXTERN(void) jsimd_rgb_ycc_convert_mips_dspr2
97        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
98         JDIMENSION output_row, int num_rows);
99EXTERN(void) jsimd_extrgb_ycc_convert_mips_dspr2
100        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
101         JDIMENSION output_row, int num_rows);
102EXTERN(void) jsimd_extrgbx_ycc_convert_mips_dspr2
103        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
104         JDIMENSION output_row, int num_rows);
105EXTERN(void) jsimd_extbgr_ycc_convert_mips_dspr2
106        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
107         JDIMENSION output_row, int num_rows);
108EXTERN(void) jsimd_extbgrx_ycc_convert_mips_dspr2
109        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
110         JDIMENSION output_row, int num_rows);
111EXTERN(void) jsimd_extxbgr_ycc_convert_mips_dspr2
112        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
113         JDIMENSION output_row, int num_rows);
114EXTERN(void) jsimd_extxrgb_ycc_convert_mips_dspr2
115        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
116         JDIMENSION output_row, int num_rows);
117
118/* RGB & extended RGB --> Grayscale Colorspace Conversion */
119EXTERN(void) jsimd_rgb_gray_convert_mmx
120        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
121         JDIMENSION output_row, int num_rows);
122EXTERN(void) jsimd_extrgb_gray_convert_mmx
123        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
124         JDIMENSION output_row, int num_rows);
125EXTERN(void) jsimd_extrgbx_gray_convert_mmx
126        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
127         JDIMENSION output_row, int num_rows);
128EXTERN(void) jsimd_extbgr_gray_convert_mmx
129        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
130         JDIMENSION output_row, int num_rows);
131EXTERN(void) jsimd_extbgrx_gray_convert_mmx
132        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
133         JDIMENSION output_row, int num_rows);
134EXTERN(void) jsimd_extxbgr_gray_convert_mmx
135        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
136         JDIMENSION output_row, int num_rows);
137EXTERN(void) jsimd_extxrgb_gray_convert_mmx
138        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
139         JDIMENSION output_row, int num_rows);
140
141extern const int jconst_rgb_gray_convert_sse2[];
142EXTERN(void) jsimd_rgb_gray_convert_sse2
143        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
144         JDIMENSION output_row, int num_rows);
145EXTERN(void) jsimd_extrgb_gray_convert_sse2
146        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
147         JDIMENSION output_row, int num_rows);
148EXTERN(void) jsimd_extrgbx_gray_convert_sse2
149        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
150         JDIMENSION output_row, int num_rows);
151EXTERN(void) jsimd_extbgr_gray_convert_sse2
152        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
153         JDIMENSION output_row, int num_rows);
154EXTERN(void) jsimd_extbgrx_gray_convert_sse2
155        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
156         JDIMENSION output_row, int num_rows);
157EXTERN(void) jsimd_extxbgr_gray_convert_sse2
158        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
159         JDIMENSION output_row, int num_rows);
160EXTERN(void) jsimd_extxrgb_gray_convert_sse2
161        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
162         JDIMENSION output_row, int num_rows);
163
164EXTERN(void) jsimd_rgb_gray_convert_mips_dspr2
165        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
166         JDIMENSION output_row, int num_rows);
167EXTERN(void) jsimd_extrgb_gray_convert_mips_dspr2
168        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
169         JDIMENSION output_row, int num_rows);
170EXTERN(void) jsimd_extrgbx_gray_convert_mips_dspr2
171        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
172         JDIMENSION output_row, int num_rows);
173EXTERN(void) jsimd_extbgr_gray_convert_mips_dspr2
174        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
175         JDIMENSION output_row, int num_rows);
176EXTERN(void) jsimd_extbgrx_gray_convert_mips_dspr2
177        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
178         JDIMENSION output_row, int num_rows);
179EXTERN(void) jsimd_extxbgr_gray_convert_mips_dspr2
180        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
181         JDIMENSION output_row, int num_rows);
182EXTERN(void) jsimd_extxrgb_gray_convert_mips_dspr2
183        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
184         JDIMENSION output_row, int num_rows);
185
186/* YCC --> RGB & extended RGB Colorspace Conversion */
187EXTERN(void) jsimd_ycc_rgb_convert_mmx
188        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
189         JSAMPARRAY output_buf, int num_rows);
190EXTERN(void) jsimd_ycc_extrgb_convert_mmx
191        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
192         JSAMPARRAY output_buf, int num_rows);
193EXTERN(void) jsimd_ycc_extrgbx_convert_mmx
194        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
195         JSAMPARRAY output_buf, int num_rows);
196EXTERN(void) jsimd_ycc_extbgr_convert_mmx
197        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
198         JSAMPARRAY output_buf, int num_rows);
199EXTERN(void) jsimd_ycc_extbgrx_convert_mmx
200        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
201         JSAMPARRAY output_buf, int num_rows);
202EXTERN(void) jsimd_ycc_extxbgr_convert_mmx
203        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
204         JSAMPARRAY output_buf, int num_rows);
205EXTERN(void) jsimd_ycc_extxrgb_convert_mmx
206        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
207         JSAMPARRAY output_buf, int num_rows);
208
209extern const int jconst_ycc_rgb_convert_sse2[];
210EXTERN(void) jsimd_ycc_rgb_convert_sse2
211        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
212         JSAMPARRAY output_buf, int num_rows);
213EXTERN(void) jsimd_ycc_extrgb_convert_sse2
214        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
215         JSAMPARRAY output_buf, int num_rows);
216EXTERN(void) jsimd_ycc_extrgbx_convert_sse2
217        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
218         JSAMPARRAY output_buf, int num_rows);
219EXTERN(void) jsimd_ycc_extbgr_convert_sse2
220        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
221         JSAMPARRAY output_buf, int num_rows);
222EXTERN(void) jsimd_ycc_extbgrx_convert_sse2
223        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
224         JSAMPARRAY output_buf, int num_rows);
225EXTERN(void) jsimd_ycc_extxbgr_convert_sse2
226        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
227         JSAMPARRAY output_buf, int num_rows);
228EXTERN(void) jsimd_ycc_extxrgb_convert_sse2
229        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
230         JSAMPARRAY output_buf, int num_rows);
231
232EXTERN(void) jsimd_ycc_rgb_convert_neon
233        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
234         JSAMPARRAY output_buf, int num_rows);
235EXTERN(void) jsimd_ycc_extrgb_convert_neon
236        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
237         JSAMPARRAY output_buf, int num_rows);
238EXTERN(void) jsimd_ycc_extrgbx_convert_neon
239        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
240         JSAMPARRAY output_buf, int num_rows);
241EXTERN(void) jsimd_ycc_extbgr_convert_neon
242        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
243         JSAMPARRAY output_buf, int num_rows);
244EXTERN(void) jsimd_ycc_extbgrx_convert_neon
245        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
246         JSAMPARRAY output_buf, int num_rows);
247EXTERN(void) jsimd_ycc_extxbgr_convert_neon
248        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
249         JSAMPARRAY output_buf, int num_rows);
250EXTERN(void) jsimd_ycc_extxrgb_convert_neon
251        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
252         JSAMPARRAY output_buf, int num_rows);
253EXTERN(void) jsimd_ycc_rgb565_convert_neon
254        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
255         JSAMPARRAY output_buf, int num_rows);
256
257EXTERN(void) jsimd_ycc_rgb_convert_mips_dspr2
258        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
259         JSAMPARRAY output_buf, int num_rows);
260EXTERN(void) jsimd_ycc_extrgb_convert_mips_dspr2
261        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
262         JSAMPARRAY output_buf, int num_rows);
263EXTERN(void) jsimd_ycc_extrgbx_convert_mips_dspr2
264        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
265         JSAMPARRAY output_buf, int num_rows);
266EXTERN(void) jsimd_ycc_extbgr_convert_mips_dspr2
267        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
268         JSAMPARRAY output_buf, int num_rows);
269EXTERN(void) jsimd_ycc_extbgrx_convert_mips_dspr2
270        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
271         JSAMPARRAY output_buf, int num_rows);
272EXTERN(void) jsimd_ycc_extxbgr_convert_mips_dspr2
273        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
274         JSAMPARRAY output_buf, int num_rows);
275EXTERN(void) jsimd_ycc_extxrgb_convert_mips_dspr2
276        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
277         JSAMPARRAY output_buf, int num_rows);
278
279/* NULL Colorspace Conversion */
280EXTERN(void) jsimd_c_null_convert_mips_dspr2
281        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
282         JDIMENSION output_row, int num_rows, int num_components);
283
284/* h2v1 Downsampling */
285EXTERN(void) jsimd_h2v1_downsample_mmx
286        (JDIMENSION image_width, int max_v_samp_factor,
287         JDIMENSION v_samp_factor, JDIMENSION width_blocks,
288         JSAMPARRAY input_data, JSAMPARRAY output_data);
289
290EXTERN(void) jsimd_h2v1_downsample_sse2
291        (JDIMENSION image_width, int max_v_samp_factor,
292         JDIMENSION v_samp_factor, JDIMENSION width_blocks,
293         JSAMPARRAY input_data, JSAMPARRAY output_data);
294
295EXTERN(void) jsimd_h2v1_downsample_mips_dspr2
296        (JDIMENSION image_width, int max_v_samp_factor,
297         JDIMENSION v_samp_factor, JDIMENSION width_blocks,
298         JSAMPARRAY input_data, JSAMPARRAY output_data);
299
300/* h2v2 Downsampling */
301EXTERN(void) jsimd_h2v2_downsample_mmx
302        (JDIMENSION image_width, int max_v_samp_factor,
303         JDIMENSION v_samp_factor, JDIMENSION width_blocks,
304         JSAMPARRAY input_data, JSAMPARRAY output_data);
305
306EXTERN(void) jsimd_h2v2_downsample_sse2
307        (JDIMENSION image_width, int max_v_samp_factor,
308         JDIMENSION v_samp_factor, JDIMENSION width_blocks,
309         JSAMPARRAY input_data, JSAMPARRAY output_data);
310
311EXTERN(void) jsimd_h2v2_downsample_mips_dspr2
312        (JDIMENSION image_width, int max_v_samp_factor,
313         JDIMENSION v_samp_factor, JDIMENSION width_blocks,
314         JSAMPARRAY input_data, JSAMPARRAY output_data);
315
316/* h2v2 Smooth Downsampling */
317EXTERN(void) jsimd_h2v2_smooth_downsample_mips_dspr2
318        (JSAMPARRAY input_data, JSAMPARRAY output_data,
319         JDIMENSION v_samp_factor, int max_v_samp_factor,
320         int smoothing_factor, JDIMENSION width_blocks,
321         JDIMENSION image_width);
322
323
324/* Upsampling */
325EXTERN(void) jsimd_h2v1_upsample_mmx
326        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,
327         JSAMPARRAY * output_data_ptr);
328EXTERN(void) jsimd_h2v2_upsample_mmx
329        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,
330         JSAMPARRAY * output_data_ptr);
331
332EXTERN(void) jsimd_h2v1_upsample_sse2
333        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,
334         JSAMPARRAY * output_data_ptr);
335EXTERN(void) jsimd_h2v2_upsample_sse2
336        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,
337         JSAMPARRAY * output_data_ptr);
338
339EXTERN(void) jsimd_h2v1_upsample_mips_dspr2
340        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,
341         JSAMPARRAY * output_data_ptr);
342EXTERN(void) jsimd_h2v2_upsample_mips_dspr2
343        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,
344         JSAMPARRAY * output_data_ptr);
345
346EXTERN(void) jsimd_int_upsample_mips_dspr2
347        (UINT8 h_expand, UINT8 v_expand, JSAMPARRAY input_data,
348         JSAMPARRAY * output_data_ptr, JDIMENSION output_width,
349         int max_v_samp_factor);
350
351
352/* Fancy Upsampling */
353EXTERN(void) jsimd_h2v1_fancy_upsample_mmx
354        (int max_v_samp_factor, JDIMENSION downsampled_width,
355         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
356EXTERN(void) jsimd_h2v2_fancy_upsample_mmx
357        (int max_v_samp_factor, JDIMENSION downsampled_width,
358         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
359
360extern const int jconst_fancy_upsample_sse2[];
361EXTERN(void) jsimd_h2v1_fancy_upsample_sse2
362        (int max_v_samp_factor, JDIMENSION downsampled_width,
363         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
364EXTERN(void) jsimd_h2v2_fancy_upsample_sse2
365        (int max_v_samp_factor, JDIMENSION downsampled_width,
366         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
367
368EXTERN(void) jsimd_h2v1_fancy_upsample_neon
369        (int max_v_samp_factor, JDIMENSION downsampled_width,
370         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
371
372EXTERN(void) jsimd_h2v1_fancy_upsample_mips_dspr2
373        (int max_v_samp_factor, JDIMENSION downsampled_width,
374         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
375EXTERN(void) jsimd_h2v2_fancy_upsample_mips_dspr2
376        (int max_v_samp_factor, JDIMENSION downsampled_width,
377         JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr);
378
379/* Merged Upsampling */
380EXTERN(void) jsimd_h2v1_merged_upsample_mmx
381        (JDIMENSION output_width, JSAMPIMAGE input_buf,
382         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
383EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx
384        (JDIMENSION output_width, JSAMPIMAGE input_buf,
385         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
386EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx
387        (JDIMENSION output_width, JSAMPIMAGE input_buf,
388         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
389EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx
390        (JDIMENSION output_width, JSAMPIMAGE input_buf,
391         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
392EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx
393        (JDIMENSION output_width, JSAMPIMAGE input_buf,
394         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
395EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx
396        (JDIMENSION output_width, JSAMPIMAGE input_buf,
397         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
398EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx
399        (JDIMENSION output_width, JSAMPIMAGE input_buf,
400         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
401
402EXTERN(void) jsimd_h2v2_merged_upsample_mmx
403        (JDIMENSION output_width, JSAMPIMAGE input_buf,
404         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
405EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx
406        (JDIMENSION output_width, JSAMPIMAGE input_buf,
407         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
408EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx
409        (JDIMENSION output_width, JSAMPIMAGE input_buf,
410         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
411EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx
412        (JDIMENSION output_width, JSAMPIMAGE input_buf,
413         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
414EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx
415        (JDIMENSION output_width, JSAMPIMAGE input_buf,
416         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
417EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx
418        (JDIMENSION output_width, JSAMPIMAGE input_buf,
419         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
420EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx
421        (JDIMENSION output_width, JSAMPIMAGE input_buf,
422         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
423
424extern const int jconst_merged_upsample_sse2[];
425EXTERN(void) jsimd_h2v1_merged_upsample_sse2
426        (JDIMENSION output_width, JSAMPIMAGE input_buf,
427         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
428EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2
429        (JDIMENSION output_width, JSAMPIMAGE input_buf,
430         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
431EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2
432        (JDIMENSION output_width, JSAMPIMAGE input_buf,
433         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
434EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2
435        (JDIMENSION output_width, JSAMPIMAGE input_buf,
436         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
437EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2
438        (JDIMENSION output_width, JSAMPIMAGE input_buf,
439         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
440EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2
441        (JDIMENSION output_width, JSAMPIMAGE input_buf,
442         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
443EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2
444        (JDIMENSION output_width, JSAMPIMAGE input_buf,
445         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
446
447EXTERN(void) jsimd_h2v2_merged_upsample_sse2
448        (JDIMENSION output_width, JSAMPIMAGE input_buf,
449         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
450EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2
451        (JDIMENSION output_width, JSAMPIMAGE input_buf,
452         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
453EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2
454        (JDIMENSION output_width, JSAMPIMAGE input_buf,
455         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
456EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2
457        (JDIMENSION output_width, JSAMPIMAGE input_buf,
458         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
459EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2
460        (JDIMENSION output_width, JSAMPIMAGE input_buf,
461         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
462EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2
463        (JDIMENSION output_width, JSAMPIMAGE input_buf,
464         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
465EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2
466        (JDIMENSION output_width, JSAMPIMAGE input_buf,
467         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
468
469EXTERN(void) jsimd_h2v1_merged_upsample_mips_dspr2
470        (JDIMENSION output_width, JSAMPIMAGE input_buf,
471         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
472EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mips_dspr2
473        (JDIMENSION output_width, JSAMPIMAGE input_buf,
474         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
475EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2
476        (JDIMENSION output_width, JSAMPIMAGE input_buf,
477         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
478EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mips_dspr2
479        (JDIMENSION output_width, JSAMPIMAGE input_buf,
480         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
481EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2
482        (JDIMENSION output_width, JSAMPIMAGE input_buf,
483         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
484EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2
485        (JDIMENSION output_width, JSAMPIMAGE input_buf,
486         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
487EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2
488        (JDIMENSION output_width, JSAMPIMAGE input_buf,
489         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
490
491EXTERN(void) jsimd_h2v2_merged_upsample_mips_dspr2
492        (JDIMENSION output_width, JSAMPIMAGE input_buf,
493         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
494EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mips_dspr2
495        (JDIMENSION output_width, JSAMPIMAGE input_buf,
496         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
497EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2
498        (JDIMENSION output_width, JSAMPIMAGE input_buf,
499         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
500EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mips_dspr2
501        (JDIMENSION output_width, JSAMPIMAGE input_buf,
502         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
503EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2
504        (JDIMENSION output_width, JSAMPIMAGE input_buf,
505         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
506EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2
507        (JDIMENSION output_width, JSAMPIMAGE input_buf,
508         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
509EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2
510        (JDIMENSION output_width, JSAMPIMAGE input_buf,
511         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);
512
513/* Sample Conversion */
514EXTERN(void) jsimd_convsamp_mmx
515        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace);
516
517EXTERN(void) jsimd_convsamp_sse2
518        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace);
519
520EXTERN(void) jsimd_convsamp_neon
521        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace);
522
523EXTERN(void) jsimd_convsamp_mips_dspr2
524        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace);
525
526/* Floating Point Sample Conversion */
527EXTERN(void) jsimd_convsamp_float_3dnow
528        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace);
529
530EXTERN(void) jsimd_convsamp_float_sse
531        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace);
532
533EXTERN(void) jsimd_convsamp_float_sse2
534        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace);
535
536EXTERN(void) jsimd_convsamp_float_mips_dspr2
537        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace);
538
539/* Slow Integer Forward DCT */
540EXTERN(void) jsimd_fdct_islow_mmx (DCTELEM * data);
541
542extern const int jconst_fdct_islow_sse2[];
543EXTERN(void) jsimd_fdct_islow_sse2 (DCTELEM * data);
544
545EXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM * data);
546
547/* Fast Integer Forward DCT */
548EXTERN(void) jsimd_fdct_ifast_mmx (DCTELEM * data);
549
550extern const int jconst_fdct_ifast_sse2[];
551EXTERN(void) jsimd_fdct_ifast_sse2 (DCTELEM * data);
552
553EXTERN(void) jsimd_fdct_ifast_neon (DCTELEM * data);
554
555EXTERN(void) jsimd_fdct_ifast_mips_dspr2 (DCTELEM * data);
556
557/* Floating Point Forward DCT */
558EXTERN(void) jsimd_fdct_float_3dnow (FAST_FLOAT * data);
559
560extern const int jconst_fdct_float_sse[];
561EXTERN(void) jsimd_fdct_float_sse (FAST_FLOAT * data);
562
563/* Quantization */
564EXTERN(void) jsimd_quantize_mmx
565        (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace);
566
567EXTERN(void) jsimd_quantize_sse2
568        (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace);
569
570EXTERN(void) jsimd_quantize_neon
571        (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace);
572
573EXTERN(void) jsimd_quantize_mips_dspr2
574        (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace);
575
576/* Floating Point Quantization */
577EXTERN(void) jsimd_quantize_float_3dnow
578        (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace);
579
580EXTERN(void) jsimd_quantize_float_sse
581        (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace);
582
583EXTERN(void) jsimd_quantize_float_sse2
584        (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace);
585
586EXTERN(void) jsimd_quantize_float_mips_dspr2
587        (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace);
588
589/* Scaled Inverse DCT */
590EXTERN(void) jsimd_idct_2x2_mmx
591        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
592         JDIMENSION output_col);
593EXTERN(void) jsimd_idct_4x4_mmx
594        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
595         JDIMENSION output_col);
596
597extern const int jconst_idct_red_sse2[];
598EXTERN(void) jsimd_idct_2x2_sse2
599        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
600         JDIMENSION output_col);
601EXTERN(void) jsimd_idct_4x4_sse2
602        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
603         JDIMENSION output_col);
604
605EXTERN(void) jsimd_idct_2x2_neon
606        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
607         JDIMENSION output_col);
608EXTERN(void) jsimd_idct_4x4_neon
609        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
610         JDIMENSION output_col);
611
612EXTERN(void) jsimd_idct_2x2_mips_dspr2
613        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
614         JDIMENSION output_col);
615EXTERN(void) jsimd_idct_4x4_mips_dspr2
616        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
617         JDIMENSION output_col, int * workspace);
618EXTERN(void) jsimd_idct_6x6_mips_dspr2
619        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
620         JDIMENSION output_col);
621EXTERN(void) jsimd_idct_12x12_pass1_mips_dspr2
622        (JCOEFPTR coef_block, void * dct_table, int * workspace);
623EXTERN(void) jsimd_idct_12x12_pass2_mips_dspr2
624        (int * workspace, int * output);
625
626/* Slow Integer Inverse DCT */
627EXTERN(void) jsimd_idct_islow_mmx
628        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
629         JDIMENSION output_col);
630
631extern const int jconst_idct_islow_sse2[];
632EXTERN(void) jsimd_idct_islow_sse2
633        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
634         JDIMENSION output_col);
635
636EXTERN(void) jsimd_idct_islow_neon
637        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
638         JDIMENSION output_col);
639
640EXTERN(void) jsimd_idct_islow_mips_dspr2
641        (void * dct_table, JCOEFPTR coef_block, int * output_buf,
642         JSAMPLE * output_col);
643
644/* Fast Integer Inverse DCT */
645EXTERN(void) jsimd_idct_ifast_mmx
646        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
647         JDIMENSION output_col);
648
649extern const int jconst_idct_ifast_sse2[];
650EXTERN(void) jsimd_idct_ifast_sse2
651        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
652         JDIMENSION output_col);
653
654EXTERN(void) jsimd_idct_ifast_neon
655        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
656         JDIMENSION output_col);
657
658EXTERN(void) jsimd_idct_ifast_cols_mips_dspr2
659        (JCOEF * inptr, IFAST_MULT_TYPE * quantptr, DCTELEM * wsptr,
660         const int * idct_coefs);
661EXTERN(void) jsimd_idct_ifast_rows_mips_dspr2
662        (DCTELEM * wsptr, JSAMPARRAY output_buf, JDIMENSION output_col,
663         const int * idct_coefs);
664
665/* Floating Point Inverse DCT */
666EXTERN(void) jsimd_idct_float_3dnow
667        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
668         JDIMENSION output_col);
669
670extern const int jconst_idct_float_sse[];
671EXTERN(void) jsimd_idct_float_sse
672        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
673         JDIMENSION output_col);
674
675extern const int jconst_idct_float_sse2[];
676EXTERN(void) jsimd_idct_float_sse2
677        (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,
678         JDIMENSION output_col);
679