blob: c21cf29b975c98d4fd68470e03b965f8cae78b9c [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.
8 *
9 */
10
11/* Bitmask for supported acceleration methods */
12
13#define JSIMD_NONE 0x00
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000014#define JSIMD_MMX 0x01
Pierre Ossman65d03172009-03-09 13:28:10 +000015#define JSIMD_3DNOW 0x02
Pierre Ossman018fc422009-03-09 13:31:56 +000016#define JSIMD_SSE 0x04
Pierre Ossmaneea72152009-03-09 13:34:17 +000017#define JSIMD_SSE2 0x08
Pierre Ossman2ae181c2009-03-09 13:21:27 +000018
19/* Short forms of external names for systems with brain-damaged linkers. */
20
21#ifdef NEED_SHORT_EXTERNAL_NAMES
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000022#define jpeg_simd_cpu_support jSiCpuSupport
23#define jsimd_rgb_ycc_convert_mmx jSRGBYCCM
DRCf25c0712009-04-03 12:00:51 +000024#define jsimd_extrgb_ycc_convert_mmx jSEXTRGBYCCM
25#define jsimd_extrgbx_ycc_convert_mmx jSEXTRGBXYCCM
26#define jsimd_extbgr_ycc_convert_mmx jSEXTBGRYCCM
27#define jsimd_extbgrx_ycc_convert_mmx jSEXTBGRXYCCM
28#define jsimd_extxbgr_ycc_convert_mmx jSEXTXBGRYCCM
29#define jsimd_extxrgb_ycc_convert_mmx jSEXTXRGBYCCM
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000030#define jsimd_ycc_rgb_convert_mmx jSYCCRGBM
DRCf25c0712009-04-03 12:00:51 +000031#define jsimd_ycc_extrgb_convert_mmx jSYCCEXTRGBM
32#define jsimd_ycc_extrgbx_convert_mmx jSYCCEXTRGBXM
33#define jsimd_ycc_extbgr_convert_mmx jSYCCEXTBGRM
34#define jsimd_ycc_extbgrx_convert_mmx jSYCCEXTBGRXM
35#define jsimd_ycc_extxbgr_convert_mmx jSYCCEXTXBGRM
36#define jsimd_ycc_extxrgb_convert_mmx jSYCCEXTXRGBM
Pierre Ossmaneea72152009-03-09 13:34:17 +000037#define jconst_rgb_ycc_convert_sse2 jSCRGBYCCS2
38#define jsimd_rgb_ycc_convert_sse2 jSRGBYCCS2
DRCf25c0712009-04-03 12:00:51 +000039#define jsimd_extrgb_ycc_convert_sse2 jSEXTRGBYCCS2
40#define jsimd_extrgbx_ycc_convert_sse2 jSEXTRGBXYCCS2
41#define jsimd_extbgr_ycc_convert_sse2 jSEXTBGRYCCS2
42#define jsimd_extbgrx_ycc_convert_sse2 jSEXTBGRXYCCS2
43#define jsimd_extxbgr_ycc_convert_sse2 jSEXTXBGRYCCS2
44#define jsimd_extxrgb_ycc_convert_sse2 jSEXTXRGBYCCS2
Pierre Ossmaneea72152009-03-09 13:34:17 +000045#define jconst_ycc_rgb_convert_sse2 jSCYCCRGBS2
46#define jsimd_ycc_rgb_convert_sse2 jSYCCRGBS2
DRCf25c0712009-04-03 12:00:51 +000047#define jsimd_ycc_extrgb_convert_sse2 jSYCCEXTRGBS2
48#define jsimd_ycc_extrgbx_convert_sse2 jSYCCEXTRGBXS2
49#define jsimd_ycc_extbgr_convert_sse2 jSYCCEXTBGRS2
50#define jsimd_ycc_extbgrx_convert_sse2 jSYCCEXTBGRXS2
51#define jsimd_ycc_extxbgr_convert_sse2 jSYCCEXTXBGRS2
52#define jsimd_ycc_extxrgb_convert_sse2 jSYCCEXTXRGBS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000053#define jsimd_h2v2_downsample_mmx jSDnH2V2M
54#define jsimd_h2v1_downsample_mmx jSDnH2V1M
Pierre Ossmaneea72152009-03-09 13:34:17 +000055#define jsimd_h2v2_downsample_sse2 jSDnH2V2S2
56#define jsimd_h2v1_downsample_sse2 jSDnH2V1S2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000057#define jsimd_h2v2_upsample_mmx jSUpH2V2M
58#define jsimd_h2v1_upsample_mmx jSUpH2V1M
59#define jsimd_h2v2_fancy_upsample_mmx jSFUpH2V2M
60#define jsimd_h2v1_fancy_upsample_mmx jSFUpH2V1M
61#define jsimd_h2v2_merged_upsample_mmx jSMUpH2V2M
DRC720e1612009-04-05 21:51:25 +000062#define jsimd_h2v2_extrgb_merged_upsample_mmx jSMUpH2V2EXTRGBM
63#define jsimd_h2v2_extrgbx_merged_upsample_mmx jSMUpH2V2EXTRGBXM
64#define jsimd_h2v2_extbgr_merged_upsample_mmx jSMUpH2V2EXTBGRM
65#define jsimd_h2v2_extbgrx_merged_upsample_mmx jSMUpH2V2EXTBGRXM
66#define jsimd_h2v2_extxbgr_merged_upsample_mmx jSMUpH2V2EXTXBGRM
67#define jsimd_h2v2_extxrgb_merged_upsample_mmx jSMUpH2V2EXTXRGBM
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000068#define jsimd_h2v1_merged_upsample_mmx jSMUpH2V1M
DRC720e1612009-04-05 21:51:25 +000069#define jsimd_h2v1_extrgb_merged_upsample_mmx jSMUpH2V1EXTRGBM
70#define jsimd_h2v1_extrgbx_merged_upsample_mmx jSMUpH2V1EXTRGBXM
71#define jsimd_h2v1_extbgr_merged_upsample_mmx jSMUpH2V1EXTBGRM
72#define jsimd_h2v1_extbgrx_merged_upsample_mmx jSMUpH2V1EXTBGRXM
73#define jsimd_h2v1_extxbgr_merged_upsample_mmx jSMUpH2V1EXTXBGRM
74#define jsimd_h2v1_extxrgb_merged_upsample_mmx jSMUpH2V1EXTXRGBM
Pierre Ossmaneea72152009-03-09 13:34:17 +000075#define jsimd_h2v2_upsample_sse2 jSUpH2V2S2
76#define jsimd_h2v1_upsample_sse2 jSUpH2V1S2
77#define jconst_fancy_upsample_sse2 jSCFUpS2
78#define jsimd_h2v2_fancy_upsample_sse2 jSFUpH2V2S2
79#define jsimd_h2v1_fancy_upsample_sse2 jSFUpH2V1S2
80#define jconst_merged_upsample_sse2 jSCMUpS2
81#define jsimd_h2v2_merged_upsample_sse2 jSMUpH2V2S2
DRC720e1612009-04-05 21:51:25 +000082#define jsimd_h2v2_extrgb_merged_upsample_sse2 jSMUpH2V2EXTRGBS2
83#define jsimd_h2v2_extrgbx_merged_upsample_sse2 jSMUpH2V2EXTRGBXS2
84#define jsimd_h2v2_extbgr_merged_upsample_sse2 jSMUpH2V2EXTBGRS2
85#define jsimd_h2v2_extbgrx_merged_upsample_sse2 jSMUpH2V2EXTBGRXS2
86#define jsimd_h2v2_extxbgr_merged_upsample_sse2 jSMUpH2V2EXTXBGRS2
87#define jsimd_h2v2_extxrgb_merged_upsample_sse2 jSMUpH2V2EXTXRGBS2
Pierre Ossmaneea72152009-03-09 13:34:17 +000088#define jsimd_h2v1_merged_upsample_sse2 jSMUpH2V1S2
DRC720e1612009-04-05 21:51:25 +000089#define jsimd_h2v1_extrgb_merged_upsample_sse2 jSMUpH2V1EXTRGBS2
90#define jsimd_h2v1_extrgbx_merged_upsample_sse2 jSMUpH2V1EXTRGBXS2
91#define jsimd_h2v1_extbgr_merged_upsample_sse2 jSMUpH2V1EXTBGRS2
92#define jsimd_h2v1_extbgrx_merged_upsample_sse2 jSMUpH2V1EXTBGRXS2
93#define jsimd_h2v1_extxbgr_merged_upsample_sse2 jSMUpH2V1EXTXBGRS2
94#define jsimd_h2v1_extxrgb_merged_upsample_sse2 jSMUpH2V1EXTXRGBS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +000095#define jsimd_convsamp_mmx jSConvM
Pierre Ossmaneea72152009-03-09 13:34:17 +000096#define jsimd_convsamp_sse2 jSConvS2
Pierre Ossman65d03172009-03-09 13:28:10 +000097#define jsimd_convsamp_float_3dnow jSConvF3D
Pierre Ossman018fc422009-03-09 13:31:56 +000098#define jsimd_convsamp_float_sse jSConvFS
Pierre Ossmaneea72152009-03-09 13:34:17 +000099#define jsimd_convsamp_float_sse2 jSConvFS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000100#define jsimd_fdct_islow_mmx jSFDMIS
101#define jsimd_fdct_ifast_mmx jSFDMIF
Pierre Ossmaneea72152009-03-09 13:34:17 +0000102#define jconst_fdct_islow_sse2 jSCFDS2IS
103#define jsimd_fdct_islow_sse2 jSFDS2IS
104#define jconst_fdct_ifast_sse2 jSCFDS2IF
105#define jsimd_fdct_ifast_sse2 jSFDS2IF
Pierre Ossman65d03172009-03-09 13:28:10 +0000106#define jsimd_fdct_float_3dnow jSFD3DF
Pierre Ossman018fc422009-03-09 13:31:56 +0000107#define jconst_fdct_float_sse jSCFDSF
108#define jsimd_fdct_float_sse jSFDSF
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000109#define jsimd_quantize_mmx jSQuantM
Pierre Ossmaneea72152009-03-09 13:34:17 +0000110#define jsimd_quantize_sse2 jSQuantS2
Pierre Ossman65d03172009-03-09 13:28:10 +0000111#define jsimd_quantize_float_3dnow jSQuantF3D
Pierre Ossman018fc422009-03-09 13:31:56 +0000112#define jsimd_quantize_float_sse jSQuantFS
Pierre Ossmaneea72152009-03-09 13:34:17 +0000113#define jsimd_quantize_float_sse2 jSQuantFS2
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000114#define jsimd_idct_2x2_mmx jSIDM22
115#define jsimd_idct_4x4_mmx jSIDM44
Pierre Ossmaneea72152009-03-09 13:34:17 +0000116#define jconst_idct_red_sse2 jSCIDS2R
117#define jsimd_idct_2x2_sse2 jSIDS222
118#define jsimd_idct_4x4_sse2 jSIDS244
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000119#define jsimd_idct_islow_mmx jSIDMIS
120#define jsimd_idct_ifast_mmx jSIDMIF
Pierre Ossmaneea72152009-03-09 13:34:17 +0000121#define jconst_idct_islow_sse2 jSCIDS2IS
122#define jsimd_idct_islow_sse2 jSIDS2IS
123#define jconst_idct_ifast_sse2 jSCIDS2IF
124#define jsimd_idct_ifast_sse2 jSIDS2IF
Pierre Ossman65d03172009-03-09 13:28:10 +0000125#define jsimd_idct_float_3dnow jSID3DF
Pierre Ossman018fc422009-03-09 13:31:56 +0000126#define jconst_fdct_float_sse jSCIDSF
127#define jsimd_idct_float_sse jSIDSF
Pierre Ossmaneea72152009-03-09 13:34:17 +0000128#define jconst_fdct_float_sse2 jSCIDS2F
129#define jsimd_idct_float_sse2 jSIDS2F
Pierre Ossman2ae181c2009-03-09 13:21:27 +0000130#endif /* NEED_SHORT_EXTERNAL_NAMES */
131
132/* SIMD Ext: retrieve SIMD/CPU information */
133EXTERN(unsigned int) jpeg_simd_cpu_support JPP((void));
134
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000135/* SIMD Color Space Conversion */
136EXTERN(void) jsimd_rgb_ycc_convert_mmx
137 JPP((JDIMENSION img_width,
138 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
139 JDIMENSION output_row, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000140EXTERN(void) jsimd_extrgb_ycc_convert_mmx
141 JPP((JDIMENSION img_width,
142 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
143 JDIMENSION output_row, int num_rows));
144EXTERN(void) jsimd_extrgbx_ycc_convert_mmx
145 JPP((JDIMENSION img_width,
146 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
147 JDIMENSION output_row, int num_rows));
148EXTERN(void) jsimd_extbgr_ycc_convert_mmx
149 JPP((JDIMENSION img_width,
150 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
151 JDIMENSION output_row, int num_rows));
152EXTERN(void) jsimd_extbgrx_ycc_convert_mmx
153 JPP((JDIMENSION img_width,
154 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
155 JDIMENSION output_row, int num_rows));
156EXTERN(void) jsimd_extxbgr_ycc_convert_mmx
157 JPP((JDIMENSION img_width,
158 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
159 JDIMENSION output_row, int num_rows));
160EXTERN(void) jsimd_extxrgb_ycc_convert_mmx
161 JPP((JDIMENSION img_width,
162 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
163 JDIMENSION output_row, int num_rows));
164
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000165EXTERN(void) jsimd_ycc_rgb_convert_mmx
166 JPP((JDIMENSION out_width,
167 JSAMPIMAGE input_buf, JDIMENSION input_row,
168 JSAMPARRAY output_buf, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000169EXTERN(void) jsimd_ycc_extrgb_convert_mmx
170 JPP((JDIMENSION out_width,
171 JSAMPIMAGE input_buf, JDIMENSION input_row,
172 JSAMPARRAY output_buf, int num_rows));
173EXTERN(void) jsimd_ycc_extrgbx_convert_mmx
174 JPP((JDIMENSION out_width,
175 JSAMPIMAGE input_buf, JDIMENSION input_row,
176 JSAMPARRAY output_buf, int num_rows));
177EXTERN(void) jsimd_ycc_extbgr_convert_mmx
178 JPP((JDIMENSION out_width,
179 JSAMPIMAGE input_buf, JDIMENSION input_row,
180 JSAMPARRAY output_buf, int num_rows));
181EXTERN(void) jsimd_ycc_extbgrx_convert_mmx
182 JPP((JDIMENSION out_width,
183 JSAMPIMAGE input_buf, JDIMENSION input_row,
184 JSAMPARRAY output_buf, int num_rows));
185EXTERN(void) jsimd_ycc_extxbgr_convert_mmx
186 JPP((JDIMENSION out_width,
187 JSAMPIMAGE input_buf, JDIMENSION input_row,
188 JSAMPARRAY output_buf, int num_rows));
189EXTERN(void) jsimd_ycc_extxrgb_convert_mmx
190 JPP((JDIMENSION out_width,
191 JSAMPIMAGE input_buf, JDIMENSION input_row,
192 JSAMPARRAY output_buf, int num_rows));
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000193
Pierre Ossmaneea72152009-03-09 13:34:17 +0000194extern const int jconst_rgb_ycc_convert_sse2[];
195EXTERN(void) jsimd_rgb_ycc_convert_sse2
196 JPP((JDIMENSION img_width,
197 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
198 JDIMENSION output_row, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000199EXTERN(void) jsimd_extrgb_ycc_convert_sse2
200 JPP((JDIMENSION img_width,
201 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
202 JDIMENSION output_row, int num_rows));
203EXTERN(void) jsimd_extrgbx_ycc_convert_sse2
204 JPP((JDIMENSION img_width,
205 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
206 JDIMENSION output_row, int num_rows));
207EXTERN(void) jsimd_extbgr_ycc_convert_sse2
208 JPP((JDIMENSION img_width,
209 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
210 JDIMENSION output_row, int num_rows));
211EXTERN(void) jsimd_extbgrx_ycc_convert_sse2
212 JPP((JDIMENSION img_width,
213 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
214 JDIMENSION output_row, int num_rows));
215EXTERN(void) jsimd_extxbgr_ycc_convert_sse2
216 JPP((JDIMENSION img_width,
217 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
218 JDIMENSION output_row, int num_rows));
219EXTERN(void) jsimd_extxrgb_ycc_convert_sse2
220 JPP((JDIMENSION img_width,
221 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
222 JDIMENSION output_row, int num_rows));
223
Pierre Ossmaneea72152009-03-09 13:34:17 +0000224extern const int jconst_ycc_rgb_convert_sse2[];
225EXTERN(void) jsimd_ycc_rgb_convert_sse2
226 JPP((JDIMENSION out_width,
227 JSAMPIMAGE input_buf, JDIMENSION input_row,
228 JSAMPARRAY output_buf, int num_rows));
DRCf25c0712009-04-03 12:00:51 +0000229EXTERN(void) jsimd_ycc_extrgb_convert_sse2
230 JPP((JDIMENSION out_width,
231 JSAMPIMAGE input_buf, JDIMENSION input_row,
232 JSAMPARRAY output_buf, int num_rows));
233EXTERN(void) jsimd_ycc_extrgbx_convert_sse2
234 JPP((JDIMENSION out_width,
235 JSAMPIMAGE input_buf, JDIMENSION input_row,
236 JSAMPARRAY output_buf, int num_rows));
237EXTERN(void) jsimd_ycc_extbgr_convert_sse2
238 JPP((JDIMENSION out_width,
239 JSAMPIMAGE input_buf, JDIMENSION input_row,
240 JSAMPARRAY output_buf, int num_rows));
241EXTERN(void) jsimd_ycc_extbgrx_convert_sse2
242 JPP((JDIMENSION out_width,
243 JSAMPIMAGE input_buf, JDIMENSION input_row,
244 JSAMPARRAY output_buf, int num_rows));
245EXTERN(void) jsimd_ycc_extxbgr_convert_sse2
246 JPP((JDIMENSION out_width,
247 JSAMPIMAGE input_buf, JDIMENSION input_row,
248 JSAMPARRAY output_buf, int num_rows));
249EXTERN(void) jsimd_ycc_extxrgb_convert_sse2
250 JPP((JDIMENSION out_width,
251 JSAMPIMAGE input_buf, JDIMENSION input_row,
252 JSAMPARRAY output_buf, int num_rows));
Pierre Ossmaneea72152009-03-09 13:34:17 +0000253
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000254/* SIMD Downsample */
255EXTERN(void) jsimd_h2v2_downsample_mmx
256 JPP((JDIMENSION image_width, int max_v_samp_factor,
257 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
258 JSAMPARRAY input_data, JSAMPARRAY output_data));
259EXTERN(void) jsimd_h2v1_downsample_mmx
260 JPP((JDIMENSION image_width, int max_v_samp_factor,
261 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
262 JSAMPARRAY input_data, JSAMPARRAY output_data));
263
Pierre Ossmaneea72152009-03-09 13:34:17 +0000264EXTERN(void) jsimd_h2v2_downsample_sse2
265 JPP((JDIMENSION image_width, int max_v_samp_factor,
266 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
267 JSAMPARRAY input_data, JSAMPARRAY output_data));
268EXTERN(void) jsimd_h2v1_downsample_sse2
269 JPP((JDIMENSION image_width, int max_v_samp_factor,
270 JDIMENSION v_samp_factor, JDIMENSION width_blocks,
271 JSAMPARRAY input_data, JSAMPARRAY output_data));
272
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000273/* SIMD Upsample */
274EXTERN(void) jsimd_h2v2_upsample_mmx
275 JPP((int max_v_samp_factor, JDIMENSION output_width,
276 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
277EXTERN(void) jsimd_h2v1_upsample_mmx
278 JPP((int max_v_samp_factor, JDIMENSION output_width,
279 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
280
281EXTERN(void) jsimd_h2v2_fancy_upsample_mmx
282 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
283 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
284EXTERN(void) jsimd_h2v1_fancy_upsample_mmx
285 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
286 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
287
288EXTERN(void) jsimd_h2v2_merged_upsample_mmx
289 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
290 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000291EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx
292 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
293 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
294EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx
295 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
296 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
297EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx
298 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
299 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
300EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx
301 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
302 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
303EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx
304 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
305 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
306EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx
307 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
308 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000309EXTERN(void) jsimd_h2v1_merged_upsample_mmx
310 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
311 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000312EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx
313 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
314 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
315EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx
316 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
317 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
318EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx
319 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
320 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
321EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx
322 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
323 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
324EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx
325 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
326 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
327EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx
328 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
329 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000330
Pierre Ossmaneea72152009-03-09 13:34:17 +0000331EXTERN(void) jsimd_h2v2_upsample_sse2
332 JPP((int max_v_samp_factor, JDIMENSION output_width,
333 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
334EXTERN(void) jsimd_h2v1_upsample_sse2
335 JPP((int max_v_samp_factor, JDIMENSION output_width,
336 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
337
338extern const int jconst_fancy_upsample_sse2[];
339EXTERN(void) jsimd_h2v2_fancy_upsample_sse2
340 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
341 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
342EXTERN(void) jsimd_h2v1_fancy_upsample_sse2
343 JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
344 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
345
346extern const int jconst_merged_upsample_sse2[];
347EXTERN(void) jsimd_h2v2_merged_upsample_sse2
348 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
349 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000350EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2
351 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
352 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
353EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2
354 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
355 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
356EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2
357 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
358 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
359EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2
360 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
361 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
362EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2
363 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
364 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
365EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2
366 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
367 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossmaneea72152009-03-09 13:34:17 +0000368EXTERN(void) jsimd_h2v1_merged_upsample_sse2
369 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
370 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
DRC720e1612009-04-05 21:51:25 +0000371EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2
372 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
373 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
374EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2
375 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
376 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
377EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2
378 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
379 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
380EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2
381 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
382 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
383EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2
384 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
385 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
386EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2
387 JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
388 JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
Pierre Ossmaneea72152009-03-09 13:34:17 +0000389
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000390/* SIMD Sample Conversion */
391EXTERN(void) jsimd_convsamp_mmx JPP((JSAMPARRAY sample_data,
392 JDIMENSION start_col,
393 DCTELEM * workspace));
394
Pierre Ossmaneea72152009-03-09 13:34:17 +0000395EXTERN(void) jsimd_convsamp_sse2 JPP((JSAMPARRAY sample_data,
396 JDIMENSION start_col,
397 DCTELEM * workspace));
398
Pierre Ossman65d03172009-03-09 13:28:10 +0000399EXTERN(void) jsimd_convsamp_float_3dnow JPP((JSAMPARRAY sample_data,
400 JDIMENSION start_col,
401 FAST_FLOAT * workspace));
402
Pierre Ossman018fc422009-03-09 13:31:56 +0000403EXTERN(void) jsimd_convsamp_float_sse JPP((JSAMPARRAY sample_data,
404 JDIMENSION start_col,
405 FAST_FLOAT * workspace));
406
Pierre Ossmaneea72152009-03-09 13:34:17 +0000407EXTERN(void) jsimd_convsamp_float_sse2 JPP((JSAMPARRAY sample_data,
408 JDIMENSION start_col,
409 FAST_FLOAT * workspace));
410
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000411/* SIMD Forward DCT */
412EXTERN(void) jsimd_fdct_islow_mmx JPP((DCTELEM * data));
413EXTERN(void) jsimd_fdct_ifast_mmx JPP((DCTELEM * data));
414
Pierre Ossmaneea72152009-03-09 13:34:17 +0000415extern const int jconst_fdct_ifast_sse2[];
416EXTERN(void) jsimd_fdct_islow_sse2 JPP((DCTELEM * data));
417extern const int jconst_fdct_islow_sse2[];
418EXTERN(void) jsimd_fdct_ifast_sse2 JPP((DCTELEM * data));
419
Pierre Ossman65d03172009-03-09 13:28:10 +0000420EXTERN(void) jsimd_fdct_float_3dnow JPP((FAST_FLOAT * data));
421
Pierre Ossman018fc422009-03-09 13:31:56 +0000422extern const int jconst_fdct_float_sse[];
423EXTERN(void) jsimd_fdct_float_sse JPP((FAST_FLOAT * data));
424
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000425/* SIMD Quantization */
426EXTERN(void) jsimd_quantize_mmx JPP((JCOEFPTR coef_block,
427 DCTELEM * divisors,
428 DCTELEM * workspace));
429
Pierre Ossmaneea72152009-03-09 13:34:17 +0000430EXTERN(void) jsimd_quantize_sse2 JPP((JCOEFPTR coef_block,
431 DCTELEM * divisors,
432 DCTELEM * workspace));
433
Pierre Ossman65d03172009-03-09 13:28:10 +0000434EXTERN(void) jsimd_quantize_float_3dnow JPP((JCOEFPTR coef_block,
435 FAST_FLOAT * divisors,
436 FAST_FLOAT * workspace));
437
Pierre Ossman018fc422009-03-09 13:31:56 +0000438EXTERN(void) jsimd_quantize_float_sse JPP((JCOEFPTR coef_block,
439 FAST_FLOAT * divisors,
440 FAST_FLOAT * workspace));
441
Pierre Ossmaneea72152009-03-09 13:34:17 +0000442EXTERN(void) jsimd_quantize_float_sse2 JPP((JCOEFPTR coef_block,
443 FAST_FLOAT * divisors,
444 FAST_FLOAT * workspace));
445
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000446/* SIMD Reduced Inverse DCT */
447EXTERN(void) jsimd_idct_2x2_mmx JPP((void * dct_table,
448 JCOEFPTR coef_block,
449 JSAMPARRAY output_buf,
450 JDIMENSION output_col));
451EXTERN(void) jsimd_idct_4x4_mmx JPP((void * dct_table,
452 JCOEFPTR coef_block,
453 JSAMPARRAY output_buf,
454 JDIMENSION output_col));
455
Pierre Ossmaneea72152009-03-09 13:34:17 +0000456extern const int jconst_idct_red_sse2[];
457EXTERN(void) jsimd_idct_2x2_sse2 JPP((void * dct_table,
458 JCOEFPTR coef_block,
459 JSAMPARRAY output_buf,
460 JDIMENSION output_col));
461EXTERN(void) jsimd_idct_4x4_sse2 JPP((void * dct_table,
462 JCOEFPTR coef_block,
463 JSAMPARRAY output_buf,
464 JDIMENSION output_col));
465
Pierre Ossman5eb84ff2009-03-09 13:25:30 +0000466/* SIMD Inverse DCT */
467EXTERN(void) jsimd_idct_islow_mmx JPP((void * dct_table,
468 JCOEFPTR coef_block,
469 JSAMPARRAY output_buf,
470 JDIMENSION output_col));
471EXTERN(void) jsimd_idct_ifast_mmx JPP((void * dct_table,
472 JCOEFPTR coef_block,
473 JSAMPARRAY output_buf,
474 JDIMENSION output_col));
475
Pierre Ossmaneea72152009-03-09 13:34:17 +0000476extern const int jconst_idct_islow_sse2[];
477EXTERN(void) jsimd_idct_islow_sse2 JPP((void * dct_table,
478 JCOEFPTR coef_block,
479 JSAMPARRAY output_buf,
480 JDIMENSION output_col));
481extern const int jconst_idct_ifast_sse2[];
482EXTERN(void) jsimd_idct_ifast_sse2 JPP((void * dct_table,
483 JCOEFPTR coef_block,
484 JSAMPARRAY output_buf,
485 JDIMENSION output_col));
486
Pierre Ossman65d03172009-03-09 13:28:10 +0000487EXTERN(void) jsimd_idct_float_3dnow JPP((void * dct_table,
488 JCOEFPTR coef_block,
489 JSAMPARRAY output_buf,
490 JDIMENSION output_col));
491
Pierre Ossman018fc422009-03-09 13:31:56 +0000492extern const int jconst_idct_float_sse[];
493EXTERN(void) jsimd_idct_float_sse JPP((void * dct_table,
494 JCOEFPTR coef_block,
495 JSAMPARRAY output_buf,
496 JDIMENSION output_col));
497
Pierre Ossmaneea72152009-03-09 13:34:17 +0000498extern const int jconst_idct_float_sse2[];
499EXTERN(void) jsimd_idct_float_sse2 JPP((void * dct_table,
500 JCOEFPTR coef_block,
501 JSAMPARRAY output_buf,
502 JDIMENSION output_col));
503