• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * jsimd.h
3  *
4  * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5  * Copyright (C) 2011, 2014, D. R. Commander.
6  * Copyright (C) 2015-2016, 2018, Matthieu Darbois.
7  *
8  * Based on the x86 SIMD extension for IJG JPEG library,
9  * Copyright (C) 1999-2006, MIYASAKA Masaru.
10  * For conditions of distribution and use, see copyright notice in jsimdext.inc
11  *
12  */
13 
14 #include "jchuff.h"             /* Declarations shared with jcphuff.c */
15 
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);
21 
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);
38 
39 EXTERN(int) jsimd_can_h2v2_downsample(void);
40 EXTERN(int) jsimd_can_h2v1_downsample(void);
41 
42 EXTERN(void) jsimd_h2v2_downsample(j_compress_ptr cinfo,
43                                    jpeg_component_info *compptr,
44                                    JSAMPARRAY input_data,
45                                    JSAMPARRAY output_data);
46 
47 EXTERN(int) jsimd_can_h2v2_smooth_downsample(void);
48 
49 EXTERN(void) jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,
50                                           jpeg_component_info *compptr,
51                                           JSAMPARRAY input_data,
52                                           JSAMPARRAY output_data);
53 
54 EXTERN(void) jsimd_h2v1_downsample(j_compress_ptr cinfo,
55                                    jpeg_component_info *compptr,
56                                    JSAMPARRAY input_data,
57                                    JSAMPARRAY output_data);
58 
59 EXTERN(int) jsimd_can_h2v2_upsample(void);
60 EXTERN(int) jsimd_can_h2v1_upsample(void);
61 EXTERN(int) jsimd_can_int_upsample(void);
62 
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);
75 
76 EXTERN(int) jsimd_can_h2v2_fancy_upsample(void);
77 EXTERN(int) jsimd_can_h2v1_fancy_upsample(void);
78 
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);
87 
88 EXTERN(int) jsimd_can_h2v2_merged_upsample(void);
89 EXTERN(int) jsimd_can_h2v1_merged_upsample(void);
90 
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);
99 
100 EXTERN(int) jsimd_can_huff_encode_one_block(void);
101 
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);
118