/media/libjpeg/simd/jsimd.h

http://github.com/zpao/v8monkey · C Header · 504 lines · 444 code · 39 blank · 21 comment · 0 complexity · a151b9002943ff29d46f1d4ef42e663b MD5 · raw file

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