A seat for hardware HEVC, and a run that may keep its file
Browse files at this commit57f67217b6bcbce9ff753aa667c39e31a3504e49Parent: bacbe9f- chore
- a seat for hardware HEVC, and a run that may keep its file
2 changed files +14 -4
- crates/engine/examples/bench.rs +13 -3
- scripts/bench.sh +1 -1
crates/engine/examples/bench.rsmodified+13 -3
| @@ -26,7 +26,8 @@ | ||
| 26 | 26 | //! first frame, `BENCH_EXPORT_CAP` (s, default 300) the wall clock any single |
| 27 | 27 | //! export measurement may take, `BENCH_EXPORT_REPS` (default 5) how many times |
| 28 | 28 | //! an export is repeated *if the cap leaves room* -- a 4K encode gets one |
| 29 | -//! capped rep, the small control gets five. | |
| 29 | +//! capped rep, the small control gets five -- and `BENCH_KEEP` (unset) whether | |
| 30 | +//! the exported file survives the run instead of being deleted with the number. | |
| 30 | 31 | |
| 31 | 32 | use std::path::{Path, PathBuf}; |
| 32 | 33 | use std::time::{Duration, Instant}; |
| @@ -63,7 +64,7 @@ fn usage() -> ! { | ||
| 63 | 64 | eprintln!( |
| 64 | 65 | "usage: bench open <file>\n bench seek <file> <secs>\n \ |
| 65 | 66 | bench scrub <file>\n bench waveform <file>\n \ |
| 66 | - bench export <file> <h264sw|h264hw|av1|hevc> <out_dir>" | |
| 67 | + bench export <file> <h264sw|h264hw|av1|hevc|hevchw> <out_dir>" | |
| 67 | 68 | ); |
| 68 | 69 | std::process::exit(2) |
| 69 | 70 | } |
| @@ -356,7 +357,11 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) { | ||
| 356 | 357 | "h264sw" => (Format::Mp4, true), |
| 357 | 358 | "h264hw" => (Format::Mp4, false), |
| 358 | 359 | "av1" => (Format::Av1, true), |
| 360 | + // `hevc` keeps meaning the software intra seat, so a row measured | |
| 361 | + // against an older baseline still compares with the one beside it; the | |
| 362 | + // GPU seat is the new name. | |
| 359 | 363 | "hevc" => (Format::Hevc, true), |
| 364 | + "hevchw" => (Format::Hevc, false), | |
| 360 | 365 | _ => usage(), |
| 361 | 366 | }; |
| 362 | 367 | let metric = format!("export_fps_{seat}"); |
| @@ -426,7 +431,12 @@ fn export_bench(path: &Path, seat: &str, out_dir: &Path) { | ||
| 426 | 431 | } |
| 427 | 432 | let seats = handle.encoders().unwrap_or_else(|| "?".into()); |
| 428 | 433 | let outcome = handle.result(); |
| 429 | - let _ = std::fs::remove_file(&out); | |
| 434 | + // A throughput run leaves nothing behind; `BENCH_KEEP=1` keeps the last | |
| 435 | + // one, which is how a seat is checked for *decodability* rather than | |
| 436 | + // speed (`ffprobe -count_frames` on the file it wrote). | |
| 437 | + if std::env::var_os("BENCH_KEEP").is_none() { | |
| 438 | + let _ = std::fs::remove_file(&out); | |
| 439 | + } | |
| 430 | 440 | if capped { |
| 431 | 441 | samples.push(progress * f64::from(span) / elapsed); |
| 432 | 442 | notes.push(format!("CAPPED at {:.0}s, {:.0}% done, {seats}", elapsed, progress * 100.0)); |
scripts/bench.shmodified+1 -1
| @@ -98,7 +98,7 @@ for file in "${files[@]}"; do | ||
| 98 | 98 | run 1800 "seek_ttff_${t}s" "$file" seek "$t" |
| 99 | 99 | done |
| 100 | 100 | run 3600 scrub "$file" scrub |
| 101 | - for seat in h264sw h264hw av1 hevc; do | |
| 101 | + for seat in h264sw h264hw av1 hevc hevchw; do | |
| 102 | 102 | run "$export_limit" "export_fps_$seat" "$file" export "$seat" "$OUT_DIR" |
| 103 | 103 | done |
| 104 | 104 | done |