forge
Explore
Log in

Don't you dare go Hollow

Error map generalised to any gate source

Browse files at this commit

19ef3ae00b46e38d0c440e42a065c97b4e144acaAhmet Kaan GümüşParent: f521fd8
  • test
    • error map generalised to any gate source
Show full message
test(opus-reell/r3): error map generalised to any gate source

her_err_map_96k -> err_map_vs_libopus; EC_ERRMAP_SRC / EC_ERRMAP_KBPS /
EC_ERRMAP_TAG select source, rate and output file, her@96 defaults kept.
crates/ec-opus/tests/conformance.rsmodified+12 -6
@@ -5282,31 +5282,37 @@ fn short_block_bits_vs_libopus() {
5282 // error share) are printed with our encoder flags plus both encoders' coded5282 // error share) are printed with our encoder flags plus both encoders' coded
5283 // decisions — libopus's packets decoded with our decoder, the reell-r2 method.5283 // decisions — libopus's packets decoded with our decoder, the reell-r2 method.
5284 // Frame mapping is in source-sample time (±1 frame of codec delay).5284 // Frame mapping is in source-sample time (±1 frame of codec delay).
5285-// Output: lanes/opus-her-r1.map.txt. HER_KBPS overrides the rate (default 96).5285+// Output: lanes/<EC_ERRMAP_TAG>.map.txt (default `opus-her-r1`). HER_KBPS (or
5286+// EC_ERRMAP_KBPS) overrides the rate, EC_ERRMAP_SRC the source file: the map is
5287+// the same analysis for any row of the library gate, not just her@96.
5286 // ---------------------------------------------------------------------------5288 // ---------------------------------------------------------------------------
5287 5289
5288 #[test]5290 #[test]
5289 #[ignore]5291 #[ignore]
5290-fn her_err_map_96k() {5292+fn err_map_vs_libopus() {
5291 const SECS: f64 = 120.0;5293 const SECS: f64 = 120.0;
5292 const FRAME: usize = 960;5294 const FRAME: usize = 960;
5293 const CH: usize = 2;5295 const CH: usize = 2;
5294 const HOP: usize = 120; // WIN_STEP: one opus_compare hop = 2.5 ms5296 const HOP: usize = 120; // WIN_STEP: one opus_compare hop = 2.5 ms
5295 const HOPS_PER_WIN: usize = 48_000 / HOP; // 1 s window = 400 hops5297 const HOPS_PER_WIN: usize = 48_000 / HOP; // 1 s window = 400 hops
5296- let kbps_env: u32 = std::env::var("HER_KBPS")5298+ let kbps_env: u32 = std::env::var("EC_ERRMAP_KBPS")
5299+ .or_else(|_| std::env::var("HER_KBPS"))
5297 .ok()5300 .ok()
5298 .and_then(|v| v.parse().ok())5301 .and_then(|v| v.parse().ok())
5299 .unwrap_or(96);5302 .unwrap_or(96);
5303+ let tag = std::env::var("EC_ERRMAP_TAG").unwrap_or_else(|_| "opus-her-r1".to_string());
5300 5304
5301- let src = shellexpand("~/Music/reeli.mp3");5305+ let src = shellexpand(
5306+ &std::env::var("EC_ERRMAP_SRC").unwrap_or_else(|_| "~/Music/reeli.mp3".to_string()),
5307+ );
5302 if !src.exists() {5308 if !src.exists() {
5303 eprintln!("SKIP: missing {}", src.display());5309 eprintln!("SKIP: missing {}", src.display());
5304 return;5310 return;
5305 }5311 }
5306 let lanes_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes");5312 let lanes_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes");
5307 fs::create_dir_all(&lanes_dir).unwrap();5313 fs::create_dir_all(&lanes_dir).unwrap();
5308- let scratch = lanes_dir.join("opus-her-r1.scratch.ogg");5314+ let scratch = lanes_dir.join(format!("{tag}.scratch.ogg"));
5309- let out_path = lanes_dir.join("opus-her-r1.map.txt");5315+ let out_path = lanes_dir.join(format!("{tag}.map.txt"));
5310 5316
5311 let source_pcm = ffmpeg_decode_pcm(&src, SECS);5317 let source_pcm = ffmpeg_decode_pcm(&src, SECS);
5312 let source_frames = source_pcm.len() / CH;5318 let source_frames = source_pcm.len() / CH;
lanes/opus-her-r1.report.mdmodified+3 -3
@@ -3,13 +3,13 @@
3 **Verdict: no fix. The charter's premise (her@96 err_ratio 10.126, target < 5) is3 **Verdict: no fix. The charter's premise (her@96 err_ratio 10.126, target < 5) is
4 superseded — `706596b` (lane-opus-64, transient_analysis port) already took her@964 superseded — `706596b` (lane-opus-64, transient_analysis port) already took her@96
5 from 10.1 → 1.05 and her@64 from 4.65 → 1.10.** This lane delivers the requested5 from 10.1 → 1.05 and her@64 from 4.65 → 1.10.** This lane delivers the requested
6-error map (`lanes/opus-her-r1.map.txt`, test `her_err_map_96k`) and the certified6+error map (`lanes/opus-her-r1.map.txt`, test `err_map_vs_libopus` (was `her_err_map_96k`, renamed in r3)) and the certified
7 current 14-row baseline. No `src` change: the gate target is met and a change would7 current 14-row baseline. No `src` change: the gate target is met and a change would
8 be tuning a passing row.8 be tuning a passing row.
9 9
10 ## What the map is10 ## What the map is
11 11
12-`her_err_map_96k` (`#[ignore]`, `crates/ec-opus/tests/conformance.rs`, 30 s): the12+`err_map_vs_libopus` (was `her_err_map_96k`, renamed in r3) (`#[ignore]`, `crates/ec-opus/tests/conformance.rs`, 30 s): the
13 gate's exact encode path for both encoders (ffmpeg libopus ref → realised ref_kbps13 gate's exact encode path for both encoders (ffmpeg libopus ref → realised ref_kbps
14 → ours CVBR at that rate), `opus_compare_err_parts` per-2.5 ms-hop ef² bucketed14 → ours CVBR at that rate), `opus_compare_err_parts` per-2.5 ms-hop ef² bucketed
15 into 1 s windows. Prints top-10 windows by ours/ref ratio and by ours share, with15 into 1 s windows. Prints top-10 windows by ours/ref ratio and by ours share, with
@@ -66,6 +66,6 @@ Worst row is now **reell@96 at 4.499** — the next gate lane's premise.
66 66
67 ## Files67 ## Files
68 68
69-- `crates/ec-opus/tests/conformance.rs` — `her_err_map_96k` (commit 233d47e).69+- `crates/ec-opus/tests/conformance.rs` — `err_map_vs_libopus` (was `her_err_map_96k`, renamed in r3) (commit 233d47e).
70 - `lanes/opus-her-r1.map.txt` — the map (commit 233d47e).70 - `lanes/opus-her-r1.map.txt` — the map (commit 233d47e).
71 - `lanes/` gate artifacts restored via `git checkout --` after the runs.71 - `lanes/` gate artifacts restored via `git checkout --` after the runs.