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,866 @@
1
+ /*
2
+ * jsimd_mips64.c
3
+ *
4
+ * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5
+ * Copyright (C) 2009-2011, 2014, 2016, 2018, 2022, D. R. Commander.
6
+ * Copyright (C) 2013-2014, MIPS Technologies, Inc., California.
7
+ * Copyright (C) 2015, 2018, 2022, Matthieu Darbois.
8
+ * Copyright (C) 2016-2018, Loongson Technology Corporation Limited, BeiJing.
9
+ *
10
+ * Based on the x86 SIMD extension for IJG JPEG library,
11
+ * Copyright (C) 1999-2006, MIYASAKA Masaru.
12
+ * For conditions of distribution and use, see copyright notice in jsimdext.inc
13
+ *
14
+ * This file contains the interface between the "normal" portions
15
+ * of the library and the SIMD implementations when running on a
16
+ * 64-bit MIPS architecture.
17
+ */
18
+
19
+ #define JPEG_INTERNALS
20
+ #include "../../jinclude.h"
21
+ #include "../../jpeglib.h"
22
+ #include "../../jsimd.h"
23
+ #include "../../jdct.h"
24
+ #include "../../jsimddct.h"
25
+ #include "../jsimd.h"
26
+
27
+ #include <ctype.h>
28
+
29
+ static THREAD_LOCAL unsigned int simd_support = ~0;
30
+
31
+ #if defined(__linux__)
32
+
33
+ #define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
34
+
35
+ LOCAL(int)
36
+ check_feature(char *buffer, char *feature)
37
+ {
38
+ char *p;
39
+
40
+ if (*feature == 0)
41
+ return 0;
42
+ if (strncmp(buffer, "ASEs implemented", 16) != 0)
43
+ return 0;
44
+ buffer += 16;
45
+ while (isspace(*buffer))
46
+ buffer++;
47
+
48
+ /* Check if 'feature' is present in the buffer as a separate word */
49
+ while ((p = strstr(buffer, feature))) {
50
+ if (p > buffer && !isspace(*(p - 1))) {
51
+ buffer++;
52
+ continue;
53
+ }
54
+ p += strlen(feature);
55
+ if (*p != 0 && !isspace(*p)) {
56
+ buffer++;
57
+ continue;
58
+ }
59
+ return 1;
60
+ }
61
+ return 0;
62
+ }
63
+
64
+ LOCAL(int)
65
+ parse_proc_cpuinfo(int bufsize)
66
+ {
67
+ char *buffer = (char *)malloc(bufsize);
68
+ FILE *fd;
69
+
70
+ simd_support = 0;
71
+
72
+ if (!buffer)
73
+ return 0;
74
+
75
+ fd = fopen("/proc/cpuinfo", "r");
76
+ if (fd) {
77
+ while (fgets(buffer, bufsize, fd)) {
78
+ if (!strchr(buffer, '\n') && !feof(fd)) {
79
+ /* "impossible" happened - insufficient size of the buffer! */
80
+ fclose(fd);
81
+ free(buffer);
82
+ return 0;
83
+ }
84
+ if (check_feature(buffer, "loongson-mmi"))
85
+ simd_support |= JSIMD_MMI;
86
+ }
87
+ fclose(fd);
88
+ }
89
+ free(buffer);
90
+ return 1;
91
+ }
92
+
93
+ #endif
94
+
95
+ /*
96
+ * Check what SIMD accelerations are supported.
97
+ */
98
+ LOCAL(void)
99
+ init_simd(void)
100
+ {
101
+ #ifndef NO_GETENV
102
+ char *env = NULL;
103
+ #endif
104
+ #if defined(__linux__)
105
+ int bufsize = 1024; /* an initial guess for the line buffer size limit */
106
+ #endif
107
+
108
+ if (simd_support != ~0U)
109
+ return;
110
+
111
+ simd_support = 0;
112
+
113
+ #if defined(__linux__)
114
+ while (!parse_proc_cpuinfo(bufsize)) {
115
+ bufsize *= 2;
116
+ if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
117
+ break;
118
+ }
119
+ #elif defined(__mips_loongson_vector_rev)
120
+ /* Only enable MMI by default on non-Linux platforms when the compiler flags
121
+ * support it. */
122
+ simd_support |= JSIMD_MMI;
123
+ #endif
124
+
125
+ #ifndef NO_GETENV
126
+ /* Force different settings through environment variables */
127
+ env = getenv("JSIMD_FORCEMMI");
128
+ if ((env != NULL) && (strcmp(env, "1") == 0))
129
+ simd_support = JSIMD_MMI;
130
+ env = getenv("JSIMD_FORCENONE");
131
+ if ((env != NULL) && (strcmp(env, "1") == 0))
132
+ simd_support = 0;
133
+ #endif
134
+ }
135
+
136
+ GLOBAL(int)
137
+ jsimd_can_rgb_ycc(void)
138
+ {
139
+ init_simd();
140
+
141
+ /* The code is optimised for these values only */
142
+ if (BITS_IN_JSAMPLE != 8)
143
+ return 0;
144
+ if (sizeof(JDIMENSION) != 4)
145
+ return 0;
146
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
147
+ return 0;
148
+
149
+ if (simd_support & JSIMD_MMI)
150
+ return 1;
151
+
152
+ return 0;
153
+ }
154
+
155
+ GLOBAL(int)
156
+ jsimd_can_rgb_gray(void)
157
+ {
158
+ init_simd();
159
+
160
+ /* The code is optimised for these values only */
161
+ if (BITS_IN_JSAMPLE != 8)
162
+ return 0;
163
+ if (sizeof(JDIMENSION) != 4)
164
+ return 0;
165
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
166
+ return 0;
167
+
168
+ if (simd_support & JSIMD_MMI)
169
+ return 1;
170
+
171
+ return 0;
172
+ }
173
+
174
+ GLOBAL(int)
175
+ jsimd_can_ycc_rgb(void)
176
+ {
177
+ init_simd();
178
+
179
+ /* The code is optimised for these values only */
180
+ if (BITS_IN_JSAMPLE != 8)
181
+ return 0;
182
+ if (sizeof(JDIMENSION) != 4)
183
+ return 0;
184
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
185
+ return 0;
186
+
187
+ if (simd_support & JSIMD_MMI)
188
+ return 1;
189
+
190
+ return 0;
191
+ }
192
+
193
+ GLOBAL(int)
194
+ jsimd_can_ycc_rgb565(void)
195
+ {
196
+ return 0;
197
+ }
198
+
199
+ GLOBAL(int)
200
+ jsimd_c_can_null_convert(void)
201
+ {
202
+ return 0;
203
+ }
204
+
205
+ GLOBAL(void)
206
+ jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
207
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
208
+ int num_rows)
209
+ {
210
+ void (*mmifct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
211
+
212
+ switch (cinfo->in_color_space) {
213
+ case JCS_EXT_RGB:
214
+ mmifct = jsimd_extrgb_ycc_convert_mmi;
215
+ break;
216
+ case JCS_EXT_RGBX:
217
+ case JCS_EXT_RGBA:
218
+ mmifct = jsimd_extrgbx_ycc_convert_mmi;
219
+ break;
220
+ case JCS_EXT_BGR:
221
+ mmifct = jsimd_extbgr_ycc_convert_mmi;
222
+ break;
223
+ case JCS_EXT_BGRX:
224
+ case JCS_EXT_BGRA:
225
+ mmifct = jsimd_extbgrx_ycc_convert_mmi;
226
+ break;
227
+ case JCS_EXT_XBGR:
228
+ case JCS_EXT_ABGR:
229
+ mmifct = jsimd_extxbgr_ycc_convert_mmi;
230
+ break;
231
+ case JCS_EXT_XRGB:
232
+ case JCS_EXT_ARGB:
233
+ mmifct = jsimd_extxrgb_ycc_convert_mmi;
234
+ break;
235
+ default:
236
+ mmifct = jsimd_rgb_ycc_convert_mmi;
237
+ break;
238
+ }
239
+
240
+ mmifct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
241
+ }
242
+
243
+ GLOBAL(void)
244
+ jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
245
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
246
+ int num_rows)
247
+ {
248
+ void (*mmifct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
249
+
250
+ switch (cinfo->in_color_space) {
251
+ case JCS_EXT_RGB:
252
+ mmifct = jsimd_extrgb_gray_convert_mmi;
253
+ break;
254
+ case JCS_EXT_RGBX:
255
+ case JCS_EXT_RGBA:
256
+ mmifct = jsimd_extrgbx_gray_convert_mmi;
257
+ break;
258
+ case JCS_EXT_BGR:
259
+ mmifct = jsimd_extbgr_gray_convert_mmi;
260
+ break;
261
+ case JCS_EXT_BGRX:
262
+ case JCS_EXT_BGRA:
263
+ mmifct = jsimd_extbgrx_gray_convert_mmi;
264
+ break;
265
+ case JCS_EXT_XBGR:
266
+ case JCS_EXT_ABGR:
267
+ mmifct = jsimd_extxbgr_gray_convert_mmi;
268
+ break;
269
+ case JCS_EXT_XRGB:
270
+ case JCS_EXT_ARGB:
271
+ mmifct = jsimd_extxrgb_gray_convert_mmi;
272
+ break;
273
+ default:
274
+ mmifct = jsimd_rgb_gray_convert_mmi;
275
+ break;
276
+ }
277
+
278
+ mmifct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
279
+ }
280
+
281
+ GLOBAL(void)
282
+ jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
283
+ JDIMENSION input_row, JSAMPARRAY output_buf,
284
+ int num_rows)
285
+ {
286
+ void (*mmifct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
287
+
288
+ switch (cinfo->out_color_space) {
289
+ case JCS_EXT_RGB:
290
+ mmifct = jsimd_ycc_extrgb_convert_mmi;
291
+ break;
292
+ case JCS_EXT_RGBX:
293
+ case JCS_EXT_RGBA:
294
+ mmifct = jsimd_ycc_extrgbx_convert_mmi;
295
+ break;
296
+ case JCS_EXT_BGR:
297
+ mmifct = jsimd_ycc_extbgr_convert_mmi;
298
+ break;
299
+ case JCS_EXT_BGRX:
300
+ case JCS_EXT_BGRA:
301
+ mmifct = jsimd_ycc_extbgrx_convert_mmi;
302
+ break;
303
+ case JCS_EXT_XBGR:
304
+ case JCS_EXT_ABGR:
305
+ mmifct = jsimd_ycc_extxbgr_convert_mmi;
306
+ break;
307
+ case JCS_EXT_XRGB:
308
+ case JCS_EXT_ARGB:
309
+ mmifct = jsimd_ycc_extxrgb_convert_mmi;
310
+ break;
311
+ default:
312
+ mmifct = jsimd_ycc_rgb_convert_mmi;
313
+ break;
314
+ }
315
+
316
+ mmifct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
317
+ }
318
+
319
+ GLOBAL(void)
320
+ jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
321
+ JDIMENSION input_row, JSAMPARRAY output_buf,
322
+ int num_rows)
323
+ {
324
+ }
325
+
326
+ GLOBAL(void)
327
+ jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
328
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
329
+ int num_rows)
330
+ {
331
+ }
332
+
333
+ GLOBAL(int)
334
+ jsimd_can_h2v2_downsample(void)
335
+ {
336
+ init_simd();
337
+
338
+ /* The code is optimised for these values only */
339
+ if (BITS_IN_JSAMPLE != 8)
340
+ return 0;
341
+ if (sizeof(JDIMENSION) != 4)
342
+ return 0;
343
+
344
+ if (simd_support & JSIMD_MMI)
345
+ return 1;
346
+
347
+ return 0;
348
+ }
349
+
350
+ GLOBAL(int)
351
+ jsimd_can_h2v2_smooth_downsample(void)
352
+ {
353
+ return 0;
354
+ }
355
+
356
+ GLOBAL(int)
357
+ jsimd_can_h2v1_downsample(void)
358
+ {
359
+ return 0;
360
+ }
361
+
362
+ GLOBAL(void)
363
+ jsimd_h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
364
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
365
+ {
366
+ jsimd_h2v2_downsample_mmi(cinfo->image_width, cinfo->max_v_samp_factor,
367
+ compptr->v_samp_factor, compptr->width_in_blocks,
368
+ input_data, output_data);
369
+ }
370
+
371
+ GLOBAL(void)
372
+ jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,
373
+ jpeg_component_info *compptr,
374
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
375
+ {
376
+ }
377
+
378
+ GLOBAL(void)
379
+ jsimd_h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
380
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
381
+ {
382
+ }
383
+
384
+ GLOBAL(int)
385
+ jsimd_can_h2v2_upsample(void)
386
+ {
387
+ return 0;
388
+ }
389
+
390
+ GLOBAL(int)
391
+ jsimd_can_h2v1_upsample(void)
392
+ {
393
+ return 0;
394
+ }
395
+
396
+ GLOBAL(int)
397
+ jsimd_can_int_upsample(void)
398
+ {
399
+ return 0;
400
+ }
401
+
402
+ GLOBAL(void)
403
+ jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
404
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
405
+ {
406
+ }
407
+
408
+ GLOBAL(void)
409
+ jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
410
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
411
+ {
412
+ }
413
+
414
+ GLOBAL(void)
415
+ jsimd_int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
416
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
417
+ {
418
+ }
419
+
420
+ GLOBAL(int)
421
+ jsimd_can_h2v2_fancy_upsample(void)
422
+ {
423
+ init_simd();
424
+
425
+ /* The code is optimised for these values only */
426
+ if (BITS_IN_JSAMPLE != 8)
427
+ return 0;
428
+ if (sizeof(JDIMENSION) != 4)
429
+ return 0;
430
+
431
+ if (simd_support & JSIMD_MMI)
432
+ return 1;
433
+
434
+ return 0;
435
+ }
436
+
437
+ GLOBAL(int)
438
+ jsimd_can_h2v1_fancy_upsample(void)
439
+ {
440
+ init_simd();
441
+
442
+ /* The code is optimised for these values only */
443
+ if (BITS_IN_JSAMPLE != 8)
444
+ return 0;
445
+ if (sizeof(JDIMENSION) != 4)
446
+ return 0;
447
+
448
+ if (simd_support & JSIMD_MMI)
449
+ return 1;
450
+
451
+ return 0;
452
+ }
453
+
454
+ GLOBAL(void)
455
+ jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
456
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
457
+ {
458
+ jsimd_h2v2_fancy_upsample_mmi(cinfo->max_v_samp_factor,
459
+ compptr->downsampled_width, input_data,
460
+ output_data_ptr);
461
+ }
462
+
463
+ GLOBAL(void)
464
+ jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
465
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
466
+ {
467
+ jsimd_h2v1_fancy_upsample_mmi(cinfo->max_v_samp_factor,
468
+ compptr->downsampled_width, input_data,
469
+ output_data_ptr);
470
+ }
471
+
472
+ GLOBAL(int)
473
+ jsimd_can_h2v2_merged_upsample(void)
474
+ {
475
+ init_simd();
476
+
477
+ /* The code is optimised for these values only */
478
+ if (BITS_IN_JSAMPLE != 8)
479
+ return 0;
480
+ if (sizeof(JDIMENSION) != 4)
481
+ return 0;
482
+
483
+ if (simd_support & JSIMD_MMI)
484
+ return 1;
485
+
486
+ return 0;
487
+ }
488
+
489
+ GLOBAL(int)
490
+ jsimd_can_h2v1_merged_upsample(void)
491
+ {
492
+ init_simd();
493
+
494
+ /* The code is optimised for these values only */
495
+ if (BITS_IN_JSAMPLE != 8)
496
+ return 0;
497
+ if (sizeof(JDIMENSION) != 4)
498
+ return 0;
499
+
500
+ if (simd_support & JSIMD_MMI)
501
+ return 1;
502
+
503
+ return 0;
504
+ }
505
+
506
+ GLOBAL(void)
507
+ jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
508
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
509
+ {
510
+ void (*mmifct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
511
+
512
+ switch (cinfo->out_color_space) {
513
+ case JCS_EXT_RGB:
514
+ mmifct = jsimd_h2v2_extrgb_merged_upsample_mmi;
515
+ break;
516
+ case JCS_EXT_RGBX:
517
+ case JCS_EXT_RGBA:
518
+ mmifct = jsimd_h2v2_extrgbx_merged_upsample_mmi;
519
+ break;
520
+ case JCS_EXT_BGR:
521
+ mmifct = jsimd_h2v2_extbgr_merged_upsample_mmi;
522
+ break;
523
+ case JCS_EXT_BGRX:
524
+ case JCS_EXT_BGRA:
525
+ mmifct = jsimd_h2v2_extbgrx_merged_upsample_mmi;
526
+ break;
527
+ case JCS_EXT_XBGR:
528
+ case JCS_EXT_ABGR:
529
+ mmifct = jsimd_h2v2_extxbgr_merged_upsample_mmi;
530
+ break;
531
+ case JCS_EXT_XRGB:
532
+ case JCS_EXT_ARGB:
533
+ mmifct = jsimd_h2v2_extxrgb_merged_upsample_mmi;
534
+ break;
535
+ default:
536
+ mmifct = jsimd_h2v2_merged_upsample_mmi;
537
+ break;
538
+ }
539
+
540
+ mmifct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
541
+ }
542
+
543
+ GLOBAL(void)
544
+ jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
545
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
546
+ {
547
+ void (*mmifct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
548
+
549
+ switch (cinfo->out_color_space) {
550
+ case JCS_EXT_RGB:
551
+ mmifct = jsimd_h2v1_extrgb_merged_upsample_mmi;
552
+ break;
553
+ case JCS_EXT_RGBX:
554
+ case JCS_EXT_RGBA:
555
+ mmifct = jsimd_h2v1_extrgbx_merged_upsample_mmi;
556
+ break;
557
+ case JCS_EXT_BGR:
558
+ mmifct = jsimd_h2v1_extbgr_merged_upsample_mmi;
559
+ break;
560
+ case JCS_EXT_BGRX:
561
+ case JCS_EXT_BGRA:
562
+ mmifct = jsimd_h2v1_extbgrx_merged_upsample_mmi;
563
+ break;
564
+ case JCS_EXT_XBGR:
565
+ case JCS_EXT_ABGR:
566
+ mmifct = jsimd_h2v1_extxbgr_merged_upsample_mmi;
567
+ break;
568
+ case JCS_EXT_XRGB:
569
+ case JCS_EXT_ARGB:
570
+ mmifct = jsimd_h2v1_extxrgb_merged_upsample_mmi;
571
+ break;
572
+ default:
573
+ mmifct = jsimd_h2v1_merged_upsample_mmi;
574
+ break;
575
+ }
576
+
577
+ mmifct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
578
+ }
579
+
580
+ GLOBAL(int)
581
+ jsimd_can_convsamp(void)
582
+ {
583
+ return 0;
584
+ }
585
+
586
+ GLOBAL(int)
587
+ jsimd_can_convsamp_float(void)
588
+ {
589
+ return 0;
590
+ }
591
+
592
+ GLOBAL(void)
593
+ jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
594
+ DCTELEM *workspace)
595
+ {
596
+ }
597
+
598
+ GLOBAL(void)
599
+ jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
600
+ FAST_FLOAT *workspace)
601
+ {
602
+ }
603
+
604
+ GLOBAL(int)
605
+ jsimd_can_fdct_islow(void)
606
+ {
607
+ init_simd();
608
+
609
+ /* The code is optimised for these values only */
610
+ if (DCTSIZE != 8)
611
+ return 0;
612
+ if (sizeof(DCTELEM) != 2)
613
+ return 0;
614
+
615
+ if (simd_support & JSIMD_MMI)
616
+ return 1;
617
+
618
+ return 0;
619
+ }
620
+
621
+ GLOBAL(int)
622
+ jsimd_can_fdct_ifast(void)
623
+ {
624
+ init_simd();
625
+
626
+ /* The code is optimised for these values only */
627
+ if (DCTSIZE != 8)
628
+ return 0;
629
+ if (sizeof(DCTELEM) != 2)
630
+ return 0;
631
+
632
+ if (simd_support & JSIMD_MMI)
633
+ return 1;
634
+
635
+ return 0;
636
+ }
637
+
638
+ GLOBAL(int)
639
+ jsimd_can_fdct_float(void)
640
+ {
641
+ return 0;
642
+ }
643
+
644
+ GLOBAL(void)
645
+ jsimd_fdct_islow(DCTELEM *data)
646
+ {
647
+ jsimd_fdct_islow_mmi(data);
648
+ }
649
+
650
+ GLOBAL(void)
651
+ jsimd_fdct_ifast(DCTELEM *data)
652
+ {
653
+ jsimd_fdct_ifast_mmi(data);
654
+ }
655
+
656
+ GLOBAL(void)
657
+ jsimd_fdct_float(FAST_FLOAT *data)
658
+ {
659
+ }
660
+
661
+ GLOBAL(int)
662
+ jsimd_can_quantize(void)
663
+ {
664
+ init_simd();
665
+
666
+ /* The code is optimised for these values only */
667
+ if (DCTSIZE != 8)
668
+ return 0;
669
+ if (sizeof(JCOEF) != 2)
670
+ return 0;
671
+ if (sizeof(DCTELEM) != 2)
672
+ return 0;
673
+
674
+ if (simd_support & JSIMD_MMI)
675
+ return 1;
676
+
677
+ return 0;
678
+ }
679
+
680
+ GLOBAL(int)
681
+ jsimd_can_quantize_float(void)
682
+ {
683
+ return 0;
684
+ }
685
+
686
+ GLOBAL(void)
687
+ jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
688
+ {
689
+ jsimd_quantize_mmi(coef_block, divisors, workspace);
690
+ }
691
+
692
+ GLOBAL(void)
693
+ jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
694
+ FAST_FLOAT *workspace)
695
+ {
696
+ }
697
+
698
+ GLOBAL(int)
699
+ jsimd_can_idct_2x2(void)
700
+ {
701
+ return 0;
702
+ }
703
+
704
+ GLOBAL(int)
705
+ jsimd_can_idct_4x4(void)
706
+ {
707
+ return 0;
708
+ }
709
+
710
+ GLOBAL(int)
711
+ jsimd_can_idct_6x6(void)
712
+ {
713
+ return 0;
714
+ }
715
+
716
+ GLOBAL(int)
717
+ jsimd_can_idct_12x12(void)
718
+ {
719
+ return 0;
720
+ }
721
+
722
+ GLOBAL(void)
723
+ jsimd_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
724
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
725
+ JDIMENSION output_col)
726
+ {
727
+ }
728
+
729
+ GLOBAL(void)
730
+ jsimd_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
731
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
732
+ JDIMENSION output_col)
733
+ {
734
+ }
735
+
736
+ GLOBAL(void)
737
+ jsimd_idct_6x6(j_decompress_ptr cinfo, jpeg_component_info *compptr,
738
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
739
+ JDIMENSION output_col)
740
+ {
741
+ }
742
+
743
+ GLOBAL(void)
744
+ jsimd_idct_12x12(j_decompress_ptr cinfo, jpeg_component_info *compptr,
745
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
746
+ JDIMENSION output_col)
747
+ {
748
+ }
749
+
750
+ GLOBAL(int)
751
+ jsimd_can_idct_islow(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(JCOEF) != 2)
759
+ return 0;
760
+ if (BITS_IN_JSAMPLE != 8)
761
+ return 0;
762
+ if (sizeof(JDIMENSION) != 4)
763
+ return 0;
764
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
765
+ return 0;
766
+
767
+ if (simd_support & JSIMD_MMI)
768
+ return 1;
769
+
770
+ return 0;
771
+ }
772
+
773
+ GLOBAL(int)
774
+ jsimd_can_idct_ifast(void)
775
+ {
776
+ init_simd();
777
+
778
+ /* The code is optimised for these values only */
779
+ if (DCTSIZE != 8)
780
+ return 0;
781
+ if (sizeof(JCOEF) != 2)
782
+ return 0;
783
+ if (BITS_IN_JSAMPLE != 8)
784
+ return 0;
785
+ if (sizeof(JDIMENSION) != 4)
786
+ return 0;
787
+ if (sizeof(IFAST_MULT_TYPE) != 2)
788
+ return 0;
789
+ if (IFAST_SCALE_BITS != 2)
790
+ return 0;
791
+
792
+ if (simd_support & JSIMD_MMI)
793
+ return 1;
794
+
795
+ return 0;
796
+ }
797
+
798
+ GLOBAL(int)
799
+ jsimd_can_idct_float(void)
800
+ {
801
+ return 0;
802
+ }
803
+
804
+ GLOBAL(void)
805
+ jsimd_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
806
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
807
+ JDIMENSION output_col)
808
+ {
809
+ jsimd_idct_islow_mmi(compptr->dct_table, coef_block, output_buf, output_col);
810
+ }
811
+
812
+ GLOBAL(void)
813
+ jsimd_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
814
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
815
+ JDIMENSION output_col)
816
+ {
817
+ jsimd_idct_ifast_mmi(compptr->dct_table, coef_block, output_buf, output_col);
818
+ }
819
+
820
+ GLOBAL(void)
821
+ jsimd_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
822
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
823
+ JDIMENSION output_col)
824
+ {
825
+ }
826
+
827
+ GLOBAL(int)
828
+ jsimd_can_huff_encode_one_block(void)
829
+ {
830
+ return 0;
831
+ }
832
+
833
+ GLOBAL(JOCTET *)
834
+ jsimd_huff_encode_one_block(void *state, JOCTET *buffer, JCOEFPTR block,
835
+ int last_dc_val, c_derived_tbl *dctbl,
836
+ c_derived_tbl *actbl)
837
+ {
838
+ return NULL;
839
+ }
840
+
841
+ GLOBAL(int)
842
+ jsimd_can_encode_mcu_AC_first_prepare(void)
843
+ {
844
+ return 0;
845
+ }
846
+
847
+ GLOBAL(void)
848
+ jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
849
+ const int *jpeg_natural_order_start, int Sl,
850
+ int Al, UJCOEF *values, size_t *zerobits)
851
+ {
852
+ }
853
+
854
+ GLOBAL(int)
855
+ jsimd_can_encode_mcu_AC_refine_prepare(void)
856
+ {
857
+ return 0;
858
+ }
859
+
860
+ GLOBAL(int)
861
+ jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
862
+ const int *jpeg_natural_order_start, int Sl,
863
+ int Al, UJCOEF *absvalues, size_t *bits)
864
+ {
865
+ return 0;
866
+ }