Closed FreezyLemon closed 1 year ago
I'm good with this, I'd maybe enable webp as well since it's become more commonly used.
Supporting openexr/exr and the hdr image formats is probably a good idea for being able to compare HDR video.
tiff support might also be useful as converting videos to tiff can be faster than png. (34fps for png and 180fps for tiff in a quick ffmpeg test)
@BuyMyMojo For videos, the video feature should be more convenient than converting to a frame sequence and comparing each frame pair via ssimulacra2_rs image ref dst
.
Or are there any limitations to running ssimulacra2_rs video ref dst
that image comparisons would work around? In that case, it might be better to implement those things in video mode too.
for quick comparisons, I prefer to make single image comparisons before doing video clips because of the compute time ssimulacra2 takes so having HDR support for the image mode is very helpful
Okay I readded those. Though it did add back in a few dependencies, not surprisingly.
The default feature list of
image
is[bmp, dds, default, dxt, exr, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, openexr, png, pnm, scoped_threadpool, tga, tiff, webp]
.I'd argue that a lot of these are not needed.
These features significantly bloat the binary size (6.2MiB / 3.6MiB -> 4.4MiB / 2.1MiB, unstripped / stripped, respectively) and also increase the build time in release mode a lot. The reason for this seems to be that the release profile uses
codegen-units=1
. Reducing the feature matrix above to just[png, jpeg]
(like in this PR) reduces the build time for theimage
crate from ~16.7 seconds to 5.4. This results in roughly 50% time saved when building the entire project. The difference for debug builds is a lot smaller.I'm open to discussion on what formats to "eliminate", but the default case is overkill IMHO. PNG and JPEG probably covers most use cases.
BTW: The original ssimulacra2 project only supports PNG input, as far as I'm aware.