Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 1 | /* |
| 2 | * simd/jsimd.h |
| 3 | * |
| 4 | * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
| 5 | * |
| 6 | * Based on the x86 SIMD extension for IJG JPEG library, |
| 7 | * Copyright (C) 1999-2006, MIYASAKA Masaru. |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | /* Bitmask for supported acceleration methods */ |
| 12 | |
| 13 | #define JSIMD_NONE 0x00 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 14 | #define JSIMD_MMX 0x01 |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 15 | #define JSIMD_3DNOW 0x02 |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 16 | #define JSIMD_SSE 0x04 |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 17 | #define JSIMD_SSE2 0x08 |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 18 | |
| 19 | /* Short forms of external names for systems with brain-damaged linkers. */ |
| 20 | |
| 21 | #ifdef NEED_SHORT_EXTERNAL_NAMES |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 22 | #define jpeg_simd_cpu_support jSiCpuSupport |
| 23 | #define jsimd_rgb_ycc_convert_mmx jSRGBYCCM |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 24 | #define jsimd_extrgb_ycc_convert_mmx jSEXTRGBYCCM |
| 25 | #define jsimd_extrgbx_ycc_convert_mmx jSEXTRGBXYCCM |
| 26 | #define jsimd_extbgr_ycc_convert_mmx jSEXTBGRYCCM |
| 27 | #define jsimd_extbgrx_ycc_convert_mmx jSEXTBGRXYCCM |
| 28 | #define jsimd_extxbgr_ycc_convert_mmx jSEXTXBGRYCCM |
| 29 | #define jsimd_extxrgb_ycc_convert_mmx jSEXTXRGBYCCM |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 30 | #define jsimd_ycc_rgb_convert_mmx jSYCCRGBM |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 31 | #define jsimd_ycc_extrgb_convert_mmx jSYCCEXTRGBM |
| 32 | #define jsimd_ycc_extrgbx_convert_mmx jSYCCEXTRGBXM |
| 33 | #define jsimd_ycc_extbgr_convert_mmx jSYCCEXTBGRM |
| 34 | #define jsimd_ycc_extbgrx_convert_mmx jSYCCEXTBGRXM |
| 35 | #define jsimd_ycc_extxbgr_convert_mmx jSYCCEXTXBGRM |
| 36 | #define jsimd_ycc_extxrgb_convert_mmx jSYCCEXTXRGBM |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 37 | #define jconst_rgb_ycc_convert_sse2 jSCRGBYCCS2 |
| 38 | #define jsimd_rgb_ycc_convert_sse2 jSRGBYCCS2 |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 39 | #define jsimd_extrgb_ycc_convert_sse2 jSEXTRGBYCCS2 |
| 40 | #define jsimd_extrgbx_ycc_convert_sse2 jSEXTRGBXYCCS2 |
| 41 | #define jsimd_extbgr_ycc_convert_sse2 jSEXTBGRYCCS2 |
| 42 | #define jsimd_extbgrx_ycc_convert_sse2 jSEXTBGRXYCCS2 |
| 43 | #define jsimd_extxbgr_ycc_convert_sse2 jSEXTXBGRYCCS2 |
| 44 | #define jsimd_extxrgb_ycc_convert_sse2 jSEXTXRGBYCCS2 |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 45 | #define jconst_ycc_rgb_convert_sse2 jSCYCCRGBS2 |
| 46 | #define jsimd_ycc_rgb_convert_sse2 jSYCCRGBS2 |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 47 | #define jsimd_ycc_extrgb_convert_sse2 jSYCCEXTRGBS2 |
| 48 | #define jsimd_ycc_extrgbx_convert_sse2 jSYCCEXTRGBXS2 |
| 49 | #define jsimd_ycc_extbgr_convert_sse2 jSYCCEXTBGRS2 |
| 50 | #define jsimd_ycc_extbgrx_convert_sse2 jSYCCEXTBGRXS2 |
| 51 | #define jsimd_ycc_extxbgr_convert_sse2 jSYCCEXTXBGRS2 |
| 52 | #define jsimd_ycc_extxrgb_convert_sse2 jSYCCEXTXRGBS2 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 53 | #define jsimd_h2v2_downsample_mmx jSDnH2V2M |
| 54 | #define jsimd_h2v1_downsample_mmx jSDnH2V1M |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 55 | #define jsimd_h2v2_downsample_sse2 jSDnH2V2S2 |
| 56 | #define jsimd_h2v1_downsample_sse2 jSDnH2V1S2 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 57 | #define jsimd_h2v2_upsample_mmx jSUpH2V2M |
| 58 | #define jsimd_h2v1_upsample_mmx jSUpH2V1M |
| 59 | #define jsimd_h2v2_fancy_upsample_mmx jSFUpH2V2M |
| 60 | #define jsimd_h2v1_fancy_upsample_mmx jSFUpH2V1M |
| 61 | #define jsimd_h2v2_merged_upsample_mmx jSMUpH2V2M |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 62 | #define jsimd_h2v2_extrgb_merged_upsample_mmx jSMUpH2V2EXTRGBM |
| 63 | #define jsimd_h2v2_extrgbx_merged_upsample_mmx jSMUpH2V2EXTRGBXM |
| 64 | #define jsimd_h2v2_extbgr_merged_upsample_mmx jSMUpH2V2EXTBGRM |
| 65 | #define jsimd_h2v2_extbgrx_merged_upsample_mmx jSMUpH2V2EXTBGRXM |
| 66 | #define jsimd_h2v2_extxbgr_merged_upsample_mmx jSMUpH2V2EXTXBGRM |
| 67 | #define jsimd_h2v2_extxrgb_merged_upsample_mmx jSMUpH2V2EXTXRGBM |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 68 | #define jsimd_h2v1_merged_upsample_mmx jSMUpH2V1M |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 69 | #define jsimd_h2v1_extrgb_merged_upsample_mmx jSMUpH2V1EXTRGBM |
| 70 | #define jsimd_h2v1_extrgbx_merged_upsample_mmx jSMUpH2V1EXTRGBXM |
| 71 | #define jsimd_h2v1_extbgr_merged_upsample_mmx jSMUpH2V1EXTBGRM |
| 72 | #define jsimd_h2v1_extbgrx_merged_upsample_mmx jSMUpH2V1EXTBGRXM |
| 73 | #define jsimd_h2v1_extxbgr_merged_upsample_mmx jSMUpH2V1EXTXBGRM |
| 74 | #define jsimd_h2v1_extxrgb_merged_upsample_mmx jSMUpH2V1EXTXRGBM |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 75 | #define jsimd_h2v2_upsample_sse2 jSUpH2V2S2 |
| 76 | #define jsimd_h2v1_upsample_sse2 jSUpH2V1S2 |
| 77 | #define jconst_fancy_upsample_sse2 jSCFUpS2 |
| 78 | #define jsimd_h2v2_fancy_upsample_sse2 jSFUpH2V2S2 |
| 79 | #define jsimd_h2v1_fancy_upsample_sse2 jSFUpH2V1S2 |
| 80 | #define jconst_merged_upsample_sse2 jSCMUpS2 |
| 81 | #define jsimd_h2v2_merged_upsample_sse2 jSMUpH2V2S2 |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 82 | #define jsimd_h2v2_extrgb_merged_upsample_sse2 jSMUpH2V2EXTRGBS2 |
| 83 | #define jsimd_h2v2_extrgbx_merged_upsample_sse2 jSMUpH2V2EXTRGBXS2 |
| 84 | #define jsimd_h2v2_extbgr_merged_upsample_sse2 jSMUpH2V2EXTBGRS2 |
| 85 | #define jsimd_h2v2_extbgrx_merged_upsample_sse2 jSMUpH2V2EXTBGRXS2 |
| 86 | #define jsimd_h2v2_extxbgr_merged_upsample_sse2 jSMUpH2V2EXTXBGRS2 |
| 87 | #define jsimd_h2v2_extxrgb_merged_upsample_sse2 jSMUpH2V2EXTXRGBS2 |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 88 | #define jsimd_h2v1_merged_upsample_sse2 jSMUpH2V1S2 |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 89 | #define jsimd_h2v1_extrgb_merged_upsample_sse2 jSMUpH2V1EXTRGBS2 |
| 90 | #define jsimd_h2v1_extrgbx_merged_upsample_sse2 jSMUpH2V1EXTRGBXS2 |
| 91 | #define jsimd_h2v1_extbgr_merged_upsample_sse2 jSMUpH2V1EXTBGRS2 |
| 92 | #define jsimd_h2v1_extbgrx_merged_upsample_sse2 jSMUpH2V1EXTBGRXS2 |
| 93 | #define jsimd_h2v1_extxbgr_merged_upsample_sse2 jSMUpH2V1EXTXBGRS2 |
| 94 | #define jsimd_h2v1_extxrgb_merged_upsample_sse2 jSMUpH2V1EXTXRGBS2 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 95 | #define jsimd_convsamp_mmx jSConvM |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 96 | #define jsimd_convsamp_sse2 jSConvS2 |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 97 | #define jsimd_convsamp_float_3dnow jSConvF3D |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 98 | #define jsimd_convsamp_float_sse jSConvFS |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 99 | #define jsimd_convsamp_float_sse2 jSConvFS2 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 100 | #define jsimd_fdct_islow_mmx jSFDMIS |
| 101 | #define jsimd_fdct_ifast_mmx jSFDMIF |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 102 | #define jconst_fdct_islow_sse2 jSCFDS2IS |
| 103 | #define jsimd_fdct_islow_sse2 jSFDS2IS |
| 104 | #define jconst_fdct_ifast_sse2 jSCFDS2IF |
| 105 | #define jsimd_fdct_ifast_sse2 jSFDS2IF |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 106 | #define jsimd_fdct_float_3dnow jSFD3DF |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 107 | #define jconst_fdct_float_sse jSCFDSF |
| 108 | #define jsimd_fdct_float_sse jSFDSF |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 109 | #define jsimd_quantize_mmx jSQuantM |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 110 | #define jsimd_quantize_sse2 jSQuantS2 |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 111 | #define jsimd_quantize_float_3dnow jSQuantF3D |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 112 | #define jsimd_quantize_float_sse jSQuantFS |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 113 | #define jsimd_quantize_float_sse2 jSQuantFS2 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 114 | #define jsimd_idct_2x2_mmx jSIDM22 |
| 115 | #define jsimd_idct_4x4_mmx jSIDM44 |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 116 | #define jconst_idct_red_sse2 jSCIDS2R |
| 117 | #define jsimd_idct_2x2_sse2 jSIDS222 |
| 118 | #define jsimd_idct_4x4_sse2 jSIDS244 |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 119 | #define jsimd_idct_islow_mmx jSIDMIS |
| 120 | #define jsimd_idct_ifast_mmx jSIDMIF |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 121 | #define jconst_idct_islow_sse2 jSCIDS2IS |
| 122 | #define jsimd_idct_islow_sse2 jSIDS2IS |
| 123 | #define jconst_idct_ifast_sse2 jSCIDS2IF |
| 124 | #define jsimd_idct_ifast_sse2 jSIDS2IF |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 125 | #define jsimd_idct_float_3dnow jSID3DF |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 126 | #define jconst_fdct_float_sse jSCIDSF |
| 127 | #define jsimd_idct_float_sse jSIDSF |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 128 | #define jconst_fdct_float_sse2 jSCIDS2F |
| 129 | #define jsimd_idct_float_sse2 jSIDS2F |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 130 | #endif /* NEED_SHORT_EXTERNAL_NAMES */ |
| 131 | |
| 132 | /* SIMD Ext: retrieve SIMD/CPU information */ |
| 133 | EXTERN(unsigned int) jpeg_simd_cpu_support JPP((void)); |
| 134 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 135 | /* SIMD Color Space Conversion */ |
| 136 | EXTERN(void) jsimd_rgb_ycc_convert_mmx |
| 137 | JPP((JDIMENSION img_width, |
| 138 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 139 | JDIMENSION output_row, int num_rows)); |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 140 | EXTERN(void) jsimd_extrgb_ycc_convert_mmx |
| 141 | JPP((JDIMENSION img_width, |
| 142 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 143 | JDIMENSION output_row, int num_rows)); |
| 144 | EXTERN(void) jsimd_extrgbx_ycc_convert_mmx |
| 145 | JPP((JDIMENSION img_width, |
| 146 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 147 | JDIMENSION output_row, int num_rows)); |
| 148 | EXTERN(void) jsimd_extbgr_ycc_convert_mmx |
| 149 | JPP((JDIMENSION img_width, |
| 150 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 151 | JDIMENSION output_row, int num_rows)); |
| 152 | EXTERN(void) jsimd_extbgrx_ycc_convert_mmx |
| 153 | JPP((JDIMENSION img_width, |
| 154 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 155 | JDIMENSION output_row, int num_rows)); |
| 156 | EXTERN(void) jsimd_extxbgr_ycc_convert_mmx |
| 157 | JPP((JDIMENSION img_width, |
| 158 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 159 | JDIMENSION output_row, int num_rows)); |
| 160 | EXTERN(void) jsimd_extxrgb_ycc_convert_mmx |
| 161 | JPP((JDIMENSION img_width, |
| 162 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 163 | JDIMENSION output_row, int num_rows)); |
| 164 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 165 | EXTERN(void) jsimd_ycc_rgb_convert_mmx |
| 166 | JPP((JDIMENSION out_width, |
| 167 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 168 | JSAMPARRAY output_buf, int num_rows)); |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 169 | EXTERN(void) jsimd_ycc_extrgb_convert_mmx |
| 170 | JPP((JDIMENSION out_width, |
| 171 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 172 | JSAMPARRAY output_buf, int num_rows)); |
| 173 | EXTERN(void) jsimd_ycc_extrgbx_convert_mmx |
| 174 | JPP((JDIMENSION out_width, |
| 175 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 176 | JSAMPARRAY output_buf, int num_rows)); |
| 177 | EXTERN(void) jsimd_ycc_extbgr_convert_mmx |
| 178 | JPP((JDIMENSION out_width, |
| 179 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 180 | JSAMPARRAY output_buf, int num_rows)); |
| 181 | EXTERN(void) jsimd_ycc_extbgrx_convert_mmx |
| 182 | JPP((JDIMENSION out_width, |
| 183 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 184 | JSAMPARRAY output_buf, int num_rows)); |
| 185 | EXTERN(void) jsimd_ycc_extxbgr_convert_mmx |
| 186 | JPP((JDIMENSION out_width, |
| 187 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 188 | JSAMPARRAY output_buf, int num_rows)); |
| 189 | EXTERN(void) jsimd_ycc_extxrgb_convert_mmx |
| 190 | JPP((JDIMENSION out_width, |
| 191 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 192 | JSAMPARRAY output_buf, int num_rows)); |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 193 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 194 | extern const int jconst_rgb_ycc_convert_sse2[]; |
| 195 | EXTERN(void) jsimd_rgb_ycc_convert_sse2 |
| 196 | JPP((JDIMENSION img_width, |
| 197 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 198 | JDIMENSION output_row, int num_rows)); |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 199 | EXTERN(void) jsimd_extrgb_ycc_convert_sse2 |
| 200 | JPP((JDIMENSION img_width, |
| 201 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 202 | JDIMENSION output_row, int num_rows)); |
| 203 | EXTERN(void) jsimd_extrgbx_ycc_convert_sse2 |
| 204 | JPP((JDIMENSION img_width, |
| 205 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 206 | JDIMENSION output_row, int num_rows)); |
| 207 | EXTERN(void) jsimd_extbgr_ycc_convert_sse2 |
| 208 | JPP((JDIMENSION img_width, |
| 209 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 210 | JDIMENSION output_row, int num_rows)); |
| 211 | EXTERN(void) jsimd_extbgrx_ycc_convert_sse2 |
| 212 | JPP((JDIMENSION img_width, |
| 213 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 214 | JDIMENSION output_row, int num_rows)); |
| 215 | EXTERN(void) jsimd_extxbgr_ycc_convert_sse2 |
| 216 | JPP((JDIMENSION img_width, |
| 217 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 218 | JDIMENSION output_row, int num_rows)); |
| 219 | EXTERN(void) jsimd_extxrgb_ycc_convert_sse2 |
| 220 | JPP((JDIMENSION img_width, |
| 221 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 222 | JDIMENSION output_row, int num_rows)); |
| 223 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 224 | extern const int jconst_ycc_rgb_convert_sse2[]; |
| 225 | EXTERN(void) jsimd_ycc_rgb_convert_sse2 |
| 226 | JPP((JDIMENSION out_width, |
| 227 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 228 | JSAMPARRAY output_buf, int num_rows)); |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 229 | EXTERN(void) jsimd_ycc_extrgb_convert_sse2 |
| 230 | JPP((JDIMENSION out_width, |
| 231 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 232 | JSAMPARRAY output_buf, int num_rows)); |
| 233 | EXTERN(void) jsimd_ycc_extrgbx_convert_sse2 |
| 234 | JPP((JDIMENSION out_width, |
| 235 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 236 | JSAMPARRAY output_buf, int num_rows)); |
| 237 | EXTERN(void) jsimd_ycc_extbgr_convert_sse2 |
| 238 | JPP((JDIMENSION out_width, |
| 239 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 240 | JSAMPARRAY output_buf, int num_rows)); |
| 241 | EXTERN(void) jsimd_ycc_extbgrx_convert_sse2 |
| 242 | JPP((JDIMENSION out_width, |
| 243 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 244 | JSAMPARRAY output_buf, int num_rows)); |
| 245 | EXTERN(void) jsimd_ycc_extxbgr_convert_sse2 |
| 246 | JPP((JDIMENSION out_width, |
| 247 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 248 | JSAMPARRAY output_buf, int num_rows)); |
| 249 | EXTERN(void) jsimd_ycc_extxrgb_convert_sse2 |
| 250 | JPP((JDIMENSION out_width, |
| 251 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 252 | JSAMPARRAY output_buf, int num_rows)); |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 253 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 254 | /* SIMD Downsample */ |
| 255 | EXTERN(void) jsimd_h2v2_downsample_mmx |
| 256 | JPP((JDIMENSION image_width, int max_v_samp_factor, |
| 257 | JDIMENSION v_samp_factor, JDIMENSION width_blocks, |
| 258 | JSAMPARRAY input_data, JSAMPARRAY output_data)); |
| 259 | EXTERN(void) jsimd_h2v1_downsample_mmx |
| 260 | JPP((JDIMENSION image_width, int max_v_samp_factor, |
| 261 | JDIMENSION v_samp_factor, JDIMENSION width_blocks, |
| 262 | JSAMPARRAY input_data, JSAMPARRAY output_data)); |
| 263 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 264 | EXTERN(void) jsimd_h2v2_downsample_sse2 |
| 265 | JPP((JDIMENSION image_width, int max_v_samp_factor, |
| 266 | JDIMENSION v_samp_factor, JDIMENSION width_blocks, |
| 267 | JSAMPARRAY input_data, JSAMPARRAY output_data)); |
| 268 | EXTERN(void) jsimd_h2v1_downsample_sse2 |
| 269 | JPP((JDIMENSION image_width, int max_v_samp_factor, |
| 270 | JDIMENSION v_samp_factor, JDIMENSION width_blocks, |
| 271 | JSAMPARRAY input_data, JSAMPARRAY output_data)); |
| 272 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 273 | /* SIMD Upsample */ |
| 274 | EXTERN(void) jsimd_h2v2_upsample_mmx |
| 275 | JPP((int max_v_samp_factor, JDIMENSION output_width, |
| 276 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 277 | EXTERN(void) jsimd_h2v1_upsample_mmx |
| 278 | JPP((int max_v_samp_factor, JDIMENSION output_width, |
| 279 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 280 | |
| 281 | EXTERN(void) jsimd_h2v2_fancy_upsample_mmx |
| 282 | JPP((int max_v_samp_factor, JDIMENSION downsampled_width, |
| 283 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 284 | EXTERN(void) jsimd_h2v1_fancy_upsample_mmx |
| 285 | JPP((int max_v_samp_factor, JDIMENSION downsampled_width, |
| 286 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 287 | |
| 288 | EXTERN(void) jsimd_h2v2_merged_upsample_mmx |
| 289 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 290 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 291 | EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx |
| 292 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 293 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 294 | EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx |
| 295 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 296 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 297 | EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx |
| 298 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 299 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 300 | EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx |
| 301 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 302 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 303 | EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx |
| 304 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 305 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 306 | EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx |
| 307 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 308 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 309 | EXTERN(void) jsimd_h2v1_merged_upsample_mmx |
| 310 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 311 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 312 | EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx |
| 313 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 314 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 315 | EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx |
| 316 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 317 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 318 | EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx |
| 319 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 320 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 321 | EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx |
| 322 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 323 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 324 | EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx |
| 325 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 326 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 327 | EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx |
| 328 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 329 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 330 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 331 | EXTERN(void) jsimd_h2v2_upsample_sse2 |
| 332 | JPP((int max_v_samp_factor, JDIMENSION output_width, |
| 333 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 334 | EXTERN(void) jsimd_h2v1_upsample_sse2 |
| 335 | JPP((int max_v_samp_factor, JDIMENSION output_width, |
| 336 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 337 | |
| 338 | extern const int jconst_fancy_upsample_sse2[]; |
| 339 | EXTERN(void) jsimd_h2v2_fancy_upsample_sse2 |
| 340 | JPP((int max_v_samp_factor, JDIMENSION downsampled_width, |
| 341 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 342 | EXTERN(void) jsimd_h2v1_fancy_upsample_sse2 |
| 343 | JPP((int max_v_samp_factor, JDIMENSION downsampled_width, |
| 344 | JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); |
| 345 | |
| 346 | extern const int jconst_merged_upsample_sse2[]; |
| 347 | EXTERN(void) jsimd_h2v2_merged_upsample_sse2 |
| 348 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 349 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 350 | EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2 |
| 351 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 352 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 353 | EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2 |
| 354 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 355 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 356 | EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2 |
| 357 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 358 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 359 | EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2 |
| 360 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 361 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 362 | EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2 |
| 363 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 364 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 365 | EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2 |
| 366 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 367 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 368 | EXTERN(void) jsimd_h2v1_merged_upsample_sse2 |
| 369 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 370 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 371 | EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2 |
| 372 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 373 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 374 | EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2 |
| 375 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 376 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 377 | EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2 |
| 378 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 379 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 380 | EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2 |
| 381 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 382 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 383 | EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2 |
| 384 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 385 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
| 386 | EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2 |
| 387 | JPP((JDIMENSION output_width, JSAMPIMAGE input_buf, |
| 388 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)); |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 389 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 390 | /* SIMD Sample Conversion */ |
| 391 | EXTERN(void) jsimd_convsamp_mmx JPP((JSAMPARRAY sample_data, |
| 392 | JDIMENSION start_col, |
| 393 | DCTELEM * workspace)); |
| 394 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 395 | EXTERN(void) jsimd_convsamp_sse2 JPP((JSAMPARRAY sample_data, |
| 396 | JDIMENSION start_col, |
| 397 | DCTELEM * workspace)); |
| 398 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 399 | EXTERN(void) jsimd_convsamp_float_3dnow JPP((JSAMPARRAY sample_data, |
| 400 | JDIMENSION start_col, |
| 401 | FAST_FLOAT * workspace)); |
| 402 | |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 403 | EXTERN(void) jsimd_convsamp_float_sse JPP((JSAMPARRAY sample_data, |
| 404 | JDIMENSION start_col, |
| 405 | FAST_FLOAT * workspace)); |
| 406 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 407 | EXTERN(void) jsimd_convsamp_float_sse2 JPP((JSAMPARRAY sample_data, |
| 408 | JDIMENSION start_col, |
| 409 | FAST_FLOAT * workspace)); |
| 410 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 411 | /* SIMD Forward DCT */ |
| 412 | EXTERN(void) jsimd_fdct_islow_mmx JPP((DCTELEM * data)); |
| 413 | EXTERN(void) jsimd_fdct_ifast_mmx JPP((DCTELEM * data)); |
| 414 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 415 | extern const int jconst_fdct_ifast_sse2[]; |
| 416 | EXTERN(void) jsimd_fdct_islow_sse2 JPP((DCTELEM * data)); |
| 417 | extern const int jconst_fdct_islow_sse2[]; |
| 418 | EXTERN(void) jsimd_fdct_ifast_sse2 JPP((DCTELEM * data)); |
| 419 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 420 | EXTERN(void) jsimd_fdct_float_3dnow JPP((FAST_FLOAT * data)); |
| 421 | |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 422 | extern const int jconst_fdct_float_sse[]; |
| 423 | EXTERN(void) jsimd_fdct_float_sse JPP((FAST_FLOAT * data)); |
| 424 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 425 | /* SIMD Quantization */ |
| 426 | EXTERN(void) jsimd_quantize_mmx JPP((JCOEFPTR coef_block, |
| 427 | DCTELEM * divisors, |
| 428 | DCTELEM * workspace)); |
| 429 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 430 | EXTERN(void) jsimd_quantize_sse2 JPP((JCOEFPTR coef_block, |
| 431 | DCTELEM * divisors, |
| 432 | DCTELEM * workspace)); |
| 433 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 434 | EXTERN(void) jsimd_quantize_float_3dnow JPP((JCOEFPTR coef_block, |
| 435 | FAST_FLOAT * divisors, |
| 436 | FAST_FLOAT * workspace)); |
| 437 | |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 438 | EXTERN(void) jsimd_quantize_float_sse JPP((JCOEFPTR coef_block, |
| 439 | FAST_FLOAT * divisors, |
| 440 | FAST_FLOAT * workspace)); |
| 441 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 442 | EXTERN(void) jsimd_quantize_float_sse2 JPP((JCOEFPTR coef_block, |
| 443 | FAST_FLOAT * divisors, |
| 444 | FAST_FLOAT * workspace)); |
| 445 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 446 | /* SIMD Reduced Inverse DCT */ |
| 447 | EXTERN(void) jsimd_idct_2x2_mmx JPP((void * dct_table, |
| 448 | JCOEFPTR coef_block, |
| 449 | JSAMPARRAY output_buf, |
| 450 | JDIMENSION output_col)); |
| 451 | EXTERN(void) jsimd_idct_4x4_mmx JPP((void * dct_table, |
| 452 | JCOEFPTR coef_block, |
| 453 | JSAMPARRAY output_buf, |
| 454 | JDIMENSION output_col)); |
| 455 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 456 | extern const int jconst_idct_red_sse2[]; |
| 457 | EXTERN(void) jsimd_idct_2x2_sse2 JPP((void * dct_table, |
| 458 | JCOEFPTR coef_block, |
| 459 | JSAMPARRAY output_buf, |
| 460 | JDIMENSION output_col)); |
| 461 | EXTERN(void) jsimd_idct_4x4_sse2 JPP((void * dct_table, |
| 462 | JCOEFPTR coef_block, |
| 463 | JSAMPARRAY output_buf, |
| 464 | JDIMENSION output_col)); |
| 465 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 466 | /* SIMD Inverse DCT */ |
| 467 | EXTERN(void) jsimd_idct_islow_mmx JPP((void * dct_table, |
| 468 | JCOEFPTR coef_block, |
| 469 | JSAMPARRAY output_buf, |
| 470 | JDIMENSION output_col)); |
| 471 | EXTERN(void) jsimd_idct_ifast_mmx JPP((void * dct_table, |
| 472 | JCOEFPTR coef_block, |
| 473 | JSAMPARRAY output_buf, |
| 474 | JDIMENSION output_col)); |
| 475 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 476 | extern const int jconst_idct_islow_sse2[]; |
| 477 | EXTERN(void) jsimd_idct_islow_sse2 JPP((void * dct_table, |
| 478 | JCOEFPTR coef_block, |
| 479 | JSAMPARRAY output_buf, |
| 480 | JDIMENSION output_col)); |
| 481 | extern const int jconst_idct_ifast_sse2[]; |
| 482 | EXTERN(void) jsimd_idct_ifast_sse2 JPP((void * dct_table, |
| 483 | JCOEFPTR coef_block, |
| 484 | JSAMPARRAY output_buf, |
| 485 | JDIMENSION output_col)); |
| 486 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 487 | EXTERN(void) jsimd_idct_float_3dnow JPP((void * dct_table, |
| 488 | JCOEFPTR coef_block, |
| 489 | JSAMPARRAY output_buf, |
| 490 | JDIMENSION output_col)); |
| 491 | |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 492 | extern const int jconst_idct_float_sse[]; |
| 493 | EXTERN(void) jsimd_idct_float_sse JPP((void * dct_table, |
| 494 | JCOEFPTR coef_block, |
| 495 | JSAMPARRAY output_buf, |
| 496 | JDIMENSION output_col)); |
| 497 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 498 | extern const int jconst_idct_float_sse2[]; |
| 499 | EXTERN(void) jsimd_idct_float_sse2 JPP((void * dct_table, |
| 500 | JCOEFPTR coef_block, |
| 501 | JSAMPARRAY output_buf, |
| 502 | JDIMENSION output_col)); |
| 503 | |