• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * simd/jsimd.h
3  *
4  * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5  * Copyright 2011 D. R. Commander
6  *
7  * Based on the x86 SIMD extension for IJG JPEG library,
8  * Copyright (C) 1999-2006, MIYASAKA Masaru.
9  * For conditions of distribution and use, see copyright notice in jsimdext.inc
10  *
11  */
12 
13 /* Bitmask for supported acceleration methods */
14 
15 #define JSIMD_NONE       0x00
16 #define JSIMD_MMX        0x01
17 #define JSIMD_3DNOW      0x02
18 #define JSIMD_SSE        0x04
19 #define JSIMD_SSE2       0x08
20 #define JSIMD_ARM_NEON   0x10
21 
22 /* Short forms of external names for systems with brain-damaged linkers. */
23 
24 #ifdef NEED_SHORT_EXTERNAL_NAMES
25 #define jpeg_simd_cpu_support                 jSiCpuSupport
26 #define jsimd_rgb_ycc_convert_mmx             jSRGBYCCM
27 #define jsimd_extrgb_ycc_convert_mmx          jSEXTRGBYCCM
28 #define jsimd_extrgbx_ycc_convert_mmx         jSEXTRGBXYCCM
29 #define jsimd_extbgr_ycc_convert_mmx          jSEXTBGRYCCM
30 #define jsimd_extbgrx_ycc_convert_mmx         jSEXTBGRXYCCM
31 #define jsimd_extxbgr_ycc_convert_mmx         jSEXTXBGRYCCM
32 #define jsimd_extxrgb_ycc_convert_mmx         jSEXTXRGBYCCM
33 #define jsimd_rgb_gray_convert_mmx            jSRGBGRYM
34 #define jsimd_extrgb_gray_convert_mmx         jSEXTRGBGRYM
35 #define jsimd_extrgbx_gray_convert_mmx        jSEXTRGBXGRYM
36 #define jsimd_extbgr_gray_convert_mmx         jSEXTBGRGRYM
37 #define jsimd_extbgrx_gray_convert_mmx        jSEXTBGRXGRYM
38 #define jsimd_extxbgr_gray_convert_mmx        jSEXTXBGRGRYM
39 #define jsimd_extxrgb_gray_convert_mmx        jSEXTXRGBGRYM
40 #define jsimd_ycc_rgb_convert_mmx             jSYCCRGBM
41 #define jsimd_ycc_extrgb_convert_mmx          jSYCCEXTRGBM
42 #define jsimd_ycc_extrgbx_convert_mmx         jSYCCEXTRGBXM
43 #define jsimd_ycc_extbgr_convert_mmx          jSYCCEXTBGRM
44 #define jsimd_ycc_extbgrx_convert_mmx         jSYCCEXTBGRXM
45 #define jsimd_ycc_extxbgr_convert_mmx         jSYCCEXTXBGRM
46 #define jsimd_ycc_extxrgb_convert_mmx         jSYCCEXTXRGBM
47 #define jconst_rgb_ycc_convert_sse2           jSCRGBYCCS2
48 #define jsimd_rgb_ycc_convert_sse2            jSRGBYCCS2
49 #define jsimd_extrgb_ycc_convert_sse2         jSEXTRGBYCCS2
50 #define jsimd_extrgbx_ycc_convert_sse2        jSEXTRGBXYCCS2
51 #define jsimd_extbgr_ycc_convert_sse2         jSEXTBGRYCCS2
52 #define jsimd_extbgrx_ycc_convert_sse2        jSEXTBGRXYCCS2
53 #define jsimd_extxbgr_ycc_convert_sse2        jSEXTXBGRYCCS2
54 #define jsimd_extxrgb_ycc_convert_sse2        jSEXTXRGBYCCS2
55 #define jconst_rgb_gray_convert_sse2          jSCRGBGRYS2
56 #define jsimd_rgb_gray_convert_sse2           jSRGBGRYS2
57 #define jsimd_extrgb_gray_convert_sse2        jSEXTRGBGRYS2
58 #define jsimd_extrgbx_gray_convert_sse2       jSEXTRGBXGRYS2
59 #define jsimd_extbgr_gray_convert_sse2        jSEXTBGRGRYS2
60 #define jsimd_extbgrx_gray_convert_sse2       jSEXTBGRXGRYS2
61 #define jsimd_extxbgr_gray_convert_sse2       jSEXTXBGRGRYS2
62 #define jsimd_extxrgb_gray_convert_sse2       jSEXTXRGBGRYS2
63 #define jconst_ycc_rgb_convert_sse2           jSCYCCRGBS2
64 #define jsimd_ycc_rgb_convert_sse2            jSYCCRGBS2
65 #define jsimd_ycc_extrgb_convert_sse2         jSYCCEXTRGBS2
66 #define jsimd_ycc_extrgbx_convert_sse2        jSYCCEXTRGBXS2
67 #define jsimd_ycc_extbgr_convert_sse2         jSYCCEXTBGRS2
68 #define jsimd_ycc_extbgrx_convert_sse2        jSYCCEXTBGRXS2
69 #define jsimd_ycc_extxbgr_convert_sse2        jSYCCEXTXBGRS2
70 #define jsimd_ycc_extxrgb_convert_sse2        jSYCCEXTXRGBS2
71 #define jsimd_h2v2_downsample_mmx             jSDnH2V2M
72 #define jsimd_h2v1_downsample_mmx             jSDnH2V1M
73 #define jsimd_h2v2_downsample_sse2            jSDnH2V2S2
74 #define jsimd_h2v1_downsample_sse2            jSDnH2V1S2
75 #define jsimd_h2v2_upsample_mmx               jSUpH2V2M
76 #define jsimd_h2v1_upsample_mmx               jSUpH2V1M
77 #define jsimd_h2v2_fancy_upsample_mmx         jSFUpH2V2M
78 #define jsimd_h2v1_fancy_upsample_mmx         jSFUpH2V1M
79 #define jsimd_h2v2_merged_upsample_mmx        jSMUpH2V2M
80 #define jsimd_h2v2_extrgb_merged_upsample_mmx jSMUpH2V2EXTRGBM
81 #define jsimd_h2v2_extrgbx_merged_upsample_mmx jSMUpH2V2EXTRGBXM
82 #define jsimd_h2v2_extbgr_merged_upsample_mmx jSMUpH2V2EXTBGRM
83 #define jsimd_h2v2_extbgrx_merged_upsample_mmx jSMUpH2V2EXTBGRXM
84 #define jsimd_h2v2_extxbgr_merged_upsample_mmx jSMUpH2V2EXTXBGRM
85 #define jsimd_h2v2_extxrgb_merged_upsample_mmx jSMUpH2V2EXTXRGBM
86 #define jsimd_h2v1_merged_upsample_mmx        jSMUpH2V1M
87 #define jsimd_h2v1_extrgb_merged_upsample_mmx jSMUpH2V1EXTRGBM
88 #define jsimd_h2v1_extrgbx_merged_upsample_mmx jSMUpH2V1EXTRGBXM
89 #define jsimd_h2v1_extbgr_merged_upsample_mmx jSMUpH2V1EXTBGRM
90 #define jsimd_h2v1_extbgrx_merged_upsample_mmx jSMUpH2V1EXTBGRXM
91 #define jsimd_h2v1_extxbgr_merged_upsample_mmx jSMUpH2V1EXTXBGRM
92 #define jsimd_h2v1_extxrgb_merged_upsample_mmx jSMUpH2V1EXTXRGBM
93 #define jsimd_h2v2_upsample_sse2              jSUpH2V2S2
94 #define jsimd_h2v1_upsample_sse2              jSUpH2V1S2
95 #define jconst_fancy_upsample_sse2            jSCFUpS2
96 #define jsimd_h2v2_fancy_upsample_sse2        jSFUpH2V2S2
97 #define jsimd_h2v1_fancy_upsample_sse2        jSFUpH2V1S2
98 #define jconst_merged_upsample_sse2           jSCMUpS2
99 #define jsimd_h2v2_merged_upsample_sse2       jSMUpH2V2S2
100 #define jsimd_h2v2_extrgb_merged_upsample_sse2 jSMUpH2V2EXTRGBS2
101 #define jsimd_h2v2_extrgbx_merged_upsample_sse2 jSMUpH2V2EXTRGBXS2
102 #define jsimd_h2v2_extbgr_merged_upsample_sse2 jSMUpH2V2EXTBGRS2
103 #define jsimd_h2v2_extbgrx_merged_upsample_sse2 jSMUpH2V2EXTBGRXS2
104 #define jsimd_h2v2_extxbgr_merged_upsample_sse2 jSMUpH2V2EXTXBGRS2
105 #define jsimd_h2v2_extxrgb_merged_upsample_sse2 jSMUpH2V2EXTXRGBS2
106 #define jsimd_h2v1_merged_upsample_sse2       jSMUpH2V1S2
107 #define jsimd_h2v1_extrgb_merged_upsample_sse2 jSMUpH2V1EXTRGBS2
108 #define jsimd_h2v1_extrgbx_merged_upsample_sse2 jSMUpH2V1EXTRGBXS2
109 #define jsimd_h2v1_extbgr_merged_upsample_sse2 jSMUpH2V1EXTBGRS2
110 #define jsimd_h2v1_extbgrx_merged_upsample_sse2 jSMUpH2V1EXTBGRXS2
111 #define jsimd_h2v1_extxbgr_merged_upsample_sse2 jSMUpH2V1EXTXBGRS2
112 #define jsimd_h2v1_extxrgb_merged_upsample_sse2 jSMUpH2V1EXTXRGBS2
113 #define jsimd_convsamp_mmx                    jSConvM
114 #define jsimd_convsamp_sse2                   jSConvS2
115 #define jsimd_convsamp_float_3dnow            jSConvF3D
116 #define jsimd_convsamp_float_sse              jSConvFS
117 #define jsimd_convsamp_float_sse2             jSConvFS2
118 #define jsimd_fdct_islow_mmx                  jSFDMIS
119 #define jsimd_fdct_ifast_mmx                  jSFDMIF
120 #define jconst_fdct_islow_sse2                jSCFDS2IS
121 #define jsimd_fdct_islow_sse2                 jSFDS2IS
122 #define jconst_fdct_ifast_sse2                jSCFDS2IF
123 #define jsimd_fdct_ifast_sse2                 jSFDS2IF
124 #define jsimd_fdct_float_3dnow                jSFD3DF
125 #define jconst_fdct_float_sse                 jSCFDSF
126 #define jsimd_fdct_float_sse                  jSFDSF
127 #define jsimd_quantize_mmx                    jSQuantM
128 #define jsimd_quantize_sse2                   jSQuantS2
129 #define jsimd_quantize_float_3dnow            jSQuantF3D
130 #define jsimd_quantize_float_sse              jSQuantFS
131 #define jsimd_quantize_float_sse2             jSQuantFS2
132 #define jsimd_idct_2x2_mmx                    jSIDM22
133 #define jsimd_idct_4x4_mmx                    jSIDM44
134 #define jconst_idct_red_sse2                  jSCIDS2R
135 #define jsimd_idct_2x2_sse2                   jSIDS222
136 #define jsimd_idct_4x4_sse2                   jSIDS244
137 #define jsimd_idct_islow_mmx                  jSIDMIS
138 #define jsimd_idct_ifast_mmx                  jSIDMIF
139 #define jconst_idct_islow_sse2                jSCIDS2IS
140 #define jsimd_idct_islow_sse2                 jSIDS2IS
141 #define jconst_idct_ifast_sse2                jSCIDS2IF
142 #define jsimd_idct_ifast_sse2                 jSIDS2IF
143 #define jsimd_idct_float_3dnow                jSID3DF
144 #define jconst_fdct_float_sse                 jSCIDSF
145 #define jsimd_idct_float_sse                  jSIDSF
146 #define jconst_fdct_float_sse2                jSCIDS2F
147 #define jsimd_idct_float_sse2                 jSIDS2F
148 #endif /* NEED_SHORT_EXTERNAL_NAMES */
149 
150 /* SIMD Ext: retrieve SIMD/CPU information */
151 EXTERN(unsigned int) jpeg_simd_cpu_support JPP((void));
152 
153 /* SIMD Color Space Conversion */
154 EXTERN(void) jsimd_rgb_ycc_convert_mmx
155         JPP((JDIMENSION img_width,
156              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
157              JDIMENSION output_row, int num_rows));
158 EXTERN(void) jsimd_extrgb_ycc_convert_mmx
159         JPP((JDIMENSION img_width,
160              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
161              JDIMENSION output_row, int num_rows));
162 EXTERN(void) jsimd_extrgbx_ycc_convert_mmx
163         JPP((JDIMENSION img_width,
164              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
165              JDIMENSION output_row, int num_rows));
166 EXTERN(void) jsimd_extbgr_ycc_convert_mmx
167         JPP((JDIMENSION img_width,
168              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
169              JDIMENSION output_row, int num_rows));
170 EXTERN(void) jsimd_extbgrx_ycc_convert_mmx
171         JPP((JDIMENSION img_width,
172              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
173              JDIMENSION output_row, int num_rows));
174 EXTERN(void) jsimd_extxbgr_ycc_convert_mmx
175         JPP((JDIMENSION img_width,
176              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
177              JDIMENSION output_row, int num_rows));
178 EXTERN(void) jsimd_extxrgb_ycc_convert_mmx
179         JPP((JDIMENSION img_width,
180              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
181              JDIMENSION output_row, int num_rows));
182 
183 EXTERN(void) jsimd_rgb_gray_convert_mmx
184         JPP((JDIMENSION img_width,
185              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
186              JDIMENSION output_row, int num_rows));
187 EXTERN(void) jsimd_extrgb_gray_convert_mmx
188         JPP((JDIMENSION img_width,
189              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
190              JDIMENSION output_row, int num_rows));
191 EXTERN(void) jsimd_extrgbx_gray_convert_mmx
192         JPP((JDIMENSION img_width,
193              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
194              JDIMENSION output_row, int num_rows));
195 EXTERN(void) jsimd_extbgr_gray_convert_mmx
196         JPP((JDIMENSION img_width,
197              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
198              JDIMENSION output_row, int num_rows));
199 EXTERN(void) jsimd_extbgrx_gray_convert_mmx
200         JPP((JDIMENSION img_width,
201              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
202              JDIMENSION output_row, int num_rows));
203 EXTERN(void) jsimd_extxbgr_gray_convert_mmx
204         JPP((JDIMENSION img_width,
205              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
206              JDIMENSION output_row, int num_rows));
207 EXTERN(void) jsimd_extxrgb_gray_convert_mmx
208         JPP((JDIMENSION img_width,
209              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
210              JDIMENSION output_row, int num_rows));
211 
212 EXTERN(void) jsimd_ycc_rgb_convert_mmx
213         JPP((JDIMENSION out_width,
214              JSAMPIMAGE input_buf, JDIMENSION input_row,
215              JSAMPARRAY output_buf, int num_rows));
216 EXTERN(void) jsimd_ycc_extrgb_convert_mmx
217         JPP((JDIMENSION out_width,
218              JSAMPIMAGE input_buf, JDIMENSION input_row,
219              JSAMPARRAY output_buf, int num_rows));
220 EXTERN(void) jsimd_ycc_extrgbx_convert_mmx
221         JPP((JDIMENSION out_width,
222              JSAMPIMAGE input_buf, JDIMENSION input_row,
223              JSAMPARRAY output_buf, int num_rows));
224 EXTERN(void) jsimd_ycc_extbgr_convert_mmx
225         JPP((JDIMENSION out_width,
226              JSAMPIMAGE input_buf, JDIMENSION input_row,
227              JSAMPARRAY output_buf, int num_rows));
228 EXTERN(void) jsimd_ycc_extbgrx_convert_mmx
229         JPP((JDIMENSION out_width,
230              JSAMPIMAGE input_buf, JDIMENSION input_row,
231              JSAMPARRAY output_buf, int num_rows));
232 EXTERN(void) jsimd_ycc_extxbgr_convert_mmx
233         JPP((JDIMENSION out_width,
234              JSAMPIMAGE input_buf, JDIMENSION input_row,
235              JSAMPARRAY output_buf, int num_rows));
236 EXTERN(void) jsimd_ycc_extxrgb_convert_mmx
237         JPP((JDIMENSION out_width,
238              JSAMPIMAGE input_buf, JDIMENSION input_row,
239              JSAMPARRAY output_buf, int num_rows));
240 
241 extern const int jconst_rgb_ycc_convert_sse2[];
242 EXTERN(void) jsimd_rgb_ycc_convert_sse2
243         JPP((JDIMENSION img_width,
244              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
245              JDIMENSION output_row, int num_rows));
246 EXTERN(void) jsimd_extrgb_ycc_convert_sse2
247         JPP((JDIMENSION img_width,
248              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
249              JDIMENSION output_row, int num_rows));
250 EXTERN(void) jsimd_extrgbx_ycc_convert_sse2
251         JPP((JDIMENSION img_width,
252              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
253              JDIMENSION output_row, int num_rows));
254 EXTERN(void) jsimd_extbgr_ycc_convert_sse2
255         JPP((JDIMENSION img_width,
256              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
257              JDIMENSION output_row, int num_rows));
258 EXTERN(void) jsimd_extbgrx_ycc_convert_sse2
259         JPP((JDIMENSION img_width,
260              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
261              JDIMENSION output_row, int num_rows));
262 EXTERN(void) jsimd_extxbgr_ycc_convert_sse2
263         JPP((JDIMENSION img_width,
264              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
265              JDIMENSION output_row, int num_rows));
266 EXTERN(void) jsimd_extxrgb_ycc_convert_sse2
267         JPP((JDIMENSION img_width,
268              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
269              JDIMENSION output_row, int num_rows));
270 
271 extern const int jconst_rgb_gray_convert_sse2[];
272 EXTERN(void) jsimd_rgb_gray_convert_sse2
273         JPP((JDIMENSION img_width,
274              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
275              JDIMENSION output_row, int num_rows));
276 EXTERN(void) jsimd_extrgb_gray_convert_sse2
277         JPP((JDIMENSION img_width,
278              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
279              JDIMENSION output_row, int num_rows));
280 EXTERN(void) jsimd_extrgbx_gray_convert_sse2
281         JPP((JDIMENSION img_width,
282              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
283              JDIMENSION output_row, int num_rows));
284 EXTERN(void) jsimd_extbgr_gray_convert_sse2
285         JPP((JDIMENSION img_width,
286              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
287              JDIMENSION output_row, int num_rows));
288 EXTERN(void) jsimd_extbgrx_gray_convert_sse2
289         JPP((JDIMENSION img_width,
290              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
291              JDIMENSION output_row, int num_rows));
292 EXTERN(void) jsimd_extxbgr_gray_convert_sse2
293         JPP((JDIMENSION img_width,
294              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
295              JDIMENSION output_row, int num_rows));
296 EXTERN(void) jsimd_extxrgb_gray_convert_sse2
297         JPP((JDIMENSION img_width,
298              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
299              JDIMENSION output_row, int num_rows));
300 
301 extern const int jconst_ycc_rgb_convert_sse2[];
302 EXTERN(void) jsimd_ycc_rgb_convert_sse2
303         JPP((JDIMENSION out_width,
304              JSAMPIMAGE input_buf, JDIMENSION input_row,
305              JSAMPARRAY output_buf, int num_rows));
306 EXTERN(void) jsimd_ycc_extrgb_convert_sse2
307         JPP((JDIMENSION out_width,
308              JSAMPIMAGE input_buf, JDIMENSION input_row,
309              JSAMPARRAY output_buf, int num_rows));
310 EXTERN(void) jsimd_ycc_extrgbx_convert_sse2
311         JPP((JDIMENSION out_width,
312              JSAMPIMAGE input_buf, JDIMENSION input_row,
313              JSAMPARRAY output_buf, int num_rows));
314 EXTERN(void) jsimd_ycc_extbgr_convert_sse2
315         JPP((JDIMENSION out_width,
316              JSAMPIMAGE input_buf, JDIMENSION input_row,
317              JSAMPARRAY output_buf, int num_rows));
318 EXTERN(void) jsimd_ycc_extbgrx_convert_sse2
319         JPP((JDIMENSION out_width,
320              JSAMPIMAGE input_buf, JDIMENSION input_row,
321              JSAMPARRAY output_buf, int num_rows));
322 EXTERN(void) jsimd_ycc_extxbgr_convert_sse2
323         JPP((JDIMENSION out_width,
324              JSAMPIMAGE input_buf, JDIMENSION input_row,
325              JSAMPARRAY output_buf, int num_rows));
326 EXTERN(void) jsimd_ycc_extxrgb_convert_sse2
327         JPP((JDIMENSION out_width,
328              JSAMPIMAGE input_buf, JDIMENSION input_row,
329              JSAMPARRAY output_buf, int num_rows));
330 
331 EXTERN(void) jsimd_rgb_ycc_convert_neon
332         JPP((JDIMENSION img_width,
333              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
334              JDIMENSION output_row, int num_rows));
335 EXTERN(void) jsimd_extrgb_ycc_convert_neon
336         JPP((JDIMENSION img_width,
337              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
338              JDIMENSION output_row, int num_rows));
339 EXTERN(void) jsimd_extrgbx_ycc_convert_neon
340         JPP((JDIMENSION img_width,
341              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
342              JDIMENSION output_row, int num_rows));
343 EXTERN(void) jsimd_extbgr_ycc_convert_neon
344         JPP((JDIMENSION img_width,
345              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
346              JDIMENSION output_row, int num_rows));
347 EXTERN(void) jsimd_extbgrx_ycc_convert_neon
348         JPP((JDIMENSION img_width,
349              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
350              JDIMENSION output_row, int num_rows));
351 EXTERN(void) jsimd_extxbgr_ycc_convert_neon
352         JPP((JDIMENSION img_width,
353              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
354              JDIMENSION output_row, int num_rows));
355 EXTERN(void) jsimd_extxrgb_ycc_convert_neon
356         JPP((JDIMENSION img_width,
357              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
358              JDIMENSION output_row, int num_rows));
359 
360 EXTERN(void) jsimd_ycc_rgb_convert_neon
361         JPP((JDIMENSION out_width,
362              JSAMPIMAGE input_buf, JDIMENSION input_row,
363              JSAMPARRAY output_buf, int num_rows));
364 EXTERN(void) jsimd_ycc_extrgb_convert_neon
365         JPP((JDIMENSION out_width,
366              JSAMPIMAGE input_buf, JDIMENSION input_row,
367              JSAMPARRAY output_buf, int num_rows));
368 EXTERN(void) jsimd_ycc_extrgbx_convert_neon
369         JPP((JDIMENSION out_width,
370              JSAMPIMAGE input_buf, JDIMENSION input_row,
371              JSAMPARRAY output_buf, int num_rows));
372 EXTERN(void) jsimd_ycc_extbgr_convert_neon
373         JPP((JDIMENSION out_width,
374              JSAMPIMAGE input_buf, JDIMENSION input_row,
375              JSAMPARRAY output_buf, int num_rows));
376 EXTERN(void) jsimd_ycc_extbgrx_convert_neon
377         JPP((JDIMENSION out_width,
378              JSAMPIMAGE input_buf, JDIMENSION input_row,
379              JSAMPARRAY output_buf, int num_rows));
380 EXTERN(void) jsimd_ycc_extxbgr_convert_neon
381         JPP((JDIMENSION out_width,
382              JSAMPIMAGE input_buf, JDIMENSION input_row,
383              JSAMPARRAY output_buf, int num_rows));
384 EXTERN(void) jsimd_ycc_extxrgb_convert_neon
385         JPP((JDIMENSION out_width,
386              JSAMPIMAGE input_buf, JDIMENSION input_row,
387              JSAMPARRAY output_buf, int num_rows));
388 
389 /* SIMD Downsample */
390 EXTERN(void) jsimd_h2v2_downsample_mmx
391         JPP((JDIMENSION image_width, int max_v_samp_factor,
392              JDIMENSION v_samp_factor, JDIMENSION width_blocks,
393              JSAMPARRAY input_data, JSAMPARRAY output_data));
394 EXTERN(void) jsimd_h2v1_downsample_mmx
395         JPP((JDIMENSION image_width, int max_v_samp_factor,
396              JDIMENSION v_samp_factor, JDIMENSION width_blocks,
397              JSAMPARRAY input_data, JSAMPARRAY output_data));
398 
399 EXTERN(void) jsimd_h2v2_downsample_sse2
400         JPP((JDIMENSION image_width, int max_v_samp_factor,
401              JDIMENSION v_samp_factor, JDIMENSION width_blocks,
402              JSAMPARRAY input_data, JSAMPARRAY output_data));
403 EXTERN(void) jsimd_h2v1_downsample_sse2
404         JPP((JDIMENSION image_width, int max_v_samp_factor,
405              JDIMENSION v_samp_factor, JDIMENSION width_blocks,
406              JSAMPARRAY input_data, JSAMPARRAY output_data));
407 
408 /* SIMD Upsample */
409 EXTERN(void) jsimd_h2v2_upsample_mmx
410         JPP((int max_v_samp_factor, JDIMENSION output_width,
411              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
412 EXTERN(void) jsimd_h2v1_upsample_mmx
413         JPP((int max_v_samp_factor, JDIMENSION output_width,
414              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
415 
416 EXTERN(void) jsimd_h2v2_fancy_upsample_mmx
417         JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
418              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
419 EXTERN(void) jsimd_h2v1_fancy_upsample_mmx
420         JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
421              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
422 
423 EXTERN(void) jsimd_h2v2_merged_upsample_mmx
424         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
425              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
426 EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx
427         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
428              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
429 EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx
430         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
431              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
432 EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx
433         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
434              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
435 EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx
436         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
437              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
438 EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx
439         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
440              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
441 EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx
442         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
443              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
444 EXTERN(void) jsimd_h2v1_merged_upsample_mmx
445         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
446              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
447 EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx
448         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
449              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
450 EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx
451         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
452              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
453 EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx
454         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
455              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
456 EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx
457         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
458              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
459 EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx
460         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
461              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
462 EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx
463         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
464              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
465 
466 EXTERN(void) jsimd_h2v2_upsample_sse2
467         JPP((int max_v_samp_factor, JDIMENSION output_width,
468              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
469 EXTERN(void) jsimd_h2v1_upsample_sse2
470         JPP((int max_v_samp_factor, JDIMENSION output_width,
471              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
472 
473 extern const int jconst_fancy_upsample_sse2[];
474 EXTERN(void) jsimd_h2v2_fancy_upsample_sse2
475         JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
476              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
477 EXTERN(void) jsimd_h2v1_fancy_upsample_sse2
478         JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
479              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
480 
481 extern const int jconst_merged_upsample_sse2[];
482 EXTERN(void) jsimd_h2v2_merged_upsample_sse2
483         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
484              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
485 EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2
486         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
487              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
488 EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2
489         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
490              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
491 EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2
492         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
493              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
494 EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2
495         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
496              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
497 EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2
498         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
499              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
500 EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2
501         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
502              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
503 EXTERN(void) jsimd_h2v1_merged_upsample_sse2
504         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
505              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
506 EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2
507         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
508              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
509 EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2
510         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
511              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
512 EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2
513         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
514              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
515 EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2
516         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
517              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
518 EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2
519         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
520              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
521 EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2
522         JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
523              JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
524 
525 EXTERN(void) jsimd_h2v1_fancy_upsample_neon
526         JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
527              JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
528 
529 /* SIMD Sample Conversion */
530 EXTERN(void) jsimd_convsamp_mmx JPP((JSAMPARRAY sample_data,
531                                      JDIMENSION start_col,
532                                      DCTELEM * workspace));
533 
534 EXTERN(void) jsimd_convsamp_sse2 JPP((JSAMPARRAY sample_data,
535                                       JDIMENSION start_col,
536                                       DCTELEM * workspace));
537 
538 EXTERN(void) jsimd_convsamp_neon JPP((JSAMPARRAY sample_data,
539                                       JDIMENSION start_col,
540                                       DCTELEM * workspace));
541 
542 EXTERN(void) jsimd_convsamp_float_3dnow JPP((JSAMPARRAY sample_data,
543                                              JDIMENSION start_col,
544                                              FAST_FLOAT * workspace));
545 
546 EXTERN(void) jsimd_convsamp_float_sse JPP((JSAMPARRAY sample_data,
547                                            JDIMENSION start_col,
548                                            FAST_FLOAT * workspace));
549 
550 EXTERN(void) jsimd_convsamp_float_sse2 JPP((JSAMPARRAY sample_data,
551                                             JDIMENSION start_col,
552                                             FAST_FLOAT * workspace));
553 
554 /* SIMD Forward DCT */
555 EXTERN(void) jsimd_fdct_islow_mmx JPP((DCTELEM * data));
556 EXTERN(void) jsimd_fdct_ifast_mmx JPP((DCTELEM * data));
557 
558 extern const int jconst_fdct_ifast_sse2[];
559 EXTERN(void) jsimd_fdct_islow_sse2 JPP((DCTELEM * data));
560 extern const int jconst_fdct_islow_sse2[];
561 EXTERN(void) jsimd_fdct_ifast_sse2 JPP((DCTELEM * data));
562 
563 EXTERN(void) jsimd_fdct_ifast_neon JPP((DCTELEM * data));
564 
565 EXTERN(void) jsimd_fdct_float_3dnow JPP((FAST_FLOAT * data));
566 
567 extern const int jconst_fdct_float_sse[];
568 EXTERN(void) jsimd_fdct_float_sse JPP((FAST_FLOAT * data));
569 
570 /* SIMD Quantization */
571 EXTERN(void) jsimd_quantize_mmx JPP((JCOEFPTR coef_block,
572                                      DCTELEM * divisors,
573                                      DCTELEM * workspace));
574 
575 EXTERN(void) jsimd_quantize_sse2 JPP((JCOEFPTR coef_block,
576                                       DCTELEM * divisors,
577                                       DCTELEM * workspace));
578 
579 EXTERN(void) jsimd_quantize_neon JPP((JCOEFPTR coef_block,
580                                       DCTELEM * divisors,
581                                       DCTELEM * workspace));
582 
583 EXTERN(void) jsimd_quantize_float_3dnow JPP((JCOEFPTR coef_block,
584                                              FAST_FLOAT * divisors,
585                                              FAST_FLOAT * workspace));
586 
587 EXTERN(void) jsimd_quantize_float_sse JPP((JCOEFPTR coef_block,
588                                            FAST_FLOAT * divisors,
589                                            FAST_FLOAT * workspace));
590 
591 EXTERN(void) jsimd_quantize_float_sse2 JPP((JCOEFPTR coef_block,
592                                             FAST_FLOAT * divisors,
593                                             FAST_FLOAT * workspace));
594 
595 /* SIMD Reduced Inverse DCT */
596 EXTERN(void) jsimd_idct_2x2_mmx JPP((void * dct_table,
597                                      JCOEFPTR coef_block,
598                                      JSAMPARRAY output_buf,
599                                      JDIMENSION output_col));
600 EXTERN(void) jsimd_idct_4x4_mmx JPP((void * dct_table,
601                                      JCOEFPTR coef_block,
602                                      JSAMPARRAY output_buf,
603                                      JDIMENSION output_col));
604 
605 extern const int jconst_idct_red_sse2[];
606 EXTERN(void) jsimd_idct_2x2_sse2 JPP((void * dct_table,
607                                       JCOEFPTR coef_block,
608                                       JSAMPARRAY output_buf,
609                                       JDIMENSION output_col));
610 EXTERN(void) jsimd_idct_4x4_sse2 JPP((void * dct_table,
611                                       JCOEFPTR coef_block,
612                                       JSAMPARRAY output_buf,
613                                       JDIMENSION output_col));
614 
615 EXTERN(void) jsimd_idct_2x2_neon JPP((void * dct_table,
616                                       JCOEFPTR coef_block,
617                                       JSAMPARRAY output_buf,
618                                       JDIMENSION output_col));
619 EXTERN(void) jsimd_idct_4x4_neon JPP((void * dct_table,
620                                       JCOEFPTR coef_block,
621                                       JSAMPARRAY output_buf,
622                                       JDIMENSION output_col));
623 
624 /* SIMD Inverse DCT */
625 EXTERN(void) jsimd_idct_islow_mmx JPP((void * dct_table,
626                                        JCOEFPTR coef_block,
627                                        JSAMPARRAY output_buf,
628                                        JDIMENSION output_col));
629 EXTERN(void) jsimd_idct_ifast_mmx JPP((void * dct_table,
630                                        JCOEFPTR coef_block,
631                                        JSAMPARRAY output_buf,
632                                        JDIMENSION output_col));
633 
634 extern const int jconst_idct_islow_sse2[];
635 EXTERN(void) jsimd_idct_islow_sse2 JPP((void * dct_table,
636                                         JCOEFPTR coef_block,
637                                         JSAMPARRAY output_buf,
638                                         JDIMENSION output_col));
639 extern const int jconst_idct_ifast_sse2[];
640 EXTERN(void) jsimd_idct_ifast_sse2 JPP((void * dct_table,
641                                         JCOEFPTR coef_block,
642                                         JSAMPARRAY output_buf,
643                                         JDIMENSION output_col));
644 
645 EXTERN(void) jsimd_idct_islow_neon JPP((void * dct_table,
646                                         JCOEFPTR coef_block,
647                                         JSAMPARRAY output_buf,
648                                         JDIMENSION output_col));
649 EXTERN(void) jsimd_idct_ifast_neon JPP((void * dct_table,
650                                         JCOEFPTR coef_block,
651                                         JSAMPARRAY output_buf,
652                                         JDIMENSION output_col));
653 
654 EXTERN(void) jsimd_idct_float_3dnow JPP((void * dct_table,
655                                          JCOEFPTR coef_block,
656                                          JSAMPARRAY output_buf,
657                                          JDIMENSION output_col));
658 
659 extern const int jconst_idct_float_sse[];
660 EXTERN(void) jsimd_idct_float_sse JPP((void * dct_table,
661                                        JCOEFPTR coef_block,
662                                        JSAMPARRAY output_buf,
663                                        JDIMENSION output_col));
664 
665 extern const int jconst_idct_float_sse2[];
666 EXTERN(void) jsimd_idct_float_sse2 JPP((void * dct_table,
667                                         JCOEFPTR coef_block,
668                                         JSAMPARRAY output_buf,
669                                         JDIMENSION output_col));
670 
671