Merge branch 'lane-vorbis-psy': band-error and bit-split oracles locate the libvorbis gap
Browse files at this commit8 changed files +1769 -4
- crates/ec-vorbis/src/decode.rs +44 -1
- crates/ec-vorbis/src/encode.rs +66 -0
- crates/ec-vorbis/tests/oracle.rs +605 -3
- lanes/vorbis-psy-r1.bands.txt +394 -0
- lanes/vorbis-psy-r1.bits.txt +72 -0
- lanes/vorbis-psy-r1.histogram.txt +440 -0
- lanes/vorbis-psy-r1.report.md +88 -0
- lanes/vorbis-psy-r3.handoff.md +60 -0
crates/ec-vorbis/src/decode.rsmodified+44 -1
| @@ -47,6 +47,14 @@ pub struct VorbisDecoder { | ||
| 47 | 47 | next_pts: Option<i64>, |
| 48 | 48 | frames: VecDeque<Frame>, |
| 49 | 49 | drained: bool, |
| 50 | + /// Per-block captured decoded residue: (half, per-channel integer residue). | |
| 51 | + /// Populated only when `enable_residue_capture` is set. | |
| 52 | + residue_capture: Vec<(usize, Vec<Vec<i32>>)>, | |
| 53 | + /// Per-block bit split captured alongside: (floor bits, residue bits, packet bits). | |
| 54 | + bit_split: Vec<(u64, u64, u64)>, | |
| 55 | + /// When true, `decode_audio` copies each block's residue (after inverse | |
| 56 | + /// coupling, before floor multiply) into `residue_capture`. | |
| 57 | + enable_residue_capture: bool, | |
| 50 | 58 | } |
| 51 | 59 | |
| 52 | 60 | impl VorbisDecoder { |
| @@ -85,6 +93,9 @@ impl VorbisDecoder { | ||
| 85 | 93 | next_pts: None, |
| 86 | 94 | frames: VecDeque::new(), |
| 87 | 95 | drained: false, |
| 96 | + residue_capture: Vec::new(), | |
| 97 | + bit_split: Vec::new(), | |
| 98 | + enable_residue_capture: false, | |
| 88 | 99 | ident, |
| 89 | 100 | comments, |
| 90 | 101 | setup, |
| @@ -146,6 +157,8 @@ impl VorbisDecoder { | ||
| 146 | 157 | } |
| 147 | 158 | |
| 148 | 159 | let mapping = &self.setup.mappings[mode.mapping]; |
| 160 | + let packet_bits = u64::from(data.len() as u64) * 8; | |
| 161 | + let before_floors = bits.remaining(); | |
| 149 | 162 | let mut floors = Vec::with_capacity(channels); |
| 150 | 163 | let mut no_residue = Vec::with_capacity(channels); |
| 151 | 164 | for &submap in mapping.mux.iter().take(channels) { |
| @@ -160,6 +173,7 @@ impl VorbisDecoder { | ||
| 160 | 173 | no_residue.push(state.is_unused()); |
| 161 | 174 | floors.push(state); |
| 162 | 175 | } |
| 176 | + let after_floors = bits.remaining(); | |
| 163 | 177 | // A coupled pair shares its residue, so one live channel keeps both. |
| 164 | 178 | for &(magnitude, angle) in &mapping.coupling { |
| 165 | 179 | if !no_residue[magnitude] || !no_residue[angle] { |
| @@ -224,6 +238,20 @@ impl VorbisDecoder { | ||
| 224 | 238 | spectra[angle] = angles; |
| 225 | 239 | } |
| 226 | 240 | |
| 241 | + if self.enable_residue_capture { | |
| 242 | + let after_residues = bits.remaining(); | |
| 243 | + self.bit_split.push(( | |
| 244 | + before_floors - after_floors, | |
| 245 | + after_floors - after_residues, | |
| 246 | + packet_bits, | |
| 247 | + )); | |
| 248 | + let captured: Vec<Vec<i32>> = spectra | |
| 249 | + .iter() | |
| 250 | + .map(|ch| ch.iter().map(|&v| v.round() as i32).collect()) | |
| 251 | + .collect(); | |
| 252 | + self.residue_capture.push((half, captured)); | |
| 253 | + } | |
| 254 | + | |
| 227 | 255 | // Floor times residue, then out of the frequency domain. |
| 228 | 256 | let window = self.windows.get(mode.block_flag, previous_long, next_long); |
| 229 | 257 | let mdct = match mode.block_flag { |
| @@ -320,8 +348,23 @@ impl VorbisDecoder { | ||
| 320 | 348 | self.frames.clear(); |
| 321 | 349 | self.drained = false; |
| 322 | 350 | } |
| 323 | -} | |
| 324 | 351 | |
| 352 | + /// Enable per-block residue capture for offline histogram analysis. | |
| 353 | + pub fn enable_residue_capture(&mut self) { | |
| 354 | + self.enable_residue_capture = true; | |
| 355 | + } | |
| 356 | + | |
| 357 | + /// Take the captured per-block residue: each entry is `(half, per-channel integer residue)`. | |
| 358 | + pub fn take_residue_capture(&mut self) -> Vec<(usize, Vec<Vec<i32>>)> { | |
| 359 | + std::mem::take(&mut self.residue_capture) | |
| 360 | + } | |
| 361 | + | |
| 362 | + /// Take the per-block (floor bits, residue bits, packet bits) captured with the residue. | |
| 363 | + pub fn take_bit_split(&mut self) -> Vec<(u64, u64, u64)> { | |
| 364 | + std::mem::take(&mut self.bit_split) | |
| 365 | + } | |
| 366 | + | |
| 367 | +} | |
| 325 | 368 | /// Vorbis channel order (§4.3.9) mapped onto [`ChannelLayout`]'s order. |
| 326 | 369 | /// |
| 327 | 370 | /// Vorbis orders a 5.1 stream FL, FC, FR, BL, BR, LFE and a 7.1 stream FL, FC, |
crates/ec-vorbis/src/encode.rsmodified+66 -0
| @@ -262,6 +262,12 @@ pub struct VorbisEncoder { | ||
| 262 | 262 | reservoir_debt: f64, |
| 263 | 263 | finished: bool, |
| 264 | 264 | packets: std::collections::VecDeque<EncodedPacket>, |
| 265 | + /// Per-block captured quantised residue: (half, per-channel quantised). | |
| 266 | + /// Populated only when `enable_residue_capture` is set. | |
| 267 | + residue_capture: Vec<(usize, Vec<Vec<i32>>)>, | |
| 268 | + /// When true, `encode_block` copies each block's quantised residue into | |
| 269 | + /// `residue_capture` for offline histogram analysis. | |
| 270 | + enable_residue_capture: bool, | |
| 265 | 271 | } |
| 266 | 272 | |
| 267 | 273 | impl VorbisEncoder { |
| @@ -358,6 +364,8 @@ impl VorbisEncoder { | ||
| 358 | 364 | class_book, |
| 359 | 365 | residue_books, |
| 360 | 366 | coupling, |
| 367 | + residue_capture: Vec::new(), | |
| 368 | + enable_residue_capture: false, | |
| 361 | 369 | }) |
| 362 | 370 | } |
| 363 | 371 | |
| @@ -376,6 +384,21 @@ impl VorbisEncoder { | ||
| 376 | 384 | &self.params |
| 377 | 385 | } |
| 378 | 386 | |
| 387 | + /// Enable per-block quantised-residue capture for offline histogram analysis. | |
| 388 | + pub fn enable_residue_capture(&mut self) { | |
| 389 | + self.enable_residue_capture = true; | |
| 390 | + } | |
| 391 | + | |
| 392 | + /// Take the captured per-block quantised residue: each entry is `(half, per-channel quantised)`. | |
| 393 | + pub fn take_residue_capture(&mut self) -> Vec<(usize, Vec<Vec<i32>>)> { | |
| 394 | + std::mem::take(&mut self.residue_capture) | |
| 395 | + } | |
| 396 | + | |
| 397 | + /// Frequency in Barks for a given Hz — public so tests can bin by band. | |
| 398 | + pub fn bark_hz(hz: f64) -> f64 { | |
| 399 | + bark(hz) | |
| 400 | + } | |
| 401 | + | |
| 379 | 402 | /// Push planar samples, one slice per channel in [`ec_core::ChannelLayout`] order. |
| 380 | 403 | pub fn push_planar(&mut self, channels: &[&[f32]]) -> Result<()> { |
| 381 | 404 | if channels.len() != usize::from(self.config.channels) { |
| @@ -801,6 +824,37 @@ impl VorbisEncoder { | ||
| 801 | 824 | break (floor_values, quantised); |
| 802 | 825 | } |
| 803 | 826 | }; |
| 827 | + if self.enable_residue_capture { | |
| 828 | + // The bitstream stores the coupled magnitude/angle form; the | |
| 829 | + // decoder inverse-couples before floor multiply. Capture in that | |
| 830 | + // same per-channel domain so the histogram matches the decoder- | |
| 831 | + // side reference capture exactly (sanity: decoding our own .ogg | |
| 832 | + // reproduces these vectors). | |
| 833 | + // Main codes the full `half * channels` interleaved region (no | |
| 834 | + // HF truncation), so every bin below `half` is coded and the | |
| 835 | + // capture keeps the whole per-channel vector. | |
| 836 | + let coded = half; | |
| 837 | + let mut per_channel: Vec<Vec<i32>> = quantised | |
| 838 | + .iter() | |
| 839 | + .map(|ch| { | |
| 840 | + let mut v = ch[..coded].to_vec(); | |
| 841 | + v.resize(half, 0); | |
| 842 | + v | |
| 843 | + }) | |
| 844 | + .collect(); | |
| 845 | + for &(magnitude, angle) in &self.coupling { | |
| 846 | + let mut mags = std::mem::take(&mut per_channel[magnitude]); | |
| 847 | + let mut angs = std::mem::take(&mut per_channel[angle]); | |
| 848 | + for (m, a) in mags.iter_mut().zip(angs.iter_mut()) { | |
| 849 | + let (l, r) = decouple(*m, *a); | |
| 850 | + *m = l; | |
| 851 | + *a = r; | |
| 852 | + } | |
| 853 | + per_channel[magnitude] = mags; | |
| 854 | + per_channel[angle] = angs; | |
| 855 | + } | |
| 856 | + self.residue_capture.push((half, per_channel)); | |
| 857 | + } | |
| 804 | 858 | |
| 805 | 859 | let mut out = BitsOut::new(); |
| 806 | 860 | out.bit(false); |
| @@ -1088,6 +1142,18 @@ fn couple(left: i32, right: i32) -> (i32, i32) { | ||
| 1088 | 1142 | }, |
| 1089 | 1143 | } |
| 1090 | 1144 | } |
| 1145 | +/// Inverse square-polar coupling on integer residue — the exact inverse of | |
| 1146 | +/// [`couple`] and the integer form of the decoder's §9.4.2 step. Used only to | |
| 1147 | +/// bring the residue capture back to per-channel (magnitude/angle undone) so it | |
| 1148 | +/// matches the decoder-side capture domain. | |
| 1149 | +fn decouple(m: i32, a: i32) -> (i32, i32) { | |
| 1150 | + match (m > 0, a > 0) { | |
| 1151 | + (true, true) => (m, m - a), | |
| 1152 | + (true, false) => (m + a, m), | |
| 1153 | + (false, true) => (m, m + a), | |
| 1154 | + (false, false) => (m - a, m), | |
| 1155 | + } | |
| 1156 | +} | |
| 1091 | 1157 | |
| 1092 | 1158 | /// §7.2.2 `render_point`, which both sides of the floor coding need. |
| 1093 | 1159 | fn predict(x0: u32, y0: i32, x1: u32, y1: i32, x: u32) -> i32 { |
crates/ec-vorbis/tests/oracle.rsmodified+605 -3
| @@ -748,7 +748,337 @@ fn quiet_content_reaches_the_target_or_is_transparent() { | ||
| 748 | 748 | } |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | +/// Per-Bark-band quantised-residue histogram comparison: ours vs libvorbis | |
| 752 | +/// reference. We encode the source with our encoder (capturing residue), then | |
| 753 | +/// encode the same source with libvorbis and decode that stream with our own | |
| 754 | +/// decoder, capturing its decoded residue (after inverse coupling, before | |
| 755 | +/// floor multiply — the same domain as the encoder's `quantised`). The | |
| 756 | +/// reference is libvorbis's own residue, so per-band divergence names where | |
| 757 | +/// our psy spends differently from libvorbis. | |
| 758 | +#[test] | |
| 759 | +#[ignore = "slow: encodes 7 sources × 128k, needs ffmpeg/libvorbis"] | |
| 760 | +fn residue_histogram_vs_reference() { | |
| 761 | + use std::io::Write; | |
| 762 | + | |
| 763 | + let sources: &[(&str, &str)] = &[ | |
| 764 | + ("nik", "~/Music/reeln.mp4"), | |
| 765 | + ("reelo", "~/Music/reelo.mp3"), | |
| 766 | + ("her", "~/Music/reeli.mp3"), | |
| 767 | + ("reell", "~/Music/reell.mp4"), | |
| 768 | + ("reelm", "~/Music/reelm.wav"), | |
| 769 | + ("dl8a", "~/Downloads/8a3b6d1d19.mp3"), | |
| 770 | + ("hein", "~/Downloads/reelm.mp3"), | |
| 771 | + ]; | |
| 772 | + let bitrate = 128_000i32; | |
| 773 | + let rate = 48_000u32; | |
| 774 | + let channels = 2u16; | |
| 775 | + // Limit to ~12 s for speed — enough blocks for a stable histogram. | |
| 776 | + let max_samples = rate as usize * 12; | |
| 777 | + | |
| 778 | + let out_dir = scratch().join("vorbis7"); | |
| 779 | + std::fs::create_dir_all(&out_dir).expect("out dir"); | |
| 780 | + let mut report = String::new(); | |
| 781 | + report.push_str("# Residue histogram: ours vs libvorbis reference\n\n"); | |
| 782 | + report.push_str(&format!("Bitrate: {} kbps, {} Hz, {}ch, {} s max\n\n", | |
| 783 | + bitrate / 1000, rate, channels, max_samples / rate as usize)); | |
| 784 | + let mut total_ours_bytes = 0u64; | |
| 785 | + let mut total_ref_bytes = 0u64; | |
| 786 | + | |
| 787 | + for &(name, src_path) in sources { | |
| 788 | + let expanded = shellexpand(src_path); | |
| 789 | + let src = PathBuf::from(&expanded); | |
| 790 | + if !src.exists() { | |
| 791 | + report.push_str(&format!("## {name}: SKIP (file not found: {expanded})\n\n")); | |
| 792 | + continue; | |
| 793 | + } | |
| 794 | + // Decode source with ffmpeg, limit duration. | |
| 795 | + let Some((source_pcm, src_rate)) = ffmpeg_decode_limited(&src, rate, max_samples) else { | |
| 796 | + report.push_str(&format!("## {name}: SKIP (ffmpeg decode failed)\n\n")); | |
| 797 | + continue; | |
| 798 | + }; | |
| 799 | + if source_pcm.len() < 2 || source_pcm[0].is_empty() { | |
| 800 | + report.push_str(&format!("## {name}: SKIP (empty decode)\n\n")); | |
| 801 | + continue; | |
| 802 | + } | |
| 803 | + // Resample to 48k if needed — ffmpeg_decode_limited already targets 48k. | |
| 804 | + let _ = src_rate; | |
| 805 | + | |
| 806 | + // --- Ours: encode source with our encoder, capture residue, keep the ogg --- | |
| 807 | + let ours_ogg = out_dir.join(format!("ours-{name}-128k.ogg")); | |
| 808 | + let (ours_residue, ours_bytes) = | |
| 809 | + encode_and_capture(&source_pcm, rate, channels, bitrate, &ours_ogg); | |
| 810 | + | |
| 811 | + // --- Sanity: decoding our own ogg with capture on must reproduce the | |
| 812 | + // encoder's capture band for band, or the two captures are not in the | |
| 813 | + // same domain and the table below means nothing. --- | |
| 814 | + let (roundtrip, ours_split) = decode_capture_with_bits(&ours_ogg); | |
| 815 | + let (sanity_ok, sanity_detail) = compare_captures(&ours_residue, &roundtrip, rate); | |
| 816 | + let ours_bits = bit_split_summary(&ours_split, &roundtrip); | |
| 817 | + | |
| 818 | + // --- Reference: encode with libvorbis, decode with OUR decoder, capture --- | |
| 819 | + let ref_ogg = out_dir.join(format!("ref-{name}-128k.ogg")); | |
| 820 | + let ref_status = Command::new("ffmpeg") | |
| 821 | + // `-vn`: with the video stream still attached (reell, h264+aac mp4) | |
| 822 | + // ffmpeg's libvorbis wrapper ignores -b:a and encodes at ~3.2x the | |
| 823 | + // target; audio-only input encodes at the requested rate. | |
| 824 | + .args(["-y", "-v", "error", "-i"]) | |
| 825 | + .arg(&src) | |
| 826 | + .args(["-vn", "-t", &format!("{}", max_samples / rate as usize), | |
| 827 | + "-ac", "2", "-ar", "48000", | |
| 828 | + "-c:a", "libvorbis", "-b:a", "128k"]) | |
| 829 | + .arg(&ref_ogg) | |
| 830 | + .status(); | |
| 831 | + let (ref_residue, ref_split) = match ref_status { | |
| 832 | + Ok(s) if s.success() => decode_capture_with_bits(&ref_ogg), | |
| 833 | + _ => { | |
| 834 | + report.push_str(&format!("## {name}: libvorbis encode failed\n\n")); | |
| 835 | + continue; | |
| 836 | + } | |
| 837 | + }; | |
| 838 | + let ref_bytes = std::fs::metadata(&ref_ogg).expect("ref ogg").len(); | |
| 839 | + total_ours_bytes += ours_bytes; | |
| 840 | + total_ref_bytes += ref_bytes; | |
| 841 | + | |
| 842 | + // --- Build per-Bark-band histograms --- | |
| 843 | + let bins = 6; // |q|: 0, 1, 2, 3-4, 5-8, 9+ | |
| 844 | + let max_bark = 25; | |
| 845 | + let mut ours_hist = vec![vec![0u64; bins]; max_bark]; | |
| 846 | + let mut ref_hist = vec![vec![0u64; bins]; max_bark]; | |
| 847 | + for (half, quantised) in &ours_residue { | |
| 848 | + accumulate(quantised, *half, rate, &mut ours_hist, max_bark); | |
| 849 | + } | |
| 850 | + for (half, quantised) in &ref_residue { | |
| 851 | + accumulate(quantised, *half, rate, &mut ref_hist, max_bark); | |
| 852 | + } | |
| 853 | + | |
| 854 | + report.push_str(&format!( | |
| 855 | + "## {name} — sanity {}: {} — ours {} B vs ref {} B ({:.2}x)\n\n", | |
| 856 | + if sanity_ok { "PASS" } else { "FAIL" }, | |
| 857 | + sanity_detail, | |
| 858 | + ours_bytes, | |
| 859 | + ref_bytes, | |
| 860 | + ours_bytes as f64 / ref_bytes as f64 | |
| 861 | + )); | |
| 862 | + let ref_bits = bit_split_summary(&ref_split, &ref_residue); | |
| 863 | + for (who, b) in [("ours", ours_bits), ("ref", ref_bits)] { | |
| 864 | + let (f, r, p, nz) = b; | |
| 865 | + report.push_str(&format!( | |
| 866 | + "bits {who}: floor {f} ({:.1}%), residue {r} ({:.1}%), other {}, packet {p}; non-zero {nz}, residue bits/non-zero {:.2}\n", | |
| 867 | + 100.0 * f as f64 / p.max(1) as f64, | |
| 868 | + 100.0 * r as f64 / p.max(1) as f64, | |
| 869 | + p.saturating_sub(f + r), | |
| 870 | + r as f64 / nz.max(1) as f64 | |
| 871 | + )); | |
| 872 | + } | |
| 873 | + report.push('\n'); | |
| 874 | + report.push_str("| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio |\n"); | |
| 875 | + report.push_str("|------|-------------|-----|-----|-------|-------|------|-----------------|-------------|\n"); | |
| 876 | + for band in 0..max_bark { | |
| 877 | + let o = &ours_hist[band]; | |
| 878 | + let r = &ref_hist[band]; | |
| 879 | + let o_total: u64 = o.iter().sum(); | |
| 880 | + let r_total: u64 = r.iter().sum(); | |
| 881 | + if o_total == 0 && r_total == 0 { | |
| 882 | + continue; | |
| 883 | + } | |
| 884 | + // "Spend" = non-zero entries (bins 1..) — proxy for bits spent. | |
| 885 | + let o_spend: u64 = o[1..].iter().sum(); | |
| 886 | + let r_spend: u64 = r[1..].iter().sum(); | |
| 887 | + let ratio = if r_spend > 0 { | |
| 888 | + o_spend as f64 / r_spend as f64 | |
| 889 | + } else { f64::INFINITY }; | |
| 890 | + report.push_str(&format!( | |
| 891 | + "| {} | {}/{} | {}/{} | {}/{} | {}/{} | {}/{} | {}/{} | {}/{} | {:.2} |\n", | |
| 892 | + band, o[0], r[0], o[1], r[1], o[2], r[2], o[3], r[3], o[4], r[4], o[5], r[5], | |
| 893 | + o_total, r_total, ratio, | |
| 894 | + )); | |
| 895 | + } | |
| 896 | + | |
| 897 | + // Fraction table: per-band share of entries in each |q| class and the | |
| 898 | + // shape distance = sum |f_ours - f_ref| over the four classes | |
| 899 | + // (0 = identical spend shape; convergence target < 0.15 in Bark 3-22). | |
| 900 | + report.push_str("| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist |\n"); | |
| 901 | + report.push_str("|------|---------|--------|---------|--------|---------|--------|----------|---------|------|\n"); | |
| 902 | + let frac = |h: &[u64], total: u64| { | |
| 903 | + vec![ | |
| 904 | + h[0] as f64 / total as f64, | |
| 905 | + h[1] as f64 / total as f64, | |
| 906 | + h[2] as f64 / total as f64, | |
| 907 | + (h[3] + h[4] + h[5]) as f64 / total as f64, | |
| 908 | + ] | |
| 909 | + }; | |
| 910 | + let mut band_dist: Vec<(usize, f64)> = Vec::new(); | |
| 911 | + for band in 0..max_bark { | |
| 912 | + let o_total: u64 = ours_hist[band].iter().sum(); | |
| 913 | + let r_total: u64 = ref_hist[band].iter().sum(); | |
| 914 | + if o_total == 0 || r_total == 0 { | |
| 915 | + continue; | |
| 916 | + } | |
| 917 | + let fo = frac(&ours_hist[band], o_total); | |
| 918 | + let fr = frac(&ref_hist[band], r_total); | |
| 919 | + let dist: f64 = fo.iter().zip(&fr).map(|(a, b)| (a - b).abs()).sum(); | |
| 920 | + band_dist.push((band, dist)); | |
| 921 | + report.push_str(&format!( | |
| 922 | + "| {} | {:.3} | {:.3} | {:.3} | {:.3} | {:.3} | {:.3} | {:.3} | {:.3} | {:.3} |\n", | |
| 923 | + band, fo[0], fr[0], fo[1], fr[1], fo[2], fr[2], fo[3], fr[3], dist, | |
| 924 | + )); | |
| 925 | + } | |
| 926 | + let in_scope: Vec<(usize, f64)> = band_dist | |
| 927 | + .iter() | |
| 928 | + .filter(|(b, _)| (3..=22).contains(b)) | |
| 929 | + .cloned() | |
| 930 | + .collect(); | |
| 931 | + if !in_scope.is_empty() { | |
| 932 | + let max_d = in_scope.iter().map(|(_, d)| *d).fold(f64::MIN, f64::max); | |
| 933 | + let over = in_scope.iter().filter(|(_, d)| *d >= 0.15).count(); | |
| 934 | + report.push_str(&format!( | |
| 935 | + "\nshape Bark 3-22: max dist {max_d:.3}, bands >= 0.15: {over}/{} — {}\n", | |
| 936 | + in_scope.len(), | |
| 937 | + if over == 0 { "SHAPE PASS" } else { "shape fail" }, | |
| 938 | + )); | |
| 939 | + } | |
| 940 | + report.push_str("\n"); | |
| 941 | + } | |
| 942 | + | |
| 943 | + report.push_str(&format!( | |
| 944 | + "\nTotal bytes: ours {total_ours_bytes} vs ref {total_ref_bytes} ({:.2}x)\n", | |
| 945 | + total_ours_bytes as f64 / total_ref_bytes as f64, | |
| 946 | + )); | |
| 947 | + let report_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) | |
| 948 | + .join("../../lanes/vorbis-psy-r1.histogram.txt"); | |
| 949 | + let mut f = File::create(&report_path).expect("create report"); | |
| 950 | + f.write_all(report.as_bytes()).expect("write report"); | |
| 951 | + println!("Histogram report: {}", report_path.display()); | |
| 952 | + // Also print to stdout for immediate viewing. | |
| 953 | + print!("{report}"); | |
| 954 | +} | |
| 955 | + | |
| 956 | +/// Encode PCM with our encoder, capturing per-block quantised residue, and mux | |
| 957 | +/// the result to `out` so it can be decoded back (sanity check + rate). | |
| 958 | +fn encode_and_capture( | |
| 959 | + source: &[Vec<f32>], | |
| 960 | + rate: u32, | |
| 961 | + channels: u16, | |
| 962 | + bitrate: i32, | |
| 963 | + out: &Path, | |
| 964 | +) -> (Vec<(usize, Vec<Vec<i32>>)>, u64) { | |
| 965 | + let mut encoder = VorbisEncoder::new(EncoderConfig { | |
| 966 | + sample_rate: rate, | |
| 967 | + channels, | |
| 968 | + bitrate_bps: bitrate, | |
| 969 | + quality: 0.6, | |
| 970 | + }) | |
| 971 | + .expect("encoder"); | |
| 972 | + encoder.enable_residue_capture(); | |
| 973 | + let borrowed: Vec<&[f32]> = source.iter().map(|c| &c[..]).collect(); | |
| 974 | + encoder.push_planar(&borrowed).expect("push"); | |
| 975 | + encoder.finish(); | |
| 976 | + let mut packets = Vec::new(); | |
| 977 | + loop { | |
| 978 | + match encoder.next_packet() { | |
| 979 | + Ok(packet) => packets.push((packet.data, packet.granule)), | |
| 980 | + Err(e) if e.is_eof() => break, | |
| 981 | + Err(e) => panic!("encode: {e}"), | |
| 982 | + } | |
| 983 | + } | |
| 984 | + mux(out, &encoder, &packets, rate, channels); | |
| 985 | + let bytes = std::fs::metadata(out).expect("muxed file").len(); | |
| 986 | + (encoder.take_residue_capture(), bytes) | |
| 987 | +} | |
| 988 | + | |
| 989 | +/// Decode with ours, capturing per-block residue (after inverse coupling, | |
| 990 | +/// before floor multiply) — the decoder-side view of the same domain the | |
| 991 | +/// encoder captures. | |
| 992 | +fn decode_capture(path: &Path) -> Vec<(usize, Vec<Vec<i32>>)> { | |
| 993 | + decode_capture_with_bits(path).0 | |
| 994 | +} | |
| 995 | + | |
| 996 | +/// Bit split summed over the stream: (floor bits, residue bits, packet bits, | |
| 997 | +/// non-zero residue count) — bits per coded value is the coding-efficiency oracle. | |
| 998 | +fn bit_split_summary(split: &[(u64, u64, u64)], residue: &[(usize, Vec<Vec<i32>>)]) -> (u64, u64, u64, u64) { | |
| 999 | + let (mut f, mut r, mut p) = (0u64, 0u64, 0u64); | |
| 1000 | + for &(a, b, c) in split { | |
| 1001 | + f += a; | |
| 1002 | + r += b; | |
| 1003 | + p += c; | |
| 1004 | + } | |
| 1005 | + let nz: u64 = residue | |
| 1006 | + .iter() | |
| 1007 | + .map(|(_, chs)| chs.iter().map(|c| c.iter().filter(|&&v| v != 0).count() as u64).sum::<u64>()) | |
| 1008 | + .sum(); | |
| 1009 | + (f, r, p, nz) | |
| 1010 | +} | |
| 1011 | + | |
| 1012 | +fn decode_capture_with_bits(path: &Path) -> (Vec<(usize, Vec<Vec<i32>>)>, Vec<(u64, u64, u64)>) { | |
| 1013 | + let mut demuxer = OggDemuxer::open(File::open(path).expect("open")).expect("ogg"); | |
| 1014 | + let stream = demuxer | |
| 1015 | + .streams() | |
| 1016 | + .iter() | |
| 1017 | + .find(|s| s.params.codec == ec_core::CodecId::Vorbis) | |
| 1018 | + .expect("a Vorbis stream") | |
| 1019 | + .clone(); | |
| 1020 | + let extradata = stream.params.extradata.clone().expect("headers"); | |
| 1021 | + let mut decoder = VorbisDecoder::from_extradata(&extradata).expect("headers parse"); | |
| 1022 | + decoder.enable_residue_capture(); | |
| 1023 | + loop { | |
| 1024 | + let packet = match demuxer.next_packet() { | |
| 1025 | + Ok(packet) => packet, | |
| 1026 | + Err(e) if e.is_eof() => break, | |
| 1027 | + Err(e) => panic!("demux {}: {e}", path.display()), | |
| 1028 | + }; | |
| 1029 | + if packet.stream != stream.index { | |
| 1030 | + continue; | |
| 1031 | + } | |
| 1032 | + // A packet the decoder cannot use is skipped, like in `our_decode`. | |
| 1033 | + if decoder.decode_audio(&packet.data).is_err() { | |
| 1034 | + continue; | |
| 1035 | + } | |
| 1036 | + } | |
| 1037 | + let residue = decoder.take_residue_capture(); | |
| 1038 | + let bits = decoder.take_bit_split(); | |
| 1039 | + (residue, bits) | |
| 1040 | +} | |
| 751 | 1041 | |
| 1042 | +/// Bin two captures by Bark and compare every histogram cell. | |
| 1043 | +fn compare_captures( | |
| 1044 | + a: &[(usize, Vec<Vec<i32>>)], | |
| 1045 | + b: &[(usize, Vec<Vec<i32>>)], | |
| 1046 | + rate: u32, | |
| 1047 | +) -> (bool, String) { | |
| 1048 | + let bins = 6; | |
| 1049 | + let max_bark = 25; | |
| 1050 | + let mut ha = vec![vec![0u64; bins]; max_bark]; | |
| 1051 | + let mut hb = vec![vec![0u64; bins]; max_bark]; | |
| 1052 | + for (half, q) in a { | |
| 1053 | + accumulate(q, *half, rate, &mut ha, max_bark); | |
| 1054 | + } | |
| 1055 | + for (half, q) in b { | |
| 1056 | + accumulate(q, *half, rate, &mut hb, max_bark); | |
| 1057 | + } | |
| 1058 | + let mut diffs = Vec::new(); | |
| 1059 | + for band in 0..max_bark { | |
| 1060 | + for bucket in 0..bins { | |
| 1061 | + if ha[band][bucket] != hb[band][bucket] { | |
| 1062 | + diffs.push(format!( | |
| 1063 | + "bark {band} q{bucket}: {} vs {}", | |
| 1064 | + ha[band][bucket], hb[band][bucket] | |
| 1065 | + )); | |
| 1066 | + } | |
| 1067 | + } | |
| 1068 | + } | |
| 1069 | + if diffs.is_empty() { | |
| 1070 | + (true, format!("identical histograms ({} vs {} blocks)", a.len(), b.len())) | |
| 1071 | + } else { | |
| 1072 | + (false, format!( | |
| 1073 | + "{} vs {} blocks; first diffs: {}", | |
| 1074 | + a.len(), | |
| 1075 | + b.len(), | |
| 1076 | + diffs.iter().take(5).cloned().collect::<Vec<_>>().join("; ") | |
| 1077 | + )) | |
| 1078 | + } | |
| 1079 | +} | |
| 1080 | + | |
| 1081 | +/// Decode with ffmpeg into planar f32, resampled to `rate`, limited to `max_samples`. | |
| 752 | 1082 | fn ffmpeg_decode_limited(path: &Path, rate: u32, max_samples: usize) -> Option<(Vec<Vec<f32>>, u32)> { |
| 753 | 1083 | let out = Command::new("ffmpeg") |
| 754 | 1084 | .args(["-v", "error", "-i"]) |
| @@ -777,8 +1107,36 @@ fn ffmpeg_decode_limited(path: &Path, rate: u32, max_samples: usize) -> Option<( | ||
| 777 | 1107 | Some((planes, rate)) |
| 778 | 1108 | } |
| 779 | 1109 | |
| 1110 | +/// Accumulate per-Bark-band |q| histograms from quantised residue. | |
| 1111 | +fn accumulate( | |
| 1112 | + quantised: &[Vec<i32>], | |
| 1113 | + half: usize, | |
| 1114 | + rate: u32, | |
| 1115 | + hist: &mut [Vec<u64>], | |
| 1116 | + max_bark: usize, | |
| 1117 | +) { | |
| 1118 | + for channel in quantised { | |
| 1119 | + for (bin, &q) in channel.iter().enumerate() { | |
| 1120 | + if bin >= half { | |
| 1121 | + break; | |
| 1122 | + } | |
| 1123 | + let hz = bin as f64 * f64::from(rate) / (2.0 * half as f64); | |
| 1124 | + let bark = VorbisEncoder::bark_hz(hz) as usize; | |
| 1125 | + let band = bark.min(max_bark - 1); | |
| 1126 | + let bucket = match q.abs() { | |
| 1127 | + 0 => 0, | |
| 1128 | + 1 => 1, | |
| 1129 | + 2 => 2, | |
| 1130 | + 3..=4 => 3, | |
| 1131 | + 5..=8 => 4, | |
| 1132 | + _ => 5, | |
| 1133 | + }; | |
| 1134 | + hist[band][bucket] += 1; | |
| 1135 | + } | |
| 1136 | + } | |
| 1137 | +} | |
| 780 | 1138 | |
| 781 | - | |
| 1139 | +/// Expand `~` in a path string. | |
| 782 | 1140 | fn shellexpand(path: &str) -> String { |
| 783 | 1141 | if let Some(rest) = path.strip_prefix("~/") { |
| 784 | 1142 | let home = std::env::var("HOME").unwrap_or_else(|_| "/home".to_string()); |
| @@ -794,7 +1152,7 @@ fn shellexpand(path: &str) -> String { | ||
| 794 | 1152 | /// unmanaged VBR, 10-30% under nominal on real music), bytes within ±3% of |
| 795 | 1153 | /// it and correlation-to-source within .005 of it. Both encodes decode |
| 796 | 1154 | /// through our decoder so the gap measures the encoders, not the decoders. |
| 797 | -/// Writes `lanes/vorbis-reservoir.sweep.txt`. | |
| 1155 | +/// Writes `lanes/vorbis-psy-r1.sweep.txt`. | |
| 798 | 1156 | #[test] |
| 799 | 1157 | #[ignore = "slow: encodes 7 full sources × 2 rates, needs ffmpeg/libvorbis"] |
| 800 | 1158 | fn real_library_sweep_vs_reference() { |
| @@ -867,8 +1225,252 @@ fn real_library_sweep_vs_reference() { | ||
| 867 | 1225 | } |
| 868 | 1226 | eprintln!("\n{table}"); |
| 869 | 1227 | let _ = std::fs::write( |
| 870 | - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes/vorbis7-bisect.sweep.txt"), | |
| 1228 | + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes/vorbis-psy-r1.sweep.txt"), | |
| 871 | 1229 | &table, |
| 872 | 1230 | ); |
| 873 | 1231 | assert!(failures.is_empty(), "sweep failures: {failures:?}"); |
| 874 | 1232 | } |
| 1233 | + | |
| 1234 | +/// In-place radix-2 FFT. Only magnitudes and differences of identically | |
| 1235 | +/// transformed spectra are used, so the twiddle sign convention is irrelevant. | |
| 1236 | +fn fft(re: &mut [f64], im: &mut [f64]) { | |
| 1237 | + let n = re.len(); | |
| 1238 | + assert!(n.is_power_of_two()); | |
| 1239 | + let bits = n.trailing_zeros(); | |
| 1240 | + for i in 0..n { | |
| 1241 | + let j = ((i as u32).reverse_bits() >> (32 - bits)) as usize; | |
| 1242 | + if j > i { | |
| 1243 | + re.swap(i, j); | |
| 1244 | + im.swap(i, j); | |
| 1245 | + } | |
| 1246 | + } | |
| 1247 | + let mut len = 2; | |
| 1248 | + while len <= n { | |
| 1249 | + let half = len / 2; | |
| 1250 | + let step = std::f64::consts::TAU / len as f64; | |
| 1251 | + for start in (0..n).step_by(len) { | |
| 1252 | + for k in 0..half { | |
| 1253 | + let angle = step * k as f64; | |
| 1254 | + let (wr, wi) = (angle.cos(), angle.sin()); | |
| 1255 | + let i = start + k; | |
| 1256 | + let j = i + half; | |
| 1257 | + let tr = re[j] * wr - im[j] * wi; | |
| 1258 | + let ti = re[j] * wi + im[j] * wr; | |
| 1259 | + re[j] = re[i] - tr; | |
| 1260 | + im[j] = im[i] - ti; | |
| 1261 | + re[i] += tr; | |
| 1262 | + im[i] += ti; | |
| 1263 | + } | |
| 1264 | + } | |
| 1265 | + len *= 2; | |
| 1266 | + } | |
| 1267 | +} | |
| 1268 | + | |
| 1269 | +/// Per-Bark-band spectral error, ours vs libvorbis, both decoded through our | |
| 1270 | +/// decoder (so the gap measures encoders, not decoders): every 2048-sample | |
| 1271 | +/// Hann frame (hop 1024) of the 48 kHz source, band edges in Hz (25 edges → | |
| 1272 | +/// 24 bands), energies summed over frames and both channels. | |
| 1273 | +/// NSR = 10log10(Σ|X_sig−X_src|²/Σ|X_src|²), E = 10log10(Σ|X_sig|²/Σ|X_src|²). | |
| 1274 | +/// The same pass records the bit split of both streams (the decode-side | |
| 1275 | +/// capture `decode_capture_with_bits` provides), so the bits table covers the | |
| 1276 | +/// same rows without a second encode pass. Writes | |
| 1277 | +/// `lanes/vorbis-psy-r1.bands.txt` and `lanes/vorbis-psy-r1.bits.txt`. | |
| 1278 | +#[test] | |
| 1279 | +#[ignore = "slow: encodes 7 full sources × 2 rates, needs ffmpeg/libvorbis"] | |
| 1280 | +fn band_error_vs_reference() { | |
| 1281 | + use std::io::Write; | |
| 1282 | + | |
| 1283 | + let sources: &[(&str, &str)] = &[ | |
| 1284 | + ("nik", "~/Music/reeln.mp4"), | |
| 1285 | + ("reelo", "~/Music/reelo.mp3"), | |
| 1286 | + ("her", "~/Music/reeli.mp3"), | |
| 1287 | + ("reell", "~/Music/reell.mp4"), | |
| 1288 | + ("reelm", "~/Music/reelm.wav"), | |
| 1289 | + ("dl8a", "~/Downloads/8a3b6d1d19.mp3"), | |
| 1290 | + ("hein", "~/Downloads/reelm.mp3"), | |
| 1291 | + ]; | |
| 1292 | + let rate = 48_000u32; | |
| 1293 | + let max_samples = rate as usize * 600; | |
| 1294 | + let out_dir = scratch().join("vorbis7-bands"); | |
| 1295 | + std::fs::create_dir_all(&out_dir).expect("out dir"); | |
| 1296 | + | |
| 1297 | + const FRAME: usize = 2048; | |
| 1298 | + const HOP: usize = 1024; | |
| 1299 | + const EDGES: [f64; 25] = [ | |
| 1300 | + 100.0, 200.0, 300.0, 400.0, 510.0, 630.0, 770.0, 920.0, 1080.0, 1270.0, 1480.0, 1720.0, | |
| 1301 | + 2000.0, 2320.0, 2700.0, 3150.0, 3700.0, 4400.0, 5300.0, 6400.0, 7700.0, 9500.0, 12000.0, | |
| 1302 | + 15500.0, 24000.0, | |
| 1303 | + ]; | |
| 1304 | + let band_of: Vec<Option<usize>> = (0..=FRAME / 2) | |
| 1305 | + .map(|bin| { | |
| 1306 | + let hz = bin as f64 * f64::from(rate) / FRAME as f64; | |
| 1307 | + EDGES.windows(2).position(|w| hz >= w[0] && hz < w[1]) | |
| 1308 | + }) | |
| 1309 | + .collect(); | |
| 1310 | + let window: Vec<f64> = (0..FRAME) | |
| 1311 | + .map(|i| 0.5 - 0.5 * (std::f64::consts::TAU * i as f64 / FRAME as f64).cos()) | |
| 1312 | + .collect(); | |
| 1313 | + | |
| 1314 | + let mut bands = String::from("# Band error: ours vs libvorbis, both via our decoder\n\n"); | |
| 1315 | + let mut bits = String::from("# Bit split over full sources, same rows as the band error\n\n"); | |
| 1316 | + let only = std::env::var("SWEEP_ONLY").ok(); | |
| 1317 | + for &(name, src_path) in sources { | |
| 1318 | + if only.as_deref().is_some_and(|o| !o.split(',').any(|n| n == name)) { | |
| 1319 | + continue; | |
| 1320 | + } | |
| 1321 | + let src = PathBuf::from(shellexpand(src_path)); | |
| 1322 | + if !src.exists() { | |
| 1323 | + bands.push_str(&format!("## {name}: SKIP (missing)\n\n")); | |
| 1324 | + continue; | |
| 1325 | + } | |
| 1326 | + let Some((source_pcm, _)) = ffmpeg_decode_limited(&src, rate, max_samples) else { | |
| 1327 | + bands.push_str(&format!("## {name}: SKIP (decode)\n\n")); | |
| 1328 | + continue; | |
| 1329 | + }; | |
| 1330 | + let seconds = source_pcm[0].len() as f64 / f64::from(rate); | |
| 1331 | + let bytes = |p: &Path| std::fs::metadata(p).expect("size").len() as f64; | |
| 1332 | + for &kbps in &[96i32, 128] { | |
| 1333 | + let t0 = std::time::Instant::now(); | |
| 1334 | + let reference = out_dir.join(format!("ref-{name}-{kbps}k.ogg")); | |
| 1335 | + let status = Command::new("ffmpeg") | |
| 1336 | + .args(["-y", "-v", "error", "-i"]) | |
| 1337 | + .arg(&src) | |
| 1338 | + .args(["-vn", "-t", "600", "-ac", "2", "-ar", "48000", "-c:a", "libvorbis", "-b:a", &format!("{kbps}k")]) | |
| 1339 | + .arg(&reference) | |
| 1340 | + .status() | |
| 1341 | + .expect("ffmpeg runs"); | |
| 1342 | + assert!(status.success(), "libvorbis encode of {name} at {kbps}k"); | |
| 1343 | + let ref_kbps = bytes(&reference) * 8.0 / seconds / 1000.0; | |
| 1344 | + // Ours at the size libvorbis actually produced, exactly as the sweep. | |
| 1345 | + let ours = encode_to_file( | |
| 1346 | + &source_pcm, | |
| 1347 | + rate, | |
| 1348 | + (ref_kbps * 1000.0).round() as i32, | |
| 1349 | + &format!("vorbis7-bands/ours-{name}-{kbps}k.ogg"), | |
| 1350 | + ); | |
| 1351 | + let ours_kbps = bytes(&ours) * 8.0 / seconds / 1000.0; | |
| 1352 | + | |
| 1353 | + // PCM through our decoder for the band error; bit split from the | |
| 1354 | + // same file's residue-domain capture (decode twice — the capture | |
| 1355 | + // path returns no PCM). | |
| 1356 | + let (ours_pcm, ours_split) = { | |
| 1357 | + let (residue, split) = decode_capture_with_bits(&ours); | |
| 1358 | + (our_decode(&ours).0, bit_split_summary(&split, &residue)) | |
| 1359 | + }; | |
| 1360 | + let (ref_pcm, ref_split) = { | |
| 1361 | + let (residue, split) = decode_capture_with_bits(&reference); | |
| 1362 | + (our_decode(&reference).0, bit_split_summary(&split, &residue)) | |
| 1363 | + }; | |
| 1364 | + | |
| 1365 | + // Bit-split block: (floor, residue, packet, non-zero) per stream. | |
| 1366 | + let (of, ores, op, onz) = ours_split; | |
| 1367 | + let (rf, rres, rp, rnz) = ref_split; | |
| 1368 | + bits.push_str(&format!( | |
| 1369 | + "## {name} @ {kbps}k (ours {ours_kbps:.1} vs ref {ref_kbps:.1} kbps)\n" | |
| 1370 | + )); | |
| 1371 | + for (who, f, r, p, nz) in [("ours", of, ores, op, onz), ("ref ", rf, rres, rp, rnz)] { | |
| 1372 | + bits.push_str(&format!( | |
| 1373 | + "{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", | |
| 1374 | + fb = f as f64 / seconds, | |
| 1375 | + fpc = 100.0 * f as f64 / p.max(1) as f64, | |
| 1376 | + rb = r as f64 / seconds, | |
| 1377 | + rpc = 100.0 * r as f64 / p.max(1) as f64, | |
| 1378 | + ob = p.saturating_sub(f + r) as f64 / seconds, | |
| 1379 | + bnz = r as f64 / nz.max(1) as f64, | |
| 1380 | + )); | |
| 1381 | + } | |
| 1382 | + bits.push_str(&format!( | |
| 1383 | + "ratio floor {:.3} residue {:.3} bits/nz {:.3}\n\n", | |
| 1384 | + of as f64 / rf.max(1) as f64, | |
| 1385 | + ores as f64 / rres.max(1) as f64, | |
| 1386 | + (ores as f64 / onz.max(1) as f64) / (rres as f64 / rnz.max(1) as f64), | |
| 1387 | + )); | |
| 1388 | + | |
| 1389 | + // Band error: align to the source exactly as the sweep does — | |
| 1390 | + // common length from sample 0 (pre-roll trim inside `our_decode`). | |
| 1391 | + let n = source_pcm[0] | |
| 1392 | + .len() | |
| 1393 | + .min(ours_pcm[0].len()) | |
| 1394 | + .min(ref_pcm[0].len()); | |
| 1395 | + let nb = EDGES.len() - 1; | |
| 1396 | + let (mut e_src, mut e_ours, mut e_ref) = | |
| 1397 | + (vec![0f64; nb], vec![0f64; nb], vec![0f64; nb]); | |
| 1398 | + let (mut err_ours, mut err_ref) = (vec![0f64; nb], vec![0f64; nb]); | |
| 1399 | + let mut spec: Vec<(Vec<f64>, Vec<f64>)> = | |
| 1400 | + (0..3).map(|_| (vec![0.0; FRAME], vec![0.0; FRAME])).collect(); | |
| 1401 | + let mut start = 0; | |
| 1402 | + while start + FRAME <= n { | |
| 1403 | + for ch in 0..2 { | |
| 1404 | + for (sig, pcm) in [&source_pcm, &ours_pcm, &ref_pcm].iter().enumerate() { | |
| 1405 | + let s = &mut spec[sig]; | |
| 1406 | + for i in 0..FRAME { | |
| 1407 | + s.0[i] = f64::from(pcm[ch][start + i]) * window[i]; | |
| 1408 | + s.1[i] = 0.0; | |
| 1409 | + } | |
| 1410 | + fft(&mut s.0, &mut s.1); | |
| 1411 | + } | |
| 1412 | + for k in 0..=FRAME / 2 { | |
| 1413 | + let Some(b) = band_of[k] else { continue }; | |
| 1414 | + let (sr, si) = (spec[0].0[k], spec[0].1[k]); | |
| 1415 | + e_src[b] += sr * sr + si * si; | |
| 1416 | + let (ur, ui) = (spec[1].0[k], spec[1].1[k]); | |
| 1417 | + e_ours[b] += ur * ur + ui * ui; | |
| 1418 | + let (dr, di) = (ur - sr, ui - si); | |
| 1419 | + err_ours[b] += dr * dr + di * di; | |
| 1420 | + let (vr, vi) = (spec[2].0[k], spec[2].1[k]); | |
| 1421 | + e_ref[b] += vr * vr + vi * vi; | |
| 1422 | + let (er, ei) = (vr - sr, vi - si); | |
| 1423 | + err_ref[b] += er * er + ei * ei; | |
| 1424 | + } | |
| 1425 | + } | |
| 1426 | + start += HOP; | |
| 1427 | + } | |
| 1428 | + let db = |e: f64, s: f64| if s > 0.0 { 10.0 * (e / s).log10() } else { f64::NAN }; | |
| 1429 | + bands.push_str(&format!( | |
| 1430 | + "## {name} @ {kbps}k (ours {ours_kbps:.1} vs ref {ref_kbps:.1} kbps)\n" | |
| 1431 | + )); | |
| 1432 | + bands.push_str("band NSR_ours NSR_ref dNSR E_ours E_ref\n"); | |
| 1433 | + for b in 0..nb { | |
| 1434 | + if e_src[b] == 0.0 { | |
| 1435 | + continue; // no source energy: NSR/E undefined | |
| 1436 | + } | |
| 1437 | + let (nsr_o, nsr_r) = (db(err_ours[b], e_src[b]), db(err_ref[b], e_src[b])); | |
| 1438 | + bands.push_str(&format!( | |
| 1439 | + "{:<8} {:7.1} {:7.1} {:6.1} {:7.1} {:7.1}\n", | |
| 1440 | + format!("{}-{}", EDGES[b] as usize, EDGES[b + 1] as usize), | |
| 1441 | + nsr_o, | |
| 1442 | + nsr_r, | |
| 1443 | + nsr_o - nsr_r, | |
| 1444 | + db(e_ours[b], e_src[b]), | |
| 1445 | + db(e_ref[b], e_src[b]), | |
| 1446 | + )); | |
| 1447 | + } | |
| 1448 | + let corr = |pcm: &[Vec<f32>]| { | |
| 1449 | + (0..2) | |
| 1450 | + .map(|c| correlation(&pcm[c][..n], &source_pcm[c][..n])) | |
| 1451 | + .sum::<f64>() | |
| 1452 | + / 2.0 | |
| 1453 | + }; | |
| 1454 | + bands.push_str(&format!( | |
| 1455 | + "broadband corr: ours {:.4} ref {:.4}\n\n", | |
| 1456 | + corr(&ours_pcm), | |
| 1457 | + corr(&ref_pcm), | |
| 1458 | + )); | |
| 1459 | + eprintln!( | |
| 1460 | + "{name}@{kbps}k: ours {ours_kbps:.1} ref {ref_kbps:.1} kbps, {:.1} s", | |
| 1461 | + t0.elapsed().as_secs_f32() | |
| 1462 | + ); | |
| 1463 | + } | |
| 1464 | + } | |
| 1465 | + for (text, file) in [ | |
| 1466 | + (&bands, "vorbis-psy-r1.bands.txt"), | |
| 1467 | + (&bits, "vorbis-psy-r1.bits.txt"), | |
| 1468 | + ] { | |
| 1469 | + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) | |
| 1470 | + .join("../../lanes") | |
| 1471 | + .join(file); | |
| 1472 | + let mut f = File::create(&path).expect("create report"); | |
| 1473 | + f.write_all(text.as_bytes()).expect("write report"); | |
| 1474 | + println!("{file}: {}", path.display()); | |
| 1475 | + } | |
| 1476 | +} |
lanes/vorbis-psy-r1.bands.txtadded+394 -0
| @@ -0,0 +1,394 @@ | ||
| 1 | +# Band error: ours vs libvorbis, both via our decoder | |
| 2 | + | |
| 3 | +## nik @ 96k (ours 84.0 vs ref 84.5 kbps) | |
| 4 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 5 | +100-200 -15.5 -21.8 6.3 -0.0 -0.1 | |
| 6 | +200-300 -12.4 -19.6 7.2 -0.1 -0.1 | |
| 7 | +300-400 -13.3 -22.8 9.5 -0.2 -0.1 | |
| 8 | +400-510 -10.6 -20.2 9.6 -0.3 -0.1 | |
| 9 | +510-630 -9.9 -19.5 9.5 -0.3 -0.1 | |
| 10 | +630-770 -12.2 -23.3 11.0 -0.2 -0.0 | |
| 11 | +770-920 -11.4 -21.3 9.8 -0.3 -0.1 | |
| 12 | +920-1080 -12.6 -22.2 9.6 -0.1 -0.0 | |
| 13 | +1080-1270 -8.3 -13.9 5.6 -0.5 -0.2 | |
| 14 | +1270-1480 -9.5 -15.4 5.9 -0.4 -0.2 | |
| 15 | +1480-1720 -8.9 -13.0 4.2 -0.5 -0.3 | |
| 16 | +1720-2000 -8.1 -12.8 4.8 -0.7 -0.3 | |
| 17 | +2000-2320 -6.5 -10.1 3.6 -0.9 -0.3 | |
| 18 | +2320-2700 -8.6 -12.1 3.6 -0.5 -0.4 | |
| 19 | +2700-3150 -8.6 -11.0 2.4 -0.6 -0.3 | |
| 20 | +3150-3700 -9.5 -12.9 3.4 -0.4 -0.3 | |
| 21 | +3700-4400 -7.9 -11.5 3.6 -0.6 -0.3 | |
| 22 | +4400-5300 -7.0 -10.6 3.6 -0.4 -0.3 | |
| 23 | +5300-6400 -3.8 -6.6 2.8 -1.1 -0.2 | |
| 24 | +6400-7700 -4.9 -6.7 1.7 -1.0 -0.0 | |
| 25 | +7700-9500 -5.7 -5.8 0.1 -0.6 0.2 | |
| 26 | +9500-12000 -6.5 -6.2 -0.3 -0.4 0.0 | |
| 27 | +12000-15500 -4.5 -4.5 -0.1 -1.2 0.5 | |
| 28 | +15500-24000 0.1 2.0 -1.9 -19.0 -2.3 | |
| 29 | +broadband corr: ours 0.9690 ref 0.9903 | |
| 30 | + | |
| 31 | +## nik @ 128k (ours 115.5 vs ref 115.8 kbps) | |
| 32 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 33 | +100-200 -19.5 -24.8 5.3 -0.0 -0.1 | |
| 34 | +200-300 -15.9 -23.5 7.6 -0.1 -0.1 | |
| 35 | +300-400 -16.8 -26.6 9.8 -0.1 -0.0 | |
| 36 | +400-510 -13.6 -24.5 10.9 -0.1 -0.0 | |
| 37 | +510-630 -12.7 -24.1 11.5 -0.1 -0.0 | |
| 38 | +630-770 -15.4 -27.5 12.1 -0.1 0.0 | |
| 39 | +770-920 -14.3 -25.9 11.6 -0.1 -0.0 | |
| 40 | +920-1080 -15.5 -27.3 11.8 -0.0 0.0 | |
| 41 | +1080-1270 -10.3 -19.2 8.9 -0.3 -0.1 | |
| 42 | +1270-1480 -12.0 -20.3 8.3 -0.2 -0.1 | |
| 43 | +1480-1720 -11.4 -17.4 6.0 -0.2 -0.1 | |
| 44 | +1720-2000 -10.5 -16.0 5.5 -0.4 -0.2 | |
| 45 | +2000-2320 -8.8 -12.9 4.2 -0.5 -0.2 | |
| 46 | +2320-2700 -11.2 -15.1 3.9 -0.3 -0.2 | |
| 47 | +2700-3150 -11.6 -14.0 2.4 -0.3 -0.2 | |
| 48 | +3150-3700 -12.6 -15.6 3.0 -0.2 -0.2 | |
| 49 | +3700-4400 -10.4 -14.1 3.7 -0.2 -0.2 | |
| 50 | +4400-5300 -8.7 -13.8 5.1 -0.1 -0.2 | |
| 51 | +5300-6400 -5.3 -9.8 4.5 -0.4 -0.3 | |
| 52 | +6400-7700 -7.0 -9.9 3.0 -0.3 -0.4 | |
| 53 | +7700-9500 -7.2 -7.5 0.3 -0.0 -0.3 | |
| 54 | +9500-12000 -8.0 -8.1 0.0 0.1 -0.4 | |
| 55 | +12000-15500 -6.4 -6.4 0.1 -0.4 -0.3 | |
| 56 | +15500-24000 0.1 2.2 -2.2 -19.0 -1.8 | |
| 57 | +broadband corr: ours 0.9838 ref 0.9951 | |
| 58 | + | |
| 59 | +## reelo @ 96k (ours 81.5 vs ref 81.8 kbps) | |
| 60 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 61 | +100-200 -14.6 -18.8 4.3 -0.1 -0.1 | |
| 62 | +200-300 -14.5 -21.5 7.0 -0.1 -0.1 | |
| 63 | +300-400 -11.7 -21.0 9.3 -0.2 -0.1 | |
| 64 | +400-510 -11.0 -20.2 9.3 -0.3 -0.1 | |
| 65 | +510-630 -12.8 -23.8 11.0 -0.1 -0.0 | |
| 66 | +630-770 -10.4 -20.6 10.2 -0.3 -0.0 | |
| 67 | +770-920 -10.0 -19.5 9.5 -0.3 -0.1 | |
| 68 | +920-1080 -8.8 -15.8 7.0 -0.4 -0.2 | |
| 69 | +1080-1270 -11.0 -16.3 5.4 -0.3 -0.2 | |
| 70 | +1270-1480 -10.8 -14.0 3.2 -0.3 -0.3 | |
| 71 | +1480-1720 -10.3 -12.2 2.0 -0.3 -0.3 | |
| 72 | +1720-2000 -8.1 -11.4 3.3 -0.6 -0.4 | |
| 73 | +2000-2320 -6.3 -9.8 3.6 -1.0 -0.4 | |
| 74 | +2320-2700 -5.7 -9.9 4.3 -1.2 -0.3 | |
| 75 | +2700-3150 -7.2 -11.4 4.2 -0.8 -0.4 | |
| 76 | +3150-3700 -6.0 -9.9 3.9 -1.1 -0.4 | |
| 77 | +3700-4400 -6.8 -11.0 4.2 -0.7 -0.4 | |
| 78 | +4400-5300 -5.4 -8.9 3.5 -1.0 -0.4 | |
| 79 | +5300-6400 -7.6 -9.1 1.4 -0.6 -0.2 | |
| 80 | +6400-7700 -7.5 -9.0 1.5 -0.6 -0.1 | |
| 81 | +7700-9500 -6.4 -7.2 0.8 -0.9 0.2 | |
| 82 | +9500-12000 -6.4 -7.1 0.7 -1.0 0.2 | |
| 83 | +12000-15500 -4.7 -5.5 0.8 -1.6 0.6 | |
| 84 | +15500-24000 -4.1 -8.2 4.0 -1.6 -0.2 | |
| 85 | +broadband corr: ours 0.9739 ref 0.9922 | |
| 86 | + | |
| 87 | +## reelo @ 128k (ours 109.1 vs ref 108.6 kbps) | |
| 88 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 89 | +100-200 -18.3 -22.7 4.4 -0.0 -0.1 | |
| 90 | +200-300 -18.2 -25.3 7.1 -0.0 -0.0 | |
| 91 | +300-400 -15.1 -25.0 9.9 -0.1 -0.1 | |
| 92 | +400-510 -13.9 -24.8 10.9 -0.1 -0.0 | |
| 93 | +510-630 -15.9 -28.4 12.5 -0.0 0.0 | |
| 94 | +630-770 -13.0 -25.1 12.1 -0.1 -0.0 | |
| 95 | +770-920 -12.7 -23.5 10.8 -0.2 -0.0 | |
| 96 | +920-1080 -11.3 -19.0 7.7 -0.2 -0.1 | |
| 97 | +1080-1270 -13.9 -19.5 5.5 -0.1 -0.1 | |
| 98 | +1270-1480 -13.7 -16.9 3.2 -0.1 -0.2 | |
| 99 | +1480-1720 -12.9 -14.5 1.5 -0.1 -0.3 | |
| 100 | +1720-2000 -10.7 -13.3 2.6 -0.3 -0.3 | |
| 101 | +2000-2320 -8.6 -11.2 2.6 -0.5 -0.3 | |
| 102 | +2320-2700 -7.9 -11.4 3.4 -0.7 -0.3 | |
| 103 | +2700-3150 -9.7 -13.1 3.4 -0.4 -0.3 | |
| 104 | +3150-3700 -8.4 -11.6 3.2 -0.6 -0.3 | |
| 105 | +3700-4400 -9.2 -12.4 3.3 -0.3 -0.4 | |
| 106 | +4400-5300 -7.7 -10.2 2.5 -0.4 -0.4 | |
| 107 | +5300-6400 -10.1 -10.5 0.3 -0.2 -0.4 | |
| 108 | +6400-7700 -10.2 -10.6 0.4 -0.2 -0.4 | |
| 109 | +7700-9500 -9.0 -8.3 -0.7 -0.4 -0.3 | |
| 110 | +9500-12000 -9.0 -8.4 -0.7 -0.4 -0.3 | |
| 111 | +12000-15500 -6.7 -7.6 0.9 -0.9 -0.3 | |
| 112 | +15500-24000 -5.6 -12.3 6.7 -1.2 -0.3 | |
| 113 | +broadband corr: ours 0.9868 ref 0.9955 | |
| 114 | + | |
| 115 | +## her @ 96k (ours 89.9 vs ref 89.9 kbps) | |
| 116 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 117 | +100-200 -13.9 -21.6 7.7 -0.0 -0.1 | |
| 118 | +200-300 -11.4 -20.8 9.4 -0.2 -0.1 | |
| 119 | +300-400 -10.5 -21.8 11.3 -0.4 -0.1 | |
| 120 | +400-510 -8.5 -20.3 11.8 -0.6 -0.1 | |
| 121 | +510-630 -7.6 -17.9 10.2 -0.7 -0.1 | |
| 122 | +630-770 -9.5 -21.6 12.1 -0.5 -0.1 | |
| 123 | +770-920 -6.5 -15.2 8.7 -1.0 -0.2 | |
| 124 | +920-1080 -11.1 -20.8 9.7 -0.2 -0.1 | |
| 125 | +1080-1270 -6.1 -12.6 6.5 -1.1 -0.4 | |
| 126 | +1270-1480 -5.6 -10.3 4.7 -1.2 -0.4 | |
| 127 | +1480-1720 -6.2 -9.9 3.7 -1.1 -0.4 | |
| 128 | +1720-2000 -5.9 -9.4 3.5 -1.2 -0.5 | |
| 129 | +2000-2320 -5.3 -7.7 2.4 -1.3 -0.5 | |
| 130 | +2320-2700 -5.9 -8.5 2.5 -1.2 -0.5 | |
| 131 | +2700-3150 -5.8 -9.1 3.4 -1.2 -0.5 | |
| 132 | +3150-3700 -4.7 -7.8 3.1 -1.7 -0.5 | |
| 133 | +3700-4400 -3.6 -7.5 4.0 -1.6 -0.5 | |
| 134 | +4400-5300 -2.8 -6.7 3.9 -1.8 -0.5 | |
| 135 | +5300-6400 -3.1 -4.2 1.1 -1.3 -0.2 | |
| 136 | +6400-7700 -3.7 -3.1 -0.7 -0.9 -0.1 | |
| 137 | +7700-9500 -3.1 -1.3 -1.8 -1.2 0.6 | |
| 138 | +9500-12000 -3.0 -1.3 -1.7 -1.6 0.7 | |
| 139 | +12000-15500 -3.0 -1.6 -1.4 -1.6 0.7 | |
| 140 | +15500-24000 -2.3 -0.9 -1.4 -2.4 -3.0 | |
| 141 | +broadband corr: ours 0.9668 ref 0.9867 | |
| 142 | + | |
| 143 | +## her @ 128k (ours 123.5 vs ref 124.9 kbps) | |
| 144 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 145 | +100-200 -17.5 -25.0 7.4 -0.0 -0.1 | |
| 146 | +200-300 -14.7 -24.7 10.0 -0.1 -0.0 | |
| 147 | +300-400 -13.5 -25.6 12.1 -0.2 -0.0 | |
| 148 | +400-510 -11.6 -24.3 12.7 -0.2 -0.1 | |
| 149 | +510-630 -10.2 -22.5 12.2 -0.3 -0.1 | |
| 150 | +630-770 -12.4 -25.4 13.0 -0.2 -0.0 | |
| 151 | +770-920 -8.8 -19.8 11.0 -0.5 -0.1 | |
| 152 | +920-1080 -13.9 -24.6 10.8 -0.1 -0.0 | |
| 153 | +1080-1270 -8.5 -16.3 7.8 -0.6 -0.3 | |
| 154 | +1270-1480 -7.7 -14.1 6.4 -0.7 -0.3 | |
| 155 | +1480-1720 -8.5 -13.9 5.4 -0.6 -0.3 | |
| 156 | +1720-2000 -8.1 -13.2 5.1 -0.6 -0.3 | |
| 157 | +2000-2320 -7.5 -11.0 3.5 -0.7 -0.4 | |
| 158 | +2320-2700 -8.3 -11.6 3.3 -0.6 -0.4 | |
| 159 | +2700-3150 -8.2 -12.0 3.8 -0.6 -0.4 | |
| 160 | +3150-3700 -6.8 -10.3 3.4 -0.9 -0.4 | |
| 161 | +3700-4400 -4.9 -10.1 5.2 -0.9 -0.4 | |
| 162 | +4400-5300 -3.8 -9.8 5.9 -0.9 -0.4 | |
| 163 | +5300-6400 -3.5 -10.1 6.6 -0.5 -0.4 | |
| 164 | +6400-7700 -4.0 -10.9 6.9 -0.2 -0.5 | |
| 165 | +7700-9500 -3.4 -2.7 -0.6 -0.3 -0.1 | |
| 166 | +9500-12000 -3.6 -2.1 -1.5 -0.6 -0.0 | |
| 167 | +12000-15500 -3.9 -2.8 -1.2 -0.8 -0.1 | |
| 168 | +15500-24000 -3.4 -6.3 2.8 -1.5 -0.4 | |
| 169 | +broadband corr: ours 0.9810 ref 0.9927 | |
| 170 | + | |
| 171 | +## reell @ 96k (ours 85.4 vs ref 85.5 kbps) | |
| 172 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 173 | +100-200 -15.4 -20.2 4.7 -0.1 -0.1 | |
| 174 | +200-300 -14.2 -20.5 6.3 -0.1 -0.1 | |
| 175 | +300-400 -14.7 -22.9 8.2 -0.1 -0.1 | |
| 176 | +400-510 -14.0 -22.5 8.4 -0.1 -0.0 | |
| 177 | +510-630 -11.0 -20.1 9.1 -0.3 -0.1 | |
| 178 | +630-770 -9.5 -18.2 8.7 -0.4 -0.1 | |
| 179 | +770-920 -14.2 -22.8 8.7 -0.1 -0.0 | |
| 180 | +920-1080 -11.7 -19.0 7.3 -0.2 -0.1 | |
| 181 | +1080-1270 -8.6 -13.3 4.7 -0.5 -0.2 | |
| 182 | +1270-1480 -11.6 -15.6 4.0 -0.2 -0.2 | |
| 183 | +1480-1720 -10.6 -13.1 2.5 -0.2 -0.2 | |
| 184 | +1720-2000 -12.8 -15.4 2.6 -0.2 -0.2 | |
| 185 | +2000-2320 -7.9 -9.6 1.7 -0.6 -0.4 | |
| 186 | +2320-2700 -7.9 -10.1 2.2 -0.6 -0.4 | |
| 187 | +2700-3150 -9.5 -11.5 1.9 -0.4 -0.3 | |
| 188 | +3150-3700 -8.5 -10.2 1.6 -0.5 -0.3 | |
| 189 | +3700-4400 -8.6 -10.3 1.7 -0.2 -0.3 | |
| 190 | +4400-5300 -8.4 -10.5 2.0 0.1 -0.3 | |
| 191 | +5300-6400 -5.4 -7.0 1.6 -0.6 -0.3 | |
| 192 | +6400-7700 -5.0 -4.7 -0.2 -0.8 0.1 | |
| 193 | +7700-9500 -8.0 -5.8 -2.2 -0.2 0.3 | |
| 194 | +9500-12000 -7.0 -5.7 -1.3 -0.5 0.0 | |
| 195 | +12000-15500 -1.9 -1.5 -0.4 -2.4 0.8 | |
| 196 | +15500-24000 -1.5 -5.9 4.3 -3.1 -0.1 | |
| 197 | +broadband corr: ours 0.9792 ref 0.9923 | |
| 198 | + | |
| 199 | +## reell @ 128k (ours 121.3 vs ref 120.9 kbps) | |
| 200 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 201 | +100-200 -20.6 -23.6 3.1 -0.0 -0.1 | |
| 202 | +200-300 -19.2 -24.5 5.3 -0.0 -0.1 | |
| 203 | +300-400 -19.3 -27.3 8.0 -0.0 -0.0 | |
| 204 | +400-510 -18.4 -27.2 8.8 -0.0 -0.0 | |
| 205 | +510-630 -14.9 -25.1 10.1 -0.1 -0.0 | |
| 206 | +630-770 -13.1 -23.3 10.2 -0.1 -0.0 | |
| 207 | +770-920 -18.1 -28.0 9.9 -0.0 0.0 | |
| 208 | +920-1080 -15.1 -24.6 9.5 -0.1 -0.0 | |
| 209 | +1080-1270 -11.3 -18.8 7.5 -0.2 -0.1 | |
| 210 | +1270-1480 -14.8 -21.1 6.3 -0.1 -0.1 | |
| 211 | +1480-1720 -13.8 -18.7 5.0 -0.1 -0.1 | |
| 212 | +1720-2000 -16.2 -20.3 4.2 -0.1 -0.1 | |
| 213 | +2000-2320 -11.0 -14.0 3.1 -0.3 -0.2 | |
| 214 | +2320-2700 -11.1 -14.4 3.3 -0.3 -0.2 | |
| 215 | +2700-3150 -12.6 -15.5 2.9 -0.2 -0.1 | |
| 216 | +3150-3700 -11.7 -14.6 2.9 -0.2 -0.2 | |
| 217 | +3700-4400 -11.0 -14.6 3.6 0.1 -0.2 | |
| 218 | +4400-5300 -10.5 -14.5 4.0 0.2 -0.2 | |
| 219 | +5300-6400 -7.3 -11.0 3.7 -0.1 -0.3 | |
| 220 | +6400-7700 -6.7 -9.3 2.6 -0.2 -0.4 | |
| 221 | +7700-9500 -9.8 -7.5 -2.3 0.0 -0.3 | |
| 222 | +9500-12000 -8.7 -7.2 -1.5 -0.1 -0.3 | |
| 223 | +12000-15500 -2.8 -2.8 0.0 -1.6 -0.1 | |
| 224 | +15500-24000 -2.6 -9.3 6.7 -2.7 -0.2 | |
| 225 | +broadband corr: ours 0.9914 ref 0.9968 | |
| 226 | + | |
| 227 | +## reelm @ 96k (ours 80.5 vs ref 79.3 kbps) | |
| 228 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 229 | +100-200 -19.2 -29.7 10.5 -0.0 0.0 | |
| 230 | +200-300 -18.7 -30.8 12.2 0.0 0.0 | |
| 231 | +300-400 -17.4 -27.9 10.5 0.0 0.0 | |
| 232 | +400-510 -17.7 -28.5 10.8 0.0 0.0 | |
| 233 | +510-630 -16.6 -28.0 11.4 -0.0 0.0 | |
| 234 | +630-770 -14.0 -24.1 10.1 -0.1 -0.0 | |
| 235 | +770-920 -14.9 -23.0 8.1 -0.1 -0.1 | |
| 236 | +920-1080 -13.4 -19.3 5.8 -0.1 -0.2 | |
| 237 | +1080-1270 -13.4 -17.1 3.6 -0.1 -0.2 | |
| 238 | +1270-1480 -14.0 -15.7 1.7 -0.1 -0.3 | |
| 239 | +1480-1720 -13.4 -13.8 0.4 -0.1 -0.4 | |
| 240 | +1720-2000 -13.2 -14.0 0.8 -0.1 -0.4 | |
| 241 | +2000-2320 -11.7 -12.7 0.9 -0.2 -0.4 | |
| 242 | +2320-2700 -12.0 -11.9 -0.1 -0.2 -0.4 | |
| 243 | +2700-3150 -12.7 -12.2 -0.5 -0.2 -0.5 | |
| 244 | +3150-3700 -10.0 -10.6 0.5 -0.4 -0.5 | |
| 245 | +3700-4400 -10.4 -11.3 1.0 -0.4 -0.4 | |
| 246 | +4400-5300 -9.9 -9.6 -0.3 -0.4 -0.4 | |
| 247 | +5300-6400 -11.7 -9.8 -1.9 -0.2 -0.3 | |
| 248 | +6400-7700 -8.5 -9.4 0.9 -0.6 -0.1 | |
| 249 | +7700-9500 -8.8 -8.0 -0.8 -0.5 0.1 | |
| 250 | +9500-12000 -8.2 -9.6 1.4 -0.6 -0.3 | |
| 251 | +12000-15500 -1.8 -5.6 3.8 -3.2 0.6 | |
| 252 | +15500-24000 -0.7 -5.5 4.8 -7.0 -0.1 | |
| 253 | +broadband corr: ours 0.9796 ref 0.9865 | |
| 254 | + | |
| 255 | +## reelm @ 128k (ours 93.5 vs ref 91.0 kbps) | |
| 256 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 257 | +100-200 -22.4 -34.2 11.8 -0.0 0.0 | |
| 258 | +200-300 -21.5 -35.3 13.9 0.0 0.1 | |
| 259 | +300-400 -20.2 -32.9 12.8 0.0 0.0 | |
| 260 | +400-510 -20.5 -33.3 12.8 0.0 0.0 | |
| 261 | +510-630 -19.7 -32.2 12.5 0.0 0.0 | |
| 262 | +630-770 -16.8 -27.5 10.7 -0.0 0.0 | |
| 263 | +770-920 -17.7 -26.1 8.3 -0.0 -0.0 | |
| 264 | +920-1080 -16.0 -22.1 6.1 -0.0 -0.1 | |
| 265 | +1080-1270 -16.2 -19.8 3.6 -0.0 -0.1 | |
| 266 | +1270-1480 -16.9 -18.2 1.3 -0.0 -0.2 | |
| 267 | +1480-1720 -16.2 -15.7 -0.5 -0.0 -0.2 | |
| 268 | +1720-2000 -15.8 -15.9 0.1 -0.0 -0.3 | |
| 269 | +2000-2320 -14.3 -14.0 -0.3 -0.1 -0.3 | |
| 270 | +2320-2700 -14.7 -13.1 -1.6 -0.1 -0.4 | |
| 271 | +2700-3150 -15.6 -13.2 -2.3 -0.1 -0.4 | |
| 272 | +3150-3700 -12.5 -11.0 -1.5 -0.2 -0.4 | |
| 273 | +3700-4400 -13.0 -11.7 -1.3 -0.2 -0.4 | |
| 274 | +4400-5300 -12.6 -10.5 -2.1 -0.2 -0.4 | |
| 275 | +5300-6400 -14.5 -11.2 -3.3 -0.1 -0.4 | |
| 276 | +6400-7700 -11.0 -11.0 0.0 -0.3 -0.4 | |
| 277 | +7700-9500 -11.3 -9.7 -1.6 -0.3 -0.3 | |
| 278 | +9500-12000 -10.4 -11.2 0.8 -0.3 -0.4 | |
| 279 | +12000-15500 -2.7 -7.4 4.6 -2.5 -0.2 | |
| 280 | +15500-24000 -1.0 -7.8 6.8 -5.3 -0.2 | |
| 281 | +broadband corr: ours 0.9890 ref 0.9906 | |
| 282 | + | |
| 283 | +## dl8a @ 96k (ours 86.9 vs ref 86.9 kbps) | |
| 284 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 285 | +100-200 -12.7 -21.2 8.5 -0.1 -0.1 | |
| 286 | +200-300 -13.3 -22.7 9.5 -0.2 -0.1 | |
| 287 | +300-400 -10.2 -20.8 10.7 -0.3 -0.1 | |
| 288 | +400-510 -9.9 -21.1 11.2 -0.4 -0.1 | |
| 289 | +510-630 -11.1 -23.8 12.7 -0.2 -0.0 | |
| 290 | +630-770 -12.2 -24.1 11.9 -0.2 -0.0 | |
| 291 | +770-920 -11.1 -21.1 10.0 -0.2 -0.1 | |
| 292 | +920-1080 -7.9 -15.7 7.9 -0.6 -0.2 | |
| 293 | +1080-1270 -9.2 -15.3 6.2 -0.5 -0.2 | |
| 294 | +1270-1480 -10.5 -14.6 4.1 -0.3 -0.3 | |
| 295 | +1480-1720 -9.2 -12.1 2.9 -0.5 -0.3 | |
| 296 | +1720-2000 -7.9 -11.5 3.6 -0.7 -0.3 | |
| 297 | +2000-2320 -6.6 -9.7 3.1 -0.9 -0.3 | |
| 298 | +2320-2700 -6.6 -9.8 3.2 -1.0 -0.4 | |
| 299 | +2700-3150 -6.1 -9.8 3.7 -1.1 -0.4 | |
| 300 | +3150-3700 -6.7 -9.7 3.0 -1.0 -0.4 | |
| 301 | +3700-4400 -6.4 -9.1 2.7 -0.7 -0.4 | |
| 302 | +4400-5300 -7.1 -9.5 2.4 -0.1 -0.4 | |
| 303 | +5300-6400 -5.7 -7.8 2.1 -0.6 -0.2 | |
| 304 | +6400-7700 -5.4 -7.1 1.7 -0.8 0.0 | |
| 305 | +7700-9500 -5.7 -6.6 0.8 -0.8 0.2 | |
| 306 | +9500-12000 -6.2 -7.3 1.1 -0.7 0.0 | |
| 307 | +12000-15500 -4.3 -5.6 1.3 -1.2 0.4 | |
| 308 | +15500-24000 -3.4 -1.9 -1.5 -2.1 -3.3 | |
| 309 | +broadband corr: ours 0.9655 ref 0.9916 | |
| 310 | + | |
| 311 | +## dl8a @ 128k (ours 118.7 vs ref 117.8 kbps) | |
| 312 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 313 | +100-200 -16.2 -24.7 8.6 -0.0 -0.1 | |
| 314 | +200-300 -16.9 -26.2 9.3 -0.1 -0.0 | |
| 315 | +300-400 -13.2 -24.9 11.7 -0.1 -0.0 | |
| 316 | +400-510 -12.9 -25.7 12.8 -0.2 -0.0 | |
| 317 | +510-630 -13.9 -28.5 14.6 -0.1 0.0 | |
| 318 | +630-770 -15.1 -28.7 13.6 -0.1 0.0 | |
| 319 | +770-920 -14.0 -25.7 11.6 -0.1 -0.0 | |
| 320 | +920-1080 -10.4 -20.0 9.6 -0.3 -0.1 | |
| 321 | +1080-1270 -12.0 -19.6 7.6 -0.3 -0.1 | |
| 322 | +1270-1480 -13.2 -18.9 5.7 -0.2 -0.2 | |
| 323 | +1480-1720 -11.9 -15.8 3.9 -0.2 -0.2 | |
| 324 | +1720-2000 -10.3 -14.6 4.3 -0.3 -0.2 | |
| 325 | +2000-2320 -9.1 -12.3 3.2 -0.4 -0.3 | |
| 326 | +2320-2700 -9.2 -12.5 3.3 -0.5 -0.3 | |
| 327 | +2700-3150 -8.8 -12.1 3.3 -0.5 -0.4 | |
| 328 | +3150-3700 -9.3 -11.8 2.5 -0.5 -0.3 | |
| 329 | +3700-4400 -8.9 -11.2 2.3 -0.2 -0.3 | |
| 330 | +4400-5300 -9.3 -11.7 2.5 0.2 -0.4 | |
| 331 | +5300-6400 -8.1 -10.0 1.9 -0.0 -0.3 | |
| 332 | +6400-7700 -7.8 -9.2 1.4 -0.1 -0.4 | |
| 333 | +7700-9500 -8.2 -7.8 -0.4 -0.2 -0.3 | |
| 334 | +9500-12000 -8.9 -8.5 -0.4 -0.2 -0.4 | |
| 335 | +12000-15500 -6.2 -6.6 0.4 -0.5 -0.3 | |
| 336 | +15500-24000 -4.8 -9.9 5.0 -1.4 -0.4 | |
| 337 | +broadband corr: ours 0.9826 ref 0.9957 | |
| 338 | + | |
| 339 | +## hein @ 96k (ours 80.3 vs ref 79.1 kbps) | |
| 340 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 341 | +100-200 -17.8 -26.8 8.9 -0.0 0.0 | |
| 342 | +200-300 -17.9 -28.2 10.3 0.0 0.0 | |
| 343 | +300-400 -16.4 -26.2 9.8 -0.0 -0.0 | |
| 344 | +400-510 -17.4 -27.6 10.2 -0.0 -0.0 | |
| 345 | +510-630 -15.9 -26.8 10.9 -0.0 -0.0 | |
| 346 | +630-770 -13.3 -23.6 10.4 -0.1 -0.0 | |
| 347 | +770-920 -14.0 -22.5 8.6 -0.1 -0.1 | |
| 348 | +920-1080 -12.7 -19.3 6.6 -0.1 -0.1 | |
| 349 | +1080-1270 -12.8 -17.1 4.3 -0.2 -0.2 | |
| 350 | +1270-1480 -13.5 -15.1 1.5 -0.1 -0.4 | |
| 351 | +1480-1720 -13.7 -12.9 -0.8 -0.1 -0.4 | |
| 352 | +1720-2000 -11.9 -12.3 0.4 -0.2 -0.4 | |
| 353 | +2000-2320 -11.2 -11.7 0.5 -0.3 -0.4 | |
| 354 | +2320-2700 -9.9 -11.3 1.3 -0.4 -0.4 | |
| 355 | +2700-3150 -12.3 -11.9 -0.4 -0.2 -0.5 | |
| 356 | +3150-3700 -9.9 -11.4 1.5 -0.4 -0.5 | |
| 357 | +3700-4400 -9.5 -11.0 1.5 -0.4 -0.5 | |
| 358 | +4400-5300 -10.0 -9.8 -0.1 -0.4 -0.4 | |
| 359 | +5300-6400 -11.1 -9.6 -1.4 -0.3 -0.3 | |
| 360 | +6400-7700 -8.6 -9.3 0.8 -0.6 -0.1 | |
| 361 | +7700-9500 -9.2 -8.1 -1.1 -0.5 0.1 | |
| 362 | +9500-12000 -8.3 -9.4 1.1 -0.6 -0.2 | |
| 363 | +12000-15500 -2.1 -5.8 3.6 -2.9 0.5 | |
| 364 | +15500-24000 -0.7 -4.9 4.2 -6.8 -0.0 | |
| 365 | +broadband corr: ours 0.9789 ref 0.9869 | |
| 366 | + | |
| 367 | +## hein @ 128k (ours 92.8 vs ref 90.7 kbps) | |
| 368 | +band NSR_ours NSR_ref dNSR E_ours E_ref | |
| 369 | +100-200 -20.5 -30.4 9.8 0.0 0.0 | |
| 370 | +200-300 -20.7 -32.2 11.6 0.0 0.0 | |
| 371 | +300-400 -19.1 -30.6 11.5 0.0 0.0 | |
| 372 | +400-510 -20.2 -31.8 11.6 0.0 0.0 | |
| 373 | +510-630 -18.7 -30.6 11.9 -0.0 0.0 | |
| 374 | +630-770 -15.9 -26.6 10.8 -0.0 -0.0 | |
| 375 | +770-920 -16.4 -25.1 8.7 -0.0 -0.0 | |
| 376 | +920-1080 -15.2 -21.8 6.6 -0.1 -0.1 | |
| 377 | +1080-1270 -15.5 -19.5 4.0 -0.1 -0.1 | |
| 378 | +1270-1480 -16.3 -17.0 0.7 -0.1 -0.3 | |
| 379 | +1480-1720 -16.6 -14.4 -2.2 -0.1 -0.3 | |
| 380 | +1720-2000 -14.7 -13.7 -1.0 -0.1 -0.3 | |
| 381 | +2000-2320 -14.0 -12.8 -1.1 -0.1 -0.4 | |
| 382 | +2320-2700 -12.4 -12.1 -0.4 -0.2 -0.3 | |
| 383 | +2700-3150 -15.1 -12.6 -2.4 -0.1 -0.4 | |
| 384 | +3150-3700 -12.3 -12.0 -0.4 -0.2 -0.4 | |
| 385 | +3700-4400 -11.7 -11.4 -0.3 -0.2 -0.5 | |
| 386 | +4400-5300 -12.5 -10.6 -1.9 -0.2 -0.4 | |
| 387 | +5300-6400 -13.6 -10.9 -2.6 -0.2 -0.4 | |
| 388 | +6400-7700 -10.8 -10.9 0.1 -0.3 -0.4 | |
| 389 | +7700-9500 -11.5 -9.8 -1.6 -0.2 -0.3 | |
| 390 | +9500-12000 -10.4 -11.0 0.7 -0.3 -0.4 | |
| 391 | +12000-15500 -3.2 -7.6 4.4 -2.2 -0.3 | |
| 392 | +15500-24000 -1.0 -6.6 5.6 -5.3 -0.3 | |
| 393 | +broadband corr: ours 0.9883 ref 0.9906 | |
| 394 | + |
lanes/vorbis-psy-r1.bits.txtadded+72 -0
| @@ -0,0 +1,72 @@ | ||
| 1 | +# Bit split over full sources, same rows as the band error | |
| 2 | + | |
| 3 | +## nik @ 96k (ours 84.0 vs ref 84.5 kbps) | |
| 4 | +ours floor 9723.2/s ( 11.7%) residue 72917.0/s ( 87.9%) other 355.3/s nz 2560721 bits/nz 5.42 | |
| 5 | +ref floor 10286.2/s ( 12.3%) residue 73047.7/s ( 87.3%) other 388.4/s nz 4760782 bits/nz 2.92 | |
| 6 | +ratio floor 0.945 residue 0.998 bits/nz 1.856 | |
| 7 | + | |
| 8 | +## nik @ 128k (ours 115.5 vs ref 115.8 kbps) | |
| 9 | +ours floor 9645.0/s ( 8.5%) residue 103989.2/s ( 91.2%) other 353.9/s nz 3814314 bits/nz 5.19 | |
| 10 | +ref floor 10077.0/s ( 8.8%) residue 104124.4/s ( 90.9%) other 389.7/s nz 5632447 bits/nz 3.52 | |
| 11 | +ratio floor 0.957 residue 0.999 bits/nz 1.475 | |
| 12 | + | |
| 13 | +## reelo @ 96k (ours 81.5 vs ref 81.8 kbps) | |
| 14 | +ours floor 9806.9/s ( 12.2%) residue 70346.3/s ( 87.4%) other 355.5/s nz 2986413 bits/nz 5.29 | |
| 15 | +ref floor 9941.3/s ( 12.3%) residue 70612.8/s ( 87.2%) other 398.4/s nz 5777660 bits/nz 2.74 | |
| 16 | +ratio floor 0.986 residue 0.996 bits/nz 1.927 | |
| 17 | + | |
| 18 | +## reelo @ 128k (ours 109.1 vs ref 108.6 kbps) | |
| 19 | +ours floor 9691.2/s ( 9.0%) residue 97679.6/s ( 90.7%) other 353.8/s nz 4295299 bits/nz 5.11 | |
| 20 | +ref floor 9747.6/s ( 9.1%) residue 97310.8/s ( 90.6%) other 403.0/s nz 6673503 bits/nz 3.27 | |
| 21 | +ratio floor 0.994 residue 1.004 bits/nz 1.560 | |
| 22 | + | |
| 23 | +## her @ 96k (ours 89.9 vs ref 89.9 kbps) | |
| 24 | +ours floor 9524.9/s ( 10.7%) residue 78889.0/s ( 88.9%) other 354.8/s nz 1787297 bits/nz 6.60 | |
| 25 | +ref floor 10153.8/s ( 11.4%) residue 78231.6/s ( 88.1%) other 424.2/s nz 3760403 bits/nz 3.11 | |
| 26 | +ratio floor 0.938 residue 1.008 bits/nz 2.122 | |
| 27 | + | |
| 28 | +## her @ 128k (ours 123.5 vs ref 124.9 kbps) | |
| 29 | +ours floor 9533.5/s ( 7.8%) residue 112062.4/s ( 91.9%) other 352.8/s nz 2722388 bits/nz 6.16 | |
| 30 | +ref floor 10767.4/s ( 8.7%) residue 112414.2/s ( 90.9%) other 440.5/s nz 4510184 bits/nz 3.73 | |
| 31 | +ratio floor 0.885 residue 0.997 bits/nz 1.652 | |
| 32 | + | |
| 33 | +## reell @ 96k (ours 85.4 vs ref 85.5 kbps) | |
| 34 | +ours floor 9711.2/s ( 11.5%) residue 74235.7/s ( 88.1%) other 352.0/s nz 1543184 bits/nz 6.13 | |
| 35 | +ref floor 10298.1/s ( 12.2%) residue 73899.0/s ( 87.4%) other 385.7/s nz 3052428 bits/nz 3.09 | |
| 36 | +ratio floor 0.943 residue 1.005 bits/nz 1.987 | |
| 37 | + | |
| 38 | +## reell @ 128k (ours 121.3 vs ref 120.9 kbps) | |
| 39 | +ours floor 9566.1/s ( 8.0%) residue 109816.9/s ( 91.7%) other 355.4/s nz 2371325 bits/nz 5.91 | |
| 40 | +ref floor 9762.0/s ( 8.2%) residue 109419.2/s ( 91.5%) other 383.9/s nz 3707113 bits/nz 3.76 | |
| 41 | +ratio floor 0.980 residue 1.004 bits/nz 1.569 | |
| 42 | + | |
| 43 | +## reelm @ 96k (ours 80.5 vs ref 79.3 kbps) | |
| 44 | +ours floor 11985.8/s ( 15.1%) residue 66845.4/s ( 84.3%) other 478.7/s nz 8155330 bits/nz 4.92 | |
| 45 | +ref floor 13236.4/s ( 16.9%) residue 64513.7/s ( 82.4%) other 554.2/s nz 16100264 bits/nz 2.40 | |
| 46 | +ratio floor 0.906 residue 1.036 bits/nz 2.046 | |
| 47 | + | |
| 48 | +## reelm @ 128k (ours 93.5 vs ref 91.0 kbps) | |
| 49 | +ours floor 11796.9/s ( 12.8%) residue 79906.7/s ( 86.7%) other 478.6/s nz 9867445 bits/nz 4.86 | |
| 50 | +ref floor 15532.3/s ( 17.3%) residue 73887.6/s ( 82.1%) other 577.2/s nz 17166019 bits/nz 2.58 | |
| 51 | +ratio floor 0.760 residue 1.081 bits/nz 1.881 | |
| 52 | + | |
| 53 | +## dl8a @ 96k (ours 86.9 vs ref 86.9 kbps) | |
| 54 | +ours floor 9898.8/s ( 11.5%) residue 75451.0/s ( 88.0%) other 361.4/s nz 1070509 bits/nz 5.22 | |
| 55 | +ref floor 10220.4/s ( 11.9%) residue 75065.3/s ( 87.6%) other 450.2/s nz 2007693 bits/nz 2.77 | |
| 56 | +ratio floor 0.969 residue 1.005 bits/nz 1.885 | |
| 57 | + | |
| 58 | +## dl8a @ 128k (ours 118.7 vs ref 117.8 kbps) | |
| 59 | +ours floor 9770.3/s ( 8.3%) residue 106984.6/s ( 91.3%) other 362.3/s nz 1586225 bits/nz 5.00 | |
| 60 | +ref floor 10898.1/s ( 9.4%) residue 104859.0/s ( 90.2%) other 461.9/s nz 2355540 bits/nz 3.30 | |
| 61 | +ratio floor 0.897 residue 1.020 bits/nz 1.515 | |
| 62 | + | |
| 63 | +## hein @ 96k (ours 80.3 vs ref 79.1 kbps) | |
| 64 | +ours floor 11754.1/s ( 14.8%) residue 66934.3/s ( 84.6%) other 464.2/s nz 8280099 bits/nz 4.85 | |
| 65 | +ref floor 13269.0/s ( 17.0%) residue 64324.4/s ( 82.3%) other 542.5/s nz 16037649 bits/nz 2.41 | |
| 66 | +ratio floor 0.886 residue 1.041 bits/nz 2.015 | |
| 67 | + | |
| 68 | +## hein @ 128k (ours 92.8 vs ref 90.7 kbps) | |
| 69 | +ours floor 11598.0/s ( 12.7%) residue 79463.3/s ( 86.8%) other 463.7/s nz 9964341 bits/nz 4.78 | |
| 70 | +ref floor 15672.4/s ( 17.5%) residue 73426.1/s ( 81.9%) other 577.8/s nz 17055459 bits/nz 2.58 | |
| 71 | +ratio floor 0.740 residue 1.082 bits/nz 1.852 | |
| 72 | + |
lanes/vorbis-psy-r1.histogram.txtadded+440 -0
| @@ -0,0 +1,440 @@ | ||
| 1 | +# Residue histogram: ours vs libvorbis reference | |
| 2 | + | |
| 3 | +Bitrate: 128 kbps, 48000 Hz, 2ch, 12 s max | |
| 4 | + | |
| 5 | +## nik — sanity PASS: identical histograms (578 vs 578 blocks) — ours 199539 B vs ref 167577 B (1.19x) | |
| 6 | + | |
| 7 | +bits ours: floor 242916 (16.4%), residue 1236957 (83.3%), other 4287, packet 1484160; non-zero 153776, residue bits/non-zero 8.04 | |
| 8 | +bits ref: floor 137211 (10.6%), residue 1150746 (89.0%), other 4875, packet 1292832; non-zero 306824, residue bits/non-zero 3.75 | |
| 9 | + | |
| 10 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 11 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 12 | +| 0 | 1779/1818 | 2538/1565 | 716/634 | 418/605 | 157/547 | 44/563 | 5652/5732 | 0.99 | | |
| 13 | +| 1 | 1840/1030 | 1543/990 | 388/696 | 357/772 | 304/607 | 96/547 | 4528/4642 | 0.74 | | |
| 14 | +| 2 | 2166/781 | 1583/1002 | 390/693 | 472/920 | 509/709 | 500/1345 | 5620/5450 | 0.74 | | |
| 15 | +| 3 | 2476/1356 | 1388/968 | 210/586 | 160/703 | 122/531 | 172/498 | 4528/4642 | 0.62 | | |
| 16 | +| 4 | 2760/1631 | 1522/1305 | 387/715 | 274/737 | 294/501 | 383/561 | 5620/5450 | 0.75 | | |
| 17 | +| 5 | 2845/1411 | 1653/1240 | 372/782 | 330/933 | 257/732 | 195/634 | 5652/5732 | 0.65 | | |
| 18 | +| 6 | 2930/1293 | 2060/1118 | 439/828 | 413/1197 | 408/1185 | 526/1201 | 6776/6822 | 0.70 | | |
| 19 | +| 7 | 4390/2583 | 1599/1596 | 279/858 | 208/805 | 170/473 | 98/225 | 6744/6540 | 0.59 | | |
| 20 | +| 8 | 4051/2245 | 1877/2127 | 474/1023 | 436/999 | 503/680 | 559/838 | 7900/7912 | 0.68 | | |
| 21 | +| 9 | 5343/3880 | 1495/2225 | 280/891 | 262/475 | 255/219 | 265/222 | 7900/7912 | 0.63 | | |
| 22 | +| 10 | 5234/4171 | 2776/3298 | 741/1278 | 613/658 | 446/391 | 338/296 | 10148/10092 | 0.83 | | |
| 23 | +| 11 | 6527/6581 | 2893/3540 | 668/838 | 644/337 | 405/134 | 167/34 | 11304/11464 | 0.98 | | |
| 24 | +| 12 | 7056/6125 | 3351/4072 | 745/1174 | 624/545 | 402/241 | 218/115 | 12396/12272 | 0.87 | | |
| 25 | +| 13 | 10667/9208 | 3550/4845 | 836/1293 | 804/811 | 579/476 | 488/281 | 16924/16914 | 0.81 | | |
| 26 | +| 14 | 10482/8505 | 5221/6094 | 1251/2199 | 1023/1280 | 749/693 | 446/323 | 19172/19094 | 0.82 | | |
| 27 | +| 15 | 17576/14460 | 5040/6699 | 1035/2006 | 709/1081 | 273/457 | 191/123 | 24824/24826 | 0.70 | | |
| 28 | +| 16 | 18181/13185 | 7011/8726 | 1650/3440 | 1323/2150 | 809/1150 | 346/535 | 29320/29186 | 0.70 | | |
| 29 | +| 17 | 28416/22448 | 5549/8977 | 519/2099 | 292/895 | 128/396 | 68/103 | 34972/34918 | 0.53 | | |
| 30 | +| 18 | 33016/21107 | 6947/14454 | 339/3464 | 188/1092 | 78/223 | 24/28 | 40592/40368 | 0.39 | | |
| 31 | +| 19 | 42329/29783 | 5717/16177 | 239/2096 | 140/440 | 74/56 | 25/10 | 48524/48562 | 0.33 | | |
| 32 | +| 20 | 47727/30397 | 10268/21738 | 379/4825 | 142/1292 | 70/117 | 54/3 | 58640/58372 | 0.39 | | |
| 33 | +| 21 | 64255/50609 | 9784/20844 | 204/2285 | 115/438 | 55/20 | 27/0 | 74440/74196 | 0.43 | | |
| 34 | +| 22 | 92299/60977 | 15411/40956 | 352/4454 | 146/1485 | 70/151 | 10/1 | 108288/108024 | 0.34 | | |
| 35 | +| 23 | 175565/139308 | 17118/47091 | 201/4981 | 23/1134 | 1/80 | 0/0 | 192908/192594 | 0.33 | | |
| 36 | +| 24 | 411386/410540 | 314/0 | 0/0 | 0/0 | 0/0 | 0/0 | 411700/410540 | inf | | |
| 37 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 38 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 39 | +| 0 | 0.315 | 0.317 | 0.449 | 0.273 | 0.127 | 0.111 | 0.110 | 0.299 | 0.384 | | |
| 40 | +| 1 | 0.406 | 0.222 | 0.341 | 0.213 | 0.086 | 0.150 | 0.167 | 0.415 | 0.624 | | |
| 41 | +| 2 | 0.385 | 0.143 | 0.282 | 0.184 | 0.069 | 0.127 | 0.264 | 0.546 | 0.680 | | |
| 42 | +| 3 | 0.547 | 0.292 | 0.307 | 0.209 | 0.046 | 0.126 | 0.100 | 0.373 | 0.705 | | |
| 43 | +| 4 | 0.491 | 0.299 | 0.271 | 0.239 | 0.069 | 0.131 | 0.169 | 0.330 | 0.446 | | |
| 44 | +| 5 | 0.503 | 0.246 | 0.292 | 0.216 | 0.066 | 0.136 | 0.138 | 0.401 | 0.667 | | |
| 45 | +| 6 | 0.432 | 0.190 | 0.304 | 0.164 | 0.065 | 0.121 | 0.199 | 0.525 | 0.766 | | |
| 46 | +| 7 | 0.651 | 0.395 | 0.237 | 0.244 | 0.041 | 0.131 | 0.071 | 0.230 | 0.512 | | |
| 47 | +| 8 | 0.513 | 0.284 | 0.238 | 0.269 | 0.060 | 0.129 | 0.190 | 0.318 | 0.458 | | |
| 48 | +| 9 | 0.676 | 0.490 | 0.189 | 0.281 | 0.035 | 0.113 | 0.099 | 0.116 | 0.372 | | |
| 49 | +| 10 | 0.516 | 0.413 | 0.274 | 0.327 | 0.073 | 0.127 | 0.138 | 0.133 | 0.214 | | |
| 50 | +| 11 | 0.577 | 0.574 | 0.256 | 0.309 | 0.059 | 0.073 | 0.108 | 0.044 | 0.134 | | |
| 51 | +| 12 | 0.569 | 0.499 | 0.270 | 0.332 | 0.060 | 0.096 | 0.100 | 0.073 | 0.194 | | |
| 52 | +| 13 | 0.630 | 0.544 | 0.210 | 0.286 | 0.049 | 0.076 | 0.111 | 0.093 | 0.207 | | |
| 53 | +| 14 | 0.547 | 0.445 | 0.272 | 0.319 | 0.065 | 0.115 | 0.116 | 0.120 | 0.203 | | |
| 54 | +| 15 | 0.708 | 0.582 | 0.203 | 0.270 | 0.042 | 0.081 | 0.047 | 0.067 | 0.251 | | |
| 55 | +| 16 | 0.620 | 0.452 | 0.239 | 0.299 | 0.056 | 0.118 | 0.085 | 0.131 | 0.337 | | |
| 56 | +| 17 | 0.813 | 0.643 | 0.159 | 0.257 | 0.015 | 0.060 | 0.014 | 0.040 | 0.339 | | |
| 57 | +| 18 | 0.813 | 0.523 | 0.171 | 0.358 | 0.008 | 0.086 | 0.007 | 0.033 | 0.581 | | |
| 58 | +| 19 | 0.872 | 0.613 | 0.118 | 0.333 | 0.005 | 0.043 | 0.005 | 0.010 | 0.518 | | |
| 59 | +| 20 | 0.814 | 0.521 | 0.175 | 0.372 | 0.006 | 0.083 | 0.005 | 0.024 | 0.586 | | |
| 60 | +| 21 | 0.863 | 0.682 | 0.131 | 0.281 | 0.003 | 0.031 | 0.003 | 0.006 | 0.362 | | |
| 61 | +| 22 | 0.852 | 0.564 | 0.142 | 0.379 | 0.003 | 0.041 | 0.002 | 0.015 | 0.576 | | |
| 62 | +| 23 | 0.910 | 0.723 | 0.089 | 0.245 | 0.001 | 0.026 | 0.000 | 0.006 | 0.374 | | |
| 63 | +| 24 | 0.999 | 1.000 | 0.001 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.002 | | |
| 64 | + | |
| 65 | +shape Bark 3-22: max dist 0.766, bands >= 0.15: 19/20 — shape fail | |
| 66 | + | |
| 67 | +## reelo — sanity PASS: identical histograms (592 vs 592 blocks) — ours 209457 B vs ref 184427 B (1.14x) | |
| 68 | + | |
| 69 | +bits ours: floor 241792 (15.5%), residue 1316635 (84.2%), other 4445, packet 1562872; non-zero 161883, residue bits/non-zero 8.13 | |
| 70 | +bits ref: floor 135587 (9.5%), residue 1285442 (90.1%), other 5707, packet 1426736; non-zero 324226, residue bits/non-zero 3.96 | |
| 71 | + | |
| 72 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 73 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 74 | +| 0 | 1394/1032 | 1378/1046 | 1089/716 | 996/1123 | 485/997 | 322/970 | 5664/5884 | 0.88 | | |
| 75 | +| 1 | 1545/612 | 1454/837 | 665/683 | 473/827 | 200/824 | 207/1057 | 4544/4840 | 0.71 | | |
| 76 | +| 2 | 2148/607 | 1711/873 | 784/726 | 543/1026 | 269/1149 | 145/839 | 5600/5220 | 0.75 | | |
| 77 | +| 3 | 1847/652 | 1261/800 | 597/572 | 453/802 | 203/905 | 183/1109 | 4544/4840 | 0.64 | | |
| 78 | +| 4 | 3182/1089 | 1289/1376 | 484/666 | 381/745 | 167/723 | 97/621 | 5600/5220 | 0.59 | | |
| 79 | +| 5 | 2891/913 | 1515/1362 | 582/889 | 351/1049 | 150/917 | 175/754 | 5664/5884 | 0.56 | | |
| 80 | +| 6 | 3151/1298 | 1802/1892 | 784/1075 | 607/1232 | 249/883 | 191/548 | 6784/6928 | 0.65 | | |
| 81 | +| 7 | 3754/1861 | 1834/2224 | 577/1015 | 307/763 | 139/296 | 109/105 | 6720/6264 | 0.67 | | |
| 82 | +| 8 | 4605/2582 | 1856/2631 | 622/1108 | 451/928 | 189/488 | 181/235 | 7904/7972 | 0.61 | | |
| 83 | +| 9 | 3844/1953 | 2140/2373 | 858/1253 | 592/1162 | 242/756 | 228/475 | 7904/7972 | 0.67 | | |
| 84 | +| 10 | 6133/4348 | 2354/3464 | 787/1137 | 547/697 | 197/301 | 126/113 | 10144/10060 | 0.70 | | |
| 85 | +| 11 | 6552/5386 | 2660/4041 | 916/1163 | 718/640 | 264/377 | 218/161 | 11328/11768 | 0.75 | | |
| 86 | +| 12 | 7592/5676 | 2965/4280 | 818/1120 | 553/662 | 272/302 | 184/108 | 12384/12148 | 0.74 | | |
| 87 | +| 13 | 10324/9058 | 3996/5711 | 1267/1285 | 797/556 | 308/294 | 236/84 | 16928/16988 | 0.83 | | |
| 88 | +| 14 | 10444/9017 | 5269/6939 | 1723/1726 | 1024/878 | 429/416 | 279/100 | 19168/19076 | 0.87 | | |
| 89 | +| 15 | 15492/13139 | 5936/8452 | 1650/1937 | 1126/939 | 349/381 | 279/112 | 24832/24960 | 0.79 | | |
| 90 | +| 16 | 19045/14579 | 6979/10089 | 1774/2465 | 973/1310 | 292/479 | 249/214 | 29312/29136 | 0.71 | | |
| 91 | +| 17 | 24736/18304 | 7505/11969 | 1628/2833 | 670/1302 | 167/470 | 270/142 | 34976/35020 | 0.61 | | |
| 92 | +| 18 | 31569/21460 | 6793/13368 | 1287/3123 | 560/1593 | 120/553 | 247/143 | 40576/40240 | 0.48 | | |
| 93 | +| 19 | 39748/28785 | 6733/15061 | 1132/3060 | 482/1344 | 137/483 | 312/143 | 48544/48876 | 0.44 | | |
| 94 | +| 20 | 48355/33901 | 7976/18736 | 1190/3522 | 581/1453 | 203/543 | 319/117 | 58624/58272 | 0.42 | | |
| 95 | +| 21 | 63134/43095 | 8841/25794 | 1336/3394 | 560/1374 | 242/478 | 319/81 | 74432/74216 | 0.36 | | |
| 96 | +| 22 | 95348/71142 | 10267/32152 | 1511/3241 | 585/1339 | 326/295 | 251/23 | 108288/108192 | 0.35 | | |
| 97 | +| 23 | 175995/132157 | 13633/54547 | 1839/4454 | 845/1559 | 412/396 | 204/19 | 192928/193132 | 0.28 | | |
| 98 | +| 24 | 410361/407176 | 1193/3280 | 91/267 | 26/169 | 9/44 | 0/4 | 411680/410940 | 0.35 | | |
| 99 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 100 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 101 | +| 0 | 0.246 | 0.175 | 0.243 | 0.178 | 0.192 | 0.122 | 0.318 | 0.525 | 0.414 | | |
| 102 | +| 1 | 0.340 | 0.126 | 0.320 | 0.173 | 0.146 | 0.141 | 0.194 | 0.560 | 0.732 | | |
| 103 | +| 2 | 0.384 | 0.116 | 0.306 | 0.167 | 0.140 | 0.139 | 0.171 | 0.577 | 0.813 | | |
| 104 | +| 3 | 0.406 | 0.135 | 0.278 | 0.165 | 0.131 | 0.118 | 0.185 | 0.582 | 0.794 | | |
| 105 | +| 4 | 0.568 | 0.209 | 0.230 | 0.264 | 0.086 | 0.128 | 0.115 | 0.400 | 0.719 | | |
| 106 | +| 5 | 0.510 | 0.155 | 0.267 | 0.231 | 0.103 | 0.151 | 0.119 | 0.462 | 0.783 | | |
| 107 | +| 6 | 0.464 | 0.187 | 0.266 | 0.273 | 0.116 | 0.155 | 0.154 | 0.384 | 0.554 | | |
| 108 | +| 7 | 0.559 | 0.297 | 0.273 | 0.355 | 0.086 | 0.162 | 0.083 | 0.186 | 0.523 | | |
| 109 | +| 8 | 0.583 | 0.324 | 0.235 | 0.330 | 0.079 | 0.139 | 0.104 | 0.207 | 0.517 | | |
| 110 | +| 9 | 0.486 | 0.245 | 0.271 | 0.298 | 0.109 | 0.157 | 0.134 | 0.300 | 0.483 | | |
| 111 | +| 10 | 0.605 | 0.432 | 0.232 | 0.344 | 0.078 | 0.113 | 0.086 | 0.110 | 0.345 | | |
| 112 | +| 11 | 0.578 | 0.458 | 0.235 | 0.343 | 0.081 | 0.099 | 0.106 | 0.100 | 0.253 | | |
| 113 | +| 12 | 0.613 | 0.467 | 0.239 | 0.352 | 0.066 | 0.092 | 0.081 | 0.088 | 0.292 | | |
| 114 | +| 13 | 0.610 | 0.533 | 0.236 | 0.336 | 0.075 | 0.076 | 0.079 | 0.055 | 0.202 | | |
| 115 | +| 14 | 0.545 | 0.473 | 0.275 | 0.364 | 0.090 | 0.090 | 0.090 | 0.073 | 0.179 | | |
| 116 | +| 15 | 0.624 | 0.526 | 0.239 | 0.339 | 0.066 | 0.078 | 0.071 | 0.057 | 0.221 | | |
| 117 | +| 16 | 0.650 | 0.500 | 0.238 | 0.346 | 0.061 | 0.085 | 0.052 | 0.069 | 0.299 | | |
| 118 | +| 17 | 0.707 | 0.523 | 0.215 | 0.342 | 0.047 | 0.081 | 0.032 | 0.055 | 0.369 | | |
| 119 | +| 18 | 0.778 | 0.533 | 0.167 | 0.332 | 0.032 | 0.078 | 0.023 | 0.057 | 0.489 | | |
| 120 | +| 19 | 0.819 | 0.589 | 0.139 | 0.308 | 0.023 | 0.063 | 0.019 | 0.040 | 0.460 | | |
| 121 | +| 20 | 0.825 | 0.582 | 0.136 | 0.322 | 0.020 | 0.060 | 0.019 | 0.036 | 0.486 | | |
| 122 | +| 21 | 0.848 | 0.581 | 0.119 | 0.348 | 0.018 | 0.046 | 0.015 | 0.026 | 0.535 | | |
| 123 | +| 22 | 0.881 | 0.658 | 0.095 | 0.297 | 0.014 | 0.030 | 0.011 | 0.015 | 0.446 | | |
| 124 | +| 23 | 0.912 | 0.684 | 0.071 | 0.282 | 0.010 | 0.023 | 0.008 | 0.010 | 0.456 | | |
| 125 | +| 24 | 0.997 | 0.991 | 0.003 | 0.008 | 0.000 | 0.001 | 0.000 | 0.001 | 0.012 | | |
| 126 | + | |
| 127 | +shape Bark 3-22: max dist 0.794, bands >= 0.15: 20/20 — shape fail | |
| 128 | + | |
| 129 | +## her — sanity PASS: identical histograms (578 vs 578 blocks) — ours 200318 B vs ref 144837 B (1.38x) | |
| 130 | + | |
| 131 | +bits ours: floor 222012 (14.9%), residue 1263990 (84.8%), other 4302, packet 1490304; non-zero 106384, residue bits/non-zero 11.88 | |
| 132 | +bits ref: floor 124059 (11.2%), residue 981117 (88.4%), other 4704, packet 1109880; non-zero 152528, residue bits/non-zero 6.43 | |
| 133 | + | |
| 134 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 135 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 136 | +| 0 | 819/3538 | 1337/1464 | 982/332 | 1079/215 | 822/106 | 613/61 | 5652/5716 | 2.22 | | |
| 137 | +| 1 | 265/380 | 411/633 | 393/576 | 671/944 | 919/970 | 1869/1111 | 4528/4614 | 1.01 | | |
| 138 | +| 2 | 391/394 | 657/643 | 539/552 | 836/886 | 1074/1209 | 2123/1826 | 5620/5510 | 1.02 | | |
| 139 | +| 3 | 302/230 | 435/361 | 390/286 | 597/532 | 835/799 | 1969/2406 | 4528/4614 | 0.96 | | |
| 140 | +| 4 | 811/972 | 1176/1460 | 781/970 | 858/997 | 900/692 | 1094/419 | 5620/5510 | 1.06 | | |
| 141 | +| 5 | 779/1641 | 1200/2120 | 855/827 | 983/569 | 867/328 | 968/231 | 5652/5716 | 1.20 | | |
| 142 | +| 6 | 546/761 | 766/1217 | 683/847 | 1015/1059 | 1223/1070 | 2543/1864 | 6776/6818 | 1.03 | | |
| 143 | +| 7 | 1918/2525 | 1822/2294 | 965/727 | 926/452 | 665/319 | 448/295 | 6744/6612 | 1.18 | | |
| 144 | +| 8 | 1436/2124 | 1680/2497 | 942/1145 | 1106/936 | 1112/640 | 1624/578 | 7900/7920 | 1.12 | | |
| 145 | +| 9 | 1475/2407 | 1917/2563 | 1052/977 | 1134/763 | 930/538 | 1392/672 | 7900/7920 | 1.17 | | |
| 146 | +| 10 | 2827/4779 | 2747/3390 | 1370/777 | 1192/462 | 871/344 | 1141/372 | 10148/10124 | 1.37 | | |
| 147 | +| 11 | 2617/4276 | 2774/3774 | 1607/1330 | 1586/863 | 1193/689 | 1527/500 | 11304/11432 | 1.21 | | |
| 148 | +| 12 | 4010/5980 | 3801/3813 | 1594/942 | 1299/692 | 890/575 | 802/326 | 12396/12328 | 1.32 | | |
| 149 | +| 13 | 7890/9445 | 4990/4918 | 1599/1147 | 1176/729 | 793/530 | 476/173 | 16924/16942 | 1.21 | | |
| 150 | +| 14 | 11516/10689 | 4390/5122 | 1353/1384 | 1075/1043 | 576/689 | 262/219 | 19172/19146 | 0.91 | | |
| 151 | +| 15 | 18683/14563 | 3949/6550 | 947/1499 | 655/1137 | 414/777 | 176/336 | 24824/24862 | 0.60 | | |
| 152 | +| 16 | 25456/18248 | 2716/7204 | 571/1619 | 357/1204 | 190/732 | 30/263 | 29320/29270 | 0.35 | | |
| 153 | +| 17 | 33232/21808 | 1391/9341 | 229/1894 | 98/1204 | 19/605 | 3/134 | 34972/34986 | 0.13 | | |
| 154 | +| 18 | 39983/27296 | 560/9816 | 41/1851 | 7/965 | 1/468 | 0/100 | 40592/40496 | 0.05 | | |
| 155 | +| 19 | 48326/36349 | 193/9229 | 4/1659 | 1/878 | 0/419 | 0/88 | 48524/48622 | 0.02 | | |
| 156 | +| 20 | 58518/51394 | 120/5857 | 2/748 | 0/397 | 0/139 | 0/5 | 58640/58540 | 0.02 | | |
| 157 | +| 21 | 74294/70756 | 146/3216 | 0/289 | 0/112 | 0/7 | 0/0 | 74440/74380 | 0.04 | | |
| 158 | +| 22 | 108112/107377 | 176/847 | 0/34 | 0/6 | 0/0 | 0/0 | 108288/108264 | 0.20 | | |
| 159 | +| 23 | 192782/192860 | 126/112 | 0/2 | 0/0 | 0/0 | 0/0 | 192908/192974 | 1.11 | | |
| 160 | +| 24 | 411700/411496 | 0/4 | 0/0 | 0/0 | 0/0 | 0/0 | 411700/411500 | 0.00 | | |
| 161 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 162 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 163 | +| 0 | 0.145 | 0.619 | 0.237 | 0.256 | 0.174 | 0.058 | 0.445 | 0.067 | 0.987 | | |
| 164 | +| 1 | 0.059 | 0.082 | 0.091 | 0.137 | 0.087 | 0.125 | 0.764 | 0.656 | 0.217 | | |
| 165 | +| 2 | 0.070 | 0.072 | 0.117 | 0.117 | 0.096 | 0.100 | 0.718 | 0.712 | 0.012 | | |
| 166 | +| 3 | 0.067 | 0.050 | 0.096 | 0.078 | 0.086 | 0.062 | 0.751 | 0.810 | 0.118 | | |
| 167 | +| 4 | 0.144 | 0.176 | 0.209 | 0.265 | 0.139 | 0.176 | 0.507 | 0.383 | 0.250 | | |
| 168 | +| 5 | 0.138 | 0.287 | 0.212 | 0.371 | 0.151 | 0.145 | 0.499 | 0.197 | 0.616 | | |
| 169 | +| 6 | 0.081 | 0.112 | 0.113 | 0.178 | 0.101 | 0.124 | 0.706 | 0.586 | 0.240 | | |
| 170 | +| 7 | 0.284 | 0.382 | 0.270 | 0.347 | 0.143 | 0.110 | 0.302 | 0.161 | 0.349 | | |
| 171 | +| 8 | 0.182 | 0.268 | 0.213 | 0.315 | 0.119 | 0.145 | 0.486 | 0.272 | 0.429 | | |
| 172 | +| 9 | 0.187 | 0.304 | 0.243 | 0.324 | 0.133 | 0.123 | 0.437 | 0.249 | 0.396 | | |
| 173 | +| 10 | 0.279 | 0.472 | 0.271 | 0.335 | 0.135 | 0.077 | 0.316 | 0.116 | 0.515 | | |
| 174 | +| 11 | 0.232 | 0.374 | 0.245 | 0.330 | 0.142 | 0.116 | 0.381 | 0.179 | 0.455 | | |
| 175 | +| 12 | 0.323 | 0.485 | 0.307 | 0.309 | 0.129 | 0.076 | 0.241 | 0.129 | 0.328 | | |
| 176 | +| 13 | 0.466 | 0.557 | 0.295 | 0.290 | 0.094 | 0.068 | 0.144 | 0.085 | 0.183 | | |
| 177 | +| 14 | 0.601 | 0.558 | 0.229 | 0.268 | 0.071 | 0.072 | 0.100 | 0.102 | 0.085 | | |
| 178 | +| 15 | 0.753 | 0.586 | 0.159 | 0.263 | 0.038 | 0.060 | 0.050 | 0.090 | 0.334 | | |
| 179 | +| 16 | 0.868 | 0.623 | 0.093 | 0.246 | 0.019 | 0.055 | 0.020 | 0.075 | 0.490 | | |
| 180 | +| 17 | 0.950 | 0.623 | 0.040 | 0.267 | 0.007 | 0.054 | 0.003 | 0.056 | 0.654 | | |
| 181 | +| 18 | 0.985 | 0.674 | 0.014 | 0.242 | 0.001 | 0.046 | 0.000 | 0.038 | 0.622 | | |
| 182 | +| 19 | 0.996 | 0.748 | 0.004 | 0.190 | 0.000 | 0.034 | 0.000 | 0.028 | 0.497 | | |
| 183 | +| 20 | 0.998 | 0.878 | 0.002 | 0.100 | 0.000 | 0.013 | 0.000 | 0.009 | 0.240 | | |
| 184 | +| 21 | 0.998 | 0.951 | 0.002 | 0.043 | 0.000 | 0.004 | 0.000 | 0.002 | 0.094 | | |
| 185 | +| 22 | 0.998 | 0.992 | 0.002 | 0.008 | 0.000 | 0.000 | 0.000 | 0.000 | 0.013 | | |
| 186 | +| 23 | 0.999 | 0.999 | 0.001 | 0.001 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | | |
| 187 | +| 24 | 1.000 | 1.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | | |
| 188 | + | |
| 189 | +shape Bark 3-22: max dist 0.654, bands >= 0.15: 16/20 — shape fail | |
| 190 | + | |
| 191 | +## reell — sanity PASS: identical histograms (578 vs 578 blocks) — ours 205448 B vs ref 179730 B (1.14x) | |
| 192 | + | |
| 193 | +bits ours: floor 260600 (17.0%), residue 1266166 (82.7%), other 4290, packet 1531056; non-zero 173005, residue bits/non-zero 7.32 | |
| 194 | +bits ref: floor 122706 (8.8%), residue 1262884 (90.8%), other 4634, packet 1390224; non-zero 349421, residue bits/non-zero 3.61 | |
| 195 | + | |
| 196 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 197 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 198 | +| 0 | 1893/1466 | 2252/1071 | 975/673 | 330/918 | 134/833 | 68/741 | 5652/5702 | 0.89 | | |
| 199 | +| 1 | 2409/663 | 1637/1012 | 351/726 | 75/950 | 27/784 | 29/467 | 4528/4602 | 0.54 | | |
| 200 | +| 2 | 2806/617 | 1908/1068 | 652/727 | 188/976 | 48/919 | 18/1193 | 5620/5500 | 0.58 | | |
| 201 | +| 3 | 2706/742 | 1353/1027 | 322/630 | 88/759 | 28/720 | 31/724 | 4528/4602 | 0.47 | | |
| 202 | +| 4 | 2952/734 | 1719/1141 | 647/827 | 212/959 | 61/846 | 29/993 | 5620/5500 | 0.56 | | |
| 203 | +| 5 | 4006/1345 | 1195/1666 | 295/883 | 84/936 | 41/620 | 31/252 | 5652/5702 | 0.38 | | |
| 204 | +| 6 | 3787/1150 | 2056/1639 | 690/1093 | 146/1190 | 52/915 | 45/815 | 6776/6802 | 0.53 | | |
| 205 | +| 7 | 4619/1498 | 1513/2008 | 394/1065 | 164/997 | 48/530 | 6/502 | 6744/6600 | 0.42 | | |
| 206 | +| 8 | 5298/2075 | 1744/2421 | 580/1204 | 179/1095 | 53/617 | 46/490 | 7900/7902 | 0.45 | | |
| 207 | +| 9 | 6380/3118 | 1222/2915 | 219/915 | 43/561 | 8/239 | 28/154 | 7900/7902 | 0.32 | | |
| 208 | +| 10 | 7509/4355 | 1794/3012 | 590/943 | 143/702 | 73/582 | 39/508 | 10148/10102 | 0.46 | | |
| 209 | +| 11 | 8027/4791 | 2445/3845 | 586/1259 | 154/784 | 42/443 | 50/282 | 11304/11404 | 0.50 | | |
| 210 | +| 12 | 9178/5756 | 2400/4123 | 522/1049 | 201/716 | 64/369 | 31/289 | 12396/12302 | 0.49 | | |
| 211 | +| 13 | 12083/8033 | 3670/5908 | 812/1458 | 219/813 | 71/521 | 69/171 | 16924/16904 | 0.55 | | |
| 212 | +| 14 | 14003/8938 | 4058/6779 | 792/1751 | 178/915 | 72/497 | 69/224 | 19172/19104 | 0.51 | | |
| 213 | +| 15 | 18680/12383 | 4977/8770 | 870/1873 | 180/990 | 40/515 | 77/275 | 24824/24806 | 0.49 | | |
| 214 | +| 16 | 22384/15396 | 5943/10614 | 690/1919 | 187/753 | 30/397 | 86/127 | 29320/29206 | 0.50 | | |
| 215 | +| 17 | 24031/16094 | 9095/13587 | 1466/3191 | 228/1250 | 36/546 | 116/240 | 34972/34908 | 0.58 | | |
| 216 | +| 18 | 29431/20726 | 9771/15496 | 1021/2878 | 208/877 | 67/319 | 94/112 | 40592/40408 | 0.57 | | |
| 217 | +| 19 | 35601/24174 | 11406/19024 | 1091/3973 | 260/1110 | 62/186 | 104/45 | 48524/48512 | 0.53 | | |
| 218 | +| 20 | 47913/37355 | 9692/18150 | 738/2257 | 185/517 | 27/114 | 85/19 | 58640/58412 | 0.51 | | |
| 219 | +| 21 | 55627/42699 | 16895/26845 | 1521/3405 | 246/1044 | 45/212 | 106/11 | 74440/74216 | 0.60 | | |
| 220 | +| 22 | 78714/53020 | 26597/43249 | 2520/7985 | 307/3166 | 66/570 | 84/34 | 108288/108024 | 0.54 | | |
| 221 | +| 23 | 171914/128851 | 19622/51392 | 1104/8395 | 216/3435 | 38/467 | 14/4 | 192908/192544 | 0.33 | | |
| 222 | +| 24 | 410116/406856 | 1526/2829 | 49/679 | 6/211 | 3/15 | 0/0 | 411700/410590 | 0.42 | | |
| 223 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 224 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 225 | +| 0 | 0.335 | 0.257 | 0.398 | 0.188 | 0.173 | 0.118 | 0.094 | 0.437 | 0.686 | | |
| 226 | +| 1 | 0.532 | 0.144 | 0.362 | 0.220 | 0.078 | 0.158 | 0.029 | 0.478 | 1.059 | | |
| 227 | +| 2 | 0.499 | 0.112 | 0.340 | 0.194 | 0.116 | 0.132 | 0.045 | 0.561 | 1.065 | | |
| 228 | +| 3 | 0.598 | 0.161 | 0.299 | 0.223 | 0.071 | 0.137 | 0.032 | 0.479 | 1.024 | | |
| 229 | +| 4 | 0.525 | 0.133 | 0.306 | 0.207 | 0.115 | 0.150 | 0.054 | 0.509 | 0.980 | | |
| 230 | +| 5 | 0.709 | 0.236 | 0.211 | 0.292 | 0.052 | 0.155 | 0.028 | 0.317 | 0.946 | | |
| 231 | +| 6 | 0.559 | 0.169 | 0.303 | 0.241 | 0.102 | 0.161 | 0.036 | 0.429 | 0.905 | | |
| 232 | +| 7 | 0.685 | 0.227 | 0.224 | 0.304 | 0.058 | 0.161 | 0.032 | 0.307 | 0.916 | | |
| 233 | +| 8 | 0.671 | 0.263 | 0.221 | 0.306 | 0.073 | 0.152 | 0.035 | 0.279 | 0.816 | | |
| 234 | +| 9 | 0.808 | 0.395 | 0.155 | 0.369 | 0.028 | 0.116 | 0.010 | 0.121 | 0.826 | | |
| 235 | +| 10 | 0.740 | 0.431 | 0.177 | 0.298 | 0.058 | 0.093 | 0.025 | 0.177 | 0.618 | | |
| 236 | +| 11 | 0.710 | 0.420 | 0.216 | 0.337 | 0.052 | 0.110 | 0.022 | 0.132 | 0.580 | | |
| 237 | +| 12 | 0.740 | 0.468 | 0.194 | 0.335 | 0.042 | 0.085 | 0.024 | 0.112 | 0.545 | | |
| 238 | +| 13 | 0.714 | 0.475 | 0.217 | 0.350 | 0.048 | 0.086 | 0.021 | 0.089 | 0.477 | | |
| 239 | +| 14 | 0.730 | 0.468 | 0.212 | 0.355 | 0.041 | 0.092 | 0.017 | 0.086 | 0.525 | | |
| 240 | +| 15 | 0.752 | 0.499 | 0.200 | 0.354 | 0.035 | 0.076 | 0.012 | 0.072 | 0.507 | | |
| 241 | +| 16 | 0.763 | 0.527 | 0.203 | 0.363 | 0.024 | 0.066 | 0.010 | 0.044 | 0.473 | | |
| 242 | +| 17 | 0.687 | 0.461 | 0.260 | 0.389 | 0.042 | 0.091 | 0.011 | 0.058 | 0.452 | | |
| 243 | +| 18 | 0.725 | 0.513 | 0.241 | 0.383 | 0.025 | 0.071 | 0.009 | 0.032 | 0.424 | | |
| 244 | +| 19 | 0.734 | 0.498 | 0.235 | 0.392 | 0.022 | 0.082 | 0.009 | 0.028 | 0.471 | | |
| 245 | +| 20 | 0.817 | 0.640 | 0.165 | 0.311 | 0.013 | 0.039 | 0.005 | 0.011 | 0.355 | | |
| 246 | +| 21 | 0.747 | 0.575 | 0.227 | 0.362 | 0.020 | 0.046 | 0.005 | 0.017 | 0.344 | | |
| 247 | +| 22 | 0.727 | 0.491 | 0.246 | 0.400 | 0.023 | 0.074 | 0.004 | 0.035 | 0.472 | | |
| 248 | +| 23 | 0.891 | 0.669 | 0.102 | 0.267 | 0.006 | 0.044 | 0.001 | 0.020 | 0.444 | | |
| 249 | +| 24 | 0.996 | 0.991 | 0.004 | 0.007 | 0.000 | 0.002 | 0.000 | 0.001 | 0.010 | | |
| 250 | + | |
| 251 | +shape Bark 3-22: max dist 1.024, bands >= 0.15: 20/20 — shape fail | |
| 252 | + | |
| 253 | +## reelm — sanity PASS: identical histograms (718 vs 718 blocks) — ours 201941 B vs ref 131152 B (1.54x) | |
| 254 | + | |
| 255 | +bits ours: floor 264080 (17.6%), residue 1234391 (82.1%), other 4777, packet 1503248; non-zero 205447, residue bits/non-zero 6.01 | |
| 256 | +bits ref: floor 152371 (15.2%), residue 847801 (84.3%), other 5452, packet 1005624; non-zero 325636, residue bits/non-zero 2.60 | |
| 257 | + | |
| 258 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 259 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 260 | +| 0 | 1888/1766 | 1682/1840 | 900/734 | 614/700 | 294/440 | 394/344 | 5772/5824 | 0.96 | | |
| 261 | +| 1 | 1717/526 | 1149/753 | 540/499 | 452/810 | 312/878 | 518/1296 | 4688/4762 | 0.70 | | |
| 262 | +| 2 | 2698/924 | 1365/1110 | 559/728 | 354/946 | 234/692 | 210/910 | 5420/5310 | 0.62 | | |
| 263 | +| 3 | 2037/795 | 1063/886 | 478/677 | 390/742 | 280/680 | 440/982 | 4688/4762 | 0.67 | | |
| 264 | +| 4 | 2708/1059 | 1370/1256 | 504/774 | 388/938 | 212/682 | 238/601 | 5420/5310 | 0.64 | | |
| 265 | +| 5 | 2570/983 | 1442/1348 | 584/825 | 448/1088 | 302/906 | 426/674 | 5772/5824 | 0.66 | | |
| 266 | +| 6 | 3254/1625 | 1644/1833 | 728/1096 | 504/1329 | 295/713 | 431/290 | 6856/6886 | 0.68 | | |
| 267 | +| 7 | 2844/1534 | 1758/1749 | 758/1079 | 564/1128 | 308/499 | 272/383 | 6504/6372 | 0.76 | | |
| 268 | +| 8 | 3462/2164 | 2044/2596 | 910/1359 | 646/1167 | 400/432 | 478/230 | 7940/7948 | 0.77 | | |
| 269 | +| 9 | 3830/2682 | 2084/2961 | 796/1240 | 518/719 | 332/220 | 380/126 | 7940/7948 | 0.78 | | |
| 270 | +| 10 | 5041/4200 | 2747/3745 | 978/1275 | 568/492 | 332/222 | 442/138 | 10108/10072 | 0.86 | | |
| 271 | +| 11 | 5608/5461 | 3022/4475 | 1109/1244 | 747/336 | 378/110 | 680/22 | 11544/11648 | 0.96 | | |
| 272 | +| 12 | 5874/5552 | 3332/4890 | 1293/1140 | 873/416 | 472/154 | 432/44 | 12276/12196 | 0.96 | | |
| 273 | +| 13 | 8056/8347 | 4708/6713 | 1656/1334 | 1145/378 | 584/156 | 815/30 | 16964/16958 | 1.03 | | |
| 274 | +| 14 | 8804/9071 | 5595/7730 | 2012/1607 | 1264/460 | 649/150 | 808/64 | 19132/19082 | 1.03 | | |
| 275 | +| 15 | 11939/11800 | 6905/10169 | 2334/2161 | 1637/602 | 852/136 | 1237/38 | 24904/24906 | 0.99 | | |
| 276 | +| 16 | 16012/15187 | 8020/11512 | 2139/1909 | 1321/440 | 703/96 | 1045/10 | 29240/29154 | 0.95 | | |
| 277 | +| 17 | 18264/16760 | 9678/13885 | 2931/3141 | 1896/925 | 851/203 | 1392/64 | 35012/34978 | 0.92 | | |
| 278 | +| 18 | 23219/20447 | 11049/16111 | 2794/2928 | 1485/668 | 698/126 | 1187/8 | 40432/40288 | 0.87 | | |
| 279 | +| 19 | 31743/24789 | 11438/19562 | 2595/3557 | 1188/740 | 608/94 | 1152/8 | 48724/48750 | 0.71 | | |
| 280 | +| 20 | 47466/36010 | 7906/20479 | 1498/1631 | 714/170 | 414/16 | 482/2 | 58480/58308 | 0.49 | | |
| 281 | +| 21 | 58502/45136 | 11448/26055 | 2054/2549 | 982/406 | 504/56 | 870/2 | 74360/74204 | 0.55 | | |
| 282 | +| 22 | 91160/67588 | 12404/34429 | 2126/4665 | 1164/1280 | 710/154 | 724/4 | 108288/108120 | 0.42 | | |
| 283 | +| 23 | 180013/135228 | 10829/52781 | 1080/4184 | 618/669 | 374/44 | 194/4 | 193108/192910 | 0.23 | | |
| 284 | +| 24 | 410916/408010 | 560/2630 | 18/110 | 4/10 | 0/0 | 2/0 | 411500/410760 | 0.21 | | |
| 285 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 286 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 287 | +| 0 | 0.327 | 0.303 | 0.291 | 0.316 | 0.156 | 0.126 | 0.226 | 0.255 | 0.108 | | |
| 288 | +| 1 | 0.366 | 0.110 | 0.245 | 0.158 | 0.115 | 0.105 | 0.273 | 0.627 | 0.706 | | |
| 289 | +| 2 | 0.498 | 0.174 | 0.252 | 0.209 | 0.103 | 0.137 | 0.147 | 0.480 | 0.733 | | |
| 290 | +| 3 | 0.435 | 0.167 | 0.227 | 0.186 | 0.102 | 0.142 | 0.237 | 0.505 | 0.617 | | |
| 291 | +| 4 | 0.500 | 0.199 | 0.253 | 0.237 | 0.093 | 0.146 | 0.155 | 0.418 | 0.633 | | |
| 292 | +| 5 | 0.445 | 0.169 | 0.250 | 0.231 | 0.101 | 0.142 | 0.204 | 0.458 | 0.590 | | |
| 293 | +| 6 | 0.475 | 0.236 | 0.240 | 0.266 | 0.106 | 0.159 | 0.179 | 0.339 | 0.477 | | |
| 294 | +| 7 | 0.437 | 0.241 | 0.270 | 0.274 | 0.117 | 0.169 | 0.176 | 0.315 | 0.393 | | |
| 295 | +| 8 | 0.436 | 0.272 | 0.257 | 0.327 | 0.115 | 0.171 | 0.192 | 0.230 | 0.328 | | |
| 296 | +| 9 | 0.482 | 0.337 | 0.262 | 0.373 | 0.100 | 0.156 | 0.155 | 0.134 | 0.332 | | |
| 297 | +| 10 | 0.499 | 0.417 | 0.272 | 0.372 | 0.097 | 0.127 | 0.133 | 0.085 | 0.260 | | |
| 298 | +| 11 | 0.486 | 0.469 | 0.262 | 0.384 | 0.096 | 0.107 | 0.156 | 0.040 | 0.266 | | |
| 299 | +| 12 | 0.478 | 0.455 | 0.271 | 0.401 | 0.105 | 0.093 | 0.145 | 0.050 | 0.259 | | |
| 300 | +| 13 | 0.475 | 0.492 | 0.278 | 0.396 | 0.098 | 0.079 | 0.150 | 0.033 | 0.271 | | |
| 301 | +| 14 | 0.460 | 0.475 | 0.292 | 0.405 | 0.105 | 0.084 | 0.142 | 0.035 | 0.256 | | |
| 302 | +| 15 | 0.479 | 0.474 | 0.277 | 0.408 | 0.094 | 0.087 | 0.150 | 0.031 | 0.262 | | |
| 303 | +| 16 | 0.548 | 0.521 | 0.274 | 0.395 | 0.073 | 0.065 | 0.105 | 0.019 | 0.241 | | |
| 304 | +| 17 | 0.522 | 0.479 | 0.276 | 0.397 | 0.084 | 0.090 | 0.118 | 0.034 | 0.253 | | |
| 305 | +| 18 | 0.574 | 0.508 | 0.273 | 0.400 | 0.069 | 0.073 | 0.083 | 0.020 | 0.260 | | |
| 306 | +| 19 | 0.651 | 0.508 | 0.235 | 0.401 | 0.053 | 0.073 | 0.061 | 0.017 | 0.372 | | |
| 307 | +| 20 | 0.812 | 0.618 | 0.135 | 0.351 | 0.026 | 0.028 | 0.028 | 0.003 | 0.437 | | |
| 308 | +| 21 | 0.787 | 0.608 | 0.154 | 0.351 | 0.028 | 0.034 | 0.032 | 0.006 | 0.408 | | |
| 309 | +| 22 | 0.842 | 0.625 | 0.115 | 0.318 | 0.020 | 0.043 | 0.024 | 0.013 | 0.455 | | |
| 310 | +| 23 | 0.932 | 0.701 | 0.056 | 0.274 | 0.006 | 0.022 | 0.006 | 0.004 | 0.467 | | |
| 311 | +| 24 | 0.999 | 0.993 | 0.001 | 0.006 | 0.000 | 0.000 | 0.000 | 0.000 | 0.011 | | |
| 312 | + | |
| 313 | +shape Bark 3-22: max dist 0.633, bands >= 0.15: 20/20 — shape fail | |
| 314 | + | |
| 315 | +## dl8a — sanity PASS: identical histograms (606 vs 606 blocks) — ours 208573 B vs ref 180190 B (1.16x) | |
| 316 | + | |
| 317 | +bits ours: floor 269080 (17.3%), residue 1282271 (82.4%), other 4401, packet 1555752; non-zero 157846, residue bits/non-zero 8.12 | |
| 318 | +bits ref: floor 145125 (10.4%), residue 1242969 (89.2%), other 5714, packet 1393808; non-zero 369421, residue bits/non-zero 3.36 | |
| 319 | + | |
| 320 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 321 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 322 | +| 0 | 3059/1819 | 2267/1669 | 189/624 | 17/625 | 8/520 | 136/613 | 5676/5870 | 0.65 | | |
| 323 | +| 1 | 2868/480 | 1198/958 | 254/612 | 101/760 | 13/774 | 126/1242 | 4560/4826 | 0.39 | | |
| 324 | +| 2 | 3611/491 | 1652/844 | 248/659 | 16/814 | 2/907 | 51/1505 | 5580/5220 | 0.42 | | |
| 325 | +| 3 | 3017/531 | 1268/926 | 129/681 | 14/803 | 9/873 | 123/1012 | 4560/4826 | 0.36 | | |
| 326 | +| 4 | 3872/716 | 1458/1034 | 183/753 | 14/975 | 7/893 | 46/849 | 5580/5220 | 0.38 | | |
| 327 | +| 5 | 3825/826 | 1521/1154 | 178/891 | 15/1052 | 8/978 | 129/969 | 5676/5870 | 0.37 | | |
| 328 | +| 6 | 5046/1327 | 1417/1907 | 155/1118 | 16/1328 | 7/697 | 151/537 | 6792/6914 | 0.31 | | |
| 329 | +| 7 | 4873/1601 | 1466/1833 | 271/918 | 20/805 | 12/482 | 54/625 | 6696/6264 | 0.39 | | |
| 330 | +| 8 | 5624/2123 | 1903/2668 | 206/1325 | 19/972 | 16/485 | 140/385 | 7908/7958 | 0.39 | | |
| 331 | +| 9 | 5979/2597 | 1597/2771 | 155/1151 | 18/780 | 16/378 | 143/281 | 7908/7958 | 0.36 | | |
| 332 | +| 10 | 7355/2933 | 2338/3439 | 230/1626 | 26/1114 | 15/559 | 176/375 | 10140/10046 | 0.39 | | |
| 333 | +| 11 | 8720/5329 | 2159/4233 | 179/1212 | 18/582 | 24/265 | 252/119 | 11352/11740 | 0.41 | | |
| 334 | +| 12 | 9515/5654 | 2461/4658 | 179/1067 | 28/414 | 32/232 | 157/109 | 12372/12134 | 0.44 | | |
| 335 | +| 13 | 12738/8366 | 3648/6366 | 197/1334 | 37/588 | 53/239 | 259/67 | 16932/16960 | 0.49 | | |
| 336 | +| 14 | 14668/8675 | 3793/7213 | 315/1817 | 37/856 | 42/379 | 309/108 | 19164/19048 | 0.43 | | |
| 337 | +| 15 | 19639/12059 | 4406/9478 | 260/2081 | 55/841 | 64/335 | 416/124 | 24840/24918 | 0.40 | | |
| 338 | +| 16 | 22612/13644 | 5859/11423 | 266/2644 | 49/993 | 76/325 | 442/65 | 29304/29094 | 0.43 | | |
| 339 | +| 17 | 27749/17470 | 6224/13296 | 309/2728 | 48/1015 | 84/366 | 566/89 | 34980/34964 | 0.41 | | |
| 340 | +| 18 | 30758/18328 | 8540/15684 | 475/3779 | 48/1576 | 94/657 | 645/160 | 40560/40184 | 0.45 | | |
| 341 | +| 19 | 38744/24380 | 8545/18952 | 279/3648 | 93/1273 | 125/401 | 778/138 | 48564/48792 | 0.40 | | |
| 342 | +| 20 | 47989/34651 | 9375/20454 | 213/2440 | 140/539 | 197/99 | 694/5 | 58608/58188 | 0.45 | | |
| 343 | +| 21 | 57801/40840 | 14737/28325 | 515/3573 | 180/1120 | 285/239 | 906/7 | 74424/74104 | 0.50 | | |
| 344 | +| 22 | 84573/57731 | 20940/41941 | 892/6285 | 240/1736 | 251/327 | 1392/4 | 108288/108024 | 0.47 | | |
| 345 | +| 23 | 166014/126258 | 23489/60922 | 663/4726 | 431/853 | 460/63 | 1891/2 | 192948/192824 | 0.40 | | |
| 346 | +| 24 | 406577/394006 | 4344/13784 | 162/1918 | 176/538 | 147/64 | 254/0 | 411660/410310 | 0.31 | | |
| 347 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 348 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 349 | +| 0 | 0.539 | 0.310 | 0.399 | 0.284 | 0.033 | 0.106 | 0.028 | 0.299 | 0.688 | | |
| 350 | +| 1 | 0.629 | 0.099 | 0.263 | 0.199 | 0.056 | 0.127 | 0.053 | 0.575 | 1.187 | | |
| 351 | +| 2 | 0.647 | 0.094 | 0.296 | 0.162 | 0.044 | 0.126 | 0.012 | 0.618 | 1.375 | | |
| 352 | +| 3 | 0.662 | 0.110 | 0.278 | 0.192 | 0.028 | 0.141 | 0.032 | 0.557 | 1.276 | | |
| 353 | +| 4 | 0.694 | 0.137 | 0.261 | 0.198 | 0.033 | 0.144 | 0.012 | 0.520 | 1.240 | | |
| 354 | +| 5 | 0.674 | 0.141 | 0.268 | 0.197 | 0.031 | 0.152 | 0.027 | 0.511 | 1.209 | | |
| 355 | +| 6 | 0.743 | 0.192 | 0.209 | 0.276 | 0.023 | 0.162 | 0.026 | 0.371 | 1.102 | | |
| 356 | +| 7 | 0.728 | 0.256 | 0.219 | 0.293 | 0.040 | 0.147 | 0.013 | 0.305 | 0.944 | | |
| 357 | +| 8 | 0.711 | 0.267 | 0.241 | 0.335 | 0.026 | 0.166 | 0.022 | 0.231 | 0.889 | | |
| 358 | +| 9 | 0.756 | 0.326 | 0.202 | 0.348 | 0.020 | 0.145 | 0.022 | 0.181 | 0.859 | | |
| 359 | +| 10 | 0.725 | 0.292 | 0.231 | 0.342 | 0.023 | 0.162 | 0.021 | 0.204 | 0.867 | | |
| 360 | +| 11 | 0.768 | 0.454 | 0.190 | 0.361 | 0.016 | 0.103 | 0.026 | 0.082 | 0.628 | | |
| 361 | +| 12 | 0.769 | 0.466 | 0.199 | 0.384 | 0.014 | 0.088 | 0.018 | 0.062 | 0.606 | | |
| 362 | +| 13 | 0.752 | 0.493 | 0.215 | 0.375 | 0.012 | 0.079 | 0.021 | 0.053 | 0.518 | | |
| 363 | +| 14 | 0.765 | 0.455 | 0.198 | 0.379 | 0.016 | 0.095 | 0.020 | 0.071 | 0.620 | | |
| 364 | +| 15 | 0.791 | 0.484 | 0.177 | 0.380 | 0.010 | 0.084 | 0.022 | 0.052 | 0.613 | | |
| 365 | +| 16 | 0.772 | 0.469 | 0.200 | 0.393 | 0.009 | 0.091 | 0.019 | 0.048 | 0.605 | | |
| 366 | +| 17 | 0.793 | 0.500 | 0.178 | 0.380 | 0.009 | 0.078 | 0.020 | 0.042 | 0.587 | | |
| 367 | +| 18 | 0.758 | 0.456 | 0.211 | 0.390 | 0.012 | 0.094 | 0.019 | 0.060 | 0.604 | | |
| 368 | +| 19 | 0.798 | 0.500 | 0.176 | 0.388 | 0.006 | 0.075 | 0.021 | 0.037 | 0.596 | | |
| 369 | +| 20 | 0.819 | 0.596 | 0.160 | 0.352 | 0.004 | 0.042 | 0.018 | 0.011 | 0.460 | | |
| 370 | +| 21 | 0.777 | 0.551 | 0.198 | 0.382 | 0.007 | 0.048 | 0.018 | 0.018 | 0.451 | | |
| 371 | +| 22 | 0.781 | 0.534 | 0.193 | 0.388 | 0.008 | 0.058 | 0.017 | 0.019 | 0.493 | | |
| 372 | +| 23 | 0.860 | 0.655 | 0.122 | 0.316 | 0.003 | 0.025 | 0.014 | 0.005 | 0.431 | | |
| 373 | +| 24 | 0.988 | 0.960 | 0.011 | 0.034 | 0.000 | 0.005 | 0.001 | 0.001 | 0.055 | | |
| 374 | + | |
| 375 | +shape Bark 3-22: max dist 1.276, bands >= 0.15: 20/20 — shape fail | |
| 376 | + | |
| 377 | +## hein — sanity PASS: identical histograms (634 vs 634 blocks) — ours 212147 B vs ref 136345 B (1.56x) | |
| 378 | + | |
| 379 | +bits ours: floor 267358 (16.9%), residue 1312257 (82.8%), other 4545, packet 1584160; non-zero 221920, residue bits/non-zero 5.91 | |
| 380 | +bits ref: floor 167042 (16.0%), residue 873404 (83.5%), other 5978, packet 1046424; non-zero 333099, residue bits/non-zero 2.62 | |
| 381 | + | |
| 382 | +| Bark | q=0 ours/ref | q=1 | q=2 | q=3-4 | q=5-8 | q=9+ | total ours/ref | spend ratio | | |
| 383 | +|------|-------------|-----|-----|-------|-------|------|-----------------|-------------| | |
| 384 | +| 0 | 2012/1566 | 1836/1238 | 948/664 | 438/744 | 182/644 | 284/1078 | 5700/5934 | 0.84 | | |
| 385 | +| 1 | 2094/562 | 1160/832 | 462/622 | 406/856 | 188/782 | 282/1250 | 4592/4904 | 0.58 | | |
| 386 | +| 2 | 2484/738 | 1544/1110 | 822/780 | 330/910 | 214/814 | 146/798 | 5540/5150 | 0.69 | | |
| 387 | +| 3 | 2038/740 | 1300/960 | 596/722 | 232/786 | 170/774 | 256/922 | 4592/4904 | 0.61 | | |
| 388 | +| 4 | 2448/698 | 1770/1010 | 682/802 | 338/994 | 142/916 | 160/730 | 5540/5150 | 0.69 | | |
| 389 | +| 5 | 2804/1000 | 1660/1480 | 588/958 | 274/1172 | 136/814 | 238/510 | 5700/5934 | 0.59 | | |
| 390 | +| 6 | 3340/1472 | 2056/1946 | 716/1270 | 272/1328 | 184/722 | 240/226 | 6808/6964 | 0.63 | | |
| 391 | +| 7 | 2984/1412 | 2132/1784 | 832/1048 | 378/1208 | 180/504 | 142/224 | 6648/6180 | 0.77 | | |
| 392 | +| 8 | 3696/2190 | 2522/2794 | 830/1456 | 390/1130 | 206/278 | 272/146 | 7916/7994 | 0.73 | | |
| 393 | +| 9 | 4250/2942 | 2386/3068 | 584/1276 | 328/532 | 140/116 | 228/60 | 7916/7994 | 0.73 | | |
| 394 | +| 10 | 5084/3882 | 3142/3924 | 954/1404 | 428/572 | 220/196 | 304/76 | 10132/10054 | 0.82 | | |
| 395 | +| 11 | 5480/5008 | 3628/4702 | 1066/1468 | 436/522 | 290/146 | 500/22 | 11400/11868 | 0.86 | | |
| 396 | +| 12 | 5906/5354 | 3954/4846 | 1168/1322 | 676/448 | 286/110 | 358/34 | 12348/12114 | 0.95 | | |
| 397 | +| 13 | 8806/8322 | 4980/6508 | 1468/1462 | 730/542 | 400/136 | 556/48 | 16940/17018 | 0.94 | | |
| 398 | +| 14 | 10208/9032 | 5372/7646 | 1496/1644 | 838/590 | 492/146 | 750/20 | 19156/19078 | 0.89 | | |
| 399 | +| 15 | 13520/12021 | 7196/9707 | 1944/2272 | 922/832 | 458/162 | 816/18 | 24856/25012 | 0.87 | | |
| 400 | +| 16 | 17314/14082 | 7564/11238 | 1932/2436 | 1066/1058 | 586/284 | 826/34 | 29288/29132 | 0.80 | | |
| 401 | +| 17 | 22188/17498 | 8510/13746 | 1808/2836 | 1050/752 | 586/198 | 846/36 | 34988/35066 | 0.73 | | |
| 402 | +| 18 | 25778/20414 | 10090/15256 | 2084/3256 | 1088/1090 | 656/176 | 832/24 | 40528/40216 | 0.74 | | |
| 403 | +| 19 | 31250/24478 | 12404/19088 | 2082/3944 | 1098/1264 | 704/198 | 1066/22 | 48604/48994 | 0.71 | | |
| 404 | +| 20 | 43114/35263 | 10854/19475 | 1752/2822 | 988/624 | 802/78 | 1066/2 | 58576/58264 | 0.67 | | |
| 405 | +| 21 | 50372/42313 | 17896/26837 | 3040/4128 | 1206/882 | 686/84 | 1208/8 | 74408/74252 | 0.75 | | |
| 406 | +| 22 | 84698/70458 | 18256/32232 | 2462/4298 | 1208/1120 | 750/172 | 914/8 | 108288/108288 | 0.62 | | |
| 407 | +| 23 | 169978/132126 | 19638/56012 | 1590/4570 | 936/624 | 526/46 | 320/0 | 192988/193378 | 0.38 | | |
| 408 | +| 24 | 411306/408402 | 284/2784 | 22/44 | 8/0 | 0/0 | 0/0 | 411620/411230 | 0.11 | | |
| 409 | +| Bark | f0 ours | f0 ref | f1 ours | f1 ref | f2 ours | f2 ref | f3+ ours | f3+ ref | dist | | |
| 410 | +|------|---------|--------|---------|--------|---------|--------|----------|---------|------| | |
| 411 | +| 0 | 0.353 | 0.264 | 0.322 | 0.209 | 0.166 | 0.112 | 0.159 | 0.416 | 0.514 | | |
| 412 | +| 1 | 0.456 | 0.115 | 0.253 | 0.170 | 0.101 | 0.127 | 0.191 | 0.589 | 0.849 | | |
| 413 | +| 2 | 0.448 | 0.143 | 0.279 | 0.216 | 0.148 | 0.151 | 0.125 | 0.490 | 0.736 | | |
| 414 | +| 3 | 0.444 | 0.151 | 0.283 | 0.196 | 0.130 | 0.147 | 0.143 | 0.506 | 0.761 | | |
| 415 | +| 4 | 0.442 | 0.136 | 0.319 | 0.196 | 0.123 | 0.156 | 0.116 | 0.513 | 0.859 | | |
| 416 | +| 5 | 0.492 | 0.169 | 0.291 | 0.249 | 0.103 | 0.161 | 0.114 | 0.421 | 0.730 | | |
| 417 | +| 6 | 0.491 | 0.211 | 0.302 | 0.279 | 0.105 | 0.182 | 0.102 | 0.327 | 0.604 | | |
| 418 | +| 7 | 0.449 | 0.228 | 0.321 | 0.289 | 0.125 | 0.170 | 0.105 | 0.313 | 0.505 | | |
| 419 | +| 8 | 0.467 | 0.274 | 0.319 | 0.350 | 0.105 | 0.182 | 0.110 | 0.194 | 0.386 | | |
| 420 | +| 9 | 0.537 | 0.368 | 0.301 | 0.384 | 0.074 | 0.160 | 0.088 | 0.089 | 0.338 | | |
| 421 | +| 10 | 0.502 | 0.386 | 0.310 | 0.390 | 0.094 | 0.140 | 0.094 | 0.084 | 0.251 | | |
| 422 | +| 11 | 0.481 | 0.422 | 0.318 | 0.396 | 0.094 | 0.124 | 0.108 | 0.058 | 0.216 | | |
| 423 | +| 12 | 0.478 | 0.442 | 0.320 | 0.400 | 0.095 | 0.109 | 0.107 | 0.049 | 0.189 | | |
| 424 | +| 13 | 0.520 | 0.489 | 0.294 | 0.382 | 0.087 | 0.086 | 0.100 | 0.043 | 0.177 | | |
| 425 | +| 14 | 0.533 | 0.473 | 0.280 | 0.401 | 0.078 | 0.086 | 0.109 | 0.040 | 0.257 | | |
| 426 | +| 15 | 0.544 | 0.481 | 0.290 | 0.388 | 0.078 | 0.091 | 0.088 | 0.040 | 0.222 | | |
| 427 | +| 16 | 0.591 | 0.483 | 0.258 | 0.386 | 0.066 | 0.084 | 0.085 | 0.047 | 0.290 | | |
| 428 | +| 17 | 0.634 | 0.499 | 0.243 | 0.392 | 0.052 | 0.081 | 0.071 | 0.028 | 0.356 | | |
| 429 | +| 18 | 0.636 | 0.508 | 0.249 | 0.379 | 0.051 | 0.081 | 0.064 | 0.032 | 0.320 | | |
| 430 | +| 19 | 0.643 | 0.500 | 0.255 | 0.390 | 0.043 | 0.080 | 0.059 | 0.030 | 0.344 | | |
| 431 | +| 20 | 0.736 | 0.605 | 0.185 | 0.334 | 0.030 | 0.048 | 0.049 | 0.012 | 0.335 | | |
| 432 | +| 21 | 0.677 | 0.570 | 0.241 | 0.361 | 0.041 | 0.056 | 0.042 | 0.013 | 0.271 | | |
| 433 | +| 22 | 0.782 | 0.651 | 0.169 | 0.298 | 0.023 | 0.040 | 0.027 | 0.012 | 0.292 | | |
| 434 | +| 23 | 0.881 | 0.683 | 0.102 | 0.290 | 0.008 | 0.024 | 0.009 | 0.003 | 0.407 | | |
| 435 | +| 24 | 0.999 | 0.993 | 0.001 | 0.007 | 0.000 | 0.000 | 0.000 | 0.000 | 0.012 | | |
| 436 | + | |
| 437 | +shape Bark 3-22: max dist 0.859, bands >= 0.15: 20/20 — shape fail | |
| 438 | + | |
| 439 | + | |
| 440 | +Total bytes: ours 1437423 vs ref 1124258 (1.28x) |
lanes/vorbis-psy-r1.report.mdadded+88 -0
| @@ -0,0 +1,88 @@ | ||
| 1 | +byte-identity: IDENTICAL (reelm 120 s 128k, main 4b007cd vs 689cdc9) | |
| 2 | + | |
| 3 | +# vorbis-psy r3 — band error + bit split, 7 sources × {96k, 128k} | |
| 4 | + | |
| 5 | +Instrument: `band_error_vs_reference` (`crates/ec-vorbis/tests/oracle.rs`), run in | |
| 6 | +release, full 14 rows (no `SWEEP_ONLY` fallback needed; 163 s total, 3–25 s/row). | |
| 7 | +Ref = ffmpeg libvorbis `-t 600 -ac 2 -ar 48000`; ours encoded at the ref's measured | |
| 8 | +kbps; both decoded through **our** decoder, so the gap measures encoders only. | |
| 9 | +Bands: 2048-pt Hann, hop 1024, 25 edges 100 Hz–24 kHz → 24 bands, both channels | |
| 10 | +summed. NSR/E in dB vs the source per band; dNSR = NSR_ours − NSR_ref (positive = | |
| 11 | +we're worse). Raw tables: `vorbis-psy-r1.bands.txt`, `vorbis-psy-r1.bits.txt`. | |
| 12 | + | |
| 13 | +## Bit split (floor / residue / bits-per-nonzero, ours vs ref, ratio) | |
| 14 | + | |
| 15 | +| row | floor ours/ref b/s | residue ours/ref b/s | nz ours/ref | bits/nz ours vs ref | ratio bits/nz | | |
| 16 | +|---|---|---|---|---|---| | |
| 17 | +| nik 96k | 9723 / 10286 | 72917 / 73048 | 2.56M / 4.76M | 5.42 vs 2.92 | **1.86** | | |
| 18 | +| nik 128k | 9645 / 10077 | 103989 / 104124 | 3.81M / 5.63M | 5.19 vs 3.52 | **1.48** | | |
| 19 | +| reelo 96k | 9807 / 9941 | 70346 / 70613 | 2.99M / 5.78M | 5.29 vs 2.74 | **1.93** | | |
| 20 | +| reelo 128k | 9691 / 9748 | 97680 / 97311 | 4.30M / 6.67M | 5.11 vs 3.27 | **1.56** | | |
| 21 | +| her 96k | 9525 / 10154 | 78889 / 78232 | 1.79M / 3.76M | 6.60 vs 3.11 | **2.12** | | |
| 22 | +| her 128k | 9534 / 10767 | 112062 / 112414 | 2.72M / 4.51M | 6.16 vs 3.73 | **1.65** | | |
| 23 | +| reell 96k | 9711 / 10298 | 74236 / 73899 | 1.54M / 3.05M | 6.13 vs 3.09 | **1.99** | | |
| 24 | +| reell 128k | 9566 / 9762 | 109817 / 109419 | 2.37M / 3.71M | 5.91 vs 3.76 | **1.57** | | |
| 25 | +| reelm 96k | 11986 / 13236 | 66845 / 64514 | 8.16M / 16.10M | 4.92 vs 2.40 | **2.05** | | |
| 26 | +| reelm 128k | 11797 / 15532 | 79907 / 73888 | 9.87M / 17.17M | 4.86 vs 2.58 | **1.88** | | |
| 27 | +| dl8a 96k | 9899 / 10220 | 75451 / 75065 | 1.07M / 2.01M | 5.22 vs 2.77 | **1.89** | | |
| 28 | +| dl8a 128k | 9770 / 10898 | 106985 / 104859 | 1.59M / 2.36M | 5.00 vs 3.30 | **1.52** | | |
| 29 | +| hein 96k | 11754 / 13269 | 66934 / 64324 | 8.28M / 16.04M | 4.85 vs 2.41 | **2.02** | | |
| 30 | +| hein 128k | 11598 / 15672 | 79463 / 73426 | 9.96M / 17.06M | 4.78 vs 2.58 | **1.85** | | |
| 31 | + | |
| 32 | +Residue totals land within ±4% of ref at matched rate (ratios 0.996–1.082), but | |
| 33 | +we spend them on 45–57% as many non-zero coefficients at 1.5–2.1× the bits each. | |
| 34 | +Floor ratio 0.74–0.99 — ref outspends us on floor most where it wins HF (reelm/ | |
| 35 | +hein 128k: ref floor 15.5–15.7k b/s vs our 11.6k). | |
| 36 | + | |
| 37 | +## Bands summary (per row: 3 largest dNSR bands; E-attenuated bands) | |
| 38 | + | |
| 39 | +`E −x.x` = encoder output band energy vs source; "attenuated" lists bands with | |
| 40 | +E_ours ≤ −3 dB while E_ref > −3 dB. | |
| 41 | + | |
| 42 | +| row | top-3 dNSR bands | attenuated bands | corr ours/ref | | |
| 43 | +|---|---|---|---| | |
| 44 | +| 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 | | |
| 45 | +| 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 | | |
| 46 | +| reelo 96k | 510-630 +11.0; 630-770 +10.2; 770-920 +9.5 | none | 0.9739 / 0.9922 | | |
| 47 | +| reelo 128k | 510-630 +12.5; 630-770 +12.1; 400-510 +10.9 | none | 0.9868 / 0.9955 | | |
| 48 | +| her 96k | 630-770 +12.1; 400-510 +11.8; 300-400 +11.3 | none | 0.9668 / 0.9867 | | |
| 49 | +| her 128k | 630-770 +13.0; 400-510 +12.7; 510-630 +12.2 | none | 0.9810 / 0.9927 | | |
| 50 | +| 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 | | |
| 51 | +| reell 128k | 630-770 +10.2; 510-630 +10.1; 770-920 +9.9 | none | 0.9914 / 0.9968 | | |
| 52 | +| 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 | | |
| 53 | +| 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 | | |
| 54 | +| dl8a 96k | 510-630 +12.7; 630-770 +11.9; 400-510 +11.2 | none | 0.9655 / 0.9916 | | |
| 55 | +| dl8a 128k | 510-630 +14.6; 630-770 +13.6; 400-510 +12.8 | none | 0.9826 / 0.9957 | | |
| 56 | +| 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 | | |
| 57 | +| 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 | | |
| 58 | + | |
| 59 | +Every row's top-3 dNSR sits in **300–1080 Hz** (dNSR +8.6 to +14.6); in that | |
| 60 | +region ref reaches NSR −20 to −30 dB while we sit at −8 to −20. | |
| 61 | + | |
| 62 | +## Diagnosis (numbers only) | |
| 63 | + | |
| 64 | +(a) **Coding efficiency: yes, every row.** bits/non-zero ours/ref = 1.48–2.12, | |
| 65 | +all 14 rows ≥ 1.3×; we code 45–57% as many non-zeros (e.g. her 96k 1.79M vs | |
| 66 | +3.76M) at 4.8–6.6 bits each vs ref's 2.4–3.8, from identical residue budgets. | |
| 67 | +(b) **HF droop: partial.** nik 15500-24000 E −19.0 dB (effective lowpass at both | |
| 68 | +rates, ref −1.8/−2.3); reell 96k −3.1; reelm −7.0/−5.3 (plus 12000-15500 −3.2 at | |
| 69 | +96k); hein −6.8/−5.3. reelo, her, dl8a: no band below −3 dB. (c) **Not flat.** | |
| 70 | +dNSR is frequency-shaped, not broadband: +9 to +15 at 300–1080 Hz, +2 to +8 at | |
| 71 | +1–5 kHz, ≤ +1.3 (often negative, we win) above 7.7 kHz; broadband corr gap is | |
| 72 | +0.0016–0.0131 at 128k and 0.0069–0.0261 at 96k, driven by the low bands. | |
| 73 | +(d) **Tonal mid 1–5 kHz on her/reelo/dl8a: present but secondary** — her 96k | |
| 74 | +1080-1270 +6.5 / 1270-1480 +4.7 / 1480-1720 +3.7; reelo 96k 2320-2700 +4.3 / | |
| 75 | +3150-3700 +3.9; dl8a 96k 2700-3150 +3.7 / 1720-2000 +3.6 — each 5–8 dB below the | |
| 76 | +same row's 510-770 Hz peak. Conclusion: the dominant gap is (a) residue coding | |
| 77 | +efficiency concentrated at 300–1080 Hz — ref encodes roughly twice the non-zeros | |
| 78 | +at half the per-coefficient cost there — with (b) HF droop a separate, source- | |
| 79 | +dependent contributor (nik/reelm/hein), and (d) minor. | |
| 80 | + | |
| 81 | +## Deviations from the charter | |
| 82 | + | |
| 83 | +- Bit-split oracle folded into `band_error_vs_reference` instead of the existing | |
| 84 | + 12 s × 128k-only `residue_histogram_vs_reference`: same `decode_capture_with_bits` | |
| 85 | + + `bit_split_summary` measurement on the same files, one encode pass instead of | |
| 86 | + two, and extended to all 14 rows (600 s, both rates). | |
| 87 | +- Task text said "25 Bark bands" but listed 25 edges; edges taken as authoritative | |
| 88 | + → 24 bands (noted in the test's doc comment). |
lanes/vorbis-psy-r3.handoff.mdadded+60 -0
| @@ -0,0 +1,60 @@ | ||
| 1 | +# lane-vorbis-psy — round 3 handoff (2026-08-23) | |
| 2 | + | |
| 3 | +Branch `lane-vorbis-psy` @ 689cdc9 + this commit. No merge, no push. | |
| 4 | + | |
| 5 | +## What this round did | |
| 6 | + | |
| 7 | +- Added `band_error_vs_reference` (ignored instrument test) to | |
| 8 | + `crates/ec-vorbis/tests/oracle.rs` — 2048-pt Hann STFT, 24 bands from 25 edges | |
| 9 | + (100 Hz–24 kHz), band NSR + band-energy-vs-source for ours vs ffmpeg libvorbis, | |
| 10 | + both decoded through our decoder. Bit-split oracle folded into the same pass | |
| 11 | + (see deviations). | |
| 12 | +- Ran all 14 rows (7 sources × {96,128} kbps, 600 s each), release mode, 163 s. | |
| 13 | +- `cargo test -p ec-vorbis` non-ignored: green (13 lib + 8 oracle, 3 ignored). | |
| 14 | +- Encoder output byte-identical to main — established at 689cdc9 in round 2 | |
| 15 | + (reelm 120 s 128k, 4b007cd vs 689cdc9), not re-proven this round; this round | |
| 16 | + touches only `tests/oracle.rs` + lanes files. | |
| 17 | + | |
| 18 | +## Findings (numbers in `vorbis-psy-r1.report.md`) | |
| 19 | + | |
| 20 | +1. **Residue coding efficiency is the dominant gap.** bits/non-zero = 1.48–2.12× | |
| 21 | + ref on all 14 rows; we emit 45–57% as many non-zeros at 4.8–6.6 bits each vs | |
| 22 | + ref's 2.4–3.8, from near-identical residue budgets (±4%). | |
| 23 | +2. **The error is concentrated at 300–1080 Hz** — dNSR +8.6 to +14.6 dB; ref hits | |
| 24 | + NSR −20 to −30 there, we sit at −8 to −20. Mid 1–5 kHz +2 to +8. Above 7.7 kHz | |
| 25 | + we win or tie on most rows. | |
| 26 | +3. **HF droop is source-dependent, not universal**: nik 15500-24000 E −19 dB | |
| 27 | + (hard lowpass, both rates; ref −1.8/−2.3), reelm −7.0/−5.3, hein −6.8/−5.3, | |
| 28 | + reell@96 −3.1. reelo/her/dl8a none. | |
| 29 | +4. Floor spend: ours 0.74–0.99× ref; ref outspends us most on reelm/hein 128k | |
| 30 | + (15.5–15.7 k b/s vs 11.6k) — same sources where HF droop shows. | |
| 31 | + | |
| 32 | +## Next-round candidates (ranked by measured impact) | |
| 33 | + | |
| 34 | +- (1)+(2) Residue: encode ~2× non-zeros at ~half bits each in low bands — | |
| 35 | + suspect book selection / dimension / amplitude-bit allocation, not psy | |
| 36 | + (budget already matches). | |
| 37 | +- (3) nik 15.5 kHz cutoff: look for a frequency-limit or floor1 cutoff in the | |
| 38 | + psy/floor path that engages on that source; reelm/hein droop likely floor | |
| 39 | + underspend (finding 4). | |
| 40 | +- (4) Tonal 1–5 kHz on her/reelo/dl8a — minor (+3.1 to +6.5), fix after (1). | |
| 41 | + | |
| 42 | +## Deviations from this round's charter | |
| 43 | + | |
| 44 | +- Bit-split oracle measured inside `band_error_vs_reference` rather than the | |
| 45 | + 12 s × 128k-only `residue_histogram_vs_reference`: same | |
| 46 | + `decode_capture_with_bits` + `bit_split_summary` on the same files, one encode | |
| 47 | + pass instead of two, extended to all 14 rows. | |
| 48 | +- "25 Bark bands" in the charter vs 25 edges listed → 24 bands; edges taken as | |
| 49 | + authoritative. | |
| 50 | + | |
| 51 | +## Files | |
| 52 | + | |
| 53 | +- `crates/ec-vorbis/tests/oracle.rs` — new test (+ fft helper), 244 lines. | |
| 54 | +- `lanes/vorbis-psy-r1.bands.txt` — 394 lines, per-row band tables. | |
| 55 | +- `lanes/vorbis-psy-r1.bits.txt` — 71 lines, per-row bit split. | |
| 56 | +- `lanes/vorbis-psy-r1.report.md` — verdict, tables, diagnosis. | |
| 57 | +- Scratch oggs under `$CARGO_TARGET_DIR/.../scratch/vorbis7-bands/` (not | |
| 58 | + committed). | |
| 59 | + | |
| 60 | +Worktree intentionally live for round 4. |