blob: 89ac1b75ebfb7e8c429320663b7e769bab0244e8 [file] [log] [blame]
Pierre Ossman2ae181c2009-03-09 13:21:27 +00001/*
2 * simd/jsimd.h
3 *
4 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5 *
6 * Based on the x86 SIMD extension for IJG JPEG library,
7 * Copyright (C) 1999-2006, MIYASAKA Masaru.
DRCaf1ca9b2011-02-02 05:42:37 +00008 * For conditions of distribution and use, see copyright notice in jsimdext.inc
Pierre Ossman2ae181c2009-03-09 13:21:27 +00009 *
10 */
11
12/* Bitmask for supported acceleration methods */
13
14#define JSIMD_NONE 0x00
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000015#define JSIMD_MMX 0x01
Pierre Ossman65d03172009-03-09 13:28:10 +000016#define JSIMD_3DNOW 0x02
Pierre Ossman018fc422009-03-09 13:31:56 +000017#define JSIMD_SSE 0x04
Pierre Ossmaneea72152009-03-09 13:34:17 +000018#define JSIMD_SSE2 0x08
Pierre Ossman2ae181c2009-03-09 13:21:27 +000019
20/* Short forms of external names for systems with brain-damaged linkers. */
21
22#ifdef NEED_SHORT_EXTERNAL_NAMES
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000023#define jpeg_simd_cpu_support jSiCpuSupport
24#define jsimd_rgb_ycc_convert_mmx jSRGBYCCM
DRCf25c0712009-04-03 12:00:51 +000025#define jsimd_extrgb_ycc_convert_mmx jSEXTRGBYCCM
26#define jsimd_extrgbx_ycc_convert_mmx jSEXTRGBXYCCM
27#define jsimd_extbgr_ycc_convert_mmx jSEXTBGRYCCM
28#define jsimd_extbgrx_ycc_convert_mmx jSEXTBGRXYCCM
29#define jsimd_extxbgr_ycc_convert_mmx jSEXTXBGRYCCM
30#define jsimd_extxrgb_ycc_convert_mmx jSEXTXRGBYCCM
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000031#define jsimd_ycc_rgb_convert_mmx jSYCCRGBM
DRCf25c0712009-04-03 12:00:51 +000032#define jsimd_ycc_extrgb_convert_mmx jSYCCEXTRGBM
33#define jsimd_ycc_extrgbx_convert_mmx jSYCCEXTRGBXM
34#define jsimd_ycc_extbgr_convert_mmx jSYCCEXTBGRM
35#define jsimd_ycc_extbgrx_convert_mmx jSYCCEXTBGRXM
36#define jsimd_ycc_extxbgr_convert_mmx jSYCCEXTXBGRM
37#define jsimd_ycc_extxrgb_convert_mmx jSYCCEXTXRGBM
Pierre Ossmaneea72152009-03-09 13:34:17 +000038#define jconst_rgb_ycc_convert_sse2 jSCRGBYCCS2
39#define jsimd_rgb_ycc_convert_sse2 jSRGBYCCS2
DRCf25c0712009-04-03 12:00:51 +000040#define jsimd_extrgb_ycc_convert_sse2 jSEXTRGBYCCS2
41#define jsimd_extrgbx_ycc_convert_sse2 jSEXTRGBXYCCS2
42#define jsimd_extbgr_ycc_convert_sse2 jSEXTBGRYCCS2
43#define jsimd_extbgrx_ycc_convert_sse2 jSEXTBGRXYCCS2
44#define jsimd_extxbgr_ycc_convert_sse2 jSEXTXBGRYCCS2
45#define jsimd_extxrgb_ycc_convert_sse2 jSEXTXRGBYCCS2
Pierre Ossmaneea72152009-03-09 13:34:17 +000046#define jconst_ycc_rgb_convert_sse2 jSCYCCRGBS2
47#define jsimd_ycc_rgb_convert_sse2 jSYCCRGBS2
DRCf25c0712009-04-03 12:00:51 +000048#define jsimd_ycc_extrgb_convert_sse2 jSYCCEXTRGBS2
49#define jsimd_ycc_extrgbx_convert_sse2 jSYCCEXTRGBXS2
50#define jsimd_ycc_extbgr_convert_sse2 jSYCCEXTBGRS2
51#define jsimd_ycc_extbgrx_convert_sse2 jSYCCEXTBGRXS2
52#define jsimd_ycc_extxbgr_convert_sse2 jSYCCEXTXBGRS2
53#define jsimd_ycc_extxrgb_convert_sse2 jSYCCEXTXRGBS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000054#define jsimd_h2v2_downsample_mmx jSDnH2V2M
55#define jsimd_h2v1_downsample_mmx jSDnH2V1M
Pierre Ossmaneea72152009-03-09 13:34:17 +000056#define jsimd_h2v2_downsample_sse2 jSDnH2V2S2
57#define jsimd_h2v1_downsample_sse2 jSDnH2V1S2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000058#define jsimd_h2v2_upsample_mmx jSUpH2V2M
59#define jsimd_h2v1_upsample_mmx jSUpH2V1M
60#define jsimd_h2v2_fancy_upsample_mmx jSFUpH2V2M
61#define jsimd_h2v1_fancy_upsample_mmx jSFUpH2V1M
62#define jsimd_h2v2_merged_upsample_mmx jSMUpH2V2M
DRC720e1612009-04-05 21:51:25 +000063#define jsimd_h2v2_extrgb_merged_upsample_mmx jSMUpH2V2EXTRGBM
64#define jsimd_h2v2_extrgbx_merged_upsample_mmx jSMUpH2V2EXTRGBXM
65#define jsimd_h2v2_extbgr_merged_upsample_mmx jSMUpH2V2EXTBGRM
66#define jsimd_h2v2_extbgrx_merged_upsample_mmx jSMUpH2V2EXTBGRXM
67#define jsimd_h2v2_extxbgr_merged_upsample_mmx jSMUpH2V2EXTXBGRM
68#define jsimd_h2v2_extxrgb_merged_upsample_mmx jSMUpH2V2EXTXRGBM
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000069#define jsimd_h2v1_merged_upsample_mmx jSMUpH2V1M
DRC720e1612009-04-05 21:51:25 +000070#define jsimd_h2v1_extrgb_merged_upsample_mmx jSMUpH2V1EXTRGBM
71#define jsimd_h2v1_extrgbx_merged_upsample_mmx jSMUpH2V1EXTRGBXM
72#define jsimd_h2v1_extbgr_merged_upsample_mmx jSMUpH2V1EXTBGRM
73#define jsimd_h2v1_extbgrx_merged_upsample_mmx jSMUpH2V1EXTBGRXM
74#define jsimd_h2v1_extxbgr_merged_upsample_mmx jSMUpH2V1EXTXBGRM
75#define jsimd_h2v1_extxrgb_merged_upsample_mmx jSMUpH2V1EXTXRGBM
Pierre Ossmaneea72152009-03-09 13:34:17 +000076#define jsimd_h2v2_upsample_sse2 jSUpH2V2S2
77#define jsimd_h2v1_upsample_sse2 jSUpH2V1S2
78#define jconst_fancy_upsample_sse2 jSCFUpS2
79#define jsimd_h2v2_fancy_upsample_sse2 jSFUpH2V2S2
80#define jsimd_h2v1_fancy_upsample_sse2 jSFUpH2V1S2
81#define jconst_merged_upsample_sse2 jSCMUpS2
82#define jsimd_h2v2_merged_upsample_sse2 jSMUpH2V2S2
DRC720e1612009-04-05 21:51:25 +000083#define jsimd_h2v2_extrgb_merged_upsample_sse2 jSMUpH2V2EXTRGBS2
84#define jsimd_h2v2_extrgbx_merged_upsample_sse2 jSMUpH2V2EXTRGBXS2
85#define jsimd_h2v2_extbgr_merged_upsample_sse2 jSMUpH2V2EXTBGRS2
86#define jsimd_h2v2_extbgrx_merged_upsample_sse2 jSMUpH2V2EXTBGRXS2
87#define jsimd_h2v2_extxbgr_merged_upsample_sse2 jSMUpH2V2EXTXBGRS2
88#define jsimd_h2v2_extxrgb_merged_upsample_sse2 jSMUpH2V2EXTXRGBS2
Pierre Ossmaneea72152009-03-09 13:34:17 +000089#define jsimd_h2v1_merged_upsample_sse2 jSMUpH2V1S2
DRC720e1612009-04-05 21:51:25 +000090#define jsimd_h2v1_extrgb_merged_upsample_sse2 jSMUpH2V1EXTRGBS2
91#define jsimd_h2v1_extrgbx_merged_upsample_sse2 jSMUpH2V1EXTRGBXS2
92#define jsimd_h2v1_extbgr_merged_upsample_sse2 jSMUpH2V1EXTBGRS2
93#define jsimd_h2v1_extbgrx_merged_upsample_sse2 jSMUpH2V1EXTBGRXS2
94#define jsimd_h2v1_extxbgr_merged_upsample_sse2 jSMUpH2V1EXTXBGRS2
95#define jsimd_h2v1_extxrgb_merged_upsample_sse2 jSMUpH2V1EXTXRGBS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000096#define jsimd_convsamp_mmx jSConvM
Pierre Ossmaneea72152009-03-09 13:34:17 +000097#define jsimd_convsamp_sse2 jSConvS2
Pierre Ossman65d03172009-03-09 13:28:10 +000098#define jsimd_convsamp_float_3dnow jSConvF3D
Pierre Ossman018fc422009-03-09 13:31:56 +000099#define jsimd_convsamp_float_sse jSConvFS
Pierre Ossmaneea72152009-03-09 13:34:17 +0000100#define jsimd_convsamp_float_sse2 jSConvFS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000101#define jsimd_fdct_islow_mmx jSFDMIS
102#define jsimd_fdct_ifast_mmx jSFDMIF
Pierre Ossmaneea72152009-03-09 13:34:17 +0000103#define jconst_fdct_islow_sse2 jSCFDS2IS
104#define jsimd_fdct_islow_sse2 jSFDS2IS
105#define jconst_fdct_ifast_sse2 jSCFDS2IF
106#define jsimd_fdct_ifast_sse2 jSFDS2IF
Pierre Ossman65d03172009-03-09 13:28:10 +0000107#define jsimd_fdct_float_3dnow jSFD3DF
Pierre Ossman018fc422009-03-09 13:31:56 +0000108#define jconst_fdct_float_sse jSCFDSF
109#define jsimd_fdct_float_sse jSFDSF
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000110#define jsimd_quantize_mmx jSQuantM
Pierre Ossmaneea72152009-03-09 13:34:17 +0000111#define jsimd_quantize_sse2 jSQuantS2
Pierre Ossman65d03172009-03-09 13:28:10 +0000112#define jsimd_quantize_float_3dnow jSQuantF3D
Pierre Ossman018fc422009-03-09 13:31:56 +0000113#define jsimd_quantize_float_sse jSQuantFS
Pierre Ossmaneea72152009-03-09 13:34:17 +0000114#define jsimd_quantize_float_sse2 jSQuantFS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000115#define jsimd_idct_2x2_mmx jSIDM22
116#define jsimd_idct_4x4_mmx jSIDM44
Pierre Ossmaneea72152009-03-09 13:34:17 +0000117#define jconst_idct_red_sse2 jSCIDS2R
118#define jsimd_idct_2x2_sse2 jSIDS222
119#define jsimd_idct_4x4_sse2 jSIDS244
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000120#define jsimd_idct_islow_mmx jSIDMIS
121#define jsimd_idct_ifast_mmx jSIDMIF
Pierre Ossmaneea72152009-03-09 13:34:17 +0000122#define jconst_idct_islow_sse2 jSCIDS2IS
123#define jsimd_idct_islow_sse2 jSIDS2IS
124#define jconst_idct_ifast_sse2 jSCIDS2IF
125#define jsimd_idct_ifast_sse2 jSIDS2IF
Pierre Ossman65d03172009-03-09 13:28:10 +0000126#define jsimd_idct_float_3dnow jSID3DF
Pierre Ossman018fc422009-03-09 13:31:56 +0000127#define jconst_fdct_float_sse jSCIDSF
128#define jsimd_idct_float_sse jSIDSF
Pierre Ossmaneea72152009-03-09 13:34:17 +0000129#define jconst_fdct_float_sse2 jSCIDS2F
130#define jsimd_idct_float_sse2 jSIDS2F
Pierre Ossman2ae181c2009-03-09 13:21:27 +0000131#endif /* NEED_SHORT_EXTERNAL_NAMES */
132
133/* SIMD Ext: retrieve SIMD/CPU information */
134EXTERN(unsigned int) jpeg_simd_cpu_support JPP((void));
135
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000136/* SIMD Color Space Conversion */
137EXTERN(void) jsimd_rgb_ycc_convert_mmx
138 JPP((JDIMENSION img_width,
139 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
140 JDIMENSION output_row, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000141EXTERN(void) jsimd_extrgb_ycc_convert_mmx
142 JPP((JDIMENSION img_width,
143 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
144 JDIMENSION output_row, int num_rows));
145EXTERN(void) jsimd_extrgbx_ycc_convert_mmx
146 JPP((JDIMENSION img_width,
147 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
148 JDIMENSION output_row, int num_rows));
149EXTERN(void) jsimd_extbgr_ycc_convert_mmx
150 JPP((JDIMENSION img_width,
151 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
152 JDIMENSION output_row, int num_rows));
153EXTERN(void) jsimd_extbgrx_ycc_convert_mmx
154 JPP((JDIMENSION img_width,
155 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
156 JDIMENSION output_row, int num_rows));
157EXTERN(void) jsimd_extxbgr_ycc_convert_mmx
158 JPP((JDIMENSION img_width,
159 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
160 JDIMENSION output_row, int num_rows));
161EXTERN(void) jsimd_extxrgb_ycc_convert_mmx
162 JPP((JDIMENSION img_width,
163 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
164 JDIMENSION output_row, int num_rows));
165
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000166EXTERN(void) jsimd_ycc_rgb_convert_mmx
167 JPP((JDIMENSION out_width,
168 JSAMPIMAGE input_buf, JDIMENSION input_row,
169 JSAMPARRAY output_buf, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000170EXTERN(void) jsimd_ycc_extrgb_convert_mmx
171 JPP((JDIMENSION out_width,
172 JSAMPIMAGE input_buf, JDIMENSION input_row,
173 JSAMPARRAY output_buf, int num_rows));
174EXTERN(void) jsimd_ycc_extrgbx_convert_mmx
175 JPP((JDIMENSION out_width,
176 JSAMPIMAGE input_buf, JDIMENSION input_row,
177 JSAMPARRAY output_buf, int num_rows));
178EXTERN(void) jsimd_ycc_extbgr_convert_mmx
179 JPP((JDIMENSION out_width,
180 JSAMPIMAGE input_buf, JDIMENSION input_row,
181 JSAMPARRAY output_buf, int num_rows));
182EXTERN(void) jsimd_ycc_extbgrx_convert_mmx
183 JPP((JDIMENSION out_width,
184 JSAMPIMAGE input_buf, JDIMENSION input_row,
185 JSAMPARRAY output_buf, int num_rows));
186EXTERN(void) jsimd_ycc_extxbgr_convert_mmx
187 JPP((JDIMENSION out_width,
188 JSAMPIMAGE input_buf, JDIMENSION input_row,
189 JSAMPARRAY output_buf, int num_rows));
190EXTERN(void) jsimd_ycc_extxrgb_convert_mmx
191 JPP((JDIMENSION out_width,
192 JSAMPIMAGE input_buf, JDIMENSION input_row,
193 JSAMPARRAY output_buf, int num_rows));
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000194
Pierre Ossmaneea72152009-03-09 13:34:17 +0000195extern const int jconst_rgb_ycc_convert_sse2[];
196EXTERN(void) jsimd_rgb_ycc_convert_sse2
197 JPP((JDIMENSION img_width,
198 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
199 JDIMENSION output_row, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000200EXTERN(void) jsimd_extrgb_ycc_convert_sse2
201 JPP((JDIMENSION img_width,
202 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
203 JDIMENSION output_row, int num_rows));
204EXTERN(void) jsimd_extrgbx_ycc_convert_sse2
205 JPP((JDIMENSION img_width,
206 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
207 JDIMENSION output_row, int num_rows));
208EXTERN(void) jsimd_extbgr_ycc_convert_sse2
209 JPP((JDIMENSION img_width,
210 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
211 JDIMENSION output_row, int num_rows));
212EXTERN(void) jsimd_extbgrx_ycc_convert_sse2
213 JPP((JDIMENSION img_width,
214 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
215 JDIMENSION output_row, int num_rows));
216EXTERN(void) jsimd_extxbgr_ycc_convert_sse2
217 JPP((JDIMENSION img_width,
218 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
219 JDIMENSION output_row, int num_rows));
220EXTERN(void) jsimd_extxrgb_ycc_convert_sse2
221 JPP((JDIMENSION img_width,
222 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
223 JDIMENSION output_row, int num_rows));
224
Pierre Ossmaneea72152009-03-09 13:34:17 +0000225extern const int jconst_ycc_rgb_convert_sse2[];
226EXTERN(void) jsimd_ycc_rgb_convert_sse2
227 JPP((JDIMENSION out_width,
228 JSAMPIMAGE input_buf, JDIMENSION input_row,
229 JSAMPARRAY output_buf, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000230EXTERN(void) jsimd_ycc_extrgb_convert_sse2
231 JPP((JDIMENSION out_width,
232 JSAMPIMAGE input_buf, JDIMENSION input_row,
233 JSAMPARRAY output_buf, int num_rows));
234EXTERN(void) jsimd_ycc_extrgbx_convert_sse2
235 JPP((JDIMENSION out_width,
236 JSAMPIMAGE input_buf, JDIMENSION input_row,
237 JSAMPARRAY output_buf, int num_rows));
238EXTERN(void) jsimd_ycc_extbgr_convert_sse2
239 JPP((JDIMENSION out_width,
240 JSAMPIMAGE input_buf, JDIMENSION input_row,
241 JSAMPARRAY output_buf, int num_rows));
242EXTERN(void) jsimd_ycc_extbgrx_convert_sse2
243 JPP((JDIMENSION out_width,
244 JSAMPIMAGE input_buf, JDIMENSION input_row,
245 JSAMPARRAY output_buf, int num_rows));
246EXTERN(void) jsimd_ycc_extxbgr_convert_sse2
247 JPP((JDIMENSION out_width,
248 JSAMPIMAGE input_buf, JDIMENSION input_row,
249 JSAMPARRAY output_buf, int num_rows));
250EXTERN(void) jsimd_ycc_extxrgb_convert_sse2
251 JPP((JDIMENSION out_width,
252 JSAMPIMAGE input_buf, JDIMENSION input_row,
253 JSAMPARRAY output_buf, int num_rows));
Pierre Ossmaneea72152009-03-09 13:34:17 +0000254
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000255/* SIMD Downsample */
256EXTERN(void) jsimd_h2v2_downsample_mmx
257 JPP((JDIMENSION image_width, int max_v_samp_factor,
258 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
259 JSAMPARRAY input_data, JSAMPARRAY output_data));
260EXTERN(void) jsimd_h2v1_downsample_mmx
261 JPP((JDIMENSION image_width, int max_v_samp_factor,
262 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
263 JSAMPARRAY input_data, JSAMPARRAY output_data));
264
Pierre Ossmaneea72152009-03-09 13:34:17 +0000265EXTERN(void) jsimd_h2v2_downsample_sse2
266 JPP((JDIMENSION image_width, int max_v_samp_factor,
267 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
268 JSAMPARRAY input_data, JSAMPARRAY output_data));
269EXTERN(void) jsimd_h2v1_downsample_sse2
270 JPP((JDIMENSION image_width, int max_v_samp_factor,
271 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
272 JSAMPARRAY input_data, JSAMPARRAY output_data));
273
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000274/* SIMD Upsample */
275EXTERN(void) jsimd_h2v2_upsample_mmx
276 JPP((int max_v_samp_factor, JDIMENSION output_width,
277 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
278EXTERN(void) jsimd_h2v1_upsample_mmx
279 JPP((int max_v_samp_factor, JDIMENSION output_width,
280 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
281
282EXTERN(void) jsimd_h2v2_fancy_upsample_mmx
283 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
284 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
285EXTERN(void) jsimd_h2v1_fancy_upsample_mmx
286 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
287 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
288
289EXTERN(void) jsimd_h2v2_merged_upsample_mmx
290 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
291 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000292EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx
293 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
294 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
295EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx
296 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
297 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
298EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx
299 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
300 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
301EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx
302 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
303 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
304EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx
305 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
306 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
307EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx
308 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
309 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000310EXTERN(void) jsimd_h2v1_merged_upsample_mmx
311 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
312 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000313EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx
314 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
315 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
316EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx
317 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
318 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
319EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx
320 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
321 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
322EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx
323 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
324 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
325EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx
326 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
327 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
328EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx
329 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
330 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000331
Pierre Ossmaneea72152009-03-09 13:34:17 +0000332EXTERN(void) jsimd_h2v2_upsample_sse2
333 JPP((int max_v_samp_factor, JDIMENSION output_width,
334 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
335EXTERN(void) jsimd_h2v1_upsample_sse2
336 JPP((int max_v_samp_factor, JDIMENSION output_width,
337 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
338
339extern const int jconst_fancy_upsample_sse2[];
340EXTERN(void) jsimd_h2v2_fancy_upsample_sse2
341 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
342 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
343EXTERN(void) jsimd_h2v1_fancy_upsample_sse2
344 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
345 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
346
347extern const int jconst_merged_upsample_sse2[];
348EXTERN(void) jsimd_h2v2_merged_upsample_sse2
349 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
350 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000351EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2
352 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
353 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
354EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2
355 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
356 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
357EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2
358 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
359 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
360EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2
361 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
362 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
363EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2
364 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
365 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
366EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2
367 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
368 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossmaneea72152009-03-09 13:34:17 +0000369EXTERN(void) jsimd_h2v1_merged_upsample_sse2
370 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
371 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000372EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2
373 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
374 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
375EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2
376 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
377 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
378EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2
379 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
380 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
381EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2
382 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
383 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
384EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2
385 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
386 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
387EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2
388 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
389 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossmaneea72152009-03-09 13:34:17 +0000390
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000391/* SIMD Sample Conversion */
392EXTERN(void) jsimd_convsamp_mmx JPP((JSAMPARRAY sample_data,
393 JDIMENSION start_col,
394 DCTELEM * workspace));
395
Pierre Ossmaneea72152009-03-09 13:34:17 +0000396EXTERN(void) jsimd_convsamp_sse2 JPP((JSAMPARRAY sample_data,
397 JDIMENSION start_col,
398 DCTELEM * workspace));
399
Pierre Ossman65d03172009-03-09 13:28:10 +0000400EXTERN(void) jsimd_convsamp_float_3dnow JPP((JSAMPARRAY sample_data,
401 JDIMENSION start_col,
402 FAST_FLOAT * workspace));
403
Pierre Ossman018fc422009-03-09 13:31:56 +0000404EXTERN(void) jsimd_convsamp_float_sse JPP((JSAMPARRAY sample_data,
405 JDIMENSION start_col,
406 FAST_FLOAT * workspace));
407
Pierre Ossmaneea72152009-03-09 13:34:17 +0000408EXTERN(void) jsimd_convsamp_float_sse2 JPP((JSAMPARRAY sample_data,
409 JDIMENSION start_col,
410 FAST_FLOAT * workspace));
411
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000412/* SIMD Forward DCT */
413EXTERN(void) jsimd_fdct_islow_mmx JPP((DCTELEM * data));
414EXTERN(void) jsimd_fdct_ifast_mmx JPP((DCTELEM * data));
415
Pierre Ossmaneea72152009-03-09 13:34:17 +0000416extern const int jconst_fdct_ifast_sse2[];
417EXTERN(void) jsimd_fdct_islow_sse2 JPP((DCTELEM * data));
418extern const int jconst_fdct_islow_sse2[];
419EXTERN(void) jsimd_fdct_ifast_sse2 JPP((DCTELEM * data));
420
Pierre Ossman65d03172009-03-09 13:28:10 +0000421EXTERN(void) jsimd_fdct_float_3dnow JPP((FAST_FLOAT * data));
422
Pierre Ossman018fc422009-03-09 13:31:56 +0000423extern const int jconst_fdct_float_sse[];
424EXTERN(void) jsimd_fdct_float_sse JPP((FAST_FLOAT * data));
425
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000426/* SIMD Quantization */
427EXTERN(void) jsimd_quantize_mmx JPP((JCOEFPTR coef_block,
428 DCTELEM * divisors,
429 DCTELEM * workspace));
430
Pierre Ossmaneea72152009-03-09 13:34:17 +0000431EXTERN(void) jsimd_quantize_sse2 JPP((JCOEFPTR coef_block,
432 DCTELEM * divisors,
433 DCTELEM * workspace));
434
Pierre Ossman65d03172009-03-09 13:28:10 +0000435EXTERN(void) jsimd_quantize_float_3dnow JPP((JCOEFPTR coef_block,
436 FAST_FLOAT * divisors,
437 FAST_FLOAT * workspace));
438
Pierre Ossman018fc422009-03-09 13:31:56 +0000439EXTERN(void) jsimd_quantize_float_sse JPP((JCOEFPTR coef_block,
440 FAST_FLOAT * divisors,
441 FAST_FLOAT * workspace));
442
Pierre Ossmaneea72152009-03-09 13:34:17 +0000443EXTERN(void) jsimd_quantize_float_sse2 JPP((JCOEFPTR coef_block,
444 FAST_FLOAT * divisors,
445 FAST_FLOAT * workspace));
446
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000447/* SIMD Reduced Inverse DCT */
448EXTERN(void) jsimd_idct_2x2_mmx JPP((void * dct_table,
449 JCOEFPTR coef_block,
450 JSAMPARRAY output_buf,
451 JDIMENSION output_col));
452EXTERN(void) jsimd_idct_4x4_mmx JPP((void * dct_table,
453 JCOEFPTR coef_block,
454 JSAMPARRAY output_buf,
455 JDIMENSION output_col));
456
Pierre Ossmaneea72152009-03-09 13:34:17 +0000457extern const int jconst_idct_red_sse2[];
458EXTERN(void) jsimd_idct_2x2_sse2 JPP((void * dct_table,
459 JCOEFPTR coef_block,
460 JSAMPARRAY output_buf,
461 JDIMENSION output_col));
462EXTERN(void) jsimd_idct_4x4_sse2 JPP((void * dct_table,
463 JCOEFPTR coef_block,
464 JSAMPARRAY output_buf,
465 JDIMENSION output_col));
466
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000467/* SIMD Inverse DCT */
468EXTERN(void) jsimd_idct_islow_mmx JPP((void * dct_table,
469 JCOEFPTR coef_block,
470 JSAMPARRAY output_buf,
471 JDIMENSION output_col));
472EXTERN(void) jsimd_idct_ifast_mmx JPP((void * dct_table,
473 JCOEFPTR coef_block,
474 JSAMPARRAY output_buf,
475 JDIMENSION output_col));
476
Pierre Ossmaneea72152009-03-09 13:34:17 +0000477extern const int jconst_idct_islow_sse2[];
478EXTERN(void) jsimd_idct_islow_sse2 JPP((void * dct_table,
479 JCOEFPTR coef_block,
480 JSAMPARRAY output_buf,
481 JDIMENSION output_col));
482extern const int jconst_idct_ifast_sse2[];
483EXTERN(void) jsimd_idct_ifast_sse2 JPP((void * dct_table,
484 JCOEFPTR coef_block,
485 JSAMPARRAY output_buf,
486 JDIMENSION output_col));
487
Pierre Ossman65d03172009-03-09 13:28:10 +0000488EXTERN(void) jsimd_idct_float_3dnow JPP((void * dct_table,
489 JCOEFPTR coef_block,
490 JSAMPARRAY output_buf,
491 JDIMENSION output_col));
492
Pierre Ossman018fc422009-03-09 13:31:56 +0000493extern const int jconst_idct_float_sse[];
494EXTERN(void) jsimd_idct_float_sse JPP((void * dct_table,
495 JCOEFPTR coef_block,
496 JSAMPARRAY output_buf,
497 JDIMENSION output_col));
498
Pierre Ossmaneea72152009-03-09 13:34:17 +0000499extern const int jconst_idct_float_sse2[];
500EXTERN(void) jsimd_idct_float_sse2 JPP((void * dct_table,
501 JCOEFPTR coef_block,
502 JSAMPARRAY output_buf,
503 JDIMENSION output_col));
504