Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1 | /* |
| 2 | * jsimd.h |
| 3 | * |
| 4 | * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
Alex Naidis | 6eb7d37 | 2016-10-16 23:10:08 +0200 | [diff] [blame] | 5 | * Copyright (C) 2011, 2014, D. R. Commander. |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 6 | * Copyright (C) 2015-2016, 2018, Matthieu Darbois. |
DRC | 1a45b81 | 2014-05-09 18:06:58 +0000 | [diff] [blame] | 7 | * |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 8 | * Based on the x86 SIMD extension for IJG JPEG library, |
| 9 | * Copyright (C) 1999-2006, MIYASAKA Masaru. |
DRC | af1ca9b | 2011-02-02 05:42:37 +0000 | [diff] [blame] | 10 | * For conditions of distribution and use, see copyright notice in jsimdext.inc |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 11 | * |
| 12 | */ |
| 13 | |
Alex Naidis | 6eb7d37 | 2016-10-16 23:10:08 +0200 | [diff] [blame] | 14 | #include "jchuff.h" /* Declarations shared with jcphuff.c */ |
| 15 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 16 | EXTERN(int) jsimd_can_rgb_ycc(void); |
| 17 | EXTERN(int) jsimd_can_rgb_gray(void); |
| 18 | EXTERN(int) jsimd_can_ycc_rgb(void); |
| 19 | EXTERN(int) jsimd_can_ycc_rgb565(void); |
| 20 | EXTERN(int) jsimd_c_can_null_convert(void); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 21 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 22 | EXTERN(void) jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, |
| 23 | JSAMPIMAGE output_buf, |
| 24 | JDIMENSION output_row, int num_rows); |
| 25 | EXTERN(void) jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, |
| 26 | JSAMPIMAGE output_buf, |
| 27 | JDIMENSION output_row, int num_rows); |
| 28 | EXTERN(void) jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, |
| 29 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 30 | JSAMPARRAY output_buf, int num_rows); |
| 31 | EXTERN(void) jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, |
| 32 | JSAMPIMAGE input_buf, |
| 33 | JDIMENSION input_row, |
| 34 | JSAMPARRAY output_buf, int num_rows); |
| 35 | EXTERN(void) jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, |
| 36 | JSAMPIMAGE output_buf, JDIMENSION output_row, |
| 37 | int num_rows); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 38 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 39 | EXTERN(int) jsimd_can_h2v2_downsample(void); |
| 40 | EXTERN(int) jsimd_can_h2v1_downsample(void); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 41 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 42 | EXTERN(void) jsimd_h2v2_downsample(j_compress_ptr cinfo, |
| 43 | jpeg_component_info *compptr, |
| 44 | JSAMPARRAY input_data, |
| 45 | JSAMPARRAY output_data); |
DRC | 6a61c1e | 2014-05-14 15:00:10 +0000 | [diff] [blame] | 46 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 47 | EXTERN(int) jsimd_can_h2v2_smooth_downsample(void); |
DRC | 6a61c1e | 2014-05-14 15:00:10 +0000 | [diff] [blame] | 48 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 49 | EXTERN(void) jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo, |
| 50 | jpeg_component_info *compptr, |
| 51 | JSAMPARRAY input_data, |
| 52 | JSAMPARRAY output_data); |
DRC | 6a61c1e | 2014-05-14 15:00:10 +0000 | [diff] [blame] | 53 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 54 | EXTERN(void) jsimd_h2v1_downsample(j_compress_ptr cinfo, |
| 55 | jpeg_component_info *compptr, |
| 56 | JSAMPARRAY input_data, |
| 57 | JSAMPARRAY output_data); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 58 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 59 | EXTERN(int) jsimd_can_h2v2_upsample(void); |
| 60 | EXTERN(int) jsimd_can_h2v1_upsample(void); |
| 61 | EXTERN(int) jsimd_can_int_upsample(void); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 62 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 63 | EXTERN(void) jsimd_h2v2_upsample(j_decompress_ptr cinfo, |
| 64 | jpeg_component_info *compptr, |
| 65 | JSAMPARRAY input_data, |
| 66 | JSAMPARRAY *output_data_ptr); |
| 67 | EXTERN(void) jsimd_h2v1_upsample(j_decompress_ptr cinfo, |
| 68 | jpeg_component_info *compptr, |
| 69 | JSAMPARRAY input_data, |
| 70 | JSAMPARRAY *output_data_ptr); |
| 71 | EXTERN(void) jsimd_int_upsample(j_decompress_ptr cinfo, |
| 72 | jpeg_component_info *compptr, |
| 73 | JSAMPARRAY input_data, |
| 74 | JSAMPARRAY *output_data_ptr); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 75 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 76 | EXTERN(int) jsimd_can_h2v2_fancy_upsample(void); |
| 77 | EXTERN(int) jsimd_can_h2v1_fancy_upsample(void); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 78 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 79 | EXTERN(void) jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, |
| 80 | jpeg_component_info *compptr, |
| 81 | JSAMPARRAY input_data, |
| 82 | JSAMPARRAY *output_data_ptr); |
| 83 | EXTERN(void) jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, |
| 84 | jpeg_component_info *compptr, |
| 85 | JSAMPARRAY input_data, |
| 86 | JSAMPARRAY *output_data_ptr); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 87 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 88 | EXTERN(int) jsimd_can_h2v2_merged_upsample(void); |
| 89 | EXTERN(int) jsimd_can_h2v1_merged_upsample(void); |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 90 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 91 | EXTERN(void) jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, |
| 92 | JSAMPIMAGE input_buf, |
| 93 | JDIMENSION in_row_group_ctr, |
| 94 | JSAMPARRAY output_buf); |
| 95 | EXTERN(void) jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, |
| 96 | JSAMPIMAGE input_buf, |
| 97 | JDIMENSION in_row_group_ctr, |
| 98 | JSAMPARRAY output_buf); |
Alex Naidis | 6eb7d37 | 2016-10-16 23:10:08 +0200 | [diff] [blame] | 99 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 100 | EXTERN(int) jsimd_can_huff_encode_one_block(void); |
Alex Naidis | 6eb7d37 | 2016-10-16 23:10:08 +0200 | [diff] [blame] | 101 | |
Leon Scroggins III | 3993b37 | 2018-07-16 10:43:45 -0400 | [diff] [blame] | 102 | EXTERN(JOCTET *) jsimd_huff_encode_one_block(void *state, JOCTET *buffer, |
| 103 | JCOEFPTR block, int last_dc_val, |
| 104 | c_derived_tbl *dctbl, |
| 105 | c_derived_tbl *actbl); |
| 106 | |
| 107 | EXTERN(int) jsimd_can_encode_mcu_AC_first_prepare(void); |
| 108 | |
| 109 | EXTERN(void) jsimd_encode_mcu_AC_first_prepare |
| 110 | (const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al, |
| 111 | JCOEF *values, size_t *zerobits); |
| 112 | |
| 113 | EXTERN(int) jsimd_can_encode_mcu_AC_refine_prepare(void); |
| 114 | |
| 115 | EXTERN(int) jsimd_encode_mcu_AC_refine_prepare |
| 116 | (const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al, |
| 117 | JCOEF *absvalues, size_t *bits); |