blob: c6378e868eb6f3e8f7dab40d1c52f8e2e5dd75af [file] [log] [blame]
Pierre Ossman9ad52342009-03-09 13:15:56 +00001/*
2 * jsimd.c
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 * This file contains the interface between the "normal" portions
10 * of the library and the SIMD implementations.
11 */
12
13#define JPEG_INTERNALS
14#include "jinclude.h"
15#include "jpeglib.h"
16#include "jdct.h"
17
18#define JSIMD_NONE 0x00
19
20static unsigned int simd_support = ~0;
21
22/*
23 * Check what SIMD accelerations are supported.
24 *
25 * FIXME: This code is racy under a multi-threaded environment.
26 */
27LOCAL(void)
28init_simd (void)
29{
30 if (simd_support != ~0)
31 return;
32
33 simd_support = JSIMD_NONE;
34}
35
36GLOBAL(int)
37jsimd_can_rgb_ycc (void)
38{
39 init_simd();
40
41 return 0;
42}
43
44GLOBAL(int)
45jsimd_can_ycc_rgb (void)
46{
47 init_simd();
48
49 return 0;
50}
51
52GLOBAL(void)
53jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
54 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
55 JDIMENSION output_row, int num_rows)
56{
57}
58
59GLOBAL(void)
60jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
61 JSAMPIMAGE input_buf, JDIMENSION input_row,
62 JSAMPARRAY output_buf, int num_rows)
63{
64}
65
66GLOBAL(int)
67jsimd_can_h2v2_downsample (void)
68{
69 init_simd();
70
71 return 0;
72}
73
74GLOBAL(int)
75jsimd_can_h2v1_downsample (void)
76{
77 init_simd();
78
79 return 0;
80}
81
82GLOBAL(void)
83jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
84 JSAMPARRAY input_data, JSAMPARRAY output_data)
85{
86}
87
88GLOBAL(void)
89jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
90 JSAMPARRAY input_data, JSAMPARRAY output_data)
91{
92}
93
94GLOBAL(int)
95jsimd_can_h2v2_upsample (void)
96{
97 init_simd();
98
99 return 0;
100}
101
102GLOBAL(int)
103jsimd_can_h2v1_upsample (void)
104{
105 init_simd();
106
107 return 0;
108}
109
110GLOBAL(void)
111jsimd_h2v2_upsample (j_decompress_ptr cinfo,
112 jpeg_component_info * compptr,
113 JSAMPARRAY input_data,
114 JSAMPARRAY * output_data_ptr)
115{
116}
117
118GLOBAL(void)
119jsimd_h2v1_upsample (j_decompress_ptr cinfo,
120 jpeg_component_info * compptr,
121 JSAMPARRAY input_data,
122 JSAMPARRAY * output_data_ptr)
123{
124}
125
126GLOBAL(int)
127jsimd_can_h2v2_fancy_upsample (void)
128{
129 init_simd();
130
131 return 0;
132}
133
134GLOBAL(int)
135jsimd_can_h2v1_fancy_upsample (void)
136{
137 init_simd();
138
139 return 0;
140}
141
142GLOBAL(void)
143jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
144 jpeg_component_info * compptr,
145 JSAMPARRAY input_data,
146 JSAMPARRAY * output_data_ptr)
147{
148}
149
150GLOBAL(void)
151jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
152 jpeg_component_info * compptr,
153 JSAMPARRAY input_data,
154 JSAMPARRAY * output_data_ptr)
155{
156}
157
158GLOBAL(int)
159jsimd_can_h2v2_merged_upsample (void)
160{
161 init_simd();
162
163 return 0;
164}
165
166GLOBAL(int)
167jsimd_can_h2v1_merged_upsample (void)
168{
169 init_simd();
170
171 return 0;
172}
173
174GLOBAL(void)
175jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
176 JSAMPIMAGE input_buf,
177 JDIMENSION in_row_group_ctr,
178 JSAMPARRAY output_buf)
179{
180}
181
182GLOBAL(void)
183jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
184 JSAMPIMAGE input_buf,
185 JDIMENSION in_row_group_ctr,
186 JSAMPARRAY output_buf)
187{
188}
189
190GLOBAL(int)
191jsimd_can_convsamp (void)
192{
193 init_simd();
194
195 return 0;
196}
197
198GLOBAL(int)
199jsimd_can_convsamp_float (void)
200{
201 init_simd();
202
203 return 0;
204}
205
206GLOBAL(void)
207jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,
208 DCTELEM * workspace)
209{
210}
211
212GLOBAL(void)
213jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,
214 FAST_FLOAT * workspace)
215{
216}
217
218GLOBAL(int)
219jsimd_can_fdct_islow (void)
220{
221 init_simd();
222
223 return 0;
224}
225
226GLOBAL(int)
227jsimd_can_fdct_ifast (void)
228{
229 init_simd();
230
231 return 0;
232}
233
234GLOBAL(int)
235jsimd_can_fdct_float (void)
236{
237 init_simd();
238
239 return 0;
240}
241
242GLOBAL(void)
243jsimd_fdct_islow (DCTELEM * data)
244{
245}
246
247GLOBAL(void)
248jsimd_fdct_ifast (DCTELEM * data)
249{
250}
251
252GLOBAL(void)
253jsimd_fdct_float (FAST_FLOAT * data)
254{
255}
256
257GLOBAL(int)
258jsimd_can_quantize (void)
259{
260 init_simd();
261
262 return 0;
263}
264
265GLOBAL(int)
266jsimd_can_quantize_float (void)
267{
268 init_simd();
269
270 return 0;
271}
272
273GLOBAL(void)
274jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,
275 DCTELEM * workspace)
276{
277}
278
279GLOBAL(void)
280jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,
281 FAST_FLOAT * workspace)
282{
283}
284
285GLOBAL(int)
286jsimd_can_idct_2x2 (void)
287{
288 init_simd();
289
290 return 0;
291}
292
293GLOBAL(int)
294jsimd_can_idct_4x4 (void)
295{
296 init_simd();
297
298 return 0;
299}
300
301GLOBAL(void)
302jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
303 JCOEFPTR coef_block, JSAMPARRAY output_buf,
304 JDIMENSION output_col)
305{
306}
307
308GLOBAL(void)
309jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
310 JCOEFPTR coef_block, JSAMPARRAY output_buf,
311 JDIMENSION output_col)
312{
313}
314
315GLOBAL(int)
316jsimd_can_idct_islow (void)
317{
318 init_simd();
319
320 return 0;
321}
322
323GLOBAL(int)
324jsimd_can_idct_ifast (void)
325{
326 init_simd();
327
328 return 0;
329}
330
331GLOBAL(int)
332jsimd_can_idct_float (void)
333{
334 init_simd();
335
336 return 0;
337}
338
339GLOBAL(void)
340jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
341 JCOEFPTR coef_block, JSAMPARRAY output_buf,
342 JDIMENSION output_col)
343{
344}
345
346GLOBAL(void)
347jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
348 JCOEFPTR coef_block, JSAMPARRAY output_buf,
349 JDIMENSION output_col)
350{
351}
352
353GLOBAL(void)
354jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
355 JCOEFPTR coef_block, JSAMPARRAY output_buf,
356 JDIMENSION output_col)
357{
358}
359