Commit 4db518c3 authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato
Browse files

Add optional ivf dumping to dav1d

parent ab1e40ff
......@@ -16,6 +16,7 @@ binaries = ["ivf", "y4m", "clap", "scan_fmt"]
default = ["binaries", "nasm"]
aom = ["cmake"]
nasm = ["nasm-rs"]
dump_ivf = ["ivf"]
[dependencies]
bitstream-io = "0.8"
......
......@@ -312,6 +312,12 @@ fn encode_decode(
ctx.set_limit(limit as u64);
println!("Encoding {}x{} speed {} quantizer {}", w, h, speed, quantizer);
#[cfg(feature="dump_ivf")]
let mut out = std::fs::File::create(&format!("out-{}x{}-s{}-q{}-{:?}.ivf",
w, h, speed, quantizer, chroma_sampling)).unwrap();
#[cfg(feature="dump_ivf")]
ivf::write_ivf_header(&mut out, w, h, 30, 1);
let mut rec_fifo = VecDeque::new();
......@@ -324,6 +330,8 @@ fn encode_decode(
let res = ctx.receive_packet();
if let Ok(pkt) = res {
println!("Encoded packet {}", pkt.number);
#[cfg(feature="dump_ivf")]
ivf::write_ivf_frame(&mut out, pkt.number, &pkt.data);
if let Some(pkt_rec) = pkt.rec {
rec_fifo.push_back(pkt_rec.clone());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment