From 2f04c6e3f5c22fe5466b121383e52fb356e87c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 23 Aug 2026 04:06:57 +0300 Subject: [PATCH] ec-vorbis: band-error + bit-split oracle vs libvorbis, 7 sources x {96,128}k Instrument test (ignored) folding the bit-split oracle into one pass: band NSR/E vs source through our decoder, ours vs ffmpeg libvorbis at matched rate. All 14 rows: bits/nonzero 1.48-2.12x ref on ~half the nonzeros, dNSR concentrated 300-1080 Hz (+9..+15 dB), HF droop on nik/reelm/hein only. Lanes files + report + round-3 handoff. --- crates/ec-vorbis/tests/oracle.rs | 244 +++++++++++++++++++ lanes/vorbis-psy-r1.bands.txt | 394 +++++++++++++++++++++++++++++++ lanes/vorbis-psy-r1.bits.txt | 72 ++++++ lanes/vorbis-psy-r1.report.md | 88 +++++++ lanes/vorbis-psy-r3.handoff.md | 60 +++++ 5 files changed, 858 insertions(+) create mode 100644 lanes/vorbis-psy-r1.bands.txt create mode 100644 lanes/vorbis-psy-r1.bits.txt create mode 100644 lanes/vorbis-psy-r1.report.md create mode 100644 lanes/vorbis-psy-r3.handoff.md diff --git a/crates/ec-vorbis/tests/oracle.rs b/crates/ec-vorbis/tests/oracle.rs index cbcfe69f..73c711c2 100644 --- a/crates/ec-vorbis/tests/oracle.rs +++ b/crates/ec-vorbis/tests/oracle.rs @@ -1230,3 +1230,247 @@ fn real_library_sweep_vs_reference() { ); assert!(failures.is_empty(), "sweep failures: {failures:?}"); } + +/// In-place radix-2 FFT. Only magnitudes and differences of identically +/// transformed spectra are used, so the twiddle sign convention is irrelevant. +fn fft(re: &mut [f64], im: &mut [f64]) { + let n = re.len(); + assert!(n.is_power_of_two()); + let bits = n.trailing_zeros(); + for i in 0..n { + let j = ((i as u32).reverse_bits() >> (32 - bits)) as usize; + if j > i { + re.swap(i, j); + im.swap(i, j); + } + } + let mut len = 2; + while len <= n { + let half = len / 2; + let step = std::f64::consts::TAU / len as f64; + for start in (0..n).step_by(len) { + for k in 0..half { + let angle = step * k as f64; + let (wr, wi) = (angle.cos(), angle.sin()); + let i = start + k; + let j = i + half; + let tr = re[j] * wr - im[j] * wi; + let ti = re[j] * wi + im[j] * wr; + re[j] = re[i] - tr; + im[j] = im[i] - ti; + re[i] += tr; + im[i] += ti; + } + } + len *= 2; + } +} + +/// Per-Bark-band spectral error, ours vs libvorbis, both decoded through our +/// decoder (so the gap measures encoders, not decoders): every 2048-sample +/// Hann frame (hop 1024) of the 48 kHz source, band edges in Hz (25 edges → +/// 24 bands), energies summed over frames and both channels. +/// NSR = 10log10(Σ|X_sig−X_src|²/Σ|X_src|²), E = 10log10(Σ|X_sig|²/Σ|X_src|²). +/// The same pass records the bit split of both streams (the decode-side +/// capture `decode_capture_with_bits` provides), so the bits table covers the +/// same rows without a second encode pass. Writes +/// `lanes/vorbis-psy-r1.bands.txt` and `lanes/vorbis-psy-r1.bits.txt`. +#[test] +#[ignore = "slow: encodes 7 full sources × 2 rates, needs ffmpeg/libvorbis"] +fn band_error_vs_reference() { + use std::io::Write; + + let sources: &[(&str, &str)] = &[ + ("nik", "~/Music/reeln.mp4"), + ("reelo", "~/Music/reelo.mp3"), + ("her", "~/Music/reeli.mp3"), + ("reell", "~/Music/reell.mp4"), + ("reelm", "~/Music/reelm.wav"), + ("dl8a", "~/Downloads/8a3b6d1d19.mp3"), + ("hein", "~/Downloads/reelm.mp3"), + ]; + let rate = 48_000u32; + let max_samples = rate as usize * 600; + let out_dir = scratch().join("vorbis7-bands"); + std::fs::create_dir_all(&out_dir).expect("out dir"); + + const FRAME: usize = 2048; + const HOP: usize = 1024; + const EDGES: [f64; 25] = [ + 100.0, 200.0, 300.0, 400.0, 510.0, 630.0, 770.0, 920.0, 1080.0, 1270.0, 1480.0, 1720.0, + 2000.0, 2320.0, 2700.0, 3150.0, 3700.0, 4400.0, 5300.0, 6400.0, 7700.0, 9500.0, 12000.0, + 15500.0, 24000.0, + ]; + let band_of: Vec> = (0..=FRAME / 2) + .map(|bin| { + let hz = bin as f64 * f64::from(rate) / FRAME as f64; + EDGES.windows(2).position(|w| hz >= w[0] && hz < w[1]) + }) + .collect(); + let window: Vec = (0..FRAME) + .map(|i| 0.5 - 0.5 * (std::f64::consts::TAU * i as f64 / FRAME as f64).cos()) + .collect(); + + let mut bands = String::from("# Band error: ours vs libvorbis, both via our decoder\n\n"); + let mut bits = String::from("# Bit split over full sources, same rows as the band error\n\n"); + let only = std::env::var("SWEEP_ONLY").ok(); + for &(name, src_path) in sources { + if only.as_deref().is_some_and(|o| !o.split(',').any(|n| n == name)) { + continue; + } + let src = PathBuf::from(shellexpand(src_path)); + if !src.exists() { + bands.push_str(&format!("## {name}: SKIP (missing)\n\n")); + continue; + } + let Some((source_pcm, _)) = ffmpeg_decode_limited(&src, rate, max_samples) else { + bands.push_str(&format!("## {name}: SKIP (decode)\n\n")); + continue; + }; + let seconds = source_pcm[0].len() as f64 / f64::from(rate); + let bytes = |p: &Path| std::fs::metadata(p).expect("size").len() as f64; + for &kbps in &[96i32, 128] { + let t0 = std::time::Instant::now(); + let reference = out_dir.join(format!("ref-{name}-{kbps}k.ogg")); + let status = Command::new("ffmpeg") + .args(["-y", "-v", "error", "-i"]) + .arg(&src) + .args(["-vn", "-t", "600", "-ac", "2", "-ar", "48000", "-c:a", "libvorbis", "-b:a", &format!("{kbps}k")]) + .arg(&reference) + .status() + .expect("ffmpeg runs"); + assert!(status.success(), "libvorbis encode of {name} at {kbps}k"); + let ref_kbps = bytes(&reference) * 8.0 / seconds / 1000.0; + // Ours at the size libvorbis actually produced, exactly as the sweep. + let ours = encode_to_file( + &source_pcm, + rate, + (ref_kbps * 1000.0).round() as i32, + &format!("vorbis7-bands/ours-{name}-{kbps}k.ogg"), + ); + let ours_kbps = bytes(&ours) * 8.0 / seconds / 1000.0; + + // PCM through our decoder for the band error; bit split from the + // same file's residue-domain capture (decode twice — the capture + // path returns no PCM). + let (ours_pcm, ours_split) = { + let (residue, split) = decode_capture_with_bits(&ours); + (our_decode(&ours).0, bit_split_summary(&split, &residue)) + }; + let (ref_pcm, ref_split) = { + let (residue, split) = decode_capture_with_bits(&reference); + (our_decode(&reference).0, bit_split_summary(&split, &residue)) + }; + + // Bit-split block: (floor, residue, packet, non-zero) per stream. + let (of, ores, op, onz) = ours_split; + let (rf, rres, rp, rnz) = ref_split; + bits.push_str(&format!( + "## {name} @ {kbps}k (ours {ours_kbps:.1} vs ref {ref_kbps:.1} kbps)\n" + )); + for (who, f, r, p, nz) in [("ours", of, ores, op, onz), ("ref ", rf, rres, rp, rnz)] { + bits.push_str(&format!( + "{who} floor {fb:>10.1}/s ({fpc:5.1}%) residue {rb:>10.1}/s ({rpc:5.1}%) other {ob:>8.1}/s nz {nz:>10} bits/nz {bnz:.2}\n", + fb = f as f64 / seconds, + fpc = 100.0 * f as f64 / p.max(1) as f64, + rb = r as f64 / seconds, + rpc = 100.0 * r as f64 / p.max(1) as f64, + ob = p.saturating_sub(f + r) as f64 / seconds, + bnz = r as f64 / nz.max(1) as f64, + )); + } + bits.push_str(&format!( + "ratio floor {:.3} residue {:.3} bits/nz {:.3}\n\n", + of as f64 / rf.max(1) as f64, + ores as f64 / rres.max(1) as f64, + (ores as f64 / onz.max(1) as f64) / (rres as f64 / rnz.max(1) as f64), + )); + + // Band error: align to the source exactly as the sweep does — + // common length from sample 0 (pre-roll trim inside `our_decode`). + let n = source_pcm[0] + .len() + .min(ours_pcm[0].len()) + .min(ref_pcm[0].len()); + let nb = EDGES.len() - 1; + let (mut e_src, mut e_ours, mut e_ref) = + (vec![0f64; nb], vec![0f64; nb], vec![0f64; nb]); + let (mut err_ours, mut err_ref) = (vec![0f64; nb], vec![0f64; nb]); + let mut spec: Vec<(Vec, Vec)> = + (0..3).map(|_| (vec![0.0; FRAME], vec![0.0; FRAME])).collect(); + let mut start = 0; + while start + FRAME <= n { + for ch in 0..2 { + for (sig, pcm) in [&source_pcm, &ours_pcm, &ref_pcm].iter().enumerate() { + let s = &mut spec[sig]; + for i in 0..FRAME { + s.0[i] = f64::from(pcm[ch][start + i]) * window[i]; + s.1[i] = 0.0; + } + fft(&mut s.0, &mut s.1); + } + for k in 0..=FRAME / 2 { + let Some(b) = band_of[k] else { continue }; + let (sr, si) = (spec[0].0[k], spec[0].1[k]); + e_src[b] += sr * sr + si * si; + let (ur, ui) = (spec[1].0[k], spec[1].1[k]); + e_ours[b] += ur * ur + ui * ui; + let (dr, di) = (ur - sr, ui - si); + err_ours[b] += dr * dr + di * di; + let (vr, vi) = (spec[2].0[k], spec[2].1[k]); + e_ref[b] += vr * vr + vi * vi; + let (er, ei) = (vr - sr, vi - si); + err_ref[b] += er * er + ei * ei; + } + } + start += HOP; + } + let db = |e: f64, s: f64| if s > 0.0 { 10.0 * (e / s).log10() } else { f64::NAN }; + bands.push_str(&format!( + "## {name} @ {kbps}k (ours {ours_kbps:.1} vs ref {ref_kbps:.1} kbps)\n" + )); + bands.push_str("band NSR_ours NSR_ref dNSR E_ours E_ref\n"); + for b in 0..nb { + if e_src[b] == 0.0 { + continue; // no source energy: NSR/E undefined + } + let (nsr_o, nsr_r) = (db(err_ours[b], e_src[b]), db(err_ref[b], e_src[b])); + bands.push_str(&format!( + "{:<8} {:7.1} {:7.1} {:6.1} {:7.1} {:7.1}\n", + format!("{}-{}", EDGES[b] as usize, EDGES[b + 1] as usize), + nsr_o, + nsr_r, + nsr_o - nsr_r, + db(e_ours[b], e_src[b]), + db(e_ref[b], e_src[b]), + )); + } + let corr = |pcm: &[Vec]| { + (0..2) + .map(|c| correlation(&pcm[c][..n], &source_pcm[c][..n])) + .sum::() + / 2.0 + }; + bands.push_str(&format!( + "broadband corr: ours {:.4} ref {:.4}\n\n", + corr(&ours_pcm), + corr(&ref_pcm), + )); + eprintln!( + "{name}@{kbps}k: ours {ours_kbps:.1} ref {ref_kbps:.1} kbps, {:.1} s", + t0.elapsed().as_secs_f32() + ); + } + } + for (text, file) in [ + (&bands, "vorbis-psy-r1.bands.txt"), + (&bits, "vorbis-psy-r1.bits.txt"), + ] { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../lanes") + .join(file); + let mut f = File::create(&path).expect("create report"); + f.write_all(text.as_bytes()).expect("write report"); + println!("{file}: {}", path.display()); + } +} diff --git a/lanes/vorbis-psy-r1.bands.txt b/lanes/vorbis-psy-r1.bands.txt new file mode 100644 index 00000000..f1559dfe --- /dev/null +++ b/lanes/vorbis-psy-r1.bands.txt @@ -0,0 +1,394 @@ +# Band error: ours vs libvorbis, both via our decoder + +## nik @ 96k (ours 84.0 vs ref 84.5 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -15.5 -21.8 6.3 -0.0 -0.1 +200-300 -12.4 -19.6 7.2 -0.1 -0.1 +300-400 -13.3 -22.8 9.5 -0.2 -0.1 +400-510 -10.6 -20.2 9.6 -0.3 -0.1 +510-630 -9.9 -19.5 9.5 -0.3 -0.1 +630-770 -12.2 -23.3 11.0 -0.2 -0.0 +770-920 -11.4 -21.3 9.8 -0.3 -0.1 +920-1080 -12.6 -22.2 9.6 -0.1 -0.0 +1080-1270 -8.3 -13.9 5.6 -0.5 -0.2 +1270-1480 -9.5 -15.4 5.9 -0.4 -0.2 +1480-1720 -8.9 -13.0 4.2 -0.5 -0.3 +1720-2000 -8.1 -12.8 4.8 -0.7 -0.3 +2000-2320 -6.5 -10.1 3.6 -0.9 -0.3 +2320-2700 -8.6 -12.1 3.6 -0.5 -0.4 +2700-3150 -8.6 -11.0 2.4 -0.6 -0.3 +3150-3700 -9.5 -12.9 3.4 -0.4 -0.3 +3700-4400 -7.9 -11.5 3.6 -0.6 -0.3 +4400-5300 -7.0 -10.6 3.6 -0.4 -0.3 +5300-6400 -3.8 -6.6 2.8 -1.1 -0.2 +6400-7700 -4.9 -6.7 1.7 -1.0 -0.0 +7700-9500 -5.7 -5.8 0.1 -0.6 0.2 +9500-12000 -6.5 -6.2 -0.3 -0.4 0.0 +12000-15500 -4.5 -4.5 -0.1 -1.2 0.5 +15500-24000 0.1 2.0 -1.9 -19.0 -2.3 +broadband corr: ours 0.9690 ref 0.9903 + +## nik @ 128k (ours 115.5 vs ref 115.8 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -19.5 -24.8 5.3 -0.0 -0.1 +200-300 -15.9 -23.5 7.6 -0.1 -0.1 +300-400 -16.8 -26.6 9.8 -0.1 -0.0 +400-510 -13.6 -24.5 10.9 -0.1 -0.0 +510-630 -12.7 -24.1 11.5 -0.1 -0.0 +630-770 -15.4 -27.5 12.1 -0.1 0.0 +770-920 -14.3 -25.9 11.6 -0.1 -0.0 +920-1080 -15.5 -27.3 11.8 -0.0 0.0 +1080-1270 -10.3 -19.2 8.9 -0.3 -0.1 +1270-1480 -12.0 -20.3 8.3 -0.2 -0.1 +1480-1720 -11.4 -17.4 6.0 -0.2 -0.1 +1720-2000 -10.5 -16.0 5.5 -0.4 -0.2 +2000-2320 -8.8 -12.9 4.2 -0.5 -0.2 +2320-2700 -11.2 -15.1 3.9 -0.3 -0.2 +2700-3150 -11.6 -14.0 2.4 -0.3 -0.2 +3150-3700 -12.6 -15.6 3.0 -0.2 -0.2 +3700-4400 -10.4 -14.1 3.7 -0.2 -0.2 +4400-5300 -8.7 -13.8 5.1 -0.1 -0.2 +5300-6400 -5.3 -9.8 4.5 -0.4 -0.3 +6400-7700 -7.0 -9.9 3.0 -0.3 -0.4 +7700-9500 -7.2 -7.5 0.3 -0.0 -0.3 +9500-12000 -8.0 -8.1 0.0 0.1 -0.4 +12000-15500 -6.4 -6.4 0.1 -0.4 -0.3 +15500-24000 0.1 2.2 -2.2 -19.0 -1.8 +broadband corr: ours 0.9838 ref 0.9951 + +## reelo @ 96k (ours 81.5 vs ref 81.8 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -14.6 -18.8 4.3 -0.1 -0.1 +200-300 -14.5 -21.5 7.0 -0.1 -0.1 +300-400 -11.7 -21.0 9.3 -0.2 -0.1 +400-510 -11.0 -20.2 9.3 -0.3 -0.1 +510-630 -12.8 -23.8 11.0 -0.1 -0.0 +630-770 -10.4 -20.6 10.2 -0.3 -0.0 +770-920 -10.0 -19.5 9.5 -0.3 -0.1 +920-1080 -8.8 -15.8 7.0 -0.4 -0.2 +1080-1270 -11.0 -16.3 5.4 -0.3 -0.2 +1270-1480 -10.8 -14.0 3.2 -0.3 -0.3 +1480-1720 -10.3 -12.2 2.0 -0.3 -0.3 +1720-2000 -8.1 -11.4 3.3 -0.6 -0.4 +2000-2320 -6.3 -9.8 3.6 -1.0 -0.4 +2320-2700 -5.7 -9.9 4.3 -1.2 -0.3 +2700-3150 -7.2 -11.4 4.2 -0.8 -0.4 +3150-3700 -6.0 -9.9 3.9 -1.1 -0.4 +3700-4400 -6.8 -11.0 4.2 -0.7 -0.4 +4400-5300 -5.4 -8.9 3.5 -1.0 -0.4 +5300-6400 -7.6 -9.1 1.4 -0.6 -0.2 +6400-7700 -7.5 -9.0 1.5 -0.6 -0.1 +7700-9500 -6.4 -7.2 0.8 -0.9 0.2 +9500-12000 -6.4 -7.1 0.7 -1.0 0.2 +12000-15500 -4.7 -5.5 0.8 -1.6 0.6 +15500-24000 -4.1 -8.2 4.0 -1.6 -0.2 +broadband corr: ours 0.9739 ref 0.9922 + +## reelo @ 128k (ours 109.1 vs ref 108.6 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -18.3 -22.7 4.4 -0.0 -0.1 +200-300 -18.2 -25.3 7.1 -0.0 -0.0 +300-400 -15.1 -25.0 9.9 -0.1 -0.1 +400-510 -13.9 -24.8 10.9 -0.1 -0.0 +510-630 -15.9 -28.4 12.5 -0.0 0.0 +630-770 -13.0 -25.1 12.1 -0.1 -0.0 +770-920 -12.7 -23.5 10.8 -0.2 -0.0 +920-1080 -11.3 -19.0 7.7 -0.2 -0.1 +1080-1270 -13.9 -19.5 5.5 -0.1 -0.1 +1270-1480 -13.7 -16.9 3.2 -0.1 -0.2 +1480-1720 -12.9 -14.5 1.5 -0.1 -0.3 +1720-2000 -10.7 -13.3 2.6 -0.3 -0.3 +2000-2320 -8.6 -11.2 2.6 -0.5 -0.3 +2320-2700 -7.9 -11.4 3.4 -0.7 -0.3 +2700-3150 -9.7 -13.1 3.4 -0.4 -0.3 +3150-3700 -8.4 -11.6 3.2 -0.6 -0.3 +3700-4400 -9.2 -12.4 3.3 -0.3 -0.4 +4400-5300 -7.7 -10.2 2.5 -0.4 -0.4 +5300-6400 -10.1 -10.5 0.3 -0.2 -0.4 +6400-7700 -10.2 -10.6 0.4 -0.2 -0.4 +7700-9500 -9.0 -8.3 -0.7 -0.4 -0.3 +9500-12000 -9.0 -8.4 -0.7 -0.4 -0.3 +12000-15500 -6.7 -7.6 0.9 -0.9 -0.3 +15500-24000 -5.6 -12.3 6.7 -1.2 -0.3 +broadband corr: ours 0.9868 ref 0.9955 + +## her @ 96k (ours 89.9 vs ref 89.9 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -13.9 -21.6 7.7 -0.0 -0.1 +200-300 -11.4 -20.8 9.4 -0.2 -0.1 +300-400 -10.5 -21.8 11.3 -0.4 -0.1 +400-510 -8.5 -20.3 11.8 -0.6 -0.1 +510-630 -7.6 -17.9 10.2 -0.7 -0.1 +630-770 -9.5 -21.6 12.1 -0.5 -0.1 +770-920 -6.5 -15.2 8.7 -1.0 -0.2 +920-1080 -11.1 -20.8 9.7 -0.2 -0.1 +1080-1270 -6.1 -12.6 6.5 -1.1 -0.4 +1270-1480 -5.6 -10.3 4.7 -1.2 -0.4 +1480-1720 -6.2 -9.9 3.7 -1.1 -0.4 +1720-2000 -5.9 -9.4 3.5 -1.2 -0.5 +2000-2320 -5.3 -7.7 2.4 -1.3 -0.5 +2320-2700 -5.9 -8.5 2.5 -1.2 -0.5 +2700-3150 -5.8 -9.1 3.4 -1.2 -0.5 +3150-3700 -4.7 -7.8 3.1 -1.7 -0.5 +3700-4400 -3.6 -7.5 4.0 -1.6 -0.5 +4400-5300 -2.8 -6.7 3.9 -1.8 -0.5 +5300-6400 -3.1 -4.2 1.1 -1.3 -0.2 +6400-7700 -3.7 -3.1 -0.7 -0.9 -0.1 +7700-9500 -3.1 -1.3 -1.8 -1.2 0.6 +9500-12000 -3.0 -1.3 -1.7 -1.6 0.7 +12000-15500 -3.0 -1.6 -1.4 -1.6 0.7 +15500-24000 -2.3 -0.9 -1.4 -2.4 -3.0 +broadband corr: ours 0.9668 ref 0.9867 + +## her @ 128k (ours 123.5 vs ref 124.9 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -17.5 -25.0 7.4 -0.0 -0.1 +200-300 -14.7 -24.7 10.0 -0.1 -0.0 +300-400 -13.5 -25.6 12.1 -0.2 -0.0 +400-510 -11.6 -24.3 12.7 -0.2 -0.1 +510-630 -10.2 -22.5 12.2 -0.3 -0.1 +630-770 -12.4 -25.4 13.0 -0.2 -0.0 +770-920 -8.8 -19.8 11.0 -0.5 -0.1 +920-1080 -13.9 -24.6 10.8 -0.1 -0.0 +1080-1270 -8.5 -16.3 7.8 -0.6 -0.3 +1270-1480 -7.7 -14.1 6.4 -0.7 -0.3 +1480-1720 -8.5 -13.9 5.4 -0.6 -0.3 +1720-2000 -8.1 -13.2 5.1 -0.6 -0.3 +2000-2320 -7.5 -11.0 3.5 -0.7 -0.4 +2320-2700 -8.3 -11.6 3.3 -0.6 -0.4 +2700-3150 -8.2 -12.0 3.8 -0.6 -0.4 +3150-3700 -6.8 -10.3 3.4 -0.9 -0.4 +3700-4400 -4.9 -10.1 5.2 -0.9 -0.4 +4400-5300 -3.8 -9.8 5.9 -0.9 -0.4 +5300-6400 -3.5 -10.1 6.6 -0.5 -0.4 +6400-7700 -4.0 -10.9 6.9 -0.2 -0.5 +7700-9500 -3.4 -2.7 -0.6 -0.3 -0.1 +9500-12000 -3.6 -2.1 -1.5 -0.6 -0.0 +12000-15500 -3.9 -2.8 -1.2 -0.8 -0.1 +15500-24000 -3.4 -6.3 2.8 -1.5 -0.4 +broadband corr: ours 0.9810 ref 0.9927 + +## reell @ 96k (ours 85.4 vs ref 85.5 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -15.4 -20.2 4.7 -0.1 -0.1 +200-300 -14.2 -20.5 6.3 -0.1 -0.1 +300-400 -14.7 -22.9 8.2 -0.1 -0.1 +400-510 -14.0 -22.5 8.4 -0.1 -0.0 +510-630 -11.0 -20.1 9.1 -0.3 -0.1 +630-770 -9.5 -18.2 8.7 -0.4 -0.1 +770-920 -14.2 -22.8 8.7 -0.1 -0.0 +920-1080 -11.7 -19.0 7.3 -0.2 -0.1 +1080-1270 -8.6 -13.3 4.7 -0.5 -0.2 +1270-1480 -11.6 -15.6 4.0 -0.2 -0.2 +1480-1720 -10.6 -13.1 2.5 -0.2 -0.2 +1720-2000 -12.8 -15.4 2.6 -0.2 -0.2 +2000-2320 -7.9 -9.6 1.7 -0.6 -0.4 +2320-2700 -7.9 -10.1 2.2 -0.6 -0.4 +2700-3150 -9.5 -11.5 1.9 -0.4 -0.3 +3150-3700 -8.5 -10.2 1.6 -0.5 -0.3 +3700-4400 -8.6 -10.3 1.7 -0.2 -0.3 +4400-5300 -8.4 -10.5 2.0 0.1 -0.3 +5300-6400 -5.4 -7.0 1.6 -0.6 -0.3 +6400-7700 -5.0 -4.7 -0.2 -0.8 0.1 +7700-9500 -8.0 -5.8 -2.2 -0.2 0.3 +9500-12000 -7.0 -5.7 -1.3 -0.5 0.0 +12000-15500 -1.9 -1.5 -0.4 -2.4 0.8 +15500-24000 -1.5 -5.9 4.3 -3.1 -0.1 +broadband corr: ours 0.9792 ref 0.9923 + +## reell @ 128k (ours 121.3 vs ref 120.9 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -20.6 -23.6 3.1 -0.0 -0.1 +200-300 -19.2 -24.5 5.3 -0.0 -0.1 +300-400 -19.3 -27.3 8.0 -0.0 -0.0 +400-510 -18.4 -27.2 8.8 -0.0 -0.0 +510-630 -14.9 -25.1 10.1 -0.1 -0.0 +630-770 -13.1 -23.3 10.2 -0.1 -0.0 +770-920 -18.1 -28.0 9.9 -0.0 0.0 +920-1080 -15.1 -24.6 9.5 -0.1 -0.0 +1080-1270 -11.3 -18.8 7.5 -0.2 -0.1 +1270-1480 -14.8 -21.1 6.3 -0.1 -0.1 +1480-1720 -13.8 -18.7 5.0 -0.1 -0.1 +1720-2000 -16.2 -20.3 4.2 -0.1 -0.1 +2000-2320 -11.0 -14.0 3.1 -0.3 -0.2 +2320-2700 -11.1 -14.4 3.3 -0.3 -0.2 +2700-3150 -12.6 -15.5 2.9 -0.2 -0.1 +3150-3700 -11.7 -14.6 2.9 -0.2 -0.2 +3700-4400 -11.0 -14.6 3.6 0.1 -0.2 +4400-5300 -10.5 -14.5 4.0 0.2 -0.2 +5300-6400 -7.3 -11.0 3.7 -0.1 -0.3 +6400-7700 -6.7 -9.3 2.6 -0.2 -0.4 +7700-9500 -9.8 -7.5 -2.3 0.0 -0.3 +9500-12000 -8.7 -7.2 -1.5 -0.1 -0.3 +12000-15500 -2.8 -2.8 0.0 -1.6 -0.1 +15500-24000 -2.6 -9.3 6.7 -2.7 -0.2 +broadband corr: ours 0.9914 ref 0.9968 + +## reelm @ 96k (ours 80.5 vs ref 79.3 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -19.2 -29.7 10.5 -0.0 0.0 +200-300 -18.7 -30.8 12.2 0.0 0.0 +300-400 -17.4 -27.9 10.5 0.0 0.0 +400-510 -17.7 -28.5 10.8 0.0 0.0 +510-630 -16.6 -28.0 11.4 -0.0 0.0 +630-770 -14.0 -24.1 10.1 -0.1 -0.0 +770-920 -14.9 -23.0 8.1 -0.1 -0.1 +920-1080 -13.4 -19.3 5.8 -0.1 -0.2 +1080-1270 -13.4 -17.1 3.6 -0.1 -0.2 +1270-1480 -14.0 -15.7 1.7 -0.1 -0.3 +1480-1720 -13.4 -13.8 0.4 -0.1 -0.4 +1720-2000 -13.2 -14.0 0.8 -0.1 -0.4 +2000-2320 -11.7 -12.7 0.9 -0.2 -0.4 +2320-2700 -12.0 -11.9 -0.1 -0.2 -0.4 +2700-3150 -12.7 -12.2 -0.5 -0.2 -0.5 +3150-3700 -10.0 -10.6 0.5 -0.4 -0.5 +3700-4400 -10.4 -11.3 1.0 -0.4 -0.4 +4400-5300 -9.9 -9.6 -0.3 -0.4 -0.4 +5300-6400 -11.7 -9.8 -1.9 -0.2 -0.3 +6400-7700 -8.5 -9.4 0.9 -0.6 -0.1 +7700-9500 -8.8 -8.0 -0.8 -0.5 0.1 +9500-12000 -8.2 -9.6 1.4 -0.6 -0.3 +12000-15500 -1.8 -5.6 3.8 -3.2 0.6 +15500-24000 -0.7 -5.5 4.8 -7.0 -0.1 +broadband corr: ours 0.9796 ref 0.9865 + +## reelm @ 128k (ours 93.5 vs ref 91.0 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -22.4 -34.2 11.8 -0.0 0.0 +200-300 -21.5 -35.3 13.9 0.0 0.1 +300-400 -20.2 -32.9 12.8 0.0 0.0 +400-510 -20.5 -33.3 12.8 0.0 0.0 +510-630 -19.7 -32.2 12.5 0.0 0.0 +630-770 -16.8 -27.5 10.7 -0.0 0.0 +770-920 -17.7 -26.1 8.3 -0.0 -0.0 +920-1080 -16.0 -22.1 6.1 -0.0 -0.1 +1080-1270 -16.2 -19.8 3.6 -0.0 -0.1 +1270-1480 -16.9 -18.2 1.3 -0.0 -0.2 +1480-1720 -16.2 -15.7 -0.5 -0.0 -0.2 +1720-2000 -15.8 -15.9 0.1 -0.0 -0.3 +2000-2320 -14.3 -14.0 -0.3 -0.1 -0.3 +2320-2700 -14.7 -13.1 -1.6 -0.1 -0.4 +2700-3150 -15.6 -13.2 -2.3 -0.1 -0.4 +3150-3700 -12.5 -11.0 -1.5 -0.2 -0.4 +3700-4400 -13.0 -11.7 -1.3 -0.2 -0.4 +4400-5300 -12.6 -10.5 -2.1 -0.2 -0.4 +5300-6400 -14.5 -11.2 -3.3 -0.1 -0.4 +6400-7700 -11.0 -11.0 0.0 -0.3 -0.4 +7700-9500 -11.3 -9.7 -1.6 -0.3 -0.3 +9500-12000 -10.4 -11.2 0.8 -0.3 -0.4 +12000-15500 -2.7 -7.4 4.6 -2.5 -0.2 +15500-24000 -1.0 -7.8 6.8 -5.3 -0.2 +broadband corr: ours 0.9890 ref 0.9906 + +## dl8a @ 96k (ours 86.9 vs ref 86.9 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -12.7 -21.2 8.5 -0.1 -0.1 +200-300 -13.3 -22.7 9.5 -0.2 -0.1 +300-400 -10.2 -20.8 10.7 -0.3 -0.1 +400-510 -9.9 -21.1 11.2 -0.4 -0.1 +510-630 -11.1 -23.8 12.7 -0.2 -0.0 +630-770 -12.2 -24.1 11.9 -0.2 -0.0 +770-920 -11.1 -21.1 10.0 -0.2 -0.1 +920-1080 -7.9 -15.7 7.9 -0.6 -0.2 +1080-1270 -9.2 -15.3 6.2 -0.5 -0.2 +1270-1480 -10.5 -14.6 4.1 -0.3 -0.3 +1480-1720 -9.2 -12.1 2.9 -0.5 -0.3 +1720-2000 -7.9 -11.5 3.6 -0.7 -0.3 +2000-2320 -6.6 -9.7 3.1 -0.9 -0.3 +2320-2700 -6.6 -9.8 3.2 -1.0 -0.4 +2700-3150 -6.1 -9.8 3.7 -1.1 -0.4 +3150-3700 -6.7 -9.7 3.0 -1.0 -0.4 +3700-4400 -6.4 -9.1 2.7 -0.7 -0.4 +4400-5300 -7.1 -9.5 2.4 -0.1 -0.4 +5300-6400 -5.7 -7.8 2.1 -0.6 -0.2 +6400-7700 -5.4 -7.1 1.7 -0.8 0.0 +7700-9500 -5.7 -6.6 0.8 -0.8 0.2 +9500-12000 -6.2 -7.3 1.1 -0.7 0.0 +12000-15500 -4.3 -5.6 1.3 -1.2 0.4 +15500-24000 -3.4 -1.9 -1.5 -2.1 -3.3 +broadband corr: ours 0.9655 ref 0.9916 + +## dl8a @ 128k (ours 118.7 vs ref 117.8 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -16.2 -24.7 8.6 -0.0 -0.1 +200-300 -16.9 -26.2 9.3 -0.1 -0.0 +300-400 -13.2 -24.9 11.7 -0.1 -0.0 +400-510 -12.9 -25.7 12.8 -0.2 -0.0 +510-630 -13.9 -28.5 14.6 -0.1 0.0 +630-770 -15.1 -28.7 13.6 -0.1 0.0 +770-920 -14.0 -25.7 11.6 -0.1 -0.0 +920-1080 -10.4 -20.0 9.6 -0.3 -0.1 +1080-1270 -12.0 -19.6 7.6 -0.3 -0.1 +1270-1480 -13.2 -18.9 5.7 -0.2 -0.2 +1480-1720 -11.9 -15.8 3.9 -0.2 -0.2 +1720-2000 -10.3 -14.6 4.3 -0.3 -0.2 +2000-2320 -9.1 -12.3 3.2 -0.4 -0.3 +2320-2700 -9.2 -12.5 3.3 -0.5 -0.3 +2700-3150 -8.8 -12.1 3.3 -0.5 -0.4 +3150-3700 -9.3 -11.8 2.5 -0.5 -0.3 +3700-4400 -8.9 -11.2 2.3 -0.2 -0.3 +4400-5300 -9.3 -11.7 2.5 0.2 -0.4 +5300-6400 -8.1 -10.0 1.9 -0.0 -0.3 +6400-7700 -7.8 -9.2 1.4 -0.1 -0.4 +7700-9500 -8.2 -7.8 -0.4 -0.2 -0.3 +9500-12000 -8.9 -8.5 -0.4 -0.2 -0.4 +12000-15500 -6.2 -6.6 0.4 -0.5 -0.3 +15500-24000 -4.8 -9.9 5.0 -1.4 -0.4 +broadband corr: ours 0.9826 ref 0.9957 + +## hein @ 96k (ours 80.3 vs ref 79.1 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -17.8 -26.8 8.9 -0.0 0.0 +200-300 -17.9 -28.2 10.3 0.0 0.0 +300-400 -16.4 -26.2 9.8 -0.0 -0.0 +400-510 -17.4 -27.6 10.2 -0.0 -0.0 +510-630 -15.9 -26.8 10.9 -0.0 -0.0 +630-770 -13.3 -23.6 10.4 -0.1 -0.0 +770-920 -14.0 -22.5 8.6 -0.1 -0.1 +920-1080 -12.7 -19.3 6.6 -0.1 -0.1 +1080-1270 -12.8 -17.1 4.3 -0.2 -0.2 +1270-1480 -13.5 -15.1 1.5 -0.1 -0.4 +1480-1720 -13.7 -12.9 -0.8 -0.1 -0.4 +1720-2000 -11.9 -12.3 0.4 -0.2 -0.4 +2000-2320 -11.2 -11.7 0.5 -0.3 -0.4 +2320-2700 -9.9 -11.3 1.3 -0.4 -0.4 +2700-3150 -12.3 -11.9 -0.4 -0.2 -0.5 +3150-3700 -9.9 -11.4 1.5 -0.4 -0.5 +3700-4400 -9.5 -11.0 1.5 -0.4 -0.5 +4400-5300 -10.0 -9.8 -0.1 -0.4 -0.4 +5300-6400 -11.1 -9.6 -1.4 -0.3 -0.3 +6400-7700 -8.6 -9.3 0.8 -0.6 -0.1 +7700-9500 -9.2 -8.1 -1.1 -0.5 0.1 +9500-12000 -8.3 -9.4 1.1 -0.6 -0.2 +12000-15500 -2.1 -5.8 3.6 -2.9 0.5 +15500-24000 -0.7 -4.9 4.2 -6.8 -0.0 +broadband corr: ours 0.9789 ref 0.9869 + +## hein @ 128k (ours 92.8 vs ref 90.7 kbps) +band NSR_ours NSR_ref dNSR E_ours E_ref +100-200 -20.5 -30.4 9.8 0.0 0.0 +200-300 -20.7 -32.2 11.6 0.0 0.0 +300-400 -19.1 -30.6 11.5 0.0 0.0 +400-510 -20.2 -31.8 11.6 0.0 0.0 +510-630 -18.7 -30.6 11.9 -0.0 0.0 +630-770 -15.9 -26.6 10.8 -0.0 -0.0 +770-920 -16.4 -25.1 8.7 -0.0 -0.0 +920-1080 -15.2 -21.8 6.6 -0.1 -0.1 +1080-1270 -15.5 -19.5 4.0 -0.1 -0.1 +1270-1480 -16.3 -17.0 0.7 -0.1 -0.3 +1480-1720 -16.6 -14.4 -2.2 -0.1 -0.3 +1720-2000 -14.7 -13.7 -1.0 -0.1 -0.3 +2000-2320 -14.0 -12.8 -1.1 -0.1 -0.4 +2320-2700 -12.4 -12.1 -0.4 -0.2 -0.3 +2700-3150 -15.1 -12.6 -2.4 -0.1 -0.4 +3150-3700 -12.3 -12.0 -0.4 -0.2 -0.4 +3700-4400 -11.7 -11.4 -0.3 -0.2 -0.5 +4400-5300 -12.5 -10.6 -1.9 -0.2 -0.4 +5300-6400 -13.6 -10.9 -2.6 -0.2 -0.4 +6400-7700 -10.8 -10.9 0.1 -0.3 -0.4 +7700-9500 -11.5 -9.8 -1.6 -0.2 -0.3 +9500-12000 -10.4 -11.0 0.7 -0.3 -0.4 +12000-15500 -3.2 -7.6 4.4 -2.2 -0.3 +15500-24000 -1.0 -6.6 5.6 -5.3 -0.3 +broadband corr: ours 0.9883 ref 0.9906 + diff --git a/lanes/vorbis-psy-r1.bits.txt b/lanes/vorbis-psy-r1.bits.txt new file mode 100644 index 00000000..4ff1390f --- /dev/null +++ b/lanes/vorbis-psy-r1.bits.txt @@ -0,0 +1,72 @@ +# Bit split over full sources, same rows as the band error + +## nik @ 96k (ours 84.0 vs ref 84.5 kbps) +ours floor 9723.2/s ( 11.7%) residue 72917.0/s ( 87.9%) other 355.3/s nz 2560721 bits/nz 5.42 +ref floor 10286.2/s ( 12.3%) residue 73047.7/s ( 87.3%) other 388.4/s nz 4760782 bits/nz 2.92 +ratio floor 0.945 residue 0.998 bits/nz 1.856 + +## nik @ 128k (ours 115.5 vs ref 115.8 kbps) +ours floor 9645.0/s ( 8.5%) residue 103989.2/s ( 91.2%) other 353.9/s nz 3814314 bits/nz 5.19 +ref floor 10077.0/s ( 8.8%) residue 104124.4/s ( 90.9%) other 389.7/s nz 5632447 bits/nz 3.52 +ratio floor 0.957 residue 0.999 bits/nz 1.475 + +## reelo @ 96k (ours 81.5 vs ref 81.8 kbps) +ours floor 9806.9/s ( 12.2%) residue 70346.3/s ( 87.4%) other 355.5/s nz 2986413 bits/nz 5.29 +ref floor 9941.3/s ( 12.3%) residue 70612.8/s ( 87.2%) other 398.4/s nz 5777660 bits/nz 2.74 +ratio floor 0.986 residue 0.996 bits/nz 1.927 + +## reelo @ 128k (ours 109.1 vs ref 108.6 kbps) +ours floor 9691.2/s ( 9.0%) residue 97679.6/s ( 90.7%) other 353.8/s nz 4295299 bits/nz 5.11 +ref floor 9747.6/s ( 9.1%) residue 97310.8/s ( 90.6%) other 403.0/s nz 6673503 bits/nz 3.27 +ratio floor 0.994 residue 1.004 bits/nz 1.560 + +## her @ 96k (ours 89.9 vs ref 89.9 kbps) +ours floor 9524.9/s ( 10.7%) residue 78889.0/s ( 88.9%) other 354.8/s nz 1787297 bits/nz 6.60 +ref floor 10153.8/s ( 11.4%) residue 78231.6/s ( 88.1%) other 424.2/s nz 3760403 bits/nz 3.11 +ratio floor 0.938 residue 1.008 bits/nz 2.122 + +## her @ 128k (ours 123.5 vs ref 124.9 kbps) +ours floor 9533.5/s ( 7.8%) residue 112062.4/s ( 91.9%) other 352.8/s nz 2722388 bits/nz 6.16 +ref floor 10767.4/s ( 8.7%) residue 112414.2/s ( 90.9%) other 440.5/s nz 4510184 bits/nz 3.73 +ratio floor 0.885 residue 0.997 bits/nz 1.652 + +## reell @ 96k (ours 85.4 vs ref 85.5 kbps) +ours floor 9711.2/s ( 11.5%) residue 74235.7/s ( 88.1%) other 352.0/s nz 1543184 bits/nz 6.13 +ref floor 10298.1/s ( 12.2%) residue 73899.0/s ( 87.4%) other 385.7/s nz 3052428 bits/nz 3.09 +ratio floor 0.943 residue 1.005 bits/nz 1.987 + +## reell @ 128k (ours 121.3 vs ref 120.9 kbps) +ours floor 9566.1/s ( 8.0%) residue 109816.9/s ( 91.7%) other 355.4/s nz 2371325 bits/nz 5.91 +ref floor 9762.0/s ( 8.2%) residue 109419.2/s ( 91.5%) other 383.9/s nz 3707113 bits/nz 3.76 +ratio floor 0.980 residue 1.004 bits/nz 1.569 + +## reelm @ 96k (ours 80.5 vs ref 79.3 kbps) +ours floor 11985.8/s ( 15.1%) residue 66845.4/s ( 84.3%) other 478.7/s nz 8155330 bits/nz 4.92 +ref floor 13236.4/s ( 16.9%) residue 64513.7/s ( 82.4%) other 554.2/s nz 16100264 bits/nz 2.40 +ratio floor 0.906 residue 1.036 bits/nz 2.046 + +## reelm @ 128k (ours 93.5 vs ref 91.0 kbps) +ours floor 11796.9/s ( 12.8%) residue 79906.7/s ( 86.7%) other 478.6/s nz 9867445 bits/nz 4.86 +ref floor 15532.3/s ( 17.3%) residue 73887.6/s ( 82.1%) other 577.2/s nz 17166019 bits/nz 2.58 +ratio floor 0.760 residue 1.081 bits/nz 1.881 + +## dl8a @ 96k (ours 86.9 vs ref 86.9 kbps) +ours floor 9898.8/s ( 11.5%) residue 75451.0/s ( 88.0%) other 361.4/s nz 1070509 bits/nz 5.22 +ref floor 10220.4/s ( 11.9%) residue 75065.3/s ( 87.6%) other 450.2/s nz 2007693 bits/nz 2.77 +ratio floor 0.969 residue 1.005 bits/nz 1.885 + +## dl8a @ 128k (ours 118.7 vs ref 117.8 kbps) +ours floor 9770.3/s ( 8.3%) residue 106984.6/s ( 91.3%) other 362.3/s nz 1586225 bits/nz 5.00 +ref floor 10898.1/s ( 9.4%) residue 104859.0/s ( 90.2%) other 461.9/s nz 2355540 bits/nz 3.30 +ratio floor 0.897 residue 1.020 bits/nz 1.515 + +## hein @ 96k (ours 80.3 vs ref 79.1 kbps) +ours floor 11754.1/s ( 14.8%) residue 66934.3/s ( 84.6%) other 464.2/s nz 8280099 bits/nz 4.85 +ref floor 13269.0/s ( 17.0%) residue 64324.4/s ( 82.3%) other 542.5/s nz 16037649 bits/nz 2.41 +ratio floor 0.886 residue 1.041 bits/nz 2.015 + +## hein @ 128k (ours 92.8 vs ref 90.7 kbps) +ours floor 11598.0/s ( 12.7%) residue 79463.3/s ( 86.8%) other 463.7/s nz 9964341 bits/nz 4.78 +ref floor 15672.4/s ( 17.5%) residue 73426.1/s ( 81.9%) other 577.8/s nz 17055459 bits/nz 2.58 +ratio floor 0.740 residue 1.082 bits/nz 1.852 + diff --git a/lanes/vorbis-psy-r1.report.md b/lanes/vorbis-psy-r1.report.md new file mode 100644 index 00000000..964804f7 --- /dev/null +++ b/lanes/vorbis-psy-r1.report.md @@ -0,0 +1,88 @@ +byte-identity: IDENTICAL (reelm 120 s 128k, main 4b007cd vs 689cdc9) + +# vorbis-psy r3 — band error + bit split, 7 sources × {96k, 128k} + +Instrument: `band_error_vs_reference` (`crates/ec-vorbis/tests/oracle.rs`), run in +release, full 14 rows (no `SWEEP_ONLY` fallback needed; 163 s total, 3–25 s/row). +Ref = ffmpeg libvorbis `-t 600 -ac 2 -ar 48000`; ours encoded at the ref's measured +kbps; both decoded through **our** decoder, so the gap measures encoders only. +Bands: 2048-pt Hann, hop 1024, 25 edges 100 Hz–24 kHz → 24 bands, both channels +summed. NSR/E in dB vs the source per band; dNSR = NSR_ours − NSR_ref (positive = +we're worse). Raw tables: `vorbis-psy-r1.bands.txt`, `vorbis-psy-r1.bits.txt`. + +## Bit split (floor / residue / bits-per-nonzero, ours vs ref, ratio) + +| row | floor ours/ref b/s | residue ours/ref b/s | nz ours/ref | bits/nz ours vs ref | ratio bits/nz | +|---|---|---|---|---|---| +| nik 96k | 9723 / 10286 | 72917 / 73048 | 2.56M / 4.76M | 5.42 vs 2.92 | **1.86** | +| nik 128k | 9645 / 10077 | 103989 / 104124 | 3.81M / 5.63M | 5.19 vs 3.52 | **1.48** | +| reelo 96k | 9807 / 9941 | 70346 / 70613 | 2.99M / 5.78M | 5.29 vs 2.74 | **1.93** | +| reelo 128k | 9691 / 9748 | 97680 / 97311 | 4.30M / 6.67M | 5.11 vs 3.27 | **1.56** | +| her 96k | 9525 / 10154 | 78889 / 78232 | 1.79M / 3.76M | 6.60 vs 3.11 | **2.12** | +| her 128k | 9534 / 10767 | 112062 / 112414 | 2.72M / 4.51M | 6.16 vs 3.73 | **1.65** | +| reell 96k | 9711 / 10298 | 74236 / 73899 | 1.54M / 3.05M | 6.13 vs 3.09 | **1.99** | +| reell 128k | 9566 / 9762 | 109817 / 109419 | 2.37M / 3.71M | 5.91 vs 3.76 | **1.57** | +| reelm 96k | 11986 / 13236 | 66845 / 64514 | 8.16M / 16.10M | 4.92 vs 2.40 | **2.05** | +| reelm 128k | 11797 / 15532 | 79907 / 73888 | 9.87M / 17.17M | 4.86 vs 2.58 | **1.88** | +| dl8a 96k | 9899 / 10220 | 75451 / 75065 | 1.07M / 2.01M | 5.22 vs 2.77 | **1.89** | +| dl8a 128k | 9770 / 10898 | 106985 / 104859 | 1.59M / 2.36M | 5.00 vs 3.30 | **1.52** | +| hein 96k | 11754 / 13269 | 66934 / 64324 | 8.28M / 16.04M | 4.85 vs 2.41 | **2.02** | +| hein 128k | 11598 / 15672 | 79463 / 73426 | 9.96M / 17.06M | 4.78 vs 2.58 | **1.85** | + +Residue totals land within ±4% of ref at matched rate (ratios 0.996–1.082), but +we spend them on 45–57% as many non-zero coefficients at 1.5–2.1× the bits each. +Floor ratio 0.74–0.99 — ref outspends us on floor most where it wins HF (reelm/ +hein 128k: ref floor 15.5–15.7k b/s vs our 11.6k). + +## Bands summary (per row: 3 largest dNSR bands; E-attenuated bands) + +`E −x.x` = encoder output band energy vs source; "attenuated" lists bands with +E_ours ≤ −3 dB while E_ref > −3 dB. + +| row | top-3 dNSR bands | attenuated bands | corr ours/ref | +|---|---|---|---| +| nik 96k | 630-770 +11.0; 770-920 +9.8; 400-510 +9.6 | 15500-24000 E −19.0 (ref −2.3) | 0.9690 / 0.9903 | +| nik 128k | 630-770 +12.1; 920-1080 +11.8; 770-920 +11.6 | 15500-24000 E −19.0 (ref −1.8) | 0.9838 / 0.9951 | +| reelo 96k | 510-630 +11.0; 630-770 +10.2; 770-920 +9.5 | none | 0.9739 / 0.9922 | +| reelo 128k | 510-630 +12.5; 630-770 +12.1; 400-510 +10.9 | none | 0.9868 / 0.9955 | +| her 96k | 630-770 +12.1; 400-510 +11.8; 300-400 +11.3 | none | 0.9668 / 0.9867 | +| her 128k | 630-770 +13.0; 400-510 +12.7; 510-630 +12.2 | none | 0.9810 / 0.9927 | +| reell 96k | 510-630 +9.1; 630-770 +8.7; 770-920 +8.7 | 15500-24000 E −3.1 (ref −0.1) | 0.9792 / 0.9923 | +| reell 128k | 630-770 +10.2; 510-630 +10.1; 770-920 +9.9 | none | 0.9914 / 0.9968 | +| reelm 96k | 200-300 +12.2; 510-630 +11.4; 400-510 +10.8 | 12000-15500 E −3.2 (ref +0.6); 15500-24000 E −7.0 (ref −0.1) | 0.9796 / 0.9865 | +| reelm 128k | 200-300 +13.9; 300-400 +12.8; 400-510 +12.8 | 15500-24000 E −5.3 (ref −0.2) | 0.9890 / 0.9906 | +| dl8a 96k | 510-630 +12.7; 630-770 +11.9; 400-510 +11.2 | none | 0.9655 / 0.9916 | +| dl8a 128k | 510-630 +14.6; 630-770 +13.6; 400-510 +12.8 | none | 0.9826 / 0.9957 | +| hein 96k | 510-630 +10.9; 630-770 +10.4; 200-300 +10.3 | 15500-24000 E −6.8 (ref −0.0) | 0.9789 / 0.9869 | +| hein 128k | 510-630 +11.9; 200-300 +11.6; 400-510 +11.6 | 15500-24000 E −5.3 (ref −0.3) | 0.9883 / 0.9906 | + +Every row's top-3 dNSR sits in **300–1080 Hz** (dNSR +8.6 to +14.6); in that +region ref reaches NSR −20 to −30 dB while we sit at −8 to −20. + +## Diagnosis (numbers only) + +(a) **Coding efficiency: yes, every row.** bits/non-zero ours/ref = 1.48–2.12, +all 14 rows ≥ 1.3×; we code 45–57% as many non-zeros (e.g. her 96k 1.79M vs +3.76M) at 4.8–6.6 bits each vs ref's 2.4–3.8, from identical residue budgets. +(b) **HF droop: partial.** nik 15500-24000 E −19.0 dB (effective lowpass at both +rates, ref −1.8/−2.3); reell 96k −3.1; reelm −7.0/−5.3 (plus 12000-15500 −3.2 at +96k); hein −6.8/−5.3. reelo, her, dl8a: no band below −3 dB. (c) **Not flat.** +dNSR is frequency-shaped, not broadband: +9 to +15 at 300–1080 Hz, +2 to +8 at +1–5 kHz, ≤ +1.3 (often negative, we win) above 7.7 kHz; broadband corr gap is +0.0016–0.0131 at 128k and 0.0069–0.0261 at 96k, driven by the low bands. +(d) **Tonal mid 1–5 kHz on her/reelo/dl8a: present but secondary** — her 96k +1080-1270 +6.5 / 1270-1480 +4.7 / 1480-1720 +3.7; reelo 96k 2320-2700 +4.3 / +3150-3700 +3.9; dl8a 96k 2700-3150 +3.7 / 1720-2000 +3.6 — each 5–8 dB below the +same row's 510-770 Hz peak. Conclusion: the dominant gap is (a) residue coding +efficiency concentrated at 300–1080 Hz — ref encodes roughly twice the non-zeros +at half the per-coefficient cost there — with (b) HF droop a separate, source- +dependent contributor (nik/reelm/hein), and (d) minor. + +## Deviations from the charter + +- Bit-split oracle folded into `band_error_vs_reference` instead of the existing + 12 s × 128k-only `residue_histogram_vs_reference`: same `decode_capture_with_bits` + + `bit_split_summary` measurement on the same files, one encode pass instead of + two, and extended to all 14 rows (600 s, both rates). +- Task text said "25 Bark bands" but listed 25 edges; edges taken as authoritative + → 24 bands (noted in the test's doc comment). diff --git a/lanes/vorbis-psy-r3.handoff.md b/lanes/vorbis-psy-r3.handoff.md new file mode 100644 index 00000000..ffce0bae --- /dev/null +++ b/lanes/vorbis-psy-r3.handoff.md @@ -0,0 +1,60 @@ +# lane-vorbis-psy — round 3 handoff (2026-08-23) + +Branch `lane-vorbis-psy` @ 689cdc9 + this commit. No merge, no push. + +## What this round did + +- Added `band_error_vs_reference` (ignored instrument test) to + `crates/ec-vorbis/tests/oracle.rs` — 2048-pt Hann STFT, 24 bands from 25 edges + (100 Hz–24 kHz), band NSR + band-energy-vs-source for ours vs ffmpeg libvorbis, + both decoded through our decoder. Bit-split oracle folded into the same pass + (see deviations). +- Ran all 14 rows (7 sources × {96,128} kbps, 600 s each), release mode, 163 s. +- `cargo test -p ec-vorbis` non-ignored: green (13 lib + 8 oracle, 3 ignored). +- Encoder output byte-identical to main — established at 689cdc9 in round 2 + (reelm 120 s 128k, 4b007cd vs 689cdc9), not re-proven this round; this round + touches only `tests/oracle.rs` + lanes files. + +## Findings (numbers in `vorbis-psy-r1.report.md`) + +1. **Residue coding efficiency is the dominant gap.** bits/non-zero = 1.48–2.12× + ref on all 14 rows; we emit 45–57% as many non-zeros at 4.8–6.6 bits each vs + ref's 2.4–3.8, from near-identical residue budgets (±4%). +2. **The error is concentrated at 300–1080 Hz** — dNSR +8.6 to +14.6 dB; ref hits + NSR −20 to −30 there, we sit at −8 to −20. Mid 1–5 kHz +2 to +8. Above 7.7 kHz + we win or tie on most rows. +3. **HF droop is source-dependent, not universal**: nik 15500-24000 E −19 dB + (hard lowpass, both rates; ref −1.8/−2.3), reelm −7.0/−5.3, hein −6.8/−5.3, + reell@96 −3.1. reelo/her/dl8a none. +4. Floor spend: ours 0.74–0.99× ref; ref outspends us most on reelm/hein 128k + (15.5–15.7 k b/s vs 11.6k) — same sources where HF droop shows. + +## Next-round candidates (ranked by measured impact) + +- (1)+(2) Residue: encode ~2× non-zeros at ~half bits each in low bands — + suspect book selection / dimension / amplitude-bit allocation, not psy + (budget already matches). +- (3) nik 15.5 kHz cutoff: look for a frequency-limit or floor1 cutoff in the + psy/floor path that engages on that source; reelm/hein droop likely floor + underspend (finding 4). +- (4) Tonal 1–5 kHz on her/reelo/dl8a — minor (+3.1 to +6.5), fix after (1). + +## Deviations from this round's charter + +- Bit-split oracle measured inside `band_error_vs_reference` rather than the + 12 s × 128k-only `residue_histogram_vs_reference`: same + `decode_capture_with_bits` + `bit_split_summary` on the same files, one encode + pass instead of two, extended to all 14 rows. +- "25 Bark bands" in the charter vs 25 edges listed → 24 bands; edges taken as + authoritative. + +## Files + +- `crates/ec-vorbis/tests/oracle.rs` — new test (+ fft helper), 244 lines. +- `lanes/vorbis-psy-r1.bands.txt` — 394 lines, per-row band tables. +- `lanes/vorbis-psy-r1.bits.txt` — 71 lines, per-row bit split. +- `lanes/vorbis-psy-r1.report.md` — verdict, tables, diagnosis. +- Scratch oggs under `$CARGO_TARGET_DIR/.../scratch/vorbis7-bands/` (not + committed). + +Worktree intentionally live for round 4.