image_pack 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +18 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +140 -0
  5. data/THIRD_PARTY_NOTICES.md +8 -0
  6. data/ext/image_pack/extconf.rb +515 -0
  7. data/ext/image_pack/image_pack.c +1618 -0
  8. data/ext/image_pack/vendor/.vendored +1 -0
  9. data/ext/image_pack/vendor/mozjpeg/BUILDING.txt +902 -0
  10. data/ext/image_pack/vendor/mozjpeg/CMakeLists.txt +1593 -0
  11. data/ext/image_pack/vendor/mozjpeg/LICENSE.md +132 -0
  12. data/ext/image_pack/vendor/mozjpeg/README-mozilla.txt +194 -0
  13. data/ext/image_pack/vendor/mozjpeg/README-turbo.txt +346 -0
  14. data/ext/image_pack/vendor/mozjpeg/README.ijg +258 -0
  15. data/ext/image_pack/vendor/mozjpeg/README.md +29 -0
  16. data/ext/image_pack/vendor/mozjpeg/cderror.h +128 -0
  17. data/ext/image_pack/vendor/mozjpeg/cdjpeg.c +156 -0
  18. data/ext/image_pack/vendor/mozjpeg/cdjpeg.h +171 -0
  19. data/ext/image_pack/vendor/mozjpeg/cjpeg.c +961 -0
  20. data/ext/image_pack/vendor/mozjpeg/cmyk.h +60 -0
  21. data/ext/image_pack/vendor/mozjpeg/coderules.txt +78 -0
  22. data/ext/image_pack/vendor/mozjpeg/croptest.in +95 -0
  23. data/ext/image_pack/vendor/mozjpeg/djpeg.c +855 -0
  24. data/ext/image_pack/vendor/mozjpeg/example.txt +464 -0
  25. data/ext/image_pack/vendor/mozjpeg/jaricom.c +157 -0
  26. data/ext/image_pack/vendor/mozjpeg/jcapimin.c +307 -0
  27. data/ext/image_pack/vendor/mozjpeg/jcapistd.c +168 -0
  28. data/ext/image_pack/vendor/mozjpeg/jcarith.c +972 -0
  29. data/ext/image_pack/vendor/mozjpeg/jccoefct.c +609 -0
  30. data/ext/image_pack/vendor/mozjpeg/jccolext.c +144 -0
  31. data/ext/image_pack/vendor/mozjpeg/jccolor.c +721 -0
  32. data/ext/image_pack/vendor/mozjpeg/jcdctmgr.c +1776 -0
  33. data/ext/image_pack/vendor/mozjpeg/jcext.c +219 -0
  34. data/ext/image_pack/vendor/mozjpeg/jchuff.c +1146 -0
  35. data/ext/image_pack/vendor/mozjpeg/jchuff.h +57 -0
  36. data/ext/image_pack/vendor/mozjpeg/jcicc.c +105 -0
  37. data/ext/image_pack/vendor/mozjpeg/jcinit.c +82 -0
  38. data/ext/image_pack/vendor/mozjpeg/jcmainct.c +162 -0
  39. data/ext/image_pack/vendor/mozjpeg/jcmarker.c +844 -0
  40. data/ext/image_pack/vendor/mozjpeg/jcmaster.c +958 -0
  41. data/ext/image_pack/vendor/mozjpeg/jcmaster.h +56 -0
  42. data/ext/image_pack/vendor/mozjpeg/jcomapi.c +109 -0
  43. data/ext/image_pack/vendor/mozjpeg/jconfig.h.in +37 -0
  44. data/ext/image_pack/vendor/mozjpeg/jconfig.txt +93 -0
  45. data/ext/image_pack/vendor/mozjpeg/jconfigint.h.in +44 -0
  46. data/ext/image_pack/vendor/mozjpeg/jcparam.c +991 -0
  47. data/ext/image_pack/vendor/mozjpeg/jcphuff.c +1123 -0
  48. data/ext/image_pack/vendor/mozjpeg/jcprepct.c +351 -0
  49. data/ext/image_pack/vendor/mozjpeg/jcsample.c +522 -0
  50. data/ext/image_pack/vendor/mozjpeg/jcstest.c +126 -0
  51. data/ext/image_pack/vendor/mozjpeg/jctrans.c +408 -0
  52. data/ext/image_pack/vendor/mozjpeg/jdapimin.c +407 -0
  53. data/ext/image_pack/vendor/mozjpeg/jdapistd.c +691 -0
  54. data/ext/image_pack/vendor/mozjpeg/jdarith.c +782 -0
  55. data/ext/image_pack/vendor/mozjpeg/jdatadst-tj.c +198 -0
  56. data/ext/image_pack/vendor/mozjpeg/jdatadst.c +299 -0
  57. data/ext/image_pack/vendor/mozjpeg/jdatasrc-tj.c +194 -0
  58. data/ext/image_pack/vendor/mozjpeg/jdatasrc.c +295 -0
  59. data/ext/image_pack/vendor/mozjpeg/jdcoefct.c +881 -0
  60. data/ext/image_pack/vendor/mozjpeg/jdcoefct.h +83 -0
  61. data/ext/image_pack/vendor/mozjpeg/jdcol565.c +384 -0
  62. data/ext/image_pack/vendor/mozjpeg/jdcolext.c +141 -0
  63. data/ext/image_pack/vendor/mozjpeg/jdcolor.c +881 -0
  64. data/ext/image_pack/vendor/mozjpeg/jdct.h +208 -0
  65. data/ext/image_pack/vendor/mozjpeg/jddctmgr.c +367 -0
  66. data/ext/image_pack/vendor/mozjpeg/jdhuff.c +834 -0
  67. data/ext/image_pack/vendor/mozjpeg/jdhuff.h +247 -0
  68. data/ext/image_pack/vendor/mozjpeg/jdicc.c +167 -0
  69. data/ext/image_pack/vendor/mozjpeg/jdinput.c +408 -0
  70. data/ext/image_pack/vendor/mozjpeg/jdmainct.c +460 -0
  71. data/ext/image_pack/vendor/mozjpeg/jdmainct.h +71 -0
  72. data/ext/image_pack/vendor/mozjpeg/jdmarker.c +1374 -0
  73. data/ext/image_pack/vendor/mozjpeg/jdmaster.c +727 -0
  74. data/ext/image_pack/vendor/mozjpeg/jdmaster.h +33 -0
  75. data/ext/image_pack/vendor/mozjpeg/jdmerge.c +587 -0
  76. data/ext/image_pack/vendor/mozjpeg/jdmerge.h +47 -0
  77. data/ext/image_pack/vendor/mozjpeg/jdmrg565.c +354 -0
  78. data/ext/image_pack/vendor/mozjpeg/jdmrgext.c +184 -0
  79. data/ext/image_pack/vendor/mozjpeg/jdphuff.c +679 -0
  80. data/ext/image_pack/vendor/mozjpeg/jdpostct.c +294 -0
  81. data/ext/image_pack/vendor/mozjpeg/jdsample.c +524 -0
  82. data/ext/image_pack/vendor/mozjpeg/jdsample.h +50 -0
  83. data/ext/image_pack/vendor/mozjpeg/jdtrans.c +156 -0
  84. data/ext/image_pack/vendor/mozjpeg/jerror.c +251 -0
  85. data/ext/image_pack/vendor/mozjpeg/jerror.h +335 -0
  86. data/ext/image_pack/vendor/mozjpeg/jfdctflt.c +169 -0
  87. data/ext/image_pack/vendor/mozjpeg/jfdctfst.c +227 -0
  88. data/ext/image_pack/vendor/mozjpeg/jfdctint.c +288 -0
  89. data/ext/image_pack/vendor/mozjpeg/jidctflt.c +240 -0
  90. data/ext/image_pack/vendor/mozjpeg/jidctfst.c +371 -0
  91. data/ext/image_pack/vendor/mozjpeg/jidctint.c +2627 -0
  92. data/ext/image_pack/vendor/mozjpeg/jidctred.c +409 -0
  93. data/ext/image_pack/vendor/mozjpeg/jinclude.h +147 -0
  94. data/ext/image_pack/vendor/mozjpeg/jmemmgr.c +1180 -0
  95. data/ext/image_pack/vendor/mozjpeg/jmemnobs.c +110 -0
  96. data/ext/image_pack/vendor/mozjpeg/jmemsys.h +178 -0
  97. data/ext/image_pack/vendor/mozjpeg/jmorecfg.h +382 -0
  98. data/ext/image_pack/vendor/mozjpeg/jpeg_nbits_table.h +4098 -0
  99. data/ext/image_pack/vendor/mozjpeg/jpegcomp.h +32 -0
  100. data/ext/image_pack/vendor/mozjpeg/jpegint.h +453 -0
  101. data/ext/image_pack/vendor/mozjpeg/jpeglib.h +1211 -0
  102. data/ext/image_pack/vendor/mozjpeg/jpegtran.c +827 -0
  103. data/ext/image_pack/vendor/mozjpeg/jpegyuv.c +172 -0
  104. data/ext/image_pack/vendor/mozjpeg/jquant1.c +856 -0
  105. data/ext/image_pack/vendor/mozjpeg/jquant2.c +1286 -0
  106. data/ext/image_pack/vendor/mozjpeg/jsimd.h +123 -0
  107. data/ext/image_pack/vendor/mozjpeg/jsimd_none.c +431 -0
  108. data/ext/image_pack/vendor/mozjpeg/jsimddct.h +70 -0
  109. data/ext/image_pack/vendor/mozjpeg/jstdhuff.c +144 -0
  110. data/ext/image_pack/vendor/mozjpeg/jutils.c +133 -0
  111. data/ext/image_pack/vendor/mozjpeg/jversion.h.in +56 -0
  112. data/ext/image_pack/vendor/mozjpeg/libjpeg.map.in +11 -0
  113. data/ext/image_pack/vendor/mozjpeg/libjpeg.txt +3150 -0
  114. data/ext/image_pack/vendor/mozjpeg/rdbmp.c +690 -0
  115. data/ext/image_pack/vendor/mozjpeg/rdcolmap.c +253 -0
  116. data/ext/image_pack/vendor/mozjpeg/rdgif.c +720 -0
  117. data/ext/image_pack/vendor/mozjpeg/rdjpeg.c +160 -0
  118. data/ext/image_pack/vendor/mozjpeg/rdjpgcom.c +494 -0
  119. data/ext/image_pack/vendor/mozjpeg/rdpng.c +194 -0
  120. data/ext/image_pack/vendor/mozjpeg/rdppm.c +781 -0
  121. data/ext/image_pack/vendor/mozjpeg/rdswitch.c +642 -0
  122. data/ext/image_pack/vendor/mozjpeg/rdtarga.c +508 -0
  123. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jccolext-neon.c +148 -0
  124. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jchuff-neon.c +334 -0
  125. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jsimd.c +976 -0
  126. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jsimd_neon.S +1200 -0
  127. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jccolext-neon.c +316 -0
  128. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jchuff-neon.c +411 -0
  129. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jsimd.c +1053 -0
  130. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jsimd_neon.S +2254 -0
  131. data/ext/image_pack/vendor/mozjpeg/simd/arm/align.h +28 -0
  132. data/ext/image_pack/vendor/mozjpeg/simd/arm/jccolor-neon.c +160 -0
  133. data/ext/image_pack/vendor/mozjpeg/simd/arm/jcgray-neon.c +120 -0
  134. data/ext/image_pack/vendor/mozjpeg/simd/arm/jcgryext-neon.c +106 -0
  135. data/ext/image_pack/vendor/mozjpeg/simd/arm/jchuff.h +131 -0
  136. data/ext/image_pack/vendor/mozjpeg/simd/arm/jcphuff-neon.c +623 -0
  137. data/ext/image_pack/vendor/mozjpeg/simd/arm/jcsample-neon.c +192 -0
  138. data/ext/image_pack/vendor/mozjpeg/simd/arm/jdcolext-neon.c +374 -0
  139. data/ext/image_pack/vendor/mozjpeg/simd/arm/jdcolor-neon.c +141 -0
  140. data/ext/image_pack/vendor/mozjpeg/simd/arm/jdmerge-neon.c +144 -0
  141. data/ext/image_pack/vendor/mozjpeg/simd/arm/jdmrgext-neon.c +723 -0
  142. data/ext/image_pack/vendor/mozjpeg/simd/arm/jdsample-neon.c +569 -0
  143. data/ext/image_pack/vendor/mozjpeg/simd/arm/jfdctfst-neon.c +214 -0
  144. data/ext/image_pack/vendor/mozjpeg/simd/arm/jfdctint-neon.c +376 -0
  145. data/ext/image_pack/vendor/mozjpeg/simd/arm/jidctfst-neon.c +472 -0
  146. data/ext/image_pack/vendor/mozjpeg/simd/arm/jidctint-neon.c +801 -0
  147. data/ext/image_pack/vendor/mozjpeg/simd/arm/jidctred-neon.c +486 -0
  148. data/ext/image_pack/vendor/mozjpeg/simd/arm/jquanti-neon.c +193 -0
  149. data/ext/image_pack/vendor/mozjpeg/simd/arm/neon-compat.h +26 -0
  150. data/ext/image_pack/vendor/mozjpeg/simd/arm/neon-compat.h.in +37 -0
  151. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-avx2.asm +578 -0
  152. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-mmx.asm +476 -0
  153. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-sse2.asm +503 -0
  154. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-avx2.asm +121 -0
  155. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-mmx.asm +121 -0
  156. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-sse2.asm +120 -0
  157. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-avx2.asm +113 -0
  158. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-mmx.asm +113 -0
  159. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-sse2.asm +112 -0
  160. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-avx2.asm +457 -0
  161. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-mmx.asm +355 -0
  162. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-sse2.asm +382 -0
  163. data/ext/image_pack/vendor/mozjpeg/simd/i386/jchuff-sse2.asm +761 -0
  164. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcphuff-sse2.asm +662 -0
  165. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-avx2.asm +388 -0
  166. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-mmx.asm +324 -0
  167. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-sse2.asm +351 -0
  168. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-avx2.asm +515 -0
  169. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-mmx.asm +404 -0
  170. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-sse2.asm +458 -0
  171. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-avx2.asm +118 -0
  172. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-mmx.asm +117 -0
  173. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-sse2.asm +117 -0
  174. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-avx2.asm +136 -0
  175. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-mmx.asm +123 -0
  176. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-sse2.asm +135 -0
  177. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-avx2.asm +575 -0
  178. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-mmx.asm +460 -0
  179. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-sse2.asm +517 -0
  180. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-avx2.asm +760 -0
  181. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-mmx.asm +731 -0
  182. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-sse2.asm +724 -0
  183. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctflt-3dn.asm +318 -0
  184. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctflt-sse.asm +369 -0
  185. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctfst-mmx.asm +395 -0
  186. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctfst-sse2.asm +403 -0
  187. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-avx2.asm +331 -0
  188. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-mmx.asm +620 -0
  189. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-sse2.asm +633 -0
  190. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-3dn.asm +451 -0
  191. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-sse.asm +571 -0
  192. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-sse2.asm +497 -0
  193. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctfst-mmx.asm +499 -0
  194. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctfst-sse2.asm +501 -0
  195. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-avx2.asm +453 -0
  196. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-mmx.asm +851 -0
  197. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-sse2.asm +858 -0
  198. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctred-mmx.asm +704 -0
  199. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctred-sse2.asm +592 -0
  200. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquant-3dn.asm +230 -0
  201. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquant-mmx.asm +276 -0
  202. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquant-sse.asm +208 -0
  203. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquantf-sse2.asm +168 -0
  204. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquanti-avx2.asm +188 -0
  205. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquanti-sse2.asm +201 -0
  206. data/ext/image_pack/vendor/mozjpeg/simd/i386/jsimd.c +1312 -0
  207. data/ext/image_pack/vendor/mozjpeg/simd/i386/jsimdcpu.asm +135 -0
  208. data/ext/image_pack/vendor/mozjpeg/simd/jsimd.h +1258 -0
  209. data/ext/image_pack/vendor/mozjpeg/simd/mips/jsimd.c +1143 -0
  210. data/ext/image_pack/vendor/mozjpeg/simd/mips/jsimd_dspr2.S +4543 -0
  211. data/ext/image_pack/vendor/mozjpeg/simd/mips/jsimd_dspr2_asm.h +292 -0
  212. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jccolext-mmi.c +455 -0
  213. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jccolor-mmi.c +148 -0
  214. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcgray-mmi.c +132 -0
  215. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcgryext-mmi.c +374 -0
  216. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcsample-mmi.c +98 -0
  217. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcsample.h +28 -0
  218. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdcolext-mmi.c +415 -0
  219. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdcolor-mmi.c +139 -0
  220. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdmerge-mmi.c +149 -0
  221. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdmrgext-mmi.c +615 -0
  222. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jdsample-mmi.c +304 -0
  223. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jfdctfst-mmi.c +255 -0
  224. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jfdctint-mmi.c +398 -0
  225. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jidctfst-mmi.c +395 -0
  226. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jidctint-mmi.c +571 -0
  227. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jquanti-mmi.c +124 -0
  228. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jsimd.c +866 -0
  229. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jsimd_mmi.h +69 -0
  230. data/ext/image_pack/vendor/mozjpeg/simd/mips64/loongson-mmintrin.h +1334 -0
  231. data/ext/image_pack/vendor/mozjpeg/simd/nasm/jcolsamp.inc +135 -0
  232. data/ext/image_pack/vendor/mozjpeg/simd/nasm/jdct.inc +31 -0
  233. data/ext/image_pack/vendor/mozjpeg/simd/nasm/jsimdcfg.inc +93 -0
  234. data/ext/image_pack/vendor/mozjpeg/simd/nasm/jsimdcfg.inc.h +133 -0
  235. data/ext/image_pack/vendor/mozjpeg/simd/nasm/jsimdext.inc +520 -0
  236. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jccolext-altivec.c +269 -0
  237. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jccolor-altivec.c +116 -0
  238. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcgray-altivec.c +111 -0
  239. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcgryext-altivec.c +228 -0
  240. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcsample-altivec.c +159 -0
  241. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcsample.h +28 -0
  242. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdcolext-altivec.c +276 -0
  243. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdcolor-altivec.c +106 -0
  244. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdmerge-altivec.c +130 -0
  245. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdmrgext-altivec.c +329 -0
  246. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jdsample-altivec.c +400 -0
  247. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jfdctfst-altivec.c +154 -0
  248. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jfdctint-altivec.c +258 -0
  249. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jidctfst-altivec.c +255 -0
  250. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jidctint-altivec.c +357 -0
  251. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jquanti-altivec.c +250 -0
  252. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jsimd.c +884 -0
  253. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jsimd_altivec.h +98 -0
  254. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolext-avx2.asm +559 -0
  255. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolext-sse2.asm +484 -0
  256. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolor-avx2.asm +121 -0
  257. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolor-sse2.asm +120 -0
  258. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcgray-avx2.asm +113 -0
  259. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcgray-sse2.asm +112 -0
  260. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcgryext-avx2.asm +438 -0
  261. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcgryext-sse2.asm +363 -0
  262. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jchuff-sse2.asm +583 -0
  263. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcphuff-sse2.asm +639 -0
  264. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcsample-avx2.asm +367 -0
  265. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jcsample-sse2.asm +330 -0
  266. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdcolext-avx2.asm +496 -0
  267. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdcolext-sse2.asm +439 -0
  268. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdcolor-avx2.asm +118 -0
  269. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdcolor-sse2.asm +117 -0
  270. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdmerge-avx2.asm +136 -0
  271. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdmerge-sse2.asm +135 -0
  272. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdmrgext-avx2.asm +596 -0
  273. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdmrgext-sse2.asm +538 -0
  274. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdsample-avx2.asm +696 -0
  275. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jdsample-sse2.asm +665 -0
  276. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jfdctflt-sse.asm +355 -0
  277. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jfdctfst-sse2.asm +389 -0
  278. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jfdctint-avx2.asm +320 -0
  279. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jfdctint-sse2.asm +619 -0
  280. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jidctflt-sse2.asm +482 -0
  281. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jidctfst-sse2.asm +491 -0
  282. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jidctint-avx2.asm +418 -0
  283. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jidctint-sse2.asm +847 -0
  284. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jidctred-sse2.asm +574 -0
  285. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jquantf-sse2.asm +155 -0
  286. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jquanti-avx2.asm +163 -0
  287. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jquanti-sse2.asm +188 -0
  288. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jsimd.c +1110 -0
  289. data/ext/image_pack/vendor/mozjpeg/simd/x86_64/jsimdcpu.asm +86 -0
  290. data/ext/image_pack/vendor/mozjpeg/strtest.c +170 -0
  291. data/ext/image_pack/vendor/mozjpeg/structure.txt +900 -0
  292. data/ext/image_pack/vendor/mozjpeg/tjbench.c +1044 -0
  293. data/ext/image_pack/vendor/mozjpeg/tjbenchtest.in +256 -0
  294. data/ext/image_pack/vendor/mozjpeg/tjbenchtest.java.in +215 -0
  295. data/ext/image_pack/vendor/mozjpeg/tjexample.c +406 -0
  296. data/ext/image_pack/vendor/mozjpeg/tjexampletest.in +149 -0
  297. data/ext/image_pack/vendor/mozjpeg/tjexampletest.java.in +151 -0
  298. data/ext/image_pack/vendor/mozjpeg/tjunittest.c +961 -0
  299. data/ext/image_pack/vendor/mozjpeg/tjutil.c +70 -0
  300. data/ext/image_pack/vendor/mozjpeg/tjutil.h +53 -0
  301. data/ext/image_pack/vendor/mozjpeg/transupp.c +2373 -0
  302. data/ext/image_pack/vendor/mozjpeg/transupp.h +243 -0
  303. data/ext/image_pack/vendor/mozjpeg/turbojpeg-jni.c +1259 -0
  304. data/ext/image_pack/vendor/mozjpeg/turbojpeg.c +2320 -0
  305. data/ext/image_pack/vendor/mozjpeg/turbojpeg.h +1784 -0
  306. data/ext/image_pack/vendor/mozjpeg/usage.txt +679 -0
  307. data/ext/image_pack/vendor/mozjpeg/wizard.txt +220 -0
  308. data/ext/image_pack/vendor/mozjpeg/wrbmp.c +552 -0
  309. data/ext/image_pack/vendor/mozjpeg/wrgif.c +580 -0
  310. data/ext/image_pack/vendor/mozjpeg/wrjpgcom.c +577 -0
  311. data/ext/image_pack/vendor/mozjpeg/wrppm.c +366 -0
  312. data/ext/image_pack/vendor/mozjpeg/wrtarga.c +258 -0
  313. data/ext/image_pack/vendor/mozjpeg/yuvjpeg.c +268 -0
  314. data/lib/image_pack/backend.rb +8 -0
  315. data/lib/image_pack/configuration.rb +23 -0
  316. data/lib/image_pack/errors.rb +13 -0
  317. data/lib/image_pack/version.rb +5 -0
  318. data/lib/image_pack.rb +208 -0
  319. metadata +433 -0
@@ -0,0 +1,1110 @@
1
+ /*
2
+ * jsimd_x86_64.c
3
+ *
4
+ * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5
+ * Copyright (C) 2009-2011, 2014, 2016, 2018, 2022-2023, D. R. Commander.
6
+ * Copyright (C) 2015-2016, 2018, 2022, Matthieu Darbois.
7
+ *
8
+ * Based on the x86 SIMD extension for IJG JPEG library,
9
+ * Copyright (C) 1999-2006, MIYASAKA Masaru.
10
+ * For conditions of distribution and use, see copyright notice in jsimdext.inc
11
+ *
12
+ * This file contains the interface between the "normal" portions
13
+ * of the library and the SIMD implementations when running on a
14
+ * 64-bit x86 architecture.
15
+ */
16
+
17
+ #define JPEG_INTERNALS
18
+ #include "../../jinclude.h"
19
+ #include "../../jpeglib.h"
20
+ #include "../../jsimd.h"
21
+ #include "../../jdct.h"
22
+ #include "../../jsimddct.h"
23
+ #include "../jsimd.h"
24
+
25
+ /*
26
+ * In the PIC cases, we have no guarantee that constants will keep
27
+ * their alignment. This macro allows us to verify it at runtime.
28
+ */
29
+ #define IS_ALIGNED(ptr, order) (((size_t)ptr & ((1 << order) - 1)) == 0)
30
+
31
+ #define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
32
+ #define IS_ALIGNED_AVX(ptr) (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
33
+
34
+ static THREAD_LOCAL unsigned int simd_support = (unsigned int)(~0);
35
+ static THREAD_LOCAL unsigned int simd_huffman = 1;
36
+
37
+ /*
38
+ * Check what SIMD accelerations are supported.
39
+ */
40
+ LOCAL(void)
41
+ init_simd(void)
42
+ {
43
+ #ifndef NO_GETENV
44
+ char env[2] = { 0 };
45
+ #endif
46
+
47
+ if (simd_support != ~0U)
48
+ return;
49
+
50
+ simd_support = jpeg_simd_cpu_support();
51
+
52
+ #ifndef NO_GETENV
53
+ /* Force different settings through environment variables */
54
+ if (!GETENV_S(env, 2, "JSIMD_FORCESSE2") && !strcmp(env, "1"))
55
+ simd_support &= JSIMD_SSE2;
56
+ if (!GETENV_S(env, 2, "JSIMD_FORCEAVX2") && !strcmp(env, "1"))
57
+ simd_support &= JSIMD_AVX2;
58
+ if (!GETENV_S(env, 2, "JSIMD_FORCENONE") && !strcmp(env, "1"))
59
+ simd_support = 0;
60
+ if (!GETENV_S(env, 2, "JSIMD_NOHUFFENC") && !strcmp(env, "1"))
61
+ simd_huffman = 0;
62
+ #endif
63
+ }
64
+
65
+ GLOBAL(int)
66
+ jsimd_can_rgb_ycc(void)
67
+ {
68
+ init_simd();
69
+
70
+ /* The code is optimised for these values only */
71
+ if (BITS_IN_JSAMPLE != 8)
72
+ return 0;
73
+ if (sizeof(JDIMENSION) != 4)
74
+ return 0;
75
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
76
+ return 0;
77
+
78
+ if ((simd_support & JSIMD_AVX2) &&
79
+ IS_ALIGNED_AVX(jconst_rgb_ycc_convert_avx2))
80
+ return 1;
81
+ if ((simd_support & JSIMD_SSE2) &&
82
+ IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))
83
+ return 1;
84
+
85
+ return 0;
86
+ }
87
+
88
+ GLOBAL(int)
89
+ jsimd_can_rgb_gray(void)
90
+ {
91
+ init_simd();
92
+
93
+ /* The code is optimised for these values only */
94
+ if (BITS_IN_JSAMPLE != 8)
95
+ return 0;
96
+ if (sizeof(JDIMENSION) != 4)
97
+ return 0;
98
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
99
+ return 0;
100
+
101
+ if ((simd_support & JSIMD_AVX2) &&
102
+ IS_ALIGNED_AVX(jconst_rgb_gray_convert_avx2))
103
+ return 1;
104
+ if ((simd_support & JSIMD_SSE2) &&
105
+ IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))
106
+ return 1;
107
+
108
+ return 0;
109
+ }
110
+
111
+ GLOBAL(int)
112
+ jsimd_can_ycc_rgb(void)
113
+ {
114
+ init_simd();
115
+
116
+ /* The code is optimised for these values only */
117
+ if (BITS_IN_JSAMPLE != 8)
118
+ return 0;
119
+ if (sizeof(JDIMENSION) != 4)
120
+ return 0;
121
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
122
+ return 0;
123
+
124
+ if ((simd_support & JSIMD_AVX2) &&
125
+ IS_ALIGNED_AVX(jconst_ycc_rgb_convert_avx2))
126
+ return 1;
127
+ if ((simd_support & JSIMD_SSE2) &&
128
+ IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))
129
+ return 1;
130
+
131
+ return 0;
132
+ }
133
+
134
+ GLOBAL(int)
135
+ jsimd_can_ycc_rgb565(void)
136
+ {
137
+ return 0;
138
+ }
139
+
140
+ GLOBAL(void)
141
+ jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
142
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
143
+ int num_rows)
144
+ {
145
+ void (*avx2fct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
146
+ void (*sse2fct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
147
+
148
+ if (simd_support == ~0U)
149
+ init_simd();
150
+
151
+ switch (cinfo->in_color_space) {
152
+ case JCS_EXT_RGB:
153
+ avx2fct = jsimd_extrgb_ycc_convert_avx2;
154
+ sse2fct = jsimd_extrgb_ycc_convert_sse2;
155
+ break;
156
+ case JCS_EXT_RGBX:
157
+ case JCS_EXT_RGBA:
158
+ avx2fct = jsimd_extrgbx_ycc_convert_avx2;
159
+ sse2fct = jsimd_extrgbx_ycc_convert_sse2;
160
+ break;
161
+ case JCS_EXT_BGR:
162
+ avx2fct = jsimd_extbgr_ycc_convert_avx2;
163
+ sse2fct = jsimd_extbgr_ycc_convert_sse2;
164
+ break;
165
+ case JCS_EXT_BGRX:
166
+ case JCS_EXT_BGRA:
167
+ avx2fct = jsimd_extbgrx_ycc_convert_avx2;
168
+ sse2fct = jsimd_extbgrx_ycc_convert_sse2;
169
+ break;
170
+ case JCS_EXT_XBGR:
171
+ case JCS_EXT_ABGR:
172
+ avx2fct = jsimd_extxbgr_ycc_convert_avx2;
173
+ sse2fct = jsimd_extxbgr_ycc_convert_sse2;
174
+ break;
175
+ case JCS_EXT_XRGB:
176
+ case JCS_EXT_ARGB:
177
+ avx2fct = jsimd_extxrgb_ycc_convert_avx2;
178
+ sse2fct = jsimd_extxrgb_ycc_convert_sse2;
179
+ break;
180
+ default:
181
+ avx2fct = jsimd_rgb_ycc_convert_avx2;
182
+ sse2fct = jsimd_rgb_ycc_convert_sse2;
183
+ break;
184
+ }
185
+
186
+ if (simd_support & JSIMD_AVX2)
187
+ avx2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
188
+ else
189
+ sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
190
+ }
191
+
192
+ GLOBAL(void)
193
+ jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
194
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
195
+ int num_rows)
196
+ {
197
+ void (*avx2fct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
198
+ void (*sse2fct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
199
+
200
+ if (simd_support == ~0U)
201
+ init_simd();
202
+
203
+ switch (cinfo->in_color_space) {
204
+ case JCS_EXT_RGB:
205
+ avx2fct = jsimd_extrgb_gray_convert_avx2;
206
+ sse2fct = jsimd_extrgb_gray_convert_sse2;
207
+ break;
208
+ case JCS_EXT_RGBX:
209
+ case JCS_EXT_RGBA:
210
+ avx2fct = jsimd_extrgbx_gray_convert_avx2;
211
+ sse2fct = jsimd_extrgbx_gray_convert_sse2;
212
+ break;
213
+ case JCS_EXT_BGR:
214
+ avx2fct = jsimd_extbgr_gray_convert_avx2;
215
+ sse2fct = jsimd_extbgr_gray_convert_sse2;
216
+ break;
217
+ case JCS_EXT_BGRX:
218
+ case JCS_EXT_BGRA:
219
+ avx2fct = jsimd_extbgrx_gray_convert_avx2;
220
+ sse2fct = jsimd_extbgrx_gray_convert_sse2;
221
+ break;
222
+ case JCS_EXT_XBGR:
223
+ case JCS_EXT_ABGR:
224
+ avx2fct = jsimd_extxbgr_gray_convert_avx2;
225
+ sse2fct = jsimd_extxbgr_gray_convert_sse2;
226
+ break;
227
+ case JCS_EXT_XRGB:
228
+ case JCS_EXT_ARGB:
229
+ avx2fct = jsimd_extxrgb_gray_convert_avx2;
230
+ sse2fct = jsimd_extxrgb_gray_convert_sse2;
231
+ break;
232
+ default:
233
+ avx2fct = jsimd_rgb_gray_convert_avx2;
234
+ sse2fct = jsimd_rgb_gray_convert_sse2;
235
+ break;
236
+ }
237
+
238
+ if (simd_support & JSIMD_AVX2)
239
+ avx2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
240
+ else
241
+ sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
242
+ }
243
+
244
+ GLOBAL(void)
245
+ jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
246
+ JDIMENSION input_row, JSAMPARRAY output_buf,
247
+ int num_rows)
248
+ {
249
+ void (*avx2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
250
+ void (*sse2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
251
+
252
+ if (simd_support == ~0U)
253
+ init_simd();
254
+
255
+ switch (cinfo->out_color_space) {
256
+ case JCS_EXT_RGB:
257
+ avx2fct = jsimd_ycc_extrgb_convert_avx2;
258
+ sse2fct = jsimd_ycc_extrgb_convert_sse2;
259
+ break;
260
+ case JCS_EXT_RGBX:
261
+ case JCS_EXT_RGBA:
262
+ avx2fct = jsimd_ycc_extrgbx_convert_avx2;
263
+ sse2fct = jsimd_ycc_extrgbx_convert_sse2;
264
+ break;
265
+ case JCS_EXT_BGR:
266
+ avx2fct = jsimd_ycc_extbgr_convert_avx2;
267
+ sse2fct = jsimd_ycc_extbgr_convert_sse2;
268
+ break;
269
+ case JCS_EXT_BGRX:
270
+ case JCS_EXT_BGRA:
271
+ avx2fct = jsimd_ycc_extbgrx_convert_avx2;
272
+ sse2fct = jsimd_ycc_extbgrx_convert_sse2;
273
+ break;
274
+ case JCS_EXT_XBGR:
275
+ case JCS_EXT_ABGR:
276
+ avx2fct = jsimd_ycc_extxbgr_convert_avx2;
277
+ sse2fct = jsimd_ycc_extxbgr_convert_sse2;
278
+ break;
279
+ case JCS_EXT_XRGB:
280
+ case JCS_EXT_ARGB:
281
+ avx2fct = jsimd_ycc_extxrgb_convert_avx2;
282
+ sse2fct = jsimd_ycc_extxrgb_convert_sse2;
283
+ break;
284
+ default:
285
+ avx2fct = jsimd_ycc_rgb_convert_avx2;
286
+ sse2fct = jsimd_ycc_rgb_convert_sse2;
287
+ break;
288
+ }
289
+
290
+ if (simd_support & JSIMD_AVX2)
291
+ avx2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
292
+ else
293
+ sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
294
+ }
295
+
296
+ GLOBAL(void)
297
+ jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
298
+ JDIMENSION input_row, JSAMPARRAY output_buf,
299
+ int num_rows)
300
+ {
301
+ }
302
+
303
+ GLOBAL(int)
304
+ jsimd_can_h2v2_downsample(void)
305
+ {
306
+ init_simd();
307
+
308
+ /* The code is optimised for these values only */
309
+ if (BITS_IN_JSAMPLE != 8)
310
+ return 0;
311
+ if (sizeof(JDIMENSION) != 4)
312
+ return 0;
313
+
314
+ if (simd_support & JSIMD_AVX2)
315
+ return 1;
316
+ if (simd_support & JSIMD_SSE2)
317
+ return 1;
318
+
319
+ return 0;
320
+ }
321
+
322
+ GLOBAL(int)
323
+ jsimd_can_h2v1_downsample(void)
324
+ {
325
+ init_simd();
326
+
327
+ /* The code is optimised for these values only */
328
+ if (BITS_IN_JSAMPLE != 8)
329
+ return 0;
330
+ if (sizeof(JDIMENSION) != 4)
331
+ return 0;
332
+
333
+ if (simd_support & JSIMD_AVX2)
334
+ return 1;
335
+ if (simd_support & JSIMD_SSE2)
336
+ return 1;
337
+
338
+ return 0;
339
+ }
340
+
341
+ GLOBAL(void)
342
+ jsimd_h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
343
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
344
+ {
345
+ if (simd_support == ~0U)
346
+ init_simd();
347
+
348
+ if (simd_support & JSIMD_AVX2)
349
+ jsimd_h2v2_downsample_avx2(cinfo->image_width, cinfo->max_v_samp_factor,
350
+ compptr->v_samp_factor,
351
+ compptr->width_in_blocks, input_data,
352
+ output_data);
353
+ else
354
+ jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,
355
+ compptr->v_samp_factor,
356
+ compptr->width_in_blocks, input_data,
357
+ output_data);
358
+ }
359
+
360
+ GLOBAL(void)
361
+ jsimd_h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
362
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
363
+ {
364
+ if (simd_support == ~0U)
365
+ init_simd();
366
+
367
+ if (simd_support & JSIMD_AVX2)
368
+ jsimd_h2v1_downsample_avx2(cinfo->image_width, cinfo->max_v_samp_factor,
369
+ compptr->v_samp_factor,
370
+ compptr->width_in_blocks, input_data,
371
+ output_data);
372
+ else
373
+ jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,
374
+ compptr->v_samp_factor,
375
+ compptr->width_in_blocks, input_data,
376
+ output_data);
377
+ }
378
+
379
+ GLOBAL(int)
380
+ jsimd_can_h2v2_upsample(void)
381
+ {
382
+ init_simd();
383
+
384
+ /* The code is optimised for these values only */
385
+ if (BITS_IN_JSAMPLE != 8)
386
+ return 0;
387
+ if (sizeof(JDIMENSION) != 4)
388
+ return 0;
389
+
390
+ if (simd_support & JSIMD_AVX2)
391
+ return 1;
392
+ if (simd_support & JSIMD_SSE2)
393
+ return 1;
394
+
395
+ return 0;
396
+ }
397
+
398
+ GLOBAL(int)
399
+ jsimd_can_h2v1_upsample(void)
400
+ {
401
+ init_simd();
402
+
403
+ /* The code is optimised for these values only */
404
+ if (BITS_IN_JSAMPLE != 8)
405
+ return 0;
406
+ if (sizeof(JDIMENSION) != 4)
407
+ return 0;
408
+
409
+ if (simd_support & JSIMD_AVX2)
410
+ return 1;
411
+ if (simd_support & JSIMD_SSE2)
412
+ return 1;
413
+
414
+ return 0;
415
+ }
416
+
417
+ GLOBAL(void)
418
+ jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
419
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
420
+ {
421
+ if (simd_support == ~0U)
422
+ init_simd();
423
+
424
+ if (simd_support & JSIMD_AVX2)
425
+ jsimd_h2v2_upsample_avx2(cinfo->max_v_samp_factor, cinfo->output_width,
426
+ input_data, output_data_ptr);
427
+ else
428
+ jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
429
+ input_data, output_data_ptr);
430
+ }
431
+
432
+ GLOBAL(void)
433
+ jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
434
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
435
+ {
436
+ if (simd_support == ~0U)
437
+ init_simd();
438
+
439
+ if (simd_support & JSIMD_AVX2)
440
+ jsimd_h2v1_upsample_avx2(cinfo->max_v_samp_factor, cinfo->output_width,
441
+ input_data, output_data_ptr);
442
+ else
443
+ jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
444
+ input_data, output_data_ptr);
445
+ }
446
+
447
+ GLOBAL(int)
448
+ jsimd_can_h2v2_fancy_upsample(void)
449
+ {
450
+ init_simd();
451
+
452
+ /* The code is optimised for these values only */
453
+ if (BITS_IN_JSAMPLE != 8)
454
+ return 0;
455
+ if (sizeof(JDIMENSION) != 4)
456
+ return 0;
457
+
458
+ if ((simd_support & JSIMD_AVX2) &&
459
+ IS_ALIGNED_AVX(jconst_fancy_upsample_avx2))
460
+ return 1;
461
+ if ((simd_support & JSIMD_SSE2) &&
462
+ IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
463
+ return 1;
464
+
465
+ return 0;
466
+ }
467
+
468
+ GLOBAL(int)
469
+ jsimd_can_h2v1_fancy_upsample(void)
470
+ {
471
+ init_simd();
472
+
473
+ /* The code is optimised for these values only */
474
+ if (BITS_IN_JSAMPLE != 8)
475
+ return 0;
476
+ if (sizeof(JDIMENSION) != 4)
477
+ return 0;
478
+
479
+ if ((simd_support & JSIMD_AVX2) &&
480
+ IS_ALIGNED_AVX(jconst_fancy_upsample_avx2))
481
+ return 1;
482
+ if ((simd_support & JSIMD_SSE2) &&
483
+ IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
484
+ return 1;
485
+
486
+ return 0;
487
+ }
488
+
489
+ GLOBAL(void)
490
+ jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
491
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
492
+ {
493
+ if (simd_support == ~0U)
494
+ init_simd();
495
+
496
+ if (simd_support & JSIMD_AVX2)
497
+ jsimd_h2v2_fancy_upsample_avx2(cinfo->max_v_samp_factor,
498
+ compptr->downsampled_width, input_data,
499
+ output_data_ptr);
500
+ else
501
+ jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,
502
+ compptr->downsampled_width, input_data,
503
+ output_data_ptr);
504
+ }
505
+
506
+ GLOBAL(void)
507
+ jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
508
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
509
+ {
510
+ if (simd_support == ~0U)
511
+ init_simd();
512
+
513
+ if (simd_support & JSIMD_AVX2)
514
+ jsimd_h2v1_fancy_upsample_avx2(cinfo->max_v_samp_factor,
515
+ compptr->downsampled_width, input_data,
516
+ output_data_ptr);
517
+ else
518
+ jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,
519
+ compptr->downsampled_width, input_data,
520
+ output_data_ptr);
521
+ }
522
+
523
+ GLOBAL(int)
524
+ jsimd_can_h2v2_merged_upsample(void)
525
+ {
526
+ init_simd();
527
+
528
+ /* The code is optimised for these values only */
529
+ if (BITS_IN_JSAMPLE != 8)
530
+ return 0;
531
+ if (sizeof(JDIMENSION) != 4)
532
+ return 0;
533
+
534
+ if ((simd_support & JSIMD_AVX2) &&
535
+ IS_ALIGNED_AVX(jconst_merged_upsample_avx2))
536
+ return 1;
537
+ if ((simd_support & JSIMD_SSE2) &&
538
+ IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
539
+ return 1;
540
+
541
+ return 0;
542
+ }
543
+
544
+ GLOBAL(int)
545
+ jsimd_can_h2v1_merged_upsample(void)
546
+ {
547
+ init_simd();
548
+
549
+ /* The code is optimised for these values only */
550
+ if (BITS_IN_JSAMPLE != 8)
551
+ return 0;
552
+ if (sizeof(JDIMENSION) != 4)
553
+ return 0;
554
+
555
+ if ((simd_support & JSIMD_AVX2) &&
556
+ IS_ALIGNED_AVX(jconst_merged_upsample_avx2))
557
+ return 1;
558
+ if ((simd_support & JSIMD_SSE2) &&
559
+ IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
560
+ return 1;
561
+
562
+ return 0;
563
+ }
564
+
565
+ GLOBAL(void)
566
+ jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
567
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
568
+ {
569
+ void (*avx2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
570
+ void (*sse2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
571
+
572
+ if (simd_support == ~0U)
573
+ init_simd();
574
+
575
+ switch (cinfo->out_color_space) {
576
+ case JCS_EXT_RGB:
577
+ avx2fct = jsimd_h2v2_extrgb_merged_upsample_avx2;
578
+ sse2fct = jsimd_h2v2_extrgb_merged_upsample_sse2;
579
+ break;
580
+ case JCS_EXT_RGBX:
581
+ case JCS_EXT_RGBA:
582
+ avx2fct = jsimd_h2v2_extrgbx_merged_upsample_avx2;
583
+ sse2fct = jsimd_h2v2_extrgbx_merged_upsample_sse2;
584
+ break;
585
+ case JCS_EXT_BGR:
586
+ avx2fct = jsimd_h2v2_extbgr_merged_upsample_avx2;
587
+ sse2fct = jsimd_h2v2_extbgr_merged_upsample_sse2;
588
+ break;
589
+ case JCS_EXT_BGRX:
590
+ case JCS_EXT_BGRA:
591
+ avx2fct = jsimd_h2v2_extbgrx_merged_upsample_avx2;
592
+ sse2fct = jsimd_h2v2_extbgrx_merged_upsample_sse2;
593
+ break;
594
+ case JCS_EXT_XBGR:
595
+ case JCS_EXT_ABGR:
596
+ avx2fct = jsimd_h2v2_extxbgr_merged_upsample_avx2;
597
+ sse2fct = jsimd_h2v2_extxbgr_merged_upsample_sse2;
598
+ break;
599
+ case JCS_EXT_XRGB:
600
+ case JCS_EXT_ARGB:
601
+ avx2fct = jsimd_h2v2_extxrgb_merged_upsample_avx2;
602
+ sse2fct = jsimd_h2v2_extxrgb_merged_upsample_sse2;
603
+ break;
604
+ default:
605
+ avx2fct = jsimd_h2v2_merged_upsample_avx2;
606
+ sse2fct = jsimd_h2v2_merged_upsample_sse2;
607
+ break;
608
+ }
609
+
610
+ if (simd_support & JSIMD_AVX2)
611
+ avx2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
612
+ else
613
+ sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
614
+ }
615
+
616
+ GLOBAL(void)
617
+ jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
618
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
619
+ {
620
+ void (*avx2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
621
+ void (*sse2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
622
+
623
+ if (simd_support == ~0U)
624
+ init_simd();
625
+
626
+ switch (cinfo->out_color_space) {
627
+ case JCS_EXT_RGB:
628
+ avx2fct = jsimd_h2v1_extrgb_merged_upsample_avx2;
629
+ sse2fct = jsimd_h2v1_extrgb_merged_upsample_sse2;
630
+ break;
631
+ case JCS_EXT_RGBX:
632
+ case JCS_EXT_RGBA:
633
+ avx2fct = jsimd_h2v1_extrgbx_merged_upsample_avx2;
634
+ sse2fct = jsimd_h2v1_extrgbx_merged_upsample_sse2;
635
+ break;
636
+ case JCS_EXT_BGR:
637
+ avx2fct = jsimd_h2v1_extbgr_merged_upsample_avx2;
638
+ sse2fct = jsimd_h2v1_extbgr_merged_upsample_sse2;
639
+ break;
640
+ case JCS_EXT_BGRX:
641
+ case JCS_EXT_BGRA:
642
+ avx2fct = jsimd_h2v1_extbgrx_merged_upsample_avx2;
643
+ sse2fct = jsimd_h2v1_extbgrx_merged_upsample_sse2;
644
+ break;
645
+ case JCS_EXT_XBGR:
646
+ case JCS_EXT_ABGR:
647
+ avx2fct = jsimd_h2v1_extxbgr_merged_upsample_avx2;
648
+ sse2fct = jsimd_h2v1_extxbgr_merged_upsample_sse2;
649
+ break;
650
+ case JCS_EXT_XRGB:
651
+ case JCS_EXT_ARGB:
652
+ avx2fct = jsimd_h2v1_extxrgb_merged_upsample_avx2;
653
+ sse2fct = jsimd_h2v1_extxrgb_merged_upsample_sse2;
654
+ break;
655
+ default:
656
+ avx2fct = jsimd_h2v1_merged_upsample_avx2;
657
+ sse2fct = jsimd_h2v1_merged_upsample_sse2;
658
+ break;
659
+ }
660
+
661
+ if (simd_support & JSIMD_AVX2)
662
+ avx2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
663
+ else
664
+ sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
665
+ }
666
+
667
+ GLOBAL(int)
668
+ jsimd_can_convsamp(void)
669
+ {
670
+ init_simd();
671
+
672
+ /* The code is optimised for these values only */
673
+ if (DCTSIZE != 8)
674
+ return 0;
675
+ if (BITS_IN_JSAMPLE != 8)
676
+ return 0;
677
+ if (sizeof(JDIMENSION) != 4)
678
+ return 0;
679
+ if (sizeof(DCTELEM) != 2)
680
+ return 0;
681
+
682
+ if (simd_support & JSIMD_AVX2)
683
+ return 1;
684
+ if (simd_support & JSIMD_SSE2)
685
+ return 1;
686
+
687
+ return 0;
688
+ }
689
+
690
+ GLOBAL(int)
691
+ jsimd_can_convsamp_float(void)
692
+ {
693
+ init_simd();
694
+
695
+ /* The code is optimised for these values only */
696
+ if (DCTSIZE != 8)
697
+ return 0;
698
+ if (BITS_IN_JSAMPLE != 8)
699
+ return 0;
700
+ if (sizeof(JDIMENSION) != 4)
701
+ return 0;
702
+ if (sizeof(FAST_FLOAT) != 4)
703
+ return 0;
704
+
705
+ if (simd_support & JSIMD_SSE2)
706
+ return 1;
707
+
708
+ return 0;
709
+ }
710
+
711
+ GLOBAL(void)
712
+ jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
713
+ DCTELEM *workspace)
714
+ {
715
+ if (simd_support == ~0U)
716
+ init_simd();
717
+
718
+ if (simd_support & JSIMD_AVX2)
719
+ jsimd_convsamp_avx2(sample_data, start_col, workspace);
720
+ else
721
+ jsimd_convsamp_sse2(sample_data, start_col, workspace);
722
+ }
723
+
724
+ GLOBAL(void)
725
+ jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
726
+ FAST_FLOAT *workspace)
727
+ {
728
+ jsimd_convsamp_float_sse2(sample_data, start_col, workspace);
729
+ }
730
+
731
+ GLOBAL(int)
732
+ jsimd_can_fdct_islow(void)
733
+ {
734
+ init_simd();
735
+
736
+ /* The code is optimised for these values only */
737
+ if (DCTSIZE != 8)
738
+ return 0;
739
+ if (sizeof(DCTELEM) != 2)
740
+ return 0;
741
+
742
+ if ((simd_support & JSIMD_AVX2) && IS_ALIGNED_AVX(jconst_fdct_islow_avx2))
743
+ return 1;
744
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))
745
+ return 1;
746
+
747
+ return 0;
748
+ }
749
+
750
+ GLOBAL(int)
751
+ jsimd_can_fdct_ifast(void)
752
+ {
753
+ init_simd();
754
+
755
+ /* The code is optimised for these values only */
756
+ if (DCTSIZE != 8)
757
+ return 0;
758
+ if (sizeof(DCTELEM) != 2)
759
+ return 0;
760
+
761
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_ifast_sse2))
762
+ return 1;
763
+
764
+ return 0;
765
+ }
766
+
767
+ GLOBAL(int)
768
+ jsimd_can_fdct_float(void)
769
+ {
770
+ init_simd();
771
+
772
+ /* The code is optimised for these values only */
773
+ if (DCTSIZE != 8)
774
+ return 0;
775
+ if (sizeof(FAST_FLOAT) != 4)
776
+ return 0;
777
+
778
+ if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse))
779
+ return 1;
780
+
781
+ return 0;
782
+ }
783
+
784
+ GLOBAL(void)
785
+ jsimd_fdct_islow(DCTELEM *data)
786
+ {
787
+ if (simd_support == ~0U)
788
+ init_simd();
789
+
790
+ if (simd_support & JSIMD_AVX2)
791
+ jsimd_fdct_islow_avx2(data);
792
+ else
793
+ jsimd_fdct_islow_sse2(data);
794
+ }
795
+
796
+ GLOBAL(void)
797
+ jsimd_fdct_ifast(DCTELEM *data)
798
+ {
799
+ jsimd_fdct_ifast_sse2(data);
800
+ }
801
+
802
+ GLOBAL(void)
803
+ jsimd_fdct_float(FAST_FLOAT *data)
804
+ {
805
+ jsimd_fdct_float_sse(data);
806
+ }
807
+
808
+ GLOBAL(int)
809
+ jsimd_can_quantize(void)
810
+ {
811
+ init_simd();
812
+
813
+ /* The code is optimised for these values only */
814
+ if (DCTSIZE != 8)
815
+ return 0;
816
+ if (sizeof(JCOEF) != 2)
817
+ return 0;
818
+ if (sizeof(DCTELEM) != 2)
819
+ return 0;
820
+
821
+ if (simd_support & JSIMD_AVX2)
822
+ return 1;
823
+ if (simd_support & JSIMD_SSE2)
824
+ return 1;
825
+
826
+ return 0;
827
+ }
828
+
829
+ GLOBAL(int)
830
+ jsimd_can_quantize_float(void)
831
+ {
832
+ init_simd();
833
+
834
+ /* The code is optimised for these values only */
835
+ if (DCTSIZE != 8)
836
+ return 0;
837
+ if (sizeof(JCOEF) != 2)
838
+ return 0;
839
+ if (sizeof(FAST_FLOAT) != 4)
840
+ return 0;
841
+
842
+ if (simd_support & JSIMD_SSE2)
843
+ return 1;
844
+
845
+ return 0;
846
+ }
847
+
848
+ GLOBAL(void)
849
+ jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
850
+ {
851
+ if (simd_support == ~0U)
852
+ init_simd();
853
+
854
+ if (simd_support & JSIMD_AVX2)
855
+ jsimd_quantize_avx2(coef_block, divisors, workspace);
856
+ else
857
+ jsimd_quantize_sse2(coef_block, divisors, workspace);
858
+ }
859
+
860
+ GLOBAL(void)
861
+ jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
862
+ FAST_FLOAT *workspace)
863
+ {
864
+ jsimd_quantize_float_sse2(coef_block, divisors, workspace);
865
+ }
866
+
867
+ GLOBAL(int)
868
+ jsimd_can_idct_2x2(void)
869
+ {
870
+ init_simd();
871
+
872
+ /* The code is optimised for these values only */
873
+ if (DCTSIZE != 8)
874
+ return 0;
875
+ if (sizeof(JCOEF) != 2)
876
+ return 0;
877
+ if (BITS_IN_JSAMPLE != 8)
878
+ return 0;
879
+ if (sizeof(JDIMENSION) != 4)
880
+ return 0;
881
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
882
+ return 0;
883
+
884
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))
885
+ return 1;
886
+
887
+ return 0;
888
+ }
889
+
890
+ GLOBAL(int)
891
+ jsimd_can_idct_4x4(void)
892
+ {
893
+ init_simd();
894
+
895
+ /* The code is optimised for these values only */
896
+ if (DCTSIZE != 8)
897
+ return 0;
898
+ if (sizeof(JCOEF) != 2)
899
+ return 0;
900
+ if (BITS_IN_JSAMPLE != 8)
901
+ return 0;
902
+ if (sizeof(JDIMENSION) != 4)
903
+ return 0;
904
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
905
+ return 0;
906
+
907
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))
908
+ return 1;
909
+
910
+ return 0;
911
+ }
912
+
913
+ GLOBAL(void)
914
+ jsimd_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
915
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
916
+ JDIMENSION output_col)
917
+ {
918
+ jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col);
919
+ }
920
+
921
+ GLOBAL(void)
922
+ jsimd_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
923
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
924
+ JDIMENSION output_col)
925
+ {
926
+ jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col);
927
+ }
928
+
929
+ GLOBAL(int)
930
+ jsimd_can_idct_islow(void)
931
+ {
932
+ init_simd();
933
+
934
+ /* The code is optimised for these values only */
935
+ if (DCTSIZE != 8)
936
+ return 0;
937
+ if (sizeof(JCOEF) != 2)
938
+ return 0;
939
+ if (BITS_IN_JSAMPLE != 8)
940
+ return 0;
941
+ if (sizeof(JDIMENSION) != 4)
942
+ return 0;
943
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
944
+ return 0;
945
+
946
+ if ((simd_support & JSIMD_AVX2) && IS_ALIGNED_AVX(jconst_idct_islow_avx2))
947
+ return 1;
948
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))
949
+ return 1;
950
+
951
+ return 0;
952
+ }
953
+
954
+ GLOBAL(int)
955
+ jsimd_can_idct_ifast(void)
956
+ {
957
+ init_simd();
958
+
959
+ /* The code is optimised for these values only */
960
+ if (DCTSIZE != 8)
961
+ return 0;
962
+ if (sizeof(JCOEF) != 2)
963
+ return 0;
964
+ if (BITS_IN_JSAMPLE != 8)
965
+ return 0;
966
+ if (sizeof(JDIMENSION) != 4)
967
+ return 0;
968
+ if (sizeof(IFAST_MULT_TYPE) != 2)
969
+ return 0;
970
+ if (IFAST_SCALE_BITS != 2)
971
+ return 0;
972
+
973
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))
974
+ return 1;
975
+
976
+ return 0;
977
+ }
978
+
979
+ GLOBAL(int)
980
+ jsimd_can_idct_float(void)
981
+ {
982
+ init_simd();
983
+
984
+ if (DCTSIZE != 8)
985
+ return 0;
986
+ if (sizeof(JCOEF) != 2)
987
+ return 0;
988
+ if (BITS_IN_JSAMPLE != 8)
989
+ return 0;
990
+ if (sizeof(JDIMENSION) != 4)
991
+ return 0;
992
+ if (sizeof(FAST_FLOAT) != 4)
993
+ return 0;
994
+ if (sizeof(FLOAT_MULT_TYPE) != 4)
995
+ return 0;
996
+
997
+ if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))
998
+ return 1;
999
+
1000
+ return 0;
1001
+ }
1002
+
1003
+ GLOBAL(void)
1004
+ jsimd_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1005
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
1006
+ JDIMENSION output_col)
1007
+ {
1008
+ if (simd_support == ~0U)
1009
+ init_simd();
1010
+
1011
+ if (simd_support & JSIMD_AVX2)
1012
+ jsimd_idct_islow_avx2(compptr->dct_table, coef_block, output_buf,
1013
+ output_col);
1014
+ else
1015
+ jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf,
1016
+ output_col);
1017
+ }
1018
+
1019
+ GLOBAL(void)
1020
+ jsimd_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1021
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
1022
+ JDIMENSION output_col)
1023
+ {
1024
+ jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf,
1025
+ output_col);
1026
+ }
1027
+
1028
+ GLOBAL(void)
1029
+ jsimd_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
1030
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
1031
+ JDIMENSION output_col)
1032
+ {
1033
+ jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf,
1034
+ output_col);
1035
+ }
1036
+
1037
+ GLOBAL(int)
1038
+ jsimd_can_huff_encode_one_block(void)
1039
+ {
1040
+ init_simd();
1041
+
1042
+ if (DCTSIZE != 8)
1043
+ return 0;
1044
+ if (sizeof(JCOEF) != 2)
1045
+ return 0;
1046
+
1047
+ if ((simd_support & JSIMD_SSE2) && simd_huffman &&
1048
+ IS_ALIGNED_SSE(jconst_huff_encode_one_block))
1049
+ return 1;
1050
+
1051
+ return 0;
1052
+ }
1053
+
1054
+ GLOBAL(JOCTET *)
1055
+ jsimd_huff_encode_one_block(void *state, JOCTET *buffer, JCOEFPTR block,
1056
+ int last_dc_val, c_derived_tbl *dctbl,
1057
+ c_derived_tbl *actbl)
1058
+ {
1059
+ return jsimd_huff_encode_one_block_sse2(state, buffer, block, last_dc_val,
1060
+ dctbl, actbl);
1061
+ }
1062
+
1063
+ GLOBAL(int)
1064
+ jsimd_can_encode_mcu_AC_first_prepare(void)
1065
+ {
1066
+ init_simd();
1067
+
1068
+ if (DCTSIZE != 8)
1069
+ return 0;
1070
+ if (sizeof(JCOEF) != 2)
1071
+ return 0;
1072
+ if (simd_support & JSIMD_SSE2)
1073
+ return 1;
1074
+
1075
+ return 0;
1076
+ }
1077
+
1078
+ GLOBAL(void)
1079
+ jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
1080
+ const int *jpeg_natural_order_start, int Sl,
1081
+ int Al, UJCOEF *values, size_t *zerobits)
1082
+ {
1083
+ jsimd_encode_mcu_AC_first_prepare_sse2(block, jpeg_natural_order_start,
1084
+ Sl, Al, values, zerobits);
1085
+ }
1086
+
1087
+ GLOBAL(int)
1088
+ jsimd_can_encode_mcu_AC_refine_prepare(void)
1089
+ {
1090
+ init_simd();
1091
+
1092
+ if (DCTSIZE != 8)
1093
+ return 0;
1094
+ if (sizeof(JCOEF) != 2)
1095
+ return 0;
1096
+ if (simd_support & JSIMD_SSE2)
1097
+ return 1;
1098
+
1099
+ return 0;
1100
+ }
1101
+
1102
+ GLOBAL(int)
1103
+ jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
1104
+ const int *jpeg_natural_order_start, int Sl,
1105
+ int Al, UJCOEF *absvalues, size_t *bits)
1106
+ {
1107
+ return jsimd_encode_mcu_AC_refine_prepare_sse2(block,
1108
+ jpeg_natural_order_start,
1109
+ Sl, Al, absvalues, bits);
1110
+ }