Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

enable re_rav1d by default for avif decoding #2621

Open
@valarauca

Description

I would like to be able ...

Decode avif images without having to fight pkg-config, ninja, meson, and vckpg to build this crate on Microsoft-Windows.

My specific use case for this functionality is ...

Decoding avif images on Microsoft Windows.

This is more generally applicable to ...

Anyone who wants to use this crate & decode avif images on Windows.

Draft

re_rav1d::dav1d is full compatible with the dav1d crate, as its API is a fork.

I've managed to get this to build with the following operation:

$ git clone https://github.com/image-rs/image
$ cd image
# Update our Cargo.toml
$ sed -i '59i re_rav1d = { version = "0.1.3", optional = true }' Cargo.toml 
$ sed -i 's/nasm = \["ravif?\/asm"\]/nasm = ["ravif?\/asm", "re_rav1d?\/asm"]/' Cargo.toml
$ sed -i 's/avif-native = \["dep:mp4parse", "dep:dav1d"\]/avif-native = ["dep:dav1d"]/' Cargo.toml
$ sed -i 's/avif = \["dep:ravif", "dep:rgb"\]/avif = ["dep:ravif", "dep:rgb", "dep:re_rav1d", "dep:mp4parse"]/' Cargo.toml

Then src/codecs/av1f/decoder.rs is updated to the import statement becomes

#[cfg(all(feature = "avif", not(feature = "avif-native")))]
use re_rav1d::dav1d::{PixelLayout, PlanarImageComponent};
#[cfg(all(feature = "avif", not(feature = "avif-native")))]
use re_rav1d::dav1d;
#[cfg(all(feature = "avif", feature = "avif-native"))]
use dav1d::{PixelLayout, PlanarImageComponent};
#[cfg(all(feature = "avif", feature = "avif-native"))]
use dav1d::{self};

To ensure there is always a dav1d prefix.

It seems to just work provided you update the src/codecs/av1f/mod.rs #feature gates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /