Skip to content

Add an AVIF decoder #1398

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

Merged
merged 3 commits into from
Jan 28, 2021
Merged

Add an AVIF decoder #1398

merged 3 commits into from
Jan 28, 2021

Conversation

linkmauve
Copy link
Contributor

@linkmauve linkmauve commented Jan 14, 2021

This encoder so far only supports 8-bit data, and due to #1217 is much less efficient than it could be, as data is always converted to BGRA8888. I could also add support for I8 and IA88, but those formats are uncommon enough we can probably ignore the inefficiency for a first version.

This is 5am quality code, so no error handling but .unwrap(), and there are some unsafe blocks which could possibly be avoided, I will get back to it after a first round of review.

This also depends on mozilla/mp4parse-rust#266 to build.

Fixes #1152.

@linkmauve linkmauve marked this pull request as draft January 14, 2021 03:59
linkmauve added a commit to linkmauve/mp4parse-rust that referenced this pull request Jan 14, 2021
Copy link
Member

@197g 197g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of unsafe in decoder is not yet very reassuring, particularly without safety comments. If that combination, deriving a slice from the plane_data_ptr and plane_data_geometry, is always safe then I'm wondering why this is not an abstraction provided in the dav1d crate?

@linkmauve linkmauve force-pushed the avif-decoder branch 2 times, most recently from 84c72fe to 4aa5e27 Compare January 18, 2021 14:32
@linkmauve
Copy link
Contributor Author

There, both the mp4parse and dav1d crates got a release, I’ve updated this PR to use the non-git version.

@linkmauve linkmauve marked this pull request as ready for review January 26, 2021 22:17
Copy link
Member

@197g 197g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, there is only this one annoying interface detail we have to worry about.

Copy link
Member

@197g 197g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion. Misclicked. The one review comment previously is already correct.

@197g 197g merged commit 80bfbb6 into image-rs:master Jan 28, 2021
@197g
Copy link
Member

197g commented Jan 28, 2021

Thanks a lot. ETA: next weekend.

@linkmauve linkmauve deleted the avif-decoder branch January 28, 2021 22:12
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.

Support AVIF (AV1 Image FIle Format)
3 participants