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

Rough draft including ravif for AVIF encoding #1314

Merged
merged 6 commits into from
Sep 16, 2020

Conversation

HeroicKatora
Copy link
Member

@HeroicKatora HeroicKatora commented Sep 14, 2020

Converts the data to the Img buffer and encodes it into an intermediate vector, then writes this into the output writer. It tries to avoid actually allocating for that conversion. It considers that RGBA8 can be converted from any byte slice and uses the applicable conversion. Any non-rgba8 image is converted using an intermediate buffer. (cc: @fintelia) Some of this code may be used for the conversion feature as well.
However it does not support limits.

Closes: #1152

Probably should move these into a more central place where dispatch
logic lives, or into the upcoming color convert. Only the final step,
converting a byte slice to rgb::RGBA, is somewhat special.
@HeroicKatora HeroicKatora marked this pull request as ready for review September 15, 2020 21:37
@HeroicKatora
Copy link
Member Author

I have no idea how to test the encoding without depending on the availability of libavif/avifdec on the test system. For now, I've validated the images manually and it appears to work.. also note that ravif is of course tested itself.

@HeroicKatora HeroicKatora merged commit 8dcd08e into image-rs:master Sep 16, 2020
@HeroicKatora HeroicKatora deleted the ravif branch September 16, 2020 16:38
@kornelski
Copy link
Contributor

kornelski commented Sep 16, 2020

For testing:

  • to test just the MP4/HEIF structure, I wrote https://lib.rs/avif-parse It's pure Rust, cut-down fork of Firefox's mp4parse. It's pretty mature.

  • to test pixels decoded from AV1, I wrote https://lib.rs/aom-decode It needs cmake and builds libaom, so it's a relatively heavy dependency, and that crate is still in flux. Sadly, there's no pure-Rust AV1 decoder.

@HeroicKatora
Copy link
Member Author

@kornelski The pixel decoding would be more interesting, of course then also with full bindings, and the pure structure seems like a duplicated effort. I suppose we just wait here, any updates on the situation are appreciated.

@est31
Copy link
Contributor

est31 commented Sep 18, 2020

There is a partial rewrite of dav1d in https://github.com/rainliu/rav1d/ but it yielded an error no matter which image I gave it.

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.

Support AVIF (AV1 Image FIle Format)
3 participants