Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.cargo/ | 25-Apr-2025 | - | 3 | 2 | ||
.github/workflows/ | 25-Apr-2025 | - | 437 | 349 | ||
c_api_tests/ | 25-Apr-2025 | - | 4,834 | 4,134 | ||
examples/ | 25-Apr-2025 | - | 136 | 98 | ||
external/ | 25-Apr-2025 | - | 20 | 15 | ||
include/avif/ | 25-Apr-2025 | - | 730 | 557 | ||
src/ | 25-Apr-2025 | - | 14,161 | 11,895 | ||
sys/ | 25-Apr-2025 | - | 880 | 550 | ||
tests/ | 25-Apr-2025 | - | 3,884 | 3,451 | ||
.gitignore | D | 25-Apr-2025 | 347 | 19 | 18 | |
.rustfmt.toml | D | 25-Apr-2025 | 413 | 19 | 18 | |
Android.bp | D | 25-Apr-2025 | 2.5 KiB | 115 | 107 | |
CONTRIBUTING.md | D | 25-Apr-2025 | 1.1 KiB | 34 | 22 | |
Cargo.toml | D | 25-Apr-2025 | 1.1 KiB | 53 | 44 | |
LICENSE | D | 25-Apr-2025 | 11.1 KiB | 203 | 169 | |
METADATA | D | 25-Apr-2025 | 684 | 22 | 20 | |
MODULE_LICENSE_APACHE2 | D | 25-Apr-2025 | 0 | |||
OWNERS | D | 25-Apr-2025 | 71 | 3 | 2 | |
README.md | D | 25-Apr-2025 | 2.2 KiB | 91 | 72 | |
build.rs | D | 25-Apr-2025 | 1.5 KiB | 44 | 26 | |
cargo-config.toml | D | 25-Apr-2025 | 582 | 8 | 6 | |
cbindgen.toml | D | 25-Apr-2025 | 2.1 KiB | 63 | 58 |
README.md
1# Crabby Avif 2 3Avif parser/decoder implementation in Rust. 4 5Feel free to file an issue for any question, suggestion or bug report. 6Contributions are also welcome, see [CONTRIBUTING](CONTRIBUTING.md). 7 8## Features 9 * Supports dav1d, libgav1 or android mediacodec as the underlying AV1 decoder. 10 * C API compatible with [libavif](https://github.com/aomediacodec/libavif) 11 * ..and more 12 13## Build 14 15```sh 16git clone https://github.com/webmproject/CrabbyAvif.git 17# If dav1d system library can be found with pkg-config, this step can be skipped. 18cd CrabbyAvif/sys/dav1d-sys 19./dav1d.cmd 20# If libyuv system library can be found with pkg-config, this step can be skipped. 21cd ../libyuv-sys 22./libyuv.cmd 23cd ../.. 24cargo build 25``` 26 27## Tests 28 29```sh 30cargo test -- --skip test_conformance 31``` 32 33### Conformance Tests 34 35```sh 36git clone https://github.com/AOMediaCodec/av1-avif.git external/av1-avif 37git clone https://github.com/AOMediaCodec/libavif.git external/libavif 38cd external/libavif/ext 39./dav1d.cmd 40cd .. 41cmake -S . -B build -DAVIF_CODEC_DAV1D=LOCAL -DAVIF_LIBYUV=OFF -DAVIF_BUILD_APPS=ON 42cmake --build build --parallel -t avifdec 43cd ../.. 44cargo test -- test_conformance 45``` 46 47If you already have the `av1-avif` repository checked out and the `avifdec` 48binary available, you can point to those by setting the following environment 49variables: 50 51``sh 52CRABBYAVIF_CONFORMANCE_TEST_DATA_DIR=<path> CRABBYAVIF_CONFORMANCE_TEST_AVIFDEC=<avifdec_binary> cargo test -- test_conformance 53`` 54 55### C API Tests 56 57```sh 58# Build google test 59cd external 60./googletest.cmd 61cd .. 62# Build the library with C API enabled 63cargo build --features capi --release 64# Build and run the C/C++ Tests 65mkdir c_build 66cd c_build 67cmake ../c_api_tests/ 68make 69make test 70``` 71 72### Android Tests 73 74The decoder tests can be run on Android using [dinghy](https://crates.io/crates/cargo-dinghy). 75 76```sh 77# One time set up 78cargo install cargo-dinghy 79# Set path to NDK 80export ANDROID_NDK_HOME=<path_to_ndk> 81# Install rust toolchain for target 82rustup target add aarch64-linux-android 83# End of One time set up 84# Make sure the device/emulator is available via adb. 85cargo dinghy -d android test --no-default-features --features android_mediacodec,libyuv --target aarch64-linux-android --test decoder_tests 86``` 87 88## License 89 90See the [Apache v2.0 license](LICENSE) file. 91