forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

gen-hevc-rext-fixtures.sh35 lines, 1.7 KiBHistoryRawDownload
1#!/usr/bin/env bash
2# gen-hevc-rext-fixtures.sh — regenerate crates/ec-h265/tests/data/rext/*.265 and their .md5.
3#
4# Each stream is synthetic (ffmpeg lavfi testsrc2 plus temporal noise, no personal media),
5# encoded by libx265 in one RExt pixel format with one set of tool switches. The sidecar .md5
6# is the MD5 of ffmpeg's own decode of the stream as raw planar samples (8-bit: 1 byte,
7# above 8 bits: 2 bytes little endian). The ec-h265 test `rext_generated` decodes the stream
8# and must match that MD5.
9#
10# Usage: scripts/gen-hevc-rext-fixtures.sh [outdir] (needs ffmpeg with libx265)
11set -euo pipefail
12ROOT=$(cd -- "$(dirname -- "$0")/.." && pwd)
13OUT=${1:-$ROOT/crates/ec-h265/tests/data/rext}
14mkdir -p "$OUT"
15SRC=(-f lavfi -i "testsrc2=size=128x96:rate=25,noise=alls=8:allf=t" -frames:v 6)
16
17gen() { # name pix_fmt x265-params
18 local name=$1 fmt=$2 params=$3
19 ffmpeg -v error -y "${SRC[@]}" -pix_fmt "$fmt" -c:v libx265 -preset fast \
20 -x265-params "log-level=error:$params" -f hevc "$OUT/$name.265"
21 ffmpeg -v error -y -i "$OUT/$name.265" -f rawvideo -pix_fmt "$fmt" - | md5sum | cut -d' ' -f1 \
22 >"$OUT/$name.md5"
23 echo "$name $fmt $(stat -c %s "$OUT/$name.265") bytes"
24}
25
26BASE="keyint=8:bframes=2:weightp=1:weightb=1:qp=22"
27for f in yuv444p yuv444p10le yuv444p12le yuv422p yuv422p10le yuv422p12le gray gray10le gray12le; do
28 gen "gen_${f}" "$f" "$BASE"
29done
30# Tool switches on the formats that matter.
31for f in yuv444p yuv444p10le yuv422p10le yuv444p12le; do
32 gen "tskip_${f}" "$f" "$BASE:tskip=1:tskip-fast=0:rect=1:amp=1:sao=1"
33 gen "lossless_${f}" "$f" "keyint=8:bframes=2:lossless=1"
34 gen "wpp_${f}" "$f" "$BASE:wpp=1:constrained-intra=1:strong-intra-smoothing=0"
35done