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,902 @@
1
+ *******************************************************************************
2
+ ** Building on Un*x Platforms (including Cygwin and OS X)
3
+ *******************************************************************************
4
+
5
+
6
+ ==================
7
+ Build Requirements
8
+ ==================
9
+
10
+ -- pkg-config
11
+ -- autoconf 2.56 or later
12
+ -- automake 1.7 or later
13
+ -- libtool 1.4 or later
14
+ * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer
15
+ provided. The easiest way to obtain them is from MacPorts
16
+ (http://www.macports.org/).
17
+
18
+ -- NASM or YASM (if building x86 or x86-64 SIMD extensions)
19
+ * NASM 0.98, or 2.01 or later is required for an x86 build (0.99 and 2.00 do
20
+ not work properly with libjpeg-turbo's x86 SIMD code.)
21
+ * NASM 2.00 or later is required for an x86-64 build.
22
+ * NASM 2.07, or 2.11.09 or later is required for an x86-64 Mac build
23
+ (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD code when
24
+ building macho64 objects.) NASM or YASM can be obtained from MacPorts
25
+ (http://www.macports.org/).
26
+
27
+ The binary RPMs released by the NASM project do not work on older Linux
28
+ systems, such as Red Hat Enterprise Linux 4. On such systems, you can
29
+ easily build and install NASM from a source RPM by downloading one of the
30
+ SRPMs from
31
+
32
+ http://www.nasm.us/pub/nasm/releasebuilds
33
+
34
+ and executing the following as root:
35
+
36
+ ARCH=`uname -m`
37
+ rpmbuild --rebuild nasm-{version}.src.rpm
38
+ rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
39
+
40
+ NOTE: the NASM build will fail if texinfo is not installed.
41
+
42
+ -- GCC v4.1 or later recommended for best performance
43
+ * Beginning with Xcode 4, Apple stopped distributing GCC and switched to
44
+ the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end
45
+ called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor
46
+ the LLVM (clang) compiler produces optimal performance with libjpeg-turbo.
47
+ Building mozjpeg with LLVM-GCC v4.2 results in a 10% performance
48
+ degradation when compressing using 64-bit code, relative to building
49
+ libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang)
50
+ results in a 20% performance degradation when compressing using 64-bit
51
+ code, relative to building libjpeg-turbo with GCC v4.2. If you are
52
+ running Snow Leopard or earlier, it is suggested that you continue to use
53
+ Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it
54
+ is suggested that you install Apple GCC v4.2 or GCC v5 through MacPorts.
55
+
56
+ -- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
57
+ required. Some systems, such as Solaris 10 and later and Red Hat Enterprise
58
+ Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will
59
+ be necessary to install the Java Developer Package, which can be downloaded
60
+ from http://developer.apple.com/downloads (Apple ID required.) For systems
61
+ that do not have a JDK installed, you can obtain the Oracle Java Development
62
+ Kit from http://www.java.com.
63
+
64
+
65
+ ==================
66
+ Out-of-Tree Builds
67
+ ==================
68
+
69
+ Binary objects, libraries, and executables are generated in the same directory
70
+ from which configure was executed (the "binary directory"), and this directory
71
+ need not necessarily be the same as the mozjpeg source directory. You
72
+ can create multiple independent binary directories, in which different versions
73
+ of mozjpeg can be built from the same source tree using different
74
+ compilers or settings. In the sections below, {build_directory} refers to the
75
+ binary directory, whereas {source_directory} refers to the mozjpeg source
76
+ directory. For in-tree builds, these directories are the same.
77
+
78
+
79
+ ================
80
+ Building mozjpeg
81
+ ================
82
+
83
+ The following procedure will build mozjpeg on Linux, FreeBSD, Cygwin, and
84
+ Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
85
+ for 64-bit build instructions.)
86
+
87
+ Simple Release tar.gz Source Build
88
+ ----------------------------------
89
+
90
+ cd {source_directory}
91
+ ./configure [additional configure flags]
92
+ make
93
+
94
+ Non-Release Source Build (e.g. GitHub clone)
95
+ --------------------------------------------
96
+
97
+ cd {source_directory}
98
+ autoreconf -fiv
99
+ cd {build_directory}
100
+ sh {source_directory}/configure [additional configure flags]
101
+ make
102
+
103
+ NOTE: Running autoreconf in the source directory is not necessary if building
104
+ mozjpeg from one of the official release tarballs.
105
+
106
+ This will generate the following files under .libs/
107
+
108
+ libjpeg.a
109
+ Static link library for the libjpeg API
110
+
111
+ libjpeg.so.{version} (Linux, Unix)
112
+ libjpeg.{version}.dylib (OS X)
113
+ cygjpeg-{version}.dll (Cygwin)
114
+ Shared library for the libjpeg API
115
+
116
+ By default, {version} is 62.2.0, 7.2.0, or 8.1.2, depending on whether
117
+ libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
118
+ {version} is 62, 7, or 8.
119
+
120
+ libjpeg.so (Linux, Unix)
121
+ libjpeg.dylib (OS X)
122
+ Development symlink for the libjpeg API
123
+
124
+ libjpeg.dll.a (Cygwin)
125
+ Import library for the libjpeg API
126
+
127
+ libturbojpeg.a
128
+ Static link library for the TurboJPEG API
129
+
130
+ libturbojpeg.so.0.1.0 (Linux, Unix)
131
+ libturbojpeg.0.1.0.dylib (OS X)
132
+ cygturbojpeg-0.dll (Cygwin)
133
+ Shared library for the TurboJPEG API
134
+
135
+ libturbojpeg.so (Linux, Unix)
136
+ libturbojpeg.dylib (OS X)
137
+ Development symlink for the TurboJPEG API
138
+
139
+ libturbojpeg.dll.a (Cygwin)
140
+ Import library for the TurboJPEG API
141
+
142
+
143
+ libjpeg v7 or v8 API/ABI Emulation
144
+ ----------------------------------
145
+
146
+ Add --with-jpeg7 to the configure command line to build a version of
147
+ mozjpeg that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
148
+ the configure command to build a version of mozjpeg that is
149
+ API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
150
+ on libjpeg v7 and v8 emulation.
151
+
152
+
153
+ In-Memory Source/Destination Managers
154
+ -------------------------------------
155
+
156
+ When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the
157
+ configure command line to build a version of mozjpeg that lacks the
158
+ jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
159
+ the original libjpeg v6b and v7 APIs, so removing them ensures strict
160
+ conformance with those APIs. See README-turbo.txt for more information.
161
+
162
+
163
+ Arithmetic Coding Support
164
+ -------------------------
165
+
166
+ Since the patent on arithmetic coding has expired, this functionality has been
167
+ included in this release of mozjpeg. mozjpeg's implementation is
168
+ based on the implementation in libjpeg v8, but it works when emulating libjpeg
169
+ v7 or v6b as well. The default is to enable both arithmetic encoding and
170
+ decoding, but those who have philosophical objections to arithmetic coding can
171
+ add --without-arith-enc or --without-arith-dec to the configure command line to
172
+ disable encoding or decoding (respectively.)
173
+
174
+
175
+ TurboJPEG Java Wrapper
176
+ ----------------------
177
+ Add --with-java to the configure command line to incorporate an optional Java
178
+ Native Interface wrapper into the TurboJPEG shared library and build the Java
179
+ front-end classes to support it. This allows the TurboJPEG shared library to
180
+ be used directly from Java applications. See java/README for more details.
181
+
182
+ You can set the JAVAC, JAR, and JAVA configure variables to specify
183
+ alternate commands for javac, jar, and java (respectively.) You can also
184
+ set the JAVACFLAGS configure variable to specify arguments that should be
185
+ passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
186
+ to specify arguments that should be passed to the C compiler when building the
187
+ JNI wrapper. Run 'configure --help' for more details.
188
+
189
+
190
+ ==================
191
+ Installing mozjpeg
192
+ ==================
193
+
194
+ If you intend to install these libraries and the associated header files, then
195
+ replace 'make' in the instructions above with
196
+
197
+ make install prefix={base dir} libdir={library directory}
198
+
199
+ For example,
200
+
201
+ make install prefix=/usr/local libdir=/usr/local/lib64
202
+
203
+ will install the header files in /usr/local/include and the library files in
204
+ /usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
205
+ is to install the header files in /opt/mozjpeg/include and the library
206
+ files in /opt/mozjpeg/lib32 (32-bit) or /opt/mozjpeg/lib64
207
+ (64-bit.)
208
+
209
+ NOTE: You can specify a prefix of /usr and a libdir of, for instance,
210
+ /usr/lib64 to overwrite the system's version of libjpeg. If you do this,
211
+ however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
212
+ overwriting it. It is recommended that you instead install mozjpeg into
213
+ a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
214
+ to force applications to use mozjpeg instead of libjpeg. See
215
+ README-turbo.txt for more information.
216
+
217
+
218
+ =============
219
+ Build Recipes
220
+ =============
221
+
222
+
223
+ 32-bit Build on 64-bit Linux
224
+ ----------------------------
225
+
226
+ Add
227
+
228
+ --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
229
+
230
+ to the configure command line.
231
+
232
+
233
+ 64-bit Build on 64-bit OS X
234
+ ---------------------------
235
+
236
+ Add
237
+
238
+ --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
239
+
240
+ to the configure command line. NASM 2.07 or later from MacPorts must be
241
+ installed.
242
+
243
+
244
+ 32-bit Build on 64-bit OS X
245
+ ---------------------------
246
+
247
+ Add
248
+
249
+ --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
250
+
251
+ to the configure command line.
252
+
253
+
254
+ 64-bit Backward-Compatible Build on 64-bit OS X
255
+ -----------------------------------------------
256
+
257
+ Add
258
+
259
+ --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
260
+ CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
261
+ -mmacosx-version-min=10.5 -O3' \
262
+ LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
263
+ -mmacosx-version-min=10.5'
264
+
265
+ to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
266
+ MacPorts, must be installed.
267
+
268
+
269
+ 32-bit Backward-Compatible Build on OS X
270
+ ----------------------------------------
271
+
272
+ Add
273
+
274
+ --host i686-apple-darwin \
275
+ CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
276
+ -mmacosx-version-min=10.5 -O3 -m32' \
277
+ LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
278
+ -mmacosx-version-min=10.5 -m32'
279
+
280
+ to the configure command line. The OS X 10.5 SDK must be installed.
281
+
282
+
283
+ 64-bit Library Build on 64-bit Solaris
284
+ --------------------------------------
285
+
286
+ Add
287
+
288
+ --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
289
+
290
+ to the configure command line.
291
+
292
+
293
+ 32-bit Build on 64-bit FreeBSD
294
+ ------------------------------
295
+
296
+ Add
297
+
298
+ --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
299
+ LDFLAGS='-B/usr/lib32'
300
+
301
+ to the configure command line. NASM 2.07 or later from FreeBSD ports must be
302
+ installed.
303
+
304
+
305
+ Oracle Solaris Studio
306
+ ---------------------
307
+
308
+ Add
309
+
310
+ CC=cc
311
+
312
+ to the configure command line. mozjpeg will automatically be built with
313
+ the maximum optimization level (-xO5) unless you override CFLAGS.
314
+
315
+ To build a 64-bit version of mozjpeg using Oracle Solaris Studio, add
316
+
317
+ --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
318
+
319
+ to the configure command line.
320
+
321
+
322
+ MinGW Build on Cygwin
323
+ ---------------------
324
+
325
+ Use CMake (see recipes below)
326
+
327
+
328
+ ===========
329
+ ARM Support
330
+ ===========
331
+
332
+ This release of mozjpeg can use ARM NEON SIMD instructions to accelerate
333
+ JPEG compression/decompression by approximately 2-4x on ARMv7 and later
334
+ platforms. If mozjpeg is configured on an ARM Linux platform, then the
335
+ build system will automatically include the NEON SIMD routines, if they are
336
+ supported. Build instructions for other ARM-based platforms follow.
337
+
338
+
339
+ Building mozjpeg for iOS
340
+ ------------------------
341
+
342
+ iOS platforms, such as the iPhone and iPad, use ARM processors, some of which
343
+ support NEON instructions. Additional steps are required in order to build
344
+ mozjpeg for these platforms.
345
+
346
+ Additional build requirements:
347
+
348
+ gas-preprocessor.pl
349
+ (https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl)
350
+ should be installed in your PATH.
351
+
352
+
353
+ ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC):
354
+
355
+ Set the following shell variables for simplicity:
356
+
357
+ Xcode 4.2 and earlier:
358
+ IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
359
+ Xcode 4.3 and later:
360
+ IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
361
+
362
+ IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
363
+ IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
364
+
365
+ ARMv6 (code will run on all iOS devices, not SIMD-accelerated):
366
+ [NOTE: Requires Xcode 4.4.x or earlier]
367
+ IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
368
+
369
+ ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
370
+ IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
371
+
372
+ ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer):
373
+ [NOTE: Requires Xcode 4.5 or later]
374
+ IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
375
+
376
+ Follow the procedure under "Building mozjpeg" above, adding
377
+
378
+ --host arm-apple-darwin10 \
379
+ CC="$IOS_GCC" LD="$IOS_GCC" \
380
+ CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
381
+ LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
382
+
383
+ to the configure command line.
384
+
385
+
386
+ ARM 32-bit Build (Xcode 5.0.x and later, Clang):
387
+
388
+ Set the following shell variables for simplicity:
389
+
390
+ IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
391
+ IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
392
+ IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
393
+
394
+ ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
395
+ IOS_CFLAGS="-arch armv7"
396
+
397
+ ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer):
398
+ IOS_CFLAGS="-arch armv7s"
399
+
400
+ Follow the procedure under "Building libjpeg-turbo" above, adding
401
+
402
+ --host arm-apple-darwin10 \
403
+ CC="$IOS_GCC" LD="$IOS_GCC" \
404
+ CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
405
+ LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" \
406
+ CCASFLAGS="-no-integrated-as $IOS_CFLAGS"
407
+
408
+ to the configure command line.
409
+
410
+
411
+ ARMv8 64-bit Build (Xcode 5.0.x and later, Clang):
412
+
413
+ Code will run on iPhone 5S/iPad Mini 2/iPad Air and newer.
414
+
415
+ Set the following shell variables for simplicity:
416
+
417
+ IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
418
+ IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
419
+ IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
420
+ IOS_CFLAGS="-arch arm64"
421
+
422
+ Follow the procedure under "Building libjpeg-turbo" above, adding
423
+
424
+ --host aarch64-apple-darwin \
425
+ CC="$IOS_GCC" LD="$IOS_GCC" \
426
+ CFLAGS="-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
427
+ LDFLAGS="-isysroot $IOS_SYSROOT $IOS_CFLAGS"
428
+
429
+ to the configure command line.
430
+
431
+
432
+ NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above
433
+ in order to support older versions of iOS than the default version supported by
434
+ the SDK.
435
+
436
+ Once built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants
437
+ into a universal library.
438
+
439
+
440
+ Building libjpeg-turbo for Android
441
+ ----------------------------------
442
+
443
+ Building libjpeg-turbo for Android platforms requires the Android NDK
444
+ (https://developer.android.com/tools/sdk/ndk) and autotools. The following is
445
+ a general recipe script that can be modified for your specific needs.
446
+
447
+ # Set these variables to suit your needs
448
+ NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk}
449
+ BUILD_PLATFORM={the platform name for the NDK package you installed--
450
+ for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
451
+ TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
452
+ toolchain directory under ${NDK_PATH}/toolchains/.}
453
+ ANDROID_VERSION={The minimum version of Android to support-- for example,
454
+ "16", "19", etc. "21" or later is required for a 64-bit build.}
455
+
456
+ # 32-bit ARMv7 build
457
+ HOST=arm-linux-androideabi
458
+ SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
459
+ ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
460
+ --sysroot=${SYSROOT}"
461
+
462
+ # 64-bit ARMv8 build
463
+ HOST=aarch64-linux-android
464
+ SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64
465
+ ANDROID_CFLAGS="--sysroot=${SYSROOT}"
466
+
467
+ TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
468
+ ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include"
469
+ export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
470
+ export AR=${TOOLCHAIN}/bin/${HOST}-ar
471
+ export AS=${TOOLCHAIN}/bin/${HOST}-as
472
+ export NM=${TOOLCHAIN}/bin/${HOST}-nm
473
+ export CC=${TOOLCHAIN}/bin/${HOST}-gcc
474
+ export LD=${TOOLCHAIN}/bin/${HOST}-ld
475
+ export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
476
+ export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
477
+ export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
478
+ cd {build_directory}
479
+ sh {source_directory}/configure --host=${HOST} \
480
+ CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3 -fPIE" \
481
+ CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \
482
+ LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
483
+ make
484
+
485
+ If building for Android 4.0.x (API level < 16) or earlier, remove -fPIE from
486
+ CFLAGS and -pie from LDFLAGS.
487
+
488
+
489
+ *******************************************************************************
490
+ ** Building on Windows (Visual C++ or MinGW)
491
+ *******************************************************************************
492
+
493
+
494
+ ==================
495
+ Build Requirements
496
+ ==================
497
+
498
+ -- CMake (http://www.cmake.org) v2.8.8 or later
499
+
500
+ -- Microsoft Visual C++ 2005 or later
501
+
502
+ If you don't already have Visual C++, then the easiest way to get it is by
503
+ installing the Windows SDK:
504
+
505
+ http://msdn.microsoft.com/en-us/windows/bb980924.aspx
506
+
507
+ The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
508
+ everything necessary to build mozjpeg.
509
+
510
+ * You can also use Microsoft Visual Studio Express Edition, which is a free
511
+ download. (NOTE: versions prior to 2012 can only be used to build 32-bit
512
+ code.)
513
+ * If you intend to build mozjpeg from the command line, then add the
514
+ appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
515
+ environment variables. This is generally accomplished by executing
516
+ vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
517
+ vcvars64.bat are part of Visual C++ and are located in the same directory
518
+ as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
519
+ optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
520
+ environment.
521
+
522
+ ... OR ...
523
+
524
+ -- MinGW
525
+
526
+ MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or
527
+ tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows
528
+ machine. Both distributions install a Start Menu link that can be used to
529
+ launch a command prompt with the appropriate compiler paths automatically
530
+ set.
531
+
532
+ -- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
533
+ a 64-bit build)
534
+
535
+ -- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
536
+ can be downloaded from http://www.java.com.
537
+
538
+
539
+ ==================
540
+ Out-of-Tree Builds
541
+ ==================
542
+
543
+ Binary objects, libraries, and executables are generated in the same directory
544
+ from which cmake was executed (the "binary directory"), and this directory need
545
+ not necessarily be the same as the mozjpeg source directory. You can
546
+ create multiple independent binary directories, in which different versions of
547
+ mozjpeg can be built from the same source tree using different compilers
548
+ or settings. In the sections below, {build_directory} refers to the binary
549
+ directory, whereas {source_directory} refers to the mozjpeg source
550
+ directory. For in-tree builds, these directories are the same.
551
+
552
+
553
+ ================
554
+ Building mozjpeg
555
+ ================
556
+
557
+
558
+ Visual C++ (Command Line)
559
+ -------------------------
560
+
561
+ cd {build_directory}
562
+ cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
563
+ nmake
564
+
565
+ This will build either a 32-bit or a 64-bit version of mozjpeg, depending
566
+ on which version of cl.exe is in the PATH.
567
+
568
+ The following files will be generated under {build_directory}:
569
+
570
+ jpeg-static.lib
571
+ Static link library for the libjpeg API
572
+ sharedlib/jpeg{version}.dll
573
+ DLL for the libjpeg API
574
+ sharedlib/jpeg.lib
575
+ Import library for the libjpeg API
576
+ turbojpeg-static.lib
577
+ Static link library for the TurboJPEG API
578
+ turbojpeg.dll
579
+ DLL for the TurboJPEG API
580
+ turbojpeg.lib
581
+ Import library for the TurboJPEG API
582
+
583
+ {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
584
+ v8 emulation is enabled.
585
+
586
+
587
+ Visual C++ (IDE)
588
+ ----------------
589
+
590
+ Choose the appropriate CMake generator option for your version of Visual Studio
591
+ (run "cmake" with no arguments for a list of available generators.) For
592
+ instance:
593
+
594
+ cd {build_directory}
595
+ cmake -G "Visual Studio 10" {source_directory}
596
+
597
+ NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10
598
+ Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake
599
+ no longer document that. A separate build directory must be used for 32-bit
600
+ and 64-bit builds.
601
+
602
+ You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
603
+ configurations in that project ("Debug", "Release", etc.) to generate a full
604
+ build of mozjpeg.
605
+
606
+ This will generate the following files under {build_directory}:
607
+
608
+ {configuration}/jpeg-static.lib
609
+ Static link library for the libjpeg API
610
+ sharedlib/{configuration}/jpeg{version}.dll
611
+ DLL for the libjpeg API
612
+ sharedlib/{configuration}/jpeg.lib
613
+ Import library for the libjpeg API
614
+ {configuration}/turbojpeg-static.lib
615
+ Static link library for the TurboJPEG API
616
+ {configuration}/turbojpeg.dll
617
+ DLL for the TurboJPEG API
618
+ {configuration}/turbojpeg.lib
619
+ Import library for the TurboJPEG API
620
+
621
+ {configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
622
+ the configuration you built in the IDE, and {version} is 62, 7, or 8,
623
+ depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
624
+
625
+
626
+ MinGW
627
+ -----
628
+
629
+ NOTE: This assumes that you are building on a Windows machine. If you are
630
+ cross-compiling on a Linux/Unix machine, then see "Build Recipes" below.
631
+
632
+ cd {build_directory}
633
+ cmake -G "MinGW Makefiles" {source_directory}
634
+ mingw32-make
635
+
636
+ This will generate the following files under {build_directory}
637
+
638
+ libjpeg.a
639
+ Static link library for the libjpeg API
640
+ sharedlib/libjpeg-{version}.dll
641
+ DLL for the libjpeg API
642
+ sharedlib/libjpeg.dll.a
643
+ Import library for the libjpeg API
644
+ libturbojpeg.a
645
+ Static link library for the TurboJPEG API
646
+ libturbojpeg.dll
647
+ DLL for the TurboJPEG API
648
+ libturbojpeg.dll.a
649
+ Import library for the TurboJPEG API
650
+
651
+ {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
652
+ v8 emulation is enabled.
653
+
654
+
655
+ Debug Build
656
+ -----------
657
+
658
+ Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
659
+ NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
660
+ NMake.)
661
+
662
+
663
+ libjpeg v7 or v8 API/ABI Emulation
664
+ -----------------------------------
665
+
666
+ Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
667
+ mozjpeg that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
668
+ to the cmake command to build a version of mozjpeg that is
669
+ API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
670
+ on libjpeg v7 and v8 emulation.
671
+
672
+
673
+ In-Memory Source/Destination Managers
674
+ -------------------------------------
675
+
676
+ When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
677
+ CMake command line to build a version of mozjpeg that lacks the
678
+ jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
679
+ the original libjpeg v6b and v7 APIs, so removing them ensures strict
680
+ conformance with those APIs. See README-turbo.txt for more information.
681
+
682
+
683
+ Arithmetic Coding Support
684
+ -------------------------
685
+
686
+ Since the patent on arithmetic coding has expired, this functionality has been
687
+ included in this release of mozjpeg. mozjpeg's implementation is
688
+ based on the implementation in libjpeg v8, but it works when emulating libjpeg
689
+ v7 or v6b as well. The default is to enable both arithmetic encoding and
690
+ decoding, but those who have philosophical objections to arithmetic coding can
691
+ add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
692
+ disable encoding or decoding (respectively.)
693
+
694
+
695
+ TurboJPEG Java Wrapper
696
+ ----------------------
697
+ Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
698
+ Native Interface wrapper into the TurboJPEG shared library and build the Java
699
+ front-end classes to support it. This allows the TurboJPEG shared library to
700
+ be used directly from Java applications. See java/README for more details.
701
+
702
+ If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
703
+ Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
704
+ alternate commands or locations for javac, jar, and java (respectively.) If
705
+ you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
706
+ instead. You can also set the JAVACFLAGS CMake variable to specify arguments
707
+ that should be passed to the Java compiler when building the front-end classes.
708
+
709
+
710
+ ==================
711
+ Installing mozjpeg
712
+ ==================
713
+
714
+ You can use the build system to install mozjpeg into a directory of your
715
+ choosing (as opposed to creating an installer.) To do this, add:
716
+
717
+ -DCMAKE_INSTALL_PREFIX={install_directory}
718
+
719
+ to the cmake command line.
720
+
721
+ For example,
722
+
723
+ cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
724
+ -DCMAKE_INSTALL_PREFIX=c:\mozjpeg {source_directory}
725
+ nmake install
726
+
727
+ will install the header files in c:\mozjpeg\include, the library files
728
+ in c:\mozjpeg\lib, the DLL's in c:\mozjpeg\bin, and the
729
+ documentation in c:\mozjpeg\doc.
730
+
731
+
732
+ =============
733
+ Build Recipes
734
+ =============
735
+
736
+
737
+ 64-bit MinGW Build on Cygwin
738
+ ----------------------------
739
+
740
+ cd {build_directory}
741
+ CC=/usr/bin/x86_64-w64-mingw32-gcc \
742
+ cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
743
+ -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \
744
+ {source_directory}
745
+ make
746
+
747
+ This produces a 64-bit build of mozjpeg that does not depend on
748
+ cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
749
+ mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
750
+
751
+
752
+ 32-bit MinGW Build on Cygwin
753
+ ----------------------------
754
+
755
+ cd {build_directory}
756
+ CC=/usr/bin/i686-w64-mingw32-gcc \
757
+ cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
758
+ -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \
759
+ {source_directory}
760
+ make
761
+
762
+ This produces a 32-bit build of mozjpeg that does not depend on
763
+ cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
764
+ mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
765
+
766
+
767
+ MinGW Build on Linux
768
+ --------------------
769
+
770
+ cd {build_directory}
771
+ CC={mingw_binary_path}/i386-mingw32-gcc \
772
+ cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
773
+ -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
774
+ -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
775
+ {source_directory}
776
+ make
777
+
778
+
779
+ *******************************************************************************
780
+ ** Creating Release Packages
781
+ *******************************************************************************
782
+
783
+ The following commands can be used to create various types of release packages:
784
+
785
+
786
+ Unix/Linux
787
+ ----------
788
+
789
+ make rpm
790
+
791
+ Create Red Hat-style binary RPM package. Requires RPM v4 or later.
792
+
793
+ make srpm
794
+
795
+ This runs 'make dist' to create a pristine source tarball, then creates a
796
+ Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
797
+
798
+ make deb
799
+
800
+ Create Debian-style binary package. Requires dpkg.
801
+
802
+ make dmg
803
+
804
+ Create Macintosh package/disk image. This requires pkgbuild and
805
+ productbuild, which are installed by default on OS X 10.7 and later and which
806
+ can be obtained by installing Xcode 3.2.6 (with the "Unix Development"
807
+ option) on OS X 10.6. Packages built in this manner can be installed on OS X
808
+ 10.5 and later, but they must be built on OS X 10.6 or later.
809
+
810
+ make udmg [BUILDDIR32={32-bit build directory}]
811
+
812
+ On 64-bit OS X systems, this creates a Macintosh package and disk image that
813
+ contains universal i386/x86-64 binaries. You should first configure a 32-bit
814
+ out-of-tree build of mozjpeg, then configure a 64-bit out-of-tree
815
+ build, then run 'make udmg' from the 64-bit build directory. The build
816
+ system will look for the 32-bit build under {source_directory}/osxx86 by
817
+ default, but you can override this by setting the BUILDDIR32 variable on the
818
+ make command line as shown above.
819
+
820
+ make iosdmg [BUILDDIR32={32-bit build directory}] \
821
+ [BUILDDIRARMV6={ARMv6 build directory}] \
822
+ [BUILDDIRARMV7={ARMv7 build directory}] \
823
+ [BUILDDIRARMV7S={ARMv7s build directory}] \
824
+ [BUILDDIRARMV8={ARMv8 build directory}]
825
+
826
+ On OS X systems, this creates a Macintosh package and disk image in which the
827
+ mozjpeg static libraries contain ARM architectures necessary to build
828
+ iOS applications. If building on an x86-64 system, the binaries will also
829
+ contain the i386 architecture, as with 'make udmg' above. You should first
830
+ configure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of
831
+ mozjpeg (see "Building mozjpeg for iOS" above.) If you are
832
+ building an x86-64 version of mozjpeg, you should configure a 32-bit
833
+ out-of-tree build as well. Next, build mozjpeg as you would normally,
834
+ using an out-of-tree build. When it is built, run 'make iosdmg' from the
835
+ build directory. The build system will look for the ARMv6 build under
836
+ {source_directory}/iosarmv6 by default, the ARMv7 build under
837
+ {source_directory}/iosarmv7 by default, the ARMv7s build under
838
+ {source_directory}/iosarmv7s by default, the ARMv8 build under
839
+ {source_directory}/iosarmv8 by default, and (if applicable) the 32-bit build
840
+ under {source_directory}/osxx86 by default, but you can override this by
841
+ setting the BUILDDIR32, BUILDDIRARMV6, BUILDDIRARMV7, BUILDDIRARMV7S, and/or
842
+ BUILDDIRARMV8 variables on the make command line as shown above.
843
+
844
+ NOTE: If including an ARMv8 build in the package, then you may need to use
845
+ Xcode's version of lipo instead of the operating system's. To do this, pass
846
+ an argument of LIPO="xcrun lipo" on the make command line.
847
+
848
+ make cygwinpkg
849
+
850
+ Build a Cygwin binary package.
851
+
852
+
853
+ Windows
854
+ -------
855
+
856
+ If using NMake:
857
+
858
+ cd {build_directory}
859
+ nmake installer
860
+
861
+ If using MinGW:
862
+
863
+ cd {build_directory}
864
+ make installer
865
+
866
+ If using the Visual Studio IDE, build the "installer" project.
867
+
868
+ The installer package (mozjpeg[-gcc][64].exe) will be located under
869
+ {build_directory}. If building using the Visual Studio IDE, then the installer
870
+ package will be located in a subdirectory with the same name as the
871
+ configuration you built (such as {build_directory}\Debug\ or
872
+ {build_directory}\Release\).
873
+
874
+ Building a Windows installer requires the Nullsoft Install System
875
+ (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
876
+
877
+
878
+ *******************************************************************************
879
+ ** Regression testing
880
+ *******************************************************************************
881
+
882
+ The most common way to test mozjpeg is by invoking 'make test' on
883
+ Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
884
+ completed. This runs a series of tests to ensure that mathematical
885
+ compatibility has been maintained. This also invokes the TurboJPEG unit tests,
886
+ which ensure that the colorspace extensions, YUV encoding, decompression
887
+ scaling, and other features of the TurboJPEG C and Java APIs are working
888
+ properly (and, by extension, that the equivalent features of the underlying
889
+ libjpeg API are also working.)
890
+
891
+ Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
892
+ the 'testclean' target (if using the Visual Studio IDE) will clean up the
893
+ output images generated by 'make test'.
894
+
895
+ On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java
896
+ wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
897
+ essentially iterate through all of the available features of the TurboJPEG APIs
898
+ that are not covered by the TurboJPEG unit tests (this includes the lossless
899
+ transform options) and compare the images generated by each feature to images
900
+ generated using the equivalent feature in the libjpeg API. The extended
901
+ TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
902
+ not in the underlying libjpeg API library.