Files
Immich/native
Santo Shakilandmertalev b3414d7595 feat(mobile): avif decoder (#32809)
* feat(mobile): avif decoder

* decode avif in the core first on android, tone-map hdr like jxl and support premultiplied alpha

* decode avif with rav1d's safe api

* use rav1d's assembly

* thread avif decodes by their tile count

* convert colour-managed avif in bands

* use the codec dependencies' simd kernels

* free avif pictures before resizing

* map avif alpha through a table

* premultiply avif while writing alpha

* drop the avif container after decoding

* use core avif decoder on ios

* fall back to imageio on ios when the core can't decode an avif

---------

Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
2026-11-06 21:35:53 +03:00
..
2026-10-24 11:52:05 +03:00
2026-10-31 07:22:45 +03:00
2026-11-06 21:35:53 +03:00
2026-11-06 21:35:53 +03:00
2026-11-06 21:35:53 +03:00
2026-11-06 21:35:53 +03:00

Native core

Rust code that ships inside the mobile app. Flutter compiles it from source through the native_core build hook, so building the app needs a Rust toolchain: mise install in mobile/ sets one up, otherwise install rustup once and the build fetches the pinned toolchain itself.

  • crates/codecs: the image decoders, a feature each, behind one decode
  • crates/native_core: the shared logic, a feature per part and a group per target
  • crates/native_core_ffi: the C ABI on the flutter group, cbindgen writes include/native_core.h
  • native_core: Flutter package with the build hook and the ffigen bindings (NOTICES carries the licenses of the crates compiled into the core, update it with the dependencies)

mise run build, test, lint, and fmt. The header and the Dart bindings come from mise run //mobile:codegen:native.