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,976 @@
1
+ /*
2
+ * jsimd_arm.c
3
+ *
4
+ * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5
+ * Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
6
+ * Copyright (C) 2009-2011, 2013-2014, 2016, 2018, 2022, D. R. Commander.
7
+ * Copyright (C) 2015-2016, 2018, 2022, Matthieu Darbois.
8
+ * Copyright (C) 2019, Google LLC.
9
+ * Copyright (C) 2020, Arm Limited.
10
+ *
11
+ * Based on the x86 SIMD extension for IJG JPEG library,
12
+ * Copyright (C) 1999-2006, MIYASAKA Masaru.
13
+ * For conditions of distribution and use, see copyright notice in jsimdext.inc
14
+ *
15
+ * This file contains the interface between the "normal" portions
16
+ * of the library and the SIMD implementations when running on a
17
+ * 32-bit Arm architecture.
18
+ */
19
+
20
+ #define JPEG_INTERNALS
21
+ #include "../../../jinclude.h"
22
+ #include "../../../jpeglib.h"
23
+ #include "../../../jsimd.h"
24
+ #include "../../../jdct.h"
25
+ #include "../../../jsimddct.h"
26
+ #include "../../jsimd.h"
27
+
28
+ #include <ctype.h>
29
+
30
+ static THREAD_LOCAL unsigned int simd_support = ~0;
31
+ static THREAD_LOCAL unsigned int simd_huffman = 1;
32
+
33
+ #if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
34
+
35
+ #define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
36
+
37
+ LOCAL(int)
38
+ check_feature(char *buffer, char *feature)
39
+ {
40
+ char *p;
41
+
42
+ if (*feature == 0)
43
+ return 0;
44
+ if (strncmp(buffer, "Features", 8) != 0)
45
+ return 0;
46
+ buffer += 8;
47
+ while (isspace(*buffer))
48
+ buffer++;
49
+
50
+ /* Check if 'feature' is present in the buffer as a separate word */
51
+ while ((p = strstr(buffer, feature))) {
52
+ if (p > buffer && !isspace(*(p - 1))) {
53
+ buffer++;
54
+ continue;
55
+ }
56
+ p += strlen(feature);
57
+ if (*p != 0 && !isspace(*p)) {
58
+ buffer++;
59
+ continue;
60
+ }
61
+ return 1;
62
+ }
63
+ return 0;
64
+ }
65
+
66
+ LOCAL(int)
67
+ parse_proc_cpuinfo(int bufsize)
68
+ {
69
+ char *buffer = (char *)malloc(bufsize);
70
+ FILE *fd;
71
+
72
+ simd_support = 0;
73
+
74
+ if (!buffer)
75
+ return 0;
76
+
77
+ fd = fopen("/proc/cpuinfo", "r");
78
+ if (fd) {
79
+ while (fgets(buffer, bufsize, fd)) {
80
+ if (!strchr(buffer, '\n') && !feof(fd)) {
81
+ /* "impossible" happened - insufficient size of the buffer! */
82
+ fclose(fd);
83
+ free(buffer);
84
+ return 0;
85
+ }
86
+ if (check_feature(buffer, "neon"))
87
+ simd_support |= JSIMD_NEON;
88
+ }
89
+ fclose(fd);
90
+ }
91
+ free(buffer);
92
+ return 1;
93
+ }
94
+
95
+ #endif
96
+
97
+ /*
98
+ * Check what SIMD accelerations are supported.
99
+ */
100
+ LOCAL(void)
101
+ init_simd(void)
102
+ {
103
+ #ifndef NO_GETENV
104
+ char env[2] = { 0 };
105
+ #endif
106
+ #if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
107
+ int bufsize = 1024; /* an initial guess for the line buffer size limit */
108
+ #endif
109
+
110
+ if (simd_support != ~0U)
111
+ return;
112
+
113
+ simd_support = 0;
114
+
115
+ #if defined(__ARM_NEON__)
116
+ simd_support |= JSIMD_NEON;
117
+ #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
118
+ /* We still have a chance to use Neon regardless of globally used
119
+ * -mcpu/-mfpu options passed to gcc by performing runtime detection via
120
+ * /proc/cpuinfo parsing on linux/android */
121
+ while (!parse_proc_cpuinfo(bufsize)) {
122
+ bufsize *= 2;
123
+ if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
124
+ break;
125
+ }
126
+ #endif
127
+
128
+ #ifndef NO_GETENV
129
+ /* Force different settings through environment variables */
130
+ if (!GETENV_S(env, 2, "JSIMD_FORCENEON") && !strcmp(env, "1"))
131
+ simd_support = JSIMD_NEON;
132
+ if (!GETENV_S(env, 2, "JSIMD_FORCENONE") && !strcmp(env, "1"))
133
+ simd_support = 0;
134
+ if (!GETENV_S(env, 2, "JSIMD_NOHUFFENC") && !strcmp(env, "1"))
135
+ simd_huffman = 0;
136
+ #endif
137
+ }
138
+
139
+ GLOBAL(int)
140
+ jsimd_can_rgb_ycc(void)
141
+ {
142
+ init_simd();
143
+
144
+ /* The code is optimised for these values only */
145
+ if (BITS_IN_JSAMPLE != 8)
146
+ return 0;
147
+ if (sizeof(JDIMENSION) != 4)
148
+ return 0;
149
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
150
+ return 0;
151
+
152
+ if (simd_support & JSIMD_NEON)
153
+ return 1;
154
+
155
+ return 0;
156
+ }
157
+
158
+ GLOBAL(int)
159
+ jsimd_can_rgb_gray(void)
160
+ {
161
+ init_simd();
162
+
163
+ /* The code is optimised for these values only */
164
+ if (BITS_IN_JSAMPLE != 8)
165
+ return 0;
166
+ if (sizeof(JDIMENSION) != 4)
167
+ return 0;
168
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
169
+ return 0;
170
+
171
+ if (simd_support & JSIMD_NEON)
172
+ return 1;
173
+
174
+ return 0;
175
+ }
176
+
177
+ GLOBAL(int)
178
+ jsimd_can_ycc_rgb(void)
179
+ {
180
+ init_simd();
181
+
182
+ /* The code is optimised for these values only */
183
+ if (BITS_IN_JSAMPLE != 8)
184
+ return 0;
185
+ if (sizeof(JDIMENSION) != 4)
186
+ return 0;
187
+ if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
188
+ return 0;
189
+
190
+ if (simd_support & JSIMD_NEON)
191
+ return 1;
192
+
193
+ return 0;
194
+ }
195
+
196
+ GLOBAL(int)
197
+ jsimd_can_ycc_rgb565(void)
198
+ {
199
+ init_simd();
200
+
201
+ /* The code is optimised for these values only */
202
+ if (BITS_IN_JSAMPLE != 8)
203
+ return 0;
204
+ if (sizeof(JDIMENSION) != 4)
205
+ return 0;
206
+
207
+ if (simd_support & JSIMD_NEON)
208
+ return 1;
209
+
210
+ return 0;
211
+ }
212
+
213
+ GLOBAL(void)
214
+ jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
215
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
216
+ int num_rows)
217
+ {
218
+ void (*neonfct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
219
+
220
+ switch (cinfo->in_color_space) {
221
+ case JCS_EXT_RGB:
222
+ neonfct = jsimd_extrgb_ycc_convert_neon;
223
+ break;
224
+ case JCS_EXT_RGBX:
225
+ case JCS_EXT_RGBA:
226
+ neonfct = jsimd_extrgbx_ycc_convert_neon;
227
+ break;
228
+ case JCS_EXT_BGR:
229
+ neonfct = jsimd_extbgr_ycc_convert_neon;
230
+ break;
231
+ case JCS_EXT_BGRX:
232
+ case JCS_EXT_BGRA:
233
+ neonfct = jsimd_extbgrx_ycc_convert_neon;
234
+ break;
235
+ case JCS_EXT_XBGR:
236
+ case JCS_EXT_ABGR:
237
+ neonfct = jsimd_extxbgr_ycc_convert_neon;
238
+ break;
239
+ case JCS_EXT_XRGB:
240
+ case JCS_EXT_ARGB:
241
+ neonfct = jsimd_extxrgb_ycc_convert_neon;
242
+ break;
243
+ default:
244
+ neonfct = jsimd_extrgb_ycc_convert_neon;
245
+ break;
246
+ }
247
+
248
+ neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
249
+ }
250
+
251
+ GLOBAL(void)
252
+ jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
253
+ JSAMPIMAGE output_buf, JDIMENSION output_row,
254
+ int num_rows)
255
+ {
256
+ void (*neonfct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
257
+
258
+ switch (cinfo->in_color_space) {
259
+ case JCS_EXT_RGB:
260
+ neonfct = jsimd_extrgb_gray_convert_neon;
261
+ break;
262
+ case JCS_EXT_RGBX:
263
+ case JCS_EXT_RGBA:
264
+ neonfct = jsimd_extrgbx_gray_convert_neon;
265
+ break;
266
+ case JCS_EXT_BGR:
267
+ neonfct = jsimd_extbgr_gray_convert_neon;
268
+ break;
269
+ case JCS_EXT_BGRX:
270
+ case JCS_EXT_BGRA:
271
+ neonfct = jsimd_extbgrx_gray_convert_neon;
272
+ break;
273
+ case JCS_EXT_XBGR:
274
+ case JCS_EXT_ABGR:
275
+ neonfct = jsimd_extxbgr_gray_convert_neon;
276
+ break;
277
+ case JCS_EXT_XRGB:
278
+ case JCS_EXT_ARGB:
279
+ neonfct = jsimd_extxrgb_gray_convert_neon;
280
+ break;
281
+ default:
282
+ neonfct = jsimd_extrgb_gray_convert_neon;
283
+ break;
284
+ }
285
+
286
+ neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
287
+ }
288
+
289
+ GLOBAL(void)
290
+ jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
291
+ JDIMENSION input_row, JSAMPARRAY output_buf,
292
+ int num_rows)
293
+ {
294
+ void (*neonfct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
295
+
296
+ switch (cinfo->out_color_space) {
297
+ case JCS_EXT_RGB:
298
+ neonfct = jsimd_ycc_extrgb_convert_neon;
299
+ break;
300
+ case JCS_EXT_RGBX:
301
+ case JCS_EXT_RGBA:
302
+ neonfct = jsimd_ycc_extrgbx_convert_neon;
303
+ break;
304
+ case JCS_EXT_BGR:
305
+ neonfct = jsimd_ycc_extbgr_convert_neon;
306
+ break;
307
+ case JCS_EXT_BGRX:
308
+ case JCS_EXT_BGRA:
309
+ neonfct = jsimd_ycc_extbgrx_convert_neon;
310
+ break;
311
+ case JCS_EXT_XBGR:
312
+ case JCS_EXT_ABGR:
313
+ neonfct = jsimd_ycc_extxbgr_convert_neon;
314
+ break;
315
+ case JCS_EXT_XRGB:
316
+ case JCS_EXT_ARGB:
317
+ neonfct = jsimd_ycc_extxrgb_convert_neon;
318
+ break;
319
+ default:
320
+ neonfct = jsimd_ycc_extrgb_convert_neon;
321
+ break;
322
+ }
323
+
324
+ neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
325
+ }
326
+
327
+ GLOBAL(void)
328
+ jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
329
+ JDIMENSION input_row, JSAMPARRAY output_buf,
330
+ int num_rows)
331
+ {
332
+ jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,
333
+ output_buf, num_rows);
334
+ }
335
+
336
+ GLOBAL(int)
337
+ jsimd_can_h2v2_downsample(void)
338
+ {
339
+ init_simd();
340
+
341
+ /* The code is optimised for these values only */
342
+ if (BITS_IN_JSAMPLE != 8)
343
+ return 0;
344
+ if (DCTSIZE != 8)
345
+ return 0;
346
+ if (sizeof(JDIMENSION) != 4)
347
+ return 0;
348
+
349
+ if (simd_support & JSIMD_NEON)
350
+ return 1;
351
+
352
+ return 0;
353
+ }
354
+
355
+ GLOBAL(int)
356
+ jsimd_can_h2v1_downsample(void)
357
+ {
358
+ init_simd();
359
+
360
+ /* The code is optimised for these values only */
361
+ if (BITS_IN_JSAMPLE != 8)
362
+ return 0;
363
+ if (DCTSIZE != 8)
364
+ return 0;
365
+ if (sizeof(JDIMENSION) != 4)
366
+ return 0;
367
+
368
+ if (simd_support & JSIMD_NEON)
369
+ return 1;
370
+
371
+ return 0;
372
+ }
373
+
374
+ GLOBAL(void)
375
+ jsimd_h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
376
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
377
+ {
378
+ jsimd_h2v2_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor,
379
+ compptr->v_samp_factor, compptr->width_in_blocks,
380
+ input_data, output_data);
381
+ }
382
+
383
+ GLOBAL(void)
384
+ jsimd_h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
385
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
386
+ {
387
+ jsimd_h2v1_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor,
388
+ compptr->v_samp_factor, compptr->width_in_blocks,
389
+ input_data, output_data);
390
+ }
391
+
392
+ GLOBAL(int)
393
+ jsimd_can_h2v2_upsample(void)
394
+ {
395
+ init_simd();
396
+
397
+ /* The code is optimised for these values only */
398
+ if (BITS_IN_JSAMPLE != 8)
399
+ return 0;
400
+ if (sizeof(JDIMENSION) != 4)
401
+ return 0;
402
+
403
+ if (simd_support & JSIMD_NEON)
404
+ return 1;
405
+
406
+ return 0;
407
+ }
408
+
409
+ GLOBAL(int)
410
+ jsimd_can_h2v1_upsample(void)
411
+ {
412
+ init_simd();
413
+
414
+ /* The code is optimised for these values only */
415
+ if (BITS_IN_JSAMPLE != 8)
416
+ return 0;
417
+ if (sizeof(JDIMENSION) != 4)
418
+ return 0;
419
+ if (simd_support & JSIMD_NEON)
420
+ return 1;
421
+
422
+ return 0;
423
+ }
424
+
425
+ GLOBAL(void)
426
+ jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
427
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
428
+ {
429
+ jsimd_h2v2_upsample_neon(cinfo->max_v_samp_factor, cinfo->output_width,
430
+ input_data, output_data_ptr);
431
+ }
432
+
433
+ GLOBAL(void)
434
+ jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
435
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
436
+ {
437
+ jsimd_h2v1_upsample_neon(cinfo->max_v_samp_factor, cinfo->output_width,
438
+ input_data, output_data_ptr);
439
+ }
440
+
441
+ GLOBAL(int)
442
+ jsimd_can_h2v2_fancy_upsample(void)
443
+ {
444
+ init_simd();
445
+
446
+ /* The code is optimised for these values only */
447
+ if (BITS_IN_JSAMPLE != 8)
448
+ return 0;
449
+ if (sizeof(JDIMENSION) != 4)
450
+ return 0;
451
+
452
+ if (simd_support & JSIMD_NEON)
453
+ return 1;
454
+
455
+ return 0;
456
+ }
457
+
458
+ GLOBAL(int)
459
+ jsimd_can_h2v1_fancy_upsample(void)
460
+ {
461
+ init_simd();
462
+
463
+ /* The code is optimised for these values only */
464
+ if (BITS_IN_JSAMPLE != 8)
465
+ return 0;
466
+ if (sizeof(JDIMENSION) != 4)
467
+ return 0;
468
+
469
+ if (simd_support & JSIMD_NEON)
470
+ return 1;
471
+
472
+ return 0;
473
+ }
474
+
475
+ GLOBAL(int)
476
+ jsimd_can_h1v2_fancy_upsample(void)
477
+ {
478
+ init_simd();
479
+
480
+ /* The code is optimised for these values only */
481
+ if (BITS_IN_JSAMPLE != 8)
482
+ return 0;
483
+ if (sizeof(JDIMENSION) != 4)
484
+ return 0;
485
+
486
+ if (simd_support & JSIMD_NEON)
487
+ return 1;
488
+
489
+ return 0;
490
+ }
491
+
492
+ GLOBAL(void)
493
+ jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
494
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
495
+ {
496
+ jsimd_h2v2_fancy_upsample_neon(cinfo->max_v_samp_factor,
497
+ compptr->downsampled_width, input_data,
498
+ output_data_ptr);
499
+ }
500
+
501
+ GLOBAL(void)
502
+ jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
503
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
504
+ {
505
+ jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor,
506
+ compptr->downsampled_width, input_data,
507
+ output_data_ptr);
508
+ }
509
+
510
+ GLOBAL(void)
511
+ jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
512
+ JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
513
+ {
514
+ jsimd_h1v2_fancy_upsample_neon(cinfo->max_v_samp_factor,
515
+ compptr->downsampled_width, input_data,
516
+ output_data_ptr);
517
+ }
518
+
519
+ GLOBAL(int)
520
+ jsimd_can_h2v2_merged_upsample(void)
521
+ {
522
+ init_simd();
523
+
524
+ /* The code is optimised for these values only */
525
+ if (BITS_IN_JSAMPLE != 8)
526
+ return 0;
527
+ if (sizeof(JDIMENSION) != 4)
528
+ return 0;
529
+
530
+ if (simd_support & JSIMD_NEON)
531
+ return 1;
532
+
533
+ return 0;
534
+ }
535
+
536
+ GLOBAL(int)
537
+ jsimd_can_h2v1_merged_upsample(void)
538
+ {
539
+ init_simd();
540
+
541
+ /* The code is optimised for these values only */
542
+ if (BITS_IN_JSAMPLE != 8)
543
+ return 0;
544
+ if (sizeof(JDIMENSION) != 4)
545
+ return 0;
546
+
547
+ if (simd_support & JSIMD_NEON)
548
+ return 1;
549
+
550
+ return 0;
551
+ }
552
+
553
+ GLOBAL(void)
554
+ jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
555
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
556
+ {
557
+ void (*neonfct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
558
+
559
+ switch (cinfo->out_color_space) {
560
+ case JCS_EXT_RGB:
561
+ neonfct = jsimd_h2v2_extrgb_merged_upsample_neon;
562
+ break;
563
+ case JCS_EXT_RGBX:
564
+ case JCS_EXT_RGBA:
565
+ neonfct = jsimd_h2v2_extrgbx_merged_upsample_neon;
566
+ break;
567
+ case JCS_EXT_BGR:
568
+ neonfct = jsimd_h2v2_extbgr_merged_upsample_neon;
569
+ break;
570
+ case JCS_EXT_BGRX:
571
+ case JCS_EXT_BGRA:
572
+ neonfct = jsimd_h2v2_extbgrx_merged_upsample_neon;
573
+ break;
574
+ case JCS_EXT_XBGR:
575
+ case JCS_EXT_ABGR:
576
+ neonfct = jsimd_h2v2_extxbgr_merged_upsample_neon;
577
+ break;
578
+ case JCS_EXT_XRGB:
579
+ case JCS_EXT_ARGB:
580
+ neonfct = jsimd_h2v2_extxrgb_merged_upsample_neon;
581
+ break;
582
+ default:
583
+ neonfct = jsimd_h2v2_extrgb_merged_upsample_neon;
584
+ break;
585
+ }
586
+
587
+ neonfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
588
+ }
589
+
590
+ GLOBAL(void)
591
+ jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
592
+ JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
593
+ {
594
+ void (*neonfct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
595
+
596
+ switch (cinfo->out_color_space) {
597
+ case JCS_EXT_RGB:
598
+ neonfct = jsimd_h2v1_extrgb_merged_upsample_neon;
599
+ break;
600
+ case JCS_EXT_RGBX:
601
+ case JCS_EXT_RGBA:
602
+ neonfct = jsimd_h2v1_extrgbx_merged_upsample_neon;
603
+ break;
604
+ case JCS_EXT_BGR:
605
+ neonfct = jsimd_h2v1_extbgr_merged_upsample_neon;
606
+ break;
607
+ case JCS_EXT_BGRX:
608
+ case JCS_EXT_BGRA:
609
+ neonfct = jsimd_h2v1_extbgrx_merged_upsample_neon;
610
+ break;
611
+ case JCS_EXT_XBGR:
612
+ case JCS_EXT_ABGR:
613
+ neonfct = jsimd_h2v1_extxbgr_merged_upsample_neon;
614
+ break;
615
+ case JCS_EXT_XRGB:
616
+ case JCS_EXT_ARGB:
617
+ neonfct = jsimd_h2v1_extxrgb_merged_upsample_neon;
618
+ break;
619
+ default:
620
+ neonfct = jsimd_h2v1_extrgb_merged_upsample_neon;
621
+ break;
622
+ }
623
+
624
+ neonfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
625
+ }
626
+
627
+ GLOBAL(int)
628
+ jsimd_can_convsamp(void)
629
+ {
630
+ init_simd();
631
+
632
+ /* The code is optimised for these values only */
633
+ if (DCTSIZE != 8)
634
+ return 0;
635
+ if (BITS_IN_JSAMPLE != 8)
636
+ return 0;
637
+ if (sizeof(JDIMENSION) != 4)
638
+ return 0;
639
+ if (sizeof(DCTELEM) != 2)
640
+ return 0;
641
+
642
+ if (simd_support & JSIMD_NEON)
643
+ return 1;
644
+
645
+ return 0;
646
+ }
647
+
648
+ GLOBAL(int)
649
+ jsimd_can_convsamp_float(void)
650
+ {
651
+ return 0;
652
+ }
653
+
654
+ GLOBAL(void)
655
+ jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
656
+ DCTELEM *workspace)
657
+ {
658
+ jsimd_convsamp_neon(sample_data, start_col, workspace);
659
+ }
660
+
661
+ GLOBAL(void)
662
+ jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
663
+ FAST_FLOAT *workspace)
664
+ {
665
+ }
666
+
667
+ GLOBAL(int)
668
+ jsimd_can_fdct_islow(void)
669
+ {
670
+ init_simd();
671
+
672
+ /* The code is optimised for these values only */
673
+ if (DCTSIZE != 8)
674
+ return 0;
675
+ if (sizeof(DCTELEM) != 2)
676
+ return 0;
677
+
678
+ if (simd_support & JSIMD_NEON)
679
+ return 1;
680
+
681
+ return 0;
682
+ }
683
+
684
+ GLOBAL(int)
685
+ jsimd_can_fdct_ifast(void)
686
+ {
687
+ init_simd();
688
+
689
+ /* The code is optimised for these values only */
690
+ if (DCTSIZE != 8)
691
+ return 0;
692
+ if (sizeof(DCTELEM) != 2)
693
+ return 0;
694
+
695
+ if (simd_support & JSIMD_NEON)
696
+ return 1;
697
+
698
+ return 0;
699
+ }
700
+
701
+ GLOBAL(int)
702
+ jsimd_can_fdct_float(void)
703
+ {
704
+ return 0;
705
+ }
706
+
707
+ GLOBAL(void)
708
+ jsimd_fdct_islow(DCTELEM *data)
709
+ {
710
+ jsimd_fdct_islow_neon(data);
711
+ }
712
+
713
+ GLOBAL(void)
714
+ jsimd_fdct_ifast(DCTELEM *data)
715
+ {
716
+ jsimd_fdct_ifast_neon(data);
717
+ }
718
+
719
+ GLOBAL(void)
720
+ jsimd_fdct_float(FAST_FLOAT *data)
721
+ {
722
+ }
723
+
724
+ GLOBAL(int)
725
+ jsimd_can_quantize(void)
726
+ {
727
+ init_simd();
728
+
729
+ /* The code is optimised for these values only */
730
+ if (DCTSIZE != 8)
731
+ return 0;
732
+ if (sizeof(JCOEF) != 2)
733
+ return 0;
734
+ if (sizeof(DCTELEM) != 2)
735
+ return 0;
736
+
737
+ if (simd_support & JSIMD_NEON)
738
+ return 1;
739
+
740
+ return 0;
741
+ }
742
+
743
+ GLOBAL(int)
744
+ jsimd_can_quantize_float(void)
745
+ {
746
+ return 0;
747
+ }
748
+
749
+ GLOBAL(void)
750
+ jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
751
+ {
752
+ jsimd_quantize_neon(coef_block, divisors, workspace);
753
+ }
754
+
755
+ GLOBAL(void)
756
+ jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
757
+ FAST_FLOAT *workspace)
758
+ {
759
+ }
760
+
761
+ GLOBAL(int)
762
+ jsimd_can_idct_2x2(void)
763
+ {
764
+ init_simd();
765
+
766
+ /* The code is optimised for these values only */
767
+ if (DCTSIZE != 8)
768
+ return 0;
769
+ if (sizeof(JCOEF) != 2)
770
+ return 0;
771
+ if (BITS_IN_JSAMPLE != 8)
772
+ return 0;
773
+ if (sizeof(JDIMENSION) != 4)
774
+ return 0;
775
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
776
+ return 0;
777
+
778
+ if (simd_support & JSIMD_NEON)
779
+ return 1;
780
+
781
+ return 0;
782
+ }
783
+
784
+ GLOBAL(int)
785
+ jsimd_can_idct_4x4(void)
786
+ {
787
+ init_simd();
788
+
789
+ /* The code is optimised for these values only */
790
+ if (DCTSIZE != 8)
791
+ return 0;
792
+ if (sizeof(JCOEF) != 2)
793
+ return 0;
794
+ if (BITS_IN_JSAMPLE != 8)
795
+ return 0;
796
+ if (sizeof(JDIMENSION) != 4)
797
+ return 0;
798
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
799
+ return 0;
800
+
801
+ if (simd_support & JSIMD_NEON)
802
+ return 1;
803
+
804
+ return 0;
805
+ }
806
+
807
+ GLOBAL(void)
808
+ jsimd_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
809
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
810
+ JDIMENSION output_col)
811
+ {
812
+ jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, output_col);
813
+ }
814
+
815
+ GLOBAL(void)
816
+ jsimd_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
817
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
818
+ JDIMENSION output_col)
819
+ {
820
+ jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, output_col);
821
+ }
822
+
823
+ GLOBAL(int)
824
+ jsimd_can_idct_islow(void)
825
+ {
826
+ init_simd();
827
+
828
+ /* The code is optimised for these values only */
829
+ if (DCTSIZE != 8)
830
+ return 0;
831
+ if (sizeof(JCOEF) != 2)
832
+ return 0;
833
+ if (BITS_IN_JSAMPLE != 8)
834
+ return 0;
835
+ if (sizeof(JDIMENSION) != 4)
836
+ return 0;
837
+ if (sizeof(ISLOW_MULT_TYPE) != 2)
838
+ return 0;
839
+
840
+ if (simd_support & JSIMD_NEON)
841
+ return 1;
842
+
843
+ return 0;
844
+ }
845
+
846
+ GLOBAL(int)
847
+ jsimd_can_idct_ifast(void)
848
+ {
849
+ init_simd();
850
+
851
+ /* The code is optimised for these values only */
852
+ if (DCTSIZE != 8)
853
+ return 0;
854
+ if (sizeof(JCOEF) != 2)
855
+ return 0;
856
+ if (BITS_IN_JSAMPLE != 8)
857
+ return 0;
858
+ if (sizeof(JDIMENSION) != 4)
859
+ return 0;
860
+ if (sizeof(IFAST_MULT_TYPE) != 2)
861
+ return 0;
862
+ if (IFAST_SCALE_BITS != 2)
863
+ return 0;
864
+
865
+ if (simd_support & JSIMD_NEON)
866
+ return 1;
867
+
868
+ return 0;
869
+ }
870
+
871
+ GLOBAL(int)
872
+ jsimd_can_idct_float(void)
873
+ {
874
+ return 0;
875
+ }
876
+
877
+ GLOBAL(void)
878
+ jsimd_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
879
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
880
+ JDIMENSION output_col)
881
+ {
882
+ jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf,
883
+ output_col);
884
+ }
885
+
886
+ GLOBAL(void)
887
+ jsimd_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
888
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
889
+ JDIMENSION output_col)
890
+ {
891
+ jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf,
892
+ output_col);
893
+ }
894
+
895
+ GLOBAL(void)
896
+ jsimd_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
897
+ JCOEFPTR coef_block, JSAMPARRAY output_buf,
898
+ JDIMENSION output_col)
899
+ {
900
+ }
901
+
902
+ GLOBAL(int)
903
+ jsimd_can_huff_encode_one_block(void)
904
+ {
905
+ init_simd();
906
+
907
+ if (DCTSIZE != 8)
908
+ return 0;
909
+ if (sizeof(JCOEF) != 2)
910
+ return 0;
911
+
912
+ if (simd_support & JSIMD_NEON && simd_huffman)
913
+ return 1;
914
+
915
+ return 0;
916
+ }
917
+
918
+ GLOBAL(JOCTET *)
919
+ jsimd_huff_encode_one_block(void *state, JOCTET *buffer, JCOEFPTR block,
920
+ int last_dc_val, c_derived_tbl *dctbl,
921
+ c_derived_tbl *actbl)
922
+ {
923
+ return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val,
924
+ dctbl, actbl);
925
+ }
926
+
927
+ GLOBAL(int)
928
+ jsimd_can_encode_mcu_AC_first_prepare(void)
929
+ {
930
+ init_simd();
931
+
932
+ if (DCTSIZE != 8)
933
+ return 0;
934
+ if (sizeof(JCOEF) != 2)
935
+ return 0;
936
+
937
+ if (simd_support & JSIMD_NEON)
938
+ return 1;
939
+
940
+ return 0;
941
+ }
942
+
943
+ GLOBAL(void)
944
+ jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
945
+ const int *jpeg_natural_order_start, int Sl,
946
+ int Al, UJCOEF *values, size_t *zerobits)
947
+ {
948
+ jsimd_encode_mcu_AC_first_prepare_neon(block, jpeg_natural_order_start,
949
+ Sl, Al, values, zerobits);
950
+ }
951
+
952
+ GLOBAL(int)
953
+ jsimd_can_encode_mcu_AC_refine_prepare(void)
954
+ {
955
+ init_simd();
956
+
957
+ if (DCTSIZE != 8)
958
+ return 0;
959
+ if (sizeof(JCOEF) != 2)
960
+ return 0;
961
+
962
+ if (simd_support & JSIMD_NEON)
963
+ return 1;
964
+
965
+ return 0;
966
+ }
967
+
968
+ GLOBAL(int)
969
+ jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
970
+ const int *jpeg_natural_order_start, int Sl,
971
+ int Al, UJCOEF *absvalues, size_t *bits)
972
+ {
973
+ return jsimd_encode_mcu_AC_refine_prepare_neon(block,
974
+ jpeg_natural_order_start, Sl,
975
+ Al, absvalues, bits);
976
+ }