Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heifsave: expose libheif/aom auto_tiles feature #4191

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

lovell
Copy link
Member

@lovell lovell commented Oct 11, 2024

I realise we don't want to expose every single possible underlying encoder feature, however given the relatively poor encoding times of AVIF images this one feels like the most useful addition to libaom I've seen in a while.

The auto_tiles property allows the aom encoder to determine the optimum tile count based on the output dimensions and available threads, which in my testing seriously improves multi-core utilisation. Elapsed time is almost halved in some cases. There are claims it reduces memory usage but I've not found much evidence of this yet. The cost of all this is very slightly increased file sizes, mostly from the additional metadata.

The upstream PR for this was strukturag/libheif#1330 (requires libaom v3.10.0+ and the forthcoming libheif v1.18.3+).

Allows the aom encoder to determine the optimum tile count based
on the output dimensions and available threads. This can improve
multi-core utilisation, reducing processing time and/or memory
usage at the cost of slightly increased file sizes.
@jcupitt jcupitt merged commit 199f024 into libvips:master Oct 11, 2024
6 checks passed
@jcupitt
Copy link
Member

jcupitt commented Oct 11, 2024

Sure, that sounds like a very useful speedup.

I'll update ChangeLog and the 8.16 release notes.

@lovell lovell deleted the heifsave-auto-tiles branch October 11, 2024 15:51
@jcupitt
Copy link
Member

jcupitt commented Oct 12, 2024

Sorry, I was thinking about this overnight. If the filesize increase is very small, how about we just enable this by default?

@lovell
Copy link
Member Author

lovell commented Oct 12, 2024

Yes, I like that idea. I guess there's a possibility for artefacts to be introduced along the edges of tiles but I didn't notice this in my testing.

jcupitt added a commit that referenced this pull request Oct 12, 2024
just turn it on by default

see #4191 (comment)
@jcupitt
Copy link
Member

jcupitt commented Oct 12, 2024

OK, I made it always on.

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

Successfully merging this pull request may close these issues.

2 participants