rfreeimage 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,1870 @@
1
+ /*
2
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
3
+ * Copyright (c) 2002-2007, Professor Benoit Macq
4
+ * Copyright (c) 2001-2003, David Janssens
5
+ * Copyright (c) 2002-2003, Yannick Verschueren
6
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
7
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
8
+ * Copyright (c) 2006-2007, Parvatha Elangovan
9
+ * All rights reserved.
10
+ *
11
+ * Redistribution and use in source and binary forms, with or without
12
+ * modification, are permitted provided that the following conditions
13
+ * are met:
14
+ * 1. Redistributions of source code must retain the above copyright
15
+ * notice, this list of conditions and the following disclaimer.
16
+ * 2. Redistributions in binary form must reproduce the above copyright
17
+ * notice, this list of conditions and the following disclaimer in the
18
+ * documentation and/or other materials provided with the distribution.
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
21
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+ * POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+
33
+ #include "opj_includes.h"
34
+
35
+ /** @defgroup PI PI - Implementation of a packet iterator */
36
+ /*@{*/
37
+
38
+ /** @name Local static functions */
39
+ /*@{*/
40
+
41
+ /**
42
+ Get next packet in layer-resolution-component-precinct order.
43
+ @param pi packet iterator to modify
44
+ @return returns false if pi pointed to the last packet or else returns true
45
+ */
46
+ static OPJ_BOOL opj_pi_next_lrcp(opj_pi_iterator_t * pi);
47
+ /**
48
+ Get next packet in resolution-layer-component-precinct order.
49
+ @param pi packet iterator to modify
50
+ @return returns false if pi pointed to the last packet or else returns true
51
+ */
52
+ static OPJ_BOOL opj_pi_next_rlcp(opj_pi_iterator_t * pi);
53
+ /**
54
+ Get next packet in resolution-precinct-component-layer order.
55
+ @param pi packet iterator to modify
56
+ @return returns false if pi pointed to the last packet or else returns true
57
+ */
58
+ static OPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi);
59
+ /**
60
+ Get next packet in precinct-component-resolution-layer order.
61
+ @param pi packet iterator to modify
62
+ @return returns false if pi pointed to the last packet or else returns true
63
+ */
64
+ static OPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi);
65
+ /**
66
+ Get next packet in component-precinct-resolution-layer order.
67
+ @param pi packet iterator to modify
68
+ @return returns false if pi pointed to the last packet or else returns true
69
+ */
70
+ static OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi);
71
+
72
+ /**
73
+ * Updates the coding parameters if the encoding is used with Progression order changes and final (or cinema parameters are used).
74
+ *
75
+ * @param p_cp the coding parameters to modify
76
+ * @param p_tileno the tile index being concerned.
77
+ * @param p_tx0 X0 parameter for the tile
78
+ * @param p_tx1 X1 parameter for the tile
79
+ * @param p_ty0 Y0 parameter for the tile
80
+ * @param p_ty1 Y1 parameter for the tile
81
+ * @param p_max_prec the maximum precision for all the bands of the tile
82
+ * @param p_max_res the maximum number of resolutions for all the poc inside the tile.
83
+ * @param p_dx_min the minimum dx of all the components of all the resolutions for the tile.
84
+ * @param p_dy_min the minimum dy of all the components of all the resolutions for the tile.
85
+ */
86
+ static void opj_pi_update_encode_poc_and_final ( opj_cp_t *p_cp,
87
+ OPJ_UINT32 p_tileno,
88
+ OPJ_INT32 p_tx0,
89
+ OPJ_INT32 p_tx1,
90
+ OPJ_INT32 p_ty0,
91
+ OPJ_INT32 p_ty1,
92
+ OPJ_UINT32 p_max_prec,
93
+ OPJ_UINT32 p_max_res,
94
+ OPJ_UINT32 p_dx_min,
95
+ OPJ_UINT32 p_dy_min);
96
+
97
+ /**
98
+ * Updates the coding parameters if the encoding is not used with Progression order changes and final (and cinema parameters are used).
99
+ *
100
+ * @param p_cp the coding parameters to modify
101
+ * @param p_num_comps the number of components
102
+ * @param p_tileno the tile index being concerned.
103
+ * @param p_tx0 X0 parameter for the tile
104
+ * @param p_tx1 X1 parameter for the tile
105
+ * @param p_ty0 Y0 parameter for the tile
106
+ * @param p_ty1 Y1 parameter for the tile
107
+ * @param p_max_prec the maximum precision for all the bands of the tile
108
+ * @param p_max_res the maximum number of resolutions for all the poc inside the tile.
109
+ * @param p_dx_min the minimum dx of all the components of all the resolutions for the tile.
110
+ * @param p_dy_min the minimum dy of all the components of all the resolutions for the tile.
111
+ */
112
+ static void opj_pi_update_encode_not_poc ( opj_cp_t *p_cp,
113
+ OPJ_UINT32 p_num_comps,
114
+ OPJ_UINT32 p_tileno,
115
+ OPJ_INT32 p_tx0,
116
+ OPJ_INT32 p_tx1,
117
+ OPJ_INT32 p_ty0,
118
+ OPJ_INT32 p_ty1,
119
+ OPJ_UINT32 p_max_prec,
120
+ OPJ_UINT32 p_max_res,
121
+ OPJ_UINT32 p_dx_min,
122
+ OPJ_UINT32 p_dy_min);
123
+ /**
124
+ * Gets the encoding parameters needed to update the coding parameters and all the pocs.
125
+ *
126
+ * @param p_image the image being encoded.
127
+ * @param p_cp the coding parameters.
128
+ * @param tileno the tile index of the tile being encoded.
129
+ * @param p_tx0 pointer that will hold the X0 parameter for the tile
130
+ * @param p_tx1 pointer that will hold the X1 parameter for the tile
131
+ * @param p_ty0 pointer that will hold the Y0 parameter for the tile
132
+ * @param p_ty1 pointer that will hold the Y1 parameter for the tile
133
+ * @param p_max_prec pointer that will hold the the maximum precision for all the bands of the tile
134
+ * @param p_max_res pointer that will hold the the maximum number of resolutions for all the poc inside the tile.
135
+ * @param p_dx_min pointer that will hold the the minimum dx of all the components of all the resolutions for the tile.
136
+ * @param p_dy_min pointer that will hold the the minimum dy of all the components of all the resolutions for the tile.
137
+ */
138
+ static void opj_get_encoding_parameters(const opj_image_t *p_image,
139
+ const opj_cp_t *p_cp,
140
+ OPJ_UINT32 tileno,
141
+ OPJ_INT32 * p_tx0,
142
+ OPJ_INT32 * p_tx1,
143
+ OPJ_INT32 * p_ty0,
144
+ OPJ_INT32 * p_ty1,
145
+ OPJ_UINT32 * p_dx_min,
146
+ OPJ_UINT32 * p_dy_min,
147
+ OPJ_UINT32 * p_max_prec,
148
+ OPJ_UINT32 * p_max_res );
149
+
150
+ /**
151
+ * Gets the encoding parameters needed to update the coding parameters and all the pocs.
152
+ * The precinct widths, heights, dx and dy for each component at each resolution will be stored as well.
153
+ * the last parameter of the function should be an array of pointers of size nb components, each pointer leading
154
+ * to an area of size 4 * max_res. The data is stored inside this area with the following pattern :
155
+ * dx_compi_res0 , dy_compi_res0 , w_compi_res0, h_compi_res0 , dx_compi_res1 , dy_compi_res1 , w_compi_res1, h_compi_res1 , ...
156
+ *
157
+ * @param p_image the image being encoded.
158
+ * @param p_cp the coding parameters.
159
+ * @param tileno the tile index of the tile being encoded.
160
+ * @param p_tx0 pointer that will hold the X0 parameter for the tile
161
+ * @param p_tx1 pointer that will hold the X1 parameter for the tile
162
+ * @param p_ty0 pointer that will hold the Y0 parameter for the tile
163
+ * @param p_ty1 pointer that will hold the Y1 parameter for the tile
164
+ * @param p_max_prec pointer that will hold the the maximum precision for all the bands of the tile
165
+ * @param p_max_res pointer that will hold the the maximum number of resolutions for all the poc inside the tile.
166
+ * @param p_dx_min pointer that will hold the the minimum dx of all the components of all the resolutions for the tile.
167
+ * @param p_dy_min pointer that will hold the the minimum dy of all the components of all the resolutions for the tile.
168
+ * @param p_resolutions pointer to an area corresponding to the one described above.
169
+ */
170
+ static void opj_get_all_encoding_parameters(const opj_image_t *p_image,
171
+ const opj_cp_t *p_cp,
172
+ OPJ_UINT32 tileno,
173
+ OPJ_INT32 * p_tx0,
174
+ OPJ_INT32 * p_tx1,
175
+ OPJ_INT32 * p_ty0,
176
+ OPJ_INT32 * p_ty1,
177
+ OPJ_UINT32 * p_dx_min,
178
+ OPJ_UINT32 * p_dy_min,
179
+ OPJ_UINT32 * p_max_prec,
180
+ OPJ_UINT32 * p_max_res,
181
+ OPJ_UINT32 ** p_resolutions );
182
+ /**
183
+ * Allocates memory for a packet iterator. Data and data sizes are set by this operation.
184
+ * No other data is set. The include section of the packet iterator is not allocated.
185
+ *
186
+ * @param p_image the image used to initialize the packet iterator (in fact only the number of components is relevant.
187
+ * @param p_cp the coding parameters.
188
+ * @param tileno the index of the tile from which creating the packet iterator.
189
+ */
190
+ static opj_pi_iterator_t * opj_pi_create( const opj_image_t *p_image,
191
+ const opj_cp_t *p_cp,
192
+ OPJ_UINT32 tileno );
193
+ /**
194
+ * FIXME DOC
195
+ */
196
+ static void opj_pi_update_decode_not_poc (opj_pi_iterator_t * p_pi,
197
+ opj_tcp_t * p_tcp,
198
+ OPJ_UINT32 p_max_precision,
199
+ OPJ_UINT32 p_max_res);
200
+ /**
201
+ * FIXME DOC
202
+ */
203
+ static void opj_pi_update_decode_poc ( opj_pi_iterator_t * p_pi,
204
+ opj_tcp_t * p_tcp,
205
+ OPJ_UINT32 p_max_precision,
206
+ OPJ_UINT32 p_max_res);
207
+
208
+ /**
209
+ * FIXME DOC
210
+ */
211
+ OPJ_BOOL opj_pi_check_next_level( OPJ_INT32 pos,
212
+ opj_cp_t *cp,
213
+ OPJ_UINT32 tileno,
214
+ OPJ_UINT32 pino,
215
+ const OPJ_CHAR *prog);
216
+
217
+ /*@}*/
218
+
219
+ /*@}*/
220
+
221
+ /*
222
+ ==========================================================
223
+ local functions
224
+ ==========================================================
225
+ */
226
+
227
+ OPJ_BOOL opj_pi_next_lrcp(opj_pi_iterator_t * pi) {
228
+ opj_pi_comp_t *comp = NULL;
229
+ opj_pi_resolution_t *res = NULL;
230
+ OPJ_UINT32 index = 0;
231
+
232
+ if (!pi->first) {
233
+ comp = &pi->comps[pi->compno];
234
+ res = &comp->resolutions[pi->resno];
235
+ goto LABEL_SKIP;
236
+ } else {
237
+ pi->first = 0;
238
+ }
239
+
240
+ for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
241
+ for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1;
242
+ pi->resno++) {
243
+ for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
244
+ comp = &pi->comps[pi->compno];
245
+ if (pi->resno >= comp->numresolutions) {
246
+ continue;
247
+ }
248
+ res = &comp->resolutions[pi->resno];
249
+ if (!pi->tp_on){
250
+ pi->poc.precno1 = res->pw * res->ph;
251
+ }
252
+ for (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {
253
+ index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
254
+ if (!pi->include[index]) {
255
+ pi->include[index] = 1;
256
+ return OPJ_TRUE;
257
+ }
258
+ LABEL_SKIP:;
259
+ }
260
+ }
261
+ }
262
+ }
263
+
264
+ return OPJ_FALSE;
265
+ }
266
+
267
+ OPJ_BOOL opj_pi_next_rlcp(opj_pi_iterator_t * pi) {
268
+ opj_pi_comp_t *comp = NULL;
269
+ opj_pi_resolution_t *res = NULL;
270
+ OPJ_UINT32 index = 0;
271
+
272
+ if (!pi->first) {
273
+ comp = &pi->comps[pi->compno];
274
+ res = &comp->resolutions[pi->resno];
275
+ goto LABEL_SKIP;
276
+ } else {
277
+ pi->first = 0;
278
+ }
279
+
280
+ for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {
281
+ for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
282
+ for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
283
+ comp = &pi->comps[pi->compno];
284
+ if (pi->resno >= comp->numresolutions) {
285
+ continue;
286
+ }
287
+ res = &comp->resolutions[pi->resno];
288
+ if(!pi->tp_on){
289
+ pi->poc.precno1 = res->pw * res->ph;
290
+ }
291
+ for (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {
292
+ index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
293
+ if (!pi->include[index]) {
294
+ pi->include[index] = 1;
295
+ return OPJ_TRUE;
296
+ }
297
+ LABEL_SKIP:;
298
+ }
299
+ }
300
+ }
301
+ }
302
+
303
+ return OPJ_FALSE;
304
+ }
305
+
306
+ OPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi) {
307
+ opj_pi_comp_t *comp = NULL;
308
+ opj_pi_resolution_t *res = NULL;
309
+ OPJ_UINT32 index = 0;
310
+
311
+ if (!pi->first) {
312
+ goto LABEL_SKIP;
313
+ } else {
314
+ OPJ_UINT32 compno, resno;
315
+ pi->first = 0;
316
+ pi->dx = 0;
317
+ pi->dy = 0;
318
+ for (compno = 0; compno < pi->numcomps; compno++) {
319
+ comp = &pi->comps[compno];
320
+ for (resno = 0; resno < comp->numresolutions; resno++) {
321
+ OPJ_UINT32 dx, dy;
322
+ res = &comp->resolutions[resno];
323
+ dx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));
324
+ dy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));
325
+ pi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);
326
+ pi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);
327
+ }
328
+ }
329
+ }
330
+ if (!pi->tp_on){
331
+ pi->poc.ty0 = pi->ty0;
332
+ pi->poc.tx0 = pi->tx0;
333
+ pi->poc.ty1 = pi->ty1;
334
+ pi->poc.tx1 = pi->tx1;
335
+ }
336
+ for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {
337
+ for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += (OPJ_INT32)(pi->dy - (OPJ_UINT32)(pi->y % (OPJ_INT32)pi->dy))) {
338
+ for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += (OPJ_INT32)(pi->dx - (OPJ_UINT32)(pi->x % (OPJ_INT32)pi->dx))) {
339
+ for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
340
+ OPJ_UINT32 levelno;
341
+ OPJ_INT32 trx0, try0;
342
+ OPJ_INT32 trx1, try1;
343
+ OPJ_UINT32 rpx, rpy;
344
+ OPJ_INT32 prci, prcj;
345
+ comp = &pi->comps[pi->compno];
346
+ if (pi->resno >= comp->numresolutions) {
347
+ continue;
348
+ }
349
+ res = &comp->resolutions[pi->resno];
350
+ levelno = comp->numresolutions - 1 - pi->resno;
351
+ trx0 = opj_int_ceildiv(pi->tx0, (OPJ_INT32)(comp->dx << levelno));
352
+ try0 = opj_int_ceildiv(pi->ty0, (OPJ_INT32)(comp->dy << levelno));
353
+ trx1 = opj_int_ceildiv(pi->tx1, (OPJ_INT32)(comp->dx << levelno));
354
+ try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
355
+ rpx = res->pdx + levelno;
356
+ rpy = res->pdy + levelno;
357
+ if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
358
+ continue;
359
+ }
360
+ if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
361
+ continue;
362
+ }
363
+
364
+ if ((res->pw==0)||(res->ph==0)) continue;
365
+
366
+ if ((trx0==trx1)||(try0==try1)) continue;
367
+
368
+ prci = opj_int_floordivpow2(opj_int_ceildiv(pi->x, (OPJ_INT32)(comp->dx << levelno)), (OPJ_INT32)res->pdx)
369
+ - opj_int_floordivpow2(trx0, (OPJ_INT32)res->pdx);
370
+ prcj = opj_int_floordivpow2(opj_int_ceildiv(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)
371
+ - opj_int_floordivpow2(try0, (OPJ_INT32)res->pdy);
372
+ pi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);
373
+ for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
374
+ index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
375
+ if (!pi->include[index]) {
376
+ pi->include[index] = 1;
377
+ return OPJ_TRUE;
378
+ }
379
+ LABEL_SKIP:;
380
+ }
381
+ }
382
+ }
383
+ }
384
+ }
385
+
386
+ return OPJ_FALSE;
387
+ }
388
+
389
+ OPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi) {
390
+ opj_pi_comp_t *comp = NULL;
391
+ opj_pi_resolution_t *res = NULL;
392
+ OPJ_UINT32 index = 0;
393
+
394
+ if (!pi->first) {
395
+ comp = &pi->comps[pi->compno];
396
+ goto LABEL_SKIP;
397
+ } else {
398
+ OPJ_UINT32 compno, resno;
399
+ pi->first = 0;
400
+ pi->dx = 0;
401
+ pi->dy = 0;
402
+ for (compno = 0; compno < pi->numcomps; compno++) {
403
+ comp = &pi->comps[compno];
404
+ for (resno = 0; resno < comp->numresolutions; resno++) {
405
+ OPJ_UINT32 dx, dy;
406
+ res = &comp->resolutions[resno];
407
+ dx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));
408
+ dy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));
409
+ pi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);
410
+ pi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);
411
+ }
412
+ }
413
+ }
414
+ if (!pi->tp_on){
415
+ pi->poc.ty0 = pi->ty0;
416
+ pi->poc.tx0 = pi->tx0;
417
+ pi->poc.ty1 = pi->ty1;
418
+ pi->poc.tx1 = pi->tx1;
419
+ }
420
+ for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += (OPJ_INT32)(pi->dy - (OPJ_UINT32)(pi->y % (OPJ_INT32)pi->dy))) {
421
+ for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += (OPJ_INT32)(pi->dx - (OPJ_UINT32)(pi->x % (OPJ_INT32)pi->dx))) {
422
+ for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
423
+ comp = &pi->comps[pi->compno];
424
+ for (pi->resno = pi->poc.resno0; pi->resno < opj_uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {
425
+ OPJ_UINT32 levelno;
426
+ OPJ_INT32 trx0, try0;
427
+ OPJ_INT32 trx1, try1;
428
+ OPJ_UINT32 rpx, rpy;
429
+ OPJ_INT32 prci, prcj;
430
+ res = &comp->resolutions[pi->resno];
431
+ levelno = comp->numresolutions - 1 - pi->resno;
432
+ trx0 = opj_int_ceildiv(pi->tx0, (OPJ_INT32)(comp->dx << levelno));
433
+ try0 = opj_int_ceildiv(pi->ty0, (OPJ_INT32)(comp->dy << levelno));
434
+ trx1 = opj_int_ceildiv(pi->tx1, (OPJ_INT32)(comp->dx << levelno));
435
+ try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
436
+ rpx = res->pdx + levelno;
437
+ rpy = res->pdy + levelno;
438
+ if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
439
+ continue;
440
+ }
441
+ if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
442
+ continue;
443
+ }
444
+
445
+ if ((res->pw==0)||(res->ph==0)) continue;
446
+
447
+ if ((trx0==trx1)||(try0==try1)) continue;
448
+
449
+ prci = opj_int_floordivpow2(opj_int_ceildiv(pi->x, (OPJ_INT32)(comp->dx << levelno)), (OPJ_INT32)res->pdx)
450
+ - opj_int_floordivpow2(trx0, (OPJ_INT32)res->pdx);
451
+ prcj = opj_int_floordivpow2(opj_int_ceildiv(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)
452
+ - opj_int_floordivpow2(try0, (OPJ_INT32)res->pdy);
453
+ pi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);
454
+ for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
455
+ index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
456
+ if (!pi->include[index]) {
457
+ pi->include[index] = 1;
458
+ return OPJ_TRUE;
459
+ }
460
+ LABEL_SKIP:;
461
+ }
462
+ }
463
+ }
464
+ }
465
+ }
466
+
467
+ return OPJ_FALSE;
468
+ }
469
+
470
+ OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi) {
471
+ opj_pi_comp_t *comp = NULL;
472
+ opj_pi_resolution_t *res = NULL;
473
+ OPJ_UINT32 index = 0;
474
+
475
+ if (!pi->first) {
476
+ comp = &pi->comps[pi->compno];
477
+ goto LABEL_SKIP;
478
+ } else {
479
+ pi->first = 0;
480
+ }
481
+
482
+ for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
483
+ OPJ_UINT32 resno;
484
+ comp = &pi->comps[pi->compno];
485
+ pi->dx = 0;
486
+ pi->dy = 0;
487
+ for (resno = 0; resno < comp->numresolutions; resno++) {
488
+ OPJ_UINT32 dx, dy;
489
+ res = &comp->resolutions[resno];
490
+ dx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));
491
+ dy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));
492
+ pi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);
493
+ pi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);
494
+ }
495
+ if (!pi->tp_on){
496
+ pi->poc.ty0 = pi->ty0;
497
+ pi->poc.tx0 = pi->tx0;
498
+ pi->poc.ty1 = pi->ty1;
499
+ pi->poc.tx1 = pi->tx1;
500
+ }
501
+ for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += (OPJ_INT32)(pi->dy - (OPJ_UINT32)(pi->y % (OPJ_INT32)pi->dy))) {
502
+ for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += (OPJ_INT32)(pi->dx - (OPJ_UINT32)(pi->x % (OPJ_INT32)pi->dx))) {
503
+ for (pi->resno = pi->poc.resno0; pi->resno < opj_uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {
504
+ OPJ_UINT32 levelno;
505
+ OPJ_INT32 trx0, try0;
506
+ OPJ_INT32 trx1, try1;
507
+ OPJ_UINT32 rpx, rpy;
508
+ OPJ_INT32 prci, prcj;
509
+ res = &comp->resolutions[pi->resno];
510
+ levelno = comp->numresolutions - 1 - pi->resno;
511
+ trx0 = opj_int_ceildiv(pi->tx0, (OPJ_INT32)(comp->dx << levelno));
512
+ try0 = opj_int_ceildiv(pi->ty0, (OPJ_INT32)(comp->dy << levelno));
513
+ trx1 = opj_int_ceildiv(pi->tx1, (OPJ_INT32)(comp->dx << levelno));
514
+ try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
515
+ rpx = res->pdx + levelno;
516
+ rpy = res->pdy + levelno;
517
+ if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
518
+ continue;
519
+ }
520
+ if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
521
+ continue;
522
+ }
523
+
524
+ if ((res->pw==0)||(res->ph==0)) continue;
525
+
526
+ if ((trx0==trx1)||(try0==try1)) continue;
527
+
528
+ prci = opj_int_floordivpow2(opj_int_ceildiv(pi->x, (OPJ_INT32)(comp->dx << levelno)), (OPJ_INT32)res->pdx)
529
+ - opj_int_floordivpow2(trx0, (OPJ_INT32)res->pdx);
530
+ prcj = opj_int_floordivpow2(opj_int_ceildiv(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)
531
+ - opj_int_floordivpow2(try0, (OPJ_INT32)res->pdy);
532
+ pi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);
533
+ for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
534
+ index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;
535
+ if (!pi->include[index]) {
536
+ pi->include[index] = 1;
537
+ return OPJ_TRUE;
538
+ }
539
+ LABEL_SKIP:;
540
+ }
541
+ }
542
+ }
543
+ }
544
+ }
545
+
546
+ return OPJ_FALSE;
547
+ }
548
+
549
+ void opj_get_encoding_parameters( const opj_image_t *p_image,
550
+ const opj_cp_t *p_cp,
551
+ OPJ_UINT32 p_tileno,
552
+ OPJ_INT32 * p_tx0,
553
+ OPJ_INT32 * p_tx1,
554
+ OPJ_INT32 * p_ty0,
555
+ OPJ_INT32 * p_ty1,
556
+ OPJ_UINT32 * p_dx_min,
557
+ OPJ_UINT32 * p_dy_min,
558
+ OPJ_UINT32 * p_max_prec,
559
+ OPJ_UINT32 * p_max_res )
560
+ {
561
+ /* loop */
562
+ OPJ_UINT32 compno, resno;
563
+ /* pointers */
564
+ const opj_tcp_t *l_tcp = 00;
565
+ const opj_tccp_t * l_tccp = 00;
566
+ const opj_image_comp_t * l_img_comp = 00;
567
+
568
+ /* position in x and y of tile */
569
+ OPJ_UINT32 p, q;
570
+
571
+ /* preconditions */
572
+ assert(p_cp != 00);
573
+ assert(p_image != 00);
574
+ assert(p_tileno < p_cp->tw * p_cp->th);
575
+
576
+ /* initializations */
577
+ l_tcp = &p_cp->tcps [p_tileno];
578
+ l_img_comp = p_image->comps;
579
+ l_tccp = l_tcp->tccps;
580
+
581
+ /* here calculation of tx0, tx1, ty0, ty1, maxprec, dx and dy */
582
+ p = p_tileno % p_cp->tw;
583
+ q = p_tileno / p_cp->tw;
584
+
585
+ /* find extent of tile */
586
+ *p_tx0 = opj_int_max((OPJ_INT32)(p_cp->tx0 + p * p_cp->tdx), (OPJ_INT32)p_image->x0);
587
+ *p_tx1 = opj_int_min((OPJ_INT32)(p_cp->tx0 + (p + 1) * p_cp->tdx), (OPJ_INT32)p_image->x1);
588
+ *p_ty0 = opj_int_max((OPJ_INT32)(p_cp->ty0 + q * p_cp->tdy), (OPJ_INT32)p_image->y0);
589
+ *p_ty1 = opj_int_min((OPJ_INT32)(p_cp->ty0 + (q + 1) * p_cp->tdy), (OPJ_INT32)p_image->y1);
590
+
591
+ /* max precision is 0 (can only grow) */
592
+ *p_max_prec = 0;
593
+ *p_max_res = 0;
594
+
595
+ /* take the largest value for dx_min and dy_min */
596
+ *p_dx_min = 0x7fffffff;
597
+ *p_dy_min = 0x7fffffff;
598
+
599
+ for (compno = 0; compno < p_image->numcomps; ++compno) {
600
+ /* arithmetic variables to calculate */
601
+ OPJ_UINT32 l_level_no;
602
+ OPJ_INT32 l_rx0, l_ry0, l_rx1, l_ry1;
603
+ OPJ_INT32 l_px0, l_py0, l_px1, py1;
604
+ OPJ_UINT32 l_pdx, l_pdy;
605
+ OPJ_UINT32 l_pw, l_ph;
606
+ OPJ_UINT32 l_product;
607
+ OPJ_INT32 l_tcx0, l_tcy0, l_tcx1, l_tcy1;
608
+
609
+ l_tcx0 = opj_int_ceildiv(*p_tx0, (OPJ_INT32)l_img_comp->dx);
610
+ l_tcy0 = opj_int_ceildiv(*p_ty0, (OPJ_INT32)l_img_comp->dy);
611
+ l_tcx1 = opj_int_ceildiv(*p_tx1, (OPJ_INT32)l_img_comp->dx);
612
+ l_tcy1 = opj_int_ceildiv(*p_ty1, (OPJ_INT32)l_img_comp->dy);
613
+
614
+ if (l_tccp->numresolutions > *p_max_res) {
615
+ *p_max_res = l_tccp->numresolutions;
616
+ }
617
+
618
+ /* use custom size for precincts */
619
+ for (resno = 0; resno < l_tccp->numresolutions; ++resno) {
620
+ OPJ_UINT32 l_dx, l_dy;
621
+
622
+ /* precinct width and height */
623
+ l_pdx = l_tccp->prcw[resno];
624
+ l_pdy = l_tccp->prch[resno];
625
+
626
+ l_dx = l_img_comp->dx * (1u << (l_pdx + l_tccp->numresolutions - 1 - resno));
627
+ l_dy = l_img_comp->dy * (1u << (l_pdy + l_tccp->numresolutions - 1 - resno));
628
+
629
+ /* take the minimum size for dx for each comp and resolution */
630
+ *p_dx_min = opj_uint_min(*p_dx_min, l_dx);
631
+ *p_dy_min = opj_uint_min(*p_dy_min, l_dy);
632
+
633
+ /* various calculations of extents */
634
+ l_level_no = l_tccp->numresolutions - 1 - resno;
635
+
636
+ l_rx0 = opj_int_ceildivpow2(l_tcx0, (OPJ_INT32)l_level_no);
637
+ l_ry0 = opj_int_ceildivpow2(l_tcy0, (OPJ_INT32)l_level_no);
638
+ l_rx1 = opj_int_ceildivpow2(l_tcx1, (OPJ_INT32)l_level_no);
639
+ l_ry1 = opj_int_ceildivpow2(l_tcy1, (OPJ_INT32)l_level_no);
640
+
641
+ l_px0 = opj_int_floordivpow2(l_rx0, (OPJ_INT32)l_pdx) << l_pdx;
642
+ l_py0 = opj_int_floordivpow2(l_ry0, (OPJ_INT32)l_pdy) << l_pdy;
643
+ l_px1 = opj_int_ceildivpow2(l_rx1, (OPJ_INT32)l_pdx) << l_pdx;
644
+
645
+ py1 = opj_int_ceildivpow2(l_ry1, (OPJ_INT32)l_pdy) << l_pdy;
646
+
647
+ l_pw = (l_rx0==l_rx1)?0:(OPJ_UINT32)((l_px1 - l_px0) >> l_pdx);
648
+ l_ph = (l_ry0==l_ry1)?0:(OPJ_UINT32)((py1 - l_py0) >> l_pdy);
649
+
650
+ l_product = l_pw * l_ph;
651
+
652
+ /* update precision */
653
+ if (l_product > *p_max_prec) {
654
+ *p_max_prec = l_product;
655
+ }
656
+ }
657
+ ++l_img_comp;
658
+ ++l_tccp;
659
+ }
660
+ }
661
+
662
+
663
+ void opj_get_all_encoding_parameters( const opj_image_t *p_image,
664
+ const opj_cp_t *p_cp,
665
+ OPJ_UINT32 tileno,
666
+ OPJ_INT32 * p_tx0,
667
+ OPJ_INT32 * p_tx1,
668
+ OPJ_INT32 * p_ty0,
669
+ OPJ_INT32 * p_ty1,
670
+ OPJ_UINT32 * p_dx_min,
671
+ OPJ_UINT32 * p_dy_min,
672
+ OPJ_UINT32 * p_max_prec,
673
+ OPJ_UINT32 * p_max_res,
674
+ OPJ_UINT32 ** p_resolutions )
675
+ {
676
+ /* loop*/
677
+ OPJ_UINT32 compno, resno;
678
+
679
+ /* pointers*/
680
+ const opj_tcp_t *tcp = 00;
681
+ const opj_tccp_t * l_tccp = 00;
682
+ const opj_image_comp_t * l_img_comp = 00;
683
+
684
+ /* to store l_dx, l_dy, w and h for each resolution and component.*/
685
+ OPJ_UINT32 * lResolutionPtr;
686
+
687
+ /* position in x and y of tile*/
688
+ OPJ_UINT32 p, q;
689
+
690
+ /* preconditions in debug*/
691
+ assert(p_cp != 00);
692
+ assert(p_image != 00);
693
+ assert(tileno < p_cp->tw * p_cp->th);
694
+
695
+ /* initializations*/
696
+ tcp = &p_cp->tcps [tileno];
697
+ l_tccp = tcp->tccps;
698
+ l_img_comp = p_image->comps;
699
+
700
+ /* position in x and y of tile*/
701
+ p = tileno % p_cp->tw;
702
+ q = tileno / p_cp->tw;
703
+
704
+ /* here calculation of tx0, tx1, ty0, ty1, maxprec, l_dx and l_dy */
705
+ *p_tx0 = opj_int_max((OPJ_INT32)(p_cp->tx0 + p * p_cp->tdx), (OPJ_INT32)p_image->x0);
706
+ *p_tx1 = opj_int_min((OPJ_INT32)(p_cp->tx0 + (p + 1) * p_cp->tdx), (OPJ_INT32)p_image->x1);
707
+ *p_ty0 = opj_int_max((OPJ_INT32)(p_cp->ty0 + q * p_cp->tdy), (OPJ_INT32)p_image->y0);
708
+ *p_ty1 = opj_int_min((OPJ_INT32)(p_cp->ty0 + (q + 1) * p_cp->tdy), (OPJ_INT32)p_image->y1);
709
+
710
+ /* max precision and resolution is 0 (can only grow)*/
711
+ *p_max_prec = 0;
712
+ *p_max_res = 0;
713
+
714
+ /* take the largest value for dx_min and dy_min*/
715
+ *p_dx_min = 0x7fffffff;
716
+ *p_dy_min = 0x7fffffff;
717
+
718
+ for (compno = 0; compno < p_image->numcomps; ++compno) {
719
+ /* aritmetic variables to calculate*/
720
+ OPJ_UINT32 l_level_no;
721
+ OPJ_INT32 l_rx0, l_ry0, l_rx1, l_ry1;
722
+ OPJ_INT32 l_px0, l_py0, l_px1, py1;
723
+ OPJ_UINT32 l_product;
724
+ OPJ_INT32 l_tcx0, l_tcy0, l_tcx1, l_tcy1;
725
+ OPJ_UINT32 l_pdx, l_pdy , l_pw , l_ph;
726
+
727
+ lResolutionPtr = p_resolutions[compno];
728
+
729
+ l_tcx0 = opj_int_ceildiv(*p_tx0, (OPJ_INT32)l_img_comp->dx);
730
+ l_tcy0 = opj_int_ceildiv(*p_ty0, (OPJ_INT32)l_img_comp->dy);
731
+ l_tcx1 = opj_int_ceildiv(*p_tx1, (OPJ_INT32)l_img_comp->dx);
732
+ l_tcy1 = opj_int_ceildiv(*p_ty1, (OPJ_INT32)l_img_comp->dy);
733
+
734
+ if (l_tccp->numresolutions > *p_max_res) {
735
+ *p_max_res = l_tccp->numresolutions;
736
+ }
737
+
738
+ /* use custom size for precincts*/
739
+ l_level_no = l_tccp->numresolutions - 1;
740
+ for (resno = 0; resno < l_tccp->numresolutions; ++resno) {
741
+ OPJ_UINT32 l_dx, l_dy;
742
+
743
+ /* precinct width and height*/
744
+ l_pdx = l_tccp->prcw[resno];
745
+ l_pdy = l_tccp->prch[resno];
746
+ *lResolutionPtr++ = l_pdx;
747
+ *lResolutionPtr++ = l_pdy;
748
+ l_dx = l_img_comp->dx * (1u << (l_pdx + l_level_no));
749
+ l_dy = l_img_comp->dy * (1u << (l_pdy + l_level_no));
750
+ /* take the minimum size for l_dx for each comp and resolution*/
751
+ *p_dx_min = (OPJ_UINT32)opj_int_min((OPJ_INT32)*p_dx_min, (OPJ_INT32)l_dx);
752
+ *p_dy_min = (OPJ_UINT32)opj_int_min((OPJ_INT32)*p_dy_min, (OPJ_INT32)l_dy);
753
+
754
+ /* various calculations of extents*/
755
+ l_rx0 = opj_int_ceildivpow2(l_tcx0, (OPJ_INT32)l_level_no);
756
+ l_ry0 = opj_int_ceildivpow2(l_tcy0, (OPJ_INT32)l_level_no);
757
+ l_rx1 = opj_int_ceildivpow2(l_tcx1, (OPJ_INT32)l_level_no);
758
+ l_ry1 = opj_int_ceildivpow2(l_tcy1, (OPJ_INT32)l_level_no);
759
+ l_px0 = opj_int_floordivpow2(l_rx0, (OPJ_INT32)l_pdx) << l_pdx;
760
+ l_py0 = opj_int_floordivpow2(l_ry0, (OPJ_INT32)l_pdy) << l_pdy;
761
+ l_px1 = opj_int_ceildivpow2(l_rx1, (OPJ_INT32)l_pdx) << l_pdx;
762
+ py1 = opj_int_ceildivpow2(l_ry1, (OPJ_INT32)l_pdy) << l_pdy;
763
+ l_pw = (l_rx0==l_rx1)?0:(OPJ_UINT32)((l_px1 - l_px0) >> l_pdx);
764
+ l_ph = (l_ry0==l_ry1)?0:(OPJ_UINT32)((py1 - l_py0) >> l_pdy);
765
+ *lResolutionPtr++ = l_pw;
766
+ *lResolutionPtr++ = l_ph;
767
+ l_product = l_pw * l_ph;
768
+
769
+ /* update precision*/
770
+ if (l_product > *p_max_prec) {
771
+ *p_max_prec = l_product;
772
+ }
773
+
774
+ --l_level_no;
775
+ }
776
+ ++l_tccp;
777
+ ++l_img_comp;
778
+ }
779
+ }
780
+
781
+ opj_pi_iterator_t * opj_pi_create( const opj_image_t *image,
782
+ const opj_cp_t *cp,
783
+ OPJ_UINT32 tileno )
784
+ {
785
+ /* loop*/
786
+ OPJ_UINT32 pino, compno;
787
+ /* number of poc in the p_pi*/
788
+ OPJ_UINT32 l_poc_bound;
789
+
790
+ /* pointers to tile coding parameters and components.*/
791
+ opj_pi_iterator_t *l_pi = 00;
792
+ opj_tcp_t *tcp = 00;
793
+ const opj_tccp_t *tccp = 00;
794
+
795
+ /* current packet iterator being allocated*/
796
+ opj_pi_iterator_t *l_current_pi = 00;
797
+
798
+ /* preconditions in debug*/
799
+ assert(cp != 00);
800
+ assert(image != 00);
801
+ assert(tileno < cp->tw * cp->th);
802
+
803
+ /* initializations*/
804
+ tcp = &cp->tcps[tileno];
805
+ l_poc_bound = tcp->numpocs+1;
806
+
807
+ /* memory allocations*/
808
+ l_pi = (opj_pi_iterator_t*) opj_calloc((l_poc_bound), sizeof(opj_pi_iterator_t));
809
+ if (!l_pi) {
810
+ return NULL;
811
+ }
812
+ memset(l_pi,0,l_poc_bound * sizeof(opj_pi_iterator_t));
813
+
814
+ l_current_pi = l_pi;
815
+ for (pino = 0; pino < l_poc_bound ; ++pino) {
816
+
817
+ l_current_pi->comps = (opj_pi_comp_t*) opj_calloc(image->numcomps, sizeof(opj_pi_comp_t));
818
+ if (! l_current_pi->comps) {
819
+ opj_pi_destroy(l_pi, l_poc_bound);
820
+ return NULL;
821
+ }
822
+
823
+ l_current_pi->numcomps = image->numcomps;
824
+ memset(l_current_pi->comps,0,image->numcomps * sizeof(opj_pi_comp_t));
825
+
826
+ for (compno = 0; compno < image->numcomps; ++compno) {
827
+ opj_pi_comp_t *comp = &l_current_pi->comps[compno];
828
+
829
+ tccp = &tcp->tccps[compno];
830
+
831
+ comp->resolutions = (opj_pi_resolution_t*) opj_malloc(tccp->numresolutions * sizeof(opj_pi_resolution_t));
832
+ if (!comp->resolutions) {
833
+ opj_pi_destroy(l_pi, l_poc_bound);
834
+ return 00;
835
+ }
836
+
837
+ comp->numresolutions = tccp->numresolutions;
838
+ memset(comp->resolutions,0,tccp->numresolutions * sizeof(opj_pi_resolution_t));
839
+ }
840
+ ++l_current_pi;
841
+ }
842
+ return l_pi;
843
+ }
844
+
845
+ void opj_pi_update_encode_poc_and_final ( opj_cp_t *p_cp,
846
+ OPJ_UINT32 p_tileno,
847
+ OPJ_INT32 p_tx0,
848
+ OPJ_INT32 p_tx1,
849
+ OPJ_INT32 p_ty0,
850
+ OPJ_INT32 p_ty1,
851
+ OPJ_UINT32 p_max_prec,
852
+ OPJ_UINT32 p_max_res,
853
+ OPJ_UINT32 p_dx_min,
854
+ OPJ_UINT32 p_dy_min)
855
+ {
856
+ /* loop*/
857
+ OPJ_UINT32 pino;
858
+ /* tile coding parameter*/
859
+ opj_tcp_t *l_tcp = 00;
860
+ /* current poc being updated*/
861
+ opj_poc_t * l_current_poc = 00;
862
+
863
+ /* number of pocs*/
864
+ OPJ_UINT32 l_poc_bound;
865
+
866
+ OPJ_ARG_NOT_USED(p_max_res);
867
+
868
+ /* preconditions in debug*/
869
+ assert(p_cp != 00);
870
+ assert(p_tileno < p_cp->tw * p_cp->th);
871
+
872
+ /* initializations*/
873
+ l_tcp = &p_cp->tcps [p_tileno];
874
+ /* number of iterations in the loop */
875
+ l_poc_bound = l_tcp->numpocs+1;
876
+
877
+ /* start at first element, and to make sure the compiler will not make a calculation each time in the loop
878
+ store a pointer to the current element to modify rather than l_tcp->pocs[i]*/
879
+ l_current_poc = l_tcp->pocs;
880
+
881
+ l_current_poc->compS = l_current_poc->compno0;
882
+ l_current_poc->compE = l_current_poc->compno1;
883
+ l_current_poc->resS = l_current_poc->resno0;
884
+ l_current_poc->resE = l_current_poc->resno1;
885
+ l_current_poc->layE = l_current_poc->layno1;
886
+
887
+ /* special treatment for the first element*/
888
+ l_current_poc->layS = 0;
889
+ l_current_poc->prg = l_current_poc->prg1;
890
+ l_current_poc->prcS = 0;
891
+
892
+ l_current_poc->prcE = p_max_prec;
893
+ l_current_poc->txS = (OPJ_UINT32)p_tx0;
894
+ l_current_poc->txE = (OPJ_UINT32)p_tx1;
895
+ l_current_poc->tyS = (OPJ_UINT32)p_ty0;
896
+ l_current_poc->tyE = (OPJ_UINT32)p_ty1;
897
+ l_current_poc->dx = p_dx_min;
898
+ l_current_poc->dy = p_dy_min;
899
+
900
+ ++ l_current_poc;
901
+ for (pino = 1;pino < l_poc_bound ; ++pino) {
902
+ l_current_poc->compS = l_current_poc->compno0;
903
+ l_current_poc->compE= l_current_poc->compno1;
904
+ l_current_poc->resS = l_current_poc->resno0;
905
+ l_current_poc->resE = l_current_poc->resno1;
906
+ l_current_poc->layE = l_current_poc->layno1;
907
+ l_current_poc->prg = l_current_poc->prg1;
908
+ l_current_poc->prcS = 0;
909
+ /* special treatment here different from the first element*/
910
+ l_current_poc->layS = (l_current_poc->layE > (l_current_poc-1)->layE) ? l_current_poc->layE : 0;
911
+
912
+ l_current_poc->prcE = p_max_prec;
913
+ l_current_poc->txS = (OPJ_UINT32)p_tx0;
914
+ l_current_poc->txE = (OPJ_UINT32)p_tx1;
915
+ l_current_poc->tyS = (OPJ_UINT32)p_ty0;
916
+ l_current_poc->tyE = (OPJ_UINT32)p_ty1;
917
+ l_current_poc->dx = p_dx_min;
918
+ l_current_poc->dy = p_dy_min;
919
+ ++ l_current_poc;
920
+ }
921
+ }
922
+
923
+ void opj_pi_update_encode_not_poc ( opj_cp_t *p_cp,
924
+ OPJ_UINT32 p_num_comps,
925
+ OPJ_UINT32 p_tileno,
926
+ OPJ_INT32 p_tx0,
927
+ OPJ_INT32 p_tx1,
928
+ OPJ_INT32 p_ty0,
929
+ OPJ_INT32 p_ty1,
930
+ OPJ_UINT32 p_max_prec,
931
+ OPJ_UINT32 p_max_res,
932
+ OPJ_UINT32 p_dx_min,
933
+ OPJ_UINT32 p_dy_min)
934
+ {
935
+ /* loop*/
936
+ OPJ_UINT32 pino;
937
+ /* tile coding parameter*/
938
+ opj_tcp_t *l_tcp = 00;
939
+ /* current poc being updated*/
940
+ opj_poc_t * l_current_poc = 00;
941
+ /* number of pocs*/
942
+ OPJ_UINT32 l_poc_bound;
943
+
944
+ /* preconditions in debug*/
945
+ assert(p_cp != 00);
946
+ assert(p_tileno < p_cp->tw * p_cp->th);
947
+
948
+ /* initializations*/
949
+ l_tcp = &p_cp->tcps [p_tileno];
950
+
951
+ /* number of iterations in the loop */
952
+ l_poc_bound = l_tcp->numpocs+1;
953
+
954
+ /* start at first element, and to make sure the compiler will not make a calculation each time in the loop
955
+ store a pointer to the current element to modify rather than l_tcp->pocs[i]*/
956
+ l_current_poc = l_tcp->pocs;
957
+
958
+ for (pino = 0; pino < l_poc_bound ; ++pino) {
959
+ l_current_poc->compS = 0;
960
+ l_current_poc->compE = p_num_comps;/*p_image->numcomps;*/
961
+ l_current_poc->resS = 0;
962
+ l_current_poc->resE = p_max_res;
963
+ l_current_poc->layS = 0;
964
+ l_current_poc->layE = l_tcp->numlayers;
965
+ l_current_poc->prg = l_tcp->prg;
966
+ l_current_poc->prcS = 0;
967
+ l_current_poc->prcE = p_max_prec;
968
+ l_current_poc->txS = (OPJ_UINT32)p_tx0;
969
+ l_current_poc->txE = (OPJ_UINT32)p_tx1;
970
+ l_current_poc->tyS = (OPJ_UINT32)p_ty0;
971
+ l_current_poc->tyE = (OPJ_UINT32)p_ty1;
972
+ l_current_poc->dx = p_dx_min;
973
+ l_current_poc->dy = p_dy_min;
974
+ ++ l_current_poc;
975
+ }
976
+ }
977
+
978
+ void opj_pi_update_decode_poc (opj_pi_iterator_t * p_pi,
979
+ opj_tcp_t * p_tcp,
980
+ OPJ_UINT32 p_max_precision,
981
+ OPJ_UINT32 p_max_res)
982
+ {
983
+ /* loop*/
984
+ OPJ_UINT32 pino;
985
+
986
+ /* encoding prameters to set*/
987
+ OPJ_UINT32 l_bound;
988
+
989
+ opj_pi_iterator_t * l_current_pi = 00;
990
+ opj_poc_t* l_current_poc = 0;
991
+
992
+ OPJ_ARG_NOT_USED(p_max_res);
993
+
994
+ /* preconditions in debug*/
995
+ assert(p_pi != 00);
996
+ assert(p_tcp != 00);
997
+
998
+ /* initializations*/
999
+ l_bound = p_tcp->numpocs+1;
1000
+ l_current_pi = p_pi;
1001
+ l_current_poc = p_tcp->pocs;
1002
+
1003
+ for (pino = 0;pino<l_bound;++pino) {
1004
+ l_current_pi->poc.prg = l_current_poc->prg; /* Progression Order #0 */
1005
+ l_current_pi->first = 1;
1006
+
1007
+ l_current_pi->poc.resno0 = l_current_poc->resno0; /* Resolution Level Index #0 (Start) */
1008
+ l_current_pi->poc.compno0 = l_current_poc->compno0; /* Component Index #0 (Start) */
1009
+ l_current_pi->poc.layno0 = 0;
1010
+ l_current_pi->poc.precno0 = 0;
1011
+ l_current_pi->poc.resno1 = l_current_poc->resno1; /* Resolution Level Index #0 (End) */
1012
+ l_current_pi->poc.compno1 = l_current_poc->compno1; /* Component Index #0 (End) */
1013
+ l_current_pi->poc.layno1 = l_current_poc->layno1; /* Layer Index #0 (End) */
1014
+ l_current_pi->poc.precno1 = p_max_precision;
1015
+ ++l_current_pi;
1016
+ ++l_current_poc;
1017
+ }
1018
+ }
1019
+
1020
+ void opj_pi_update_decode_not_poc (opj_pi_iterator_t * p_pi,
1021
+ opj_tcp_t * p_tcp,
1022
+ OPJ_UINT32 p_max_precision,
1023
+ OPJ_UINT32 p_max_res)
1024
+ {
1025
+ /* loop*/
1026
+ OPJ_UINT32 pino;
1027
+
1028
+ /* encoding prameters to set*/
1029
+ OPJ_UINT32 l_bound;
1030
+
1031
+ opj_pi_iterator_t * l_current_pi = 00;
1032
+ /* preconditions in debug*/
1033
+ assert(p_tcp != 00);
1034
+ assert(p_pi != 00);
1035
+
1036
+ /* initializations*/
1037
+ l_bound = p_tcp->numpocs+1;
1038
+ l_current_pi = p_pi;
1039
+
1040
+ for (pino = 0;pino<l_bound;++pino) {
1041
+ l_current_pi->poc.prg = p_tcp->prg;
1042
+ l_current_pi->first = 1;
1043
+ l_current_pi->poc.resno0 = 0;
1044
+ l_current_pi->poc.compno0 = 0;
1045
+ l_current_pi->poc.layno0 = 0;
1046
+ l_current_pi->poc.precno0 = 0;
1047
+ l_current_pi->poc.resno1 = p_max_res;
1048
+ l_current_pi->poc.compno1 = l_current_pi->numcomps;
1049
+ l_current_pi->poc.layno1 = p_tcp->numlayers;
1050
+ l_current_pi->poc.precno1 = p_max_precision;
1051
+ ++l_current_pi;
1052
+ }
1053
+ }
1054
+
1055
+
1056
+
1057
+ OPJ_BOOL opj_pi_check_next_level( OPJ_INT32 pos,
1058
+ opj_cp_t *cp,
1059
+ OPJ_UINT32 tileno,
1060
+ OPJ_UINT32 pino,
1061
+ const OPJ_CHAR *prog)
1062
+ {
1063
+ OPJ_INT32 i;
1064
+ opj_tcp_t *tcps =&cp->tcps[tileno];
1065
+ opj_poc_t *tcp = &tcps->pocs[pino];
1066
+
1067
+ if(pos>=0){
1068
+ for(i=pos;pos>=0;i--){
1069
+ switch(prog[i]){
1070
+ case 'R':
1071
+ if(tcp->res_t==tcp->resE){
1072
+ if(opj_pi_check_next_level(pos-1,cp,tileno,pino,prog)){
1073
+ return OPJ_TRUE;
1074
+ }else{
1075
+ return OPJ_FALSE;
1076
+ }
1077
+ }else{
1078
+ return OPJ_TRUE;
1079
+ }
1080
+ break;
1081
+ case 'C':
1082
+ if(tcp->comp_t==tcp->compE){
1083
+ if(opj_pi_check_next_level(pos-1,cp,tileno,pino,prog)){
1084
+ return OPJ_TRUE;
1085
+ }else{
1086
+ return OPJ_FALSE;
1087
+ }
1088
+ }else{
1089
+ return OPJ_TRUE;
1090
+ }
1091
+ break;
1092
+ case 'L':
1093
+ if(tcp->lay_t==tcp->layE){
1094
+ if(opj_pi_check_next_level(pos-1,cp,tileno,pino,prog)){
1095
+ return OPJ_TRUE;
1096
+ }else{
1097
+ return OPJ_FALSE;
1098
+ }
1099
+ }else{
1100
+ return OPJ_TRUE;
1101
+ }
1102
+ break;
1103
+ case 'P':
1104
+ switch(tcp->prg){
1105
+ case OPJ_LRCP||OPJ_RLCP:
1106
+ if(tcp->prc_t == tcp->prcE){
1107
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1108
+ return OPJ_TRUE;
1109
+ }else{
1110
+ return OPJ_FALSE;
1111
+ }
1112
+ }else{
1113
+ return OPJ_TRUE;
1114
+ }
1115
+ break;
1116
+ default:
1117
+ if(tcp->tx0_t == tcp->txE){
1118
+ /*TY*/
1119
+ if(tcp->ty0_t == tcp->tyE){
1120
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1121
+ return OPJ_TRUE;
1122
+ }else{
1123
+ return OPJ_FALSE;
1124
+ }
1125
+ }else{
1126
+ return OPJ_TRUE;
1127
+ }/*TY*/
1128
+ }else{
1129
+ return OPJ_TRUE;
1130
+ }
1131
+ break;
1132
+ }/*end case P*/
1133
+ }/*end switch*/
1134
+ }/*end for*/
1135
+ }/*end if*/
1136
+ return OPJ_FALSE;
1137
+ }
1138
+
1139
+
1140
+ /*
1141
+ ==========================================================
1142
+ Packet iterator interface
1143
+ ==========================================================
1144
+ */
1145
+ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
1146
+ opj_cp_t *p_cp,
1147
+ OPJ_UINT32 p_tile_no)
1148
+ {
1149
+ /* loop */
1150
+ OPJ_UINT32 pino;
1151
+ OPJ_UINT32 compno, resno;
1152
+
1153
+ /* to store w, h, dx and dy fro all components and resolutions */
1154
+ OPJ_UINT32 * l_tmp_data;
1155
+ OPJ_UINT32 ** l_tmp_ptr;
1156
+
1157
+ /* encoding prameters to set */
1158
+ OPJ_UINT32 l_max_res;
1159
+ OPJ_UINT32 l_max_prec;
1160
+ OPJ_INT32 l_tx0,l_tx1,l_ty0,l_ty1;
1161
+ OPJ_UINT32 l_dx_min,l_dy_min;
1162
+ OPJ_UINT32 l_bound;
1163
+ OPJ_UINT32 l_step_p , l_step_c , l_step_r , l_step_l ;
1164
+ OPJ_UINT32 l_data_stride;
1165
+
1166
+ /* pointers */
1167
+ opj_pi_iterator_t *l_pi = 00;
1168
+ opj_tcp_t *l_tcp = 00;
1169
+ const opj_tccp_t *l_tccp = 00;
1170
+ opj_pi_comp_t *l_current_comp = 00;
1171
+ opj_image_comp_t * l_img_comp = 00;
1172
+ opj_pi_iterator_t * l_current_pi = 00;
1173
+ OPJ_UINT32 * l_encoding_value_ptr = 00;
1174
+
1175
+ /* preconditions in debug */
1176
+ assert(p_cp != 00);
1177
+ assert(p_image != 00);
1178
+ assert(p_tile_no < p_cp->tw * p_cp->th);
1179
+
1180
+ /* initializations */
1181
+ l_tcp = &p_cp->tcps[p_tile_no];
1182
+ l_bound = l_tcp->numpocs+1;
1183
+
1184
+ l_data_stride = 4 * OPJ_J2K_MAXRLVLS;
1185
+ l_tmp_data = (OPJ_UINT32*)opj_malloc(
1186
+ l_data_stride * p_image->numcomps * sizeof(OPJ_UINT32));
1187
+ if
1188
+ (! l_tmp_data)
1189
+ {
1190
+ return 00;
1191
+ }
1192
+ l_tmp_ptr = (OPJ_UINT32**)opj_malloc(
1193
+ p_image->numcomps * sizeof(OPJ_UINT32 *));
1194
+ if
1195
+ (! l_tmp_ptr)
1196
+ {
1197
+ opj_free(l_tmp_data);
1198
+ return 00;
1199
+ }
1200
+
1201
+ /* memory allocation for pi */
1202
+ l_pi = opj_pi_create(p_image, p_cp, p_tile_no);
1203
+ if (!l_pi) {
1204
+ opj_free(l_tmp_data);
1205
+ opj_free(l_tmp_ptr);
1206
+ return 00;
1207
+ }
1208
+
1209
+ l_encoding_value_ptr = l_tmp_data;
1210
+ /* update pointer array */
1211
+ for
1212
+ (compno = 0; compno < p_image->numcomps; ++compno)
1213
+ {
1214
+ l_tmp_ptr[compno] = l_encoding_value_ptr;
1215
+ l_encoding_value_ptr += l_data_stride;
1216
+ }
1217
+ /* get encoding parameters */
1218
+ opj_get_all_encoding_parameters(p_image,p_cp,p_tile_no,&l_tx0,&l_tx1,&l_ty0,&l_ty1,&l_dx_min,&l_dy_min,&l_max_prec,&l_max_res,l_tmp_ptr);
1219
+
1220
+ /* step calculations */
1221
+ l_step_p = 1;
1222
+ l_step_c = l_max_prec * l_step_p;
1223
+ l_step_r = p_image->numcomps * l_step_c;
1224
+ l_step_l = l_max_res * l_step_r;
1225
+
1226
+ /* set values for first packet iterator */
1227
+ l_current_pi = l_pi;
1228
+
1229
+ /* memory allocation for include */
1230
+ l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
1231
+ if
1232
+ (!l_current_pi->include)
1233
+ {
1234
+ opj_free(l_tmp_data);
1235
+ opj_free(l_tmp_ptr);
1236
+ opj_pi_destroy(l_pi, l_bound);
1237
+ return 00;
1238
+ }
1239
+ memset(l_current_pi->include,0, (l_tcp->numlayers + 1) * l_step_l* sizeof(OPJ_INT16));
1240
+
1241
+ /* special treatment for the first packet iterator */
1242
+ l_current_comp = l_current_pi->comps;
1243
+ l_img_comp = p_image->comps;
1244
+ l_tccp = l_tcp->tccps;
1245
+
1246
+ l_current_pi->tx0 = l_tx0;
1247
+ l_current_pi->ty0 = l_ty0;
1248
+ l_current_pi->tx1 = l_tx1;
1249
+ l_current_pi->ty1 = l_ty1;
1250
+
1251
+ /*l_current_pi->dx = l_img_comp->dx;*/
1252
+ /*l_current_pi->dy = l_img_comp->dy;*/
1253
+
1254
+ l_current_pi->step_p = l_step_p;
1255
+ l_current_pi->step_c = l_step_c;
1256
+ l_current_pi->step_r = l_step_r;
1257
+ l_current_pi->step_l = l_step_l;
1258
+
1259
+ /* allocation for components and number of components has already been calculated by opj_pi_create */
1260
+ for
1261
+ (compno = 0; compno < l_current_pi->numcomps; ++compno)
1262
+ {
1263
+ opj_pi_resolution_t *l_res = l_current_comp->resolutions;
1264
+ l_encoding_value_ptr = l_tmp_ptr[compno];
1265
+
1266
+ l_current_comp->dx = l_img_comp->dx;
1267
+ l_current_comp->dy = l_img_comp->dy;
1268
+ /* resolutions have already been initialized */
1269
+ for
1270
+ (resno = 0; resno < l_current_comp->numresolutions; resno++)
1271
+ {
1272
+ l_res->pdx = *(l_encoding_value_ptr++);
1273
+ l_res->pdy = *(l_encoding_value_ptr++);
1274
+ l_res->pw = *(l_encoding_value_ptr++);
1275
+ l_res->ph = *(l_encoding_value_ptr++);
1276
+ ++l_res;
1277
+ }
1278
+ ++l_current_comp;
1279
+ ++l_img_comp;
1280
+ ++l_tccp;
1281
+ }
1282
+ ++l_current_pi;
1283
+
1284
+ for (pino = 1 ; pino<l_bound ; ++pino )
1285
+ {
1286
+ l_current_comp = l_current_pi->comps;
1287
+ l_img_comp = p_image->comps;
1288
+ l_tccp = l_tcp->tccps;
1289
+
1290
+ l_current_pi->tx0 = l_tx0;
1291
+ l_current_pi->ty0 = l_ty0;
1292
+ l_current_pi->tx1 = l_tx1;
1293
+ l_current_pi->ty1 = l_ty1;
1294
+ /*l_current_pi->dx = l_dx_min;*/
1295
+ /*l_current_pi->dy = l_dy_min;*/
1296
+ l_current_pi->step_p = l_step_p;
1297
+ l_current_pi->step_c = l_step_c;
1298
+ l_current_pi->step_r = l_step_r;
1299
+ l_current_pi->step_l = l_step_l;
1300
+
1301
+ /* allocation for components and number of components has already been calculated by opj_pi_create */
1302
+ for
1303
+ (compno = 0; compno < l_current_pi->numcomps; ++compno)
1304
+ {
1305
+ opj_pi_resolution_t *l_res = l_current_comp->resolutions;
1306
+ l_encoding_value_ptr = l_tmp_ptr[compno];
1307
+
1308
+ l_current_comp->dx = l_img_comp->dx;
1309
+ l_current_comp->dy = l_img_comp->dy;
1310
+ /* resolutions have already been initialized */
1311
+ for
1312
+ (resno = 0; resno < l_current_comp->numresolutions; resno++)
1313
+ {
1314
+ l_res->pdx = *(l_encoding_value_ptr++);
1315
+ l_res->pdy = *(l_encoding_value_ptr++);
1316
+ l_res->pw = *(l_encoding_value_ptr++);
1317
+ l_res->ph = *(l_encoding_value_ptr++);
1318
+ ++l_res;
1319
+ }
1320
+ ++l_current_comp;
1321
+ ++l_img_comp;
1322
+ ++l_tccp;
1323
+ }
1324
+ /* special treatment*/
1325
+ l_current_pi->include = (l_current_pi-1)->include;
1326
+ ++l_current_pi;
1327
+ }
1328
+ opj_free(l_tmp_data);
1329
+ l_tmp_data = 00;
1330
+ opj_free(l_tmp_ptr);
1331
+ l_tmp_ptr = 00;
1332
+ if
1333
+ (l_tcp->POC)
1334
+ {
1335
+ opj_pi_update_decode_poc (l_pi,l_tcp,l_max_prec,l_max_res);
1336
+ }
1337
+ else
1338
+ {
1339
+ opj_pi_update_decode_not_poc(l_pi,l_tcp,l_max_prec,l_max_res);
1340
+ }
1341
+ return l_pi;
1342
+ }
1343
+
1344
+
1345
+
1346
+ opj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *p_image,
1347
+ opj_cp_t *p_cp,
1348
+ OPJ_UINT32 p_tile_no,
1349
+ J2K_T2_MODE p_t2_mode )
1350
+ {
1351
+ /* loop*/
1352
+ OPJ_UINT32 pino;
1353
+ OPJ_UINT32 compno, resno;
1354
+
1355
+ /* to store w, h, dx and dy fro all components and resolutions*/
1356
+ OPJ_UINT32 * l_tmp_data;
1357
+ OPJ_UINT32 ** l_tmp_ptr;
1358
+
1359
+ /* encoding prameters to set*/
1360
+ OPJ_UINT32 l_max_res;
1361
+ OPJ_UINT32 l_max_prec;
1362
+ OPJ_INT32 l_tx0,l_tx1,l_ty0,l_ty1;
1363
+ OPJ_UINT32 l_dx_min,l_dy_min;
1364
+ OPJ_UINT32 l_bound;
1365
+ OPJ_UINT32 l_step_p , l_step_c , l_step_r , l_step_l ;
1366
+ OPJ_UINT32 l_data_stride;
1367
+
1368
+ /* pointers*/
1369
+ opj_pi_iterator_t *l_pi = 00;
1370
+ opj_tcp_t *l_tcp = 00;
1371
+ const opj_tccp_t *l_tccp = 00;
1372
+ opj_pi_comp_t *l_current_comp = 00;
1373
+ opj_image_comp_t * l_img_comp = 00;
1374
+ opj_pi_iterator_t * l_current_pi = 00;
1375
+ OPJ_UINT32 * l_encoding_value_ptr = 00;
1376
+
1377
+ /* preconditions in debug*/
1378
+ assert(p_cp != 00);
1379
+ assert(p_image != 00);
1380
+ assert(p_tile_no < p_cp->tw * p_cp->th);
1381
+
1382
+ /* initializations*/
1383
+ l_tcp = &p_cp->tcps[p_tile_no];
1384
+ l_bound = l_tcp->numpocs+1;
1385
+
1386
+ l_data_stride = 4 * OPJ_J2K_MAXRLVLS;
1387
+ l_tmp_data = (OPJ_UINT32*)opj_malloc(
1388
+ l_data_stride * p_image->numcomps * sizeof(OPJ_UINT32));
1389
+ if (! l_tmp_data) {
1390
+ return 00;
1391
+ }
1392
+
1393
+ l_tmp_ptr = (OPJ_UINT32**)opj_malloc(
1394
+ p_image->numcomps * sizeof(OPJ_UINT32 *));
1395
+ if (! l_tmp_ptr) {
1396
+ opj_free(l_tmp_data);
1397
+ return 00;
1398
+ }
1399
+
1400
+ /* memory allocation for pi*/
1401
+ l_pi = opj_pi_create(p_image,p_cp,p_tile_no);
1402
+ if (!l_pi) {
1403
+ opj_free(l_tmp_data);
1404
+ opj_free(l_tmp_ptr);
1405
+ return 00;
1406
+ }
1407
+
1408
+ l_encoding_value_ptr = l_tmp_data;
1409
+ /* update pointer array*/
1410
+ for (compno = 0; compno < p_image->numcomps; ++compno) {
1411
+ l_tmp_ptr[compno] = l_encoding_value_ptr;
1412
+ l_encoding_value_ptr += l_data_stride;
1413
+ }
1414
+
1415
+ /* get encoding parameters*/
1416
+ opj_get_all_encoding_parameters(p_image,p_cp,p_tile_no,&l_tx0,&l_tx1,&l_ty0,&l_ty1,&l_dx_min,&l_dy_min,&l_max_prec,&l_max_res,l_tmp_ptr);
1417
+
1418
+ /* step calculations*/
1419
+ l_step_p = 1;
1420
+ l_step_c = l_max_prec * l_step_p;
1421
+ l_step_r = p_image->numcomps * l_step_c;
1422
+ l_step_l = l_max_res * l_step_r;
1423
+
1424
+ /* set values for first packet iterator*/
1425
+ l_pi->tp_on = p_cp->m_specific_param.m_enc.m_tp_on;
1426
+ l_current_pi = l_pi;
1427
+
1428
+ /* memory allocation for include*/
1429
+ l_current_pi->include = (OPJ_INT16*) opj_calloc(l_tcp->numlayers * l_step_l, sizeof(OPJ_INT16));
1430
+ if (!l_current_pi->include) {
1431
+ opj_free(l_tmp_data);
1432
+ opj_free(l_tmp_ptr);
1433
+ opj_pi_destroy(l_pi, l_bound);
1434
+ return 00;
1435
+ }
1436
+ memset(l_current_pi->include,0,l_tcp->numlayers * l_step_l* sizeof(OPJ_INT16));
1437
+
1438
+ /* special treatment for the first packet iterator*/
1439
+ l_current_comp = l_current_pi->comps;
1440
+ l_img_comp = p_image->comps;
1441
+ l_tccp = l_tcp->tccps;
1442
+ l_current_pi->tx0 = l_tx0;
1443
+ l_current_pi->ty0 = l_ty0;
1444
+ l_current_pi->tx1 = l_tx1;
1445
+ l_current_pi->ty1 = l_ty1;
1446
+ l_current_pi->dx = l_dx_min;
1447
+ l_current_pi->dy = l_dy_min;
1448
+ l_current_pi->step_p = l_step_p;
1449
+ l_current_pi->step_c = l_step_c;
1450
+ l_current_pi->step_r = l_step_r;
1451
+ l_current_pi->step_l = l_step_l;
1452
+
1453
+ /* allocation for components and number of components has already been calculated by opj_pi_create */
1454
+ for (compno = 0; compno < l_current_pi->numcomps; ++compno) {
1455
+ opj_pi_resolution_t *l_res = l_current_comp->resolutions;
1456
+ l_encoding_value_ptr = l_tmp_ptr[compno];
1457
+
1458
+ l_current_comp->dx = l_img_comp->dx;
1459
+ l_current_comp->dy = l_img_comp->dy;
1460
+
1461
+ /* resolutions have already been initialized */
1462
+ for (resno = 0; resno < l_current_comp->numresolutions; resno++) {
1463
+ l_res->pdx = *(l_encoding_value_ptr++);
1464
+ l_res->pdy = *(l_encoding_value_ptr++);
1465
+ l_res->pw = *(l_encoding_value_ptr++);
1466
+ l_res->ph = *(l_encoding_value_ptr++);
1467
+ ++l_res;
1468
+ }
1469
+
1470
+ ++l_current_comp;
1471
+ ++l_img_comp;
1472
+ ++l_tccp;
1473
+ }
1474
+ ++l_current_pi;
1475
+
1476
+ for (pino = 1 ; pino<l_bound ; ++pino ) {
1477
+ l_current_comp = l_current_pi->comps;
1478
+ l_img_comp = p_image->comps;
1479
+ l_tccp = l_tcp->tccps;
1480
+
1481
+ l_current_pi->tx0 = l_tx0;
1482
+ l_current_pi->ty0 = l_ty0;
1483
+ l_current_pi->tx1 = l_tx1;
1484
+ l_current_pi->ty1 = l_ty1;
1485
+ l_current_pi->dx = l_dx_min;
1486
+ l_current_pi->dy = l_dy_min;
1487
+ l_current_pi->step_p = l_step_p;
1488
+ l_current_pi->step_c = l_step_c;
1489
+ l_current_pi->step_r = l_step_r;
1490
+ l_current_pi->step_l = l_step_l;
1491
+
1492
+ /* allocation for components and number of components has already been calculated by opj_pi_create */
1493
+ for (compno = 0; compno < l_current_pi->numcomps; ++compno) {
1494
+ opj_pi_resolution_t *l_res = l_current_comp->resolutions;
1495
+ l_encoding_value_ptr = l_tmp_ptr[compno];
1496
+
1497
+ l_current_comp->dx = l_img_comp->dx;
1498
+ l_current_comp->dy = l_img_comp->dy;
1499
+ /* resolutions have already been initialized */
1500
+ for (resno = 0; resno < l_current_comp->numresolutions; resno++) {
1501
+ l_res->pdx = *(l_encoding_value_ptr++);
1502
+ l_res->pdy = *(l_encoding_value_ptr++);
1503
+ l_res->pw = *(l_encoding_value_ptr++);
1504
+ l_res->ph = *(l_encoding_value_ptr++);
1505
+ ++l_res;
1506
+ }
1507
+ ++l_current_comp;
1508
+ ++l_img_comp;
1509
+ ++l_tccp;
1510
+ }
1511
+
1512
+ /* special treatment*/
1513
+ l_current_pi->include = (l_current_pi-1)->include;
1514
+ ++l_current_pi;
1515
+ }
1516
+
1517
+ opj_free(l_tmp_data);
1518
+ l_tmp_data = 00;
1519
+ opj_free(l_tmp_ptr);
1520
+ l_tmp_ptr = 00;
1521
+
1522
+ if (l_tcp->POC && ( p_cp->m_specific_param.m_enc.m_cinema || p_t2_mode == FINAL_PASS)) {
1523
+ opj_pi_update_encode_poc_and_final(p_cp,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);
1524
+ }
1525
+ else {
1526
+ opj_pi_update_encode_not_poc(p_cp,p_image->numcomps,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);
1527
+ }
1528
+
1529
+ return l_pi;
1530
+ }
1531
+
1532
+ void opj_pi_create_encode( opj_pi_iterator_t *pi,
1533
+ opj_cp_t *cp,
1534
+ OPJ_UINT32 tileno,
1535
+ OPJ_UINT32 pino,
1536
+ OPJ_UINT32 tpnum,
1537
+ OPJ_INT32 tppos,
1538
+ J2K_T2_MODE t2_mode)
1539
+ {
1540
+ const OPJ_CHAR *prog;
1541
+ OPJ_INT32 i;
1542
+ OPJ_UINT32 incr_top=1,resetX=0;
1543
+ opj_tcp_t *tcps =&cp->tcps[tileno];
1544
+ opj_poc_t *tcp= &tcps->pocs[pino];
1545
+
1546
+ prog = opj_j2k_convert_progression_order(tcp->prg);
1547
+
1548
+ pi[pino].first = 1;
1549
+ pi[pino].poc.prg = tcp->prg;
1550
+
1551
+ if(!(cp->m_specific_param.m_enc.m_tp_on && ((!cp->m_specific_param.m_enc.m_cinema && (t2_mode == FINAL_PASS)) || cp->m_specific_param.m_enc.m_cinema))){
1552
+ pi[pino].poc.resno0 = tcp->resS;
1553
+ pi[pino].poc.resno1 = tcp->resE;
1554
+ pi[pino].poc.compno0 = tcp->compS;
1555
+ pi[pino].poc.compno1 = tcp->compE;
1556
+ pi[pino].poc.layno0 = tcp->layS;
1557
+ pi[pino].poc.layno1 = tcp->layE;
1558
+ pi[pino].poc.precno0 = tcp->prcS;
1559
+ pi[pino].poc.precno1 = tcp->prcE;
1560
+ pi[pino].poc.tx0 = (OPJ_INT32)tcp->txS;
1561
+ pi[pino].poc.ty0 = (OPJ_INT32)tcp->tyS;
1562
+ pi[pino].poc.tx1 = (OPJ_INT32)tcp->txE;
1563
+ pi[pino].poc.ty1 = (OPJ_INT32)tcp->tyE;
1564
+ }else {
1565
+ for(i=tppos+1;i<4;i++){
1566
+ switch(prog[i]){
1567
+ case 'R':
1568
+ pi[pino].poc.resno0 = tcp->resS;
1569
+ pi[pino].poc.resno1 = tcp->resE;
1570
+ break;
1571
+ case 'C':
1572
+ pi[pino].poc.compno0 = tcp->compS;
1573
+ pi[pino].poc.compno1 = tcp->compE;
1574
+ break;
1575
+ case 'L':
1576
+ pi[pino].poc.layno0 = tcp->layS;
1577
+ pi[pino].poc.layno1 = tcp->layE;
1578
+ break;
1579
+ case 'P':
1580
+ switch(tcp->prg){
1581
+ case OPJ_LRCP:
1582
+ case OPJ_RLCP:
1583
+ pi[pino].poc.precno0 = tcp->prcS;
1584
+ pi[pino].poc.precno1 = tcp->prcE;
1585
+ break;
1586
+ default:
1587
+ pi[pino].poc.tx0 = (OPJ_INT32)tcp->txS;
1588
+ pi[pino].poc.ty0 = (OPJ_INT32)tcp->tyS;
1589
+ pi[pino].poc.tx1 = (OPJ_INT32)tcp->txE;
1590
+ pi[pino].poc.ty1 = (OPJ_INT32)tcp->tyE;
1591
+ break;
1592
+ }
1593
+ break;
1594
+ }
1595
+ }
1596
+
1597
+ if(tpnum==0){
1598
+ for(i=tppos;i>=0;i--){
1599
+ switch(prog[i]){
1600
+ case 'C':
1601
+ tcp->comp_t = tcp->compS;
1602
+ pi[pino].poc.compno0 = tcp->comp_t;
1603
+ pi[pino].poc.compno1 = tcp->comp_t+1;
1604
+ tcp->comp_t+=1;
1605
+ break;
1606
+ case 'R':
1607
+ tcp->res_t = tcp->resS;
1608
+ pi[pino].poc.resno0 = tcp->res_t;
1609
+ pi[pino].poc.resno1 = tcp->res_t+1;
1610
+ tcp->res_t+=1;
1611
+ break;
1612
+ case 'L':
1613
+ tcp->lay_t = tcp->layS;
1614
+ pi[pino].poc.layno0 = tcp->lay_t;
1615
+ pi[pino].poc.layno1 = tcp->lay_t+1;
1616
+ tcp->lay_t+=1;
1617
+ break;
1618
+ case 'P':
1619
+ switch(tcp->prg){
1620
+ case OPJ_LRCP:
1621
+ case OPJ_RLCP:
1622
+ tcp->prc_t = tcp->prcS;
1623
+ pi[pino].poc.precno0 = tcp->prc_t;
1624
+ pi[pino].poc.precno1 = tcp->prc_t+1;
1625
+ tcp->prc_t+=1;
1626
+ break;
1627
+ default:
1628
+ tcp->tx0_t = tcp->txS;
1629
+ tcp->ty0_t = tcp->tyS;
1630
+ pi[pino].poc.tx0 = (OPJ_INT32)tcp->tx0_t;
1631
+ pi[pino].poc.tx1 = (OPJ_INT32)(tcp->tx0_t + tcp->dx - (tcp->tx0_t % tcp->dx));
1632
+ pi[pino].poc.ty0 = (OPJ_INT32)tcp->ty0_t;
1633
+ pi[pino].poc.ty1 = (OPJ_INT32)(tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy));
1634
+ tcp->tx0_t = (OPJ_UINT32)pi[pino].poc.tx1;
1635
+ tcp->ty0_t = (OPJ_UINT32)pi[pino].poc.ty1;
1636
+ break;
1637
+ }
1638
+ break;
1639
+ }
1640
+ }
1641
+ incr_top=1;
1642
+ }else{
1643
+ for(i=tppos;i>=0;i--){
1644
+ switch(prog[i]){
1645
+ case 'C':
1646
+ pi[pino].poc.compno0 = tcp->comp_t-1;
1647
+ pi[pino].poc.compno1 = tcp->comp_t;
1648
+ break;
1649
+ case 'R':
1650
+ pi[pino].poc.resno0 = tcp->res_t-1;
1651
+ pi[pino].poc.resno1 = tcp->res_t;
1652
+ break;
1653
+ case 'L':
1654
+ pi[pino].poc.layno0 = tcp->lay_t-1;
1655
+ pi[pino].poc.layno1 = tcp->lay_t;
1656
+ break;
1657
+ case 'P':
1658
+ switch(tcp->prg){
1659
+ case OPJ_LRCP:
1660
+ case OPJ_RLCP:
1661
+ pi[pino].poc.precno0 = tcp->prc_t-1;
1662
+ pi[pino].poc.precno1 = tcp->prc_t;
1663
+ break;
1664
+ default:
1665
+ pi[pino].poc.tx0 = (OPJ_INT32)(tcp->tx0_t - tcp->dx - (tcp->tx0_t % tcp->dx));
1666
+ pi[pino].poc.tx1 = (OPJ_INT32)tcp->tx0_t ;
1667
+ pi[pino].poc.ty0 = (OPJ_INT32)(tcp->ty0_t - tcp->dy - (tcp->ty0_t % tcp->dy));
1668
+ pi[pino].poc.ty1 = (OPJ_INT32)tcp->ty0_t ;
1669
+ break;
1670
+ }
1671
+ break;
1672
+ }
1673
+ if(incr_top==1){
1674
+ switch(prog[i]){
1675
+ case 'R':
1676
+ if(tcp->res_t==tcp->resE){
1677
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1678
+ tcp->res_t = tcp->resS;
1679
+ pi[pino].poc.resno0 = tcp->res_t;
1680
+ pi[pino].poc.resno1 = tcp->res_t+1;
1681
+ tcp->res_t+=1;
1682
+ incr_top=1;
1683
+ }else{
1684
+ incr_top=0;
1685
+ }
1686
+ }else{
1687
+ pi[pino].poc.resno0 = tcp->res_t;
1688
+ pi[pino].poc.resno1 = tcp->res_t+1;
1689
+ tcp->res_t+=1;
1690
+ incr_top=0;
1691
+ }
1692
+ break;
1693
+ case 'C':
1694
+ if(tcp->comp_t ==tcp->compE){
1695
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1696
+ tcp->comp_t = tcp->compS;
1697
+ pi[pino].poc.compno0 = tcp->comp_t;
1698
+ pi[pino].poc.compno1 = tcp->comp_t+1;
1699
+ tcp->comp_t+=1;
1700
+ incr_top=1;
1701
+ }else{
1702
+ incr_top=0;
1703
+ }
1704
+ }else{
1705
+ pi[pino].poc.compno0 = tcp->comp_t;
1706
+ pi[pino].poc.compno1 = tcp->comp_t+1;
1707
+ tcp->comp_t+=1;
1708
+ incr_top=0;
1709
+ }
1710
+ break;
1711
+ case 'L':
1712
+ if(tcp->lay_t == tcp->layE){
1713
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1714
+ tcp->lay_t = tcp->layS;
1715
+ pi[pino].poc.layno0 = tcp->lay_t;
1716
+ pi[pino].poc.layno1 = tcp->lay_t+1;
1717
+ tcp->lay_t+=1;
1718
+ incr_top=1;
1719
+ }else{
1720
+ incr_top=0;
1721
+ }
1722
+ }else{
1723
+ pi[pino].poc.layno0 = tcp->lay_t;
1724
+ pi[pino].poc.layno1 = tcp->lay_t+1;
1725
+ tcp->lay_t+=1;
1726
+ incr_top=0;
1727
+ }
1728
+ break;
1729
+ case 'P':
1730
+ switch(tcp->prg){
1731
+ case OPJ_LRCP:
1732
+ case OPJ_RLCP:
1733
+ if(tcp->prc_t == tcp->prcE){
1734
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1735
+ tcp->prc_t = tcp->prcS;
1736
+ pi[pino].poc.precno0 = tcp->prc_t;
1737
+ pi[pino].poc.precno1 = tcp->prc_t+1;
1738
+ tcp->prc_t+=1;
1739
+ incr_top=1;
1740
+ }else{
1741
+ incr_top=0;
1742
+ }
1743
+ }else{
1744
+ pi[pino].poc.precno0 = tcp->prc_t;
1745
+ pi[pino].poc.precno1 = tcp->prc_t+1;
1746
+ tcp->prc_t+=1;
1747
+ incr_top=0;
1748
+ }
1749
+ break;
1750
+ default:
1751
+ if(tcp->tx0_t >= tcp->txE){
1752
+ if(tcp->ty0_t >= tcp->tyE){
1753
+ if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){
1754
+ tcp->ty0_t = tcp->tyS;
1755
+ pi[pino].poc.ty0 = (OPJ_INT32)tcp->ty0_t;
1756
+ pi[pino].poc.ty1 = (OPJ_INT32)(tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy));
1757
+ tcp->ty0_t = (OPJ_UINT32)pi[pino].poc.ty1;
1758
+ incr_top=1;resetX=1;
1759
+ }else{
1760
+ incr_top=0;resetX=0;
1761
+ }
1762
+ }else{
1763
+ pi[pino].poc.ty0 = (OPJ_INT32)tcp->ty0_t;
1764
+ pi[pino].poc.ty1 = (OPJ_INT32)(tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy));
1765
+ tcp->ty0_t = (OPJ_UINT32)pi[pino].poc.ty1;
1766
+ incr_top=0;resetX=1;
1767
+ }
1768
+ if(resetX==1){
1769
+ tcp->tx0_t = tcp->txS;
1770
+ pi[pino].poc.tx0 = (OPJ_INT32)tcp->tx0_t;
1771
+ pi[pino].poc.tx1 = (OPJ_INT32)(tcp->tx0_t + tcp->dx- (tcp->tx0_t % tcp->dx));
1772
+ tcp->tx0_t = (OPJ_UINT32)pi[pino].poc.tx1;
1773
+ }
1774
+ }else{
1775
+ pi[pino].poc.tx0 = (OPJ_INT32)tcp->tx0_t;
1776
+ pi[pino].poc.tx1 = (OPJ_INT32)(tcp->tx0_t + tcp->dx- (tcp->tx0_t % tcp->dx));
1777
+ tcp->tx0_t = (OPJ_UINT32)pi[pino].poc.tx1;
1778
+ incr_top=0;
1779
+ }
1780
+ break;
1781
+ }
1782
+ break;
1783
+ }
1784
+ }
1785
+ }
1786
+ }
1787
+ }
1788
+ }
1789
+
1790
+ void opj_pi_destroy(opj_pi_iterator_t *p_pi,
1791
+ OPJ_UINT32 p_nb_elements)
1792
+ {
1793
+ OPJ_UINT32 compno, pino;
1794
+ opj_pi_iterator_t *l_current_pi = p_pi;
1795
+ if (p_pi) {
1796
+ if (p_pi->include) {
1797
+ opj_free(p_pi->include);
1798
+ p_pi->include = 00;
1799
+ }
1800
+ for (pino = 0; pino < p_nb_elements; ++pino){
1801
+ if(l_current_pi->comps) {
1802
+ opj_pi_comp_t *l_current_component = l_current_pi->comps;
1803
+ for (compno = 0; compno < l_current_pi->numcomps; compno++){
1804
+ if(l_current_component->resolutions) {
1805
+ opj_free(l_current_component->resolutions);
1806
+ l_current_component->resolutions = 00;
1807
+ }
1808
+
1809
+ ++l_current_component;
1810
+ }
1811
+ opj_free(l_current_pi->comps);
1812
+ l_current_pi->comps = 0;
1813
+ }
1814
+ ++l_current_pi;
1815
+ }
1816
+ opj_free(p_pi);
1817
+ }
1818
+ }
1819
+
1820
+
1821
+
1822
+ void opj_pi_update_encoding_parameters( const opj_image_t *p_image,
1823
+ opj_cp_t *p_cp,
1824
+ OPJ_UINT32 p_tile_no )
1825
+ {
1826
+ /* encoding parameters to set */
1827
+ OPJ_UINT32 l_max_res;
1828
+ OPJ_UINT32 l_max_prec;
1829
+ OPJ_INT32 l_tx0,l_tx1,l_ty0,l_ty1;
1830
+ OPJ_UINT32 l_dx_min,l_dy_min;
1831
+
1832
+ /* pointers */
1833
+ opj_tcp_t *l_tcp = 00;
1834
+
1835
+ /* preconditions */
1836
+ assert(p_cp != 00);
1837
+ assert(p_image != 00);
1838
+ assert(p_tile_no < p_cp->tw * p_cp->th);
1839
+
1840
+ l_tcp = &(p_cp->tcps[p_tile_no]);
1841
+
1842
+ /* get encoding parameters */
1843
+ opj_get_encoding_parameters(p_image,p_cp,p_tile_no,&l_tx0,&l_tx1,&l_ty0,&l_ty1,&l_dx_min,&l_dy_min,&l_max_prec,&l_max_res);
1844
+
1845
+ if (l_tcp->POC) {
1846
+ opj_pi_update_encode_poc_and_final(p_cp,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);
1847
+ }
1848
+ else {
1849
+ opj_pi_update_encode_not_poc(p_cp,p_image->numcomps,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);
1850
+ }
1851
+ }
1852
+
1853
+ OPJ_BOOL opj_pi_next(opj_pi_iterator_t * pi) {
1854
+ switch (pi->poc.prg) {
1855
+ case OPJ_LRCP:
1856
+ return opj_pi_next_lrcp(pi);
1857
+ case OPJ_RLCP:
1858
+ return opj_pi_next_rlcp(pi);
1859
+ case OPJ_RPCL:
1860
+ return opj_pi_next_rpcl(pi);
1861
+ case OPJ_PCRL:
1862
+ return opj_pi_next_pcrl(pi);
1863
+ case OPJ_CPRL:
1864
+ return opj_pi_next_cprl(pi);
1865
+ case OPJ_PROG_UNKNOWN:
1866
+ return OPJ_FALSE;
1867
+ }
1868
+
1869
+ return OPJ_FALSE;
1870
+ }