Skip to content

Conversation

@cmb69
Copy link
Member

@cmb69 cmb69 commented Dec 22, 2024

libheif currently supports x265 and kvazaar for encoding HEIC images; while the former is recommended, the latter has a more liberal license, and as such is an interesting alternative. However, kvazaar apparently does not yet support changing the chroma subsampling, and as such, writing HEIC images fails. We apply basically the same fix as for libheif < 1.9.0, where we just ignore the given chroma subsampling, and use whatever the encoder deems suitable (likely 420).

[1] https://github.com/strukturag/libheif?tab=readme-ov-file#compiling


Note that this fixes tests/heif/bug788 for me, and let's tests/heif/heif_im2im proceed (it now only fails due to pixel differences; likely that would happen with older libheif, too).

Also note that comparing the plugin name might be a bit brittle, but comparing the plugin ID might be too, and seems to require more ado, so maybe we're good comparing the name.

Since we support HEIF encoding not only with HEVC, but also with AV1, it seems to prudent to check whether the AV1 encoders supported by libheif (currently AOM, rav1e, and svt-av1), work as expected, or show similar limitations as kvazaar (chroma subsampling is supported by all three, but there may be other limitations).

cc @YakoYakoYokuYoku

libheif currently supports x265 and kvazaar for encoding HEIC images;
while the former is recommended, the latter has a more liberal license,
and as such is an interesting alternative.  However, kvazaar apparently
does not yet support changing the chroma subsampling, and as such,
writing HEIC images fails.  We apply basically the same fix as for
libheif < 1.9.0, where we just ignore the given chroma subsampling, and
use whatever the encoder deems suitable (likely 420).

[1] <https://github.com/strukturag/libheif?tab=readme-ov-file#compiling>
@cmb69
Copy link
Member Author

cmb69 commented Dec 22, 2024

The Ubuntu and macOS CI failures are unrelated; the Windows CI failure might be related, though. Need to check.

@cmb69 cmb69 marked this pull request as draft December 22, 2024 12:39
@cmb69
Copy link
Member Author

cmb69 commented Dec 22, 2024

I can reproduce locally with https://github.com/libgd/libgd-windows-vcpkg-prebuild; looks like a bad build (see strukturag/libheif#357 (comment)). No way to work around this. I think we need to update the dependencies for Windows anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant