OLD | NEW |
1 /* | 1 /* |
2 * jsimd_arm.c | 2 * jsimd_arm.c |
3 * | 3 * |
4 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB | 4 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
5 * Copyright 2009-2011 D. R. Commander | 5 * Copyright 2009-2011 D. R. Commander |
6 * | 6 * |
7 * Based on the x86 SIMD extension for IJG JPEG library, | 7 * Based on the x86 SIMD extension for IJG JPEG library, |
8 * Copyright (C) 1999-2006, MIYASAKA Masaru. | 8 * Copyright (C) 1999-2006, MIYASAKA Masaru. |
9 * For conditions of distribution and use, see copyright notice in jsimdext.inc | 9 * For conditions of distribution and use, see copyright notice in jsimdext.inc |
10 * | 10 * |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 * FIXME: This code is racy under a multi-threaded environment. | 97 * FIXME: This code is racy under a multi-threaded environment. |
98 */ | 98 */ |
99 LOCAL(void) | 99 LOCAL(void) |
100 init_simd (void) | 100 init_simd (void) |
101 { | 101 { |
102 char *env = NULL; | 102 char *env = NULL; |
103 #if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(
__ANDROID__) | 103 #if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(
__ANDROID__) |
104 int bufsize = 1024; /* an initial guess for the line buffer size limit */ | 104 int bufsize = 1024; /* an initial guess for the line buffer size limit */ |
105 #endif | 105 #endif |
106 | 106 |
107 if (simd_support != ~0) | 107 if (simd_support != ~0U) |
108 return; | 108 return; |
109 | 109 |
110 simd_support = 0; | 110 simd_support = 0; |
111 | 111 |
112 #if defined(__ARM_NEON__) | 112 #if defined(__ARM_NEON__) |
113 simd_support |= JSIMD_ARM_NEON; | 113 simd_support |= JSIMD_ARM_NEON; |
114 #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) | 114 #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) |
115 /* We still have a chance to use NEON regardless of globally used | 115 /* We still have a chance to use NEON regardless of globally used |
116 * -mcpu/-mfpu options passed to gcc by performing runtime detection via | 116 * -mcpu/-mfpu options passed to gcc by performing runtime detection via |
117 * /proc/cpuinfo parsing on linux/android */ | 117 * /proc/cpuinfo parsing on linux/android */ |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 init_simd(); | 331 init_simd(); |
332 | 332 |
333 return 0; | 333 return 0; |
334 } | 334 } |
335 | 335 |
336 GLOBAL(int) | 336 GLOBAL(int) |
337 jsimd_can_h2v1_fancy_upsample (void) | 337 jsimd_can_h2v1_fancy_upsample (void) |
338 { | 338 { |
339 init_simd(); | 339 init_simd(); |
340 | 340 |
| 341 /* The code is optimised for these values only */ |
| 342 if (BITS_IN_JSAMPLE != 8) |
| 343 return 0; |
| 344 if (sizeof(JDIMENSION) != 4) |
| 345 return 0; |
| 346 |
| 347 if (simd_support & JSIMD_ARM_NEON) |
| 348 return 1; |
| 349 |
341 return 0; | 350 return 0; |
342 } | 351 } |
343 | 352 |
344 GLOBAL(void) | 353 GLOBAL(void) |
345 jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, | 354 jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, |
346 jpeg_component_info * compptr, | 355 jpeg_component_info * compptr, |
347 JSAMPARRAY input_data, | 356 JSAMPARRAY input_data, |
348 JSAMPARRAY * output_data_ptr) | 357 JSAMPARRAY * output_data_ptr) |
349 { | 358 { |
350 } | 359 } |
351 | 360 |
352 GLOBAL(void) | 361 GLOBAL(void) |
353 jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, | 362 jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, |
354 jpeg_component_info * compptr, | 363 jpeg_component_info * compptr, |
355 JSAMPARRAY input_data, | 364 JSAMPARRAY input_data, |
356 JSAMPARRAY * output_data_ptr) | 365 JSAMPARRAY * output_data_ptr) |
357 { | 366 { |
| 367 if (simd_support & JSIMD_ARM_NEON) |
| 368 jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor, |
| 369 compptr->downsampled_width, input_data, output_data_ptr); |
358 } | 370 } |
359 | 371 |
360 GLOBAL(int) | 372 GLOBAL(int) |
361 jsimd_can_h2v2_merged_upsample (void) | 373 jsimd_can_h2v2_merged_upsample (void) |
362 { | 374 { |
363 init_simd(); | 375 init_simd(); |
364 | 376 |
365 return 0; | 377 return 0; |
366 } | 378 } |
367 | 379 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col
); | 673 jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col
); |
662 } | 674 } |
663 | 675 |
664 GLOBAL(void) | 676 GLOBAL(void) |
665 jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, | 677 jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
666 JCOEFPTR coef_block, JSAMPARRAY output_buf, | 678 JCOEFPTR coef_block, JSAMPARRAY output_buf, |
667 JDIMENSION output_col) | 679 JDIMENSION output_col) |
668 { | 680 { |
669 } | 681 } |
670 | 682 |
OLD | NEW |