rfreeimage 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (860) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +1 -0
  4. data/Rakefile +34 -0
  5. data/ext/rfreeimage/extconf.rb +35 -0
  6. data/ext/rfreeimage/rfi_main.c +389 -0
  7. data/lib/rfreeimage/image.rb +26 -0
  8. data/lib/rfreeimage/version.rb +3 -0
  9. data/lib/rfreeimage.rb +3 -0
  10. data/rfreeimage.gemspec +32 -0
  11. data/vendor/FreeImage/Makefile +34 -0
  12. data/vendor/FreeImage/Makefile.cygwin +74 -0
  13. data/vendor/FreeImage/Makefile.fip +84 -0
  14. data/vendor/FreeImage/Makefile.gnu +83 -0
  15. data/vendor/FreeImage/Makefile.iphone +96 -0
  16. data/vendor/FreeImage/Makefile.mingw +136 -0
  17. data/vendor/FreeImage/Makefile.osx +115 -0
  18. data/vendor/FreeImage/Makefile.solaris +66 -0
  19. data/vendor/FreeImage/Makefile.srcs +6 -0
  20. data/vendor/FreeImage/README.iphone +19 -0
  21. data/vendor/FreeImage/README.linux +50 -0
  22. data/vendor/FreeImage/README.minGW +236 -0
  23. data/vendor/FreeImage/README.osx +44 -0
  24. data/vendor/FreeImage/README.solaris +67 -0
  25. data/vendor/FreeImage/Source/CacheFile.h +92 -0
  26. data/vendor/FreeImage/Source/DeprecationManager/Deprecated.cpp +36 -0
  27. data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.cpp +103 -0
  28. data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.h +83 -0
  29. data/vendor/FreeImage/Source/FreeImage/BitmapAccess.cpp +1573 -0
  30. data/vendor/FreeImage/Source/FreeImage/CacheFile.cpp +271 -0
  31. data/vendor/FreeImage/Source/FreeImage/ColorLookup.cpp +785 -0
  32. data/vendor/FreeImage/Source/FreeImage/Conversion.cpp +551 -0
  33. data/vendor/FreeImage/Source/FreeImage/Conversion16_555.cpp +209 -0
  34. data/vendor/FreeImage/Source/FreeImage/Conversion16_565.cpp +204 -0
  35. data/vendor/FreeImage/Source/FreeImage/Conversion24.cpp +252 -0
  36. data/vendor/FreeImage/Source/FreeImage/Conversion32.cpp +345 -0
  37. data/vendor/FreeImage/Source/FreeImage/Conversion4.cpp +246 -0
  38. data/vendor/FreeImage/Source/FreeImage/Conversion8.cpp +305 -0
  39. data/vendor/FreeImage/Source/FreeImage/ConversionFloat.cpp +194 -0
  40. data/vendor/FreeImage/Source/FreeImage/ConversionRGB16.cpp +144 -0
  41. data/vendor/FreeImage/Source/FreeImage/ConversionRGBA16.cpp +147 -0
  42. data/vendor/FreeImage/Source/FreeImage/ConversionRGBAF.cpp +250 -0
  43. data/vendor/FreeImage/Source/FreeImage/ConversionRGBF.cpp +243 -0
  44. data/vendor/FreeImage/Source/FreeImage/ConversionType.cpp +699 -0
  45. data/vendor/FreeImage/Source/FreeImage/ConversionUINT16.cpp +134 -0
  46. data/vendor/FreeImage/Source/FreeImage/FreeImage.cpp +226 -0
  47. data/vendor/FreeImage/Source/FreeImage/FreeImageC.c +22 -0
  48. data/vendor/FreeImage/Source/FreeImage/FreeImageIO.cpp +175 -0
  49. data/vendor/FreeImage/Source/FreeImage/GetType.cpp +92 -0
  50. data/vendor/FreeImage/Source/FreeImage/Halftoning.cpp +474 -0
  51. data/vendor/FreeImage/Source/FreeImage/J2KHelper.cpp +591 -0
  52. data/vendor/FreeImage/Source/FreeImage/J2KHelper.h +36 -0
  53. data/vendor/FreeImage/Source/FreeImage/LFPQuantizer.cpp +208 -0
  54. data/vendor/FreeImage/Source/FreeImage/MNGHelper.cpp +1320 -0
  55. data/vendor/FreeImage/Source/FreeImage/MemoryIO.cpp +237 -0
  56. data/vendor/FreeImage/Source/FreeImage/MultiPage.cpp +974 -0
  57. data/vendor/FreeImage/Source/FreeImage/NNQuantizer.cpp +507 -0
  58. data/vendor/FreeImage/Source/FreeImage/PSDParser.cpp +1057 -0
  59. data/vendor/FreeImage/Source/FreeImage/PSDParser.h +271 -0
  60. data/vendor/FreeImage/Source/FreeImage/PixelAccess.cpp +197 -0
  61. data/vendor/FreeImage/Source/FreeImage/Plugin.cpp +822 -0
  62. data/vendor/FreeImage/Source/FreeImage/PluginBMP.cpp +1494 -0
  63. data/vendor/FreeImage/Source/FreeImage/PluginCUT.cpp +240 -0
  64. data/vendor/FreeImage/Source/FreeImage/PluginDDS.cpp +655 -0
  65. data/vendor/FreeImage/Source/FreeImage/PluginEXR.cpp +773 -0
  66. data/vendor/FreeImage/Source/FreeImage/PluginG3.cpp +433 -0
  67. data/vendor/FreeImage/Source/FreeImage/PluginGIF.cpp +1407 -0
  68. data/vendor/FreeImage/Source/FreeImage/PluginHDR.cpp +722 -0
  69. data/vendor/FreeImage/Source/FreeImage/PluginICO.cpp +824 -0
  70. data/vendor/FreeImage/Source/FreeImage/PluginIFF.cpp +459 -0
  71. data/vendor/FreeImage/Source/FreeImage/PluginJ2K.cpp +328 -0
  72. data/vendor/FreeImage/Source/FreeImage/PluginJNG.cpp +162 -0
  73. data/vendor/FreeImage/Source/FreeImage/PluginJP2.cpp +328 -0
  74. data/vendor/FreeImage/Source/FreeImage/PluginJPEG.cpp +1706 -0
  75. data/vendor/FreeImage/Source/FreeImage/PluginJXR.cpp +1475 -0
  76. data/vendor/FreeImage/Source/FreeImage/PluginKOALA.cpp +243 -0
  77. data/vendor/FreeImage/Source/FreeImage/PluginMNG.cpp +153 -0
  78. data/vendor/FreeImage/Source/FreeImage/PluginPCD.cpp +251 -0
  79. data/vendor/FreeImage/Source/FreeImage/PluginPCX.cpp +659 -0
  80. data/vendor/FreeImage/Source/FreeImage/PluginPFM.cpp +409 -0
  81. data/vendor/FreeImage/Source/FreeImage/PluginPICT.cpp +1343 -0
  82. data/vendor/FreeImage/Source/FreeImage/PluginPNG.cpp +1115 -0
  83. data/vendor/FreeImage/Source/FreeImage/PluginPNM.cpp +838 -0
  84. data/vendor/FreeImage/Source/FreeImage/PluginPSD.cpp +131 -0
  85. data/vendor/FreeImage/Source/FreeImage/PluginRAS.cpp +512 -0
  86. data/vendor/FreeImage/Source/FreeImage/PluginRAW.cpp +793 -0
  87. data/vendor/FreeImage/Source/FreeImage/PluginSGI.cpp +425 -0
  88. data/vendor/FreeImage/Source/FreeImage/PluginTARGA.cpp +1591 -0
  89. data/vendor/FreeImage/Source/FreeImage/PluginTIFF.cpp +2631 -0
  90. data/vendor/FreeImage/Source/FreeImage/PluginWBMP.cpp +372 -0
  91. data/vendor/FreeImage/Source/FreeImage/PluginWebP.cpp +698 -0
  92. data/vendor/FreeImage/Source/FreeImage/PluginXBM.cpp +399 -0
  93. data/vendor/FreeImage/Source/FreeImage/PluginXPM.cpp +487 -0
  94. data/vendor/FreeImage/Source/FreeImage/TIFFLogLuv.cpp +65 -0
  95. data/vendor/FreeImage/Source/FreeImage/ToneMapping.cpp +75 -0
  96. data/vendor/FreeImage/Source/FreeImage/WuQuantizer.cpp +559 -0
  97. data/vendor/FreeImage/Source/FreeImage/ZLibInterface.cpp +223 -0
  98. data/vendor/FreeImage/Source/FreeImage/tmoColorConvert.cpp +479 -0
  99. data/vendor/FreeImage/Source/FreeImage/tmoDrago03.cpp +295 -0
  100. data/vendor/FreeImage/Source/FreeImage/tmoFattal02.cpp +689 -0
  101. data/vendor/FreeImage/Source/FreeImage/tmoReinhard05.cpp +260 -0
  102. data/vendor/FreeImage/Source/FreeImage.h +1153 -0
  103. data/vendor/FreeImage/Source/FreeImageIO.h +63 -0
  104. data/vendor/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp +730 -0
  105. data/vendor/FreeImage/Source/FreeImageToolkit/Background.cpp +895 -0
  106. data/vendor/FreeImage/Source/FreeImageToolkit/Channels.cpp +488 -0
  107. data/vendor/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp +917 -0
  108. data/vendor/FreeImage/Source/FreeImageToolkit/Colors.cpp +967 -0
  109. data/vendor/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp +861 -0
  110. data/vendor/FreeImage/Source/FreeImageToolkit/Display.cpp +230 -0
  111. data/vendor/FreeImage/Source/FreeImageToolkit/Filters.h +287 -0
  112. data/vendor/FreeImage/Source/FreeImageToolkit/Flip.cpp +166 -0
  113. data/vendor/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp +623 -0
  114. data/vendor/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp +505 -0
  115. data/vendor/FreeImage/Source/FreeImageToolkit/Rescale.cpp +192 -0
  116. data/vendor/FreeImage/Source/FreeImageToolkit/Resize.cpp +2116 -0
  117. data/vendor/FreeImage/Source/FreeImageToolkit/Resize.h +196 -0
  118. data/vendor/FreeImage/Source/LibJPEG/ansi2knr.c +739 -0
  119. data/vendor/FreeImage/Source/LibJPEG/cderror.h +134 -0
  120. data/vendor/FreeImage/Source/LibJPEG/cdjpeg.c +181 -0
  121. data/vendor/FreeImage/Source/LibJPEG/cdjpeg.h +187 -0
  122. data/vendor/FreeImage/Source/LibJPEG/cjpeg.c +664 -0
  123. data/vendor/FreeImage/Source/LibJPEG/ckconfig.c +402 -0
  124. data/vendor/FreeImage/Source/LibJPEG/djpeg.c +617 -0
  125. data/vendor/FreeImage/Source/LibJPEG/example.c +433 -0
  126. data/vendor/FreeImage/Source/LibJPEG/jaricom.c +153 -0
  127. data/vendor/FreeImage/Source/LibJPEG/jcapimin.c +288 -0
  128. data/vendor/FreeImage/Source/LibJPEG/jcapistd.c +162 -0
  129. data/vendor/FreeImage/Source/LibJPEG/jcarith.c +944 -0
  130. data/vendor/FreeImage/Source/LibJPEG/jccoefct.c +454 -0
  131. data/vendor/FreeImage/Source/LibJPEG/jccolor.c +604 -0
  132. data/vendor/FreeImage/Source/LibJPEG/jcdctmgr.c +477 -0
  133. data/vendor/FreeImage/Source/LibJPEG/jchuff.c +1573 -0
  134. data/vendor/FreeImage/Source/LibJPEG/jcinit.c +84 -0
  135. data/vendor/FreeImage/Source/LibJPEG/jcmainct.c +297 -0
  136. data/vendor/FreeImage/Source/LibJPEG/jcmarker.c +719 -0
  137. data/vendor/FreeImage/Source/LibJPEG/jcmaster.c +856 -0
  138. data/vendor/FreeImage/Source/LibJPEG/jcomapi.c +106 -0
  139. data/vendor/FreeImage/Source/LibJPEG/jconfig.h +161 -0
  140. data/vendor/FreeImage/Source/LibJPEG/jcparam.c +675 -0
  141. data/vendor/FreeImage/Source/LibJPEG/jcprepct.c +358 -0
  142. data/vendor/FreeImage/Source/LibJPEG/jcsample.c +545 -0
  143. data/vendor/FreeImage/Source/LibJPEG/jctrans.c +385 -0
  144. data/vendor/FreeImage/Source/LibJPEG/jdapimin.c +399 -0
  145. data/vendor/FreeImage/Source/LibJPEG/jdapistd.c +276 -0
  146. data/vendor/FreeImage/Source/LibJPEG/jdarith.c +796 -0
  147. data/vendor/FreeImage/Source/LibJPEG/jdatadst.c +270 -0
  148. data/vendor/FreeImage/Source/LibJPEG/jdatasrc.c +275 -0
  149. data/vendor/FreeImage/Source/LibJPEG/jdcoefct.c +741 -0
  150. data/vendor/FreeImage/Source/LibJPEG/jdcolor.c +748 -0
  151. data/vendor/FreeImage/Source/LibJPEG/jdct.h +393 -0
  152. data/vendor/FreeImage/Source/LibJPEG/jddctmgr.c +384 -0
  153. data/vendor/FreeImage/Source/LibJPEG/jdhuff.c +1554 -0
  154. data/vendor/FreeImage/Source/LibJPEG/jdinput.c +662 -0
  155. data/vendor/FreeImage/Source/LibJPEG/jdmainct.c +513 -0
  156. data/vendor/FreeImage/Source/LibJPEG/jdmarker.c +1511 -0
  157. data/vendor/FreeImage/Source/LibJPEG/jdmaster.c +543 -0
  158. data/vendor/FreeImage/Source/LibJPEG/jdmerge.c +401 -0
  159. data/vendor/FreeImage/Source/LibJPEG/jdpostct.c +290 -0
  160. data/vendor/FreeImage/Source/LibJPEG/jdsample.c +361 -0
  161. data/vendor/FreeImage/Source/LibJPEG/jdtrans.c +140 -0
  162. data/vendor/FreeImage/Source/LibJPEG/jerror.c +253 -0
  163. data/vendor/FreeImage/Source/LibJPEG/jerror.h +304 -0
  164. data/vendor/FreeImage/Source/LibJPEG/jfdctflt.c +174 -0
  165. data/vendor/FreeImage/Source/LibJPEG/jfdctfst.c +230 -0
  166. data/vendor/FreeImage/Source/LibJPEG/jfdctint.c +4406 -0
  167. data/vendor/FreeImage/Source/LibJPEG/jidctflt.c +235 -0
  168. data/vendor/FreeImage/Source/LibJPEG/jidctfst.c +368 -0
  169. data/vendor/FreeImage/Source/LibJPEG/jidctint.c +5179 -0
  170. data/vendor/FreeImage/Source/LibJPEG/jinclude.h +91 -0
  171. data/vendor/FreeImage/Source/LibJPEG/jmemansi.c +167 -0
  172. data/vendor/FreeImage/Source/LibJPEG/jmemdos.c +638 -0
  173. data/vendor/FreeImage/Source/LibJPEG/jmemmac.c +289 -0
  174. data/vendor/FreeImage/Source/LibJPEG/jmemmgr.c +1119 -0
  175. data/vendor/FreeImage/Source/LibJPEG/jmemname.c +276 -0
  176. data/vendor/FreeImage/Source/LibJPEG/jmemnobs.c +109 -0
  177. data/vendor/FreeImage/Source/LibJPEG/jmemsys.h +198 -0
  178. data/vendor/FreeImage/Source/LibJPEG/jmorecfg.h +442 -0
  179. data/vendor/FreeImage/Source/LibJPEG/jpegint.h +426 -0
  180. data/vendor/FreeImage/Source/LibJPEG/jpeglib.h +1180 -0
  181. data/vendor/FreeImage/Source/LibJPEG/jpegtran.c +577 -0
  182. data/vendor/FreeImage/Source/LibJPEG/jquant1.c +857 -0
  183. data/vendor/FreeImage/Source/LibJPEG/jquant2.c +1311 -0
  184. data/vendor/FreeImage/Source/LibJPEG/jutils.c +227 -0
  185. data/vendor/FreeImage/Source/LibJPEG/jversion.h +14 -0
  186. data/vendor/FreeImage/Source/LibJPEG/rdbmp.c +480 -0
  187. data/vendor/FreeImage/Source/LibJPEG/rdcolmap.c +253 -0
  188. data/vendor/FreeImage/Source/LibJPEG/rdgif.c +38 -0
  189. data/vendor/FreeImage/Source/LibJPEG/rdjpgcom.c +515 -0
  190. data/vendor/FreeImage/Source/LibJPEG/rdppm.c +459 -0
  191. data/vendor/FreeImage/Source/LibJPEG/rdrle.c +387 -0
  192. data/vendor/FreeImage/Source/LibJPEG/rdswitch.c +365 -0
  193. data/vendor/FreeImage/Source/LibJPEG/rdtarga.c +500 -0
  194. data/vendor/FreeImage/Source/LibJPEG/transupp.c +1763 -0
  195. data/vendor/FreeImage/Source/LibJPEG/transupp.h +219 -0
  196. data/vendor/FreeImage/Source/LibJPEG/wrbmp.c +442 -0
  197. data/vendor/FreeImage/Source/LibJPEG/wrgif.c +399 -0
  198. data/vendor/FreeImage/Source/LibJPEG/wrjpgcom.c +583 -0
  199. data/vendor/FreeImage/Source/LibJPEG/wrppm.c +269 -0
  200. data/vendor/FreeImage/Source/LibJPEG/wrrle.c +305 -0
  201. data/vendor/FreeImage/Source/LibJPEG/wrtarga.c +253 -0
  202. data/vendor/FreeImage/Source/LibJXR/common/include/guiddef.h +230 -0
  203. data/vendor/FreeImage/Source/LibJXR/common/include/wmsal.h +757 -0
  204. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstring.h +342 -0
  205. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_adt.h +71 -0
  206. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_strict.h +1096 -0
  207. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_undef.h +406 -0
  208. data/vendor/FreeImage/Source/LibJXR/image/decode/JXRTranscode.c +987 -0
  209. data/vendor/FreeImage/Source/LibJXR/image/decode/decode.c +200 -0
  210. data/vendor/FreeImage/Source/LibJXR/image/decode/decode.h +143 -0
  211. data/vendor/FreeImage/Source/LibJXR/image/decode/postprocess.c +288 -0
  212. data/vendor/FreeImage/Source/LibJXR/image/decode/segdec.c +1205 -0
  213. data/vendor/FreeImage/Source/LibJXR/image/decode/strInvTransform.c +1888 -0
  214. data/vendor/FreeImage/Source/LibJXR/image/decode/strPredQuantDec.c +539 -0
  215. data/vendor/FreeImage/Source/LibJXR/image/decode/strdec.c +3628 -0
  216. data/vendor/FreeImage/Source/LibJXR/image/decode/strdec_x86.c +1640 -0
  217. data/vendor/FreeImage/Source/LibJXR/image/encode/encode.c +144 -0
  218. data/vendor/FreeImage/Source/LibJXR/image/encode/encode.h +113 -0
  219. data/vendor/FreeImage/Source/LibJXR/image/encode/segenc.c +1186 -0
  220. data/vendor/FreeImage/Source/LibJXR/image/encode/strFwdTransform.c +1111 -0
  221. data/vendor/FreeImage/Source/LibJXR/image/encode/strPredQuantEnc.c +511 -0
  222. data/vendor/FreeImage/Source/LibJXR/image/encode/strenc.c +2370 -0
  223. data/vendor/FreeImage/Source/LibJXR/image/encode/strenc_x86.c +409 -0
  224. data/vendor/FreeImage/Source/LibJXR/image/sys/adapthuff.c +511 -0
  225. data/vendor/FreeImage/Source/LibJXR/image/sys/ansi.h +61 -0
  226. data/vendor/FreeImage/Source/LibJXR/image/sys/common.h +131 -0
  227. data/vendor/FreeImage/Source/LibJXR/image/sys/image.c +183 -0
  228. data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimer.h +115 -0
  229. data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimerANSI.c +274 -0
  230. data/vendor/FreeImage/Source/LibJXR/image/sys/strPredQuant.c +306 -0
  231. data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.c +85 -0
  232. data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.h +50 -0
  233. data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.c +1251 -0
  234. data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.h +681 -0
  235. data/vendor/FreeImage/Source/LibJXR/image/sys/windowsmediaphoto.h +515 -0
  236. data/vendor/FreeImage/Source/LibJXR/image/sys/xplatform_image.h +84 -0
  237. data/vendor/FreeImage/Source/LibJXR/image/x86/x86.h +58 -0
  238. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.c +930 -0
  239. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.h +636 -0
  240. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlueJxr.c +2246 -0
  241. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGluePFC.c +2338 -0
  242. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.c +905 -0
  243. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.h +258 -0
  244. data/vendor/FreeImage/Source/LibOpenJPEG/bio.c +188 -0
  245. data/vendor/FreeImage/Source/LibOpenJPEG/bio.h +128 -0
  246. data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.c +239 -0
  247. data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.h +68 -0
  248. data/vendor/FreeImage/Source/LibOpenJPEG/cio.c +644 -0
  249. data/vendor/FreeImage/Source/LibOpenJPEG/cio.h +393 -0
  250. data/vendor/FreeImage/Source/LibOpenJPEG/dwt.c +919 -0
  251. data/vendor/FreeImage/Source/LibOpenJPEG/dwt.h +116 -0
  252. data/vendor/FreeImage/Source/LibOpenJPEG/event.c +141 -0
  253. data/vendor/FreeImage/Source/LibOpenJPEG/event.h +97 -0
  254. data/vendor/FreeImage/Source/LibOpenJPEG/function_list.c +114 -0
  255. data/vendor/FreeImage/Source/LibOpenJPEG/function_list.h +126 -0
  256. data/vendor/FreeImage/Source/LibOpenJPEG/image.c +235 -0
  257. data/vendor/FreeImage/Source/LibOpenJPEG/image.h +63 -0
  258. data/vendor/FreeImage/Source/LibOpenJPEG/indexbox_manager.h +148 -0
  259. data/vendor/FreeImage/Source/LibOpenJPEG/invert.c +289 -0
  260. data/vendor/FreeImage/Source/LibOpenJPEG/invert.h +59 -0
  261. data/vendor/FreeImage/Source/LibOpenJPEG/j2k.c +10238 -0
  262. data/vendor/FreeImage/Source/LibOpenJPEG/j2k.h +838 -0
  263. data/vendor/FreeImage/Source/LibOpenJPEG/jp2.c +2776 -0
  264. data/vendor/FreeImage/Source/LibOpenJPEG/jp2.h +490 -0
  265. data/vendor/FreeImage/Source/LibOpenJPEG/mct.c +319 -0
  266. data/vendor/FreeImage/Source/LibOpenJPEG/mct.h +149 -0
  267. data/vendor/FreeImage/Source/LibOpenJPEG/mqc.c +604 -0
  268. data/vendor/FreeImage/Source/LibOpenJPEG/mqc.h +201 -0
  269. data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.c +955 -0
  270. data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.h +1475 -0
  271. data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.c +59 -0
  272. data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.h +54 -0
  273. data/vendor/FreeImage/Source/LibOpenJPEG/opj_codec.h +160 -0
  274. data/vendor/FreeImage/Source/LibOpenJPEG/opj_config.h +9 -0
  275. data/vendor/FreeImage/Source/LibOpenJPEG/opj_config_private.h +16 -0
  276. data/vendor/FreeImage/Source/LibOpenJPEG/opj_includes.h +175 -0
  277. data/vendor/FreeImage/Source/LibOpenJPEG/opj_intmath.h +172 -0
  278. data/vendor/FreeImage/Source/LibOpenJPEG/opj_inttypes.h +43 -0
  279. data/vendor/FreeImage/Source/LibOpenJPEG/opj_malloc.h +180 -0
  280. data/vendor/FreeImage/Source/LibOpenJPEG/opj_stdint.h +47 -0
  281. data/vendor/FreeImage/Source/LibOpenJPEG/phix_manager.c +191 -0
  282. data/vendor/FreeImage/Source/LibOpenJPEG/pi.c +1870 -0
  283. data/vendor/FreeImage/Source/LibOpenJPEG/pi.h +182 -0
  284. data/vendor/FreeImage/Source/LibOpenJPEG/ppix_manager.c +194 -0
  285. data/vendor/FreeImage/Source/LibOpenJPEG/raw.c +89 -0
  286. data/vendor/FreeImage/Source/LibOpenJPEG/raw.h +100 -0
  287. data/vendor/FreeImage/Source/LibOpenJPEG/t1.c +1751 -0
  288. data/vendor/FreeImage/Source/LibOpenJPEG/t1.h +157 -0
  289. data/vendor/FreeImage/Source/LibOpenJPEG/t1_generate_luts.c +276 -0
  290. data/vendor/FreeImage/Source/LibOpenJPEG/t1_luts.h +143 -0
  291. data/vendor/FreeImage/Source/LibOpenJPEG/t2.c +1334 -0
  292. data/vendor/FreeImage/Source/LibOpenJPEG/t2.h +127 -0
  293. data/vendor/FreeImage/Source/LibOpenJPEG/tcd.c +2123 -0
  294. data/vendor/FreeImage/Source/LibOpenJPEG/tcd.h +348 -0
  295. data/vendor/FreeImage/Source/LibOpenJPEG/tgt.c +331 -0
  296. data/vendor/FreeImage/Source/LibOpenJPEG/tgt.h +140 -0
  297. data/vendor/FreeImage/Source/LibOpenJPEG/thix_manager.c +134 -0
  298. data/vendor/FreeImage/Source/LibOpenJPEG/tpix_manager.c +185 -0
  299. data/vendor/FreeImage/Source/LibPNG/example.c +1061 -0
  300. data/vendor/FreeImage/Source/LibPNG/png.c +4493 -0
  301. data/vendor/FreeImage/Source/LibPNG/png.h +3282 -0
  302. data/vendor/FreeImage/Source/LibPNG/pngconf.h +644 -0
  303. data/vendor/FreeImage/Source/LibPNG/pngdebug.h +154 -0
  304. data/vendor/FreeImage/Source/LibPNG/pngerror.c +963 -0
  305. data/vendor/FreeImage/Source/LibPNG/pngget.c +1213 -0
  306. data/vendor/FreeImage/Source/LibPNG/pnginfo.h +260 -0
  307. data/vendor/FreeImage/Source/LibPNG/pnglibconf.h +218 -0
  308. data/vendor/FreeImage/Source/LibPNG/pngmem.c +281 -0
  309. data/vendor/FreeImage/Source/LibPNG/pngpread.c +1168 -0
  310. data/vendor/FreeImage/Source/LibPNG/pngpriv.h +1944 -0
  311. data/vendor/FreeImage/Source/LibPNG/pngread.c +4121 -0
  312. data/vendor/FreeImage/Source/LibPNG/pngrio.c +120 -0
  313. data/vendor/FreeImage/Source/LibPNG/pngrtran.c +4994 -0
  314. data/vendor/FreeImage/Source/LibPNG/pngrutil.c +4474 -0
  315. data/vendor/FreeImage/Source/LibPNG/pngset.c +1611 -0
  316. data/vendor/FreeImage/Source/LibPNG/pngstruct.h +489 -0
  317. data/vendor/FreeImage/Source/LibPNG/pngtest.c +2011 -0
  318. data/vendor/FreeImage/Source/LibPNG/pngtrans.c +849 -0
  319. data/vendor/FreeImage/Source/LibPNG/pngwio.c +168 -0
  320. data/vendor/FreeImage/Source/LibPNG/pngwrite.c +2455 -0
  321. data/vendor/FreeImage/Source/LibPNG/pngwtran.c +574 -0
  322. data/vendor/FreeImage/Source/LibPNG/pngwutil.c +3029 -0
  323. data/vendor/FreeImage/Source/LibRawLite/dcraw/dcraw.c +15462 -0
  324. data/vendor/FreeImage/Source/LibRawLite/internal/aahd_demosaic.cpp +706 -0
  325. data/vendor/FreeImage/Source/LibRawLite/internal/dcb_demosaicing.c +710 -0
  326. data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_common.cpp +13593 -0
  327. data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_fileio.cpp +240 -0
  328. data/vendor/FreeImage/Source/LibRawLite/internal/defines.h +167 -0
  329. data/vendor/FreeImage/Source/LibRawLite/internal/demosaic_packs.cpp +99 -0
  330. data/vendor/FreeImage/Source/LibRawLite/internal/dht_demosaic.cpp +873 -0
  331. data/vendor/FreeImage/Source/LibRawLite/internal/libraw_internal_funcs.h +282 -0
  332. data/vendor/FreeImage/Source/LibRawLite/internal/libraw_x3f.cpp +1919 -0
  333. data/vendor/FreeImage/Source/LibRawLite/internal/var_defines.h +216 -0
  334. data/vendor/FreeImage/Source/LibRawLite/internal/wf_filtering.cpp +1950 -0
  335. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw.h +338 -0
  336. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_alloc.h +99 -0
  337. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_const.h +233 -0
  338. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_datastream.h +238 -0
  339. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_internal.h +225 -0
  340. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_types.h +442 -0
  341. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_version.h +62 -0
  342. data/vendor/FreeImage/Source/LibRawLite/src/libraw_c_api.cpp +230 -0
  343. data/vendor/FreeImage/Source/LibRawLite/src/libraw_cxx.cpp +4533 -0
  344. data/vendor/FreeImage/Source/LibRawLite/src/libraw_datastream.cpp +703 -0
  345. data/vendor/FreeImage/Source/LibTIFF4/mkg3states.c +451 -0
  346. data/vendor/FreeImage/Source/LibTIFF4/mkspans.c +82 -0
  347. data/vendor/FreeImage/Source/LibTIFF4/t4.h +292 -0
  348. data/vendor/FreeImage/Source/LibTIFF4/tif_aux.c +358 -0
  349. data/vendor/FreeImage/Source/LibTIFF4/tif_close.c +140 -0
  350. data/vendor/FreeImage/Source/LibTIFF4/tif_codec.c +166 -0
  351. data/vendor/FreeImage/Source/LibTIFF4/tif_color.c +287 -0
  352. data/vendor/FreeImage/Source/LibTIFF4/tif_compress.c +304 -0
  353. data/vendor/FreeImage/Source/LibTIFF4/tif_config.h +97 -0
  354. data/vendor/FreeImage/Source/LibTIFF4/tif_config.vc.h +74 -0
  355. data/vendor/FreeImage/Source/LibTIFF4/tif_config.wince.h +71 -0
  356. data/vendor/FreeImage/Source/LibTIFF4/tif_dir.c +1700 -0
  357. data/vendor/FreeImage/Source/LibTIFF4/tif_dir.h +308 -0
  358. data/vendor/FreeImage/Source/LibTIFF4/tif_dirinfo.c +959 -0
  359. data/vendor/FreeImage/Source/LibTIFF4/tif_dirread.c +5640 -0
  360. data/vendor/FreeImage/Source/LibTIFF4/tif_dirwrite.c +2910 -0
  361. data/vendor/FreeImage/Source/LibTIFF4/tif_dumpmode.c +143 -0
  362. data/vendor/FreeImage/Source/LibTIFF4/tif_error.c +80 -0
  363. data/vendor/FreeImage/Source/LibTIFF4/tif_extension.c +118 -0
  364. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.c +1595 -0
  365. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.h +538 -0
  366. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3sm.c +1260 -0
  367. data/vendor/FreeImage/Source/LibTIFF4/tif_flush.c +118 -0
  368. data/vendor/FreeImage/Source/LibTIFF4/tif_getimage.c +2890 -0
  369. data/vendor/FreeImage/Source/LibTIFF4/tif_jbig.c +213 -0
  370. data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg.c +2354 -0
  371. data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg_12.c +65 -0
  372. data/vendor/FreeImage/Source/LibTIFF4/tif_luv.c +1683 -0
  373. data/vendor/FreeImage/Source/LibTIFF4/tif_lzma.c +495 -0
  374. data/vendor/FreeImage/Source/LibTIFF4/tif_lzw.c +1169 -0
  375. data/vendor/FreeImage/Source/LibTIFF4/tif_next.c +181 -0
  376. data/vendor/FreeImage/Source/LibTIFF4/tif_ojpeg.c +2501 -0
  377. data/vendor/FreeImage/Source/LibTIFF4/tif_open.c +725 -0
  378. data/vendor/FreeImage/Source/LibTIFF4/tif_packbits.c +300 -0
  379. data/vendor/FreeImage/Source/LibTIFF4/tif_pixarlog.c +1442 -0
  380. data/vendor/FreeImage/Source/LibTIFF4/tif_predict.c +764 -0
  381. data/vendor/FreeImage/Source/LibTIFF4/tif_predict.h +77 -0
  382. data/vendor/FreeImage/Source/LibTIFF4/tif_print.c +716 -0
  383. data/vendor/FreeImage/Source/LibTIFF4/tif_read.c +1086 -0
  384. data/vendor/FreeImage/Source/LibTIFF4/tif_strip.c +383 -0
  385. data/vendor/FreeImage/Source/LibTIFF4/tif_swab.c +310 -0
  386. data/vendor/FreeImage/Source/LibTIFF4/tif_thunder.c +207 -0
  387. data/vendor/FreeImage/Source/LibTIFF4/tif_tile.c +299 -0
  388. data/vendor/FreeImage/Source/LibTIFF4/tif_unix.c +325 -0
  389. data/vendor/FreeImage/Source/LibTIFF4/tif_version.c +40 -0
  390. data/vendor/FreeImage/Source/LibTIFF4/tif_vms.c +603 -0
  391. data/vendor/FreeImage/Source/LibTIFF4/tif_warning.c +81 -0
  392. data/vendor/FreeImage/Source/LibTIFF4/tif_win32.c +443 -0
  393. data/vendor/FreeImage/Source/LibTIFF4/tif_wince.c +293 -0
  394. data/vendor/FreeImage/Source/LibTIFF4/tif_write.c +771 -0
  395. data/vendor/FreeImage/Source/LibTIFF4/tif_zip.c +472 -0
  396. data/vendor/FreeImage/Source/LibTIFF4/tiff.h +681 -0
  397. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.h +170 -0
  398. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.vc.h +160 -0
  399. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.wince.h +121 -0
  400. data/vendor/FreeImage/Source/LibTIFF4/tiffio.h +557 -0
  401. data/vendor/FreeImage/Source/LibTIFF4/tiffiop.h +367 -0
  402. data/vendor/FreeImage/Source/LibTIFF4/tiffvers.h +9 -0
  403. data/vendor/FreeImage/Source/LibTIFF4/uvcode.h +180 -0
  404. data/vendor/FreeImage/Source/LibWebP/src/dec/alphai.h +55 -0
  405. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.alpha.c +167 -0
  406. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.buffer.c +249 -0
  407. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.frame.c +827 -0
  408. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.idec.c +857 -0
  409. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.io.c +640 -0
  410. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.quant.c +110 -0
  411. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.tree.c +525 -0
  412. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8.c +663 -0
  413. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8l.c +1584 -0
  414. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.webp.c +834 -0
  415. data/vendor/FreeImage/Source/LibWebP/src/dec/decode_vp8.h +185 -0
  416. data/vendor/FreeImage/Source/LibWebP/src/dec/vp8i.h +353 -0
  417. data/vendor/FreeImage/Source/LibWebP/src/dec/vp8li.h +136 -0
  418. data/vendor/FreeImage/Source/LibWebP/src/dec/webpi.h +120 -0
  419. data/vendor/FreeImage/Source/LibWebP/src/demux/demux.demux.c +957 -0
  420. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing.c +377 -0
  421. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_mips_dsp_r2.c +139 -0
  422. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_sse2.c +296 -0
  423. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb.c +68 -0
  424. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_mips_dsp_r2.c +108 -0
  425. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_sse2.c +62 -0
  426. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost.c +412 -0
  427. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips32.c +154 -0
  428. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips_dsp_r2.c +107 -0
  429. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_sse2.c +121 -0
  430. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cpu.c +138 -0
  431. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec.c +760 -0
  432. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_clip_tables.c +366 -0
  433. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips32.c +585 -0
  434. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +992 -0
  435. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_neon.c +1489 -0
  436. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_sse2.c +1284 -0
  437. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc.c +788 -0
  438. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_avx2.c +24 -0
  439. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips32.c +670 -0
  440. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +1510 -0
  441. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_neon.c +932 -0
  442. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_sse2.c +940 -0
  443. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters.c +240 -0
  444. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +404 -0
  445. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_sse2.c +349 -0
  446. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.h +434 -0
  447. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless.c +1838 -0
  448. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips32.c +416 -0
  449. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +921 -0
  450. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_neon.c +357 -0
  451. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_sse2.c +535 -0
  452. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler.c +115 -0
  453. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips32.c +192 -0
  454. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips_dsp_r2.c +210 -0
  455. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling.c +252 -0
  456. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +280 -0
  457. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_neon.c +267 -0
  458. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_sse2.c +214 -0
  459. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv.c +166 -0
  460. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips32.c +100 -0
  461. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +131 -0
  462. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_sse2.c +322 -0
  463. data/vendor/FreeImage/Source/LibWebP/src/dsp/lossless.h +313 -0
  464. data/vendor/FreeImage/Source/LibWebP/src/dsp/mips_macro.h +200 -0
  465. data/vendor/FreeImage/Source/LibWebP/src/dsp/neon.h +82 -0
  466. data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv.h +321 -0
  467. data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv_tables_sse2.h +536 -0
  468. data/vendor/FreeImage/Source/LibWebP/src/enc/backward_references.h +202 -0
  469. data/vendor/FreeImage/Source/LibWebP/src/enc/cost.h +69 -0
  470. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.alpha.c +440 -0
  471. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.analysis.c +501 -0
  472. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.backward_references.c +1076 -0
  473. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.config.c +163 -0
  474. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.cost.c +355 -0
  475. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.filter.c +296 -0
  476. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.frame.c +850 -0
  477. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.histogram.c +897 -0
  478. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.iterator.c +456 -0
  479. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.near_lossless.c +160 -0
  480. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture.c +290 -0
  481. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_csp.c +1100 -0
  482. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_psnr.c +150 -0
  483. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_rescale.c +285 -0
  484. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_tools.c +206 -0
  485. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.quant.c +1191 -0
  486. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.syntax.c +383 -0
  487. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.token.c +285 -0
  488. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.tree.c +504 -0
  489. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.vp8l.c +1437 -0
  490. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.webpenc.c +379 -0
  491. data/vendor/FreeImage/Source/LibWebP/src/enc/histogram.h +114 -0
  492. data/vendor/FreeImage/Source/LibWebP/src/enc/vp8enci.h +551 -0
  493. data/vendor/FreeImage/Source/LibWebP/src/enc/vp8li.h +78 -0
  494. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.anim_encode.c +1241 -0
  495. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxedit.c +696 -0
  496. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxinternal.c +551 -0
  497. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxread.c +544 -0
  498. data/vendor/FreeImage/Source/LibWebP/src/mux/muxi.h +232 -0
  499. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader.h +168 -0
  500. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader_inl.h +172 -0
  501. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_writer.h +120 -0
  502. data/vendor/FreeImage/Source/LibWebP/src/utils/color_cache.h +74 -0
  503. data/vendor/FreeImage/Source/LibWebP/src/utils/endian_inl.h +100 -0
  504. data/vendor/FreeImage/Source/LibWebP/src/utils/filters.h +32 -0
  505. data/vendor/FreeImage/Source/LibWebP/src/utils/huffman.h +67 -0
  506. data/vendor/FreeImage/Source/LibWebP/src/utils/huffman_encode.h +60 -0
  507. data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels.h +36 -0
  508. data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels_dec.h +35 -0
  509. data/vendor/FreeImage/Source/LibWebP/src/utils/random.h +63 -0
  510. data/vendor/FreeImage/Source/LibWebP/src/utils/rescaler.h +78 -0
  511. data/vendor/FreeImage/Source/LibWebP/src/utils/thread.h +93 -0
  512. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_reader.c +208 -0
  513. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_writer.c +308 -0
  514. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.color_cache.c +49 -0
  515. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.filters.c +76 -0
  516. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.h +121 -0
  517. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman.c +205 -0
  518. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman_encode.c +417 -0
  519. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels.c +140 -0
  520. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels_dec.c +279 -0
  521. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.random.c +43 -0
  522. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.rescaler.c +82 -0
  523. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.thread.c +309 -0
  524. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.utils.c +211 -0
  525. data/vendor/FreeImage/Source/LibWebP/src/webp/decode.h +493 -0
  526. data/vendor/FreeImage/Source/LibWebP/src/webp/demux.h +224 -0
  527. data/vendor/FreeImage/Source/LibWebP/src/webp/encode.h +515 -0
  528. data/vendor/FreeImage/Source/LibWebP/src/webp/format_constants.h +88 -0
  529. data/vendor/FreeImage/Source/LibWebP/src/webp/mux.h +507 -0
  530. data/vendor/FreeImage/Source/LibWebP/src/webp/mux_types.h +97 -0
  531. data/vendor/FreeImage/Source/LibWebP/src/webp/types.h +52 -0
  532. data/vendor/FreeImage/Source/MapIntrospector.h +212 -0
  533. data/vendor/FreeImage/Source/Metadata/Exif.cpp +1253 -0
  534. data/vendor/FreeImage/Source/Metadata/FIRational.cpp +176 -0
  535. data/vendor/FreeImage/Source/Metadata/FIRational.h +108 -0
  536. data/vendor/FreeImage/Source/Metadata/FreeImageTag.cpp +353 -0
  537. data/vendor/FreeImage/Source/Metadata/FreeImageTag.h +500 -0
  538. data/vendor/FreeImage/Source/Metadata/IPTC.cpp +342 -0
  539. data/vendor/FreeImage/Source/Metadata/TagConversion.cpp +1094 -0
  540. data/vendor/FreeImage/Source/Metadata/TagLib.cpp +1618 -0
  541. data/vendor/FreeImage/Source/Metadata/XTIFF.cpp +766 -0
  542. data/vendor/FreeImage/Source/OpenEXR/Half/eLut.cpp +114 -0
  543. data/vendor/FreeImage/Source/OpenEXR/Half/eLut.h +71 -0
  544. data/vendor/FreeImage/Source/OpenEXR/Half/half.cpp +310 -0
  545. data/vendor/FreeImage/Source/OpenEXR/Half/half.h +757 -0
  546. data/vendor/FreeImage/Source/OpenEXR/Half/halfExport.h +27 -0
  547. data/vendor/FreeImage/Source/OpenEXR/Half/halfFunction.h +179 -0
  548. data/vendor/FreeImage/Source/OpenEXR/Half/halfLimits.h +102 -0
  549. data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.cpp +164 -0
  550. data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.h +16391 -0
  551. data/vendor/FreeImage/Source/OpenEXR/Iex/Iex.h +60 -0
  552. data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.cpp +156 -0
  553. data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.h +264 -0
  554. data/vendor/FreeImage/Source/OpenEXR/Iex/IexErrnoExc.h +208 -0
  555. data/vendor/FreeImage/Source/OpenEXR/Iex/IexExport.h +51 -0
  556. data/vendor/FreeImage/Source/OpenEXR/Iex/IexForward.h +229 -0
  557. data/vendor/FreeImage/Source/OpenEXR/Iex/IexMacros.h +170 -0
  558. data/vendor/FreeImage/Source/OpenEXR/Iex/IexMathExc.h +57 -0
  559. data/vendor/FreeImage/Source/OpenEXR/Iex/IexNamespace.h +112 -0
  560. data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.cpp +873 -0
  561. data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.h +97 -0
  562. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.cpp +113 -0
  563. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.h +146 -0
  564. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.cpp +530 -0
  565. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.h +91 -0
  566. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathIeeeExc.h +62 -0
  567. data/vendor/FreeImage/Source/OpenEXR/IlmBaseConfig.h +61 -0
  568. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.cpp +633 -0
  569. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.h +324 -0
  570. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfArray.h +285 -0
  571. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.cpp +158 -0
  572. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.h +407 -0
  573. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAutoArray.h +95 -0
  574. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.cpp +1072 -0
  575. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.h +118 -0
  576. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp +111 -0
  577. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.h +87 -0
  578. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp +1438 -0
  579. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.h +555 -0
  580. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.cpp +322 -0
  581. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.h +436 -0
  582. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp +150 -0
  583. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.h +74 -0
  584. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h +163 -0
  585. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.cpp +151 -0
  586. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.h +131 -0
  587. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp +87 -0
  588. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.h +73 -0
  589. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp +591 -0
  590. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.h +142 -0
  591. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompression.h +84 -0
  592. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp +78 -0
  593. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.h +64 -0
  594. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.cpp +226 -0
  595. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.h +265 -0
  596. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.cpp +143 -0
  597. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.h +107 -0
  598. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.cpp +110 -0
  599. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.h +132 -0
  600. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.cpp +230 -0
  601. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.h +339 -0
  602. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageState.h +96 -0
  603. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp +78 -0
  604. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h +68 -0
  605. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp +2025 -0
  606. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.h +276 -0
  607. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.cpp +149 -0
  608. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.h +181 -0
  609. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp +1552 -0
  610. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.h +244 -0
  611. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.cpp +107 -0
  612. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.h +168 -0
  613. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp +1979 -0
  614. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.h +437 -0
  615. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.cpp +273 -0
  616. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.h +362 -0
  617. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp +2055 -0
  618. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.h +475 -0
  619. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.cpp +250 -0
  620. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.h +394 -0
  621. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp +57 -0
  622. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.h +59 -0
  623. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp +3424 -0
  624. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.h +210 -0
  625. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressorSimd.h +2145 -0
  626. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.cpp +335 -0
  627. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.h +336 -0
  628. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp +76 -0
  629. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.h +68 -0
  630. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfExport.h +46 -0
  631. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.cpp +768 -0
  632. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.h +148 -0
  633. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp +57 -0
  634. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.h +58 -0
  635. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.cpp +84 -0
  636. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.h +76 -0
  637. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfForward.h +127 -0
  638. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp +228 -0
  639. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.h +386 -0
  640. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp +76 -0
  641. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h +94 -0
  642. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.cpp +76 -0
  643. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.h +58 -0
  644. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.cpp +112 -0
  645. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.h +62 -0
  646. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.cpp +1283 -0
  647. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.h +699 -0
  648. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.cpp +1114 -0
  649. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.h +82 -0
  650. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.cpp +110 -0
  651. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.h +255 -0
  652. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.cpp +895 -0
  653. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.h +240 -0
  654. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.cpp +114 -0
  655. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.h +84 -0
  656. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.cpp +51 -0
  657. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.h +69 -0
  658. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputStreamMutex.h +68 -0
  659. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInt64.h +56 -0
  660. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.cpp +57 -0
  661. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.h +58 -0
  662. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.cpp +217 -0
  663. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.h +167 -0
  664. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp +99 -0
  665. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.h +73 -0
  666. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrder.h +69 -0
  667. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp +78 -0
  668. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.h +72 -0
  669. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.cpp +178 -0
  670. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.h +188 -0
  671. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp +263 -0
  672. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.h +83 -0
  673. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.cpp +1872 -0
  674. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.h +466 -0
  675. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +783 -0
  676. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.h +128 -0
  677. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp +519 -0
  678. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.h +118 -0
  679. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.cpp +435 -0
  680. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.h +187 -0
  681. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfName.h +150 -0
  682. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfNamespace.h +115 -0
  683. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp +126 -0
  684. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.h +110 -0
  685. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOptimizedPixelReading.h +646 -0
  686. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.cpp +1378 -0
  687. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.h +263 -0
  688. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.cpp +105 -0
  689. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.h +77 -0
  690. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.cpp +52 -0
  691. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.h +62 -0
  692. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputStreamMutex.h +70 -0
  693. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartHelper.h +262 -0
  694. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.cpp +63 -0
  695. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.h +62 -0
  696. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPixelType.h +67 -0
  697. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.cpp +667 -0
  698. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.h +117 -0
  699. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.cpp +104 -0
  700. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.h +135 -0
  701. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp +103 -0
  702. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.h +70 -0
  703. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp +553 -0
  704. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.h +109 -0
  705. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.cpp +127 -0
  706. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.h +98 -0
  707. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp +74 -0
  708. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.h +69 -0
  709. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgba.h +109 -0
  710. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.cpp +1405 -0
  711. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.h +346 -0
  712. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.cpp +497 -0
  713. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.h +259 -0
  714. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.cpp +157 -0
  715. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.h +63 -0
  716. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.cpp +220 -0
  717. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.h +80 -0
  718. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp +1702 -0
  719. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.h +210 -0
  720. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSimd.h +59 -0
  721. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp +125 -0
  722. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.h +382 -0
  723. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.cpp +242 -0
  724. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.h +160 -0
  725. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.cpp +80 -0
  726. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.h +71 -0
  727. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp +100 -0
  728. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.h +74 -0
  729. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp +129 -0
  730. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.h +172 -0
  731. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.cpp +216 -0
  732. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.h +97 -0
  733. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.cpp +62 -0
  734. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.h +95 -0
  735. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescription.h +107 -0
  736. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp +86 -0
  737. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.h +72 -0
  738. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.cpp +552 -0
  739. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.h +125 -0
  740. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp +1533 -0
  741. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.h +401 -0
  742. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.cpp +208 -0
  743. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.h +100 -0
  744. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.cpp +389 -0
  745. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.h +106 -0
  746. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp +1841 -0
  747. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.h +495 -0
  748. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.cpp +228 -0
  749. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.h +105 -0
  750. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp +1163 -0
  751. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.h +482 -0
  752. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.cpp +431 -0
  753. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.h +242 -0
  754. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp +79 -0
  755. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.h +74 -0
  756. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.cpp +217 -0
  757. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.h +100 -0
  758. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.cpp +60 -0
  759. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.h +136 -0
  760. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.cpp +391 -0
  761. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.h +78 -0
  762. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfXdr.h +927 -0
  763. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.cpp +196 -0
  764. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.h +78 -0
  765. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.cpp +127 -0
  766. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.h +89 -0
  767. data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.cpp +136 -0
  768. data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.h +16396 -0
  769. data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.cpp +573 -0
  770. data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.h +98334 -0
  771. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.cpp +80 -0
  772. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.h +143 -0
  773. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadExport.h +46 -0
  774. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadForward.h +52 -0
  775. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.cpp +59 -0
  776. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.h +160 -0
  777. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexPosix.cpp +85 -0
  778. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexWin32.cpp +79 -0
  779. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadNamespace.h +114 -0
  780. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.cpp +483 -0
  781. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.h +160 -0
  782. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPosix.cpp +98 -0
  783. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp +60 -0
  784. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.h +112 -0
  785. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosix.cpp +106 -0
  786. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosixCompat.cpp +155 -0
  787. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphoreWin32.cpp +153 -0
  788. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadWin32.cpp +100 -0
  789. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.cpp +37 -0
  790. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.h +849 -0
  791. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBoxAlgo.h +1016 -0
  792. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColor.h +736 -0
  793. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.cpp +178 -0
  794. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.h +257 -0
  795. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathEuler.h +926 -0
  796. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExc.h +73 -0
  797. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExport.h +46 -0
  798. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathForward.h +72 -0
  799. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrame.h +192 -0
  800. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustum.h +741 -0
  801. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustumTest.h +417 -0
  802. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.cpp +181 -0
  803. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.h +269 -0
  804. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGL.h +166 -0
  805. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGLU.h +54 -0
  806. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathHalfLimits.h +68 -0
  807. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInt64.h +62 -0
  808. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInterval.h +226 -0
  809. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLimits.h +268 -0
  810. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLine.h +185 -0
  811. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLineAlgo.h +288 -0
  812. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMath.h +208 -0
  813. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrix.h +3441 -0
  814. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.cpp +1252 -0
  815. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.h +1425 -0
  816. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathNamespace.h +115 -0
  817. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlane.h +257 -0
  818. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlatform.h +112 -0
  819. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathQuat.h +964 -0
  820. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.cpp +194 -0
  821. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.h +401 -0
  822. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRoots.h +219 -0
  823. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.cpp +54 -0
  824. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.h +656 -0
  825. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathSphere.h +177 -0
  826. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.cpp +583 -0
  827. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.h +2227 -0
  828. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVecAlgo.h +147 -0
  829. data/vendor/FreeImage/Source/OpenEXR/OpenEXRConfig.h +72 -0
  830. data/vendor/FreeImage/Source/Plugin.h +144 -0
  831. data/vendor/FreeImage/Source/Quantizers.h +354 -0
  832. data/vendor/FreeImage/Source/ToneMapping.h +44 -0
  833. data/vendor/FreeImage/Source/Utilities.h +516 -0
  834. data/vendor/FreeImage/Source/ZLib/adler32.c +179 -0
  835. data/vendor/FreeImage/Source/ZLib/compress.c +80 -0
  836. data/vendor/FreeImage/Source/ZLib/crc32.c +425 -0
  837. data/vendor/FreeImage/Source/ZLib/crc32.h +441 -0
  838. data/vendor/FreeImage/Source/ZLib/deflate.c +1967 -0
  839. data/vendor/FreeImage/Source/ZLib/deflate.h +346 -0
  840. data/vendor/FreeImage/Source/ZLib/gzclose.c +25 -0
  841. data/vendor/FreeImage/Source/ZLib/gzguts.h +209 -0
  842. data/vendor/FreeImage/Source/ZLib/gzlib.c +634 -0
  843. data/vendor/FreeImage/Source/ZLib/gzread.c +594 -0
  844. data/vendor/FreeImage/Source/ZLib/gzwrite.c +577 -0
  845. data/vendor/FreeImage/Source/ZLib/infback.c +640 -0
  846. data/vendor/FreeImage/Source/ZLib/inffast.c +340 -0
  847. data/vendor/FreeImage/Source/ZLib/inffast.h +11 -0
  848. data/vendor/FreeImage/Source/ZLib/inffixed.h +94 -0
  849. data/vendor/FreeImage/Source/ZLib/inflate.c +1512 -0
  850. data/vendor/FreeImage/Source/ZLib/inflate.h +122 -0
  851. data/vendor/FreeImage/Source/ZLib/inftrees.c +306 -0
  852. data/vendor/FreeImage/Source/ZLib/inftrees.h +62 -0
  853. data/vendor/FreeImage/Source/ZLib/trees.c +1226 -0
  854. data/vendor/FreeImage/Source/ZLib/trees.h +128 -0
  855. data/vendor/FreeImage/Source/ZLib/uncompr.c +59 -0
  856. data/vendor/FreeImage/Source/ZLib/zconf.h +511 -0
  857. data/vendor/FreeImage/Source/ZLib/zlib.h +1768 -0
  858. data/vendor/FreeImage/Source/ZLib/zutil.c +324 -0
  859. data/vendor/FreeImage/Source/ZLib/zutil.h +253 -0
  860. metadata +931 -0
@@ -0,0 +1,1888 @@
1
+ //*@@@+++@@@@******************************************************************
2
+ //
3
+ // Copyright � Microsoft Corp.
4
+ // All rights reserved.
5
+ //
6
+ // Redistribution and use in source and binary forms, with or without
7
+ // modification, are permitted provided that the following conditions are met:
8
+ //
9
+ // � Redistributions of source code must retain the above copyright notice,
10
+ // this list of conditions and the following disclaimer.
11
+ // � Redistributions in binary form must reproduce the above copyright notice,
12
+ // this list of conditions and the following disclaimer in the documentation
13
+ // and/or other materials provided with the distribution.
14
+ //
15
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19
+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
+ // POSSIBILITY OF SUCH DAMAGE.
26
+ //
27
+ //*@@@---@@@@******************************************************************
28
+
29
+ #include "strTransform.h"
30
+ #include "strcodec.h"
31
+ #include "decode.h"
32
+
33
+ /** rotation by -pi/8 **/
34
+ #define IROTATE1(a, b) (a) -= (((b) + 1) >> 1), (b) += (((a) + 1) >> 1) // this works well too
35
+ #define IROTATE2(a, b) (a) -= (((b)*3 + 4) >> 3), (b) += (((a)*3 + 4) >> 3) // this works well too
36
+
37
+ /** local functions **/
38
+ static Void invOddOdd(PixelI *, PixelI *, PixelI *, PixelI *);
39
+ static Void invOddOddPost(PixelI *, PixelI *, PixelI *, PixelI *);
40
+ static Void invOdd(PixelI *, PixelI *, PixelI *, PixelI *);
41
+ static Void strHSTdec(PixelI *, PixelI *, PixelI *, PixelI *);
42
+ static Void strHSTdec1(PixelI *, PixelI *);
43
+ static Void strHSTdec1_alternate(PixelI *, PixelI *);
44
+ static Void strHSTdec1_edge(PixelI *pa, PixelI *pd);
45
+
46
+ /** IDCT stuff **/
47
+ /** reordering should be combined with zigzag scan **/
48
+ /** data order before IDCT **/
49
+ /** 0 8 4 6 **/
50
+ /** 2 10 14 12 **/
51
+ /** 1 11 15 13 **/
52
+ /** 9 3 7 5 **/
53
+ /** data order after IDCT **/
54
+ /** 0 1 2 3 **/
55
+ /** 4 5 6 7 **/
56
+ /** 8 9 10 11 **/
57
+ /** 12 13 14 15 **/
58
+ Void strIDCT4x4Stage1(PixelI* p)
59
+ {
60
+ /** top left corner, butterfly => butterfly **/
61
+ strDCT2x2up(p + 0, p + 1, p + 2, p + 3);
62
+
63
+ /** top right corner, -pi/8 rotation => butterfly **/
64
+ invOdd(p + 5, p + 4, p + 7, p + 6);
65
+
66
+ /** bottom left corner, butterfly => -pi/8 rotation **/
67
+ invOdd(p + 10, p + 8, p + 11, p + 9);
68
+
69
+ /** bottom right corner, -pi/8 rotation => -pi/8 rotation **/
70
+ invOddOdd(p + 15, p + 14, p + 13, p + 12);
71
+
72
+ /** butterfly **/
73
+ //FOURBUTTERFLY(p, 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);
74
+ FOURBUTTERFLY_HARDCODED1(p);
75
+ }
76
+
77
+ Void strIDCT4x4Stage2(PixelI* p)
78
+ {
79
+ /** bottom left corner, butterfly => -pi/8 rotation **/
80
+ invOdd(p + 32, p + 48, p + 96, p + 112);
81
+
82
+ /** top right corner, -pi/8 rotation => butterfly **/
83
+ invOdd(p + 128, p + 192, p + 144, p + 208);
84
+
85
+ /** bottom right corner, -pi/8 rotation => -pi/8 rotation **/
86
+ invOddOdd(p + 160, p + 224, p + 176, p + 240);
87
+
88
+ /** top left corner, butterfly => butterfly **/
89
+ strDCT2x2up(p + 0, p + 64, p + 16, p + 80);
90
+
91
+ /** butterfly **/
92
+ FOURBUTTERFLY(p, 0, 192, 48, 240, 64, 128, 112, 176, 16, 208, 32, 224, 80, 144, 96, 160);
93
+ }
94
+
95
+ Void strNormalizeDec(PixelI* p, Bool bChroma)
96
+ {
97
+ int i;
98
+ if (!bChroma) {
99
+ //for (i = 0; i < 256; i += 16) {
100
+ // p[i] <<= 2;
101
+ //}
102
+ }
103
+ else {
104
+ for (i = 0; i < 256; i += 16) {
105
+ p[i] += p[i];
106
+ }
107
+ }
108
+ }
109
+
110
+ /** 2x2 DCT with post-scaling - for use on decoder side **/
111
+ Void strDCT2x2dnDec(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
112
+ {
113
+ PixelI a, b, c, d, C, t;
114
+ a = *pa;
115
+ b = *pb;
116
+ C = *pc;
117
+ d = *pd;
118
+
119
+ a += d;
120
+ b -= C;
121
+ t = ((a - b) >> 1);
122
+ c = t - d;
123
+ d = t - C;
124
+ a -= d;
125
+ b += c;
126
+
127
+ *pa = a * 2;
128
+ *pb = b * 2;
129
+ *pc = c * 2;
130
+ *pd = d * 2;
131
+ }
132
+
133
+
134
+ /** post filter stuff **/
135
+ /** 2-point post for boundaries **/
136
+ Void strPost2(PixelI * a, PixelI * b)
137
+ {
138
+ *b += ((*a + 4) >> 3);
139
+ *a += ((*b + 2) >> 2);
140
+ *b += ((*a + 4) >> 3);
141
+ }
142
+
143
+ Void strPost2_alternate(PixelI * pa, PixelI * pb)
144
+ {
145
+ PixelI a, b;
146
+ a = *pa;
147
+ b = *pb;
148
+
149
+ /** rotate **/
150
+ b += ((a + 2) >> 2);
151
+ a += ((b + 1) >> 1);
152
+ a += (b >> 5);
153
+ a += (b >> 9);
154
+ a += (b >> 13);
155
+
156
+ b += ((a + 2) >> 2);
157
+
158
+ *pa = a;
159
+ *pb = b;
160
+ }
161
+
162
+ Void strPost2x2(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
163
+ {
164
+ PixelI a, b, c, d;
165
+ a = *pa;
166
+ b = *pb;
167
+ c = *pc;
168
+ d = *pd;
169
+
170
+ /** butterflies **/
171
+ a += d;
172
+ b += c;
173
+ d -= (a + 1) >> 1;
174
+ c -= (b + 1) >> 1;
175
+
176
+ /** rotate **/
177
+ b += ((a + 2) >> 2);
178
+ a += ((b + 1) >> 1);
179
+ b += ((a + 2) >> 2);
180
+
181
+ /** butterflies **/
182
+ d += (a + 1) >> 1;
183
+ c += (b + 1) >> 1;
184
+ a -= d;
185
+ b -= c;
186
+
187
+ *pa = a;
188
+ *pb = b;
189
+ *pc = c;
190
+ *pd = d;
191
+ }
192
+
193
+ Void strPost2x2_alternate(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
194
+ {
195
+ PixelI a, b, c, d;
196
+ a = *pa;
197
+ b = *pb;
198
+ c = *pc;
199
+ d = *pd;
200
+
201
+ /** butterflies **/
202
+ a += d;
203
+ b += c;
204
+ d -= (a + 1) >> 1;
205
+ c -= (b + 1) >> 1;
206
+
207
+ /** rotate **/
208
+ b += ((a + 2) >> 2);
209
+ a += ((b + 1) >> 1);
210
+ a += (b >> 5);
211
+ a += (b >> 9);
212
+ a += (b >> 13);
213
+ b += ((a + 2) >> 2);
214
+
215
+ /** butterflies **/
216
+ d += (a + 1) >> 1;
217
+ c += (b + 1) >> 1;
218
+ a -= d;
219
+ b -= c;
220
+
221
+ *pa = a;
222
+ *pb = b;
223
+ *pc = c;
224
+ *pd = d;
225
+ }
226
+
227
+ /** 4-point post for boundaries **/
228
+ Void strPost4(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
229
+ {
230
+ PixelI a, b, c, d;
231
+ a = *pa;
232
+ b = *pb;
233
+ c = *pc;
234
+ d = *pd;
235
+
236
+ a += d, b += c;
237
+ d -= ((a + 1) >> 1), c -= ((b + 1) >> 1);
238
+
239
+ IROTATE1(c, d);
240
+
241
+ d += ((a + 1) >> 1), c += ((b + 1) >> 1);
242
+ a -= d - ((d * 3 + 16) >> 5), b -= c - ((c * 3 + 16) >> 5);
243
+ d += ((a * 3 + 8) >> 4), c += ((b * 3 + 8) >> 4);
244
+ a += ((d * 3 + 16) >> 5), b += ((c * 3 + 16) >> 5);
245
+
246
+ *pa = a;
247
+ *pb = b;
248
+ *pc = c;
249
+ *pd = d;
250
+ }
251
+
252
+ Void strPost4_alternate(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
253
+ {
254
+ PixelI a, b, c, d;
255
+ a = *pa;
256
+ b = *pb;
257
+ c = *pc;
258
+ d = *pd;
259
+
260
+ a += d, b += c;
261
+ d -= ((a + 1) >> 1), c -= ((b + 1) >> 1);
262
+
263
+ strHSTdec1_edge(&a, &d); strHSTdec1_edge(&b, &c);
264
+ IROTATE1(c, d);
265
+ d += ((a + 1) >> 1), c += ((b + 1) >> 1);
266
+
267
+ a -= d, b -= c;
268
+
269
+ *pa = a;
270
+ *pb = b;
271
+ *pc = c;
272
+ *pd = d;
273
+ }
274
+
275
+ /*****************************************************************************************
276
+ Input data offsets:
277
+ (15)(14)|(10+64)(11+64) p0 (15)(14)|(74)(75)
278
+ (13)(12)|( 8+64)( 9+64) (13)(12)|(72)(73)
279
+ --------+-------------- --------+--------
280
+ ( 5)( 4)|( 0+64) (1+64) p1 ( 5)( 4)|(64)(65)
281
+ ( 7)( 6)|( 2+64) (3+64) ( 7)( 6)|(66)(67)
282
+ *****************************************************************************************/
283
+ Void DCCompensate (PixelI *a, PixelI *b, PixelI *c, PixelI *d, int iDC)
284
+ {
285
+ iDC = iDC>>1;
286
+ *a -= iDC;
287
+ *d -= iDC;
288
+ *b += iDC;
289
+ *c += iDC;
290
+ }
291
+
292
+ #ifndef max
293
+ #define max(a,b) (((a) > (b)) ? (a) : (b))
294
+ #endif
295
+
296
+ #ifndef min
297
+ #define min(a,b) (((a) < (b)) ? (a) : (b))
298
+ #endif
299
+
300
+ int ClipDCL(int iDCL, int iAltDCL)
301
+ {
302
+ int iClipDCL = 0;
303
+ if (iDCL > 0) {
304
+ if (iAltDCL > 0)
305
+ iClipDCL = min(iDCL, iAltDCL);
306
+ else
307
+ iClipDCL = 0;
308
+ }
309
+ else if (iDCL < 0) {
310
+ if (iAltDCL < 0)
311
+ iClipDCL = max(iDCL, iAltDCL);
312
+ else
313
+ iClipDCL = 0;
314
+ }
315
+ return iClipDCL;
316
+ }
317
+
318
+ Void strPost4x4Stage1Split(PixelI *p0, PixelI *p1, Int iOffset, Int iHPQP, Bool bHPAbsent)
319
+ {
320
+ int iDCLAlt1, iDCLAlt2, iDCLAlt3, iDCLAlt0;
321
+ int iDCL1, iDCL2, iDCL3, iDCL0;
322
+ int iTmp1, iTmp2, iTmp3, iTmp0;
323
+
324
+ PixelI *p2 = p0 + 72 - iOffset;
325
+ PixelI *p3 = p1 + 64 - iOffset;
326
+ p0 += 12;
327
+ p1 += 4;
328
+
329
+ /** buttefly **/
330
+ strDCT2x2dn(p0 + 0, p2 + 0, p1 + 0, p3 + 0);
331
+ strDCT2x2dn(p0 + 1, p2 + 1, p1 + 1, p3 + 1);
332
+ strDCT2x2dn(p0 + 2, p2 + 2, p1 + 2, p3 + 2);
333
+ strDCT2x2dn(p0 + 3, p2 + 3, p1 + 3, p3 + 3);
334
+
335
+ /** bottom right corner: -pi/8 rotation => -pi/8 rotation **/
336
+ invOddOddPost(p3 + 0, p3 + 1, p3 + 2, p3 + 3);
337
+
338
+ /** anti diagonal corners: rotation by -pi/8 **/
339
+ IROTATE1(p1[2], p1[3]);
340
+ IROTATE1(p1[0], p1[1]);
341
+ IROTATE1(p2[1], p2[3]);
342
+ IROTATE1(p2[0], p2[2]);
343
+
344
+ /** butterfly **/
345
+ strHSTdec1(p0 + 0, p3 + 0);
346
+ strHSTdec1(p0 + 1, p3 + 1);
347
+ strHSTdec1(p0 + 2, p3 + 2);
348
+ strHSTdec1(p0 + 3, p3 + 3);
349
+ strHSTdec(p0 + 0, p2 + 0, p1 + 0, p3 + 0);
350
+ strHSTdec(p0 + 1, p2 + 1, p1 + 1, p3 + 1);
351
+ strHSTdec(p0 + 2, p2 + 2, p1 + 2, p3 + 2);
352
+ strHSTdec(p0 + 3, p2 + 3, p1 + 3, p3 + 3);
353
+
354
+ iTmp0 = (*(p0 +0) + *(p1 +0) + *(p2 +0) + *(p3 +0))>>1;
355
+ iTmp1 = (*(p0 +1) + *(p1 +1) + *(p2 +1) + *(p3 +1))>>1;
356
+ iTmp2 = (*(p0 +2) + *(p1 +2) + *(p2 +2) + *(p3 +2))>>1;
357
+ iTmp3 = (*(p0 +3) + *(p1 +3) + *(p2 +3) + *(p3 +3))>>1;
358
+ iDCL0 = (iTmp0 * 595 + 65536)>>17; //Approximating 27/5947
359
+ iDCL1 = (iTmp1 * 595 + 65536)>>17;
360
+ iDCL2 = (iTmp2 * 595 + 65536)>>17;
361
+ iDCL3 = (iTmp3 * 595 + 65536)>>17;
362
+ if ((abs(iDCL0) < iHPQP && iHPQP > 20) || bHPAbsent) {
363
+ iDCLAlt0 = (*(p0 +0) - *(p1 +0) - *(p2 +0) + *(p3 +0))>>1;
364
+ iDCL0 = ClipDCL (iDCL0, iDCLAlt0);
365
+ DCCompensate (p0 + 0, p2 + 0, p1 + 0, p3 + 0, iDCL0);
366
+ }
367
+ if ((abs(iDCL1) < iHPQP && iHPQP > 20) || bHPAbsent) {
368
+ iDCLAlt1 = (*(p0 +1) - *(p1 +1) - *(p2 +1) + *(p3 +1))>>1;
369
+ iDCL1 = ClipDCL (iDCL1, iDCLAlt1);
370
+ DCCompensate (p0 + 1, p2 + 1, p1 + 1, p3 + 1, iDCL1);
371
+ }
372
+ if ((abs(iDCL2) < iHPQP && iHPQP > 20) || bHPAbsent) {
373
+ iDCLAlt2 = (*(p0 +2) - *(p1 +2) - *(p2 +2) + *(p3 +2))>>1;
374
+ iDCL2 = ClipDCL (iDCL2, iDCLAlt2);
375
+ DCCompensate (p0 + 2, p2 + 2, p1 + 2, p3 + 2, iDCL2);
376
+ }
377
+ if ((abs(iDCL3) < iHPQP && iHPQP > 20) || bHPAbsent) {
378
+ iDCLAlt3 = (*(p0 +3) - *(p1 +3) - *(p2 +3) + *(p3 +3))>>1;
379
+ iDCL3 = ClipDCL (iDCL3, iDCLAlt3);
380
+ DCCompensate (p0 + 3, p2 + 3, p1 + 3, p3 + 3, iDCL3);
381
+ }
382
+ }
383
+
384
+ Void strPost4x4Stage1(PixelI* p, Int iOffset, Int iHPQP, Bool bHPAbsent)
385
+ {
386
+ strPost4x4Stage1Split(p, p + 16, iOffset, iHPQP, bHPAbsent);
387
+ }
388
+
389
+ Void strPost4x4Stage1Split_alternate(PixelI *p0, PixelI *p1, Int iOffset)
390
+ {
391
+ PixelI *p2 = p0 + 72 - iOffset;
392
+ PixelI *p3 = p1 + 64 - iOffset;
393
+ p0 += 12;
394
+ p1 += 4;
395
+
396
+ /** buttefly **/
397
+ strDCT2x2dn(p0 + 0, p2 + 0, p1 + 0, p3 + 0);
398
+ strDCT2x2dn(p0 + 1, p2 + 1, p1 + 1, p3 + 1);
399
+ strDCT2x2dn(p0 + 2, p2 + 2, p1 + 2, p3 + 2);
400
+ strDCT2x2dn(p0 + 3, p2 + 3, p1 + 3, p3 + 3);
401
+
402
+ /** bottom right corner: -pi/8 rotation => -pi/8 rotation **/
403
+ invOddOddPost(p3 + 0, p3 + 1, p3 + 2, p3 + 3);
404
+
405
+ /** anti diagonal corners: rotation by -pi/8 **/
406
+ IROTATE1(p1[2], p1[3]);
407
+ IROTATE1(p1[0], p1[1]);
408
+ IROTATE1(p2[1], p2[3]);
409
+ IROTATE1(p2[0], p2[2]);
410
+
411
+ /** butterfly **/
412
+ strHSTdec1_alternate(p0 + 0, p3 + 0);
413
+ strHSTdec1_alternate(p0 + 1, p3 + 1);
414
+ strHSTdec1_alternate(p0 + 2, p3 + 2);
415
+ strHSTdec1_alternate(p0 + 3, p3 + 3);
416
+ strHSTdec(p0 + 0, p2 + 0, p1 + 0, p3 + 0);
417
+ strHSTdec(p0 + 1, p2 + 1, p1 + 1, p3 + 1);
418
+ strHSTdec(p0 + 2, p2 + 2, p1 + 2, p3 + 2);
419
+ strHSTdec(p0 + 3, p2 + 3, p1 + 3, p3 + 3);
420
+ }
421
+
422
+ Void strPost4x4Stage1_alternate(PixelI* p, Int iOffset)
423
+ {
424
+ strPost4x4Stage1Split_alternate(p, p + 16, iOffset);
425
+ }
426
+
427
+ /*****************************************************************************************
428
+ Input data offsets:
429
+ (15)(14)|(10+32)(11+32) p0 (15)(14)|(42)(43)
430
+ (13)(12)|( 8+32)( 9+32) (13)(12)|(40)(41)
431
+ --------+-------------- --------+--------
432
+ ( 5)( 4)|( 0+32) (1+32) p1 ( 5)( 4)|(32)(33)
433
+ ( 7)( 6)|( 2+32) (3+32) ( 7)( 6)|(34)(35)
434
+ *****************************************************************************************/
435
+
436
+ /*****************************************************************************************
437
+ Input data offsets:
438
+ ( -96)(-32)|(32)( 96) p0
439
+ ( -80)(-16)|(48)(112)
440
+ -----------+------------
441
+ (-128)(-64)|( 0)( 64) p1
442
+ (-112)(-48)|(16)( 80)
443
+ *****************************************************************************************/
444
+ Void strPost4x4Stage2Split(PixelI* p0, PixelI* p1)
445
+ {
446
+ /** buttefly **/
447
+ strDCT2x2dn(p0 - 96, p0 + 96, p1 - 112, p1 + 80);
448
+ strDCT2x2dn(p0 - 32, p0 + 32, p1 - 48, p1 + 16);
449
+ strDCT2x2dn(p0 - 80, p0 + 112, p1 - 128, p1 + 64);
450
+ strDCT2x2dn(p0 - 16, p0 + 48, p1 - 64, p1 + 0);
451
+
452
+ /** bottom right corner: -pi/8 rotation => -pi/8 rotation **/
453
+ invOddOddPost(p1 + 0, p1 + 64, p1 + 16, p1 + 80);
454
+
455
+ /** anti diagonal corners: rotation by -pi/8 **/
456
+ IROTATE1(p0[ 48], p0[ 32]);
457
+ IROTATE1(p0[112], p0[ 96]);
458
+ IROTATE1(p1[-64], p1[-128]);
459
+ IROTATE1(p1[-48], p1[-112]);
460
+
461
+ /** butterfly **/
462
+ strHSTdec1(p0 - 96, p1 + 80);
463
+ strHSTdec1(p0 - 32, p1 + 16);
464
+ strHSTdec1(p0 - 80, p1 + 64);
465
+ strHSTdec1(p0 - 16, p1 + 0);
466
+
467
+ strHSTdec(p0 - 96, p1 - 112, p0 + 96, p1 + 80);
468
+ strHSTdec(p0 - 32, p1 - 48, p0 + 32, p1 + 16);
469
+ strHSTdec(p0 - 80, p1 - 128, p0 + 112, p1 + 64);
470
+ strHSTdec(p0 - 16, p1 - 64, p0 + 48, p1 + 0);
471
+ }
472
+
473
+ Void strPost4x4Stage2Split_alternate(PixelI* p0, PixelI* p1)
474
+ {
475
+ /** buttefly **/
476
+ strDCT2x2dn(p0 - 96, p0 + 96, p1 - 112, p1 + 80);
477
+ strDCT2x2dn(p0 - 32, p0 + 32, p1 - 48, p1 + 16);
478
+ strDCT2x2dn(p0 - 80, p0 + 112, p1 - 128, p1 + 64);
479
+ strDCT2x2dn(p0 - 16, p0 + 48, p1 - 64, p1 + 0);
480
+
481
+ /** bottom right corner: -pi/8 rotation => -pi/8 rotation **/
482
+ invOddOddPost(p1 + 0, p1 + 64, p1 + 16, p1 + 80);
483
+
484
+ /** anti diagonal corners: rotation by -pi/8 **/
485
+ IROTATE1(p0[ 48], p0[ 32]);
486
+ IROTATE1(p0[112], p0[ 96]);
487
+ IROTATE1(p1[-64], p1[-128]);
488
+ IROTATE1(p1[-48], p1[-112]);
489
+
490
+ /** butterfly **/
491
+ strHSTdec1_alternate(p0 - 96, p1 + 80);
492
+ strHSTdec1_alternate(p0 - 32, p1 + 16);
493
+ strHSTdec1_alternate(p0 - 80, p1 + 64);
494
+ strHSTdec1_alternate(p0 - 16, p1 + 0);
495
+
496
+ strHSTdec(p0 - 96, p1 - 112, p0 + 96, p1 + 80);
497
+ strHSTdec(p0 - 32, p1 - 48, p0 + 32, p1 + 16);
498
+ strHSTdec(p0 - 80, p1 - 128, p0 + 112, p1 + 64);
499
+ strHSTdec(p0 - 16, p1 - 64, p0 + 48, p1 + 0);
500
+ }
501
+
502
+ /**
503
+ Hadamard+Scale transform
504
+ for some strange reason, breaking up the function into two blocks, strHSTdec1 and strHSTdec
505
+ seems to work faster
506
+ **/
507
+ static Void strHSTdec1(PixelI *pa, PixelI *pd)
508
+ {
509
+ /** different realization : does rescaling as well! **/
510
+ PixelI a, d;
511
+ a = *pa;
512
+ d = *pd;
513
+
514
+ a += d;
515
+ d = (a >> 1) - d;
516
+ a += (d * 3 + 0) >> 3;
517
+ d += (a * 3 + 0) >> 4;
518
+ //a += (d * 3 + 4) >> 3;
519
+
520
+ *pa = a;
521
+ *pd = d;
522
+ }
523
+
524
+ static Void strHSTdec1_alternate(PixelI *pa, PixelI *pd)
525
+ {
526
+ /** different realization : does rescaling as well! **/
527
+ PixelI a, d;
528
+ a = *pa;
529
+ d = *pd;
530
+
531
+ a += d;
532
+ d = (a >> 1) - d;
533
+ a += (d * 3 + 0) >> 3;
534
+ d += (a * 3 + 0) >> 4;
535
+ //a += (d * 3 + 4) >> 3;
536
+
537
+ d += (a >> 7);
538
+ d -= (a >> 10);
539
+
540
+ *pa = a;
541
+ *pd = d;
542
+ }
543
+
544
+ static Void strHSTdec1_edge (PixelI *pa, PixelI *pd)
545
+ {
546
+ /** different realization as compared to scaling operator for 2D case **/
547
+ PixelI a, d;
548
+ a = *pa;
549
+ d = *pd;
550
+
551
+ a += d;
552
+ d = (a >> 1) - d;
553
+ a += (d * 3 + 0) >> 3;
554
+ d += (a * 3 + 0) >> 4;
555
+
556
+ //Scaling modification of adding 7/1024 in 2 steps (without multiplication by 7).
557
+ d += (a >> 7);
558
+ d -= (a >> 10);
559
+
560
+ a += (d * 3 + 4) >> 3;
561
+ d -= (a >> 1);
562
+ a += d;
563
+ // End new operations
564
+
565
+ *pa = a;
566
+ *pd = -d; // Negative sign needed here for 1D scaling case to ensure correct scaling.
567
+ }
568
+
569
+ static Void strHSTdec(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
570
+ {
571
+ /** different realization : does rescaling as well! **/
572
+ PixelI a, b, c, d;
573
+ a = *pa;
574
+ b = *pb;
575
+ c = *pc;
576
+ d = *pd;
577
+
578
+ b -= c;
579
+ a += (d * 3 + 4) >> 3;
580
+
581
+ d -= (b >> 1);
582
+ c = ((a - b) >> 1) - c;
583
+ *pc = d;
584
+ *pd = c;
585
+ *pa = a - c, *pb = b + d;
586
+ }
587
+
588
+ /** Kron(Rotate(pi/8), Rotate(pi/8)) **/
589
+ static Void invOddOdd(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
590
+ {
591
+ PixelI a, b, c, d, t1, t2;
592
+ a = *pa;
593
+ b = *pb;
594
+ c = *pc;
595
+ d = *pd;
596
+
597
+ /** butterflies **/
598
+ d += a;
599
+ c -= b;
600
+ a -= (t1 = d >> 1);
601
+ b += (t2 = c >> 1);
602
+
603
+ /** rotate pi/4 **/
604
+ a -= (b * 3 + 3) >> 3;
605
+ b += (a * 3 + 3) >> 2;
606
+ a -= (b * 3 + 4) >> 3;
607
+
608
+ /** butterflies **/
609
+ b -= t2;
610
+ a += t1;
611
+ c += b;
612
+ d -= a;
613
+
614
+ /** sign flips **/
615
+ *pa = a;
616
+ *pb = -b;
617
+ *pc = -c;
618
+ *pd = d;
619
+ }
620
+
621
+ /** Kron(Rotate(pi/8), Rotate(pi/8)) **/
622
+ static Void invOddOddPost(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
623
+ {
624
+ PixelI a, b, c, d, t1, t2;
625
+ a = *pa;
626
+ b = *pb;
627
+ c = *pc;
628
+ d = *pd;
629
+
630
+ /** butterflies **/
631
+ d += a;
632
+ c -= b;
633
+ a -= (t1 = d >> 1);
634
+ b += (t2 = c >> 1);
635
+
636
+ /** rotate pi/4 **/
637
+ a -= (b * 3 + 6) >> 3;
638
+ b += (a * 3 + 2) >> 2;
639
+ a -= (b * 3 + 4) >> 3;
640
+
641
+ /** butterflies **/
642
+ b -= t2;
643
+ a += t1;
644
+ c += b;
645
+ d -= a;
646
+
647
+ *pa = a;
648
+ *pb = b;
649
+ *pc = c;
650
+ *pd = d;
651
+ }
652
+
653
+
654
+ /** Kron(Rotate(-pi/8), [1 1; 1 -1]/sqrt(2)) **/
655
+ /** [D C A B] => [a b c d] **/
656
+ Void invOdd(PixelI *pa, PixelI *pb, PixelI *pc, PixelI *pd)
657
+ {
658
+ PixelI a, b, c, d;
659
+ a = *pa;
660
+ b = *pb;
661
+ c = *pc;
662
+ d = *pd;
663
+
664
+ /** butterflies **/
665
+ b += d;
666
+ a -= c;
667
+ d -= (b) >> 1;
668
+ c += (a + 1) >> 1;
669
+
670
+ /** rotate pi/8 **/
671
+ IROTATE2(a, b);
672
+ IROTATE2(c, d);
673
+
674
+ /** butterflies **/
675
+ c -= (b + 1) >> 1;
676
+ d = ((a + 1) >> 1) - d;
677
+ b += c;
678
+ a -= d;
679
+
680
+ *pa = a;
681
+ *pb = b;
682
+ *pc = c;
683
+ *pd = d;
684
+ }
685
+
686
+ /*************************************************************************
687
+ Top-level function to inverse tranform possible part of a macroblock
688
+ *************************************************************************/
689
+ Int invTransformMacroblock(CWMImageStrCodec * pSC)
690
+ {
691
+ const OVERLAP olOverlap = pSC->WMISCP.olOverlap;
692
+ const COLORFORMAT cfColorFormat = pSC->m_param.cfColorFormat;
693
+ // const BITDEPTH_BITS bdBitDepth = pSC->WMII.bdBitDepth;
694
+ const Bool left = (pSC->cColumn == 0), right = (pSC->cColumn == pSC->cmbWidth);
695
+ const Bool top = (pSC->cRow == 0), bottom = (pSC->cRow == pSC->cmbHeight);
696
+ const Bool topORbottom = (top || bottom), leftORright = (left || right);
697
+ const Bool topORleft = (top || left), bottomORright = (bottom || right);
698
+ const size_t mbWidth = pSC->cmbWidth, mbX = pSC->cColumn;
699
+ PixelI * p = NULL;// * pt = NULL;
700
+ size_t i;
701
+ const size_t iChannels = (cfColorFormat == YUV_420 || cfColorFormat == YUV_422) ? 1 : pSC->m_param.cNumChannels;
702
+ const size_t tScale = pSC->m_Dparam->cThumbnailScale;
703
+ Int j = 0;
704
+
705
+ Int qp[MAX_CHANNELS], dcqp[MAX_CHANNELS], iStrength = (1 << pSC->WMII.cPostProcStrength);
706
+ // ERR_CODE result = ICERR_OK;
707
+
708
+ Bool bHPAbsent = (pSC->WMISCP.sbSubband == SB_NO_HIGHPASS || pSC->WMISCP.sbSubband == SB_DC_ONLY);
709
+
710
+ if(pSC->WMII.cPostProcStrength > 0){
711
+ // threshold for post processing
712
+ for(i = 0; i < iChannels; i ++){
713
+ qp[i] = pSC->pTile[pSC->cTileColumn].pQuantizerLP[i][pSC->MBInfo.iQIndexLP].iQP * iStrength * (olOverlap == OL_NONE ? 2 : 1);
714
+ dcqp[i] = pSC->pTile[pSC->cTileColumn].pQuantizerDC[i][0].iQP * iStrength;
715
+ }
716
+
717
+ if(left) // a new MB row
718
+ slideOneMBRow(pSC->pPostProcInfo, pSC->m_param.cNumChannels, mbWidth, top, bottom); // previous current row becomes previous row
719
+ }
720
+
721
+ //================================================================
722
+ // 400_Y, 444_YUV
723
+ for (i = 0; i < iChannels && tScale < 16; ++i)
724
+ {
725
+ PixelI* const p0 = pSC->p0MBbuffer[i];
726
+ PixelI* const p1 = pSC->p1MBbuffer[i];
727
+
728
+ Int iHPQP = 255;
729
+ if (!bHPAbsent)
730
+ iHPQP = pSC->pTile[pSC->cTileColumn].pQuantizerHP[i][pSC->MBInfo.iQIndexHP].iQP;
731
+
732
+ //================================
733
+ // second level inverse transform
734
+ if (!bottomORright)
735
+ {
736
+ if(pSC->WMII.cPostProcStrength > 0)
737
+ updatePostProcInfo(pSC->pPostProcInfo, p1, mbX, i); // update postproc info before IDCT
738
+
739
+ strIDCT4x4Stage2(p1);
740
+ if (pSC->m_param.bScaledArith) {
741
+ strNormalizeDec(p1, (i != 0));
742
+ }
743
+ }
744
+
745
+ //================================
746
+ // second level inverse overlap
747
+ if (OL_TWO == olOverlap)
748
+ {
749
+ if (leftORright && (!topORbottom))
750
+ {
751
+ j = left ? 0 : -128;
752
+ strPost4(p0 + j + 32, p0 + j + 48, p1 + j + 0, p1 + j + 16);
753
+ strPost4(p0 + j + 96, p0 + j + 112, p1 + j + 64, p1 + j + 80);
754
+ }
755
+
756
+ if (!leftORright)
757
+ {
758
+ if (topORbottom)
759
+ {
760
+ p = top ? p1 : p0 + 32;
761
+ strPost4(p - 128, p - 64, p + 0, p + 64);
762
+ strPost4(p - 112, p - 48, p + 16, p + 80);
763
+ p = NULL;
764
+ }
765
+ else
766
+ {
767
+ strPost4x4Stage2Split(p0, p1);
768
+ }
769
+ }
770
+ }
771
+
772
+ if(pSC->WMII.cPostProcStrength > 0)
773
+ postProcMB(pSC->pPostProcInfo, p0, p1, mbX, i, dcqp[i]); // second stage deblocking
774
+
775
+ //================================
776
+ // first level inverse transform
777
+ if(tScale >= 4) // bypass first level transform for 4:1 and smaller thumbnail
778
+ continue;
779
+
780
+ if (!top)
781
+ {
782
+ for (j = (left ? 32 : -96); j < (right ? 32 : 160); j += 64)
783
+ {
784
+ strIDCT4x4Stage1(p0 + j + 0);
785
+ strIDCT4x4Stage1(p0 + j + 16);
786
+ }
787
+ }
788
+
789
+ if (!bottom)
790
+ {
791
+ for (j = (left ? 0 : -128); j < (right ? 0 : 128); j += 64)
792
+ {
793
+ strIDCT4x4Stage1(p1 + j + 0);
794
+ strIDCT4x4Stage1(p1 + j + 16);
795
+ }
796
+ }
797
+
798
+ //================================
799
+ // first level inverse overlap
800
+ if (OL_NONE != olOverlap)
801
+ {
802
+ if (leftORright)
803
+ {
804
+ j = left ? 0 + 10 : -64 + 14;
805
+ if (!top)
806
+ {
807
+ p = p0 + 16 + j;
808
+ strPost4(p + 0, p - 2, p + 6, p + 8);
809
+ strPost4(p + 1, p - 1, p + 7, p + 9);
810
+ strPost4(p + 16, p + 14, p + 22, p + 24);
811
+ strPost4(p + 17, p + 15, p + 23, p + 25);
812
+ p = NULL;
813
+ }
814
+ if (!bottom)
815
+ {
816
+ p = p1 + j;
817
+ strPost4(p + 0, p - 2, p + 6, p + 8);
818
+ strPost4(p + 1, p - 1, p + 7, p + 9);
819
+ p = NULL;
820
+ }
821
+ if (!topORbottom)
822
+ {
823
+ strPost4(p0 + 48 + j + 0, p0 + 48 + j - 2, p1 - 10 + j, p1 - 8 + j);
824
+ strPost4(p0 + 48 + j + 1, p0 + 48 + j - 1, p1 - 9 + j, p1 - 7 + j);
825
+ }
826
+ }
827
+
828
+ if (top)
829
+ {
830
+ for (j = (left ? 0 : -192); j < (right ? -64 : 64); j += 64)
831
+ {
832
+ p = p1 + j;
833
+ strPost4(p + 5, p + 4, p + 64, p + 65);
834
+ strPost4(p + 7, p + 6, p + 66, p + 67);
835
+ p = NULL;
836
+
837
+ strPost4x4Stage1(p1 + j, 0, iHPQP, bHPAbsent);
838
+ }
839
+ }
840
+ else if (bottom)
841
+ {
842
+ for (j = (left ? 0 : -192); j < (right ? -64 : 64); j += 64)
843
+ {
844
+ strPost4x4Stage1(p0 + 16 + j, 0, iHPQP, bHPAbsent);
845
+ strPost4x4Stage1(p0 + 32 + j, 0, iHPQP, bHPAbsent);
846
+
847
+ p = p0 + 48 + j;
848
+ strPost4(p + 15, p + 14, p + 74, p + 75);
849
+ strPost4(p + 13, p + 12, p + 72, p + 73);
850
+ p = NULL;
851
+ }
852
+ }
853
+ else
854
+ {
855
+ for (j = (left ? 0 : -192); j < (right ? -64 : 64); j += 64)
856
+ {
857
+ strPost4x4Stage1(p0 + 16 + j, 0, iHPQP, bHPAbsent);
858
+ strPost4x4Stage1(p0 + 32 + j, 0, iHPQP, bHPAbsent);
859
+ strPost4x4Stage1Split(p0 + 48 + j, p1 + j, 0, iHPQP, bHPAbsent);
860
+ strPost4x4Stage1(p1 + j, 0, iHPQP, bHPAbsent);
861
+ }
862
+ }
863
+ }
864
+
865
+ if(pSC->WMII.cPostProcStrength > 0 && (!topORleft))
866
+ postProcBlock(pSC->pPostProcInfo, p0, p1, mbX, i, qp[i]); // destairing and first stage deblocking
867
+ }
868
+
869
+ //================================================================
870
+ // 420_UV
871
+ for (i = 0; i < (YUV_420 == cfColorFormat? 2U : 0U) && tScale < 16; ++i)
872
+ {
873
+ PixelI* const p0 = pSC->p0MBbuffer[1 + i];//(0 == i ? pSC->pU0 : pSC->pV0);
874
+ PixelI* const p1 = pSC->p1MBbuffer[1 + i];//(0 == i ? pSC->pU1 : pSC->pV1);
875
+
876
+ Int iHPQP = 255;
877
+ if (!bHPAbsent)
878
+ iHPQP = pSC->pTile[pSC->cTileColumn].pQuantizerHP[i][pSC->MBInfo.iQIndexHP].iQP;
879
+
880
+ //========================================
881
+ // second level inverse transform (420_UV)
882
+ if (!bottomORright)
883
+ {
884
+ if (!pSC->m_param.bScaledArith) {
885
+ strDCT2x2dn(p1, p1 + 32, p1 + 16, p1 + 48);
886
+ }
887
+ else {
888
+ strDCT2x2dnDec(p1, p1 + 32, p1 + 16, p1 + 48);
889
+ }
890
+ }
891
+
892
+ //========================================
893
+ // second level inverse overlap (420_UV)
894
+ if (OL_TWO == olOverlap)
895
+ {
896
+ if (leftORright && !topORbottom)
897
+ {
898
+ j = (left ? 0 : -32);
899
+ strPost2(p0 + j + 16, p1 + j);
900
+ }
901
+
902
+ if (!leftORright)
903
+ {
904
+ if (topORbottom)
905
+ {
906
+ p = (top ? p1 : p0 + 16);
907
+ strPost2(p - 32, p);
908
+ p = NULL;
909
+ }
910
+ else{
911
+ strPost2x2(p0 - 16, p0 + 16, p1 - 32, p1);
912
+ }
913
+ }
914
+ }
915
+
916
+ //========================================
917
+ // first level inverse transform (420_UV)
918
+ if(tScale >= 4) // bypass first level transform for 4:1 and smaller thumbnail
919
+ continue;
920
+
921
+ if (!top)
922
+ {
923
+ for (j = (left ? 16 : -16); j < (right ? 16 : 48); j += 32)
924
+ {
925
+ strIDCT4x4Stage1(p0 + j);
926
+ }
927
+ }
928
+
929
+ if (!bottom)
930
+ {
931
+ for (j = (left ? 0 : -32); j < (right ? 0 : 32); j += 32)
932
+ {
933
+ strIDCT4x4Stage1(p1 + j);
934
+ }
935
+ }
936
+
937
+ //========================================
938
+ // first level inverse overlap (420_UV)
939
+ if (OL_NONE != olOverlap)
940
+ {
941
+ if(!left && !top)
942
+ {
943
+ if (bottom)
944
+ {
945
+ for (j = -48; j < (right ? -16 : 16); j += 32)
946
+ {
947
+ p = p0 + j;
948
+ strPost4(p + 15, p + 14, p + 42, p + 43);
949
+ strPost4(p + 13, p + 12, p + 40, p + 41);
950
+ p = NULL;
951
+ }
952
+ }
953
+ else
954
+ {
955
+ for (j = -48; j < (right ? -16 : 16); j += 32)
956
+ {
957
+ strPost4x4Stage1Split(p0 + j, p1 - 16 + j, 32, iHPQP, bHPAbsent);
958
+ }
959
+ }
960
+
961
+ if (right)
962
+ {
963
+ if (!bottom)
964
+ {
965
+ strPost4(p0 - 2 , p0 - 4 , p1 - 28, p1 - 26);
966
+ strPost4(p0 - 1 , p0 - 3 , p1 - 27, p1 - 25);
967
+ }
968
+
969
+ strPost4(p0 - 18, p0 - 20, p0 - 12, p0 - 10);
970
+ strPost4(p0 - 17, p0 - 19, p0 - 11, p0 - 9);
971
+ }
972
+ else
973
+ {
974
+ strPost4x4Stage1(p0 - 32, 32, iHPQP, bHPAbsent);
975
+ }
976
+
977
+ strPost4x4Stage1(p0 - 64, 32, iHPQP, bHPAbsent);
978
+ }
979
+ else if (top)
980
+ {
981
+ for (j = (left ? 0: -64); j < (right ? -32: 0); j += 32)
982
+ {
983
+ p = p1 + j + 4;
984
+ strPost4(p + 1, p + 0, p + 28, p + 29);
985
+ strPost4(p + 3, p + 2, p + 30, p + 31);
986
+ p = NULL;
987
+ }
988
+ }
989
+ else if (left)
990
+ {
991
+ if (!bottom)
992
+ {
993
+ strPost4(p0 + 26, p0 + 24, p1 + 0, p1 + 2);
994
+ strPost4(p0 + 27, p0 + 25, p1 + 1, p1 + 3);
995
+ }
996
+
997
+ strPost4(p0 + 10, p0 + 8, p0 + 16, p0 + 18);
998
+ strPost4(p0 + 11, p0 + 9, p0 + 17, p0 + 19);
999
+ }
1000
+ }
1001
+ }
1002
+
1003
+ //================================================================
1004
+ // 422_UV
1005
+ for (i = 0; i < (YUV_422 == cfColorFormat? 2U : 0U) && tScale < 16; ++i)
1006
+ {
1007
+ PixelI* const p0 = pSC->p0MBbuffer[1 + i];//(0 == i ? pSC->pU0 : pSC->pV0);
1008
+ PixelI* const p1 = pSC->p1MBbuffer[1 + i];//(0 == i ? pSC->pU1 : pSC->pV1);
1009
+
1010
+ Int iHPQP = 255;
1011
+ if (!bHPAbsent)
1012
+ iHPQP = pSC->pTile[pSC->cTileColumn].pQuantizerHP[i][pSC->MBInfo.iQIndexHP].iQP;
1013
+
1014
+ //========================================
1015
+ // second level inverse transform (422_UV)
1016
+ if ((!bottomORright) && pSC->m_Dparam->cThumbnailScale < 16)
1017
+ {
1018
+ // 1D lossless HT
1019
+ p1[0] -= ((p1[32] + 1) >> 1);
1020
+ p1[32] += p1[0];
1021
+
1022
+ if (!pSC->m_param.bScaledArith) {
1023
+ strDCT2x2dn(p1 + 0, p1 + 64, p1 + 16, p1 + 80);
1024
+ strDCT2x2dn(p1 + 32, p1 + 96, p1 + 48, p1 + 112);
1025
+ }
1026
+ else {
1027
+ strDCT2x2dnDec(p1 + 0, p1 + 64, p1 + 16, p1 + 80);
1028
+ strDCT2x2dnDec(p1 + 32, p1 + 96, p1 + 48, p1 + 112);
1029
+ }
1030
+ }
1031
+
1032
+ //========================================
1033
+ // second level inverse overlap (422_UV)
1034
+ if (OL_TWO == olOverlap)
1035
+ {
1036
+ if (!bottom)
1037
+ {
1038
+ if (leftORright)
1039
+ {
1040
+ if (!top)
1041
+ {
1042
+ j = (left ? 0 : -64);
1043
+ strPost2(p0 + 48 + j, p1 + j);
1044
+ }
1045
+
1046
+ j = (left ? 16 : -48);
1047
+ strPost2(p1 + j, p1 + j + 16);
1048
+ }
1049
+ else
1050
+ {
1051
+ if (top)
1052
+ {
1053
+ strPost2(p1 - 64, p1);
1054
+ }
1055
+ else
1056
+ {
1057
+ strPost2x2(p0 - 16, p0 + 48, p1 - 64, p1);
1058
+ }
1059
+
1060
+ strPost2x2(p1 - 48, p1 + 16, p1 - 32, p1 + 32);
1061
+ }
1062
+ }
1063
+ else if (!leftORright)
1064
+ {
1065
+ strPost2(p0 - 16, p0 + 48);
1066
+ }
1067
+ }
1068
+
1069
+ //========================================
1070
+ // first level inverse transform (422_UV)
1071
+ if(tScale >= 4) // bypass first level transform for 4:1 and smaller thumbnail
1072
+ continue;
1073
+
1074
+ if (!top)
1075
+ {
1076
+ for (j = (left ? 48 : -16); j < (right ? 48 : 112); j += 64)
1077
+ {
1078
+ strIDCT4x4Stage1(p0 + j);
1079
+ }
1080
+ }
1081
+
1082
+ if (!bottom)
1083
+ {
1084
+ for (j = (left ? 0 : -64); j < (right ? 0 : 64); j += 64)
1085
+ {
1086
+ strIDCT4x4Stage1(p1 + j + 0);
1087
+ strIDCT4x4Stage1(p1 + j + 16);
1088
+ strIDCT4x4Stage1(p1 + j + 32);
1089
+ }
1090
+ }
1091
+
1092
+ //========================================
1093
+ // first level inverse overlap (422_UV)
1094
+ if (OL_NONE != olOverlap)
1095
+ {
1096
+ if (!top)
1097
+ {
1098
+ if (leftORright)
1099
+ {
1100
+ j = (left ? 32 + 10 : -32 + 14);
1101
+
1102
+ p = p0 + j;
1103
+ strPost4(p + 0, p - 2, p + 6, p + 8);
1104
+ strPost4(p + 1, p - 1, p + 7, p + 9);
1105
+
1106
+ p = NULL;
1107
+ }
1108
+
1109
+ for (j = (left ? 0 : -128); j < (right ? -64 : 0); j += 64)
1110
+ {
1111
+ strPost4x4Stage1(p0 + j + 32, 0, iHPQP, bHPAbsent);
1112
+ }
1113
+ }
1114
+
1115
+ if (!bottom)
1116
+ {
1117
+ if (leftORright)
1118
+ {
1119
+ j = (left ? 0 + 10 : -64 + 14);
1120
+
1121
+ p = p1 + j;
1122
+ strPost4(p + 0, p - 2, p + 6, p + 8);
1123
+ strPost4(p + 1, p - 1, p + 7, p + 9);
1124
+
1125
+ p += 16;
1126
+ strPost4(p + 0, p - 2, p + 6, p + 8);
1127
+ strPost4(p + 1, p - 1, p + 7, p + 9);
1128
+
1129
+ p = NULL;
1130
+ }
1131
+
1132
+ for (j = (left ? 0 : -128); j < (right ? -64 : 0); j += 64)
1133
+ {
1134
+ strPost4x4Stage1(p1 + j + 0, 0, iHPQP, bHPAbsent);
1135
+ strPost4x4Stage1(p1 + j + 16, 0, iHPQP, bHPAbsent);
1136
+ }
1137
+ }
1138
+
1139
+ if (topORbottom)
1140
+ {
1141
+ p = (top ? p1 + 5 : p0 + 48 + 13);
1142
+ for (j = (left ? 0 : -128); j < (right ? -64 : 0); j += 64)
1143
+ {
1144
+ strPost4(p + j + 0, p + j - 1, p + j + 59, p + j + 60);
1145
+ strPost4(p + j + 2, p + j + 1, p + j + 61, p + j + 62);
1146
+ }
1147
+ p = NULL;
1148
+ }
1149
+ else
1150
+ {
1151
+ if (leftORright)
1152
+ {
1153
+ j = (left ? 0 + 0 : -64 + 4);
1154
+ strPost4(p0 + j + 48 + 10 + 0, p0 + j + 48 + 10 - 2, p1 + j + 0, p1 + j + 2);
1155
+ strPost4(p0 + j + 48 + 10 + 1, p0 + j + 48 + 10 - 1, p1 + j + 1, p1 + j + 3);
1156
+ }
1157
+
1158
+ for (j = (left ? 0 : -128); j < (right ? -64 : 0); j += 64)
1159
+ {
1160
+ strPost4x4Stage1Split(p0 + j + 48, p1 + j + 0, 0, iHPQP, bHPAbsent);
1161
+ }
1162
+ }
1163
+ }
1164
+ }
1165
+
1166
+ return ICERR_OK;
1167
+ }
1168
+
1169
+ Int invTransformMacroblock_alteredOperators_hard(CWMImageStrCodec * pSC)
1170
+ {
1171
+ const OVERLAP olOverlap = pSC->WMISCP.olOverlap;
1172
+ const COLORFORMAT cfColorFormat = pSC->m_param.cfColorFormat;
1173
+ // const BITDEPTH_BITS bdBitDepth = pSC->WMII.bdBitDepth;
1174
+ const Bool left = (pSC->cColumn == 0), right = (pSC->cColumn == pSC->cmbWidth);
1175
+ const Bool top = (pSC->cRow == 0), bottom = (pSC->cRow == pSC->cmbHeight);
1176
+ const Bool topORbottom = (top || bottom), leftORright = (left || right);
1177
+ const Bool topORleft = (top || left), bottomORright = (bottom || right);
1178
+ Bool leftAdjacentColumn = (pSC->cColumn == 1), rightAdjacentColumn = (pSC->cColumn == pSC->cmbWidth - 1);
1179
+ // Bool topAdjacentRow = (pSC->cRow == 1), bottomAdjacentRow = (pSC->cRow == pSC->cmbHeight - 1);
1180
+ const size_t mbWidth = pSC->cmbWidth;
1181
+ PixelI * p = NULL;// * pt = NULL;
1182
+ size_t i;
1183
+ const size_t iChannels = (cfColorFormat == YUV_420 || cfColorFormat == YUV_422) ? 1 : pSC->m_param.cNumChannels;
1184
+ const size_t tScale = pSC->m_Dparam->cThumbnailScale;
1185
+ Int j = 0;
1186
+
1187
+ Int qp[MAX_CHANNELS], dcqp[MAX_CHANNELS], iStrength = (1 << pSC->WMII.cPostProcStrength);
1188
+ // ERR_CODE result = ICERR_OK;
1189
+
1190
+ #define mbX pSC->mbX
1191
+ #define mbY pSC->mbY
1192
+ #define tileX pSC->tileX
1193
+ #define tileY pSC->tileY
1194
+ #define bVertTileBoundary pSC->bVertTileBoundary
1195
+ #define bHoriTileBoundary pSC->bHoriTileBoundary
1196
+ #define bOneMBLeftVertTB pSC->bOneMBLeftVertTB
1197
+ #define bOneMBRightVertTB pSC->bOneMBRightVertTB
1198
+ #define iPredBefore pSC->iPredBefore
1199
+ #define iPredAfter pSC->iPredAfter
1200
+
1201
+ if (pSC->WMISCP.bUseHardTileBoundaries) {
1202
+ //Add tile location information
1203
+ if (pSC->cColumn == 0) {
1204
+ bVertTileBoundary = FALSE;
1205
+ tileY = 0;
1206
+ }
1207
+ bOneMBLeftVertTB = bOneMBRightVertTB = FALSE;
1208
+ if(tileY > 0 && tileY <= pSC->WMISCP.cNumOfSliceMinus1H && (pSC->cColumn - 1) == pSC->WMISCP.uiTileY[tileY])
1209
+ bOneMBRightVertTB = TRUE;
1210
+ if(tileY < pSC->WMISCP.cNumOfSliceMinus1H && pSC->cColumn == pSC->WMISCP.uiTileY[tileY + 1]) {
1211
+ bVertTileBoundary = TRUE;
1212
+ tileY++;
1213
+ }
1214
+ else
1215
+ bVertTileBoundary = FALSE;
1216
+ if(tileY < pSC->WMISCP.cNumOfSliceMinus1H && (pSC->cColumn + 1) == pSC->WMISCP.uiTileY[tileY + 1])
1217
+ bOneMBLeftVertTB = TRUE;
1218
+
1219
+ if (pSC->cRow == 0) {
1220
+ bHoriTileBoundary = FALSE;
1221
+ tileX = 0;
1222
+ }
1223
+ else if(mbY != pSC->cRow && tileX < pSC->WMISCP.cNumOfSliceMinus1V && pSC->cRow == pSC->WMISCP.uiTileX[tileX + 1]) {
1224
+ bHoriTileBoundary = TRUE;
1225
+ tileX++;
1226
+ }
1227
+ else if(mbY != pSC->cRow)
1228
+ bHoriTileBoundary = FALSE;
1229
+ }
1230
+ else {
1231
+ bVertTileBoundary = FALSE;
1232
+ bHoriTileBoundary = FALSE;
1233
+ bOneMBLeftVertTB = FALSE;
1234
+ bOneMBRightVertTB = FALSE;
1235
+ }
1236
+ mbX = pSC->cColumn, mbY = pSC->cRow;
1237
+
1238
+ if(pSC->WMII.cPostProcStrength > 0){
1239
+ // threshold for post processing
1240
+ for(i = 0; i < iChannels; i ++){
1241
+ qp[i] = pSC->pTile[pSC->cTileColumn].pQuantizerLP[i][pSC->MBInfo.iQIndexLP].iQP * iStrength * (olOverlap == OL_NONE ? 2 : 1);
1242
+ dcqp[i] = pSC->pTile[pSC->cTileColumn].pQuantizerDC[i][0].iQP * iStrength;
1243
+ }
1244
+
1245
+ if(left) // a new MB row
1246
+ slideOneMBRow(pSC->pPostProcInfo, pSC->m_param.cNumChannels, mbWidth, top, bottom); // previous current row becomes previous row
1247
+ }
1248
+
1249
+ //================================================================
1250
+ // 400_Y, 444_YUV
1251
+ for (i = 0; i < iChannels && tScale < 16; ++i)
1252
+ {
1253
+ PixelI* const p0 = pSC->p0MBbuffer[i];
1254
+ PixelI* const p1 = pSC->p1MBbuffer[i];
1255
+
1256
+ //================================
1257
+ // second level inverse transform
1258
+ if (!bottomORright)
1259
+ {
1260
+ if(pSC->WMII.cPostProcStrength > 0)
1261
+ updatePostProcInfo(pSC->pPostProcInfo, p1, mbX, i); // update postproc info before IDCT
1262
+
1263
+ strIDCT4x4Stage2(p1);
1264
+ if (pSC->m_param.bScaledArith) {
1265
+ strNormalizeDec(p1, (i != 0));
1266
+ }
1267
+ }
1268
+
1269
+ //================================
1270
+ // second level inverse overlap
1271
+ if (OL_TWO == olOverlap)
1272
+ {
1273
+ /* Corner operations */
1274
+ if ((top || bHoriTileBoundary) && (left || bVertTileBoundary))
1275
+ strPost4_alternate(p1 + 0, p1 + 64, p1 + 0 + 16, p1 + 64 + 16);
1276
+ if ((top || bHoriTileBoundary) && (right || bVertTileBoundary))
1277
+ strPost4_alternate(p1 - 128, p1 - 64, p1 - 128 + 16, p1 - 64 + 16);
1278
+ if ((bottom || bHoriTileBoundary) && (left || bVertTileBoundary))
1279
+ strPost4_alternate(p0 + 32, p0 + 96, p0 + 32 + 16, p0 + 96 + 16);
1280
+ if ((bottom || bHoriTileBoundary) && (right || bVertTileBoundary))
1281
+ strPost4_alternate(p0 - 96, p0 - 32, p0 - 96 + 16, p0 - 32 + 16);
1282
+ if ((leftORright || bVertTileBoundary) && (!topORbottom && !bHoriTileBoundary))
1283
+ {
1284
+ if (left || bVertTileBoundary) {
1285
+ j = 0;
1286
+ strPost4_alternate(p0 + j + 32, p0 + j + 48, p1 + j + 0, p1 + j + 16);
1287
+ strPost4_alternate(p0 + j + 96, p0 + j + 112, p1 + j + 64, p1 + j + 80);
1288
+ }
1289
+ if (right || bVertTileBoundary) {
1290
+ j = -128;
1291
+ strPost4_alternate(p0 + j + 32, p0 + j + 48, p1 + j + 0, p1 + j + 16);
1292
+ strPost4_alternate(p0 + j + 96, p0 + j + 112, p1 + j + 64, p1 + j + 80);
1293
+ }
1294
+ }
1295
+
1296
+ if (!leftORright)
1297
+ {
1298
+ if ((topORbottom || bHoriTileBoundary) && !bVertTileBoundary)
1299
+ {
1300
+ if (top || bHoriTileBoundary) {
1301
+ p = p1;
1302
+ strPost4_alternate(p - 128, p - 64, p + 0, p + 64);
1303
+ strPost4_alternate(p - 112, p - 48, p + 16, p + 80);
1304
+ p = NULL;
1305
+ }
1306
+ if (bottom || bHoriTileBoundary) {
1307
+ p = p0 + 32;
1308
+ strPost4_alternate(p - 128, p - 64, p + 0, p + 64);
1309
+ strPost4_alternate(p - 112, p - 48, p + 16, p + 80);
1310
+ p = NULL;
1311
+ }
1312
+ }
1313
+
1314
+ if (!topORbottom && !bHoriTileBoundary && !bVertTileBoundary)
1315
+ strPost4x4Stage2Split_alternate(p0, p1);
1316
+ }
1317
+ }
1318
+
1319
+ if(pSC->WMII.cPostProcStrength > 0)
1320
+ postProcMB(pSC->pPostProcInfo, p0, p1, mbX, i, dcqp[i]); // second stage deblocking
1321
+
1322
+ //================================
1323
+ // first level inverse transform
1324
+ if(tScale >= 4) // bypass first level transform for 4:1 and smaller thumbnail
1325
+ continue;
1326
+
1327
+ if (!top)
1328
+ {
1329
+ for (j = (left ? 32 : -96); j < (right ? 32 : 160); j += 64)
1330
+ {
1331
+ strIDCT4x4Stage1(p0 + j + 0);
1332
+ strIDCT4x4Stage1(p0 + j + 16);
1333
+ }
1334
+ }
1335
+
1336
+ if (!bottom)
1337
+ {
1338
+ for (j = (left ? 0 : -128); j < (right ? 0 : 128); j += 64)
1339
+ {
1340
+ // if(tScale == 2 && bdBitDepth != BD_1){
1341
+ // MIPgen(p1 + j + 0);
1342
+ // MIPgen(p1 + j + 16);
1343
+ // }
1344
+ strIDCT4x4Stage1(p1 + j + 0);
1345
+ strIDCT4x4Stage1(p1 + j + 16);
1346
+ }
1347
+ }
1348
+
1349
+ //================================
1350
+ // first level inverse overlap
1351
+ if (OL_NONE != olOverlap)
1352
+ {
1353
+ if (leftORright || bVertTileBoundary)
1354
+ {
1355
+ /* Corner operations */
1356
+ if ((top || bHoriTileBoundary) && (left || bVertTileBoundary))
1357
+ strPost4_alternate(p1 + 0, p1 + 1, p1 + 2, p1 + 3);
1358
+ if ((top || bHoriTileBoundary) && (right || bVertTileBoundary))
1359
+ strPost4_alternate(p1 - 59, p1 - 60, p1 - 57, p1 - 58);
1360
+ if ((bottom || bHoriTileBoundary) && (left || bVertTileBoundary))
1361
+ strPost4_alternate(p0 + 48 + 10, p0 + 48 + 11, p0 + 48 + 8, p0 + 48 + 9);
1362
+ if ((bottom || bHoriTileBoundary) && (right || bVertTileBoundary))
1363
+ strPost4_alternate(p0 - 1, p0 - 2, p0 - 3, p0 - 4);
1364
+ if (left || bVertTileBoundary) {
1365
+ j = 0 + 10;
1366
+ if (!top)
1367
+ {
1368
+ p = p0 + 16 + j;
1369
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1370
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1371
+ strPost4_alternate(p + 16, p + 14, p + 22, p + 24);
1372
+ strPost4_alternate(p + 17, p + 15, p + 23, p + 25);
1373
+ p = NULL;
1374
+ }
1375
+ if (!bottom)
1376
+ {
1377
+ p = p1 + j;
1378
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1379
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1380
+ p = NULL;
1381
+ }
1382
+ if (!topORbottom && !bHoriTileBoundary)
1383
+ {
1384
+ strPost4_alternate(p0 + 48 + j + 0, p0 + 48 + j - 2, p1 - 10 + j, p1 - 8 + j);
1385
+ strPost4_alternate(p0 + 48 + j + 1, p0 + 48 + j - 1, p1 - 9 + j, p1 - 7 + j);
1386
+ }
1387
+ }
1388
+ if (right || bVertTileBoundary) {
1389
+ j = -64 + 14;
1390
+ if (!top)
1391
+ {
1392
+ p = p0 + 16 + j;
1393
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1394
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1395
+ strPost4_alternate(p + 16, p + 14, p + 22, p + 24);
1396
+ strPost4_alternate(p + 17, p + 15, p + 23, p + 25);
1397
+ p = NULL;
1398
+ }
1399
+ if (!bottom)
1400
+ {
1401
+ p = p1 + j;
1402
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1403
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1404
+ p = NULL;
1405
+ }
1406
+ if (!topORbottom && !bHoriTileBoundary)
1407
+ {
1408
+ strPost4_alternate(p0 + 48 + j + 0, p0 + 48 + j - 2, p1 - 10 + j, p1 - 8 + j);
1409
+ strPost4_alternate(p0 + 48 + j + 1, p0 + 48 + j - 1, p1 - 9 + j, p1 - 7 + j);
1410
+ }
1411
+ }
1412
+ }
1413
+
1414
+ if (top || bHoriTileBoundary)
1415
+ {
1416
+ for (j = (left ? 0 : -192); j < (right ? -64 : 64); j += 64)
1417
+ {
1418
+ if (!bVertTileBoundary || j != -64) {
1419
+ p = p1 + j;
1420
+ strPost4_alternate(p + 5, p + 4, p + 64, p + 65);
1421
+ strPost4_alternate(p + 7, p + 6, p + 66, p + 67);
1422
+ p = NULL;
1423
+
1424
+ strPost4x4Stage1_alternate(p1 + j, 0);
1425
+ }
1426
+ }
1427
+ }
1428
+
1429
+ if (bottom || bHoriTileBoundary)
1430
+ {
1431
+ for (j = (left ? 0 : -192); j < (right ? -64 : 64); j += 64)
1432
+ {
1433
+ if (!bVertTileBoundary || j != -64) {
1434
+ strPost4x4Stage1_alternate(p0 + 16 + j, 0);
1435
+ strPost4x4Stage1_alternate(p0 + 32 + j, 0);
1436
+
1437
+ p = p0 + 48 + j;
1438
+ strPost4_alternate(p + 15, p + 14, p + 74, p + 75);
1439
+ strPost4_alternate(p + 13, p + 12, p + 72, p + 73);
1440
+ p = NULL;
1441
+ }
1442
+ }
1443
+ }
1444
+
1445
+ if (!top && !bottom && !bHoriTileBoundary)
1446
+ {
1447
+ for (j = (left ? 0 : -192); j < (right ? -64 : 64); j += 64)
1448
+ {
1449
+ if (!bVertTileBoundary || j != -64) {
1450
+ strPost4x4Stage1_alternate(p0 + 16 + j, 0);
1451
+ strPost4x4Stage1_alternate(p0 + 32 + j, 0);
1452
+ strPost4x4Stage1Split_alternate(p0 + 48 + j, p1 + j, 0);
1453
+ strPost4x4Stage1_alternate(p1 + j, 0);
1454
+ }
1455
+ }
1456
+ }
1457
+ }
1458
+
1459
+ if(pSC->WMII.cPostProcStrength > 0 && (!topORleft))
1460
+ postProcBlock(pSC->pPostProcInfo, p0, p1, mbX, i, qp[i]); // destairing and first stage deblocking
1461
+ }
1462
+
1463
+ //================================================================
1464
+ // 420_UV
1465
+ for (i = 0; i < (YUV_420 == cfColorFormat? 2U : 0U) && tScale < 16; ++i)
1466
+ {
1467
+ PixelI* const p0 = pSC->p0MBbuffer[1 + i];//(0 == i ? pSC->pU0 : pSC->pV0);
1468
+ PixelI* const p1 = pSC->p1MBbuffer[1 + i];//(0 == i ? pSC->pU1 : pSC->pV1);
1469
+
1470
+ //========================================
1471
+ // second level inverse transform (420_UV)
1472
+ if (!bottomORright)
1473
+ {
1474
+ if (!pSC->m_param.bScaledArith) {
1475
+ strDCT2x2dn(p1, p1 + 32, p1 + 16, p1 + 48);
1476
+ }
1477
+ else {
1478
+ strDCT2x2dnDec(p1, p1 + 32, p1 + 16, p1 + 48);
1479
+ }
1480
+ }
1481
+
1482
+ //========================================
1483
+ // second level inverse overlap (420_UV)
1484
+ if (OL_TWO == olOverlap)
1485
+ {
1486
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (top || bHoriTileBoundary))
1487
+ COMPUTE_CORNER_PRED_DIFF(p1 - 64 + 0, *(p1 - 64 + 32));
1488
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (top || bHoriTileBoundary))
1489
+ iPredBefore[i][0] = *(p1 + 0);
1490
+ if ((right || bVertTileBoundary) && (top || bHoriTileBoundary))
1491
+ COMPUTE_CORNER_PRED_DIFF(p1 - 64 + 32, iPredBefore[i][0]);
1492
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (bottom || bHoriTileBoundary))
1493
+ COMPUTE_CORNER_PRED_DIFF(p0 - 64 + 16, *(p0 - 64 + 48));
1494
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (bottom || bHoriTileBoundary))
1495
+ iPredBefore[i][1] = *(p0 + 16);
1496
+ if ((right || bVertTileBoundary) && (bottom || bHoriTileBoundary))
1497
+ COMPUTE_CORNER_PRED_DIFF(p0 - 64 + 48, iPredBefore[i][1]);
1498
+
1499
+ if ((leftORright || bVertTileBoundary) && !topORbottom && !bHoriTileBoundary)
1500
+ {
1501
+ if (left || bVertTileBoundary)
1502
+ strPost2_alternate(p0 + 0 + 16, p1 + 0);
1503
+ if (right || bVertTileBoundary)
1504
+ strPost2_alternate(p0 + -32 + 16, p1 + -32);
1505
+ }
1506
+
1507
+ if (!leftORright)
1508
+ {
1509
+ if ((topORbottom || bHoriTileBoundary) && !bVertTileBoundary)
1510
+ {
1511
+ if (top || bHoriTileBoundary)
1512
+ strPost2_alternate(p1 - 32, p1);
1513
+ if (bottom || bHoriTileBoundary)
1514
+ strPost2_alternate(p0 + 16 - 32, p0 + 16);
1515
+ }
1516
+ else if (!topORbottom && !bHoriTileBoundary && !bVertTileBoundary) {
1517
+ strPost2x2_alternate(p0 - 16, p0 + 16, p1 - 32, p1);
1518
+ }
1519
+ }
1520
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (top || bHoriTileBoundary))
1521
+ COMPUTE_CORNER_PRED_ADD(p1 - 64 + 0, *(p1 - 64 + 32));
1522
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (top || bHoriTileBoundary))
1523
+ iPredAfter[i][0] = *(p1 + 0);
1524
+ if ((right || bVertTileBoundary) && (top || bHoriTileBoundary))
1525
+ COMPUTE_CORNER_PRED_ADD(p1 - 64 + 32, iPredAfter[i][0]);
1526
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (bottom || bHoriTileBoundary))
1527
+ COMPUTE_CORNER_PRED_ADD(p0 - 64 + 16, *(p0 - 64 + 48));
1528
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (bottom || bHoriTileBoundary))
1529
+ iPredAfter[i][1] = *(p0 + 16);
1530
+ if ((right || bVertTileBoundary) && (bottom || bHoriTileBoundary))
1531
+ COMPUTE_CORNER_PRED_ADD(p0 - 64 + 48, iPredAfter[i][1]);
1532
+ }
1533
+
1534
+ //========================================
1535
+ // first level inverse transform (420_UV)
1536
+ if(tScale >= 4) // bypass first level transform for 4:1 and smaller thumbnail
1537
+ continue;
1538
+
1539
+ if (!top)
1540
+ {
1541
+ // In order to allow correction operation of corner chroma overlap operators (fixed)
1542
+ // processing of left most MB column must be delayed by one MB
1543
+ // Thus left MB not processed until leftAdjacentColumn = 1
1544
+ for (j = ((left) ? 48 : ((leftAdjacentColumn || bOneMBRightVertTB) ? -48 : -16)); j < ((right || bVertTileBoundary) ? 16 : 48); j += 32)
1545
+ {
1546
+ strIDCT4x4Stage1(p0 + j);
1547
+ }
1548
+ }
1549
+
1550
+ if (!bottom)
1551
+ {
1552
+ // In order to allow correction operation of corner chroma overlap operators (fixed)
1553
+ // processing of left most MB column must be delayed by one MB
1554
+ // Thus left MB not processed until leftAdjacentColumn = 1
1555
+ for (j = ((left) ? 32 : ((leftAdjacentColumn || bOneMBRightVertTB) ? -64 : -32)); j < ((right || bVertTileBoundary) ? 0 : 32); j += 32)
1556
+ {
1557
+ strIDCT4x4Stage1(p1 + j);
1558
+ }
1559
+ }
1560
+
1561
+ //========================================
1562
+ // first level inverse overlap (420_UV)
1563
+ if (OL_NONE != olOverlap)
1564
+ {
1565
+ /* Corner operations */
1566
+ /* Change because the top-left corner ICT will not have happened until leftAdjacentColumn ==1 */
1567
+ if ((top || bHoriTileBoundary) && (leftAdjacentColumn || bOneMBRightVertTB))
1568
+ strPost4_alternate(p1 - 64 + 0, p1 - 64 + 1, p1 - 64 + 2, p1 - 64 + 3);
1569
+ if ((top || bHoriTileBoundary) && (right || bVertTileBoundary))
1570
+ strPost4_alternate(p1 - 27, p1 - 28, p1 - 25, p1 - 26);
1571
+ /* Change because the bottom-left corner ICT will not have happened until leftAdjacentColumn ==1 */
1572
+ if ((bottom || bHoriTileBoundary) && (leftAdjacentColumn || bOneMBRightVertTB))
1573
+ strPost4_alternate(p0 - 64 + 16 + 10, p0 - 64 + 16 + 11, p0 - 64 + 16 + 8, p0 - 64 + 16 + 9);
1574
+ if ((bottom || bHoriTileBoundary) && (right || bVertTileBoundary))
1575
+ strPost4_alternate(p0 - 1, p0 - 2, p0 - 3, p0 - 4);
1576
+ if(!left && !top)
1577
+ {
1578
+ /* Change because the vertical 1-D overlap operations of the left edge pixels cannot be performed until leftAdjacentColumn ==1 */
1579
+ if (leftAdjacentColumn || bOneMBRightVertTB)
1580
+ {
1581
+ if (!bottom && !bHoriTileBoundary)
1582
+ {
1583
+ strPost4_alternate(p0 - 64 + 26, p0 - 64 + 24, p1 - 64 + 0, p1 - 64 + 2);
1584
+ strPost4_alternate(p0 - 64 + 27, p0 - 64 + 25, p1 - 64 + 1, p1 - 64 + 3);
1585
+ }
1586
+
1587
+ strPost4_alternate(p0 - 64 + 10, p0 - 64 + 8, p0 - 64 + 16, p0 - 64 + 18);
1588
+ strPost4_alternate(p0 - 64 + 11, p0 - 64 + 9, p0 - 64 + 17, p0 - 64 + 19);
1589
+ }
1590
+ if (bottom || bHoriTileBoundary)
1591
+ {
1592
+ p = p0 + -48;
1593
+ strPost4_alternate(p + 15, p + 14, p + 42, p + 43);
1594
+ strPost4_alternate(p + 13, p + 12, p + 40, p + 41);
1595
+ p = NULL;
1596
+
1597
+ if (!right && !bVertTileBoundary)
1598
+ {
1599
+ p = p0 + -16;
1600
+ strPost4_alternate(p + 15, p + 14, p + 42, p + 43);
1601
+ strPost4_alternate(p + 13, p + 12, p + 40, p + 41);
1602
+ p = NULL;
1603
+ }
1604
+ }
1605
+ else
1606
+ {
1607
+ strPost4x4Stage1Split_alternate(p0 + -48, p1 - 16 + -48, 32);
1608
+
1609
+ if (!right && !bVertTileBoundary)
1610
+ strPost4x4Stage1Split_alternate(p0 + -16, p1 - 16 + -16, 32);
1611
+ }
1612
+
1613
+ if (right || bVertTileBoundary)
1614
+ {
1615
+ if (!bottom && !bHoriTileBoundary)
1616
+ {
1617
+ strPost4_alternate(p0 - 2 , p0 - 4 , p1 - 28, p1 - 26);
1618
+ strPost4_alternate(p0 - 1 , p0 - 3 , p1 - 27, p1 - 25);
1619
+ }
1620
+
1621
+ strPost4_alternate(p0 - 18, p0 - 20, p0 - 12, p0 - 10);
1622
+ strPost4_alternate(p0 - 17, p0 - 19, p0 - 11, p0 - 9);
1623
+ }
1624
+ else
1625
+ {
1626
+ strPost4x4Stage1_alternate(p0 - 32, 32);
1627
+ }
1628
+
1629
+ strPost4x4Stage1_alternate(p0 - 64, 32);
1630
+ }
1631
+
1632
+ if (top || bHoriTileBoundary)
1633
+ {
1634
+ if (!left)
1635
+ {
1636
+ p = p1 + -64 + 4;
1637
+ strPost4_alternate(p + 1, p + 0, p + 28, p + 29);
1638
+ strPost4_alternate(p + 3, p + 2, p + 30, p + 31);
1639
+ p = NULL;
1640
+ }
1641
+
1642
+ if (!left && !right && !bVertTileBoundary)
1643
+ {
1644
+ p = p1 + -32 + 4;
1645
+ strPost4_alternate(p + 1, p + 0, p + 28, p + 29);
1646
+ strPost4_alternate(p + 3, p + 2, p + 30, p + 31);
1647
+ p = NULL;
1648
+ }
1649
+ }
1650
+ }
1651
+ }
1652
+
1653
+ //================================================================
1654
+ // 422_UV
1655
+ for (i = 0; i < (YUV_422 == cfColorFormat? 2U : 0U) && tScale < 16; ++i)
1656
+ {
1657
+ PixelI* const p0 = pSC->p0MBbuffer[1 + i];//(0 == i ? pSC->pU0 : pSC->pV0);
1658
+ PixelI* const p1 = pSC->p1MBbuffer[1 + i];//(0 == i ? pSC->pU1 : pSC->pV1);
1659
+
1660
+ //========================================
1661
+ // second level inverse transform (422_UV)
1662
+ if ((!bottomORright) && pSC->m_Dparam->cThumbnailScale < 16)
1663
+ {
1664
+ // 1D lossless HT
1665
+ p1[0] -= ((p1[32] + 1) >> 1);
1666
+ p1[32] += p1[0];
1667
+
1668
+ if (!pSC->m_param.bScaledArith) {
1669
+ strDCT2x2dn(p1 + 0, p1 + 64, p1 + 16, p1 + 80);
1670
+ strDCT2x2dn(p1 + 32, p1 + 96, p1 + 48, p1 + 112);
1671
+ }
1672
+ else {
1673
+ strDCT2x2dnDec(p1 + 0, p1 + 64, p1 + 16, p1 + 80);
1674
+ strDCT2x2dnDec(p1 + 32, p1 + 96, p1 + 48, p1 + 112);
1675
+ }
1676
+ }
1677
+
1678
+ //========================================
1679
+ // second level inverse overlap (422_UV)
1680
+ if (OL_TWO == olOverlap)
1681
+ {
1682
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (top || bHoriTileBoundary))
1683
+ COMPUTE_CORNER_PRED_DIFF(p1 - 128 + 0, *(p1 - 128 + 64));
1684
+
1685
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (top || bHoriTileBoundary))
1686
+ iPredBefore[i][0] = *(p1 + 0);
1687
+ if ((right || bVertTileBoundary) && (top || bHoriTileBoundary))
1688
+ COMPUTE_CORNER_PRED_DIFF(p1 - 128 + 64, iPredBefore[i][0]);
1689
+
1690
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (bottom || bHoriTileBoundary))
1691
+ COMPUTE_CORNER_PRED_DIFF(p0 - 128 + 48, *(p0 - 128 + 112));
1692
+
1693
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (bottom || bHoriTileBoundary))
1694
+ iPredBefore[i][1] = *(p0 + 48);
1695
+ if ((right || bVertTileBoundary) && (bottom || bHoriTileBoundary))
1696
+ COMPUTE_CORNER_PRED_DIFF(p0 - 128 + 112, iPredBefore[i][1]);
1697
+
1698
+ if (!bottom)
1699
+ {
1700
+ if (leftORright || bVertTileBoundary)
1701
+ {
1702
+ if (!top && !bHoriTileBoundary)
1703
+ {
1704
+ if (left || bVertTileBoundary)
1705
+ strPost2_alternate(p0 + 48 + 0, p1 + 0);
1706
+
1707
+ if (right || bVertTileBoundary)
1708
+ strPost2_alternate(p0 + 48 + -64, p1 + -64);
1709
+ }
1710
+
1711
+ if (left || bVertTileBoundary)
1712
+ strPost2_alternate(p1 + 16, p1 + 16 + 16);
1713
+
1714
+ if (right || bVertTileBoundary)
1715
+ strPost2_alternate(p1 + -48, p1 + -48 + 16);
1716
+ }
1717
+
1718
+ if (!leftORright && !bVertTileBoundary)
1719
+ {
1720
+ if (top || bHoriTileBoundary)
1721
+ strPost2_alternate(p1 - 64, p1);
1722
+ else
1723
+ strPost2x2_alternate(p0 - 16, p0 + 48, p1 - 64, p1);
1724
+
1725
+ strPost2x2_alternate(p1 - 48, p1 + 16, p1 - 32, p1 + 32);
1726
+ }
1727
+ }
1728
+
1729
+ if ((bottom || bHoriTileBoundary) && (!leftORright && !bVertTileBoundary))
1730
+ strPost2_alternate(p0 - 16, p0 + 48);
1731
+
1732
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (top || bHoriTileBoundary))
1733
+ COMPUTE_CORNER_PRED_ADD(p1 - 128 + 0, *(p1 - 128 + 64));
1734
+
1735
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (top || bHoriTileBoundary))
1736
+ iPredAfter[i][0] = *(p1 + 0);
1737
+ if ((right || bVertTileBoundary) && (top || bHoriTileBoundary))
1738
+ COMPUTE_CORNER_PRED_ADD(p1 - 128 + 64, iPredAfter[i][0]);
1739
+
1740
+ if ((leftAdjacentColumn || bOneMBRightVertTB) && (bottom || bHoriTileBoundary))
1741
+ COMPUTE_CORNER_PRED_ADD(p0 - 128 + 48, *(p0 - 128 + 112));
1742
+
1743
+ if ((rightAdjacentColumn || bOneMBLeftVertTB) && (bottom || bHoriTileBoundary))
1744
+ iPredAfter[i][1] = *(p0 + 48);
1745
+ if ((right || bVertTileBoundary) && (bottom || bHoriTileBoundary))
1746
+ COMPUTE_CORNER_PRED_ADD(p0 - 128 + 112, iPredAfter[i][1]);
1747
+ }
1748
+
1749
+ //========================================
1750
+ // first level inverse transform (422_UV)
1751
+ if(tScale >= 4) // bypass first level transform for 4:1 and smaller thumbnail
1752
+ continue;
1753
+
1754
+ if (!top)
1755
+ {
1756
+ // Need to delay processing of left column until leftAdjacentColumn = 1 for corner overlap operators
1757
+ // Since 422 has no vertical downsampling, no top MB delay of processing is necessary
1758
+ for (j = (left ? 112 : ((leftAdjacentColumn || bOneMBRightVertTB) ? -80 : -16)); j < ((right || bVertTileBoundary) ? 48 : 112); j += 64)
1759
+ {
1760
+ strIDCT4x4Stage1(p0 + j);
1761
+ }
1762
+ }
1763
+
1764
+ if (!bottom)
1765
+ {
1766
+ // Need to delay processing of left column until leftAdjacentColumn = 1 for corner overlap operators
1767
+ // Since 422 has no vertical downsampling, no top MB delay of processing is necessary
1768
+ for (j = (left ? 64 : ((leftAdjacentColumn || bOneMBRightVertTB) ? -128 : -64)); j < ((right || bVertTileBoundary) ? 0 : 64); j += 64)
1769
+ {
1770
+ strIDCT4x4Stage1(p1 + j + 0);
1771
+ strIDCT4x4Stage1(p1 + j + 16);
1772
+ strIDCT4x4Stage1(p1 + j + 32);
1773
+ }
1774
+ }
1775
+
1776
+ //========================================
1777
+ // first level inverse overlap (422_UV)
1778
+ if (OL_NONE != olOverlap)
1779
+ {
1780
+ /* Corner operations */
1781
+ if ((top || bHoriTileBoundary) && (leftAdjacentColumn || bOneMBRightVertTB))
1782
+ strPost4_alternate(p1 - 128 + 0, p1 - 128 + 1, p1 - 128 + 2, p1 - 128 + 3);
1783
+ if ((top || bHoriTileBoundary) && (right || bVertTileBoundary))
1784
+ strPost4_alternate(p1 - 59, p1 - 60, p1 - 57, p1 - 58);
1785
+ if ((bottom || bHoriTileBoundary) && (leftAdjacentColumn || bOneMBRightVertTB))
1786
+ strPost4_alternate(p0 - 128 + 48 + 10, p0 - 128 + 48 + 11, p0 - 128 + 48 + 8, p0 - 128 + 48 + 9);
1787
+ if ((bottom || bHoriTileBoundary) && (right || bVertTileBoundary))
1788
+ strPost4_alternate(p0 - 1, p0 - 2, p0 - 3, p0 - 4);
1789
+ if (!top)
1790
+ {
1791
+ // Need to delay processing of left column until leftAdjacentColumn = 1 for corner overlap operators
1792
+ if (leftAdjacentColumn || bOneMBRightVertTB) {
1793
+ p = p0 + 32 + 10 - 128;
1794
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1795
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1796
+ p = NULL;
1797
+ }
1798
+
1799
+ if (right || bVertTileBoundary) {
1800
+ p = p0 + -32 + 14;
1801
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1802
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1803
+ p = NULL;
1804
+ }
1805
+
1806
+ for (j = (left ? 0 : -128); j < ((right || bVertTileBoundary) ? -64 : 0); j += 64)
1807
+ strPost4x4Stage1_alternate(p0 + j + 32, 0);
1808
+ }
1809
+
1810
+ if (!bottom)
1811
+ {
1812
+ // Need to delay processing of left column until leftAdjacentColumn = 1 for corner overlap operators
1813
+ if (leftAdjacentColumn || bOneMBRightVertTB)
1814
+ {
1815
+ p = p1 + 0 + 10 - 128;
1816
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1817
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1818
+ p += 16;
1819
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1820
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1821
+ p = NULL;
1822
+ }
1823
+
1824
+ if (right || bVertTileBoundary)
1825
+ {
1826
+ p = p1 + -64 + 14;
1827
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1828
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1829
+ p += 16;
1830
+ strPost4_alternate(p + 0, p - 2, p + 6, p + 8);
1831
+ strPost4_alternate(p + 1, p - 1, p + 7, p + 9);
1832
+ p = NULL;
1833
+ }
1834
+
1835
+ for (j = (left ? 0 : -128); j < ((right || bVertTileBoundary) ? -64 : 0); j += 64)
1836
+ {
1837
+ strPost4x4Stage1_alternate(p1 + j + 0, 0);
1838
+ strPost4x4Stage1_alternate(p1 + j + 16, 0);
1839
+ }
1840
+ }
1841
+
1842
+ if (topORbottom || bHoriTileBoundary)
1843
+ {
1844
+ if (top || bHoriTileBoundary) {
1845
+ p = p1 + 5;
1846
+ for (j = (left ? 0 : -128); j < ((right || bVertTileBoundary) ? -64 : 0); j += 64)
1847
+ {
1848
+ strPost4_alternate(p + j + 0, p + j - 1, p + j + 59, p + j + 60);
1849
+ strPost4_alternate(p + j + 2, p + j + 1, p + j + 61, p + j + 62);
1850
+ }
1851
+ p = NULL;
1852
+ }
1853
+
1854
+ if (bottom || bHoriTileBoundary) {
1855
+ p = p0 + 48 + 13;
1856
+ for (j = (left ? 0 : -128); j < ((right || bVertTileBoundary) ? -64 : 0); j += 64)
1857
+ {
1858
+ strPost4_alternate(p + j + 0, p + j - 1, p + j + 59, p + j + 60);
1859
+ strPost4_alternate(p + j + 2, p + j + 1, p + j + 61, p + j + 62);
1860
+ }
1861
+ p = NULL;
1862
+ }
1863
+ }
1864
+ else
1865
+ {
1866
+ // Need to delay processing of left column until leftAdjacentColumn = 1 for corner overlap operators
1867
+ if (leftAdjacentColumn || bOneMBRightVertTB)
1868
+ {
1869
+ j = 0 + 0 - 128;
1870
+ strPost4_alternate(p0 + j + 48 + 10 + 0, p0 + j + 48 + 10 - 2, p1 + j + 0, p1 + j + 2);
1871
+ strPost4_alternate(p0 + j + 48 + 10 + 1, p0 + j + 48 + 10 - 1, p1 + j + 1, p1 + j + 3);
1872
+ }
1873
+
1874
+ if (right || bVertTileBoundary)
1875
+ {
1876
+ j = -64 + 4;
1877
+ strPost4_alternate(p0 + j + 48 + 10 + 0, p0 + j + 48 + 10 - 2, p1 + j + 0, p1 + j + 2);
1878
+ strPost4_alternate(p0 + j + 48 + 10 + 1, p0 + j + 48 + 10 - 1, p1 + j + 1, p1 + j + 3);
1879
+ }
1880
+
1881
+ for (j = (left ? 0 : -128); j < ((right || bVertTileBoundary) ? -64 : 0); j += 64)
1882
+ strPost4x4Stage1Split_alternate(p0 + j + 48, p1 + j + 0, 0);
1883
+ }
1884
+ }
1885
+ }
1886
+
1887
+ return ICERR_OK;
1888
+ }