Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1 | /* |
| 2 | * jsimd.c |
| 3 | * |
| 4 | * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 5 | * Copyright 2009 D. R. Commander |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 6 | * |
| 7 | * Based on the x86 SIMD extension for IJG JPEG library, |
| 8 | * Copyright (C) 1999-2006, MIYASAKA Masaru. |
| 9 | * |
| 10 | * This file contains the interface between the "normal" portions |
| 11 | * of the library and the SIMD implementations. |
| 12 | */ |
| 13 | |
| 14 | #define JPEG_INTERNALS |
| 15 | #include "jinclude.h" |
| 16 | #include "jpeglib.h" |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 17 | #include "jsimd.h" |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 18 | #include "jdct.h" |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 19 | #include "jsimddct.h" |
| 20 | #include "simd/jsimd.h" |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 21 | |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 22 | /* |
| 23 | * In the PIC cases, we have no guarantee that constants will keep |
| 24 | * their alignment. This macro allows us to verify it at runtime. |
| 25 | */ |
| 26 | #ifdef WITH_SIMD |
| 27 | #define IS_ALIGNED(ptr, order) (((unsigned)ptr & ((1 << order) - 1)) == 0) |
| 28 | #else |
| 29 | #define IS_ALIGNED(ptr, order) (0) |
| 30 | #endif |
| 31 | |
| 32 | #define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */ |
| 33 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 34 | static unsigned int simd_support = ~0; |
| 35 | |
| 36 | /* |
| 37 | * Check what SIMD accelerations are supported. |
| 38 | * |
| 39 | * FIXME: This code is racy under a multi-threaded environment. |
| 40 | */ |
| 41 | LOCAL(void) |
| 42 | init_simd (void) |
| 43 | { |
DRC | 59c1a25 | 2009-04-03 11:27:17 +0000 | [diff] [blame] | 44 | #ifdef WITH_SIMD |
| 45 | char *env = NULL; |
| 46 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 47 | if (simd_support != ~0) |
| 48 | return; |
| 49 | |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 50 | #ifdef WITH_SIMD |
| 51 | simd_support = jpeg_simd_cpu_support(); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 52 | #ifndef __x86_64__ |
DRC | 59c1a25 | 2009-04-03 11:27:17 +0000 | [diff] [blame] | 53 | if((env=getenv("JSIMD_FORCEMMX"))!=NULL && !strcmp(env, "1")) |
| 54 | simd_support = JSIMD_MMX; |
| 55 | else if((env=getenv("JSIMD_FORCESSE2"))!=NULL && !strcmp(env, "1")) |
| 56 | simd_support = JSIMD_SSE2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 57 | #endif |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 58 | #else |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 59 | simd_support = JSIMD_NONE; |
Pierre Ossman | 2ae181c | 2009-03-09 13:21:27 +0000 | [diff] [blame] | 60 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | GLOBAL(int) |
| 64 | jsimd_can_rgb_ycc (void) |
| 65 | { |
| 66 | init_simd(); |
| 67 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 68 | /* The code is optimised for these values only */ |
| 69 | if (BITS_IN_JSAMPLE != 8) |
| 70 | return 0; |
| 71 | if (sizeof(JDIMENSION) != 4) |
| 72 | return 0; |
| 73 | if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) |
| 74 | return 0; |
| 75 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 76 | if ((simd_support & JSIMD_SSE2) && |
| 77 | IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2)) |
| 78 | return 1; |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 79 | if (simd_support & JSIMD_MMX) |
| 80 | return 1; |
| 81 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | GLOBAL(int) |
| 86 | jsimd_can_ycc_rgb (void) |
| 87 | { |
| 88 | init_simd(); |
| 89 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 90 | /* The code is optimised for these values only */ |
| 91 | if (BITS_IN_JSAMPLE != 8) |
| 92 | return 0; |
| 93 | if (sizeof(JDIMENSION) != 4) |
| 94 | return 0; |
| 95 | if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) |
| 96 | return 0; |
| 97 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 98 | if ((simd_support & JSIMD_SSE2) && |
| 99 | IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2)) |
| 100 | return 1; |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 101 | if (simd_support & JSIMD_MMX) |
| 102 | return 1; |
| 103 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 104 | return 0; |
| 105 | } |
| 106 | |
| 107 | GLOBAL(void) |
| 108 | jsimd_rgb_ycc_convert (j_compress_ptr cinfo, |
| 109 | JSAMPARRAY input_buf, JSAMPIMAGE output_buf, |
| 110 | JDIMENSION output_row, int num_rows) |
| 111 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 112 | #ifdef WITH_SIMD |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 113 | void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 114 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 115 | void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 116 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 117 | switch(cinfo->in_color_space) |
| 118 | { |
| 119 | case JCS_EXT_RGB: |
| 120 | sse2fct=jsimd_extrgb_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 121 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 122 | mmxfct=jsimd_extrgb_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 123 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 124 | break; |
| 125 | case JCS_EXT_RGBX: |
| 126 | sse2fct=jsimd_extrgbx_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 127 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 128 | mmxfct=jsimd_extrgbx_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 129 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 130 | break; |
| 131 | case JCS_EXT_BGR: |
| 132 | sse2fct=jsimd_extbgr_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 133 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 134 | mmxfct=jsimd_extbgr_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 135 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 136 | break; |
| 137 | case JCS_EXT_BGRX: |
| 138 | sse2fct=jsimd_extbgrx_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 139 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 140 | mmxfct=jsimd_extbgrx_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 141 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 142 | break; |
| 143 | case JCS_EXT_XBGR: |
| 144 | sse2fct=jsimd_extxbgr_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 145 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 146 | mmxfct=jsimd_extxbgr_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 147 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 148 | break; |
| 149 | case JCS_EXT_XRGB: |
| 150 | sse2fct=jsimd_extxrgb_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 151 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 152 | mmxfct=jsimd_extxrgb_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 153 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 154 | break; |
| 155 | default: |
| 156 | sse2fct=jsimd_rgb_ycc_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 157 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 158 | mmxfct=jsimd_rgb_ycc_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 159 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 160 | break; |
| 161 | } |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 162 | if ((simd_support & JSIMD_SSE2) && |
| 163 | IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2)) |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 164 | sse2fct(cinfo->image_width, input_buf, |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 165 | output_buf, output_row, num_rows); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 166 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 167 | else if (simd_support & JSIMD_MMX) |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 168 | mmxfct(cinfo->image_width, input_buf, |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 169 | output_buf, output_row, num_rows); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 170 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 171 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | GLOBAL(void) |
| 175 | jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, |
| 176 | JSAMPIMAGE input_buf, JDIMENSION input_row, |
| 177 | JSAMPARRAY output_buf, int num_rows) |
| 178 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 179 | #ifdef WITH_SIMD |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 180 | void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 181 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 182 | void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 183 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 184 | switch(cinfo->out_color_space) |
| 185 | { |
| 186 | case JCS_EXT_RGB: |
| 187 | sse2fct=jsimd_ycc_extrgb_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 188 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 189 | mmxfct=jsimd_ycc_extrgb_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 190 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 191 | break; |
| 192 | case JCS_EXT_RGBX: |
| 193 | sse2fct=jsimd_ycc_extrgbx_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 194 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 195 | mmxfct=jsimd_ycc_extrgbx_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 196 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 197 | break; |
| 198 | case JCS_EXT_BGR: |
| 199 | sse2fct=jsimd_ycc_extbgr_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 200 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 201 | mmxfct=jsimd_ycc_extbgr_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 202 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 203 | break; |
| 204 | case JCS_EXT_BGRX: |
| 205 | sse2fct=jsimd_ycc_extbgrx_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 206 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 207 | mmxfct=jsimd_ycc_extbgrx_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 208 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 209 | break; |
| 210 | case JCS_EXT_XBGR: |
| 211 | sse2fct=jsimd_ycc_extxbgr_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 212 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 213 | mmxfct=jsimd_ycc_extxbgr_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 214 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 215 | break; |
| 216 | case JCS_EXT_XRGB: |
| 217 | sse2fct=jsimd_ycc_extxrgb_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 218 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 219 | mmxfct=jsimd_ycc_extxrgb_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 220 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 221 | break; |
| 222 | default: |
| 223 | sse2fct=jsimd_ycc_rgb_convert_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 224 | #ifndef __x86_64__ |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 225 | mmxfct=jsimd_ycc_rgb_convert_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 226 | #endif |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 227 | break; |
| 228 | } |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 229 | if ((simd_support & JSIMD_SSE2) && |
| 230 | IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2)) |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 231 | sse2fct(cinfo->output_width, input_buf, |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 232 | input_row, output_buf, num_rows); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 233 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 234 | else if (simd_support & JSIMD_MMX) |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 235 | mmxfct(cinfo->output_width, input_buf, |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 236 | input_row, output_buf, num_rows); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 237 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 238 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | GLOBAL(int) |
| 242 | jsimd_can_h2v2_downsample (void) |
| 243 | { |
| 244 | init_simd(); |
| 245 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 246 | /* The code is optimised for these values only */ |
| 247 | if (BITS_IN_JSAMPLE != 8) |
| 248 | return 0; |
| 249 | if (sizeof(JDIMENSION) != 4) |
| 250 | return 0; |
| 251 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 252 | if (simd_support & JSIMD_SSE2) |
| 253 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 254 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 255 | if (simd_support & JSIMD_MMX) |
| 256 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 257 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 258 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 259 | return 0; |
| 260 | } |
| 261 | |
| 262 | GLOBAL(int) |
| 263 | jsimd_can_h2v1_downsample (void) |
| 264 | { |
| 265 | init_simd(); |
| 266 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 267 | /* The code is optimised for these values only */ |
| 268 | if (BITS_IN_JSAMPLE != 8) |
| 269 | return 0; |
| 270 | if (sizeof(JDIMENSION) != 4) |
| 271 | return 0; |
| 272 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 273 | if (simd_support & JSIMD_SSE2) |
| 274 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 275 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 276 | if (simd_support & JSIMD_MMX) |
| 277 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 278 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 279 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 280 | return 0; |
| 281 | } |
| 282 | |
| 283 | GLOBAL(void) |
| 284 | jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, |
| 285 | JSAMPARRAY input_data, JSAMPARRAY output_data) |
| 286 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 287 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 288 | if (simd_support & JSIMD_SSE2) |
| 289 | jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor, |
| 290 | compptr->v_samp_factor, compptr->width_in_blocks, |
| 291 | input_data, output_data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 292 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 293 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 294 | jsimd_h2v2_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor, |
| 295 | compptr->v_samp_factor, compptr->width_in_blocks, |
| 296 | input_data, output_data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 297 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 298 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | GLOBAL(void) |
| 302 | jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, |
| 303 | JSAMPARRAY input_data, JSAMPARRAY output_data) |
| 304 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 305 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 306 | if (simd_support & JSIMD_SSE2) |
| 307 | jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor, |
| 308 | compptr->v_samp_factor, compptr->width_in_blocks, |
| 309 | input_data, output_data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 310 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 311 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 312 | jsimd_h2v1_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor, |
| 313 | compptr->v_samp_factor, compptr->width_in_blocks, |
| 314 | input_data, output_data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 315 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 316 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 317 | } |
| 318 | |
| 319 | GLOBAL(int) |
| 320 | jsimd_can_h2v2_upsample (void) |
| 321 | { |
| 322 | init_simd(); |
| 323 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 324 | /* The code is optimised for these values only */ |
| 325 | if (BITS_IN_JSAMPLE != 8) |
| 326 | return 0; |
| 327 | if (sizeof(JDIMENSION) != 4) |
| 328 | return 0; |
| 329 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 330 | if (simd_support & JSIMD_SSE2) |
| 331 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 332 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 333 | if (simd_support & JSIMD_MMX) |
| 334 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 335 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 336 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 337 | return 0; |
| 338 | } |
| 339 | |
| 340 | GLOBAL(int) |
| 341 | jsimd_can_h2v1_upsample (void) |
| 342 | { |
| 343 | init_simd(); |
| 344 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 345 | /* The code is optimised for these values only */ |
| 346 | if (BITS_IN_JSAMPLE != 8) |
| 347 | return 0; |
| 348 | if (sizeof(JDIMENSION) != 4) |
| 349 | return 0; |
| 350 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 351 | if (simd_support & JSIMD_SSE2) |
| 352 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 353 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 354 | if (simd_support & JSIMD_MMX) |
| 355 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 356 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 357 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 358 | return 0; |
| 359 | } |
| 360 | |
| 361 | GLOBAL(void) |
| 362 | jsimd_h2v2_upsample (j_decompress_ptr cinfo, |
| 363 | jpeg_component_info * compptr, |
| 364 | JSAMPARRAY input_data, |
| 365 | JSAMPARRAY * output_data_ptr) |
| 366 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 367 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 368 | if (simd_support & JSIMD_SSE2) |
| 369 | jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, |
| 370 | cinfo->output_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 371 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 372 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 373 | jsimd_h2v2_upsample_mmx(cinfo->max_v_samp_factor, |
| 374 | cinfo->output_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 375 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 376 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | GLOBAL(void) |
| 380 | jsimd_h2v1_upsample (j_decompress_ptr cinfo, |
| 381 | jpeg_component_info * compptr, |
| 382 | JSAMPARRAY input_data, |
| 383 | JSAMPARRAY * output_data_ptr) |
| 384 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 385 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 386 | if (simd_support & JSIMD_SSE2) |
| 387 | jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, |
| 388 | cinfo->output_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 389 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 390 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 391 | jsimd_h2v1_upsample_mmx(cinfo->max_v_samp_factor, |
| 392 | cinfo->output_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 393 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 394 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 395 | } |
| 396 | |
| 397 | GLOBAL(int) |
| 398 | jsimd_can_h2v2_fancy_upsample (void) |
| 399 | { |
| 400 | init_simd(); |
| 401 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 402 | /* The code is optimised for these values only */ |
| 403 | if (BITS_IN_JSAMPLE != 8) |
| 404 | return 0; |
| 405 | if (sizeof(JDIMENSION) != 4) |
| 406 | return 0; |
| 407 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 408 | if ((simd_support & JSIMD_SSE2) && |
| 409 | IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) |
| 410 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 411 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 412 | if (simd_support & JSIMD_MMX) |
| 413 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 414 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 415 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 416 | return 0; |
| 417 | } |
| 418 | |
| 419 | GLOBAL(int) |
| 420 | jsimd_can_h2v1_fancy_upsample (void) |
| 421 | { |
| 422 | init_simd(); |
| 423 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 424 | /* The code is optimised for these values only */ |
| 425 | if (BITS_IN_JSAMPLE != 8) |
| 426 | return 0; |
| 427 | if (sizeof(JDIMENSION) != 4) |
| 428 | return 0; |
| 429 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 430 | if ((simd_support & JSIMD_SSE2) && |
| 431 | IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) |
| 432 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 433 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 434 | if (simd_support & JSIMD_MMX) |
| 435 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 436 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 437 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 438 | return 0; |
| 439 | } |
| 440 | |
| 441 | GLOBAL(void) |
| 442 | jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, |
| 443 | jpeg_component_info * compptr, |
| 444 | JSAMPARRAY input_data, |
| 445 | JSAMPARRAY * output_data_ptr) |
| 446 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 447 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 448 | if ((simd_support & JSIMD_SSE2) && |
| 449 | IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) |
| 450 | jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor, |
| 451 | compptr->downsampled_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 452 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 453 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 454 | jsimd_h2v2_fancy_upsample_mmx(cinfo->max_v_samp_factor, |
| 455 | compptr->downsampled_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 456 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 457 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | GLOBAL(void) |
| 461 | jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, |
| 462 | jpeg_component_info * compptr, |
| 463 | JSAMPARRAY input_data, |
| 464 | JSAMPARRAY * output_data_ptr) |
| 465 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 466 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 467 | if ((simd_support & JSIMD_SSE2) && |
| 468 | IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) |
| 469 | jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor, |
| 470 | compptr->downsampled_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 471 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 472 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 473 | jsimd_h2v1_fancy_upsample_mmx(cinfo->max_v_samp_factor, |
| 474 | compptr->downsampled_width, input_data, output_data_ptr); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 475 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 476 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 477 | } |
| 478 | |
| 479 | GLOBAL(int) |
| 480 | jsimd_can_h2v2_merged_upsample (void) |
| 481 | { |
| 482 | init_simd(); |
| 483 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 484 | /* The code is optimised for these values only */ |
| 485 | if (BITS_IN_JSAMPLE != 8) |
| 486 | return 0; |
| 487 | if (sizeof(JDIMENSION) != 4) |
| 488 | return 0; |
| 489 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 490 | if ((simd_support & JSIMD_SSE2) && |
| 491 | IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) |
| 492 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 493 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 494 | if (simd_support & JSIMD_MMX) |
| 495 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 496 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 497 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 498 | return 0; |
| 499 | } |
| 500 | |
| 501 | GLOBAL(int) |
| 502 | jsimd_can_h2v1_merged_upsample (void) |
| 503 | { |
| 504 | init_simd(); |
| 505 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 506 | /* The code is optimised for these values only */ |
| 507 | if (BITS_IN_JSAMPLE != 8) |
| 508 | return 0; |
| 509 | if (sizeof(JDIMENSION) != 4) |
| 510 | return 0; |
| 511 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 512 | if ((simd_support & JSIMD_SSE2) && |
| 513 | IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) |
| 514 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 515 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 516 | if (simd_support & JSIMD_MMX) |
| 517 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 518 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 519 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 520 | return 0; |
| 521 | } |
| 522 | |
| 523 | GLOBAL(void) |
| 524 | jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo, |
| 525 | JSAMPIMAGE input_buf, |
| 526 | JDIMENSION in_row_group_ctr, |
| 527 | JSAMPARRAY output_buf) |
| 528 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 529 | #ifdef WITH_SIMD |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 530 | void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 531 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 532 | void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 533 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 534 | switch(cinfo->out_color_space) |
| 535 | { |
| 536 | case JCS_EXT_RGB: |
| 537 | sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 538 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 539 | mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 540 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 541 | break; |
| 542 | case JCS_EXT_RGBX: |
| 543 | sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 544 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 545 | mmxfct=jsimd_h2v2_extrgbx_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 546 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 547 | break; |
| 548 | case JCS_EXT_BGR: |
| 549 | sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 550 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 551 | mmxfct=jsimd_h2v2_extbgr_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 552 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 553 | break; |
| 554 | case JCS_EXT_BGRX: |
| 555 | sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 556 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 557 | mmxfct=jsimd_h2v2_extbgrx_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 558 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 559 | break; |
| 560 | case JCS_EXT_XBGR: |
| 561 | sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 562 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 563 | mmxfct=jsimd_h2v2_extxbgr_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 564 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 565 | break; |
| 566 | case JCS_EXT_XRGB: |
| 567 | sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 568 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 569 | mmxfct=jsimd_h2v2_extxrgb_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 570 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 571 | break; |
| 572 | default: |
| 573 | sse2fct=jsimd_h2v2_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 574 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 575 | mmxfct=jsimd_h2v2_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 576 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 577 | break; |
| 578 | } |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 579 | if ((simd_support & JSIMD_SSE2) && |
| 580 | IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 581 | sse2fct(cinfo->output_width, input_buf, |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 582 | in_row_group_ctr, output_buf); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 583 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 584 | else if (simd_support & JSIMD_MMX) |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 585 | mmxfct(cinfo->output_width, input_buf, |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 586 | in_row_group_ctr, output_buf); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 587 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 588 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 589 | } |
| 590 | |
| 591 | GLOBAL(void) |
| 592 | jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, |
| 593 | JSAMPIMAGE input_buf, |
| 594 | JDIMENSION in_row_group_ctr, |
| 595 | JSAMPARRAY output_buf) |
| 596 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 597 | #ifdef WITH_SIMD |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 598 | void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 599 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 600 | void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 601 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 602 | switch(cinfo->out_color_space) |
| 603 | { |
| 604 | case JCS_EXT_RGB: |
| 605 | sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 606 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 607 | mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 608 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 609 | break; |
| 610 | case JCS_EXT_RGBX: |
| 611 | sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 612 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 613 | mmxfct=jsimd_h2v1_extrgbx_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 614 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 615 | break; |
| 616 | case JCS_EXT_BGR: |
| 617 | sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 618 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 619 | mmxfct=jsimd_h2v1_extbgr_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 620 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 621 | break; |
| 622 | case JCS_EXT_BGRX: |
| 623 | sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 624 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 625 | mmxfct=jsimd_h2v1_extbgrx_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 626 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 627 | break; |
| 628 | case JCS_EXT_XBGR: |
| 629 | sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 630 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 631 | mmxfct=jsimd_h2v1_extxbgr_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 632 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 633 | break; |
| 634 | case JCS_EXT_XRGB: |
| 635 | sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 636 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 637 | mmxfct=jsimd_h2v1_extxrgb_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 638 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 639 | break; |
| 640 | default: |
| 641 | sse2fct=jsimd_h2v1_merged_upsample_sse2; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 642 | #ifndef __x86_64__ |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 643 | mmxfct=jsimd_h2v1_merged_upsample_mmx; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 644 | #endif |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 645 | break; |
| 646 | } |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 647 | if ((simd_support & JSIMD_SSE2) && |
| 648 | IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 649 | sse2fct(cinfo->output_width, input_buf, |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 650 | in_row_group_ctr, output_buf); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 651 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 652 | else if (simd_support & JSIMD_MMX) |
DRC | 720e161 | 2009-04-05 21:51:25 +0000 | [diff] [blame] | 653 | mmxfct(cinfo->output_width, input_buf, |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 654 | in_row_group_ctr, output_buf); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 655 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 656 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | GLOBAL(int) |
| 660 | jsimd_can_convsamp (void) |
| 661 | { |
| 662 | init_simd(); |
| 663 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 664 | /* The code is optimised for these values only */ |
| 665 | if (DCTSIZE != 8) |
| 666 | return 0; |
| 667 | if (BITS_IN_JSAMPLE != 8) |
| 668 | return 0; |
| 669 | if (sizeof(JDIMENSION) != 4) |
| 670 | return 0; |
| 671 | if (sizeof(DCTELEM) != 2) |
| 672 | return 0; |
| 673 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 674 | if (simd_support & JSIMD_SSE2) |
| 675 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 676 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 677 | if (simd_support & JSIMD_MMX) |
| 678 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 679 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 680 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 681 | return 0; |
| 682 | } |
| 683 | |
| 684 | GLOBAL(int) |
| 685 | jsimd_can_convsamp_float (void) |
| 686 | { |
| 687 | init_simd(); |
| 688 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 689 | /* The code is optimised for these values only */ |
| 690 | if (DCTSIZE != 8) |
| 691 | return 0; |
| 692 | if (BITS_IN_JSAMPLE != 8) |
| 693 | return 0; |
| 694 | if (sizeof(JDIMENSION) != 4) |
| 695 | return 0; |
| 696 | if (sizeof(FAST_FLOAT) != 4) |
| 697 | return 0; |
| 698 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 699 | if (simd_support & JSIMD_SSE2) |
| 700 | return 1; |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 701 | if (simd_support & JSIMD_SSE) |
| 702 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 703 | #ifndef __x86_64__ |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 704 | if (simd_support & JSIMD_3DNOW) |
| 705 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 706 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 707 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 708 | return 0; |
| 709 | } |
| 710 | |
| 711 | GLOBAL(void) |
| 712 | jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, |
| 713 | DCTELEM * workspace) |
| 714 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 715 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 716 | if (simd_support & JSIMD_SSE2) |
| 717 | jsimd_convsamp_sse2(sample_data, start_col, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 718 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 719 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 720 | jsimd_convsamp_mmx(sample_data, start_col, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 721 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 722 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 723 | } |
| 724 | |
| 725 | GLOBAL(void) |
| 726 | jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, |
| 727 | FAST_FLOAT * workspace) |
| 728 | { |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 729 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 730 | if (simd_support & JSIMD_SSE2) |
| 731 | jsimd_convsamp_float_sse2(sample_data, start_col, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 732 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 733 | else if (simd_support & JSIMD_SSE) |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 734 | jsimd_convsamp_float_sse(sample_data, start_col, workspace); |
| 735 | else if (simd_support & JSIMD_3DNOW) |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 736 | jsimd_convsamp_float_3dnow(sample_data, start_col, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 737 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 738 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 739 | } |
| 740 | |
| 741 | GLOBAL(int) |
| 742 | jsimd_can_fdct_islow (void) |
| 743 | { |
| 744 | init_simd(); |
| 745 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 746 | /* The code is optimised for these values only */ |
| 747 | if (DCTSIZE != 8) |
| 748 | return 0; |
| 749 | if (sizeof(DCTELEM) != 2) |
| 750 | return 0; |
| 751 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 752 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) |
| 753 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 754 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 755 | if (simd_support & JSIMD_MMX) |
| 756 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 757 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 758 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 759 | return 0; |
| 760 | } |
| 761 | |
| 762 | GLOBAL(int) |
| 763 | jsimd_can_fdct_ifast (void) |
| 764 | { |
| 765 | init_simd(); |
| 766 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 767 | /* The code is optimised for these values only */ |
| 768 | if (DCTSIZE != 8) |
| 769 | return 0; |
| 770 | if (sizeof(DCTELEM) != 2) |
| 771 | return 0; |
| 772 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 773 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_ifast_sse2)) |
| 774 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 775 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 776 | if (simd_support & JSIMD_MMX) |
| 777 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 778 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 779 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 780 | return 0; |
| 781 | } |
| 782 | |
| 783 | GLOBAL(int) |
| 784 | jsimd_can_fdct_float (void) |
| 785 | { |
| 786 | init_simd(); |
| 787 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 788 | /* The code is optimised for these values only */ |
| 789 | if (DCTSIZE != 8) |
| 790 | return 0; |
| 791 | if (sizeof(FAST_FLOAT) != 4) |
| 792 | return 0; |
| 793 | |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 794 | if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse)) |
| 795 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 796 | #ifndef __x86_64__ |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 797 | if (simd_support & JSIMD_3DNOW) |
| 798 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 799 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 800 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 801 | return 0; |
| 802 | } |
| 803 | |
| 804 | GLOBAL(void) |
| 805 | jsimd_fdct_islow (DCTELEM * data) |
| 806 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 807 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 808 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) |
| 809 | jsimd_fdct_islow_sse2(data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 810 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 811 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 812 | jsimd_fdct_islow_mmx(data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 813 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 814 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 815 | } |
| 816 | |
| 817 | GLOBAL(void) |
| 818 | jsimd_fdct_ifast (DCTELEM * data) |
| 819 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 820 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 821 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) |
| 822 | jsimd_fdct_ifast_sse2(data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 823 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 824 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 825 | jsimd_fdct_ifast_mmx(data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 826 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 827 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 828 | } |
| 829 | |
| 830 | GLOBAL(void) |
| 831 | jsimd_fdct_float (FAST_FLOAT * data) |
| 832 | { |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 833 | #ifdef WITH_SIMD |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 834 | if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse)) |
| 835 | jsimd_fdct_float_sse(data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 836 | #ifndef __x86_64__ |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 837 | else if (simd_support & JSIMD_3DNOW) |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 838 | jsimd_fdct_float_3dnow(data); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 839 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 840 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 841 | } |
| 842 | |
| 843 | GLOBAL(int) |
| 844 | jsimd_can_quantize (void) |
| 845 | { |
| 846 | init_simd(); |
| 847 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 848 | /* The code is optimised for these values only */ |
| 849 | if (DCTSIZE != 8) |
| 850 | return 0; |
| 851 | if (sizeof(JCOEF) != 2) |
| 852 | return 0; |
| 853 | if (sizeof(DCTELEM) != 2) |
| 854 | return 0; |
| 855 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 856 | if (simd_support & JSIMD_SSE2) |
| 857 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 858 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 859 | if (simd_support & JSIMD_MMX) |
| 860 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 861 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 862 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 863 | return 0; |
| 864 | } |
| 865 | |
| 866 | GLOBAL(int) |
| 867 | jsimd_can_quantize_float (void) |
| 868 | { |
| 869 | init_simd(); |
| 870 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 871 | /* The code is optimised for these values only */ |
| 872 | if (DCTSIZE != 8) |
| 873 | return 0; |
| 874 | if (sizeof(JCOEF) != 2) |
| 875 | return 0; |
| 876 | if (sizeof(FAST_FLOAT) != 4) |
| 877 | return 0; |
| 878 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 879 | if (simd_support & JSIMD_SSE2) |
| 880 | return 1; |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 881 | if (simd_support & JSIMD_SSE) |
| 882 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 883 | #ifndef __x86_64__ |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 884 | if (simd_support & JSIMD_3DNOW) |
| 885 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 886 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 887 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 888 | return 0; |
| 889 | } |
| 890 | |
| 891 | GLOBAL(void) |
| 892 | jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, |
| 893 | DCTELEM * workspace) |
| 894 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 895 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 896 | if (simd_support & JSIMD_SSE2) |
| 897 | jsimd_quantize_sse2(coef_block, divisors, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 898 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 899 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 900 | jsimd_quantize_mmx(coef_block, divisors, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 901 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 902 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 903 | } |
| 904 | |
| 905 | GLOBAL(void) |
| 906 | jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, |
| 907 | FAST_FLOAT * workspace) |
| 908 | { |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 909 | #ifdef WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 910 | if (simd_support & JSIMD_SSE2) |
| 911 | jsimd_quantize_float_sse2(coef_block, divisors, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 912 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 913 | else if (simd_support & JSIMD_SSE) |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 914 | jsimd_quantize_float_sse(coef_block, divisors, workspace); |
| 915 | else if (simd_support & JSIMD_3DNOW) |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 916 | jsimd_quantize_float_3dnow(coef_block, divisors, workspace); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 917 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 918 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 919 | } |
| 920 | |
| 921 | GLOBAL(int) |
| 922 | jsimd_can_idct_2x2 (void) |
| 923 | { |
| 924 | init_simd(); |
| 925 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 926 | /* The code is optimised for these values only */ |
| 927 | if (DCTSIZE != 8) |
| 928 | return 0; |
| 929 | if (sizeof(JCOEF) != 2) |
| 930 | return 0; |
| 931 | if (BITS_IN_JSAMPLE != 8) |
| 932 | return 0; |
| 933 | if (sizeof(JDIMENSION) != 4) |
| 934 | return 0; |
| 935 | if (sizeof(ISLOW_MULT_TYPE) != 2) |
| 936 | return 0; |
| 937 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 938 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) |
| 939 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 940 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 941 | if (simd_support & JSIMD_MMX) |
| 942 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 943 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 944 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 945 | return 0; |
| 946 | } |
| 947 | |
| 948 | GLOBAL(int) |
| 949 | jsimd_can_idct_4x4 (void) |
| 950 | { |
| 951 | init_simd(); |
| 952 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 953 | /* The code is optimised for these values only */ |
| 954 | if (DCTSIZE != 8) |
| 955 | return 0; |
| 956 | if (sizeof(JCOEF) != 2) |
| 957 | return 0; |
| 958 | if (BITS_IN_JSAMPLE != 8) |
| 959 | return 0; |
| 960 | if (sizeof(JDIMENSION) != 4) |
| 961 | return 0; |
| 962 | if (sizeof(ISLOW_MULT_TYPE) != 2) |
| 963 | return 0; |
| 964 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 965 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) |
| 966 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 967 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 968 | if (simd_support & JSIMD_MMX) |
| 969 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 970 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 971 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 972 | return 0; |
| 973 | } |
| 974 | |
| 975 | GLOBAL(void) |
| 976 | jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
| 977 | JCOEFPTR coef_block, JSAMPARRAY output_buf, |
| 978 | JDIMENSION output_col) |
| 979 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 980 | #if WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 981 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) |
| 982 | jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 983 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 984 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 985 | jsimd_idct_2x2_mmx(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 986 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 987 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 988 | } |
| 989 | |
| 990 | GLOBAL(void) |
| 991 | jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
| 992 | JCOEFPTR coef_block, JSAMPARRAY output_buf, |
| 993 | JDIMENSION output_col) |
| 994 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 995 | #if WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 996 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) |
| 997 | jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 998 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 999 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1000 | jsimd_idct_4x4_mmx(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1001 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1002 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1003 | } |
| 1004 | |
| 1005 | GLOBAL(int) |
| 1006 | jsimd_can_idct_islow (void) |
| 1007 | { |
| 1008 | init_simd(); |
| 1009 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1010 | /* The code is optimised for these values only */ |
| 1011 | if (DCTSIZE != 8) |
| 1012 | return 0; |
| 1013 | if (sizeof(JCOEF) != 2) |
| 1014 | return 0; |
| 1015 | if (BITS_IN_JSAMPLE != 8) |
| 1016 | return 0; |
| 1017 | if (sizeof(JDIMENSION) != 4) |
| 1018 | return 0; |
| 1019 | if (sizeof(ISLOW_MULT_TYPE) != 2) |
| 1020 | return 0; |
| 1021 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1022 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2)) |
| 1023 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1024 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1025 | if (simd_support & JSIMD_MMX) |
| 1026 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1027 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1028 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1029 | return 0; |
| 1030 | } |
| 1031 | |
| 1032 | GLOBAL(int) |
| 1033 | jsimd_can_idct_ifast (void) |
| 1034 | { |
| 1035 | init_simd(); |
| 1036 | |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1037 | /* The code is optimised for these values only */ |
| 1038 | if (DCTSIZE != 8) |
| 1039 | return 0; |
| 1040 | if (sizeof(JCOEF) != 2) |
| 1041 | return 0; |
| 1042 | if (BITS_IN_JSAMPLE != 8) |
| 1043 | return 0; |
| 1044 | if (sizeof(JDIMENSION) != 4) |
| 1045 | return 0; |
| 1046 | if (sizeof(IFAST_MULT_TYPE) != 2) |
| 1047 | return 0; |
| 1048 | if (IFAST_SCALE_BITS != 2) |
| 1049 | return 0; |
| 1050 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1051 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2)) |
| 1052 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1053 | #ifndef __x86_64__ |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1054 | if (simd_support & JSIMD_MMX) |
| 1055 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1056 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1057 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1058 | return 0; |
| 1059 | } |
| 1060 | |
| 1061 | GLOBAL(int) |
| 1062 | jsimd_can_idct_float (void) |
| 1063 | { |
| 1064 | init_simd(); |
| 1065 | |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 1066 | if (DCTSIZE != 8) |
| 1067 | return 0; |
| 1068 | if (sizeof(JCOEF) != 2) |
| 1069 | return 0; |
| 1070 | if (BITS_IN_JSAMPLE != 8) |
| 1071 | return 0; |
| 1072 | if (sizeof(JDIMENSION) != 4) |
| 1073 | return 0; |
| 1074 | if (sizeof(FAST_FLOAT) != 4) |
| 1075 | return 0; |
| 1076 | if (sizeof(FLOAT_MULT_TYPE) != 4) |
| 1077 | return 0; |
| 1078 | |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1079 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2)) |
| 1080 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1081 | #ifndef __x86_64__ |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 1082 | if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse)) |
| 1083 | return 1; |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 1084 | if (simd_support & JSIMD_3DNOW) |
| 1085 | return 1; |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1086 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 1087 | |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1088 | return 0; |
| 1089 | } |
| 1090 | |
| 1091 | GLOBAL(void) |
| 1092 | jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
| 1093 | JCOEFPTR coef_block, JSAMPARRAY output_buf, |
| 1094 | JDIMENSION output_col) |
| 1095 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1096 | #if WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1097 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2)) |
| 1098 | jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1099 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1100 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1101 | jsimd_idct_islow_mmx(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1102 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1103 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1104 | } |
| 1105 | |
| 1106 | GLOBAL(void) |
| 1107 | jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
| 1108 | JCOEFPTR coef_block, JSAMPARRAY output_buf, |
| 1109 | JDIMENSION output_col) |
| 1110 | { |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1111 | #if WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1112 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2)) |
| 1113 | jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1114 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1115 | else if (simd_support & JSIMD_MMX) |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1116 | jsimd_idct_ifast_mmx(compptr->dct_table, coef_block, output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1117 | #endif |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 1118 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1119 | } |
| 1120 | |
| 1121 | GLOBAL(void) |
| 1122 | jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, |
| 1123 | JCOEFPTR coef_block, JSAMPARRAY output_buf, |
| 1124 | JDIMENSION output_col) |
| 1125 | { |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 1126 | #if WITH_SIMD |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1127 | if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2)) |
| 1128 | jsimd_idct_float_sse2(compptr->dct_table, coef_block, |
| 1129 | output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1130 | #ifndef __x86_64__ |
Pierre Ossman | eea7215 | 2009-03-09 13:34:17 +0000 | [diff] [blame] | 1131 | else if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse)) |
Pierre Ossman | 018fc42 | 2009-03-09 13:31:56 +0000 | [diff] [blame] | 1132 | jsimd_idct_float_sse(compptr->dct_table, coef_block, |
| 1133 | output_buf, output_col); |
| 1134 | else if (simd_support & JSIMD_3DNOW) |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 1135 | jsimd_idct_float_3dnow(compptr->dct_table, coef_block, |
| 1136 | output_buf, output_col); |
DRC | cdc8ac3 | 2009-06-25 20:38:31 +0000 | [diff] [blame^] | 1137 | #endif |
Pierre Ossman | 65d0317 | 2009-03-09 13:28:10 +0000 | [diff] [blame] | 1138 | #endif |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 1139 | } |
| 1140 | |