forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiBe12d32fTahinli6 days ago3982 commits

vp9-bench.sh31 lines, 1.2 KiBHistoryRawDownload
1#!/usr/bin/env bash
2# vp9-bench.sh: ec-vp9 decode throughput sweep. Run on a server through remote-run.sh.
3#
4# Usage: scripts/vp9-bench.sh [clip.ivf ...]
5# Builds the decode_ivf example in release, then decodes each clip at 1, 2 and 4 tile
6# threads. With no arguments it uses tile1080.ivf (fixtures/vp9-bench) and a libvpx-encoded
7# 1080p30 testsrc2 clip with 4 tile columns, encoded here with ffmpeg.
8# Prints one line per run: clip threads fps digest.
9set -euo pipefail
10cd "$(dirname "$0")/../crates/ec-vp9"
11cargo build --release --example decode_ivf 2>&1 | tail -1
12bin=$(cd ../.. && pwd)/target/release/examples/decode_ivf
13[ -x "$bin" ] || bin=${CARGO_TARGET_DIR:-../../target}/release/examples/decode_ivf
14tmp=${TMPDIR:-/tmp}/vp9bench
15mkdir -p "$tmp"
16clips=("$@")
17if [ ${#clips[@]} -eq 0 ]; then
18 clips=("$HOME/fixtures/vp9-bench/tile1080.ivf")
19 if [ ! -s "$tmp/tile4-1080p30.ivf" ]; then
20 ffmpeg -v error -y -f lavfi -i testsrc2=size=1920x1080:rate=30 -t 10 \
21 -c:v libvpx-vp9 -tile-columns 2 -row-mt 1 -b:v 4M -deadline realtime -cpu-used 8 \
22 "$tmp/tile4-1080p30.ivf"
23 fi
24 clips+=("$tmp/tile4-1080p30.ivf")
25fi
26for clip in "${clips[@]}"; do
27 for t in 1 2 4; do
28 line=$("$bin" "$clip" "$t")
29 echo "$(basename "$clip") threads=$t $line"
30 done
31done