rfreeimage 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (860) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +1 -0
  4. data/Rakefile +34 -0
  5. data/ext/rfreeimage/extconf.rb +35 -0
  6. data/ext/rfreeimage/rfi_main.c +389 -0
  7. data/lib/rfreeimage/image.rb +26 -0
  8. data/lib/rfreeimage/version.rb +3 -0
  9. data/lib/rfreeimage.rb +3 -0
  10. data/rfreeimage.gemspec +32 -0
  11. data/vendor/FreeImage/Makefile +34 -0
  12. data/vendor/FreeImage/Makefile.cygwin +74 -0
  13. data/vendor/FreeImage/Makefile.fip +84 -0
  14. data/vendor/FreeImage/Makefile.gnu +83 -0
  15. data/vendor/FreeImage/Makefile.iphone +96 -0
  16. data/vendor/FreeImage/Makefile.mingw +136 -0
  17. data/vendor/FreeImage/Makefile.osx +115 -0
  18. data/vendor/FreeImage/Makefile.solaris +66 -0
  19. data/vendor/FreeImage/Makefile.srcs +6 -0
  20. data/vendor/FreeImage/README.iphone +19 -0
  21. data/vendor/FreeImage/README.linux +50 -0
  22. data/vendor/FreeImage/README.minGW +236 -0
  23. data/vendor/FreeImage/README.osx +44 -0
  24. data/vendor/FreeImage/README.solaris +67 -0
  25. data/vendor/FreeImage/Source/CacheFile.h +92 -0
  26. data/vendor/FreeImage/Source/DeprecationManager/Deprecated.cpp +36 -0
  27. data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.cpp +103 -0
  28. data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.h +83 -0
  29. data/vendor/FreeImage/Source/FreeImage/BitmapAccess.cpp +1573 -0
  30. data/vendor/FreeImage/Source/FreeImage/CacheFile.cpp +271 -0
  31. data/vendor/FreeImage/Source/FreeImage/ColorLookup.cpp +785 -0
  32. data/vendor/FreeImage/Source/FreeImage/Conversion.cpp +551 -0
  33. data/vendor/FreeImage/Source/FreeImage/Conversion16_555.cpp +209 -0
  34. data/vendor/FreeImage/Source/FreeImage/Conversion16_565.cpp +204 -0
  35. data/vendor/FreeImage/Source/FreeImage/Conversion24.cpp +252 -0
  36. data/vendor/FreeImage/Source/FreeImage/Conversion32.cpp +345 -0
  37. data/vendor/FreeImage/Source/FreeImage/Conversion4.cpp +246 -0
  38. data/vendor/FreeImage/Source/FreeImage/Conversion8.cpp +305 -0
  39. data/vendor/FreeImage/Source/FreeImage/ConversionFloat.cpp +194 -0
  40. data/vendor/FreeImage/Source/FreeImage/ConversionRGB16.cpp +144 -0
  41. data/vendor/FreeImage/Source/FreeImage/ConversionRGBA16.cpp +147 -0
  42. data/vendor/FreeImage/Source/FreeImage/ConversionRGBAF.cpp +250 -0
  43. data/vendor/FreeImage/Source/FreeImage/ConversionRGBF.cpp +243 -0
  44. data/vendor/FreeImage/Source/FreeImage/ConversionType.cpp +699 -0
  45. data/vendor/FreeImage/Source/FreeImage/ConversionUINT16.cpp +134 -0
  46. data/vendor/FreeImage/Source/FreeImage/FreeImage.cpp +226 -0
  47. data/vendor/FreeImage/Source/FreeImage/FreeImageC.c +22 -0
  48. data/vendor/FreeImage/Source/FreeImage/FreeImageIO.cpp +175 -0
  49. data/vendor/FreeImage/Source/FreeImage/GetType.cpp +92 -0
  50. data/vendor/FreeImage/Source/FreeImage/Halftoning.cpp +474 -0
  51. data/vendor/FreeImage/Source/FreeImage/J2KHelper.cpp +591 -0
  52. data/vendor/FreeImage/Source/FreeImage/J2KHelper.h +36 -0
  53. data/vendor/FreeImage/Source/FreeImage/LFPQuantizer.cpp +208 -0
  54. data/vendor/FreeImage/Source/FreeImage/MNGHelper.cpp +1320 -0
  55. data/vendor/FreeImage/Source/FreeImage/MemoryIO.cpp +237 -0
  56. data/vendor/FreeImage/Source/FreeImage/MultiPage.cpp +974 -0
  57. data/vendor/FreeImage/Source/FreeImage/NNQuantizer.cpp +507 -0
  58. data/vendor/FreeImage/Source/FreeImage/PSDParser.cpp +1057 -0
  59. data/vendor/FreeImage/Source/FreeImage/PSDParser.h +271 -0
  60. data/vendor/FreeImage/Source/FreeImage/PixelAccess.cpp +197 -0
  61. data/vendor/FreeImage/Source/FreeImage/Plugin.cpp +822 -0
  62. data/vendor/FreeImage/Source/FreeImage/PluginBMP.cpp +1494 -0
  63. data/vendor/FreeImage/Source/FreeImage/PluginCUT.cpp +240 -0
  64. data/vendor/FreeImage/Source/FreeImage/PluginDDS.cpp +655 -0
  65. data/vendor/FreeImage/Source/FreeImage/PluginEXR.cpp +773 -0
  66. data/vendor/FreeImage/Source/FreeImage/PluginG3.cpp +433 -0
  67. data/vendor/FreeImage/Source/FreeImage/PluginGIF.cpp +1407 -0
  68. data/vendor/FreeImage/Source/FreeImage/PluginHDR.cpp +722 -0
  69. data/vendor/FreeImage/Source/FreeImage/PluginICO.cpp +824 -0
  70. data/vendor/FreeImage/Source/FreeImage/PluginIFF.cpp +459 -0
  71. data/vendor/FreeImage/Source/FreeImage/PluginJ2K.cpp +328 -0
  72. data/vendor/FreeImage/Source/FreeImage/PluginJNG.cpp +162 -0
  73. data/vendor/FreeImage/Source/FreeImage/PluginJP2.cpp +328 -0
  74. data/vendor/FreeImage/Source/FreeImage/PluginJPEG.cpp +1706 -0
  75. data/vendor/FreeImage/Source/FreeImage/PluginJXR.cpp +1475 -0
  76. data/vendor/FreeImage/Source/FreeImage/PluginKOALA.cpp +243 -0
  77. data/vendor/FreeImage/Source/FreeImage/PluginMNG.cpp +153 -0
  78. data/vendor/FreeImage/Source/FreeImage/PluginPCD.cpp +251 -0
  79. data/vendor/FreeImage/Source/FreeImage/PluginPCX.cpp +659 -0
  80. data/vendor/FreeImage/Source/FreeImage/PluginPFM.cpp +409 -0
  81. data/vendor/FreeImage/Source/FreeImage/PluginPICT.cpp +1343 -0
  82. data/vendor/FreeImage/Source/FreeImage/PluginPNG.cpp +1115 -0
  83. data/vendor/FreeImage/Source/FreeImage/PluginPNM.cpp +838 -0
  84. data/vendor/FreeImage/Source/FreeImage/PluginPSD.cpp +131 -0
  85. data/vendor/FreeImage/Source/FreeImage/PluginRAS.cpp +512 -0
  86. data/vendor/FreeImage/Source/FreeImage/PluginRAW.cpp +793 -0
  87. data/vendor/FreeImage/Source/FreeImage/PluginSGI.cpp +425 -0
  88. data/vendor/FreeImage/Source/FreeImage/PluginTARGA.cpp +1591 -0
  89. data/vendor/FreeImage/Source/FreeImage/PluginTIFF.cpp +2631 -0
  90. data/vendor/FreeImage/Source/FreeImage/PluginWBMP.cpp +372 -0
  91. data/vendor/FreeImage/Source/FreeImage/PluginWebP.cpp +698 -0
  92. data/vendor/FreeImage/Source/FreeImage/PluginXBM.cpp +399 -0
  93. data/vendor/FreeImage/Source/FreeImage/PluginXPM.cpp +487 -0
  94. data/vendor/FreeImage/Source/FreeImage/TIFFLogLuv.cpp +65 -0
  95. data/vendor/FreeImage/Source/FreeImage/ToneMapping.cpp +75 -0
  96. data/vendor/FreeImage/Source/FreeImage/WuQuantizer.cpp +559 -0
  97. data/vendor/FreeImage/Source/FreeImage/ZLibInterface.cpp +223 -0
  98. data/vendor/FreeImage/Source/FreeImage/tmoColorConvert.cpp +479 -0
  99. data/vendor/FreeImage/Source/FreeImage/tmoDrago03.cpp +295 -0
  100. data/vendor/FreeImage/Source/FreeImage/tmoFattal02.cpp +689 -0
  101. data/vendor/FreeImage/Source/FreeImage/tmoReinhard05.cpp +260 -0
  102. data/vendor/FreeImage/Source/FreeImage.h +1153 -0
  103. data/vendor/FreeImage/Source/FreeImageIO.h +63 -0
  104. data/vendor/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp +730 -0
  105. data/vendor/FreeImage/Source/FreeImageToolkit/Background.cpp +895 -0
  106. data/vendor/FreeImage/Source/FreeImageToolkit/Channels.cpp +488 -0
  107. data/vendor/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp +917 -0
  108. data/vendor/FreeImage/Source/FreeImageToolkit/Colors.cpp +967 -0
  109. data/vendor/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp +861 -0
  110. data/vendor/FreeImage/Source/FreeImageToolkit/Display.cpp +230 -0
  111. data/vendor/FreeImage/Source/FreeImageToolkit/Filters.h +287 -0
  112. data/vendor/FreeImage/Source/FreeImageToolkit/Flip.cpp +166 -0
  113. data/vendor/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp +623 -0
  114. data/vendor/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp +505 -0
  115. data/vendor/FreeImage/Source/FreeImageToolkit/Rescale.cpp +192 -0
  116. data/vendor/FreeImage/Source/FreeImageToolkit/Resize.cpp +2116 -0
  117. data/vendor/FreeImage/Source/FreeImageToolkit/Resize.h +196 -0
  118. data/vendor/FreeImage/Source/LibJPEG/ansi2knr.c +739 -0
  119. data/vendor/FreeImage/Source/LibJPEG/cderror.h +134 -0
  120. data/vendor/FreeImage/Source/LibJPEG/cdjpeg.c +181 -0
  121. data/vendor/FreeImage/Source/LibJPEG/cdjpeg.h +187 -0
  122. data/vendor/FreeImage/Source/LibJPEG/cjpeg.c +664 -0
  123. data/vendor/FreeImage/Source/LibJPEG/ckconfig.c +402 -0
  124. data/vendor/FreeImage/Source/LibJPEG/djpeg.c +617 -0
  125. data/vendor/FreeImage/Source/LibJPEG/example.c +433 -0
  126. data/vendor/FreeImage/Source/LibJPEG/jaricom.c +153 -0
  127. data/vendor/FreeImage/Source/LibJPEG/jcapimin.c +288 -0
  128. data/vendor/FreeImage/Source/LibJPEG/jcapistd.c +162 -0
  129. data/vendor/FreeImage/Source/LibJPEG/jcarith.c +944 -0
  130. data/vendor/FreeImage/Source/LibJPEG/jccoefct.c +454 -0
  131. data/vendor/FreeImage/Source/LibJPEG/jccolor.c +604 -0
  132. data/vendor/FreeImage/Source/LibJPEG/jcdctmgr.c +477 -0
  133. data/vendor/FreeImage/Source/LibJPEG/jchuff.c +1573 -0
  134. data/vendor/FreeImage/Source/LibJPEG/jcinit.c +84 -0
  135. data/vendor/FreeImage/Source/LibJPEG/jcmainct.c +297 -0
  136. data/vendor/FreeImage/Source/LibJPEG/jcmarker.c +719 -0
  137. data/vendor/FreeImage/Source/LibJPEG/jcmaster.c +856 -0
  138. data/vendor/FreeImage/Source/LibJPEG/jcomapi.c +106 -0
  139. data/vendor/FreeImage/Source/LibJPEG/jconfig.h +161 -0
  140. data/vendor/FreeImage/Source/LibJPEG/jcparam.c +675 -0
  141. data/vendor/FreeImage/Source/LibJPEG/jcprepct.c +358 -0
  142. data/vendor/FreeImage/Source/LibJPEG/jcsample.c +545 -0
  143. data/vendor/FreeImage/Source/LibJPEG/jctrans.c +385 -0
  144. data/vendor/FreeImage/Source/LibJPEG/jdapimin.c +399 -0
  145. data/vendor/FreeImage/Source/LibJPEG/jdapistd.c +276 -0
  146. data/vendor/FreeImage/Source/LibJPEG/jdarith.c +796 -0
  147. data/vendor/FreeImage/Source/LibJPEG/jdatadst.c +270 -0
  148. data/vendor/FreeImage/Source/LibJPEG/jdatasrc.c +275 -0
  149. data/vendor/FreeImage/Source/LibJPEG/jdcoefct.c +741 -0
  150. data/vendor/FreeImage/Source/LibJPEG/jdcolor.c +748 -0
  151. data/vendor/FreeImage/Source/LibJPEG/jdct.h +393 -0
  152. data/vendor/FreeImage/Source/LibJPEG/jddctmgr.c +384 -0
  153. data/vendor/FreeImage/Source/LibJPEG/jdhuff.c +1554 -0
  154. data/vendor/FreeImage/Source/LibJPEG/jdinput.c +662 -0
  155. data/vendor/FreeImage/Source/LibJPEG/jdmainct.c +513 -0
  156. data/vendor/FreeImage/Source/LibJPEG/jdmarker.c +1511 -0
  157. data/vendor/FreeImage/Source/LibJPEG/jdmaster.c +543 -0
  158. data/vendor/FreeImage/Source/LibJPEG/jdmerge.c +401 -0
  159. data/vendor/FreeImage/Source/LibJPEG/jdpostct.c +290 -0
  160. data/vendor/FreeImage/Source/LibJPEG/jdsample.c +361 -0
  161. data/vendor/FreeImage/Source/LibJPEG/jdtrans.c +140 -0
  162. data/vendor/FreeImage/Source/LibJPEG/jerror.c +253 -0
  163. data/vendor/FreeImage/Source/LibJPEG/jerror.h +304 -0
  164. data/vendor/FreeImage/Source/LibJPEG/jfdctflt.c +174 -0
  165. data/vendor/FreeImage/Source/LibJPEG/jfdctfst.c +230 -0
  166. data/vendor/FreeImage/Source/LibJPEG/jfdctint.c +4406 -0
  167. data/vendor/FreeImage/Source/LibJPEG/jidctflt.c +235 -0
  168. data/vendor/FreeImage/Source/LibJPEG/jidctfst.c +368 -0
  169. data/vendor/FreeImage/Source/LibJPEG/jidctint.c +5179 -0
  170. data/vendor/FreeImage/Source/LibJPEG/jinclude.h +91 -0
  171. data/vendor/FreeImage/Source/LibJPEG/jmemansi.c +167 -0
  172. data/vendor/FreeImage/Source/LibJPEG/jmemdos.c +638 -0
  173. data/vendor/FreeImage/Source/LibJPEG/jmemmac.c +289 -0
  174. data/vendor/FreeImage/Source/LibJPEG/jmemmgr.c +1119 -0
  175. data/vendor/FreeImage/Source/LibJPEG/jmemname.c +276 -0
  176. data/vendor/FreeImage/Source/LibJPEG/jmemnobs.c +109 -0
  177. data/vendor/FreeImage/Source/LibJPEG/jmemsys.h +198 -0
  178. data/vendor/FreeImage/Source/LibJPEG/jmorecfg.h +442 -0
  179. data/vendor/FreeImage/Source/LibJPEG/jpegint.h +426 -0
  180. data/vendor/FreeImage/Source/LibJPEG/jpeglib.h +1180 -0
  181. data/vendor/FreeImage/Source/LibJPEG/jpegtran.c +577 -0
  182. data/vendor/FreeImage/Source/LibJPEG/jquant1.c +857 -0
  183. data/vendor/FreeImage/Source/LibJPEG/jquant2.c +1311 -0
  184. data/vendor/FreeImage/Source/LibJPEG/jutils.c +227 -0
  185. data/vendor/FreeImage/Source/LibJPEG/jversion.h +14 -0
  186. data/vendor/FreeImage/Source/LibJPEG/rdbmp.c +480 -0
  187. data/vendor/FreeImage/Source/LibJPEG/rdcolmap.c +253 -0
  188. data/vendor/FreeImage/Source/LibJPEG/rdgif.c +38 -0
  189. data/vendor/FreeImage/Source/LibJPEG/rdjpgcom.c +515 -0
  190. data/vendor/FreeImage/Source/LibJPEG/rdppm.c +459 -0
  191. data/vendor/FreeImage/Source/LibJPEG/rdrle.c +387 -0
  192. data/vendor/FreeImage/Source/LibJPEG/rdswitch.c +365 -0
  193. data/vendor/FreeImage/Source/LibJPEG/rdtarga.c +500 -0
  194. data/vendor/FreeImage/Source/LibJPEG/transupp.c +1763 -0
  195. data/vendor/FreeImage/Source/LibJPEG/transupp.h +219 -0
  196. data/vendor/FreeImage/Source/LibJPEG/wrbmp.c +442 -0
  197. data/vendor/FreeImage/Source/LibJPEG/wrgif.c +399 -0
  198. data/vendor/FreeImage/Source/LibJPEG/wrjpgcom.c +583 -0
  199. data/vendor/FreeImage/Source/LibJPEG/wrppm.c +269 -0
  200. data/vendor/FreeImage/Source/LibJPEG/wrrle.c +305 -0
  201. data/vendor/FreeImage/Source/LibJPEG/wrtarga.c +253 -0
  202. data/vendor/FreeImage/Source/LibJXR/common/include/guiddef.h +230 -0
  203. data/vendor/FreeImage/Source/LibJXR/common/include/wmsal.h +757 -0
  204. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstring.h +342 -0
  205. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_adt.h +71 -0
  206. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_strict.h +1096 -0
  207. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_undef.h +406 -0
  208. data/vendor/FreeImage/Source/LibJXR/image/decode/JXRTranscode.c +987 -0
  209. data/vendor/FreeImage/Source/LibJXR/image/decode/decode.c +200 -0
  210. data/vendor/FreeImage/Source/LibJXR/image/decode/decode.h +143 -0
  211. data/vendor/FreeImage/Source/LibJXR/image/decode/postprocess.c +288 -0
  212. data/vendor/FreeImage/Source/LibJXR/image/decode/segdec.c +1205 -0
  213. data/vendor/FreeImage/Source/LibJXR/image/decode/strInvTransform.c +1888 -0
  214. data/vendor/FreeImage/Source/LibJXR/image/decode/strPredQuantDec.c +539 -0
  215. data/vendor/FreeImage/Source/LibJXR/image/decode/strdec.c +3628 -0
  216. data/vendor/FreeImage/Source/LibJXR/image/decode/strdec_x86.c +1640 -0
  217. data/vendor/FreeImage/Source/LibJXR/image/encode/encode.c +144 -0
  218. data/vendor/FreeImage/Source/LibJXR/image/encode/encode.h +113 -0
  219. data/vendor/FreeImage/Source/LibJXR/image/encode/segenc.c +1186 -0
  220. data/vendor/FreeImage/Source/LibJXR/image/encode/strFwdTransform.c +1111 -0
  221. data/vendor/FreeImage/Source/LibJXR/image/encode/strPredQuantEnc.c +511 -0
  222. data/vendor/FreeImage/Source/LibJXR/image/encode/strenc.c +2370 -0
  223. data/vendor/FreeImage/Source/LibJXR/image/encode/strenc_x86.c +409 -0
  224. data/vendor/FreeImage/Source/LibJXR/image/sys/adapthuff.c +511 -0
  225. data/vendor/FreeImage/Source/LibJXR/image/sys/ansi.h +61 -0
  226. data/vendor/FreeImage/Source/LibJXR/image/sys/common.h +131 -0
  227. data/vendor/FreeImage/Source/LibJXR/image/sys/image.c +183 -0
  228. data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimer.h +115 -0
  229. data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimerANSI.c +274 -0
  230. data/vendor/FreeImage/Source/LibJXR/image/sys/strPredQuant.c +306 -0
  231. data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.c +85 -0
  232. data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.h +50 -0
  233. data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.c +1251 -0
  234. data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.h +681 -0
  235. data/vendor/FreeImage/Source/LibJXR/image/sys/windowsmediaphoto.h +515 -0
  236. data/vendor/FreeImage/Source/LibJXR/image/sys/xplatform_image.h +84 -0
  237. data/vendor/FreeImage/Source/LibJXR/image/x86/x86.h +58 -0
  238. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.c +930 -0
  239. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.h +636 -0
  240. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlueJxr.c +2246 -0
  241. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGluePFC.c +2338 -0
  242. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.c +905 -0
  243. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.h +258 -0
  244. data/vendor/FreeImage/Source/LibOpenJPEG/bio.c +188 -0
  245. data/vendor/FreeImage/Source/LibOpenJPEG/bio.h +128 -0
  246. data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.c +239 -0
  247. data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.h +68 -0
  248. data/vendor/FreeImage/Source/LibOpenJPEG/cio.c +644 -0
  249. data/vendor/FreeImage/Source/LibOpenJPEG/cio.h +393 -0
  250. data/vendor/FreeImage/Source/LibOpenJPEG/dwt.c +919 -0
  251. data/vendor/FreeImage/Source/LibOpenJPEG/dwt.h +116 -0
  252. data/vendor/FreeImage/Source/LibOpenJPEG/event.c +141 -0
  253. data/vendor/FreeImage/Source/LibOpenJPEG/event.h +97 -0
  254. data/vendor/FreeImage/Source/LibOpenJPEG/function_list.c +114 -0
  255. data/vendor/FreeImage/Source/LibOpenJPEG/function_list.h +126 -0
  256. data/vendor/FreeImage/Source/LibOpenJPEG/image.c +235 -0
  257. data/vendor/FreeImage/Source/LibOpenJPEG/image.h +63 -0
  258. data/vendor/FreeImage/Source/LibOpenJPEG/indexbox_manager.h +148 -0
  259. data/vendor/FreeImage/Source/LibOpenJPEG/invert.c +289 -0
  260. data/vendor/FreeImage/Source/LibOpenJPEG/invert.h +59 -0
  261. data/vendor/FreeImage/Source/LibOpenJPEG/j2k.c +10238 -0
  262. data/vendor/FreeImage/Source/LibOpenJPEG/j2k.h +838 -0
  263. data/vendor/FreeImage/Source/LibOpenJPEG/jp2.c +2776 -0
  264. data/vendor/FreeImage/Source/LibOpenJPEG/jp2.h +490 -0
  265. data/vendor/FreeImage/Source/LibOpenJPEG/mct.c +319 -0
  266. data/vendor/FreeImage/Source/LibOpenJPEG/mct.h +149 -0
  267. data/vendor/FreeImage/Source/LibOpenJPEG/mqc.c +604 -0
  268. data/vendor/FreeImage/Source/LibOpenJPEG/mqc.h +201 -0
  269. data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.c +955 -0
  270. data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.h +1475 -0
  271. data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.c +59 -0
  272. data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.h +54 -0
  273. data/vendor/FreeImage/Source/LibOpenJPEG/opj_codec.h +160 -0
  274. data/vendor/FreeImage/Source/LibOpenJPEG/opj_config.h +9 -0
  275. data/vendor/FreeImage/Source/LibOpenJPEG/opj_config_private.h +16 -0
  276. data/vendor/FreeImage/Source/LibOpenJPEG/opj_includes.h +175 -0
  277. data/vendor/FreeImage/Source/LibOpenJPEG/opj_intmath.h +172 -0
  278. data/vendor/FreeImage/Source/LibOpenJPEG/opj_inttypes.h +43 -0
  279. data/vendor/FreeImage/Source/LibOpenJPEG/opj_malloc.h +180 -0
  280. data/vendor/FreeImage/Source/LibOpenJPEG/opj_stdint.h +47 -0
  281. data/vendor/FreeImage/Source/LibOpenJPEG/phix_manager.c +191 -0
  282. data/vendor/FreeImage/Source/LibOpenJPEG/pi.c +1870 -0
  283. data/vendor/FreeImage/Source/LibOpenJPEG/pi.h +182 -0
  284. data/vendor/FreeImage/Source/LibOpenJPEG/ppix_manager.c +194 -0
  285. data/vendor/FreeImage/Source/LibOpenJPEG/raw.c +89 -0
  286. data/vendor/FreeImage/Source/LibOpenJPEG/raw.h +100 -0
  287. data/vendor/FreeImage/Source/LibOpenJPEG/t1.c +1751 -0
  288. data/vendor/FreeImage/Source/LibOpenJPEG/t1.h +157 -0
  289. data/vendor/FreeImage/Source/LibOpenJPEG/t1_generate_luts.c +276 -0
  290. data/vendor/FreeImage/Source/LibOpenJPEG/t1_luts.h +143 -0
  291. data/vendor/FreeImage/Source/LibOpenJPEG/t2.c +1334 -0
  292. data/vendor/FreeImage/Source/LibOpenJPEG/t2.h +127 -0
  293. data/vendor/FreeImage/Source/LibOpenJPEG/tcd.c +2123 -0
  294. data/vendor/FreeImage/Source/LibOpenJPEG/tcd.h +348 -0
  295. data/vendor/FreeImage/Source/LibOpenJPEG/tgt.c +331 -0
  296. data/vendor/FreeImage/Source/LibOpenJPEG/tgt.h +140 -0
  297. data/vendor/FreeImage/Source/LibOpenJPEG/thix_manager.c +134 -0
  298. data/vendor/FreeImage/Source/LibOpenJPEG/tpix_manager.c +185 -0
  299. data/vendor/FreeImage/Source/LibPNG/example.c +1061 -0
  300. data/vendor/FreeImage/Source/LibPNG/png.c +4493 -0
  301. data/vendor/FreeImage/Source/LibPNG/png.h +3282 -0
  302. data/vendor/FreeImage/Source/LibPNG/pngconf.h +644 -0
  303. data/vendor/FreeImage/Source/LibPNG/pngdebug.h +154 -0
  304. data/vendor/FreeImage/Source/LibPNG/pngerror.c +963 -0
  305. data/vendor/FreeImage/Source/LibPNG/pngget.c +1213 -0
  306. data/vendor/FreeImage/Source/LibPNG/pnginfo.h +260 -0
  307. data/vendor/FreeImage/Source/LibPNG/pnglibconf.h +218 -0
  308. data/vendor/FreeImage/Source/LibPNG/pngmem.c +281 -0
  309. data/vendor/FreeImage/Source/LibPNG/pngpread.c +1168 -0
  310. data/vendor/FreeImage/Source/LibPNG/pngpriv.h +1944 -0
  311. data/vendor/FreeImage/Source/LibPNG/pngread.c +4121 -0
  312. data/vendor/FreeImage/Source/LibPNG/pngrio.c +120 -0
  313. data/vendor/FreeImage/Source/LibPNG/pngrtran.c +4994 -0
  314. data/vendor/FreeImage/Source/LibPNG/pngrutil.c +4474 -0
  315. data/vendor/FreeImage/Source/LibPNG/pngset.c +1611 -0
  316. data/vendor/FreeImage/Source/LibPNG/pngstruct.h +489 -0
  317. data/vendor/FreeImage/Source/LibPNG/pngtest.c +2011 -0
  318. data/vendor/FreeImage/Source/LibPNG/pngtrans.c +849 -0
  319. data/vendor/FreeImage/Source/LibPNG/pngwio.c +168 -0
  320. data/vendor/FreeImage/Source/LibPNG/pngwrite.c +2455 -0
  321. data/vendor/FreeImage/Source/LibPNG/pngwtran.c +574 -0
  322. data/vendor/FreeImage/Source/LibPNG/pngwutil.c +3029 -0
  323. data/vendor/FreeImage/Source/LibRawLite/dcraw/dcraw.c +15462 -0
  324. data/vendor/FreeImage/Source/LibRawLite/internal/aahd_demosaic.cpp +706 -0
  325. data/vendor/FreeImage/Source/LibRawLite/internal/dcb_demosaicing.c +710 -0
  326. data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_common.cpp +13593 -0
  327. data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_fileio.cpp +240 -0
  328. data/vendor/FreeImage/Source/LibRawLite/internal/defines.h +167 -0
  329. data/vendor/FreeImage/Source/LibRawLite/internal/demosaic_packs.cpp +99 -0
  330. data/vendor/FreeImage/Source/LibRawLite/internal/dht_demosaic.cpp +873 -0
  331. data/vendor/FreeImage/Source/LibRawLite/internal/libraw_internal_funcs.h +282 -0
  332. data/vendor/FreeImage/Source/LibRawLite/internal/libraw_x3f.cpp +1919 -0
  333. data/vendor/FreeImage/Source/LibRawLite/internal/var_defines.h +216 -0
  334. data/vendor/FreeImage/Source/LibRawLite/internal/wf_filtering.cpp +1950 -0
  335. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw.h +338 -0
  336. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_alloc.h +99 -0
  337. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_const.h +233 -0
  338. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_datastream.h +238 -0
  339. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_internal.h +225 -0
  340. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_types.h +442 -0
  341. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_version.h +62 -0
  342. data/vendor/FreeImage/Source/LibRawLite/src/libraw_c_api.cpp +230 -0
  343. data/vendor/FreeImage/Source/LibRawLite/src/libraw_cxx.cpp +4533 -0
  344. data/vendor/FreeImage/Source/LibRawLite/src/libraw_datastream.cpp +703 -0
  345. data/vendor/FreeImage/Source/LibTIFF4/mkg3states.c +451 -0
  346. data/vendor/FreeImage/Source/LibTIFF4/mkspans.c +82 -0
  347. data/vendor/FreeImage/Source/LibTIFF4/t4.h +292 -0
  348. data/vendor/FreeImage/Source/LibTIFF4/tif_aux.c +358 -0
  349. data/vendor/FreeImage/Source/LibTIFF4/tif_close.c +140 -0
  350. data/vendor/FreeImage/Source/LibTIFF4/tif_codec.c +166 -0
  351. data/vendor/FreeImage/Source/LibTIFF4/tif_color.c +287 -0
  352. data/vendor/FreeImage/Source/LibTIFF4/tif_compress.c +304 -0
  353. data/vendor/FreeImage/Source/LibTIFF4/tif_config.h +97 -0
  354. data/vendor/FreeImage/Source/LibTIFF4/tif_config.vc.h +74 -0
  355. data/vendor/FreeImage/Source/LibTIFF4/tif_config.wince.h +71 -0
  356. data/vendor/FreeImage/Source/LibTIFF4/tif_dir.c +1700 -0
  357. data/vendor/FreeImage/Source/LibTIFF4/tif_dir.h +308 -0
  358. data/vendor/FreeImage/Source/LibTIFF4/tif_dirinfo.c +959 -0
  359. data/vendor/FreeImage/Source/LibTIFF4/tif_dirread.c +5640 -0
  360. data/vendor/FreeImage/Source/LibTIFF4/tif_dirwrite.c +2910 -0
  361. data/vendor/FreeImage/Source/LibTIFF4/tif_dumpmode.c +143 -0
  362. data/vendor/FreeImage/Source/LibTIFF4/tif_error.c +80 -0
  363. data/vendor/FreeImage/Source/LibTIFF4/tif_extension.c +118 -0
  364. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.c +1595 -0
  365. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.h +538 -0
  366. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3sm.c +1260 -0
  367. data/vendor/FreeImage/Source/LibTIFF4/tif_flush.c +118 -0
  368. data/vendor/FreeImage/Source/LibTIFF4/tif_getimage.c +2890 -0
  369. data/vendor/FreeImage/Source/LibTIFF4/tif_jbig.c +213 -0
  370. data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg.c +2354 -0
  371. data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg_12.c +65 -0
  372. data/vendor/FreeImage/Source/LibTIFF4/tif_luv.c +1683 -0
  373. data/vendor/FreeImage/Source/LibTIFF4/tif_lzma.c +495 -0
  374. data/vendor/FreeImage/Source/LibTIFF4/tif_lzw.c +1169 -0
  375. data/vendor/FreeImage/Source/LibTIFF4/tif_next.c +181 -0
  376. data/vendor/FreeImage/Source/LibTIFF4/tif_ojpeg.c +2501 -0
  377. data/vendor/FreeImage/Source/LibTIFF4/tif_open.c +725 -0
  378. data/vendor/FreeImage/Source/LibTIFF4/tif_packbits.c +300 -0
  379. data/vendor/FreeImage/Source/LibTIFF4/tif_pixarlog.c +1442 -0
  380. data/vendor/FreeImage/Source/LibTIFF4/tif_predict.c +764 -0
  381. data/vendor/FreeImage/Source/LibTIFF4/tif_predict.h +77 -0
  382. data/vendor/FreeImage/Source/LibTIFF4/tif_print.c +716 -0
  383. data/vendor/FreeImage/Source/LibTIFF4/tif_read.c +1086 -0
  384. data/vendor/FreeImage/Source/LibTIFF4/tif_strip.c +383 -0
  385. data/vendor/FreeImage/Source/LibTIFF4/tif_swab.c +310 -0
  386. data/vendor/FreeImage/Source/LibTIFF4/tif_thunder.c +207 -0
  387. data/vendor/FreeImage/Source/LibTIFF4/tif_tile.c +299 -0
  388. data/vendor/FreeImage/Source/LibTIFF4/tif_unix.c +325 -0
  389. data/vendor/FreeImage/Source/LibTIFF4/tif_version.c +40 -0
  390. data/vendor/FreeImage/Source/LibTIFF4/tif_vms.c +603 -0
  391. data/vendor/FreeImage/Source/LibTIFF4/tif_warning.c +81 -0
  392. data/vendor/FreeImage/Source/LibTIFF4/tif_win32.c +443 -0
  393. data/vendor/FreeImage/Source/LibTIFF4/tif_wince.c +293 -0
  394. data/vendor/FreeImage/Source/LibTIFF4/tif_write.c +771 -0
  395. data/vendor/FreeImage/Source/LibTIFF4/tif_zip.c +472 -0
  396. data/vendor/FreeImage/Source/LibTIFF4/tiff.h +681 -0
  397. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.h +170 -0
  398. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.vc.h +160 -0
  399. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.wince.h +121 -0
  400. data/vendor/FreeImage/Source/LibTIFF4/tiffio.h +557 -0
  401. data/vendor/FreeImage/Source/LibTIFF4/tiffiop.h +367 -0
  402. data/vendor/FreeImage/Source/LibTIFF4/tiffvers.h +9 -0
  403. data/vendor/FreeImage/Source/LibTIFF4/uvcode.h +180 -0
  404. data/vendor/FreeImage/Source/LibWebP/src/dec/alphai.h +55 -0
  405. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.alpha.c +167 -0
  406. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.buffer.c +249 -0
  407. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.frame.c +827 -0
  408. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.idec.c +857 -0
  409. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.io.c +640 -0
  410. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.quant.c +110 -0
  411. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.tree.c +525 -0
  412. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8.c +663 -0
  413. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8l.c +1584 -0
  414. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.webp.c +834 -0
  415. data/vendor/FreeImage/Source/LibWebP/src/dec/decode_vp8.h +185 -0
  416. data/vendor/FreeImage/Source/LibWebP/src/dec/vp8i.h +353 -0
  417. data/vendor/FreeImage/Source/LibWebP/src/dec/vp8li.h +136 -0
  418. data/vendor/FreeImage/Source/LibWebP/src/dec/webpi.h +120 -0
  419. data/vendor/FreeImage/Source/LibWebP/src/demux/demux.demux.c +957 -0
  420. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing.c +377 -0
  421. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_mips_dsp_r2.c +139 -0
  422. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_sse2.c +296 -0
  423. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb.c +68 -0
  424. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_mips_dsp_r2.c +108 -0
  425. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_sse2.c +62 -0
  426. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost.c +412 -0
  427. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips32.c +154 -0
  428. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips_dsp_r2.c +107 -0
  429. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_sse2.c +121 -0
  430. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cpu.c +138 -0
  431. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec.c +760 -0
  432. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_clip_tables.c +366 -0
  433. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips32.c +585 -0
  434. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +992 -0
  435. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_neon.c +1489 -0
  436. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_sse2.c +1284 -0
  437. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc.c +788 -0
  438. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_avx2.c +24 -0
  439. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips32.c +670 -0
  440. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +1510 -0
  441. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_neon.c +932 -0
  442. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_sse2.c +940 -0
  443. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters.c +240 -0
  444. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +404 -0
  445. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_sse2.c +349 -0
  446. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.h +434 -0
  447. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless.c +1838 -0
  448. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips32.c +416 -0
  449. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +921 -0
  450. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_neon.c +357 -0
  451. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_sse2.c +535 -0
  452. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler.c +115 -0
  453. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips32.c +192 -0
  454. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips_dsp_r2.c +210 -0
  455. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling.c +252 -0
  456. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +280 -0
  457. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_neon.c +267 -0
  458. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_sse2.c +214 -0
  459. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv.c +166 -0
  460. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips32.c +100 -0
  461. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +131 -0
  462. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_sse2.c +322 -0
  463. data/vendor/FreeImage/Source/LibWebP/src/dsp/lossless.h +313 -0
  464. data/vendor/FreeImage/Source/LibWebP/src/dsp/mips_macro.h +200 -0
  465. data/vendor/FreeImage/Source/LibWebP/src/dsp/neon.h +82 -0
  466. data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv.h +321 -0
  467. data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv_tables_sse2.h +536 -0
  468. data/vendor/FreeImage/Source/LibWebP/src/enc/backward_references.h +202 -0
  469. data/vendor/FreeImage/Source/LibWebP/src/enc/cost.h +69 -0
  470. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.alpha.c +440 -0
  471. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.analysis.c +501 -0
  472. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.backward_references.c +1076 -0
  473. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.config.c +163 -0
  474. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.cost.c +355 -0
  475. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.filter.c +296 -0
  476. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.frame.c +850 -0
  477. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.histogram.c +897 -0
  478. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.iterator.c +456 -0
  479. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.near_lossless.c +160 -0
  480. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture.c +290 -0
  481. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_csp.c +1100 -0
  482. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_psnr.c +150 -0
  483. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_rescale.c +285 -0
  484. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_tools.c +206 -0
  485. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.quant.c +1191 -0
  486. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.syntax.c +383 -0
  487. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.token.c +285 -0
  488. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.tree.c +504 -0
  489. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.vp8l.c +1437 -0
  490. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.webpenc.c +379 -0
  491. data/vendor/FreeImage/Source/LibWebP/src/enc/histogram.h +114 -0
  492. data/vendor/FreeImage/Source/LibWebP/src/enc/vp8enci.h +551 -0
  493. data/vendor/FreeImage/Source/LibWebP/src/enc/vp8li.h +78 -0
  494. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.anim_encode.c +1241 -0
  495. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxedit.c +696 -0
  496. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxinternal.c +551 -0
  497. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxread.c +544 -0
  498. data/vendor/FreeImage/Source/LibWebP/src/mux/muxi.h +232 -0
  499. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader.h +168 -0
  500. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader_inl.h +172 -0
  501. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_writer.h +120 -0
  502. data/vendor/FreeImage/Source/LibWebP/src/utils/color_cache.h +74 -0
  503. data/vendor/FreeImage/Source/LibWebP/src/utils/endian_inl.h +100 -0
  504. data/vendor/FreeImage/Source/LibWebP/src/utils/filters.h +32 -0
  505. data/vendor/FreeImage/Source/LibWebP/src/utils/huffman.h +67 -0
  506. data/vendor/FreeImage/Source/LibWebP/src/utils/huffman_encode.h +60 -0
  507. data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels.h +36 -0
  508. data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels_dec.h +35 -0
  509. data/vendor/FreeImage/Source/LibWebP/src/utils/random.h +63 -0
  510. data/vendor/FreeImage/Source/LibWebP/src/utils/rescaler.h +78 -0
  511. data/vendor/FreeImage/Source/LibWebP/src/utils/thread.h +93 -0
  512. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_reader.c +208 -0
  513. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_writer.c +308 -0
  514. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.color_cache.c +49 -0
  515. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.filters.c +76 -0
  516. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.h +121 -0
  517. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman.c +205 -0
  518. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman_encode.c +417 -0
  519. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels.c +140 -0
  520. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels_dec.c +279 -0
  521. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.random.c +43 -0
  522. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.rescaler.c +82 -0
  523. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.thread.c +309 -0
  524. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.utils.c +211 -0
  525. data/vendor/FreeImage/Source/LibWebP/src/webp/decode.h +493 -0
  526. data/vendor/FreeImage/Source/LibWebP/src/webp/demux.h +224 -0
  527. data/vendor/FreeImage/Source/LibWebP/src/webp/encode.h +515 -0
  528. data/vendor/FreeImage/Source/LibWebP/src/webp/format_constants.h +88 -0
  529. data/vendor/FreeImage/Source/LibWebP/src/webp/mux.h +507 -0
  530. data/vendor/FreeImage/Source/LibWebP/src/webp/mux_types.h +97 -0
  531. data/vendor/FreeImage/Source/LibWebP/src/webp/types.h +52 -0
  532. data/vendor/FreeImage/Source/MapIntrospector.h +212 -0
  533. data/vendor/FreeImage/Source/Metadata/Exif.cpp +1253 -0
  534. data/vendor/FreeImage/Source/Metadata/FIRational.cpp +176 -0
  535. data/vendor/FreeImage/Source/Metadata/FIRational.h +108 -0
  536. data/vendor/FreeImage/Source/Metadata/FreeImageTag.cpp +353 -0
  537. data/vendor/FreeImage/Source/Metadata/FreeImageTag.h +500 -0
  538. data/vendor/FreeImage/Source/Metadata/IPTC.cpp +342 -0
  539. data/vendor/FreeImage/Source/Metadata/TagConversion.cpp +1094 -0
  540. data/vendor/FreeImage/Source/Metadata/TagLib.cpp +1618 -0
  541. data/vendor/FreeImage/Source/Metadata/XTIFF.cpp +766 -0
  542. data/vendor/FreeImage/Source/OpenEXR/Half/eLut.cpp +114 -0
  543. data/vendor/FreeImage/Source/OpenEXR/Half/eLut.h +71 -0
  544. data/vendor/FreeImage/Source/OpenEXR/Half/half.cpp +310 -0
  545. data/vendor/FreeImage/Source/OpenEXR/Half/half.h +757 -0
  546. data/vendor/FreeImage/Source/OpenEXR/Half/halfExport.h +27 -0
  547. data/vendor/FreeImage/Source/OpenEXR/Half/halfFunction.h +179 -0
  548. data/vendor/FreeImage/Source/OpenEXR/Half/halfLimits.h +102 -0
  549. data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.cpp +164 -0
  550. data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.h +16391 -0
  551. data/vendor/FreeImage/Source/OpenEXR/Iex/Iex.h +60 -0
  552. data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.cpp +156 -0
  553. data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.h +264 -0
  554. data/vendor/FreeImage/Source/OpenEXR/Iex/IexErrnoExc.h +208 -0
  555. data/vendor/FreeImage/Source/OpenEXR/Iex/IexExport.h +51 -0
  556. data/vendor/FreeImage/Source/OpenEXR/Iex/IexForward.h +229 -0
  557. data/vendor/FreeImage/Source/OpenEXR/Iex/IexMacros.h +170 -0
  558. data/vendor/FreeImage/Source/OpenEXR/Iex/IexMathExc.h +57 -0
  559. data/vendor/FreeImage/Source/OpenEXR/Iex/IexNamespace.h +112 -0
  560. data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.cpp +873 -0
  561. data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.h +97 -0
  562. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.cpp +113 -0
  563. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.h +146 -0
  564. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.cpp +530 -0
  565. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.h +91 -0
  566. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathIeeeExc.h +62 -0
  567. data/vendor/FreeImage/Source/OpenEXR/IlmBaseConfig.h +61 -0
  568. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.cpp +633 -0
  569. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.h +324 -0
  570. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfArray.h +285 -0
  571. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.cpp +158 -0
  572. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.h +407 -0
  573. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAutoArray.h +95 -0
  574. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.cpp +1072 -0
  575. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.h +118 -0
  576. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp +111 -0
  577. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.h +87 -0
  578. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp +1438 -0
  579. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.h +555 -0
  580. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.cpp +322 -0
  581. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.h +436 -0
  582. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp +150 -0
  583. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.h +74 -0
  584. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h +163 -0
  585. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.cpp +151 -0
  586. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.h +131 -0
  587. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp +87 -0
  588. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.h +73 -0
  589. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp +591 -0
  590. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.h +142 -0
  591. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompression.h +84 -0
  592. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp +78 -0
  593. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.h +64 -0
  594. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.cpp +226 -0
  595. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.h +265 -0
  596. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.cpp +143 -0
  597. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.h +107 -0
  598. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.cpp +110 -0
  599. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.h +132 -0
  600. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.cpp +230 -0
  601. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.h +339 -0
  602. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageState.h +96 -0
  603. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp +78 -0
  604. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h +68 -0
  605. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp +2025 -0
  606. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.h +276 -0
  607. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.cpp +149 -0
  608. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.h +181 -0
  609. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp +1552 -0
  610. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.h +244 -0
  611. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.cpp +107 -0
  612. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.h +168 -0
  613. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp +1979 -0
  614. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.h +437 -0
  615. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.cpp +273 -0
  616. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.h +362 -0
  617. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp +2055 -0
  618. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.h +475 -0
  619. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.cpp +250 -0
  620. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.h +394 -0
  621. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp +57 -0
  622. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.h +59 -0
  623. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp +3424 -0
  624. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.h +210 -0
  625. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressorSimd.h +2145 -0
  626. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.cpp +335 -0
  627. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.h +336 -0
  628. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp +76 -0
  629. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.h +68 -0
  630. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfExport.h +46 -0
  631. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.cpp +768 -0
  632. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.h +148 -0
  633. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp +57 -0
  634. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.h +58 -0
  635. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.cpp +84 -0
  636. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.h +76 -0
  637. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfForward.h +127 -0
  638. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp +228 -0
  639. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.h +386 -0
  640. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp +76 -0
  641. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h +94 -0
  642. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.cpp +76 -0
  643. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.h +58 -0
  644. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.cpp +112 -0
  645. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.h +62 -0
  646. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.cpp +1283 -0
  647. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.h +699 -0
  648. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.cpp +1114 -0
  649. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.h +82 -0
  650. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.cpp +110 -0
  651. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.h +255 -0
  652. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.cpp +895 -0
  653. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.h +240 -0
  654. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.cpp +114 -0
  655. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.h +84 -0
  656. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.cpp +51 -0
  657. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.h +69 -0
  658. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputStreamMutex.h +68 -0
  659. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInt64.h +56 -0
  660. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.cpp +57 -0
  661. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.h +58 -0
  662. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.cpp +217 -0
  663. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.h +167 -0
  664. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp +99 -0
  665. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.h +73 -0
  666. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrder.h +69 -0
  667. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp +78 -0
  668. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.h +72 -0
  669. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.cpp +178 -0
  670. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.h +188 -0
  671. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp +263 -0
  672. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.h +83 -0
  673. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.cpp +1872 -0
  674. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.h +466 -0
  675. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +783 -0
  676. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.h +128 -0
  677. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp +519 -0
  678. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.h +118 -0
  679. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.cpp +435 -0
  680. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.h +187 -0
  681. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfName.h +150 -0
  682. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfNamespace.h +115 -0
  683. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp +126 -0
  684. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.h +110 -0
  685. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOptimizedPixelReading.h +646 -0
  686. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.cpp +1378 -0
  687. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.h +263 -0
  688. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.cpp +105 -0
  689. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.h +77 -0
  690. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.cpp +52 -0
  691. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.h +62 -0
  692. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputStreamMutex.h +70 -0
  693. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartHelper.h +262 -0
  694. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.cpp +63 -0
  695. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.h +62 -0
  696. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPixelType.h +67 -0
  697. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.cpp +667 -0
  698. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.h +117 -0
  699. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.cpp +104 -0
  700. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.h +135 -0
  701. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp +103 -0
  702. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.h +70 -0
  703. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp +553 -0
  704. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.h +109 -0
  705. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.cpp +127 -0
  706. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.h +98 -0
  707. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp +74 -0
  708. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.h +69 -0
  709. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgba.h +109 -0
  710. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.cpp +1405 -0
  711. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.h +346 -0
  712. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.cpp +497 -0
  713. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.h +259 -0
  714. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.cpp +157 -0
  715. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.h +63 -0
  716. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.cpp +220 -0
  717. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.h +80 -0
  718. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp +1702 -0
  719. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.h +210 -0
  720. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSimd.h +59 -0
  721. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp +125 -0
  722. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.h +382 -0
  723. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.cpp +242 -0
  724. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.h +160 -0
  725. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.cpp +80 -0
  726. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.h +71 -0
  727. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp +100 -0
  728. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.h +74 -0
  729. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp +129 -0
  730. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.h +172 -0
  731. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.cpp +216 -0
  732. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.h +97 -0
  733. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.cpp +62 -0
  734. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.h +95 -0
  735. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescription.h +107 -0
  736. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp +86 -0
  737. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.h +72 -0
  738. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.cpp +552 -0
  739. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.h +125 -0
  740. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp +1533 -0
  741. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.h +401 -0
  742. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.cpp +208 -0
  743. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.h +100 -0
  744. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.cpp +389 -0
  745. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.h +106 -0
  746. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp +1841 -0
  747. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.h +495 -0
  748. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.cpp +228 -0
  749. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.h +105 -0
  750. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp +1163 -0
  751. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.h +482 -0
  752. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.cpp +431 -0
  753. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.h +242 -0
  754. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp +79 -0
  755. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.h +74 -0
  756. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.cpp +217 -0
  757. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.h +100 -0
  758. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.cpp +60 -0
  759. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.h +136 -0
  760. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.cpp +391 -0
  761. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.h +78 -0
  762. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfXdr.h +927 -0
  763. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.cpp +196 -0
  764. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.h +78 -0
  765. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.cpp +127 -0
  766. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.h +89 -0
  767. data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.cpp +136 -0
  768. data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.h +16396 -0
  769. data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.cpp +573 -0
  770. data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.h +98334 -0
  771. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.cpp +80 -0
  772. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.h +143 -0
  773. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadExport.h +46 -0
  774. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadForward.h +52 -0
  775. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.cpp +59 -0
  776. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.h +160 -0
  777. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexPosix.cpp +85 -0
  778. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexWin32.cpp +79 -0
  779. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadNamespace.h +114 -0
  780. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.cpp +483 -0
  781. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.h +160 -0
  782. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPosix.cpp +98 -0
  783. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp +60 -0
  784. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.h +112 -0
  785. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosix.cpp +106 -0
  786. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosixCompat.cpp +155 -0
  787. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphoreWin32.cpp +153 -0
  788. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadWin32.cpp +100 -0
  789. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.cpp +37 -0
  790. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.h +849 -0
  791. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBoxAlgo.h +1016 -0
  792. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColor.h +736 -0
  793. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.cpp +178 -0
  794. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.h +257 -0
  795. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathEuler.h +926 -0
  796. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExc.h +73 -0
  797. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExport.h +46 -0
  798. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathForward.h +72 -0
  799. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrame.h +192 -0
  800. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustum.h +741 -0
  801. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustumTest.h +417 -0
  802. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.cpp +181 -0
  803. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.h +269 -0
  804. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGL.h +166 -0
  805. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGLU.h +54 -0
  806. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathHalfLimits.h +68 -0
  807. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInt64.h +62 -0
  808. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInterval.h +226 -0
  809. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLimits.h +268 -0
  810. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLine.h +185 -0
  811. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLineAlgo.h +288 -0
  812. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMath.h +208 -0
  813. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrix.h +3441 -0
  814. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.cpp +1252 -0
  815. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.h +1425 -0
  816. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathNamespace.h +115 -0
  817. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlane.h +257 -0
  818. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlatform.h +112 -0
  819. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathQuat.h +964 -0
  820. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.cpp +194 -0
  821. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.h +401 -0
  822. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRoots.h +219 -0
  823. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.cpp +54 -0
  824. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.h +656 -0
  825. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathSphere.h +177 -0
  826. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.cpp +583 -0
  827. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.h +2227 -0
  828. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVecAlgo.h +147 -0
  829. data/vendor/FreeImage/Source/OpenEXR/OpenEXRConfig.h +72 -0
  830. data/vendor/FreeImage/Source/Plugin.h +144 -0
  831. data/vendor/FreeImage/Source/Quantizers.h +354 -0
  832. data/vendor/FreeImage/Source/ToneMapping.h +44 -0
  833. data/vendor/FreeImage/Source/Utilities.h +516 -0
  834. data/vendor/FreeImage/Source/ZLib/adler32.c +179 -0
  835. data/vendor/FreeImage/Source/ZLib/compress.c +80 -0
  836. data/vendor/FreeImage/Source/ZLib/crc32.c +425 -0
  837. data/vendor/FreeImage/Source/ZLib/crc32.h +441 -0
  838. data/vendor/FreeImage/Source/ZLib/deflate.c +1967 -0
  839. data/vendor/FreeImage/Source/ZLib/deflate.h +346 -0
  840. data/vendor/FreeImage/Source/ZLib/gzclose.c +25 -0
  841. data/vendor/FreeImage/Source/ZLib/gzguts.h +209 -0
  842. data/vendor/FreeImage/Source/ZLib/gzlib.c +634 -0
  843. data/vendor/FreeImage/Source/ZLib/gzread.c +594 -0
  844. data/vendor/FreeImage/Source/ZLib/gzwrite.c +577 -0
  845. data/vendor/FreeImage/Source/ZLib/infback.c +640 -0
  846. data/vendor/FreeImage/Source/ZLib/inffast.c +340 -0
  847. data/vendor/FreeImage/Source/ZLib/inffast.h +11 -0
  848. data/vendor/FreeImage/Source/ZLib/inffixed.h +94 -0
  849. data/vendor/FreeImage/Source/ZLib/inflate.c +1512 -0
  850. data/vendor/FreeImage/Source/ZLib/inflate.h +122 -0
  851. data/vendor/FreeImage/Source/ZLib/inftrees.c +306 -0
  852. data/vendor/FreeImage/Source/ZLib/inftrees.h +62 -0
  853. data/vendor/FreeImage/Source/ZLib/trees.c +1226 -0
  854. data/vendor/FreeImage/Source/ZLib/trees.h +128 -0
  855. data/vendor/FreeImage/Source/ZLib/uncompr.c +59 -0
  856. data/vendor/FreeImage/Source/ZLib/zconf.h +511 -0
  857. data/vendor/FreeImage/Source/ZLib/zlib.h +1768 -0
  858. data/vendor/FreeImage/Source/ZLib/zutil.c +324 -0
  859. data/vendor/FreeImage/Source/ZLib/zutil.h +253 -0
  860. metadata +931 -0
@@ -0,0 +1,932 @@
1
+ // Copyright 2012 Google Inc. All Rights Reserved.
2
+ //
3
+ // Use of this source code is governed by a BSD-style license
4
+ // that can be found in the COPYING file in the root of the source
5
+ // tree. An additional intellectual property rights grant can be found
6
+ // in the file PATENTS. All contributing project authors may
7
+ // be found in the AUTHORS file in the root of the source tree.
8
+ // -----------------------------------------------------------------------------
9
+ //
10
+ // ARM NEON version of speed-critical encoding functions.
11
+ //
12
+ // adapted from libvpx (http://www.webmproject.org/code/)
13
+
14
+ #include "./dsp.h"
15
+
16
+ #if defined(WEBP_USE_NEON)
17
+
18
+ #include <assert.h>
19
+
20
+ #include "./neon.h"
21
+ #include "../enc/vp8enci.h"
22
+
23
+ //------------------------------------------------------------------------------
24
+ // Transforms (Paragraph 14.4)
25
+
26
+ // Inverse transform.
27
+ // This code is pretty much the same as TransformOne in the dec_neon.c, except
28
+ // for subtraction to *ref. See the comments there for algorithmic explanations.
29
+
30
+ static const int16_t kC1 = 20091;
31
+ static const int16_t kC2 = 17734; // half of kC2, actually. See comment above.
32
+
33
+ // This code works but is *slower* than the inlined-asm version below
34
+ // (with gcc-4.6). So we disable it for now. Later, it'll be conditional to
35
+ // WEBP_USE_INTRINSICS define.
36
+ // With gcc-4.8, it's a little faster speed than inlined-assembly.
37
+ #if defined(WEBP_USE_INTRINSICS)
38
+
39
+ // Treats 'v' as an uint8x8_t and zero extends to an int16x8_t.
40
+ static WEBP_INLINE int16x8_t ConvertU8ToS16(uint32x2_t v) {
41
+ return vreinterpretq_s16_u16(vmovl_u8(vreinterpret_u8_u32(v)));
42
+ }
43
+
44
+ // Performs unsigned 8b saturation on 'dst01' and 'dst23' storing the result
45
+ // to the corresponding rows of 'dst'.
46
+ static WEBP_INLINE void SaturateAndStore4x4(uint8_t* const dst,
47
+ const int16x8_t dst01,
48
+ const int16x8_t dst23) {
49
+ // Unsigned saturate to 8b.
50
+ const uint8x8_t dst01_u8 = vqmovun_s16(dst01);
51
+ const uint8x8_t dst23_u8 = vqmovun_s16(dst23);
52
+
53
+ // Store the results.
54
+ vst1_lane_u32((uint32_t*)(dst + 0 * BPS), vreinterpret_u32_u8(dst01_u8), 0);
55
+ vst1_lane_u32((uint32_t*)(dst + 1 * BPS), vreinterpret_u32_u8(dst01_u8), 1);
56
+ vst1_lane_u32((uint32_t*)(dst + 2 * BPS), vreinterpret_u32_u8(dst23_u8), 0);
57
+ vst1_lane_u32((uint32_t*)(dst + 3 * BPS), vreinterpret_u32_u8(dst23_u8), 1);
58
+ }
59
+
60
+ static WEBP_INLINE void Add4x4(const int16x8_t row01, const int16x8_t row23,
61
+ const uint8_t* const ref, uint8_t* const dst) {
62
+ uint32x2_t dst01 = vdup_n_u32(0);
63
+ uint32x2_t dst23 = vdup_n_u32(0);
64
+
65
+ // Load the source pixels.
66
+ dst01 = vld1_lane_u32((uint32_t*)(ref + 0 * BPS), dst01, 0);
67
+ dst23 = vld1_lane_u32((uint32_t*)(ref + 2 * BPS), dst23, 0);
68
+ dst01 = vld1_lane_u32((uint32_t*)(ref + 1 * BPS), dst01, 1);
69
+ dst23 = vld1_lane_u32((uint32_t*)(ref + 3 * BPS), dst23, 1);
70
+
71
+ {
72
+ // Convert to 16b.
73
+ const int16x8_t dst01_s16 = ConvertU8ToS16(dst01);
74
+ const int16x8_t dst23_s16 = ConvertU8ToS16(dst23);
75
+
76
+ // Descale with rounding.
77
+ const int16x8_t out01 = vrsraq_n_s16(dst01_s16, row01, 3);
78
+ const int16x8_t out23 = vrsraq_n_s16(dst23_s16, row23, 3);
79
+ // Add the inverse transform.
80
+ SaturateAndStore4x4(dst, out01, out23);
81
+ }
82
+ }
83
+
84
+ static WEBP_INLINE void Transpose8x2(const int16x8_t in0, const int16x8_t in1,
85
+ int16x8x2_t* const out) {
86
+ // a0 a1 a2 a3 | b0 b1 b2 b3 => a0 b0 c0 d0 | a1 b1 c1 d1
87
+ // c0 c1 c2 c3 | d0 d1 d2 d3 a2 b2 c2 d2 | a3 b3 c3 d3
88
+ const int16x8x2_t tmp0 = vzipq_s16(in0, in1); // a0 c0 a1 c1 a2 c2 ...
89
+ // b0 d0 b1 d1 b2 d2 ...
90
+ *out = vzipq_s16(tmp0.val[0], tmp0.val[1]);
91
+ }
92
+
93
+ static WEBP_INLINE void TransformPass(int16x8x2_t* const rows) {
94
+ // {rows} = in0 | in4
95
+ // in8 | in12
96
+ // B1 = in4 | in12
97
+ const int16x8_t B1 =
98
+ vcombine_s16(vget_high_s16(rows->val[0]), vget_high_s16(rows->val[1]));
99
+ // C0 = kC1 * in4 | kC1 * in12
100
+ // C1 = kC2 * in4 | kC2 * in12
101
+ const int16x8_t C0 = vsraq_n_s16(B1, vqdmulhq_n_s16(B1, kC1), 1);
102
+ const int16x8_t C1 = vqdmulhq_n_s16(B1, kC2);
103
+ const int16x4_t a = vqadd_s16(vget_low_s16(rows->val[0]),
104
+ vget_low_s16(rows->val[1])); // in0 + in8
105
+ const int16x4_t b = vqsub_s16(vget_low_s16(rows->val[0]),
106
+ vget_low_s16(rows->val[1])); // in0 - in8
107
+ // c = kC2 * in4 - kC1 * in12
108
+ // d = kC1 * in4 + kC2 * in12
109
+ const int16x4_t c = vqsub_s16(vget_low_s16(C1), vget_high_s16(C0));
110
+ const int16x4_t d = vqadd_s16(vget_low_s16(C0), vget_high_s16(C1));
111
+ const int16x8_t D0 = vcombine_s16(a, b); // D0 = a | b
112
+ const int16x8_t D1 = vcombine_s16(d, c); // D1 = d | c
113
+ const int16x8_t E0 = vqaddq_s16(D0, D1); // a+d | b+c
114
+ const int16x8_t E_tmp = vqsubq_s16(D0, D1); // a-d | b-c
115
+ const int16x8_t E1 = vcombine_s16(vget_high_s16(E_tmp), vget_low_s16(E_tmp));
116
+ Transpose8x2(E0, E1, rows);
117
+ }
118
+
119
+ static void ITransformOne(const uint8_t* ref,
120
+ const int16_t* in, uint8_t* dst) {
121
+ int16x8x2_t rows;
122
+ INIT_VECTOR2(rows, vld1q_s16(in + 0), vld1q_s16(in + 8));
123
+ TransformPass(&rows);
124
+ TransformPass(&rows);
125
+ Add4x4(rows.val[0], rows.val[1], ref, dst);
126
+ }
127
+
128
+ #else
129
+
130
+ static void ITransformOne(const uint8_t* ref,
131
+ const int16_t* in, uint8_t* dst) {
132
+ const int kBPS = BPS;
133
+ const int16_t kC1C2[] = { kC1, kC2, 0, 0 };
134
+
135
+ __asm__ volatile (
136
+ "vld1.16 {q1, q2}, [%[in]] \n"
137
+ "vld1.16 {d0}, [%[kC1C2]] \n"
138
+
139
+ // d2: in[0]
140
+ // d3: in[8]
141
+ // d4: in[4]
142
+ // d5: in[12]
143
+ "vswp d3, d4 \n"
144
+
145
+ // q8 = {in[4], in[12]} * kC1 * 2 >> 16
146
+ // q9 = {in[4], in[12]} * kC2 >> 16
147
+ "vqdmulh.s16 q8, q2, d0[0] \n"
148
+ "vqdmulh.s16 q9, q2, d0[1] \n"
149
+
150
+ // d22 = a = in[0] + in[8]
151
+ // d23 = b = in[0] - in[8]
152
+ "vqadd.s16 d22, d2, d3 \n"
153
+ "vqsub.s16 d23, d2, d3 \n"
154
+
155
+ // q8 = in[4]/[12] * kC1 >> 16
156
+ "vshr.s16 q8, q8, #1 \n"
157
+
158
+ // Add {in[4], in[12]} back after the multiplication.
159
+ "vqadd.s16 q8, q2, q8 \n"
160
+
161
+ // d20 = c = in[4]*kC2 - in[12]*kC1
162
+ // d21 = d = in[4]*kC1 + in[12]*kC2
163
+ "vqsub.s16 d20, d18, d17 \n"
164
+ "vqadd.s16 d21, d19, d16 \n"
165
+
166
+ // d2 = tmp[0] = a + d
167
+ // d3 = tmp[1] = b + c
168
+ // d4 = tmp[2] = b - c
169
+ // d5 = tmp[3] = a - d
170
+ "vqadd.s16 d2, d22, d21 \n"
171
+ "vqadd.s16 d3, d23, d20 \n"
172
+ "vqsub.s16 d4, d23, d20 \n"
173
+ "vqsub.s16 d5, d22, d21 \n"
174
+
175
+ "vzip.16 q1, q2 \n"
176
+ "vzip.16 q1, q2 \n"
177
+
178
+ "vswp d3, d4 \n"
179
+
180
+ // q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16
181
+ // q9 = {tmp[4], tmp[12]} * kC2 >> 16
182
+ "vqdmulh.s16 q8, q2, d0[0] \n"
183
+ "vqdmulh.s16 q9, q2, d0[1] \n"
184
+
185
+ // d22 = a = tmp[0] + tmp[8]
186
+ // d23 = b = tmp[0] - tmp[8]
187
+ "vqadd.s16 d22, d2, d3 \n"
188
+ "vqsub.s16 d23, d2, d3 \n"
189
+
190
+ "vshr.s16 q8, q8, #1 \n"
191
+ "vqadd.s16 q8, q2, q8 \n"
192
+
193
+ // d20 = c = in[4]*kC2 - in[12]*kC1
194
+ // d21 = d = in[4]*kC1 + in[12]*kC2
195
+ "vqsub.s16 d20, d18, d17 \n"
196
+ "vqadd.s16 d21, d19, d16 \n"
197
+
198
+ // d2 = tmp[0] = a + d
199
+ // d3 = tmp[1] = b + c
200
+ // d4 = tmp[2] = b - c
201
+ // d5 = tmp[3] = a - d
202
+ "vqadd.s16 d2, d22, d21 \n"
203
+ "vqadd.s16 d3, d23, d20 \n"
204
+ "vqsub.s16 d4, d23, d20 \n"
205
+ "vqsub.s16 d5, d22, d21 \n"
206
+
207
+ "vld1.32 d6[0], [%[ref]], %[kBPS] \n"
208
+ "vld1.32 d6[1], [%[ref]], %[kBPS] \n"
209
+ "vld1.32 d7[0], [%[ref]], %[kBPS] \n"
210
+ "vld1.32 d7[1], [%[ref]], %[kBPS] \n"
211
+
212
+ "sub %[ref], %[ref], %[kBPS], lsl #2 \n"
213
+
214
+ // (val) + 4 >> 3
215
+ "vrshr.s16 d2, d2, #3 \n"
216
+ "vrshr.s16 d3, d3, #3 \n"
217
+ "vrshr.s16 d4, d4, #3 \n"
218
+ "vrshr.s16 d5, d5, #3 \n"
219
+
220
+ "vzip.16 q1, q2 \n"
221
+ "vzip.16 q1, q2 \n"
222
+
223
+ // Must accumulate before saturating
224
+ "vmovl.u8 q8, d6 \n"
225
+ "vmovl.u8 q9, d7 \n"
226
+
227
+ "vqadd.s16 q1, q1, q8 \n"
228
+ "vqadd.s16 q2, q2, q9 \n"
229
+
230
+ "vqmovun.s16 d0, q1 \n"
231
+ "vqmovun.s16 d1, q2 \n"
232
+
233
+ "vst1.32 d0[0], [%[dst]], %[kBPS] \n"
234
+ "vst1.32 d0[1], [%[dst]], %[kBPS] \n"
235
+ "vst1.32 d1[0], [%[dst]], %[kBPS] \n"
236
+ "vst1.32 d1[1], [%[dst]] \n"
237
+
238
+ : [in] "+r"(in), [dst] "+r"(dst) // modified registers
239
+ : [kBPS] "r"(kBPS), [kC1C2] "r"(kC1C2), [ref] "r"(ref) // constants
240
+ : "memory", "q0", "q1", "q2", "q8", "q9", "q10", "q11" // clobbered
241
+ );
242
+ }
243
+
244
+ #endif // WEBP_USE_INTRINSICS
245
+
246
+ static void ITransform(const uint8_t* ref,
247
+ const int16_t* in, uint8_t* dst, int do_two) {
248
+ ITransformOne(ref, in, dst);
249
+ if (do_two) {
250
+ ITransformOne(ref + 4, in + 16, dst + 4);
251
+ }
252
+ }
253
+
254
+ // Load all 4x4 pixels into a single uint8x16_t variable.
255
+ static uint8x16_t Load4x4(const uint8_t* src) {
256
+ uint32x4_t out = vdupq_n_u32(0);
257
+ out = vld1q_lane_u32((const uint32_t*)(src + 0 * BPS), out, 0);
258
+ out = vld1q_lane_u32((const uint32_t*)(src + 1 * BPS), out, 1);
259
+ out = vld1q_lane_u32((const uint32_t*)(src + 2 * BPS), out, 2);
260
+ out = vld1q_lane_u32((const uint32_t*)(src + 3 * BPS), out, 3);
261
+ return vreinterpretq_u8_u32(out);
262
+ }
263
+
264
+ // Forward transform.
265
+
266
+ #if defined(WEBP_USE_INTRINSICS)
267
+
268
+ static WEBP_INLINE void Transpose4x4_S16(const int16x4_t A, const int16x4_t B,
269
+ const int16x4_t C, const int16x4_t D,
270
+ int16x8_t* const out01,
271
+ int16x8_t* const out32) {
272
+ const int16x4x2_t AB = vtrn_s16(A, B);
273
+ const int16x4x2_t CD = vtrn_s16(C, D);
274
+ const int32x2x2_t tmp02 = vtrn_s32(vreinterpret_s32_s16(AB.val[0]),
275
+ vreinterpret_s32_s16(CD.val[0]));
276
+ const int32x2x2_t tmp13 = vtrn_s32(vreinterpret_s32_s16(AB.val[1]),
277
+ vreinterpret_s32_s16(CD.val[1]));
278
+ *out01 = vreinterpretq_s16_s64(
279
+ vcombine_s64(vreinterpret_s64_s32(tmp02.val[0]),
280
+ vreinterpret_s64_s32(tmp13.val[0])));
281
+ *out32 = vreinterpretq_s16_s64(
282
+ vcombine_s64(vreinterpret_s64_s32(tmp13.val[1]),
283
+ vreinterpret_s64_s32(tmp02.val[1])));
284
+ }
285
+
286
+ static WEBP_INLINE int16x8_t DiffU8ToS16(const uint8x8_t a,
287
+ const uint8x8_t b) {
288
+ return vreinterpretq_s16_u16(vsubl_u8(a, b));
289
+ }
290
+
291
+ static void FTransform(const uint8_t* src, const uint8_t* ref,
292
+ int16_t* out) {
293
+ int16x8_t d0d1, d3d2; // working 4x4 int16 variables
294
+ {
295
+ const uint8x16_t S0 = Load4x4(src);
296
+ const uint8x16_t R0 = Load4x4(ref);
297
+ const int16x8_t D0D1 = DiffU8ToS16(vget_low_u8(S0), vget_low_u8(R0));
298
+ const int16x8_t D2D3 = DiffU8ToS16(vget_high_u8(S0), vget_high_u8(R0));
299
+ const int16x4_t D0 = vget_low_s16(D0D1);
300
+ const int16x4_t D1 = vget_high_s16(D0D1);
301
+ const int16x4_t D2 = vget_low_s16(D2D3);
302
+ const int16x4_t D3 = vget_high_s16(D2D3);
303
+ Transpose4x4_S16(D0, D1, D2, D3, &d0d1, &d3d2);
304
+ }
305
+ { // 1rst pass
306
+ const int32x4_t kCst937 = vdupq_n_s32(937);
307
+ const int32x4_t kCst1812 = vdupq_n_s32(1812);
308
+ const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2); // d0+d3 | d1+d2 (=a0|a1)
309
+ const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2); // d0-d3 | d1-d2 (=a3|a2)
310
+ const int16x8_t a0a1_2 = vshlq_n_s16(a0a1, 3);
311
+ const int16x4_t tmp0 = vadd_s16(vget_low_s16(a0a1_2),
312
+ vget_high_s16(a0a1_2));
313
+ const int16x4_t tmp2 = vsub_s16(vget_low_s16(a0a1_2),
314
+ vget_high_s16(a0a1_2));
315
+ const int32x4_t a3_2217 = vmull_n_s16(vget_low_s16(a3a2), 2217);
316
+ const int32x4_t a2_2217 = vmull_n_s16(vget_high_s16(a3a2), 2217);
317
+ const int32x4_t a2_p_a3 = vmlal_n_s16(a2_2217, vget_low_s16(a3a2), 5352);
318
+ const int32x4_t a3_m_a2 = vmlsl_n_s16(a3_2217, vget_high_s16(a3a2), 5352);
319
+ const int16x4_t tmp1 = vshrn_n_s32(vaddq_s32(a2_p_a3, kCst1812), 9);
320
+ const int16x4_t tmp3 = vshrn_n_s32(vaddq_s32(a3_m_a2, kCst937), 9);
321
+ Transpose4x4_S16(tmp0, tmp1, tmp2, tmp3, &d0d1, &d3d2);
322
+ }
323
+ { // 2nd pass
324
+ // the (1<<16) addition is for the replacement: a3!=0 <-> 1-(a3==0)
325
+ const int32x4_t kCst12000 = vdupq_n_s32(12000 + (1 << 16));
326
+ const int32x4_t kCst51000 = vdupq_n_s32(51000);
327
+ const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2); // d0+d3 | d1+d2 (=a0|a1)
328
+ const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2); // d0-d3 | d1-d2 (=a3|a2)
329
+ const int16x4_t a0_k7 = vadd_s16(vget_low_s16(a0a1), vdup_n_s16(7));
330
+ const int16x4_t out0 = vshr_n_s16(vadd_s16(a0_k7, vget_high_s16(a0a1)), 4);
331
+ const int16x4_t out2 = vshr_n_s16(vsub_s16(a0_k7, vget_high_s16(a0a1)), 4);
332
+ const int32x4_t a3_2217 = vmull_n_s16(vget_low_s16(a3a2), 2217);
333
+ const int32x4_t a2_2217 = vmull_n_s16(vget_high_s16(a3a2), 2217);
334
+ const int32x4_t a2_p_a3 = vmlal_n_s16(a2_2217, vget_low_s16(a3a2), 5352);
335
+ const int32x4_t a3_m_a2 = vmlsl_n_s16(a3_2217, vget_high_s16(a3a2), 5352);
336
+ const int16x4_t tmp1 = vaddhn_s32(a2_p_a3, kCst12000);
337
+ const int16x4_t out3 = vaddhn_s32(a3_m_a2, kCst51000);
338
+ const int16x4_t a3_eq_0 =
339
+ vreinterpret_s16_u16(vceq_s16(vget_low_s16(a3a2), vdup_n_s16(0)));
340
+ const int16x4_t out1 = vadd_s16(tmp1, a3_eq_0);
341
+ vst1_s16(out + 0, out0);
342
+ vst1_s16(out + 4, out1);
343
+ vst1_s16(out + 8, out2);
344
+ vst1_s16(out + 12, out3);
345
+ }
346
+ }
347
+
348
+ #else
349
+
350
+ // adapted from vp8/encoder/arm/neon/shortfdct_neon.asm
351
+ static const int16_t kCoeff16[] = {
352
+ 5352, 5352, 5352, 5352, 2217, 2217, 2217, 2217
353
+ };
354
+ static const int32_t kCoeff32[] = {
355
+ 1812, 1812, 1812, 1812,
356
+ 937, 937, 937, 937,
357
+ 12000, 12000, 12000, 12000,
358
+ 51000, 51000, 51000, 51000
359
+ };
360
+
361
+ static void FTransform(const uint8_t* src, const uint8_t* ref,
362
+ int16_t* out) {
363
+ const int kBPS = BPS;
364
+ const uint8_t* src_ptr = src;
365
+ const uint8_t* ref_ptr = ref;
366
+ const int16_t* coeff16 = kCoeff16;
367
+ const int32_t* coeff32 = kCoeff32;
368
+
369
+ __asm__ volatile (
370
+ // load src into q4, q5 in high half
371
+ "vld1.8 {d8}, [%[src_ptr]], %[kBPS] \n"
372
+ "vld1.8 {d10}, [%[src_ptr]], %[kBPS] \n"
373
+ "vld1.8 {d9}, [%[src_ptr]], %[kBPS] \n"
374
+ "vld1.8 {d11}, [%[src_ptr]] \n"
375
+
376
+ // load ref into q6, q7 in high half
377
+ "vld1.8 {d12}, [%[ref_ptr]], %[kBPS] \n"
378
+ "vld1.8 {d14}, [%[ref_ptr]], %[kBPS] \n"
379
+ "vld1.8 {d13}, [%[ref_ptr]], %[kBPS] \n"
380
+ "vld1.8 {d15}, [%[ref_ptr]] \n"
381
+
382
+ // Pack the high values in to q4 and q6
383
+ "vtrn.32 q4, q5 \n"
384
+ "vtrn.32 q6, q7 \n"
385
+
386
+ // d[0-3] = src - ref
387
+ "vsubl.u8 q0, d8, d12 \n"
388
+ "vsubl.u8 q1, d9, d13 \n"
389
+
390
+ // load coeff16 into q8(d16=5352, d17=2217)
391
+ "vld1.16 {q8}, [%[coeff16]] \n"
392
+
393
+ // load coeff32 high half into q9 = 1812, q10 = 937
394
+ "vld1.32 {q9, q10}, [%[coeff32]]! \n"
395
+
396
+ // load coeff32 low half into q11=12000, q12=51000
397
+ "vld1.32 {q11,q12}, [%[coeff32]] \n"
398
+
399
+ // part 1
400
+ // Transpose. Register dN is the same as dN in C
401
+ "vtrn.32 d0, d2 \n"
402
+ "vtrn.32 d1, d3 \n"
403
+ "vtrn.16 d0, d1 \n"
404
+ "vtrn.16 d2, d3 \n"
405
+
406
+ "vadd.s16 d4, d0, d3 \n" // a0 = d0 + d3
407
+ "vadd.s16 d5, d1, d2 \n" // a1 = d1 + d2
408
+ "vsub.s16 d6, d1, d2 \n" // a2 = d1 - d2
409
+ "vsub.s16 d7, d0, d3 \n" // a3 = d0 - d3
410
+
411
+ "vadd.s16 d0, d4, d5 \n" // a0 + a1
412
+ "vshl.s16 d0, d0, #3 \n" // temp[0+i*4] = (a0+a1) << 3
413
+ "vsub.s16 d2, d4, d5 \n" // a0 - a1
414
+ "vshl.s16 d2, d2, #3 \n" // (temp[2+i*4] = (a0-a1) << 3
415
+
416
+ "vmlal.s16 q9, d7, d16 \n" // a3*5352 + 1812
417
+ "vmlal.s16 q10, d7, d17 \n" // a3*2217 + 937
418
+ "vmlal.s16 q9, d6, d17 \n" // a2*2217 + a3*5352 + 1812
419
+ "vmlsl.s16 q10, d6, d16 \n" // a3*2217 + 937 - a2*5352
420
+
421
+ // temp[1+i*4] = (d2*2217 + d3*5352 + 1812) >> 9
422
+ // temp[3+i*4] = (d3*2217 + 937 - d2*5352) >> 9
423
+ "vshrn.s32 d1, q9, #9 \n"
424
+ "vshrn.s32 d3, q10, #9 \n"
425
+
426
+ // part 2
427
+ // transpose d0=ip[0], d1=ip[4], d2=ip[8], d3=ip[12]
428
+ "vtrn.32 d0, d2 \n"
429
+ "vtrn.32 d1, d3 \n"
430
+ "vtrn.16 d0, d1 \n"
431
+ "vtrn.16 d2, d3 \n"
432
+
433
+ "vmov.s16 d26, #7 \n"
434
+
435
+ "vadd.s16 d4, d0, d3 \n" // a1 = ip[0] + ip[12]
436
+ "vadd.s16 d5, d1, d2 \n" // b1 = ip[4] + ip[8]
437
+ "vsub.s16 d6, d1, d2 \n" // c1 = ip[4] - ip[8]
438
+ "vadd.s16 d4, d4, d26 \n" // a1 + 7
439
+ "vsub.s16 d7, d0, d3 \n" // d1 = ip[0] - ip[12]
440
+
441
+ "vadd.s16 d0, d4, d5 \n" // op[0] = a1 + b1 + 7
442
+ "vsub.s16 d2, d4, d5 \n" // op[8] = a1 - b1 + 7
443
+
444
+ "vmlal.s16 q11, d7, d16 \n" // d1*5352 + 12000
445
+ "vmlal.s16 q12, d7, d17 \n" // d1*2217 + 51000
446
+
447
+ "vceq.s16 d4, d7, #0 \n"
448
+
449
+ "vshr.s16 d0, d0, #4 \n"
450
+ "vshr.s16 d2, d2, #4 \n"
451
+
452
+ "vmlal.s16 q11, d6, d17 \n" // c1*2217 + d1*5352 + 12000
453
+ "vmlsl.s16 q12, d6, d16 \n" // d1*2217 - c1*5352 + 51000
454
+
455
+ "vmvn d4, d4 \n" // !(d1 == 0)
456
+ // op[4] = (c1*2217 + d1*5352 + 12000)>>16
457
+ "vshrn.s32 d1, q11, #16 \n"
458
+ // op[4] += (d1!=0)
459
+ "vsub.s16 d1, d1, d4 \n"
460
+ // op[12]= (d1*2217 - c1*5352 + 51000)>>16
461
+ "vshrn.s32 d3, q12, #16 \n"
462
+
463
+ // set result to out array
464
+ "vst1.16 {q0, q1}, [%[out]] \n"
465
+ : [src_ptr] "+r"(src_ptr), [ref_ptr] "+r"(ref_ptr),
466
+ [coeff32] "+r"(coeff32) // modified registers
467
+ : [kBPS] "r"(kBPS), [coeff16] "r"(coeff16),
468
+ [out] "r"(out) // constants
469
+ : "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9",
470
+ "q10", "q11", "q12", "q13" // clobbered
471
+ );
472
+ }
473
+
474
+ #endif
475
+
476
+ #define LOAD_LANE_16b(VALUE, LANE) do { \
477
+ (VALUE) = vld1_lane_s16(src, (VALUE), (LANE)); \
478
+ src += stride; \
479
+ } while (0)
480
+
481
+ static void FTransformWHT(const int16_t* src, int16_t* out) {
482
+ const int stride = 16;
483
+ const int16x4_t zero = vdup_n_s16(0);
484
+ int32x4x4_t tmp0;
485
+ int16x4x4_t in;
486
+ INIT_VECTOR4(in, zero, zero, zero, zero);
487
+ LOAD_LANE_16b(in.val[0], 0);
488
+ LOAD_LANE_16b(in.val[1], 0);
489
+ LOAD_LANE_16b(in.val[2], 0);
490
+ LOAD_LANE_16b(in.val[3], 0);
491
+ LOAD_LANE_16b(in.val[0], 1);
492
+ LOAD_LANE_16b(in.val[1], 1);
493
+ LOAD_LANE_16b(in.val[2], 1);
494
+ LOAD_LANE_16b(in.val[3], 1);
495
+ LOAD_LANE_16b(in.val[0], 2);
496
+ LOAD_LANE_16b(in.val[1], 2);
497
+ LOAD_LANE_16b(in.val[2], 2);
498
+ LOAD_LANE_16b(in.val[3], 2);
499
+ LOAD_LANE_16b(in.val[0], 3);
500
+ LOAD_LANE_16b(in.val[1], 3);
501
+ LOAD_LANE_16b(in.val[2], 3);
502
+ LOAD_LANE_16b(in.val[3], 3);
503
+
504
+ {
505
+ // a0 = in[0 * 16] + in[2 * 16]
506
+ // a1 = in[1 * 16] + in[3 * 16]
507
+ // a2 = in[1 * 16] - in[3 * 16]
508
+ // a3 = in[0 * 16] - in[2 * 16]
509
+ const int32x4_t a0 = vaddl_s16(in.val[0], in.val[2]);
510
+ const int32x4_t a1 = vaddl_s16(in.val[1], in.val[3]);
511
+ const int32x4_t a2 = vsubl_s16(in.val[1], in.val[3]);
512
+ const int32x4_t a3 = vsubl_s16(in.val[0], in.val[2]);
513
+ tmp0.val[0] = vaddq_s32(a0, a1);
514
+ tmp0.val[1] = vaddq_s32(a3, a2);
515
+ tmp0.val[2] = vsubq_s32(a3, a2);
516
+ tmp0.val[3] = vsubq_s32(a0, a1);
517
+ }
518
+ {
519
+ const int32x4x4_t tmp1 = Transpose4x4(tmp0);
520
+ // a0 = tmp[0 + i] + tmp[ 8 + i]
521
+ // a1 = tmp[4 + i] + tmp[12 + i]
522
+ // a2 = tmp[4 + i] - tmp[12 + i]
523
+ // a3 = tmp[0 + i] - tmp[ 8 + i]
524
+ const int32x4_t a0 = vaddq_s32(tmp1.val[0], tmp1.val[2]);
525
+ const int32x4_t a1 = vaddq_s32(tmp1.val[1], tmp1.val[3]);
526
+ const int32x4_t a2 = vsubq_s32(tmp1.val[1], tmp1.val[3]);
527
+ const int32x4_t a3 = vsubq_s32(tmp1.val[0], tmp1.val[2]);
528
+ const int32x4_t b0 = vhaddq_s32(a0, a1); // (a0 + a1) >> 1
529
+ const int32x4_t b1 = vhaddq_s32(a3, a2); // (a3 + a2) >> 1
530
+ const int32x4_t b2 = vhsubq_s32(a3, a2); // (a3 - a2) >> 1
531
+ const int32x4_t b3 = vhsubq_s32(a0, a1); // (a0 - a1) >> 1
532
+ const int16x4_t out0 = vmovn_s32(b0);
533
+ const int16x4_t out1 = vmovn_s32(b1);
534
+ const int16x4_t out2 = vmovn_s32(b2);
535
+ const int16x4_t out3 = vmovn_s32(b3);
536
+
537
+ vst1_s16(out + 0, out0);
538
+ vst1_s16(out + 4, out1);
539
+ vst1_s16(out + 8, out2);
540
+ vst1_s16(out + 12, out3);
541
+ }
542
+ }
543
+ #undef LOAD_LANE_16b
544
+
545
+ //------------------------------------------------------------------------------
546
+ // Texture distortion
547
+ //
548
+ // We try to match the spectral content (weighted) between source and
549
+ // reconstructed samples.
550
+
551
+ // a 0123, b 0123
552
+ // a 4567, b 4567
553
+ // a 89ab, b 89ab
554
+ // a cdef, b cdef
555
+ //
556
+ // transpose
557
+ //
558
+ // a 048c, b 048c
559
+ // a 159d, b 159d
560
+ // a 26ae, b 26ae
561
+ // a 37bf, b 37bf
562
+ //
563
+ static WEBP_INLINE uint8x8x4_t DistoTranspose4x4U8(uint8x8x4_t d4_in) {
564
+ const uint8x8x2_t d2_tmp0 = vtrn_u8(d4_in.val[0], d4_in.val[1]);
565
+ const uint8x8x2_t d2_tmp1 = vtrn_u8(d4_in.val[2], d4_in.val[3]);
566
+ const uint16x4x2_t d2_tmp2 = vtrn_u16(vreinterpret_u16_u8(d2_tmp0.val[0]),
567
+ vreinterpret_u16_u8(d2_tmp1.val[0]));
568
+ const uint16x4x2_t d2_tmp3 = vtrn_u16(vreinterpret_u16_u8(d2_tmp0.val[1]),
569
+ vreinterpret_u16_u8(d2_tmp1.val[1]));
570
+
571
+ d4_in.val[0] = vreinterpret_u8_u16(d2_tmp2.val[0]);
572
+ d4_in.val[2] = vreinterpret_u8_u16(d2_tmp2.val[1]);
573
+ d4_in.val[1] = vreinterpret_u8_u16(d2_tmp3.val[0]);
574
+ d4_in.val[3] = vreinterpret_u8_u16(d2_tmp3.val[1]);
575
+ return d4_in;
576
+ }
577
+
578
+ static WEBP_INLINE int16x8x4_t DistoTranspose4x4S16(int16x8x4_t q4_in) {
579
+ const int16x8x2_t q2_tmp0 = vtrnq_s16(q4_in.val[0], q4_in.val[1]);
580
+ const int16x8x2_t q2_tmp1 = vtrnq_s16(q4_in.val[2], q4_in.val[3]);
581
+ const int32x4x2_t q2_tmp2 = vtrnq_s32(vreinterpretq_s32_s16(q2_tmp0.val[0]),
582
+ vreinterpretq_s32_s16(q2_tmp1.val[0]));
583
+ const int32x4x2_t q2_tmp3 = vtrnq_s32(vreinterpretq_s32_s16(q2_tmp0.val[1]),
584
+ vreinterpretq_s32_s16(q2_tmp1.val[1]));
585
+ q4_in.val[0] = vreinterpretq_s16_s32(q2_tmp2.val[0]);
586
+ q4_in.val[2] = vreinterpretq_s16_s32(q2_tmp2.val[1]);
587
+ q4_in.val[1] = vreinterpretq_s16_s32(q2_tmp3.val[0]);
588
+ q4_in.val[3] = vreinterpretq_s16_s32(q2_tmp3.val[1]);
589
+ return q4_in;
590
+ }
591
+
592
+ static WEBP_INLINE int16x8x4_t DistoHorizontalPass(const uint8x8x4_t d4_in) {
593
+ // {a0, a1} = {in[0] + in[2], in[1] + in[3]}
594
+ // {a3, a2} = {in[0] - in[2], in[1] - in[3]}
595
+ const int16x8_t q_a0 = vreinterpretq_s16_u16(vaddl_u8(d4_in.val[0],
596
+ d4_in.val[2]));
597
+ const int16x8_t q_a1 = vreinterpretq_s16_u16(vaddl_u8(d4_in.val[1],
598
+ d4_in.val[3]));
599
+ const int16x8_t q_a3 = vreinterpretq_s16_u16(vsubl_u8(d4_in.val[0],
600
+ d4_in.val[2]));
601
+ const int16x8_t q_a2 = vreinterpretq_s16_u16(vsubl_u8(d4_in.val[1],
602
+ d4_in.val[3]));
603
+ int16x8x4_t q4_out;
604
+ // tmp[0] = a0 + a1
605
+ // tmp[1] = a3 + a2
606
+ // tmp[2] = a3 - a2
607
+ // tmp[3] = a0 - a1
608
+ INIT_VECTOR4(q4_out,
609
+ vaddq_s16(q_a0, q_a1), vaddq_s16(q_a3, q_a2),
610
+ vsubq_s16(q_a3, q_a2), vsubq_s16(q_a0, q_a1));
611
+ return q4_out;
612
+ }
613
+
614
+ static WEBP_INLINE int16x8x4_t DistoVerticalPass(int16x8x4_t q4_in) {
615
+ const int16x8_t q_a0 = vaddq_s16(q4_in.val[0], q4_in.val[2]);
616
+ const int16x8_t q_a1 = vaddq_s16(q4_in.val[1], q4_in.val[3]);
617
+ const int16x8_t q_a2 = vsubq_s16(q4_in.val[1], q4_in.val[3]);
618
+ const int16x8_t q_a3 = vsubq_s16(q4_in.val[0], q4_in.val[2]);
619
+
620
+ q4_in.val[0] = vaddq_s16(q_a0, q_a1);
621
+ q4_in.val[1] = vaddq_s16(q_a3, q_a2);
622
+ q4_in.val[2] = vabdq_s16(q_a3, q_a2);
623
+ q4_in.val[3] = vabdq_s16(q_a0, q_a1);
624
+ q4_in.val[0] = vabsq_s16(q4_in.val[0]);
625
+ q4_in.val[1] = vabsq_s16(q4_in.val[1]);
626
+ return q4_in;
627
+ }
628
+
629
+ static WEBP_INLINE int16x4x4_t DistoLoadW(const uint16_t* w) {
630
+ const uint16x8_t q_w07 = vld1q_u16(&w[0]);
631
+ const uint16x8_t q_w8f = vld1q_u16(&w[8]);
632
+ int16x4x4_t d4_w;
633
+ INIT_VECTOR4(d4_w,
634
+ vget_low_s16(vreinterpretq_s16_u16(q_w07)),
635
+ vget_high_s16(vreinterpretq_s16_u16(q_w07)),
636
+ vget_low_s16(vreinterpretq_s16_u16(q_w8f)),
637
+ vget_high_s16(vreinterpretq_s16_u16(q_w8f)));
638
+ return d4_w;
639
+ }
640
+
641
+ static WEBP_INLINE int32x2_t DistoSum(const int16x8x4_t q4_in,
642
+ const int16x4x4_t d4_w) {
643
+ int32x2_t d_sum;
644
+ // sum += w[ 0] * abs(b0);
645
+ // sum += w[ 4] * abs(b1);
646
+ // sum += w[ 8] * abs(b2);
647
+ // sum += w[12] * abs(b3);
648
+ int32x4_t q_sum0 = vmull_s16(d4_w.val[0], vget_low_s16(q4_in.val[0]));
649
+ int32x4_t q_sum1 = vmull_s16(d4_w.val[1], vget_low_s16(q4_in.val[1]));
650
+ int32x4_t q_sum2 = vmull_s16(d4_w.val[2], vget_low_s16(q4_in.val[2]));
651
+ int32x4_t q_sum3 = vmull_s16(d4_w.val[3], vget_low_s16(q4_in.val[3]));
652
+ q_sum0 = vmlsl_s16(q_sum0, d4_w.val[0], vget_high_s16(q4_in.val[0]));
653
+ q_sum1 = vmlsl_s16(q_sum1, d4_w.val[1], vget_high_s16(q4_in.val[1]));
654
+ q_sum2 = vmlsl_s16(q_sum2, d4_w.val[2], vget_high_s16(q4_in.val[2]));
655
+ q_sum3 = vmlsl_s16(q_sum3, d4_w.val[3], vget_high_s16(q4_in.val[3]));
656
+
657
+ q_sum0 = vaddq_s32(q_sum0, q_sum1);
658
+ q_sum2 = vaddq_s32(q_sum2, q_sum3);
659
+ q_sum2 = vaddq_s32(q_sum0, q_sum2);
660
+ d_sum = vpadd_s32(vget_low_s32(q_sum2), vget_high_s32(q_sum2));
661
+ d_sum = vpadd_s32(d_sum, d_sum);
662
+ return d_sum;
663
+ }
664
+
665
+ #define LOAD_LANE_32b(src, VALUE, LANE) \
666
+ (VALUE) = vld1_lane_u32((const uint32_t*)(src), (VALUE), (LANE))
667
+
668
+ // Hadamard transform
669
+ // Returns the weighted sum of the absolute value of transformed coefficients.
670
+ static int Disto4x4(const uint8_t* const a, const uint8_t* const b,
671
+ const uint16_t* const w) {
672
+ uint32x2_t d_in_ab_0123 = vdup_n_u32(0);
673
+ uint32x2_t d_in_ab_4567 = vdup_n_u32(0);
674
+ uint32x2_t d_in_ab_89ab = vdup_n_u32(0);
675
+ uint32x2_t d_in_ab_cdef = vdup_n_u32(0);
676
+ uint8x8x4_t d4_in;
677
+
678
+ // load data a, b
679
+ LOAD_LANE_32b(a + 0 * BPS, d_in_ab_0123, 0);
680
+ LOAD_LANE_32b(a + 1 * BPS, d_in_ab_4567, 0);
681
+ LOAD_LANE_32b(a + 2 * BPS, d_in_ab_89ab, 0);
682
+ LOAD_LANE_32b(a + 3 * BPS, d_in_ab_cdef, 0);
683
+ LOAD_LANE_32b(b + 0 * BPS, d_in_ab_0123, 1);
684
+ LOAD_LANE_32b(b + 1 * BPS, d_in_ab_4567, 1);
685
+ LOAD_LANE_32b(b + 2 * BPS, d_in_ab_89ab, 1);
686
+ LOAD_LANE_32b(b + 3 * BPS, d_in_ab_cdef, 1);
687
+ INIT_VECTOR4(d4_in,
688
+ vreinterpret_u8_u32(d_in_ab_0123),
689
+ vreinterpret_u8_u32(d_in_ab_4567),
690
+ vreinterpret_u8_u32(d_in_ab_89ab),
691
+ vreinterpret_u8_u32(d_in_ab_cdef));
692
+
693
+ {
694
+ // horizontal pass
695
+ const uint8x8x4_t d4_t = DistoTranspose4x4U8(d4_in);
696
+ const int16x8x4_t q4_h = DistoHorizontalPass(d4_t);
697
+ const int16x4x4_t d4_w = DistoLoadW(w);
698
+ // vertical pass
699
+ const int16x8x4_t q4_t = DistoTranspose4x4S16(q4_h);
700
+ const int16x8x4_t q4_v = DistoVerticalPass(q4_t);
701
+ int32x2_t d_sum = DistoSum(q4_v, d4_w);
702
+
703
+ // abs(sum2 - sum1) >> 5
704
+ d_sum = vabs_s32(d_sum);
705
+ d_sum = vshr_n_s32(d_sum, 5);
706
+ return vget_lane_s32(d_sum, 0);
707
+ }
708
+ }
709
+ #undef LOAD_LANE_32b
710
+
711
+ static int Disto16x16(const uint8_t* const a, const uint8_t* const b,
712
+ const uint16_t* const w) {
713
+ int D = 0;
714
+ int x, y;
715
+ for (y = 0; y < 16 * BPS; y += 4 * BPS) {
716
+ for (x = 0; x < 16; x += 4) {
717
+ D += Disto4x4(a + x + y, b + x + y, w);
718
+ }
719
+ }
720
+ return D;
721
+ }
722
+
723
+ //------------------------------------------------------------------------------
724
+
725
+ static void CollectHistogram(const uint8_t* ref, const uint8_t* pred,
726
+ int start_block, int end_block,
727
+ VP8Histogram* const histo) {
728
+ const uint16x8_t max_coeff_thresh = vdupq_n_u16(MAX_COEFF_THRESH);
729
+ int j;
730
+ int distribution[MAX_COEFF_THRESH + 1] = { 0 };
731
+ for (j = start_block; j < end_block; ++j) {
732
+ int16_t out[16];
733
+ FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out);
734
+ {
735
+ int k;
736
+ const int16x8_t a0 = vld1q_s16(out + 0);
737
+ const int16x8_t b0 = vld1q_s16(out + 8);
738
+ const uint16x8_t a1 = vreinterpretq_u16_s16(vabsq_s16(a0));
739
+ const uint16x8_t b1 = vreinterpretq_u16_s16(vabsq_s16(b0));
740
+ const uint16x8_t a2 = vshrq_n_u16(a1, 3);
741
+ const uint16x8_t b2 = vshrq_n_u16(b1, 3);
742
+ const uint16x8_t a3 = vminq_u16(a2, max_coeff_thresh);
743
+ const uint16x8_t b3 = vminq_u16(b2, max_coeff_thresh);
744
+ vst1q_s16(out + 0, vreinterpretq_s16_u16(a3));
745
+ vst1q_s16(out + 8, vreinterpretq_s16_u16(b3));
746
+ // Convert coefficients to bin.
747
+ for (k = 0; k < 16; ++k) {
748
+ ++distribution[out[k]];
749
+ }
750
+ }
751
+ }
752
+ VP8LSetHistogramData(distribution, histo);
753
+ }
754
+
755
+ //------------------------------------------------------------------------------
756
+
757
+ static WEBP_INLINE void AccumulateSSE16(const uint8_t* const a,
758
+ const uint8_t* const b,
759
+ uint32x4_t* const sum) {
760
+ const uint8x16_t a0 = vld1q_u8(a);
761
+ const uint8x16_t b0 = vld1q_u8(b);
762
+ const uint8x16_t abs_diff = vabdq_u8(a0, b0);
763
+ uint16x8_t prod = vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff));
764
+ prod = vmlal_u8(prod, vget_high_u8(abs_diff), vget_high_u8(abs_diff));
765
+ *sum = vpadalq_u16(*sum, prod); // pair-wise add and accumulate
766
+ }
767
+
768
+ // Horizontal sum of all four uint32_t values in 'sum'.
769
+ static int SumToInt(uint32x4_t sum) {
770
+ const uint64x2_t sum2 = vpaddlq_u32(sum);
771
+ const uint64_t sum3 = vgetq_lane_u64(sum2, 0) + vgetq_lane_u64(sum2, 1);
772
+ return (int)sum3;
773
+ }
774
+
775
+ static int SSE16x16(const uint8_t* a, const uint8_t* b) {
776
+ uint32x4_t sum = vdupq_n_u32(0);
777
+ int y;
778
+ for (y = 0; y < 16; ++y) {
779
+ AccumulateSSE16(a + y * BPS, b + y * BPS, &sum);
780
+ }
781
+ return SumToInt(sum);
782
+ }
783
+
784
+ static int SSE16x8(const uint8_t* a, const uint8_t* b) {
785
+ uint32x4_t sum = vdupq_n_u32(0);
786
+ int y;
787
+ for (y = 0; y < 8; ++y) {
788
+ AccumulateSSE16(a + y * BPS, b + y * BPS, &sum);
789
+ }
790
+ return SumToInt(sum);
791
+ }
792
+
793
+ static int SSE8x8(const uint8_t* a, const uint8_t* b) {
794
+ uint32x4_t sum = vdupq_n_u32(0);
795
+ int y;
796
+ for (y = 0; y < 8; ++y) {
797
+ const uint8x8_t a0 = vld1_u8(a + y * BPS);
798
+ const uint8x8_t b0 = vld1_u8(b + y * BPS);
799
+ const uint8x8_t abs_diff = vabd_u8(a0, b0);
800
+ const uint16x8_t prod = vmull_u8(abs_diff, abs_diff);
801
+ sum = vpadalq_u16(sum, prod);
802
+ }
803
+ return SumToInt(sum);
804
+ }
805
+
806
+ static int SSE4x4(const uint8_t* a, const uint8_t* b) {
807
+ const uint8x16_t a0 = Load4x4(a);
808
+ const uint8x16_t b0 = Load4x4(b);
809
+ const uint8x16_t abs_diff = vabdq_u8(a0, b0);
810
+ uint16x8_t prod = vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff));
811
+ prod = vmlal_u8(prod, vget_high_u8(abs_diff), vget_high_u8(abs_diff));
812
+ return SumToInt(vpaddlq_u16(prod));
813
+ }
814
+
815
+ //------------------------------------------------------------------------------
816
+
817
+ // Compilation with gcc-4.6.x is problematic for now.
818
+ #if !defined(WORK_AROUND_GCC)
819
+
820
+ static int16x8_t Quantize(int16_t* const in,
821
+ const VP8Matrix* const mtx, int offset) {
822
+ const uint16x8_t sharp = vld1q_u16(&mtx->sharpen_[offset]);
823
+ const uint16x8_t q = vld1q_u16(&mtx->q_[offset]);
824
+ const uint16x8_t iq = vld1q_u16(&mtx->iq_[offset]);
825
+ const uint32x4_t bias0 = vld1q_u32(&mtx->bias_[offset + 0]);
826
+ const uint32x4_t bias1 = vld1q_u32(&mtx->bias_[offset + 4]);
827
+
828
+ const int16x8_t a = vld1q_s16(in + offset); // in
829
+ const uint16x8_t b = vreinterpretq_u16_s16(vabsq_s16(a)); // coeff = abs(in)
830
+ const int16x8_t sign = vshrq_n_s16(a, 15); // sign
831
+ const uint16x8_t c = vaddq_u16(b, sharp); // + sharpen
832
+ const uint32x4_t m0 = vmull_u16(vget_low_u16(c), vget_low_u16(iq));
833
+ const uint32x4_t m1 = vmull_u16(vget_high_u16(c), vget_high_u16(iq));
834
+ const uint32x4_t m2 = vhaddq_u32(m0, bias0);
835
+ const uint32x4_t m3 = vhaddq_u32(m1, bias1); // (coeff * iQ + bias) >> 1
836
+ const uint16x8_t c0 = vcombine_u16(vshrn_n_u32(m2, 16),
837
+ vshrn_n_u32(m3, 16)); // QFIX=17 = 16+1
838
+ const uint16x8_t c1 = vminq_u16(c0, vdupq_n_u16(MAX_LEVEL));
839
+ const int16x8_t c2 = veorq_s16(vreinterpretq_s16_u16(c1), sign);
840
+ const int16x8_t c3 = vsubq_s16(c2, sign); // restore sign
841
+ const int16x8_t c4 = vmulq_s16(c3, vreinterpretq_s16_u16(q));
842
+ vst1q_s16(in + offset, c4);
843
+ assert(QFIX == 17); // this function can't work as is if QFIX != 16+1
844
+ return c3;
845
+ }
846
+
847
+ static const uint8_t kShuffles[4][8] = {
848
+ { 0, 1, 2, 3, 8, 9, 16, 17 },
849
+ { 10, 11, 4, 5, 6, 7, 12, 13 },
850
+ { 18, 19, 24, 25, 26, 27, 20, 21 },
851
+ { 14, 15, 22, 23, 28, 29, 30, 31 }
852
+ };
853
+
854
+ static int QuantizeBlock(int16_t in[16], int16_t out[16],
855
+ const VP8Matrix* const mtx) {
856
+ const int16x8_t out0 = Quantize(in, mtx, 0);
857
+ const int16x8_t out1 = Quantize(in, mtx, 8);
858
+ uint8x8x4_t shuffles;
859
+ // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
860
+ // non-standard versions there.
861
+ #if defined(__APPLE__) && defined(__aarch64__) && \
862
+ defined(__apple_build_version__) && (__apple_build_version__< 6020037)
863
+ uint8x16x2_t all_out;
864
+ INIT_VECTOR2(all_out, vreinterpretq_u8_s16(out0), vreinterpretq_u8_s16(out1));
865
+ INIT_VECTOR4(shuffles,
866
+ vtbl2q_u8(all_out, vld1_u8(kShuffles[0])),
867
+ vtbl2q_u8(all_out, vld1_u8(kShuffles[1])),
868
+ vtbl2q_u8(all_out, vld1_u8(kShuffles[2])),
869
+ vtbl2q_u8(all_out, vld1_u8(kShuffles[3])));
870
+ #else
871
+ uint8x8x4_t all_out;
872
+ INIT_VECTOR4(all_out,
873
+ vreinterpret_u8_s16(vget_low_s16(out0)),
874
+ vreinterpret_u8_s16(vget_high_s16(out0)),
875
+ vreinterpret_u8_s16(vget_low_s16(out1)),
876
+ vreinterpret_u8_s16(vget_high_s16(out1)));
877
+ INIT_VECTOR4(shuffles,
878
+ vtbl4_u8(all_out, vld1_u8(kShuffles[0])),
879
+ vtbl4_u8(all_out, vld1_u8(kShuffles[1])),
880
+ vtbl4_u8(all_out, vld1_u8(kShuffles[2])),
881
+ vtbl4_u8(all_out, vld1_u8(kShuffles[3])));
882
+ #endif
883
+ // Zigzag reordering
884
+ vst1_u8((uint8_t*)(out + 0), shuffles.val[0]);
885
+ vst1_u8((uint8_t*)(out + 4), shuffles.val[1]);
886
+ vst1_u8((uint8_t*)(out + 8), shuffles.val[2]);
887
+ vst1_u8((uint8_t*)(out + 12), shuffles.val[3]);
888
+ // test zeros
889
+ if (*(uint64_t*)(out + 0) != 0) return 1;
890
+ if (*(uint64_t*)(out + 4) != 0) return 1;
891
+ if (*(uint64_t*)(out + 8) != 0) return 1;
892
+ if (*(uint64_t*)(out + 12) != 0) return 1;
893
+ return 0;
894
+ }
895
+
896
+ static int Quantize2Blocks(int16_t in[32], int16_t out[32],
897
+ const VP8Matrix* const mtx) {
898
+ int nz;
899
+ nz = QuantizeBlock(in + 0 * 16, out + 0 * 16, mtx) << 0;
900
+ nz |= QuantizeBlock(in + 1 * 16, out + 1 * 16, mtx) << 1;
901
+ return nz;
902
+ }
903
+
904
+ #endif // !WORK_AROUND_GCC
905
+
906
+ #endif // WEBP_USE_NEON
907
+
908
+ //------------------------------------------------------------------------------
909
+ // Entry point
910
+
911
+ extern void VP8EncDspInitNEON(void);
912
+
913
+ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) {
914
+ #if defined(WEBP_USE_NEON)
915
+ VP8ITransform = ITransform;
916
+ VP8FTransform = FTransform;
917
+
918
+ VP8FTransformWHT = FTransformWHT;
919
+
920
+ VP8TDisto4x4 = Disto4x4;
921
+ VP8TDisto16x16 = Disto16x16;
922
+ VP8CollectHistogram = CollectHistogram;
923
+ VP8SSE16x16 = SSE16x16;
924
+ VP8SSE16x8 = SSE16x8;
925
+ VP8SSE8x8 = SSE8x8;
926
+ VP8SSE4x4 = SSE4x4;
927
+ #if !defined(WORK_AROUND_GCC)
928
+ VP8EncQuantizeBlock = QuantizeBlock;
929
+ VP8EncQuantize2Blocks = Quantize2Blocks;
930
+ #endif
931
+ #endif // WEBP_USE_NEON
932
+ }