zenrav1e 0.1.0

AV1 encoder optimized for still and animated AVIF images (Imazen fork of rav1e)
Documentation

zenrav1e

crates.io docs.rs license

AV1 encoder optimized for still and animated AVIF images. Fork of rav1e by Imazen.

Fork of rav1e

All changes are additive on top of upstream rav1e.

Encoding features

  • Quantization matrices — frequency-dependent quantization weights, ~10% BD-rate improvement
  • Filter intra prediction — 5 recursive filter modes, auto-enabled at speed <= 6
  • Trellis quantization — Viterbi DP with CDF-based rate estimation and quality-adaptive dampening
  • Variance adaptive quantization (VAQ) — configurable strength parameter
  • Tune::StillImage mode — tuning preset for photographic content
  • Lossless mode — mathematically lossless encoding via quantizer: 0
  • Cooperative cancellationenough::Stop support behind the stop feature

Modernization

  • Rust 2024 edition (MSRV 1.88)
  • safe_unaligned_simd for safe SIMD load/store in entropy coding

All upstream rav1e video encoding capabilities are preserved.

Usage

zenrav1e is a library. If you want to encode AVIF images, use ravif or zenavif, which wrap zenrav1e with a higher-level API.

For direct use:

use zenrav1e::prelude::*;

let mut enc = EncoderConfig::default();
enc.width = 640;
enc.height = 480;
enc.speed_settings = SpeedSettings::from_preset(6);
enc.still_picture = true;
enc.enable_qm = true;  // quantization matrices

let cfg = Config::new().with_encoder_config(enc);
let mut ctx: Context<u8> = cfg.new_context().unwrap();
// send frames, receive packets...

Building

# Pure Rust (no asm) — primary development target
cargo check --no-default-features --features threading
cargo test --no-default-features --features threading

# With x86_64 asm (requires nasm)
cargo check --features threading

Requires Rust 1.88+. The asm feature needs NASM 2.14.02+ on x86_64.

License

BSD-2-Clause, same as upstream rav1e. See LICENSE and PATENTS.