rfreeimage 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +1 -0
- data/Rakefile +34 -0
- data/ext/rfreeimage/extconf.rb +35 -0
- data/ext/rfreeimage/rfi_main.c +389 -0
- data/lib/rfreeimage/image.rb +26 -0
- data/lib/rfreeimage/version.rb +3 -0
- data/lib/rfreeimage.rb +3 -0
- data/rfreeimage.gemspec +32 -0
- data/vendor/FreeImage/Makefile +34 -0
- data/vendor/FreeImage/Makefile.cygwin +74 -0
- data/vendor/FreeImage/Makefile.fip +84 -0
- data/vendor/FreeImage/Makefile.gnu +83 -0
- data/vendor/FreeImage/Makefile.iphone +96 -0
- data/vendor/FreeImage/Makefile.mingw +136 -0
- data/vendor/FreeImage/Makefile.osx +115 -0
- data/vendor/FreeImage/Makefile.solaris +66 -0
- data/vendor/FreeImage/Makefile.srcs +6 -0
- data/vendor/FreeImage/README.iphone +19 -0
- data/vendor/FreeImage/README.linux +50 -0
- data/vendor/FreeImage/README.minGW +236 -0
- data/vendor/FreeImage/README.osx +44 -0
- data/vendor/FreeImage/README.solaris +67 -0
- data/vendor/FreeImage/Source/CacheFile.h +92 -0
- data/vendor/FreeImage/Source/DeprecationManager/Deprecated.cpp +36 -0
- data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.cpp +103 -0
- data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.h +83 -0
- data/vendor/FreeImage/Source/FreeImage/BitmapAccess.cpp +1573 -0
- data/vendor/FreeImage/Source/FreeImage/CacheFile.cpp +271 -0
- data/vendor/FreeImage/Source/FreeImage/ColorLookup.cpp +785 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion.cpp +551 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion16_555.cpp +209 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion16_565.cpp +204 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion24.cpp +252 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion32.cpp +345 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion4.cpp +246 -0
- data/vendor/FreeImage/Source/FreeImage/Conversion8.cpp +305 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionFloat.cpp +194 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionRGB16.cpp +144 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionRGBA16.cpp +147 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionRGBAF.cpp +250 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionRGBF.cpp +243 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionType.cpp +699 -0
- data/vendor/FreeImage/Source/FreeImage/ConversionUINT16.cpp +134 -0
- data/vendor/FreeImage/Source/FreeImage/FreeImage.cpp +226 -0
- data/vendor/FreeImage/Source/FreeImage/FreeImageC.c +22 -0
- data/vendor/FreeImage/Source/FreeImage/FreeImageIO.cpp +175 -0
- data/vendor/FreeImage/Source/FreeImage/GetType.cpp +92 -0
- data/vendor/FreeImage/Source/FreeImage/Halftoning.cpp +474 -0
- data/vendor/FreeImage/Source/FreeImage/J2KHelper.cpp +591 -0
- data/vendor/FreeImage/Source/FreeImage/J2KHelper.h +36 -0
- data/vendor/FreeImage/Source/FreeImage/LFPQuantizer.cpp +208 -0
- data/vendor/FreeImage/Source/FreeImage/MNGHelper.cpp +1320 -0
- data/vendor/FreeImage/Source/FreeImage/MemoryIO.cpp +237 -0
- data/vendor/FreeImage/Source/FreeImage/MultiPage.cpp +974 -0
- data/vendor/FreeImage/Source/FreeImage/NNQuantizer.cpp +507 -0
- data/vendor/FreeImage/Source/FreeImage/PSDParser.cpp +1057 -0
- data/vendor/FreeImage/Source/FreeImage/PSDParser.h +271 -0
- data/vendor/FreeImage/Source/FreeImage/PixelAccess.cpp +197 -0
- data/vendor/FreeImage/Source/FreeImage/Plugin.cpp +822 -0
- data/vendor/FreeImage/Source/FreeImage/PluginBMP.cpp +1494 -0
- data/vendor/FreeImage/Source/FreeImage/PluginCUT.cpp +240 -0
- data/vendor/FreeImage/Source/FreeImage/PluginDDS.cpp +655 -0
- data/vendor/FreeImage/Source/FreeImage/PluginEXR.cpp +773 -0
- data/vendor/FreeImage/Source/FreeImage/PluginG3.cpp +433 -0
- data/vendor/FreeImage/Source/FreeImage/PluginGIF.cpp +1407 -0
- data/vendor/FreeImage/Source/FreeImage/PluginHDR.cpp +722 -0
- data/vendor/FreeImage/Source/FreeImage/PluginICO.cpp +824 -0
- data/vendor/FreeImage/Source/FreeImage/PluginIFF.cpp +459 -0
- data/vendor/FreeImage/Source/FreeImage/PluginJ2K.cpp +328 -0
- data/vendor/FreeImage/Source/FreeImage/PluginJNG.cpp +162 -0
- data/vendor/FreeImage/Source/FreeImage/PluginJP2.cpp +328 -0
- data/vendor/FreeImage/Source/FreeImage/PluginJPEG.cpp +1706 -0
- data/vendor/FreeImage/Source/FreeImage/PluginJXR.cpp +1475 -0
- data/vendor/FreeImage/Source/FreeImage/PluginKOALA.cpp +243 -0
- data/vendor/FreeImage/Source/FreeImage/PluginMNG.cpp +153 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPCD.cpp +251 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPCX.cpp +659 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPFM.cpp +409 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPICT.cpp +1343 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPNG.cpp +1115 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPNM.cpp +838 -0
- data/vendor/FreeImage/Source/FreeImage/PluginPSD.cpp +131 -0
- data/vendor/FreeImage/Source/FreeImage/PluginRAS.cpp +512 -0
- data/vendor/FreeImage/Source/FreeImage/PluginRAW.cpp +793 -0
- data/vendor/FreeImage/Source/FreeImage/PluginSGI.cpp +425 -0
- data/vendor/FreeImage/Source/FreeImage/PluginTARGA.cpp +1591 -0
- data/vendor/FreeImage/Source/FreeImage/PluginTIFF.cpp +2631 -0
- data/vendor/FreeImage/Source/FreeImage/PluginWBMP.cpp +372 -0
- data/vendor/FreeImage/Source/FreeImage/PluginWebP.cpp +698 -0
- data/vendor/FreeImage/Source/FreeImage/PluginXBM.cpp +399 -0
- data/vendor/FreeImage/Source/FreeImage/PluginXPM.cpp +487 -0
- data/vendor/FreeImage/Source/FreeImage/TIFFLogLuv.cpp +65 -0
- data/vendor/FreeImage/Source/FreeImage/ToneMapping.cpp +75 -0
- data/vendor/FreeImage/Source/FreeImage/WuQuantizer.cpp +559 -0
- data/vendor/FreeImage/Source/FreeImage/ZLibInterface.cpp +223 -0
- data/vendor/FreeImage/Source/FreeImage/tmoColorConvert.cpp +479 -0
- data/vendor/FreeImage/Source/FreeImage/tmoDrago03.cpp +295 -0
- data/vendor/FreeImage/Source/FreeImage/tmoFattal02.cpp +689 -0
- data/vendor/FreeImage/Source/FreeImage/tmoReinhard05.cpp +260 -0
- data/vendor/FreeImage/Source/FreeImage.h +1153 -0
- data/vendor/FreeImage/Source/FreeImageIO.h +63 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp +730 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Background.cpp +895 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Channels.cpp +488 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp +917 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Colors.cpp +967 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp +861 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Display.cpp +230 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Filters.h +287 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Flip.cpp +166 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp +623 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp +505 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Rescale.cpp +192 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Resize.cpp +2116 -0
- data/vendor/FreeImage/Source/FreeImageToolkit/Resize.h +196 -0
- data/vendor/FreeImage/Source/LibJPEG/ansi2knr.c +739 -0
- data/vendor/FreeImage/Source/LibJPEG/cderror.h +134 -0
- data/vendor/FreeImage/Source/LibJPEG/cdjpeg.c +181 -0
- data/vendor/FreeImage/Source/LibJPEG/cdjpeg.h +187 -0
- data/vendor/FreeImage/Source/LibJPEG/cjpeg.c +664 -0
- data/vendor/FreeImage/Source/LibJPEG/ckconfig.c +402 -0
- data/vendor/FreeImage/Source/LibJPEG/djpeg.c +617 -0
- data/vendor/FreeImage/Source/LibJPEG/example.c +433 -0
- data/vendor/FreeImage/Source/LibJPEG/jaricom.c +153 -0
- data/vendor/FreeImage/Source/LibJPEG/jcapimin.c +288 -0
- data/vendor/FreeImage/Source/LibJPEG/jcapistd.c +162 -0
- data/vendor/FreeImage/Source/LibJPEG/jcarith.c +944 -0
- data/vendor/FreeImage/Source/LibJPEG/jccoefct.c +454 -0
- data/vendor/FreeImage/Source/LibJPEG/jccolor.c +604 -0
- data/vendor/FreeImage/Source/LibJPEG/jcdctmgr.c +477 -0
- data/vendor/FreeImage/Source/LibJPEG/jchuff.c +1573 -0
- data/vendor/FreeImage/Source/LibJPEG/jcinit.c +84 -0
- data/vendor/FreeImage/Source/LibJPEG/jcmainct.c +297 -0
- data/vendor/FreeImage/Source/LibJPEG/jcmarker.c +719 -0
- data/vendor/FreeImage/Source/LibJPEG/jcmaster.c +856 -0
- data/vendor/FreeImage/Source/LibJPEG/jcomapi.c +106 -0
- data/vendor/FreeImage/Source/LibJPEG/jconfig.h +161 -0
- data/vendor/FreeImage/Source/LibJPEG/jcparam.c +675 -0
- data/vendor/FreeImage/Source/LibJPEG/jcprepct.c +358 -0
- data/vendor/FreeImage/Source/LibJPEG/jcsample.c +545 -0
- data/vendor/FreeImage/Source/LibJPEG/jctrans.c +385 -0
- data/vendor/FreeImage/Source/LibJPEG/jdapimin.c +399 -0
- data/vendor/FreeImage/Source/LibJPEG/jdapistd.c +276 -0
- data/vendor/FreeImage/Source/LibJPEG/jdarith.c +796 -0
- data/vendor/FreeImage/Source/LibJPEG/jdatadst.c +270 -0
- data/vendor/FreeImage/Source/LibJPEG/jdatasrc.c +275 -0
- data/vendor/FreeImage/Source/LibJPEG/jdcoefct.c +741 -0
- data/vendor/FreeImage/Source/LibJPEG/jdcolor.c +748 -0
- data/vendor/FreeImage/Source/LibJPEG/jdct.h +393 -0
- data/vendor/FreeImage/Source/LibJPEG/jddctmgr.c +384 -0
- data/vendor/FreeImage/Source/LibJPEG/jdhuff.c +1554 -0
- data/vendor/FreeImage/Source/LibJPEG/jdinput.c +662 -0
- data/vendor/FreeImage/Source/LibJPEG/jdmainct.c +513 -0
- data/vendor/FreeImage/Source/LibJPEG/jdmarker.c +1511 -0
- data/vendor/FreeImage/Source/LibJPEG/jdmaster.c +543 -0
- data/vendor/FreeImage/Source/LibJPEG/jdmerge.c +401 -0
- data/vendor/FreeImage/Source/LibJPEG/jdpostct.c +290 -0
- data/vendor/FreeImage/Source/LibJPEG/jdsample.c +361 -0
- data/vendor/FreeImage/Source/LibJPEG/jdtrans.c +140 -0
- data/vendor/FreeImage/Source/LibJPEG/jerror.c +253 -0
- data/vendor/FreeImage/Source/LibJPEG/jerror.h +304 -0
- data/vendor/FreeImage/Source/LibJPEG/jfdctflt.c +174 -0
- data/vendor/FreeImage/Source/LibJPEG/jfdctfst.c +230 -0
- data/vendor/FreeImage/Source/LibJPEG/jfdctint.c +4406 -0
- data/vendor/FreeImage/Source/LibJPEG/jidctflt.c +235 -0
- data/vendor/FreeImage/Source/LibJPEG/jidctfst.c +368 -0
- data/vendor/FreeImage/Source/LibJPEG/jidctint.c +5179 -0
- data/vendor/FreeImage/Source/LibJPEG/jinclude.h +91 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemansi.c +167 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemdos.c +638 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemmac.c +289 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemmgr.c +1119 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemname.c +276 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemnobs.c +109 -0
- data/vendor/FreeImage/Source/LibJPEG/jmemsys.h +198 -0
- data/vendor/FreeImage/Source/LibJPEG/jmorecfg.h +442 -0
- data/vendor/FreeImage/Source/LibJPEG/jpegint.h +426 -0
- data/vendor/FreeImage/Source/LibJPEG/jpeglib.h +1180 -0
- data/vendor/FreeImage/Source/LibJPEG/jpegtran.c +577 -0
- data/vendor/FreeImage/Source/LibJPEG/jquant1.c +857 -0
- data/vendor/FreeImage/Source/LibJPEG/jquant2.c +1311 -0
- data/vendor/FreeImage/Source/LibJPEG/jutils.c +227 -0
- data/vendor/FreeImage/Source/LibJPEG/jversion.h +14 -0
- data/vendor/FreeImage/Source/LibJPEG/rdbmp.c +480 -0
- data/vendor/FreeImage/Source/LibJPEG/rdcolmap.c +253 -0
- data/vendor/FreeImage/Source/LibJPEG/rdgif.c +38 -0
- data/vendor/FreeImage/Source/LibJPEG/rdjpgcom.c +515 -0
- data/vendor/FreeImage/Source/LibJPEG/rdppm.c +459 -0
- data/vendor/FreeImage/Source/LibJPEG/rdrle.c +387 -0
- data/vendor/FreeImage/Source/LibJPEG/rdswitch.c +365 -0
- data/vendor/FreeImage/Source/LibJPEG/rdtarga.c +500 -0
- data/vendor/FreeImage/Source/LibJPEG/transupp.c +1763 -0
- data/vendor/FreeImage/Source/LibJPEG/transupp.h +219 -0
- data/vendor/FreeImage/Source/LibJPEG/wrbmp.c +442 -0
- data/vendor/FreeImage/Source/LibJPEG/wrgif.c +399 -0
- data/vendor/FreeImage/Source/LibJPEG/wrjpgcom.c +583 -0
- data/vendor/FreeImage/Source/LibJPEG/wrppm.c +269 -0
- data/vendor/FreeImage/Source/LibJPEG/wrrle.c +305 -0
- data/vendor/FreeImage/Source/LibJPEG/wrtarga.c +253 -0
- data/vendor/FreeImage/Source/LibJXR/common/include/guiddef.h +230 -0
- data/vendor/FreeImage/Source/LibJXR/common/include/wmsal.h +757 -0
- data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstring.h +342 -0
- data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_adt.h +71 -0
- data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_strict.h +1096 -0
- data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_undef.h +406 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/JXRTranscode.c +987 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/decode.c +200 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/decode.h +143 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/postprocess.c +288 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/segdec.c +1205 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/strInvTransform.c +1888 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/strPredQuantDec.c +539 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/strdec.c +3628 -0
- data/vendor/FreeImage/Source/LibJXR/image/decode/strdec_x86.c +1640 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/encode.c +144 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/encode.h +113 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/segenc.c +1186 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/strFwdTransform.c +1111 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/strPredQuantEnc.c +511 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/strenc.c +2370 -0
- data/vendor/FreeImage/Source/LibJXR/image/encode/strenc_x86.c +409 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/adapthuff.c +511 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/ansi.h +61 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/common.h +131 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/image.c +183 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimer.h +115 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimerANSI.c +274 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/strPredQuant.c +306 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.c +85 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.h +50 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.c +1251 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.h +681 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/windowsmediaphoto.h +515 -0
- data/vendor/FreeImage/Source/LibJXR/image/sys/xplatform_image.h +84 -0
- data/vendor/FreeImage/Source/LibJXR/image/x86/x86.h +58 -0
- data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.c +930 -0
- data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.h +636 -0
- data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlueJxr.c +2246 -0
- data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGluePFC.c +2338 -0
- data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.c +905 -0
- data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.h +258 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/bio.c +188 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/bio.h +128 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.c +239 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.h +68 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/cio.c +644 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/cio.h +393 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/dwt.c +919 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/dwt.h +116 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/event.c +141 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/event.h +97 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/function_list.c +114 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/function_list.h +126 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/image.c +235 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/image.h +63 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/indexbox_manager.h +148 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/invert.c +289 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/invert.h +59 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/j2k.c +10238 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/j2k.h +838 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/jp2.c +2776 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/jp2.h +490 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/mct.c +319 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/mct.h +149 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/mqc.c +604 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/mqc.h +201 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.c +955 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.h +1475 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.c +59 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.h +54 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_codec.h +160 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_config.h +9 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_config_private.h +16 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_includes.h +175 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_intmath.h +172 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_inttypes.h +43 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_malloc.h +180 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/opj_stdint.h +47 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/phix_manager.c +191 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/pi.c +1870 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/pi.h +182 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/ppix_manager.c +194 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/raw.c +89 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/raw.h +100 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/t1.c +1751 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/t1.h +157 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/t1_generate_luts.c +276 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/t1_luts.h +143 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/t2.c +1334 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/t2.h +127 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/tcd.c +2123 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/tcd.h +348 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/tgt.c +331 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/tgt.h +140 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/thix_manager.c +134 -0
- data/vendor/FreeImage/Source/LibOpenJPEG/tpix_manager.c +185 -0
- data/vendor/FreeImage/Source/LibPNG/example.c +1061 -0
- data/vendor/FreeImage/Source/LibPNG/png.c +4493 -0
- data/vendor/FreeImage/Source/LibPNG/png.h +3282 -0
- data/vendor/FreeImage/Source/LibPNG/pngconf.h +644 -0
- data/vendor/FreeImage/Source/LibPNG/pngdebug.h +154 -0
- data/vendor/FreeImage/Source/LibPNG/pngerror.c +963 -0
- data/vendor/FreeImage/Source/LibPNG/pngget.c +1213 -0
- data/vendor/FreeImage/Source/LibPNG/pnginfo.h +260 -0
- data/vendor/FreeImage/Source/LibPNG/pnglibconf.h +218 -0
- data/vendor/FreeImage/Source/LibPNG/pngmem.c +281 -0
- data/vendor/FreeImage/Source/LibPNG/pngpread.c +1168 -0
- data/vendor/FreeImage/Source/LibPNG/pngpriv.h +1944 -0
- data/vendor/FreeImage/Source/LibPNG/pngread.c +4121 -0
- data/vendor/FreeImage/Source/LibPNG/pngrio.c +120 -0
- data/vendor/FreeImage/Source/LibPNG/pngrtran.c +4994 -0
- data/vendor/FreeImage/Source/LibPNG/pngrutil.c +4474 -0
- data/vendor/FreeImage/Source/LibPNG/pngset.c +1611 -0
- data/vendor/FreeImage/Source/LibPNG/pngstruct.h +489 -0
- data/vendor/FreeImage/Source/LibPNG/pngtest.c +2011 -0
- data/vendor/FreeImage/Source/LibPNG/pngtrans.c +849 -0
- data/vendor/FreeImage/Source/LibPNG/pngwio.c +168 -0
- data/vendor/FreeImage/Source/LibPNG/pngwrite.c +2455 -0
- data/vendor/FreeImage/Source/LibPNG/pngwtran.c +574 -0
- data/vendor/FreeImage/Source/LibPNG/pngwutil.c +3029 -0
- data/vendor/FreeImage/Source/LibRawLite/dcraw/dcraw.c +15462 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/aahd_demosaic.cpp +706 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/dcb_demosaicing.c +710 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_common.cpp +13593 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_fileio.cpp +240 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/defines.h +167 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/demosaic_packs.cpp +99 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/dht_demosaic.cpp +873 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/libraw_internal_funcs.h +282 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/libraw_x3f.cpp +1919 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/var_defines.h +216 -0
- data/vendor/FreeImage/Source/LibRawLite/internal/wf_filtering.cpp +1950 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw.h +338 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_alloc.h +99 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_const.h +233 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_datastream.h +238 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_internal.h +225 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_types.h +442 -0
- data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_version.h +62 -0
- data/vendor/FreeImage/Source/LibRawLite/src/libraw_c_api.cpp +230 -0
- data/vendor/FreeImage/Source/LibRawLite/src/libraw_cxx.cpp +4533 -0
- data/vendor/FreeImage/Source/LibRawLite/src/libraw_datastream.cpp +703 -0
- data/vendor/FreeImage/Source/LibTIFF4/mkg3states.c +451 -0
- data/vendor/FreeImage/Source/LibTIFF4/mkspans.c +82 -0
- data/vendor/FreeImage/Source/LibTIFF4/t4.h +292 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_aux.c +358 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_close.c +140 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_codec.c +166 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_color.c +287 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_compress.c +304 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_config.h +97 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_config.vc.h +74 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_config.wince.h +71 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_dir.c +1700 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_dir.h +308 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_dirinfo.c +959 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_dirread.c +5640 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_dirwrite.c +2910 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_dumpmode.c +143 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_error.c +80 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_extension.c +118 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.c +1595 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.h +538 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_fax3sm.c +1260 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_flush.c +118 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_getimage.c +2890 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_jbig.c +213 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg.c +2354 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg_12.c +65 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_luv.c +1683 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_lzma.c +495 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_lzw.c +1169 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_next.c +181 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_ojpeg.c +2501 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_open.c +725 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_packbits.c +300 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_pixarlog.c +1442 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_predict.c +764 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_predict.h +77 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_print.c +716 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_read.c +1086 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_strip.c +383 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_swab.c +310 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_thunder.c +207 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_tile.c +299 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_unix.c +325 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_version.c +40 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_vms.c +603 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_warning.c +81 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_win32.c +443 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_wince.c +293 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_write.c +771 -0
- data/vendor/FreeImage/Source/LibTIFF4/tif_zip.c +472 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiff.h +681 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiffconf.h +170 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiffconf.vc.h +160 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiffconf.wince.h +121 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiffio.h +557 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiffiop.h +367 -0
- data/vendor/FreeImage/Source/LibTIFF4/tiffvers.h +9 -0
- data/vendor/FreeImage/Source/LibTIFF4/uvcode.h +180 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/alphai.h +55 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.alpha.c +167 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.buffer.c +249 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.frame.c +827 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.idec.c +857 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.io.c +640 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.quant.c +110 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.tree.c +525 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8.c +663 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8l.c +1584 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/dec.webp.c +834 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/decode_vp8.h +185 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/vp8i.h +353 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/vp8li.h +136 -0
- data/vendor/FreeImage/Source/LibWebP/src/dec/webpi.h +120 -0
- data/vendor/FreeImage/Source/LibWebP/src/demux/demux.demux.c +957 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing.c +377 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_mips_dsp_r2.c +139 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_sse2.c +296 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb.c +68 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_mips_dsp_r2.c +108 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_sse2.c +62 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost.c +412 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips32.c +154 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips_dsp_r2.c +107 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_sse2.c +121 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cpu.c +138 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec.c +760 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_clip_tables.c +366 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips32.c +585 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +992 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_neon.c +1489 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_sse2.c +1284 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc.c +788 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_avx2.c +24 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips32.c +670 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +1510 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_neon.c +932 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_sse2.c +940 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters.c +240 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +404 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_sse2.c +349 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.h +434 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless.c +1838 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips32.c +416 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +921 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_neon.c +357 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_sse2.c +535 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler.c +115 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips32.c +192 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips_dsp_r2.c +210 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling.c +252 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +280 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_neon.c +267 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_sse2.c +214 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv.c +166 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips32.c +100 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +131 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_sse2.c +322 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/lossless.h +313 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/mips_macro.h +200 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/neon.h +82 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv.h +321 -0
- data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv_tables_sse2.h +536 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/backward_references.h +202 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/cost.h +69 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.alpha.c +440 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.analysis.c +501 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.backward_references.c +1076 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.config.c +163 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.cost.c +355 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.filter.c +296 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.frame.c +850 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.histogram.c +897 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.iterator.c +456 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.near_lossless.c +160 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture.c +290 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_csp.c +1100 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_psnr.c +150 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_rescale.c +285 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_tools.c +206 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.quant.c +1191 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.syntax.c +383 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.token.c +285 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.tree.c +504 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.vp8l.c +1437 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/enc.webpenc.c +379 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/histogram.h +114 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/vp8enci.h +551 -0
- data/vendor/FreeImage/Source/LibWebP/src/enc/vp8li.h +78 -0
- data/vendor/FreeImage/Source/LibWebP/src/mux/mux.anim_encode.c +1241 -0
- data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxedit.c +696 -0
- data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxinternal.c +551 -0
- data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxread.c +544 -0
- data/vendor/FreeImage/Source/LibWebP/src/mux/muxi.h +232 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader.h +168 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader_inl.h +172 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/bit_writer.h +120 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/color_cache.h +74 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/endian_inl.h +100 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/filters.h +32 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/huffman.h +67 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/huffman_encode.h +60 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels.h +36 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels_dec.h +35 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/random.h +63 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/rescaler.h +78 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/thread.h +93 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_reader.c +208 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_writer.c +308 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.color_cache.c +49 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.filters.c +76 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.h +121 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman.c +205 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman_encode.c +417 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels.c +140 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels_dec.c +279 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.random.c +43 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.rescaler.c +82 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.thread.c +309 -0
- data/vendor/FreeImage/Source/LibWebP/src/utils/utils.utils.c +211 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/decode.h +493 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/demux.h +224 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/encode.h +515 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/format_constants.h +88 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/mux.h +507 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/mux_types.h +97 -0
- data/vendor/FreeImage/Source/LibWebP/src/webp/types.h +52 -0
- data/vendor/FreeImage/Source/MapIntrospector.h +212 -0
- data/vendor/FreeImage/Source/Metadata/Exif.cpp +1253 -0
- data/vendor/FreeImage/Source/Metadata/FIRational.cpp +176 -0
- data/vendor/FreeImage/Source/Metadata/FIRational.h +108 -0
- data/vendor/FreeImage/Source/Metadata/FreeImageTag.cpp +353 -0
- data/vendor/FreeImage/Source/Metadata/FreeImageTag.h +500 -0
- data/vendor/FreeImage/Source/Metadata/IPTC.cpp +342 -0
- data/vendor/FreeImage/Source/Metadata/TagConversion.cpp +1094 -0
- data/vendor/FreeImage/Source/Metadata/TagLib.cpp +1618 -0
- data/vendor/FreeImage/Source/Metadata/XTIFF.cpp +766 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/eLut.cpp +114 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/eLut.h +71 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/half.cpp +310 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/half.h +757 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/halfExport.h +27 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/halfFunction.h +179 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/halfLimits.h +102 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.cpp +164 -0
- data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.h +16391 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/Iex.h +60 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.cpp +156 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.h +264 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexErrnoExc.h +208 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexExport.h +51 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexForward.h +229 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexMacros.h +170 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexMathExc.h +57 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexNamespace.h +112 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.cpp +873 -0
- data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.h +97 -0
- data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.cpp +113 -0
- data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.h +146 -0
- data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.cpp +530 -0
- data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.h +91 -0
- data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathIeeeExc.h +62 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmBaseConfig.h +61 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.cpp +633 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.h +324 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfArray.h +285 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.cpp +158 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.h +407 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAutoArray.h +95 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.cpp +1072 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.h +118 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp +111 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.h +87 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp +1438 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.h +555 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.cpp +322 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.h +436 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp +150 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.h +74 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h +163 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.cpp +151 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.h +131 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp +87 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.h +73 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp +591 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.h +142 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompression.h +84 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp +78 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.h +64 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.cpp +226 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.h +265 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.cpp +143 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.h +107 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.cpp +110 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.h +132 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.cpp +230 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.h +339 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageState.h +96 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp +78 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h +68 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp +2025 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.h +276 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.cpp +149 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.h +181 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp +1552 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.h +244 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.cpp +107 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.h +168 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp +1979 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.h +437 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.cpp +273 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.h +362 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp +2055 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.h +475 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.cpp +250 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.h +394 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp +57 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.h +59 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp +3424 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.h +210 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressorSimd.h +2145 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.cpp +335 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.h +336 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp +76 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.h +68 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfExport.h +46 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.cpp +768 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.h +148 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp +57 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.h +58 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.cpp +84 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.h +76 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfForward.h +127 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp +228 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.h +386 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp +76 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h +94 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.cpp +76 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.h +58 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.cpp +112 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.h +62 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.cpp +1283 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.h +699 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.cpp +1114 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.h +82 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.cpp +110 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.h +255 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.cpp +895 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.h +240 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.cpp +114 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.h +84 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.cpp +51 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.h +69 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputStreamMutex.h +68 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInt64.h +56 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.cpp +57 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.h +58 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.cpp +217 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.h +167 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp +99 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.h +73 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrder.h +69 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp +78 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.h +72 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.cpp +178 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.h +188 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp +263 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.h +83 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.cpp +1872 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.h +466 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +783 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.h +128 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp +519 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.h +118 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.cpp +435 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.h +187 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfName.h +150 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfNamespace.h +115 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp +126 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.h +110 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOptimizedPixelReading.h +646 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.cpp +1378 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.h +263 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.cpp +105 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.h +77 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.cpp +52 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.h +62 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputStreamMutex.h +70 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartHelper.h +262 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.cpp +63 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.h +62 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPixelType.h +67 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.cpp +667 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.h +117 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.cpp +104 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.h +135 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp +103 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.h +70 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp +553 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.h +109 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.cpp +127 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.h +98 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp +74 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.h +69 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgba.h +109 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.cpp +1405 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.h +346 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.cpp +497 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.h +259 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.cpp +157 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.h +63 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.cpp +220 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.h +80 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp +1702 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.h +210 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSimd.h +59 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp +125 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.h +382 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.cpp +242 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.h +160 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.cpp +80 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.h +71 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp +100 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.h +74 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp +129 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.h +172 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.cpp +216 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.h +97 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.cpp +62 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.h +95 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescription.h +107 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp +86 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.h +72 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.cpp +552 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.h +125 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp +1533 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.h +401 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.cpp +208 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.h +100 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.cpp +389 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.h +106 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp +1841 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.h +495 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.cpp +228 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.h +105 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp +1163 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.h +482 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.cpp +431 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.h +242 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp +79 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.h +74 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.cpp +217 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.h +100 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.cpp +60 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.h +136 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.cpp +391 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.h +78 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfXdr.h +927 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.cpp +196 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.h +78 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.cpp +127 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.h +89 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.cpp +136 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.h +16396 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.cpp +573 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.h +98334 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.cpp +80 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.h +143 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadExport.h +46 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadForward.h +52 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.cpp +59 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.h +160 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexPosix.cpp +85 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexWin32.cpp +79 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadNamespace.h +114 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.cpp +483 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.h +160 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPosix.cpp +98 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp +60 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.h +112 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosix.cpp +106 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosixCompat.cpp +155 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphoreWin32.cpp +153 -0
- data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadWin32.cpp +100 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.cpp +37 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.h +849 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBoxAlgo.h +1016 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColor.h +736 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.cpp +178 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.h +257 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathEuler.h +926 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExc.h +73 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExport.h +46 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathForward.h +72 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrame.h +192 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustum.h +741 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustumTest.h +417 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.cpp +181 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.h +269 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGL.h +166 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGLU.h +54 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathHalfLimits.h +68 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInt64.h +62 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInterval.h +226 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLimits.h +268 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLine.h +185 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLineAlgo.h +288 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMath.h +208 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrix.h +3441 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.cpp +1252 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.h +1425 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathNamespace.h +115 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlane.h +257 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlatform.h +112 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathQuat.h +964 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.cpp +194 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.h +401 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRoots.h +219 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.cpp +54 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.h +656 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathSphere.h +177 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.cpp +583 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.h +2227 -0
- data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVecAlgo.h +147 -0
- data/vendor/FreeImage/Source/OpenEXR/OpenEXRConfig.h +72 -0
- data/vendor/FreeImage/Source/Plugin.h +144 -0
- data/vendor/FreeImage/Source/Quantizers.h +354 -0
- data/vendor/FreeImage/Source/ToneMapping.h +44 -0
- data/vendor/FreeImage/Source/Utilities.h +516 -0
- data/vendor/FreeImage/Source/ZLib/adler32.c +179 -0
- data/vendor/FreeImage/Source/ZLib/compress.c +80 -0
- data/vendor/FreeImage/Source/ZLib/crc32.c +425 -0
- data/vendor/FreeImage/Source/ZLib/crc32.h +441 -0
- data/vendor/FreeImage/Source/ZLib/deflate.c +1967 -0
- data/vendor/FreeImage/Source/ZLib/deflate.h +346 -0
- data/vendor/FreeImage/Source/ZLib/gzclose.c +25 -0
- data/vendor/FreeImage/Source/ZLib/gzguts.h +209 -0
- data/vendor/FreeImage/Source/ZLib/gzlib.c +634 -0
- data/vendor/FreeImage/Source/ZLib/gzread.c +594 -0
- data/vendor/FreeImage/Source/ZLib/gzwrite.c +577 -0
- data/vendor/FreeImage/Source/ZLib/infback.c +640 -0
- data/vendor/FreeImage/Source/ZLib/inffast.c +340 -0
- data/vendor/FreeImage/Source/ZLib/inffast.h +11 -0
- data/vendor/FreeImage/Source/ZLib/inffixed.h +94 -0
- data/vendor/FreeImage/Source/ZLib/inflate.c +1512 -0
- data/vendor/FreeImage/Source/ZLib/inflate.h +122 -0
- data/vendor/FreeImage/Source/ZLib/inftrees.c +306 -0
- data/vendor/FreeImage/Source/ZLib/inftrees.h +62 -0
- data/vendor/FreeImage/Source/ZLib/trees.c +1226 -0
- data/vendor/FreeImage/Source/ZLib/trees.h +128 -0
- data/vendor/FreeImage/Source/ZLib/uncompr.c +59 -0
- data/vendor/FreeImage/Source/ZLib/zconf.h +511 -0
- data/vendor/FreeImage/Source/ZLib/zlib.h +1768 -0
- data/vendor/FreeImage/Source/ZLib/zutil.c +324 -0
- data/vendor/FreeImage/Source/ZLib/zutil.h +253 -0
- metadata +931 -0
@@ -0,0 +1,897 @@
|
|
1
|
+
// Copyright 2012 Google Inc. All Rights Reserved.
|
2
|
+
//
|
3
|
+
// Use of this source code is governed by a BSD-style license
|
4
|
+
// that can be found in the COPYING file in the root of the source
|
5
|
+
// tree. An additional intellectual property rights grant can be found
|
6
|
+
// in the file PATENTS. All contributing project authors may
|
7
|
+
// be found in the AUTHORS file in the root of the source tree.
|
8
|
+
// -----------------------------------------------------------------------------
|
9
|
+
//
|
10
|
+
// Author: Jyrki Alakuijala (jyrki@google.com)
|
11
|
+
//
|
12
|
+
#ifdef HAVE_CONFIG_H
|
13
|
+
#include "../webp/config.h"
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#include <math.h>
|
17
|
+
|
18
|
+
#include "./backward_references.h"
|
19
|
+
#include "./histogram.h"
|
20
|
+
#include "../dsp/lossless.h"
|
21
|
+
#include "../utils/utils.h"
|
22
|
+
|
23
|
+
#define MAX_COST 1.e38
|
24
|
+
|
25
|
+
// Number of partitions for the three dominant (literal, red and blue) symbol
|
26
|
+
// costs.
|
27
|
+
#define NUM_PARTITIONS 4
|
28
|
+
// The size of the bin-hash corresponding to the three dominant costs.
|
29
|
+
#define BIN_SIZE (NUM_PARTITIONS * NUM_PARTITIONS * NUM_PARTITIONS)
|
30
|
+
// Maximum number of histograms allowed in greedy combining algorithm.
|
31
|
+
#define MAX_HISTO_GREEDY 100
|
32
|
+
|
33
|
+
static void HistogramClear(VP8LHistogram* const p) {
|
34
|
+
uint32_t* const literal = p->literal_;
|
35
|
+
const int cache_bits = p->palette_code_bits_;
|
36
|
+
const int histo_size = VP8LGetHistogramSize(cache_bits);
|
37
|
+
memset(p, 0, histo_size);
|
38
|
+
p->palette_code_bits_ = cache_bits;
|
39
|
+
p->literal_ = literal;
|
40
|
+
}
|
41
|
+
|
42
|
+
// Swap two histogram pointers.
|
43
|
+
static void HistogramSwap(VP8LHistogram** const A, VP8LHistogram** const B) {
|
44
|
+
VP8LHistogram* const tmp = *A;
|
45
|
+
*A = *B;
|
46
|
+
*B = tmp;
|
47
|
+
}
|
48
|
+
|
49
|
+
static void HistogramCopy(const VP8LHistogram* const src,
|
50
|
+
VP8LHistogram* const dst) {
|
51
|
+
uint32_t* const dst_literal = dst->literal_;
|
52
|
+
const int dst_cache_bits = dst->palette_code_bits_;
|
53
|
+
const int histo_size = VP8LGetHistogramSize(dst_cache_bits);
|
54
|
+
assert(src->palette_code_bits_ == dst_cache_bits);
|
55
|
+
memcpy(dst, src, histo_size);
|
56
|
+
dst->literal_ = dst_literal;
|
57
|
+
}
|
58
|
+
|
59
|
+
int VP8LGetHistogramSize(int cache_bits) {
|
60
|
+
const int literal_size = VP8LHistogramNumCodes(cache_bits);
|
61
|
+
const size_t total_size = sizeof(VP8LHistogram) + sizeof(int) * literal_size;
|
62
|
+
assert(total_size <= (size_t)0x7fffffff);
|
63
|
+
return (int)total_size;
|
64
|
+
}
|
65
|
+
|
66
|
+
void VP8LFreeHistogram(VP8LHistogram* const histo) {
|
67
|
+
WebPSafeFree(histo);
|
68
|
+
}
|
69
|
+
|
70
|
+
void VP8LFreeHistogramSet(VP8LHistogramSet* const histo) {
|
71
|
+
WebPSafeFree(histo);
|
72
|
+
}
|
73
|
+
|
74
|
+
void VP8LHistogramStoreRefs(const VP8LBackwardRefs* const refs,
|
75
|
+
VP8LHistogram* const histo) {
|
76
|
+
VP8LRefsCursor c = VP8LRefsCursorInit(refs);
|
77
|
+
while (VP8LRefsCursorOk(&c)) {
|
78
|
+
VP8LHistogramAddSinglePixOrCopy(histo, c.cur_pos);
|
79
|
+
VP8LRefsCursorNext(&c);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
void VP8LHistogramCreate(VP8LHistogram* const p,
|
84
|
+
const VP8LBackwardRefs* const refs,
|
85
|
+
int palette_code_bits) {
|
86
|
+
if (palette_code_bits >= 0) {
|
87
|
+
p->palette_code_bits_ = palette_code_bits;
|
88
|
+
}
|
89
|
+
HistogramClear(p);
|
90
|
+
VP8LHistogramStoreRefs(refs, p);
|
91
|
+
}
|
92
|
+
|
93
|
+
void VP8LHistogramInit(VP8LHistogram* const p, int palette_code_bits) {
|
94
|
+
p->palette_code_bits_ = palette_code_bits;
|
95
|
+
HistogramClear(p);
|
96
|
+
}
|
97
|
+
|
98
|
+
VP8LHistogram* VP8LAllocateHistogram(int cache_bits) {
|
99
|
+
VP8LHistogram* histo = NULL;
|
100
|
+
const int total_size = VP8LGetHistogramSize(cache_bits);
|
101
|
+
uint8_t* const memory = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*memory));
|
102
|
+
if (memory == NULL) return NULL;
|
103
|
+
histo = (VP8LHistogram*)memory;
|
104
|
+
// literal_ won't necessary be aligned.
|
105
|
+
histo->literal_ = (uint32_t*)(memory + sizeof(VP8LHistogram));
|
106
|
+
VP8LHistogramInit(histo, cache_bits);
|
107
|
+
return histo;
|
108
|
+
}
|
109
|
+
|
110
|
+
VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits) {
|
111
|
+
int i;
|
112
|
+
VP8LHistogramSet* set;
|
113
|
+
const size_t total_size = sizeof(*set)
|
114
|
+
+ sizeof(*set->histograms) * size
|
115
|
+
+ (size_t)VP8LGetHistogramSize(cache_bits) * size;
|
116
|
+
uint8_t* memory = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*memory));
|
117
|
+
if (memory == NULL) return NULL;
|
118
|
+
|
119
|
+
set = (VP8LHistogramSet*)memory;
|
120
|
+
memory += sizeof(*set);
|
121
|
+
set->histograms = (VP8LHistogram**)memory;
|
122
|
+
memory += size * sizeof(*set->histograms);
|
123
|
+
set->max_size = size;
|
124
|
+
set->size = size;
|
125
|
+
for (i = 0; i < size; ++i) {
|
126
|
+
set->histograms[i] = (VP8LHistogram*)memory;
|
127
|
+
// literal_ won't necessary be aligned.
|
128
|
+
set->histograms[i]->literal_ = (uint32_t*)(memory + sizeof(VP8LHistogram));
|
129
|
+
VP8LHistogramInit(set->histograms[i], cache_bits);
|
130
|
+
// There's no padding/alignment between successive histograms.
|
131
|
+
memory += VP8LGetHistogramSize(cache_bits);
|
132
|
+
}
|
133
|
+
return set;
|
134
|
+
}
|
135
|
+
|
136
|
+
// -----------------------------------------------------------------------------
|
137
|
+
|
138
|
+
void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo,
|
139
|
+
const PixOrCopy* const v) {
|
140
|
+
if (PixOrCopyIsLiteral(v)) {
|
141
|
+
++histo->alpha_[PixOrCopyLiteral(v, 3)];
|
142
|
+
++histo->red_[PixOrCopyLiteral(v, 2)];
|
143
|
+
++histo->literal_[PixOrCopyLiteral(v, 1)];
|
144
|
+
++histo->blue_[PixOrCopyLiteral(v, 0)];
|
145
|
+
} else if (PixOrCopyIsCacheIdx(v)) {
|
146
|
+
const int literal_ix =
|
147
|
+
NUM_LITERAL_CODES + NUM_LENGTH_CODES + PixOrCopyCacheIdx(v);
|
148
|
+
++histo->literal_[literal_ix];
|
149
|
+
} else {
|
150
|
+
int code, extra_bits;
|
151
|
+
VP8LPrefixEncodeBits(PixOrCopyLength(v), &code, &extra_bits);
|
152
|
+
++histo->literal_[NUM_LITERAL_CODES + code];
|
153
|
+
VP8LPrefixEncodeBits(PixOrCopyDistance(v), &code, &extra_bits);
|
154
|
+
++histo->distance_[code];
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
// -----------------------------------------------------------------------------
|
159
|
+
// Various histogram combine/cost-eval functions
|
160
|
+
|
161
|
+
static int GetCombinedHistogramEntropy(const VP8LHistogram* const a,
|
162
|
+
const VP8LHistogram* const b,
|
163
|
+
double cost_threshold,
|
164
|
+
double* cost) {
|
165
|
+
const int palette_code_bits = a->palette_code_bits_;
|
166
|
+
assert(a->palette_code_bits_ == b->palette_code_bits_);
|
167
|
+
*cost += VP8LGetCombinedEntropy(a->literal_, b->literal_,
|
168
|
+
VP8LHistogramNumCodes(palette_code_bits));
|
169
|
+
*cost += VP8LExtraCostCombined(a->literal_ + NUM_LITERAL_CODES,
|
170
|
+
b->literal_ + NUM_LITERAL_CODES,
|
171
|
+
NUM_LENGTH_CODES);
|
172
|
+
if (*cost > cost_threshold) return 0;
|
173
|
+
|
174
|
+
*cost += VP8LGetCombinedEntropy(a->red_, b->red_, NUM_LITERAL_CODES);
|
175
|
+
if (*cost > cost_threshold) return 0;
|
176
|
+
|
177
|
+
*cost += VP8LGetCombinedEntropy(a->blue_, b->blue_, NUM_LITERAL_CODES);
|
178
|
+
if (*cost > cost_threshold) return 0;
|
179
|
+
|
180
|
+
*cost += VP8LGetCombinedEntropy(a->alpha_, b->alpha_, NUM_LITERAL_CODES);
|
181
|
+
if (*cost > cost_threshold) return 0;
|
182
|
+
|
183
|
+
*cost += VP8LGetCombinedEntropy(a->distance_, b->distance_,
|
184
|
+
NUM_DISTANCE_CODES);
|
185
|
+
*cost += VP8LExtraCostCombined(a->distance_, b->distance_,
|
186
|
+
NUM_DISTANCE_CODES);
|
187
|
+
if (*cost > cost_threshold) return 0;
|
188
|
+
|
189
|
+
return 1;
|
190
|
+
}
|
191
|
+
|
192
|
+
// Performs out = a + b, computing the cost C(a+b) - C(a) - C(b) while comparing
|
193
|
+
// to the threshold value 'cost_threshold'. The score returned is
|
194
|
+
// Score = C(a+b) - C(a) - C(b), where C(a) + C(b) is known and fixed.
|
195
|
+
// Since the previous score passed is 'cost_threshold', we only need to compare
|
196
|
+
// the partial cost against 'cost_threshold + C(a) + C(b)' to possibly bail-out
|
197
|
+
// early.
|
198
|
+
static double HistogramAddEval(const VP8LHistogram* const a,
|
199
|
+
const VP8LHistogram* const b,
|
200
|
+
VP8LHistogram* const out,
|
201
|
+
double cost_threshold) {
|
202
|
+
double cost = 0;
|
203
|
+
const double sum_cost = a->bit_cost_ + b->bit_cost_;
|
204
|
+
cost_threshold += sum_cost;
|
205
|
+
|
206
|
+
if (GetCombinedHistogramEntropy(a, b, cost_threshold, &cost)) {
|
207
|
+
VP8LHistogramAdd(a, b, out);
|
208
|
+
out->bit_cost_ = cost;
|
209
|
+
out->palette_code_bits_ = a->palette_code_bits_;
|
210
|
+
out->trivial_symbol_ = (a->trivial_symbol_ == b->trivial_symbol_) ?
|
211
|
+
a->trivial_symbol_ : VP8L_NON_TRIVIAL_SYM;
|
212
|
+
}
|
213
|
+
|
214
|
+
return cost - sum_cost;
|
215
|
+
}
|
216
|
+
|
217
|
+
// Same as HistogramAddEval(), except that the resulting histogram
|
218
|
+
// is not stored. Only the cost C(a+b) - C(a) is evaluated. We omit
|
219
|
+
// the term C(b) which is constant over all the evaluations.
|
220
|
+
static double HistogramAddThresh(const VP8LHistogram* const a,
|
221
|
+
const VP8LHistogram* const b,
|
222
|
+
double cost_threshold) {
|
223
|
+
double cost = -a->bit_cost_;
|
224
|
+
GetCombinedHistogramEntropy(a, b, cost_threshold, &cost);
|
225
|
+
return cost;
|
226
|
+
}
|
227
|
+
|
228
|
+
// -----------------------------------------------------------------------------
|
229
|
+
|
230
|
+
// The structure to keep track of cost range for the three dominant entropy
|
231
|
+
// symbols.
|
232
|
+
// TODO(skal): Evaluate if float can be used here instead of double for
|
233
|
+
// representing the entropy costs.
|
234
|
+
typedef struct {
|
235
|
+
double literal_max_;
|
236
|
+
double literal_min_;
|
237
|
+
double red_max_;
|
238
|
+
double red_min_;
|
239
|
+
double blue_max_;
|
240
|
+
double blue_min_;
|
241
|
+
} DominantCostRange;
|
242
|
+
|
243
|
+
static void DominantCostRangeInit(DominantCostRange* const c) {
|
244
|
+
c->literal_max_ = 0.;
|
245
|
+
c->literal_min_ = MAX_COST;
|
246
|
+
c->red_max_ = 0.;
|
247
|
+
c->red_min_ = MAX_COST;
|
248
|
+
c->blue_max_ = 0.;
|
249
|
+
c->blue_min_ = MAX_COST;
|
250
|
+
}
|
251
|
+
|
252
|
+
static void UpdateDominantCostRange(
|
253
|
+
const VP8LHistogram* const h, DominantCostRange* const c) {
|
254
|
+
if (c->literal_max_ < h->literal_cost_) c->literal_max_ = h->literal_cost_;
|
255
|
+
if (c->literal_min_ > h->literal_cost_) c->literal_min_ = h->literal_cost_;
|
256
|
+
if (c->red_max_ < h->red_cost_) c->red_max_ = h->red_cost_;
|
257
|
+
if (c->red_min_ > h->red_cost_) c->red_min_ = h->red_cost_;
|
258
|
+
if (c->blue_max_ < h->blue_cost_) c->blue_max_ = h->blue_cost_;
|
259
|
+
if (c->blue_min_ > h->blue_cost_) c->blue_min_ = h->blue_cost_;
|
260
|
+
}
|
261
|
+
|
262
|
+
static void UpdateHistogramCost(VP8LHistogram* const h) {
|
263
|
+
uint32_t alpha_sym, red_sym, blue_sym;
|
264
|
+
const double alpha_cost = VP8LPopulationCost(h->alpha_, NUM_LITERAL_CODES,
|
265
|
+
&alpha_sym);
|
266
|
+
const double distance_cost =
|
267
|
+
VP8LPopulationCost(h->distance_, NUM_DISTANCE_CODES, NULL) +
|
268
|
+
VP8LExtraCost(h->distance_, NUM_DISTANCE_CODES);
|
269
|
+
const int num_codes = VP8LHistogramNumCodes(h->palette_code_bits_);
|
270
|
+
h->literal_cost_ = VP8LPopulationCost(h->literal_, num_codes, NULL) +
|
271
|
+
VP8LExtraCost(h->literal_ + NUM_LITERAL_CODES,
|
272
|
+
NUM_LENGTH_CODES);
|
273
|
+
h->red_cost_ = VP8LPopulationCost(h->red_, NUM_LITERAL_CODES, &red_sym);
|
274
|
+
h->blue_cost_ = VP8LPopulationCost(h->blue_, NUM_LITERAL_CODES, &blue_sym);
|
275
|
+
h->bit_cost_ = h->literal_cost_ + h->red_cost_ + h->blue_cost_ +
|
276
|
+
alpha_cost + distance_cost;
|
277
|
+
if ((alpha_sym | red_sym | blue_sym) == VP8L_NON_TRIVIAL_SYM) {
|
278
|
+
h->trivial_symbol_ = VP8L_NON_TRIVIAL_SYM;
|
279
|
+
} else {
|
280
|
+
h->trivial_symbol_ =
|
281
|
+
((uint32_t)alpha_sym << 24) | (red_sym << 16) | (blue_sym << 0);
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
static int GetBinIdForEntropy(double min, double max, double val) {
|
286
|
+
const double range = max - min + 1e-6;
|
287
|
+
const double delta = val - min;
|
288
|
+
return (int)(NUM_PARTITIONS * delta / range);
|
289
|
+
}
|
290
|
+
|
291
|
+
static int GetHistoBinIndexLowEffort(
|
292
|
+
const VP8LHistogram* const h, const DominantCostRange* const c) {
|
293
|
+
const int bin_id = GetBinIdForEntropy(c->literal_min_, c->literal_max_,
|
294
|
+
h->literal_cost_);
|
295
|
+
assert(bin_id < NUM_PARTITIONS);
|
296
|
+
return bin_id;
|
297
|
+
}
|
298
|
+
|
299
|
+
static int GetHistoBinIndex(
|
300
|
+
const VP8LHistogram* const h, const DominantCostRange* const c) {
|
301
|
+
const int bin_id =
|
302
|
+
GetBinIdForEntropy(c->blue_min_, c->blue_max_, h->blue_cost_) +
|
303
|
+
NUM_PARTITIONS * GetBinIdForEntropy(c->red_min_, c->red_max_,
|
304
|
+
h->red_cost_) +
|
305
|
+
NUM_PARTITIONS * NUM_PARTITIONS * GetBinIdForEntropy(c->literal_min_,
|
306
|
+
c->literal_max_,
|
307
|
+
h->literal_cost_);
|
308
|
+
assert(bin_id < BIN_SIZE);
|
309
|
+
return bin_id;
|
310
|
+
}
|
311
|
+
|
312
|
+
// Construct the histograms from backward references.
|
313
|
+
static void HistogramBuild(
|
314
|
+
int xsize, int histo_bits, const VP8LBackwardRefs* const backward_refs,
|
315
|
+
VP8LHistogramSet* const image_histo) {
|
316
|
+
int x = 0, y = 0;
|
317
|
+
const int histo_xsize = VP8LSubSampleSize(xsize, histo_bits);
|
318
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
319
|
+
VP8LRefsCursor c = VP8LRefsCursorInit(backward_refs);
|
320
|
+
assert(histo_bits > 0);
|
321
|
+
while (VP8LRefsCursorOk(&c)) {
|
322
|
+
const PixOrCopy* const v = c.cur_pos;
|
323
|
+
const int ix = (y >> histo_bits) * histo_xsize + (x >> histo_bits);
|
324
|
+
VP8LHistogramAddSinglePixOrCopy(histograms[ix], v);
|
325
|
+
x += PixOrCopyLength(v);
|
326
|
+
while (x >= xsize) {
|
327
|
+
x -= xsize;
|
328
|
+
++y;
|
329
|
+
}
|
330
|
+
VP8LRefsCursorNext(&c);
|
331
|
+
}
|
332
|
+
}
|
333
|
+
|
334
|
+
// Copies the histograms and computes its bit_cost.
|
335
|
+
static void HistogramCopyAndAnalyze(
|
336
|
+
VP8LHistogramSet* const orig_histo, VP8LHistogramSet* const image_histo) {
|
337
|
+
int i;
|
338
|
+
const int histo_size = orig_histo->size;
|
339
|
+
VP8LHistogram** const orig_histograms = orig_histo->histograms;
|
340
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
341
|
+
for (i = 0; i < histo_size; ++i) {
|
342
|
+
VP8LHistogram* const histo = orig_histograms[i];
|
343
|
+
UpdateHistogramCost(histo);
|
344
|
+
// Copy histograms from orig_histo[] to image_histo[].
|
345
|
+
HistogramCopy(histo, histograms[i]);
|
346
|
+
}
|
347
|
+
}
|
348
|
+
|
349
|
+
// Partition histograms to different entropy bins for three dominant (literal,
|
350
|
+
// red and blue) symbol costs and compute the histogram aggregate bit_cost.
|
351
|
+
static void HistogramAnalyzeEntropyBin(VP8LHistogramSet* const image_histo,
|
352
|
+
int16_t* const bin_map, int low_effort) {
|
353
|
+
int i;
|
354
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
355
|
+
const int histo_size = image_histo->size;
|
356
|
+
const int bin_depth = histo_size + 1;
|
357
|
+
DominantCostRange cost_range;
|
358
|
+
DominantCostRangeInit(&cost_range);
|
359
|
+
|
360
|
+
// Analyze the dominant (literal, red and blue) entropy costs.
|
361
|
+
for (i = 0; i < histo_size; ++i) {
|
362
|
+
VP8LHistogram* const histo = histograms[i];
|
363
|
+
UpdateDominantCostRange(histo, &cost_range);
|
364
|
+
}
|
365
|
+
|
366
|
+
// bin-hash histograms on three of the dominant (literal, red and blue)
|
367
|
+
// symbol costs.
|
368
|
+
for (i = 0; i < histo_size; ++i) {
|
369
|
+
int num_histos;
|
370
|
+
VP8LHistogram* const histo = histograms[i];
|
371
|
+
const int16_t bin_id = low_effort ?
|
372
|
+
(int16_t)GetHistoBinIndexLowEffort(histo, &cost_range) :
|
373
|
+
(int16_t)GetHistoBinIndex(histo, &cost_range);
|
374
|
+
const int bin_offset = bin_id * bin_depth;
|
375
|
+
// bin_map[n][0] for every bin 'n' maintains the counter for the number of
|
376
|
+
// histograms in that bin.
|
377
|
+
// Get and increment the num_histos in that bin.
|
378
|
+
num_histos = ++bin_map[bin_offset];
|
379
|
+
assert(bin_offset + num_histos < bin_depth * BIN_SIZE);
|
380
|
+
// Add histogram i'th index at num_histos (last) position in the bin_map.
|
381
|
+
bin_map[bin_offset + num_histos] = i;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
// Compact the histogram set by removing unused entries.
|
386
|
+
static void HistogramCompactBins(VP8LHistogramSet* const image_histo) {
|
387
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
388
|
+
int i, j;
|
389
|
+
|
390
|
+
for (i = 0, j = 0; i < image_histo->size; ++i) {
|
391
|
+
if (histograms[i] != NULL && histograms[i]->bit_cost_ != 0.) {
|
392
|
+
if (j < i) {
|
393
|
+
histograms[j] = histograms[i];
|
394
|
+
histograms[i] = NULL;
|
395
|
+
}
|
396
|
+
++j;
|
397
|
+
}
|
398
|
+
}
|
399
|
+
image_histo->size = j;
|
400
|
+
}
|
401
|
+
|
402
|
+
static VP8LHistogram* HistogramCombineEntropyBin(
|
403
|
+
VP8LHistogramSet* const image_histo,
|
404
|
+
VP8LHistogram* cur_combo,
|
405
|
+
int16_t* const bin_map, int bin_depth, int num_bins,
|
406
|
+
double combine_cost_factor, int low_effort) {
|
407
|
+
int bin_id;
|
408
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
409
|
+
|
410
|
+
for (bin_id = 0; bin_id < num_bins; ++bin_id) {
|
411
|
+
const int bin_offset = bin_id * bin_depth;
|
412
|
+
const int num_histos = bin_map[bin_offset];
|
413
|
+
const int idx1 = bin_map[bin_offset + 1];
|
414
|
+
int num_combine_failures = 0;
|
415
|
+
int n;
|
416
|
+
for (n = 2; n <= num_histos; ++n) {
|
417
|
+
const int idx2 = bin_map[bin_offset + n];
|
418
|
+
if (low_effort) {
|
419
|
+
// Merge all histograms with the same bin index, irrespective of cost of
|
420
|
+
// the merged histograms.
|
421
|
+
VP8LHistogramAdd(histograms[idx1], histograms[idx2], histograms[idx1]);
|
422
|
+
histograms[idx2]->bit_cost_ = 0.;
|
423
|
+
} else {
|
424
|
+
const double bit_cost_idx2 = histograms[idx2]->bit_cost_;
|
425
|
+
if (bit_cost_idx2 > 0.) {
|
426
|
+
const double bit_cost_thresh = -bit_cost_idx2 * combine_cost_factor;
|
427
|
+
const double curr_cost_diff =
|
428
|
+
HistogramAddEval(histograms[idx1], histograms[idx2],
|
429
|
+
cur_combo, bit_cost_thresh);
|
430
|
+
if (curr_cost_diff < bit_cost_thresh) {
|
431
|
+
// Try to merge two histograms only if the combo is a trivial one or
|
432
|
+
// the two candidate histograms are already non-trivial.
|
433
|
+
// For some images, 'try_combine' turns out to be false for a lot of
|
434
|
+
// histogram pairs. In that case, we fallback to combining
|
435
|
+
// histograms as usual to avoid increasing the header size.
|
436
|
+
const int try_combine =
|
437
|
+
(cur_combo->trivial_symbol_ != VP8L_NON_TRIVIAL_SYM) ||
|
438
|
+
((histograms[idx1]->trivial_symbol_ == VP8L_NON_TRIVIAL_SYM) &&
|
439
|
+
(histograms[idx2]->trivial_symbol_ == VP8L_NON_TRIVIAL_SYM));
|
440
|
+
const int max_combine_failures = 32;
|
441
|
+
if (try_combine || (num_combine_failures >= max_combine_failures)) {
|
442
|
+
HistogramSwap(&cur_combo, &histograms[idx1]);
|
443
|
+
histograms[idx2]->bit_cost_ = 0.;
|
444
|
+
} else {
|
445
|
+
++num_combine_failures;
|
446
|
+
}
|
447
|
+
}
|
448
|
+
}
|
449
|
+
}
|
450
|
+
}
|
451
|
+
if (low_effort) {
|
452
|
+
// Update the bit_cost for the merged histograms (per bin index).
|
453
|
+
UpdateHistogramCost(histograms[idx1]);
|
454
|
+
}
|
455
|
+
}
|
456
|
+
HistogramCompactBins(image_histo);
|
457
|
+
return cur_combo;
|
458
|
+
}
|
459
|
+
|
460
|
+
static uint32_t MyRand(uint32_t *seed) {
|
461
|
+
*seed *= 16807U;
|
462
|
+
if (*seed == 0) {
|
463
|
+
*seed = 1;
|
464
|
+
}
|
465
|
+
return *seed;
|
466
|
+
}
|
467
|
+
|
468
|
+
// -----------------------------------------------------------------------------
|
469
|
+
// Histogram pairs priority queue
|
470
|
+
|
471
|
+
// Pair of histograms. Negative idx1 value means that pair is out-of-date.
|
472
|
+
typedef struct {
|
473
|
+
int idx1;
|
474
|
+
int idx2;
|
475
|
+
double cost_diff;
|
476
|
+
double cost_combo;
|
477
|
+
} HistogramPair;
|
478
|
+
|
479
|
+
typedef struct {
|
480
|
+
HistogramPair* heap;
|
481
|
+
int* positions;
|
482
|
+
int size;
|
483
|
+
int max_index;
|
484
|
+
} HistoHeap;
|
485
|
+
|
486
|
+
static int HistoHeapInit(HistoHeap* const histo_heap, const int max_index) {
|
487
|
+
histo_heap->size = 0;
|
488
|
+
histo_heap->max_index = max_index;
|
489
|
+
histo_heap->heap = WebPSafeMalloc(max_index * max_index,
|
490
|
+
sizeof(*histo_heap->heap));
|
491
|
+
histo_heap->positions = WebPSafeMalloc(max_index * max_index,
|
492
|
+
sizeof(*histo_heap->positions));
|
493
|
+
return histo_heap->heap != NULL && histo_heap->positions != NULL;
|
494
|
+
}
|
495
|
+
|
496
|
+
static void HistoHeapClear(HistoHeap* const histo_heap) {
|
497
|
+
assert(histo_heap != NULL);
|
498
|
+
WebPSafeFree(histo_heap->heap);
|
499
|
+
WebPSafeFree(histo_heap->positions);
|
500
|
+
}
|
501
|
+
|
502
|
+
static void SwapHistogramPairs(HistogramPair *p1,
|
503
|
+
HistogramPair *p2) {
|
504
|
+
const HistogramPair tmp = *p1;
|
505
|
+
*p1 = *p2;
|
506
|
+
*p2 = tmp;
|
507
|
+
}
|
508
|
+
|
509
|
+
// Given a valid min-heap in range [0, heap_size-1) this function places value
|
510
|
+
// heap[heap_size-1] into right location within heap and sets its position in
|
511
|
+
// positions array.
|
512
|
+
static void HeapPush(HistoHeap* const histo_heap) {
|
513
|
+
HistogramPair* const heap = histo_heap->heap - 1;
|
514
|
+
int* const positions = histo_heap->positions;
|
515
|
+
const int max_index = histo_heap->max_index;
|
516
|
+
int v;
|
517
|
+
++histo_heap->size;
|
518
|
+
v = histo_heap->size;
|
519
|
+
while (v > 1 && heap[v].cost_diff < heap[v >> 1].cost_diff) {
|
520
|
+
SwapHistogramPairs(&heap[v], &heap[v >> 1]);
|
521
|
+
// Change position of moved pair in heap.
|
522
|
+
if (heap[v].idx1 >= 0) {
|
523
|
+
const int pos = heap[v].idx1 * max_index + heap[v].idx2;
|
524
|
+
assert(pos >= 0 && pos < max_index * max_index);
|
525
|
+
positions[pos] = v;
|
526
|
+
}
|
527
|
+
v >>= 1;
|
528
|
+
}
|
529
|
+
positions[heap[v].idx1 * max_index + heap[v].idx2] = v;
|
530
|
+
}
|
531
|
+
|
532
|
+
// Given a valid min-heap in range [0, heap_size) this function shortens heap
|
533
|
+
// range by one and places element with the lowest value to (heap_size-1).
|
534
|
+
static void HeapPop(HistoHeap* const histo_heap) {
|
535
|
+
HistogramPair* const heap = histo_heap->heap - 1;
|
536
|
+
int* const positions = histo_heap->positions;
|
537
|
+
const int heap_size = histo_heap->size;
|
538
|
+
const int max_index = histo_heap->max_index;
|
539
|
+
int v = 1;
|
540
|
+
if (heap[v].idx1 >= 0) {
|
541
|
+
positions[heap[v].idx1 * max_index + heap[v].idx2] = -1;
|
542
|
+
}
|
543
|
+
SwapHistogramPairs(&heap[v], &heap[heap_size]);
|
544
|
+
while ((v << 1) < heap_size) {
|
545
|
+
int son = (heap[v << 1].cost_diff < heap[v].cost_diff) ? (v << 1) : v;
|
546
|
+
if (((v << 1) + 1) < heap_size &&
|
547
|
+
heap[(v << 1) + 1].cost_diff < heap[son].cost_diff) {
|
548
|
+
son = (v << 1) + 1;
|
549
|
+
}
|
550
|
+
if (son == v) break;
|
551
|
+
SwapHistogramPairs(&heap[v], &heap[son]);
|
552
|
+
// Change position of moved pair in heap.
|
553
|
+
if (heap[v].idx1 >= 0) {
|
554
|
+
positions[heap[v].idx1 * max_index + heap[v].idx2] = v;
|
555
|
+
}
|
556
|
+
v = son;
|
557
|
+
}
|
558
|
+
if (heap[v].idx1 >= 0) {
|
559
|
+
positions[heap[v].idx1 * max_index + heap[v].idx2] = v;
|
560
|
+
}
|
561
|
+
--histo_heap->size;
|
562
|
+
}
|
563
|
+
|
564
|
+
// -----------------------------------------------------------------------------
|
565
|
+
|
566
|
+
static void PreparePair(VP8LHistogram** histograms, int idx1, int idx2,
|
567
|
+
HistogramPair* const pair,
|
568
|
+
VP8LHistogram* const histos) {
|
569
|
+
if (idx1 > idx2) {
|
570
|
+
const int tmp = idx2;
|
571
|
+
idx2 = idx1;
|
572
|
+
idx1 = tmp;
|
573
|
+
}
|
574
|
+
pair->idx1 = idx1;
|
575
|
+
pair->idx2 = idx2;
|
576
|
+
pair->cost_diff =
|
577
|
+
HistogramAddEval(histograms[idx1], histograms[idx2], histos, 0);
|
578
|
+
pair->cost_combo = histos->bit_cost_;
|
579
|
+
}
|
580
|
+
|
581
|
+
#define POSITION_INVALID (-1)
|
582
|
+
|
583
|
+
// Invalidates pairs intersecting (idx1, idx2) in heap.
|
584
|
+
static void InvalidatePairs(int idx1, int idx2,
|
585
|
+
const HistoHeap* const histo_heap) {
|
586
|
+
HistogramPair* const heap = histo_heap->heap - 1;
|
587
|
+
int* const positions = histo_heap->positions;
|
588
|
+
const int max_index = histo_heap->max_index;
|
589
|
+
int i;
|
590
|
+
for (i = 0; i < idx1; ++i) {
|
591
|
+
const int pos = positions[i * max_index + idx1];
|
592
|
+
if (pos >= 0) {
|
593
|
+
heap[pos].idx1 = POSITION_INVALID;
|
594
|
+
}
|
595
|
+
}
|
596
|
+
for (i = idx1 + 1; i < max_index; ++i) {
|
597
|
+
const int pos = positions[idx1 * max_index + i];
|
598
|
+
if (pos >= 0) {
|
599
|
+
heap[pos].idx1 = POSITION_INVALID;
|
600
|
+
}
|
601
|
+
}
|
602
|
+
for (i = 0; i < idx2; ++i) {
|
603
|
+
const int pos = positions[i * max_index + idx2];
|
604
|
+
if (pos >= 0) {
|
605
|
+
heap[pos].idx1 = POSITION_INVALID;
|
606
|
+
}
|
607
|
+
}
|
608
|
+
for (i = idx2 + 1; i < max_index; ++i) {
|
609
|
+
const int pos = positions[idx2 * max_index + i];
|
610
|
+
if (pos >= 0) {
|
611
|
+
heap[pos].idx1 = POSITION_INVALID;
|
612
|
+
}
|
613
|
+
}
|
614
|
+
}
|
615
|
+
|
616
|
+
// Combines histograms by continuously choosing the one with the highest cost
|
617
|
+
// reduction.
|
618
|
+
static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo,
|
619
|
+
VP8LHistogram* const histos) {
|
620
|
+
int ok = 0;
|
621
|
+
int image_histo_size = image_histo->size;
|
622
|
+
int i, j;
|
623
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
624
|
+
// Indexes of remaining histograms.
|
625
|
+
int* const clusters = WebPSafeMalloc(image_histo_size, sizeof(*clusters));
|
626
|
+
// Heap of histogram pairs.
|
627
|
+
HistoHeap histo_heap;
|
628
|
+
|
629
|
+
if (!HistoHeapInit(&histo_heap, image_histo_size) || clusters == NULL) {
|
630
|
+
goto End;
|
631
|
+
}
|
632
|
+
|
633
|
+
for (i = 0; i < image_histo_size; ++i) {
|
634
|
+
// Initialize clusters indexes.
|
635
|
+
clusters[i] = i;
|
636
|
+
for (j = i + 1; j < image_histo_size; ++j) {
|
637
|
+
// Initialize positions array.
|
638
|
+
histo_heap.positions[i * histo_heap.max_index + j] = POSITION_INVALID;
|
639
|
+
PreparePair(histograms, i, j, &histo_heap.heap[histo_heap.size], histos);
|
640
|
+
if (histo_heap.heap[histo_heap.size].cost_diff < 0) {
|
641
|
+
HeapPush(&histo_heap);
|
642
|
+
}
|
643
|
+
}
|
644
|
+
}
|
645
|
+
|
646
|
+
while (image_histo_size > 1 && histo_heap.size > 0) {
|
647
|
+
const int idx1 = histo_heap.heap[0].idx1;
|
648
|
+
const int idx2 = histo_heap.heap[0].idx2;
|
649
|
+
VP8LHistogramAdd(histograms[idx2], histograms[idx1], histograms[idx1]);
|
650
|
+
histograms[idx1]->bit_cost_ = histo_heap.heap[0].cost_combo;
|
651
|
+
// Remove merged histogram.
|
652
|
+
for (i = 0; i + 1 < image_histo_size; ++i) {
|
653
|
+
if (clusters[i] >= idx2) {
|
654
|
+
clusters[i] = clusters[i + 1];
|
655
|
+
}
|
656
|
+
}
|
657
|
+
--image_histo_size;
|
658
|
+
|
659
|
+
// Invalidate pairs intersecting the just combined best pair.
|
660
|
+
InvalidatePairs(idx1, idx2, &histo_heap);
|
661
|
+
|
662
|
+
// Pop invalid pairs from the top of the heap.
|
663
|
+
while (histo_heap.size > 0 && histo_heap.heap[0].idx1 < 0) {
|
664
|
+
HeapPop(&histo_heap);
|
665
|
+
}
|
666
|
+
|
667
|
+
// Push new pairs formed with combined histogram to the heap.
|
668
|
+
for (i = 0; i < image_histo_size; ++i) {
|
669
|
+
if (clusters[i] != idx1) {
|
670
|
+
PreparePair(histograms, idx1, clusters[i],
|
671
|
+
&histo_heap.heap[histo_heap.size], histos);
|
672
|
+
if (histo_heap.heap[histo_heap.size].cost_diff < 0) {
|
673
|
+
HeapPush(&histo_heap);
|
674
|
+
}
|
675
|
+
}
|
676
|
+
}
|
677
|
+
}
|
678
|
+
// Move remaining histograms to the beginning of the array.
|
679
|
+
for (i = 0; i < image_histo_size; ++i) {
|
680
|
+
if (i != clusters[i]) { // swap the two histograms
|
681
|
+
HistogramSwap(&histograms[i], &histograms[clusters[i]]);
|
682
|
+
}
|
683
|
+
}
|
684
|
+
|
685
|
+
image_histo->size = image_histo_size;
|
686
|
+
ok = 1;
|
687
|
+
|
688
|
+
End:
|
689
|
+
WebPSafeFree(clusters);
|
690
|
+
HistoHeapClear(&histo_heap);
|
691
|
+
return ok;
|
692
|
+
}
|
693
|
+
|
694
|
+
static VP8LHistogram* HistogramCombineStochastic(
|
695
|
+
VP8LHistogramSet* const image_histo,
|
696
|
+
VP8LHistogram* tmp_histo,
|
697
|
+
VP8LHistogram* best_combo,
|
698
|
+
int quality, int min_cluster_size) {
|
699
|
+
int iter;
|
700
|
+
uint32_t seed = 0;
|
701
|
+
int tries_with_no_success = 0;
|
702
|
+
int image_histo_size = image_histo->size;
|
703
|
+
const int iter_mult = (quality < 25) ? 2 : 2 + (quality - 25) / 8;
|
704
|
+
const int outer_iters = image_histo_size * iter_mult;
|
705
|
+
const int num_pairs = image_histo_size / 2;
|
706
|
+
const int num_tries_no_success = outer_iters / 2;
|
707
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
708
|
+
|
709
|
+
// Collapse similar histograms in 'image_histo'.
|
710
|
+
++min_cluster_size;
|
711
|
+
for (iter = 0;
|
712
|
+
iter < outer_iters && image_histo_size >= min_cluster_size;
|
713
|
+
++iter) {
|
714
|
+
double best_cost_diff = 0.;
|
715
|
+
int best_idx1 = -1, best_idx2 = 1;
|
716
|
+
int j;
|
717
|
+
const int num_tries =
|
718
|
+
(num_pairs < image_histo_size) ? num_pairs : image_histo_size;
|
719
|
+
seed += iter;
|
720
|
+
for (j = 0; j < num_tries; ++j) {
|
721
|
+
double curr_cost_diff;
|
722
|
+
// Choose two histograms at random and try to combine them.
|
723
|
+
const uint32_t idx1 = MyRand(&seed) % image_histo_size;
|
724
|
+
const uint32_t tmp = (j & 7) + 1;
|
725
|
+
const uint32_t diff =
|
726
|
+
(tmp < 3) ? tmp : MyRand(&seed) % (image_histo_size - 1);
|
727
|
+
const uint32_t idx2 = (idx1 + diff + 1) % image_histo_size;
|
728
|
+
if (idx1 == idx2) {
|
729
|
+
continue;
|
730
|
+
}
|
731
|
+
|
732
|
+
// Calculate cost reduction on combining.
|
733
|
+
curr_cost_diff = HistogramAddEval(histograms[idx1], histograms[idx2],
|
734
|
+
tmp_histo, best_cost_diff);
|
735
|
+
if (curr_cost_diff < best_cost_diff) { // found a better pair?
|
736
|
+
HistogramSwap(&best_combo, &tmp_histo);
|
737
|
+
best_cost_diff = curr_cost_diff;
|
738
|
+
best_idx1 = idx1;
|
739
|
+
best_idx2 = idx2;
|
740
|
+
}
|
741
|
+
}
|
742
|
+
|
743
|
+
if (best_idx1 >= 0) {
|
744
|
+
HistogramSwap(&best_combo, &histograms[best_idx1]);
|
745
|
+
// swap best_idx2 slot with last one (which is now unused)
|
746
|
+
--image_histo_size;
|
747
|
+
if (best_idx2 != image_histo_size) {
|
748
|
+
HistogramSwap(&histograms[image_histo_size], &histograms[best_idx2]);
|
749
|
+
histograms[image_histo_size] = NULL;
|
750
|
+
}
|
751
|
+
tries_with_no_success = 0;
|
752
|
+
}
|
753
|
+
if (++tries_with_no_success >= num_tries_no_success) {
|
754
|
+
break;
|
755
|
+
}
|
756
|
+
}
|
757
|
+
image_histo->size = image_histo_size;
|
758
|
+
return best_combo;
|
759
|
+
}
|
760
|
+
|
761
|
+
// -----------------------------------------------------------------------------
|
762
|
+
// Histogram refinement
|
763
|
+
|
764
|
+
// Find the best 'out' histogram for each of the 'in' histograms.
|
765
|
+
// Note: we assume that out[]->bit_cost_ is already up-to-date.
|
766
|
+
static void HistogramRemap(const VP8LHistogramSet* const orig_histo,
|
767
|
+
const VP8LHistogramSet* const image_histo,
|
768
|
+
uint16_t* const symbols) {
|
769
|
+
int i;
|
770
|
+
VP8LHistogram** const orig_histograms = orig_histo->histograms;
|
771
|
+
VP8LHistogram** const histograms = image_histo->histograms;
|
772
|
+
const int orig_histo_size = orig_histo->size;
|
773
|
+
const int image_histo_size = image_histo->size;
|
774
|
+
if (image_histo_size > 1) {
|
775
|
+
for (i = 0; i < orig_histo_size; ++i) {
|
776
|
+
int best_out = 0;
|
777
|
+
double best_bits =
|
778
|
+
HistogramAddThresh(histograms[0], orig_histograms[i], MAX_COST);
|
779
|
+
int k;
|
780
|
+
for (k = 1; k < image_histo_size; ++k) {
|
781
|
+
const double cur_bits =
|
782
|
+
HistogramAddThresh(histograms[k], orig_histograms[i], best_bits);
|
783
|
+
if (cur_bits < best_bits) {
|
784
|
+
best_bits = cur_bits;
|
785
|
+
best_out = k;
|
786
|
+
}
|
787
|
+
}
|
788
|
+
symbols[i] = best_out;
|
789
|
+
}
|
790
|
+
} else {
|
791
|
+
assert(image_histo_size == 1);
|
792
|
+
for (i = 0; i < orig_histo_size; ++i) {
|
793
|
+
symbols[i] = 0;
|
794
|
+
}
|
795
|
+
}
|
796
|
+
|
797
|
+
// Recompute each out based on raw and symbols.
|
798
|
+
for (i = 0; i < image_histo_size; ++i) {
|
799
|
+
HistogramClear(histograms[i]);
|
800
|
+
}
|
801
|
+
|
802
|
+
for (i = 0; i < orig_histo_size; ++i) {
|
803
|
+
const int idx = symbols[i];
|
804
|
+
VP8LHistogramAdd(orig_histograms[i], histograms[idx], histograms[idx]);
|
805
|
+
}
|
806
|
+
}
|
807
|
+
|
808
|
+
static double GetCombineCostFactor(int histo_size, int quality) {
|
809
|
+
double combine_cost_factor = 0.16;
|
810
|
+
if (quality < 90) {
|
811
|
+
if (histo_size > 256) combine_cost_factor /= 2.;
|
812
|
+
if (histo_size > 512) combine_cost_factor /= 2.;
|
813
|
+
if (histo_size > 1024) combine_cost_factor /= 2.;
|
814
|
+
if (quality <= 50) combine_cost_factor /= 2.;
|
815
|
+
}
|
816
|
+
return combine_cost_factor;
|
817
|
+
}
|
818
|
+
|
819
|
+
int VP8LGetHistoImageSymbols(int xsize, int ysize,
|
820
|
+
const VP8LBackwardRefs* const refs,
|
821
|
+
int quality, int low_effort,
|
822
|
+
int histo_bits, int cache_bits,
|
823
|
+
VP8LHistogramSet* const image_histo,
|
824
|
+
VP8LHistogramSet* const tmp_histos,
|
825
|
+
uint16_t* const histogram_symbols) {
|
826
|
+
int ok = 0;
|
827
|
+
const int histo_xsize = histo_bits ? VP8LSubSampleSize(xsize, histo_bits) : 1;
|
828
|
+
const int histo_ysize = histo_bits ? VP8LSubSampleSize(ysize, histo_bits) : 1;
|
829
|
+
const int image_histo_raw_size = histo_xsize * histo_ysize;
|
830
|
+
const int entropy_combine_num_bins = low_effort ? NUM_PARTITIONS : BIN_SIZE;
|
831
|
+
|
832
|
+
// The bin_map for every bin follows following semantics:
|
833
|
+
// bin_map[n][0] = num_histo; // The number of histograms in that bin.
|
834
|
+
// bin_map[n][1] = index of first histogram in that bin;
|
835
|
+
// bin_map[n][num_histo] = index of last histogram in that bin;
|
836
|
+
// bin_map[n][num_histo + 1] ... bin_map[n][bin_depth - 1] = unused indices.
|
837
|
+
const int bin_depth = image_histo_raw_size + 1;
|
838
|
+
int16_t* bin_map = NULL;
|
839
|
+
VP8LHistogramSet* const orig_histo =
|
840
|
+
VP8LAllocateHistogramSet(image_histo_raw_size, cache_bits);
|
841
|
+
VP8LHistogram* cur_combo;
|
842
|
+
const int entropy_combine =
|
843
|
+
(orig_histo->size > entropy_combine_num_bins * 2) && (quality < 100);
|
844
|
+
|
845
|
+
if (orig_histo == NULL) goto Error;
|
846
|
+
|
847
|
+
// Don't attempt linear bin-partition heuristic for:
|
848
|
+
// histograms of small sizes, as bin_map will be very sparse and;
|
849
|
+
// Maximum quality (q==100), to preserve the compression gains at that level.
|
850
|
+
if (entropy_combine) {
|
851
|
+
const int bin_map_size = bin_depth * entropy_combine_num_bins;
|
852
|
+
bin_map = (int16_t*)WebPSafeCalloc(bin_map_size, sizeof(*bin_map));
|
853
|
+
if (bin_map == NULL) goto Error;
|
854
|
+
}
|
855
|
+
|
856
|
+
// Construct the histograms from backward references.
|
857
|
+
HistogramBuild(xsize, histo_bits, refs, orig_histo);
|
858
|
+
// Copies the histograms and computes its bit_cost.
|
859
|
+
HistogramCopyAndAnalyze(orig_histo, image_histo);
|
860
|
+
|
861
|
+
cur_combo = tmp_histos->histograms[1]; // pick up working slot
|
862
|
+
if (entropy_combine) {
|
863
|
+
const double combine_cost_factor =
|
864
|
+
GetCombineCostFactor(image_histo_raw_size, quality);
|
865
|
+
HistogramAnalyzeEntropyBin(orig_histo, bin_map, low_effort);
|
866
|
+
// Collapse histograms with similar entropy.
|
867
|
+
cur_combo = HistogramCombineEntropyBin(image_histo, cur_combo, bin_map,
|
868
|
+
bin_depth, entropy_combine_num_bins,
|
869
|
+
combine_cost_factor, low_effort);
|
870
|
+
}
|
871
|
+
|
872
|
+
// Don't combine the histograms using stochastic and greedy heuristics for
|
873
|
+
// low-effort compression mode.
|
874
|
+
if (!low_effort || !entropy_combine) {
|
875
|
+
const float x = quality / 100.f;
|
876
|
+
// cubic ramp between 1 and MAX_HISTO_GREEDY:
|
877
|
+
const int threshold_size = (int)(1 + (x * x * x) * (MAX_HISTO_GREEDY - 1));
|
878
|
+
cur_combo = HistogramCombineStochastic(image_histo,
|
879
|
+
tmp_histos->histograms[0],
|
880
|
+
cur_combo, quality, threshold_size);
|
881
|
+
if ((image_histo->size <= threshold_size) &&
|
882
|
+
!HistogramCombineGreedy(image_histo, cur_combo)) {
|
883
|
+
goto Error;
|
884
|
+
}
|
885
|
+
}
|
886
|
+
|
887
|
+
// TODO(vikasa): Optimize HistogramRemap for low-effort compression mode also.
|
888
|
+
// Find the optimal map from original histograms to the final ones.
|
889
|
+
HistogramRemap(orig_histo, image_histo, histogram_symbols);
|
890
|
+
|
891
|
+
ok = 1;
|
892
|
+
|
893
|
+
Error:
|
894
|
+
WebPSafeFree(bin_map);
|
895
|
+
VP8LFreeHistogramSet(orig_histo);
|
896
|
+
return ok;
|
897
|
+
}
|