Files
craft-libs/crates/video/tests/av1_decode/adhoc.rs
Dylan M. Taylor 16564be34b craft-video: AV1 decoder from FilmCraft, with DeckCraft's hardening (av1-decode) (#836)
* craft-video: AV1 decoder from FilmCraft (`av1-decode` feature)

FilmCraft's crates/av1 at 4c0d2ad7 becomes craft_video::av1::decode. The encoder moves to
av1/encode and is still exported from craft_video::av1. Feature av1 now turns on av1-decode and
av1-encode, so either half can be built without the other.

The ignored speed tests no longer read the thread CPU clock (FilmCraft used rustix for it).
craft_video::budget (the picture memory budget from DeckCraft's bitstream crate) is added for the
next commit. craft-video is built at opt-level 3 in the dev profile, as FilmCraft built its
codecs.

* craft-video: AV1 decoder hardening from DeckCraft's copy

- The picture store (eight reference slots, the new frame, frames in flight) is checked against
  a memory budget before a frame is allocated; Decoder::set_memory_budget.
- Non-uniform tile spacing is refused past MAX_TILE_COLS columns or MAX_TILE_ROWS rows.

* craft-video: AV1 fuzz seeds are 64x64 so SVT-AV1 2.x can encode them

FilmCraft's seeds were 64x48; the SVT-AV1 2.3 on the Ubuntu runners refuses a source under 64
lines, and an encoder that exists but fails is a test failure, not a skip.
2026-11-11 17:43:10 -05:00

26 lines
959 B
Rust

//! Compare an arbitrary IVF file with libdav1d:
//! `AV1_IVF=/path/x.ivf AV1_PIX=yuv420p cargo test -p craft-video --features av1-decode,threads --test av1_decode adhoc:: -- --ignored --nocapture`
use crate::common;
use common::*;
#[test]
#[ignore]
fn adhoc_compare() {
let Some(ff) = ffmpeg_dav1d() else { return };
let Some(path) = std::env::var_os("AV1_IVF") else { return };
let path = std::path::PathBuf::from(path);
let pics = decode_all(&path).unwrap();
let pix = pix_fmt_for(&pics[0]).to_string();
let raw = reference(&ff, &path, &pix);
let per = picture_samples(&pics[0]);
println!("{} pictures, reference has {} frames", pics.len(), raw.len() / per);
for (i, p) in pics.iter().enumerate() {
if (i + 1) * per > raw.len() {
break;
}
let (first, count) = compare(p, &raw[i * per..(i + 1) * per]);
println!("frame {i}: {} mismatches, first {:?}", count, first);
}
}