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, 2013-2014D. 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 * |
11 * This file contains the interface between the "normal" portions | 11 * This file contains the interface between the "normal" portions |
12 * of the library and the SIMD implementations when running on | 12 * of the library and the SIMD implementations when running on |
13 * ARM architecture. | 13 * ARM architecture. |
14 * | 14 * |
15 * Based on the stubs from 'jsimd_none.c' | 15 * Based on the stubs from 'jsimd_none.c' |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (sizeof(JDIMENSION) != 4) | 169 if (sizeof(JDIMENSION) != 4) |
170 return 0; | 170 return 0; |
171 if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) | 171 if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) |
172 return 0; | 172 return 0; |
173 if (simd_support & JSIMD_ARM_NEON) | 173 if (simd_support & JSIMD_ARM_NEON) |
174 return 1; | 174 return 1; |
175 | 175 |
176 return 0; | 176 return 0; |
177 } | 177 } |
178 | 178 |
| 179 GLOBAL(int) |
| 180 jsimd_can_ycc_rgb565 (void) |
| 181 { |
| 182 init_simd(); |
| 183 |
| 184 /* The code is optimised for these values only */ |
| 185 if (BITS_IN_JSAMPLE != 8) |
| 186 return 0; |
| 187 if (sizeof(JDIMENSION) != 4) |
| 188 return 0; |
| 189 |
| 190 if (simd_support & JSIMD_ARM_NEON) |
| 191 return 1; |
| 192 |
| 193 return 0; |
| 194 } |
| 195 |
179 GLOBAL(void) | 196 GLOBAL(void) |
180 jsimd_rgb_ycc_convert (j_compress_ptr cinfo, | 197 jsimd_rgb_ycc_convert (j_compress_ptr cinfo, |
181 JSAMPARRAY input_buf, JSAMPIMAGE output_buf, | 198 JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
182 JDIMENSION output_row, int num_rows) | 199 JDIMENSION output_row, int num_rows) |
183 { | 200 { |
184 void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); | 201 void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); |
185 | 202 |
186 switch(cinfo->in_color_space) | 203 switch(cinfo->in_color_space) |
187 { | 204 { |
188 case JCS_EXT_RGB: | 205 case JCS_EXT_RGB: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 neonfct=jsimd_ycc_extbgrx_convert_neon; | 265 neonfct=jsimd_ycc_extbgrx_convert_neon; |
249 break; | 266 break; |
250 case JCS_EXT_XBGR: | 267 case JCS_EXT_XBGR: |
251 case JCS_EXT_ABGR: | 268 case JCS_EXT_ABGR: |
252 neonfct=jsimd_ycc_extxbgr_convert_neon; | 269 neonfct=jsimd_ycc_extxbgr_convert_neon; |
253 break; | 270 break; |
254 case JCS_EXT_XRGB: | 271 case JCS_EXT_XRGB: |
255 case JCS_EXT_ARGB: | 272 case JCS_EXT_ARGB: |
256 neonfct=jsimd_ycc_extxrgb_convert_neon; | 273 neonfct=jsimd_ycc_extxrgb_convert_neon; |
257 break; | 274 break; |
258 default: | 275 default: |
259 neonfct=jsimd_ycc_extrgb_convert_neon; | 276 neonfct=jsimd_ycc_extrgb_convert_neon; |
260 break; | 277 break; |
261 } | 278 } |
262 | 279 |
263 if (simd_support & JSIMD_ARM_NEON) | 280 if (simd_support & JSIMD_ARM_NEON) |
264 neonfct(cinfo->output_width, input_buf, | 281 neonfct(cinfo->output_width, input_buf, |
265 input_row, output_buf, num_rows); | 282 input_row, output_buf, num_rows); |
266 } | 283 } |
267 | 284 |
| 285 GLOBAL(void) |
| 286 jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, |
| 287 JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 288 JSAMPARRAY output_buf, int num_rows) |
| 289 { |
| 290 if (simd_support & JSIMD_ARM_NEON) |
| 291 jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row, |
| 292 output_buf, num_rows); |
| 293 } |
| 294 |
268 GLOBAL(int) | 295 GLOBAL(int) |
269 jsimd_can_h2v2_downsample (void) | 296 jsimd_can_h2v2_downsample (void) |
270 { | 297 { |
271 init_simd(); | 298 init_simd(); |
272 | 299 |
273 return 0; | 300 return 0; |
274 } | 301 } |
275 | 302 |
276 GLOBAL(int) | 303 GLOBAL(int) |
277 jsimd_can_h2v1_downsample (void) | 304 jsimd_can_h2v1_downsample (void) |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col
); | 700 jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col
); |
674 } | 701 } |
675 | 702 |
676 GLOBAL(void) | 703 GLOBAL(void) |
677 jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, | 704 jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
678 JCOEFPTR coef_block, JSAMPARRAY output_buf, | 705 JCOEFPTR coef_block, JSAMPARRAY output_buf, |
679 JDIMENSION output_col) | 706 JDIMENSION output_col) |
680 { | 707 { |
681 } | 708 } |
682 | 709 |
OLD | NEW |