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

libavif: enable encoding support #42438

Merged
merged 3 commits into from
Apr 6, 2023
Merged

libavif: enable encoding support #42438

merged 3 commits into from
Apr 6, 2023

Conversation

oreo639
Copy link
Member

@oreo639 oreo639 commented Feb 25, 2023

Testing the changes

  • I tested the changes in this PR: briefly

Allows tests to pass for #42426

@lemmi
Copy link
Member

lemmi commented Feb 25, 2023

Oh, so that was missing for darktable be able to export to avif. But I was wondering whether multiple encoders need to be enabled. I just glanced at the cmake file and didn't actually try and see what happens if only a single encoder is available:

-- Checking for module 'rav1e'
--   Found rav1e, version 0.6.3
-- Found rav1e: /usr/lib/librav1e.so (found version "0.6.3")
-- libavif: Codec enabled: rav1e (encode)
-- Checking for module 'SvtAv1Enc'
--   Found SvtAv1Enc, version 1.4.1
-- Found svt: /usr/lib/libSvtAv1Enc.so (found version "1.4.1")
-- libavif: Codec enabled: svt (encode)
-- Checking for module 'aom'
--   Found aom, version 3.5.0
-- Found aom: /usr/lib/libaom.so (found version "3.5.0")
-- libavif: Codec enabled: aom (encode/decode)

@oreo639
Copy link
Member Author

oreo639 commented Feb 25, 2023

You can specify the encoder you want to use:
https://github.com/AOMediaCodec/libavif/blob/647c3c208cf152395d777c1bf7240d2ecf7df5a9/include/avif/avif.h#L707-L715

https://github.com/AOMediaCodec/libavif/blob/f4a963865bab5edf004b670f2c9defe389087545/apps/avifenc.c#L1286-L1300

For example, the kimageformats test expect libaom and fail when comparing the image binary output to what is expected if aom is not provided.

libaom is the most important since it is necessary for lossless, enabling rav1e and libsvt-av1 allows people to use them through libavif.

@lemmi
Copy link
Member

lemmi commented Feb 25, 2023

darktable takes a ridiculous amount of time (several minutes) to export an image. I used avifenc to see what's up and the libaom codec seemed to perform ok, while the rav1e also took considerably longer with default settings. Wasn't able to test svt, since it only works on yuv420.
So, I'm still not sure what the value of the other codecs is, but I'm happy I can enable the avif format once this is merged.

@oreo639
Copy link
Member Author

oreo639 commented Feb 25, 2023

You are right, rav1e is slower than libaom. My bad.

@oreo639 oreo639 force-pushed the rav1e branch 2 times, most recently from a51aad3 to c945583 Compare April 3, 2023 08:22
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.

None yet

2 participants