zenrav1e
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 cancellation —
enough::Stopsupport behind thestopfeature
Modernization
- Rust 2024 edition (MSRV 1.88)
safe_unaligned_simdfor 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 *;
let mut enc = default;
enc.width = 640;
enc.height = 480;
enc.speed_settings = from_preset;
enc.still_picture = true;
enc.enable_qm = true; // quantization matrices
let cfg = new.with_encoder_config;
let mut ctx: = cfg.new_context.unwrap;
// send frames, receive packets...
Building
# Pure Rust (no asm) — primary development target
# With x86_64 asm (requires nasm)
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.