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