1 /*
2  * jsimd_none.c
3  *
4  * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5  * Copyright (C) 2009-2011, 2014, D. R. Commander.
6  * Copyright (C) 2015-2016, 2018, Matthieu Darbois.
7  * Copyright (C) 2020, Arm Limited.
8  *
9  * Based on the x86 SIMD extension for IJG JPEG library,
10  * Copyright (C) 1999-2006, MIYASAKA Masaru.
11  * For conditions of distribution and use, see copyright notice in jsimdext.inc
12  *
13  * This file contains stubs for when there is no SIMD support available.
14  */
15 
16 #define JPEG_INTERNALS
17 #include "jinclude.h"
18 #include "jpeglib.h"
19 #include "jsimd.h"
20 #include "jdct.h"
21 #include "jsimddct.h"
22 
23 GLOBAL(int)
jsimd_can_rgb_ycc(void)24 jsimd_can_rgb_ycc(void)
25 {
26   return 0;
27 }
28 
29 GLOBAL(int)
jsimd_can_rgb_gray(void)30 jsimd_can_rgb_gray(void)
31 {
32   return 0;
33 }
34 
35 GLOBAL(int)
jsimd_can_ycc_rgb(void)36 jsimd_can_ycc_rgb(void)
37 {
38   return 0;
39 }
40 
41 GLOBAL(int)
jsimd_can_ycc_rgb565(void)42 jsimd_can_ycc_rgb565(void)
43 {
44   return 0;
45 }
46 
47 GLOBAL(int)
jsimd_c_can_null_convert(void)48 jsimd_c_can_null_convert(void)
49 {
50   return 0;
51 }
52 
53 GLOBAL(void)
jsimd_rgb_ycc_convert(j_compress_ptr cinfo,JSAMPARRAY input_buf,JSAMPIMAGE output_buf,JDIMENSION output_row,int num_rows)54 jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
55                       JSAMPIMAGE output_buf, JDIMENSION output_row,
56                       int num_rows)
57 {
58 }
59 
60 GLOBAL(void)
jsimd_rgb_gray_convert(j_compress_ptr cinfo,JSAMPARRAY input_buf,JSAMPIMAGE output_buf,JDIMENSION output_row,int num_rows)61 jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
62                        JSAMPIMAGE output_buf, JDIMENSION output_row,
63                        int num_rows)
64 {
65 }
66 
67 GLOBAL(void)
jsimd_ycc_rgb_convert(j_decompress_ptr cinfo,JSAMPIMAGE input_buf,JDIMENSION input_row,JSAMPARRAY output_buf,int num_rows)68 jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
69                       JDIMENSION input_row, JSAMPARRAY output_buf,
70                       int num_rows)
71 {
72 }
73 
74 GLOBAL(void)
jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo,JSAMPIMAGE input_buf,JDIMENSION input_row,JSAMPARRAY output_buf,int num_rows)75 jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
76                          JDIMENSION input_row, JSAMPARRAY output_buf,
77                          int num_rows)
78 {
79 }
80 
81 GLOBAL(void)
jsimd_c_null_convert(j_compress_ptr cinfo,JSAMPARRAY input_buf,JSAMPIMAGE output_buf,JDIMENSION output_row,int num_rows)82 jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
83                      JSAMPIMAGE output_buf, JDIMENSION output_row,
84                      int num_rows)
85 {
86 }
87 
88 GLOBAL(int)
jsimd_can_h2v2_downsample(void)89 jsimd_can_h2v2_downsample(void)
90 {
91   return 0;
92 }
93 
94 GLOBAL(int)
jsimd_can_h2v1_downsample(void)95 jsimd_can_h2v1_downsample(void)
96 {
97   return 0;
98 }
99 
100 GLOBAL(int)
jsimd_can_h2v2_smooth_downsample(void)101 jsimd_can_h2v2_smooth_downsample(void)
102 {
103   return 0;
104 }
105 
106 GLOBAL(void)
jsimd_h2v2_downsample(j_compress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY output_data)107 jsimd_h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
108                       JSAMPARRAY input_data, JSAMPARRAY output_data)
109 {
110 }
111 
112 GLOBAL(void)
jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY output_data)113 jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,
114                              jpeg_component_info *compptr,
115                              JSAMPARRAY input_data, JSAMPARRAY output_data)
116 {
117 }
118 
119 GLOBAL(void)
jsimd_h2v1_downsample(j_compress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY output_data)120 jsimd_h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
121                       JSAMPARRAY input_data, JSAMPARRAY output_data)
122 {
123 }
124 
125 GLOBAL(int)
jsimd_can_h2v2_upsample(void)126 jsimd_can_h2v2_upsample(void)
127 {
128   return 0;
129 }
130 
131 GLOBAL(int)
jsimd_can_h2v1_upsample(void)132 jsimd_can_h2v1_upsample(void)
133 {
134   return 0;
135 }
136 
137 GLOBAL(int)
jsimd_can_int_upsample(void)138 jsimd_can_int_upsample(void)
139 {
140   return 0;
141 }
142 
143 GLOBAL(void)
jsimd_int_upsample(j_decompress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY * output_data_ptr)144 jsimd_int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
145                    JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
146 {
147 }
148 
149 GLOBAL(void)
jsimd_h2v2_upsample(j_decompress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY * output_data_ptr)150 jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
151                     JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
152 {
153 }
154 
155 GLOBAL(void)
jsimd_h2v1_upsample(j_decompress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY * output_data_ptr)156 jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
157                     JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
158 {
159 }
160 
161 GLOBAL(int)
jsimd_can_h2v2_fancy_upsample(void)162 jsimd_can_h2v2_fancy_upsample(void)
163 {
164   return 0;
165 }
166 
167 GLOBAL(int)
jsimd_can_h2v1_fancy_upsample(void)168 jsimd_can_h2v1_fancy_upsample(void)
169 {
170   return 0;
171 }
172 
173 GLOBAL(int)
jsimd_can_h1v2_fancy_upsample(void)174 jsimd_can_h1v2_fancy_upsample(void)
175 {
176   return 0;
177 }
178 
179 GLOBAL(void)
jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY * output_data_ptr)180 jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
181                           JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
182 {
183 }
184 
185 GLOBAL(void)
jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY * output_data_ptr)186 jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
187                           JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
188 {
189 }
190 
191 GLOBAL(void)
jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo,jpeg_component_info * compptr,JSAMPARRAY input_data,JSAMPARRAY * output_data_ptr)192 jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
193                           JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
194 {
195 }
196 
197 GLOBAL(int)
jsimd_can_h2v2_merged_upsample(void)198 jsimd_can_h2v2_merged_upsample(void)
199 {
200   return 0;
201 }
202 
203 GLOBAL(int)
jsimd_can_h2v1_merged_upsample(void)204 jsimd_can_h2v1_merged_upsample(void)
205 {
206   return 0;
207 }
208 
209 GLOBAL(void)
jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo,JSAMPIMAGE input_buf,JDIMENSION in_row_group_ctr,JSAMPARRAY output_buf)210 jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
211                            JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
212 {
213 }
214 
215 GLOBAL(void)
jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo,JSAMPIMAGE input_buf,JDIMENSION in_row_group_ctr,JSAMPARRAY output_buf)216 jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
217                            JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
218 {
219 }
220 
221 GLOBAL(int)
jsimd_can_convsamp(void)222 jsimd_can_convsamp(void)
223 {
224   return 0;
225 }
226 
227 GLOBAL(int)
jsimd_can_convsamp_float(void)228 jsimd_can_convsamp_float(void)
229 {
230   return 0;
231 }
232 
233 GLOBAL(void)
jsimd_convsamp(JSAMPARRAY sample_data,JDIMENSION start_col,DCTELEM * workspace)234 jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
235                DCTELEM *workspace)
236 {
237 }
238 
239 GLOBAL(void)
jsimd_convsamp_float(JSAMPARRAY sample_data,JDIMENSION start_col,FAST_FLOAT * workspace)240 jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
241                      FAST_FLOAT *workspace)
242 {
243 }
244 
245 GLOBAL(int)
jsimd_can_fdct_islow(void)246 jsimd_can_fdct_islow(void)
247 {
248   return 0;
249 }
250 
251 GLOBAL(int)
jsimd_can_fdct_ifast(void)252 jsimd_can_fdct_ifast(void)
253 {
254   return 0;
255 }
256 
257 GLOBAL(int)
jsimd_can_fdct_float(void)258 jsimd_can_fdct_float(void)
259 {
260   return 0;
261 }
262 
263 GLOBAL(void)
jsimd_fdct_islow(DCTELEM * data)264 jsimd_fdct_islow(DCTELEM *data)
265 {
266 }
267 
268 GLOBAL(void)
jsimd_fdct_ifast(DCTELEM * data)269 jsimd_fdct_ifast(DCTELEM *data)
270 {
271 }
272 
273 GLOBAL(void)
jsimd_fdct_float(FAST_FLOAT * data)274 jsimd_fdct_float(FAST_FLOAT *data)
275 {
276 }
277 
278 GLOBAL(int)
jsimd_can_quantize(void)279 jsimd_can_quantize(void)
280 {
281   return 0;
282 }
283 
284 GLOBAL(int)
jsimd_can_quantize_float(void)285 jsimd_can_quantize_float(void)
286 {
287   return 0;
288 }
289 
290 GLOBAL(void)
jsimd_quantize(JCOEFPTR coef_block,DCTELEM * divisors,DCTELEM * workspace)291 jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
292 {
293 }
294 
295 GLOBAL(void)
jsimd_quantize_float(JCOEFPTR coef_block,FAST_FLOAT * divisors,FAST_FLOAT * workspace)296 jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
297                      FAST_FLOAT *workspace)
298 {
299 }
300 
301 GLOBAL(int)
jsimd_can_idct_2x2(void)302 jsimd_can_idct_2x2(void)
303 {
304   return 0;
305 }
306 
307 GLOBAL(int)
jsimd_can_idct_4x4(void)308 jsimd_can_idct_4x4(void)
309 {
310   return 0;
311 }
312 
313 GLOBAL(int)
jsimd_can_idct_6x6(void)314 jsimd_can_idct_6x6(void)
315 {
316   return 0;
317 }
318 
319 GLOBAL(int)
jsimd_can_idct_12x12(void)320 jsimd_can_idct_12x12(void)
321 {
322   return 0;
323 }
324 
325 GLOBAL(void)
jsimd_idct_2x2(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)326 jsimd_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
327                JCOEFPTR coef_block, JSAMPARRAY output_buf,
328                JDIMENSION output_col)
329 {
330 }
331 
332 GLOBAL(void)
jsimd_idct_4x4(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)333 jsimd_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
334                JCOEFPTR coef_block, JSAMPARRAY output_buf,
335                JDIMENSION output_col)
336 {
337 }
338 
339 GLOBAL(void)
jsimd_idct_6x6(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)340 jsimd_idct_6x6(j_decompress_ptr cinfo, jpeg_component_info *compptr,
341                JCOEFPTR coef_block, JSAMPARRAY output_buf,
342                JDIMENSION output_col)
343 {
344 }
345 
346 GLOBAL(void)
jsimd_idct_12x12(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)347 jsimd_idct_12x12(j_decompress_ptr cinfo, jpeg_component_info *compptr,
348                  JCOEFPTR coef_block, JSAMPARRAY output_buf,
349                  JDIMENSION output_col)
350 {
351 }
352 
353 GLOBAL(int)
jsimd_can_idct_islow(void)354 jsimd_can_idct_islow(void)
355 {
356   return 0;
357 }
358 
359 GLOBAL(int)
jsimd_can_idct_ifast(void)360 jsimd_can_idct_ifast(void)
361 {
362   return 0;
363 }
364 
365 GLOBAL(int)
jsimd_can_idct_float(void)366 jsimd_can_idct_float(void)
367 {
368   return 0;
369 }
370 
371 GLOBAL(void)
jsimd_idct_islow(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)372 jsimd_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
373                  JCOEFPTR coef_block, JSAMPARRAY output_buf,
374                  JDIMENSION output_col)
375 {
376 }
377 
378 GLOBAL(void)
jsimd_idct_ifast(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)379 jsimd_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
380                  JCOEFPTR coef_block, JSAMPARRAY output_buf,
381                  JDIMENSION output_col)
382 {
383 }
384 
385 GLOBAL(void)
jsimd_idct_float(j_decompress_ptr cinfo,jpeg_component_info * compptr,JCOEFPTR coef_block,JSAMPARRAY output_buf,JDIMENSION output_col)386 jsimd_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
387                  JCOEFPTR coef_block, JSAMPARRAY output_buf,
388                  JDIMENSION output_col)
389 {
390 }
391 
392 GLOBAL(int)
jsimd_can_huff_encode_one_block(void)393 jsimd_can_huff_encode_one_block(void)
394 {
395   return 0;
396 }
397 
398 GLOBAL(JOCTET *)
jsimd_huff_encode_one_block(void * state,JOCTET * buffer,JCOEFPTR block,int last_dc_val,c_derived_tbl * dctbl,c_derived_tbl * actbl)399 jsimd_huff_encode_one_block(void *state, JOCTET *buffer, JCOEFPTR block,
400                             int last_dc_val, c_derived_tbl *dctbl,
401                             c_derived_tbl *actbl)
402 {
403   return NULL;
404 }
405 
406 GLOBAL(int)
jsimd_can_encode_mcu_AC_first_prepare(void)407 jsimd_can_encode_mcu_AC_first_prepare(void)
408 {
409   return 0;
410 }
411 
412 GLOBAL(void)
jsimd_encode_mcu_AC_first_prepare(const JCOEF * block,const int * jpeg_natural_order_start,int Sl,int Al,JCOEF * values,size_t * zerobits)413 jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
414                                   const int *jpeg_natural_order_start, int Sl,
415                                   int Al, JCOEF *values, size_t *zerobits)
416 {
417 }
418 
419 GLOBAL(int)
jsimd_can_encode_mcu_AC_refine_prepare(void)420 jsimd_can_encode_mcu_AC_refine_prepare(void)
421 {
422   return 0;
423 }
424 
425 GLOBAL(int)
jsimd_encode_mcu_AC_refine_prepare(const JCOEF * block,const int * jpeg_natural_order_start,int Sl,int Al,JCOEF * absvalues,size_t * bits)426 jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
427                                    const int *jpeg_natural_order_start, int Sl,
428                                    int Al, JCOEF *absvalues, size_t *bits)
429 {
430   return 0;
431 }
432