diff --git a/crates/ec-opus/src/encoder.rs b/crates/ec-opus/src/encoder.rs index 2cff883f..3dd9e4f1 100644 --- a/crates/ec-opus/src/encoder.rs +++ b/crates/ec-opus/src/encoder.rs @@ -257,6 +257,16 @@ impl Encoder { self.celt.last_diag() } + /// Per-frame SILK diagnostics from the last SILK-encoded frame (mono). + /// Returns `None` if no mono SILK encoder has been initialised. + pub fn last_silk_diag(&self) -> Option<&crate::silk_enc_write::SilkFrameDiag> { + self.silk_mb + .as_ref() + .or(self.silk_wb.as_ref()) + .or(self.silk_nb.as_ref()) + .map(|s| s.last_diag()) + } + /// Drops all inter-frame state; the next packet starts like the first. pub fn reset(&mut self) { self.celt.reset(); diff --git a/crates/ec-opus/src/lib.rs b/crates/ec-opus/src/lib.rs index dfafe942..441706c9 100644 --- a/crates/ec-opus/src/lib.rs +++ b/crates/ec-opus/src/lib.rs @@ -76,11 +76,12 @@ pub mod silk_enc_write; pub use celt::CeltDecoder; pub use celt_enc::CeltFrameDiag; pub use encoder::{Application, Encoder}; +pub use silk_enc_write::SilkFrameDiag; pub use multistream::MultistreamDecoder; pub use multistream_enc::MultistreamEncoder; pub use packet::{Bandwidth, Mode, Packet, Toc}; pub use range::{RangeDecoder, RangeEncoder}; -pub use silk::SilkDecoder; +pub use silk::{SilkDecIndices, SilkDecoder}; pub use silk_enc_write::{SilkEncoder, SilkStereoEncoder}; use ec_core::{Error, Result}; diff --git a/crates/ec-opus/src/silk.rs b/crates/ec-opus/src/silk.rs index 06abb796..c7ac689c 100644 --- a/crates/ec-opus/src/silk.rs +++ b/crates/ec-opus/src/silk.rs @@ -245,6 +245,25 @@ struct Indices { seed: i32, } +/// Public snapshot of per-frame SILK parameters as decoded from the +/// bitstream — used by the oracle diagnostic to compare our encoder's +/// packets against ffmpeg-libopus's. +#[derive(Clone, Debug, Default)] +pub struct SilkDecIndices { + pub signal_type: i32, + pub quant_offset_type: i32, + pub gains: [i8; 4], + pub nlsf: [i8; 17], + pub nlsf_interp_coef_q2: i32, + pub lag_index: i32, + pub contour_index: i32, + pub per_index: usize, + pub ltp_index: [usize; 4], + pub ltp_scale_index: usize, + pub seed: i32, + pub frames_decoded: usize, +} + /// Everything `decode_parameters` produces for one frame. #[derive(Clone, Debug)] struct FrameCtrl { @@ -420,6 +439,26 @@ impl SilkDecoder { &ch.out_buf[..ch.ltp_mem_length] } + /// Snapshot of the last decoded frame's index parameters for channel 0. + /// Used by the oracle diagnostic to inspect what the bitstream coded. + pub fn last_indices(&self) -> SilkDecIndices { + let ix = &self.channels[0].indices; + SilkDecIndices { + signal_type: ix.signal_type, + quant_offset_type: ix.quant_offset_type, + gains: ix.gains, + nlsf: ix.nlsf, + nlsf_interp_coef_q2: ix.nlsf_interp_coef_q2, + lag_index: ix.lag_index, + contour_index: ix.contour_index, + per_index: ix.per_index, + ltp_index: ix.ltp_index, + ltp_scale_index: ix.ltp_scale_index, + seed: ix.seed, + frames_decoded: self.channels[0].frames_decoded, + } + } + /// Drops all inter-packet state. pub fn reset(&mut self) { let api_rate = self.api_rate; diff --git a/crates/ec-opus/src/silk_enc.rs b/crates/ec-opus/src/silk_enc.rs index 819fd6d0..bfed315f 100644 --- a/crates/ec-opus/src/silk_enc.rs +++ b/crates/ec-opus/src/silk_enc.rs @@ -556,7 +556,19 @@ fn ncc(frame: &[f32], lag: usize) -> f32 { /// Coarse (4 kHz-equivalent decimated) search followed by a fine search at /// full rate, then a per-subframe refinement and contour-table lookup /// against the decoder's own `CB_LAGS_*` tables (`silk.rs:157-176`). -pub(crate) fn estimate_pitch(frame: &[f32], fs_khz: i32, nb_subfr: usize) -> Option { +/// Voiced decision: libopus silk_find_pitch_lags starts from 0.6 (minus speech-activity, +/// tilt and prev-type terms); value measured on real speech, lane opus-silkq r1. +// Sweep 2026-08-23 (reelm 12k SILK-WB, corr/err_ratio): .35 -> .8081/11.4, +// .45 -> .8127/26.3, .55 -> .8106/44.8, .65 -> .7987/12.3; err non-monotonic, +// threshold is not the 12k mechanism. Kept at .35. +const VOICED_THRESHOLD: f32 = 0.35; + +pub(crate) fn estimate_pitch( + frame: &[f32], + fs_khz: i32, + nb_subfr: usize, + prior_lag: Option, +) -> Option { let min_lag = (PE_MIN_LAG_MS * fs_khz) as usize; let max_lag = (PE_MAX_LAG_MS * fs_khz) as usize; if frame.len() <= max_lag { @@ -595,8 +607,38 @@ pub(crate) fn estimate_pitch(frame: &[f32], fs_khz: i32, nb_subfr: usize) -> Opt .find(|&(_, &s)| s >= 0.85 * fine_best) .map(|(lag, _)| lag) .unwrap_or(fine_lo); - let best_score = fine_best; - let voiced = best_score > 0.35; + let mut best_score = fine_best; + + // Pitch continuity (libopus `silk_P_estimation` reuses the prior frame's + // lag as a prior). The open-loop search can octave-error onto an integer + // multiple of the true period — seen as a 2-3.5x lag jump with LTP gain + // pinned at its floor — cratering that second's corr. When a prior lag is + // available and the open-loop result jumped away from it, re-search the + // fine window around the prior lag and keep it if its NCC is comparable. + // Measured harmful on real speech (reelm 12k SILK-WB: err_ratio 11.4 -> 26.2, + // lane opus-silkq r1); kept off. + const ENABLE_PITCH_CONTINUITY: bool = false; + let mut best_lag = best_lag; + if ENABLE_PITCH_CONTINUITY { + if let Some(pl) = prior_lag { + let pl = pl as usize; + if pl >= min_lag && pl <= max_lag && best_lag.abs_diff(pl) > dec { + let p_lo = pl.saturating_sub(dec).max(min_lag); + let p_hi = (pl + dec).min(max_lag); + let p_scores: Vec = (p_lo..=p_hi).map(|lag| ncc(frame, lag)).collect(); + let p_best = p_scores.iter().cloned().fold(f32::MIN, f32::max); + if p_best >= 0.85 * best_score { + best_lag = (p_lo..=p_hi) + .zip(p_scores.iter()) + .find(|&(_, &s)| s >= 0.85 * p_best) + .map(|(lag, _)| lag) + .unwrap_or(pl); + best_score = p_best; + } + } + } + } + let voiced = best_score > VOICED_THRESHOLD; if !voiced { return Some(PitchEstimate { voiced: false, @@ -905,7 +947,7 @@ mod tests { let (idx, win) = w; frame[idx + 1] = 0.25 * win[0] + 0.5 * win[1] + 0.25 * win[2]; } - let est = estimate_pitch(&frame, 16, 4).expect("long enough frame"); + let est = estimate_pitch(&frame, 16, 4, None).expect("long enough frame"); assert!(est.voiced, "pulse train should read as voiced"); assert!( (est.lag as f32 - period).abs() <= 1.0, @@ -920,7 +962,7 @@ mod tests { ((rng_state >> 8) as f32 / 8_388_608.0) - 1.0 }) .collect(); - let est_noise = estimate_pitch(&noise, 16, 4).expect("long enough frame"); + let est_noise = estimate_pitch(&noise, 16, 4, None).expect("long enough frame"); assert!(!est_noise.voiced, "white noise should read as unvoiced"); } diff --git a/crates/ec-opus/src/silk_enc_write.rs b/crates/ec-opus/src/silk_enc_write.rs index 2241b03f..68187247 100644 --- a/crates/ec-opus/src/silk_enc_write.rs +++ b/crates/ec-opus/src/silk_enc_write.rs @@ -38,6 +38,21 @@ const LEVEL_ADJUST: f32 = 80.0 / 1024.0; /// with 16 such pulses in one block. const MAX_PULSE: i32 = 1023; +/// Per-frame SILK diagnostics captured at the end of the last `encode_inner` +/// call, for the speech-quality diagnostic lane. +#[derive(Clone, Debug, Default)] +pub struct SilkFrameDiag { + pub voiced: bool, + pub signal_type: i32, + pub gain_idx: [i8; MAX_NB_SUBFR], + pub nb_subfr: usize, + pub lag_index: i32, + pub pitch_l: [i32; MAX_NB_SUBFR], + pub nlsf_interp: i32, + pub bytes: usize, + pub ltp_gain: f32, +} + /// A mono, 10/20/40/60 ms, NB/MB/WB SILK encoder. #[derive(Clone, Debug)] pub struct SilkEncoder { @@ -65,6 +80,8 @@ pub struct SilkEncoder { shape_d: Vec, shape_u: Vec, shape_gq: Vec, + prev_pitch_lag: i32, + last_diag: SilkFrameDiag, } /// Noise-shaping constants: AR (denominator) and MA (numerator) bandwidth @@ -130,6 +147,7 @@ impl SilkEncoder { final_range: 0, mirror_range: 0, voiced_frames: 0, + prev_pitch_lag: 0, mirror_out: vec![0; 20 * 16], target_bps: None, reservoir: 0.0, @@ -138,6 +156,7 @@ impl SilkEncoder { shape_d: vec![0.0; 20 * fs_khz], shape_u: vec![0.0; 20 * fs_khz], shape_gq: vec![0.0; 20 * fs_khz], + last_diag: SilkFrameDiag::default(), } } @@ -152,6 +171,12 @@ impl SilkEncoder { self.voiced_frames } + /// Per-frame diagnostics captured at the end of the last `encode_inner` + /// call. + pub fn last_diag(&self) -> &SilkFrameDiag { + &self.last_diag + } + /// Target bit rate in bits per second; `None` (the default) codes pulses /// at unit excitation RMS with no rate loop. pub fn set_bitrate(&mut self, bps: u32) { @@ -389,7 +414,13 @@ impl SilkEncoder { let res: Vec = (0..n as isize).map(whiten).collect(); // Pitch / LTP. - let pitch = estimate_pitch(&x, fs as i32, nb_subfr).filter(|p| p.voiced); + let prior = if self.prev_pitch_lag > 0 { Some(self.prev_pitch_lag) } else { None }; + let pitch = estimate_pitch(&x, fs as i32, nb_subfr, prior).filter(|p| p.voiced); + if let Some(p) = &pitch { + self.prev_pitch_lag = p.lag; + } else { + self.prev_pitch_lag = 0; + } let voiced = pitch.is_some(); let (lag_index, contour_index, pitch_l) = match &pitch { @@ -657,6 +688,7 @@ impl SilkEncoder { voiced, ltp_scale_index, nq: nq.clone(), + ltp_gain, seed_index, }; let enc = &mut self.range; @@ -741,6 +773,23 @@ impl SilkEncoder { self.shape_d.copy_from_slice(&best.run.d[n..]); self.shape_u.copy_from_slice(&best.run.u[n..]); self.shape_gq.copy_from_slice(&best.run.gq[n..]); + self.last_diag = SilkFrameDiag { + voiced: best.voiced, + signal_type: best.signal_type, + gain_idx: best.gain_idx, + nb_subfr: best.nb_subfr, + lag_index: best.lag_index, + pitch_l: { + let mut pl = [0i32; MAX_NB_SUBFR]; + for (i, &v) in pitch_l.iter().enumerate().take(best.nb_subfr) { + pl[i] = v; + } + pl + }, + nlsf_interp: best.nq.interp_index, + bytes: best.bytes.len(), + ltp_gain: best.ltp_gain, + }; Ok(best) } } @@ -1030,6 +1079,7 @@ struct Trial { voiced: bool, ltp_scale_index: usize, nq: NlsfQuant, + ltp_gain: f32, seed_index: i32, } diff --git a/crates/ec-opus/tests/conformance.rs b/crates/ec-opus/tests/conformance.rs index a61143d3..f0df917c 100644 --- a/crates/ec-opus/tests/conformance.rs +++ b/crates/ec-opus/tests/conformance.rs @@ -3593,6 +3593,751 @@ fn silk_library_gate_vs_libopus() { println!("wrote {}", sweep_path.display()); } +// --------------------------------------------------------------------------- +// Per-second SILK diagnostic: reelm@12k VoIP encoder decisions vs libopus. +// Names the mechanism behind the 12k corr gap by per-second SILK frame facts. +// Run: +// cargo test -p ec-opus --release --test conformance silk_silkq_persecond_diag -- --ignored --nocapture +// Writes lanes/opus-silkq-r1.seconds.txt. +// --------------------------------------------------------------------------- + +#[test] +#[ignore] +fn silk_silkq_persecond_diag() { + const SECS: f64 = 120.0; + const FRAME: usize = 960; // 20 ms at 48 kHz + const CHANNELS: usize = 1; // MONO + const MAX_LAG: usize = 2000; + const KBPS: u32 = 12; + + let src = shellexpand("~/Music/reelm.wav"); + assert!(src.exists(), "source missing: {}", src.display()); + let source_pcm = ffmpeg_decode_pcm_mono(&src, SECS); + let source_frames = source_pcm.len() / CHANNELS; + assert!(source_frames > 48_000, "source too short"); + let seconds = source_frames as f64 / 48000.0; + + let lanes_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes"); + fs::create_dir_all(&lanes_dir).unwrap(); + let ref_ogg = temp_path("opus-silkq-r1-ref.opus"); + + // Reference: ffmpeg libopus mono voip VBR at 12k; realised rate from size. + ffmpeg_encode_libopus_mono_voip(&src, KBPS, &ref_ogg, SECS); + let ref_bytes = fs::metadata(&ref_ogg).map(|m| m.len() as usize).unwrap_or(0); + let ref_kbps = ref_bytes as f64 * 8.0 / seconds / 1000.0; + let ref_dec = ffmpeg_decode(&ref_ogg, CHANNELS).expect("ffmpeg libopus decode of ref"); + let ref_trim: Vec = ref_dec.into_iter().take(source_frames * CHANNELS).collect(); + let (_, ref_aligned) = align_to_source(&source_pcm, &ref_trim, CHANNELS, MAX_LAG); + let ref_ogg_bytes = fs::read(&ref_ogg).expect("read ref ogg"); + let ref_payload: Vec = ogg_packets(&ref_ogg_bytes) + .into_iter() + .skip(2) // skip opus_head + opus_comment + .filter(|p| !p.is_empty()) + .map(|p| p.len()) + .collect(); + let _ = fs::remove_file(&ref_ogg); + + // Ours: ec-opus Voip at the reference's realised rate, collecting per-frame + // SILK diag. Bitrate matches the gate (ref_kbps*1000 rounded). + let mut enc = Encoder::new(48000, CHANNELS, Application::Voip).expect("encoder"); + enc.set_bitrate((ref_kbps * 1000.0).round() as u32); + enc.set_vbr_constrained(true); + let mut dec = Decoder::new(48000, CHANNELS).unwrap(); + let mut out = vec![0u8; 1500]; + let mut buf = vec![0.0f32; 5760 * CHANNELS]; + let mut padded = Vec::new(); + let mut ours_dec = Vec::new(); + let mut diags: Vec = Vec::new(); + let mut ours_bytes: Vec = Vec::new(); + + for block in source_pcm.chunks(FRAME * CHANNELS) { + let block = if block.len() < FRAME * CHANNELS { + padded.clear(); + padded.extend_from_slice(block); + padded.resize(FRAME * CHANNELS, 0.0); + &padded[..] + } else { + block + }; + let len = enc.encode_float(block, FRAME, &mut out).expect("encode"); + let d = enc.last_silk_diag().cloned(); + ours_bytes.push(len); + if let Some(d) = d { diags.push(d); } + let n = dec.decode_float(&out[..len], &mut buf).expect("decode"); + ours_dec.extend_from_slice(&buf[..n * CHANNELS]); + } + let ours_trim: Vec = ours_dec.into_iter().take(source_frames * CHANNELS).collect(); + let (_, ours_aligned) = align_to_source(&source_pcm, &ours_trim, CHANNELS, MAX_LAG); + + // Per-second correlation ours vs ref against the full-band source (matches + // the gate's corr_bl for the 12k auto-mode row: no lowpass). + let n_frames = source_frames + .min(ours_aligned.len() / CHANNELS) + .min(ref_aligned.len() / CHANNELS); + let sec_samples = 48000usize; + let frames_per_sec = sec_samples / FRAME; // 50 + + let mut sec_rows: Vec<(usize, f64, f64, f64)> = Vec::new(); // (sec, corr_o, corr_r, gap) + let mut start = 0usize; + let mut sec_idx = 0usize; + while start + sec_samples <= n_frames { + let (mut sxy_o, mut sxx_o, mut syy_o) = (0.0f64, 0.0f64, 0.0f64); + let (mut sxy_r, mut sxx_r, mut syy_r) = (0.0f64, 0.0f64, 0.0f64); + for i in 0..sec_samples { + let s = source_pcm[start + i] as f64; + let o = ours_aligned[start + i] as f64; + let r = ref_aligned[start + i] as f64; + sxy_o += s * o; sxx_o += s * s; syy_o += o * o; + sxy_r += s * r; sxx_r += s * s; syy_r += r * r; + } + let co = if sxx_o > 0.0 && syy_o > 0.0 { sxy_o / (sxx_o * syy_o).sqrt() } else { 0.0 }; + let cr = if sxx_r > 0.0 && syy_r > 0.0 { sxy_r / (sxx_r * syy_r).sqrt() } else { 0.0 }; + sec_rows.push((sec_idx, co, cr, cr - co)); + start += sec_samples; + sec_idx += 1; + } + + let mut sorted = sec_rows.clone(); + sorted.sort_by(|a, b| b.3.partial_cmp(&a.3).unwrap()); + + let mut out_str = String::new(); + out_str.push_str("# reelm@12k SILK per-second diagnostic (r1)\n"); + out_str.push_str("# mono, 120s cap, 20ms frames, VBR constrained, 48kHz, Application::Voip\n"); + out_str.push_str(&format!("# total frames: ours={} ref={}\n", diags.len(), ref_payload.len())); + let avg_o: f64 = sec_rows.iter().map(|r| r.1).sum::() / sec_rows.len().max(1) as f64; + let avg_r: f64 = sec_rows.iter().map(|r| r.2).sum::() / sec_rows.len().max(1) as f64; + let gap_avg = avg_r - avg_o; + out_str.push_str(&format!( + "# avg corr: ours={:.4} ref={:.4} gap={:+.4} ref_kbps={:.1} ours_kbps={:.1}\n\n", + avg_o, avg_r, gap_avg, ref_kbps, + ours_bytes.iter().map(|&b| b as f64).sum::() * 8.0 / seconds / 1000.0 + )); + + // Per-second summary table. + out_str.push_str("# sec\tcorr_o\tcorr_r\tgap\tgain_idx_mean\tvoiced_n\tnlsf_interp\tavg_B_o\tavg_B_r\tltp_gain_mean\tpitch_l_mean\n"); + for &(s, co, cr, g) in &sec_rows { + let f0 = s * frames_per_sec; + let f1 = ((s + 1) * frames_per_sec).min(diags.len()); + let sd = &diags[f0..f1.min(diags.len())]; + let gain_mean: f64 = if !sd.is_empty() { + sd.iter().map(|d| d.gain_idx[0] as f64).sum::() / sd.len() as f64 + } else { -1.0 }; + let voiced_n = sd.iter().filter(|d| d.voiced).count(); + let nlsf_int = if !sd.is_empty() { + sd.iter().map(|d| d.nlsf_interp).max().unwrap_or(0) + } else { 0 }; + let avg_b_o: f64 = if !sd.is_empty() { + sd.iter().map(|d| d.bytes as f64).sum::() / sd.len() as f64 + } else { 0.0 }; + let ref_f0 = f0.min(ref_payload.len()); + let ref_f1 = f1.min(ref_payload.len()); + let avg_b_r: f64 = if ref_f1 > ref_f0 { + ref_payload[ref_f0..ref_f1].iter().map(|&b| b as f64).sum::() + / (ref_f1 - ref_f0) as f64 + } else { 0.0 }; + let ltp_mean: f64 = if !sd.is_empty() { + sd.iter().map(|d| d.ltp_gain as f64).sum::() / sd.len() as f64 + } else { 0.0 }; + let pitch_mean: f64 = if !sd.is_empty() { + sd.iter().filter(|d| d.voiced).map(|d| d.pitch_l[0] as f64).sum::() + / sd.iter().filter(|d| d.voiced).count().max(1) as f64 + } else { 0.0 }; + out_str.push_str(&format!( + "{}\t{:.4}\t{:.4}\t{:+.4}\t{:.1}\t{}\t{}\t{:.1}\t{:.1}\t{:.3}\t{:.1}\n", + s, co, cr, g, gain_mean, voiced_n, nlsf_int, avg_b_o, avg_b_r, ltp_mean, pitch_mean + )); + } + + // Top 10 worst seconds by gap with per-frame SILK diag. + out_str.push_str("\n# --- 10 worst seconds by gap (per-frame SILK diag) ---\n"); + out_str.push_str("# frame\tt_ms\tB_o\tB_r\tvoiced\tsig_type\tgain[0]\tlag_idx\tpitch_l\tnlsf_int\tltp_gain\tnb_subfr\n"); + for &(s, _co, _cr, g) in sorted.iter().take(10) { + let f0 = s * frames_per_sec; + let f1 = ((s + 1) * frames_per_sec).min(diags.len()); + out_str.push_str(&format!("# second {} gap={:+.4}\n", s, g)); + for fi in f0..f1.min(diags.len()) { + let d = &diags[fi]; + let b_ref = ref_payload.get(fi).copied().unwrap_or(0); + out_str.push_str(&format!( + "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{:.3}\t{}\n", + fi, fi * 20, d.bytes, b_ref, + d.voiced as u8, d.signal_type, d.gain_idx[0], d.lag_index, + d.pitch_l[0], d.nlsf_interp, d.ltp_gain, d.nb_subfr + )); + } + out_str.push('\n'); + } + + // Global stats. + out_str.push_str("# --- global stats ---\n"); + let voiced_count = diags.iter().filter(|d| d.voiced).count(); + out_str.push_str(&format!("# voiced frames: {}/{}\n", voiced_count, diags.len())); + let gain_hist: Vec<(i8, usize)> = { + let mut h = std::collections::HashMap::new(); + for d in &diags { *h.entry(d.gain_idx[0]).or_insert(0) += 1; } + let mut v: Vec<_> = h.into_iter().collect(); + v.sort(); + v + }; + out_str.push_str(&format!("# gain_idx[0] histogram: {:?}\n", gain_hist)); + let nlsf_hist: Vec<(i32, usize)> = { + let mut h = std::collections::HashMap::new(); + for d in &diags { *h.entry(d.nlsf_interp).or_insert(0) += 1; } + let mut v: Vec<_> = h.into_iter().collect(); + v.sort(); + v + }; + out_str.push_str(&format!("# nlsf_interp histogram: {:?}\n", nlsf_hist)); + let avg_b_ours: f64 = diags.iter().map(|d| d.bytes as f64).sum::() / diags.len().max(1) as f64; + let avg_b_ref: f64 = ref_payload.iter().map(|&b| b as f64).sum::() / ref_payload.len().max(1) as f64; + out_str.push_str(&format!("# avg bytes/frame: ours={:.1} ref={:.1}\n", avg_b_ours, avg_b_ref)); + let ltp_mean_all: f64 = diags.iter().map(|d| d.ltp_gain as f64).sum::() / diags.len().max(1) as f64; + out_str.push_str(&format!("# mean ltp_gain: {:.4}\n", ltp_mean_all)); + + let out_path = lanes_dir.join("opus-silkq-r1.seconds.txt"); + fs::write(&out_path, out_str).unwrap(); + println!("wrote {}", out_path.display()); +} + +// --------------------------------------------------------------------------- +// ORACLE: decode both our packets and ffmpeg-libopus ref packets through our +// own SilkDecoder, read back the per-frame `Indices`, and print side-by-side +// for the worst seconds to name the divergence mechanism. +// Run: SWEEP_ONLY=reelm cargo test -p ec-opus --release --test conformance \ +// silk_silkq_oracle -- --ignored --nocapture +// --------------------------------------------------------------------------- +#[test] +#[ignore] +fn silk_silkq_oracle() { + const SECS: f64 = 120.0; + const FRAME: usize = 960; // 20 ms at 48 kHz + const CHANNELS: usize = 1; + const KBPS: u32 = 12; + const TARGET_SECS: &[usize] = &[3, 39, 51, 5, 1]; + + let src = shellexpand("~/Music/reelm.wav"); + assert!(src.exists(), "source missing: {}", src.display()); + let source_pcm = ffmpeg_decode_pcm_mono(&src, SECS); + + let lanes_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes"); + fs::create_dir_all(&lanes_dir).unwrap(); + let ref_ogg = temp_path("opus-silkq-oracle-ref.opus"); + + // Reference: ffmpeg libopus mono voip at 12k. + ffmpeg_encode_libopus_mono_voip(&src, KBPS, &ref_ogg, SECS); + let ref_ogg_bytes = fs::read(&ref_ogg).expect("read ref ogg"); + let ref_packets: Vec> = ogg_packets(&ref_ogg_bytes) + .into_iter() + .skip(2) + .filter(|p| !p.is_empty()) + .collect(); + let _ = fs::remove_file(&ref_ogg); + + // Ours: ec-opus Voip at 12k. + let mut enc = Encoder::new(48000, CHANNELS, Application::Voip).expect("encoder"); + enc.set_bitrate(KBPS * 1000); + enc.set_vbr_constrained(true); + let mut out = vec![0u8; 1500]; + let mut ours_packets: Vec> = Vec::new(); + let mut padded = Vec::new(); + for block in source_pcm.chunks(FRAME * CHANNELS) { + let block = if block.len() < FRAME * CHANNELS { + padded.clear(); + padded.extend_from_slice(block); + padded.resize(FRAME * CHANNELS, 0.0); + &padded[..] + } else { + block + }; + let len = enc.encode_float(block, FRAME, &mut out).expect("encode"); + ours_packets.push(out[..len].to_vec()); + } + + + let ours_ix = collect_indices(&ours_packets); + let ref_ix = collect_indices(&ref_packets); + + eprintln!("ours frames: {} ref frames: {}", ours_ix.len(), ref_ix.len()); + + // Print side-by-side for target seconds (50 frames/sec at 20ms). + let frames_per_sec = 50usize; + let mut out_str = String::new(); + out_str.push_str("# reelm@12k SILK oracle: ours vs ffmpeg-libopus indices (r1)\n"); + out_str.push_str("# mono, 120s, 20ms frames, VBR constrained, 48kHz, Application::Voip\n"); + out_str.push_str(&format!("# ours_frames={} ref_frames={}\n", ours_ix.len(), ref_ix.len())); + out_str.push_str("# sig: 0=unvoiced 2=voiced | per: LTP codebook | nlsf_i: 4=nointerp\n"); + out_str.push_str("# gains/ltp are 4 subframe indices; lag/contour only for voiced\n\n"); + + for &sec in TARGET_SECS { + let start = sec * frames_per_sec; + let end = start + frames_per_sec; + out_str.push_str(&format!("=== second {} (frames {}–{}) ===\n", sec, start, end - 1)); + out_str.push_str("frame side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes\n"); + for f in start..end { + let ours = ours_ix.get(f); + let refr = ref_ix.get(f); + if ours.is_none() && refr.is_none() { + continue; + } + for (side, item) in [("O", ours), ("R", refr)] { + match item { + Some((ix, bytes)) => { + let voiced = ix.signal_type == 2; + let lag_str = if voiced { + format!("{:4}", ix.lag_index) + } else { + " -".to_string() + }; + let cont_str = if voiced { + format!("{:4}", ix.contour_index) + } else { + " -".to_string() + }; + let per_str = if voiced { + format!("{}", ix.per_index) + } else { + "-".to_string() + }; + let ltp_str = if voiced { + format!("[{},{},{},{}]", ix.ltp_index[0], ix.ltp_index[1], ix.ltp_index[2], ix.ltp_index[3]) + } else { + "[-,-,-,-]".to_string() + }; + let ltpscl_str = if voiced { + format!("{}", ix.ltp_scale_index) + } else { + "-".to_string() + }; + out_str.push_str(&format!( + "{:5} {} {:2} {:2} [{:2},{:2},{:2},{:2}] {:2} {} {} {} {} {} {:2} {:3}\n", + f, side, ix.signal_type, ix.quant_offset_type, + ix.gains[0], ix.gains[1], ix.gains[2], ix.gains[3], + ix.nlsf_interp_coef_q2, + lag_str, cont_str, per_str, ltp_str, ltpscl_str, + ix.seed, bytes, + )); + } + None => { + out_str.push_str(&format!("{:5} {} -- missing --\n", f, side)); + } + } + } + } + out_str.push('\n'); + } + + // Summarize divergence statistics across ALL frames. + let n = ours_ix.len().min(ref_ix.len()); + let mut sig_mismatch = 0; + let mut qoff_mismatch = 0; + let mut gain_diff_sum = 0i64; + let mut nlsf_interp_diff = 0; + let mut ltp_per_mismatch = 0; + let mut ltp_idx_diff_sum = 0i64; + let mut voiced_both = 0; + let mut lag_diff_sum = 0i64; + let mut bytes_ours = 0u64; + let mut bytes_ref = 0u64; + for i in 0..n { + let (o, ob) = &ours_ix[i]; + let (r, rb) = &ref_ix[i]; + if o.signal_type != r.signal_type { sig_mismatch += 1; } + if o.quant_offset_type != r.quant_offset_type { qoff_mismatch += 1; } + for k in 0..4 { gain_diff_sum += (o.gains[k] as i64 - r.gains[k] as i64).abs(); } + if o.nlsf_interp_coef_q2 != r.nlsf_interp_coef_q2 { nlsf_interp_diff += 1; } + if o.signal_type == 2 && r.signal_type == 2 { + voiced_both += 1; + if o.per_index != r.per_index { ltp_per_mismatch += 1; } + for k in 0..4 { ltp_idx_diff_sum += (o.ltp_index[k] as i64 - r.ltp_index[k] as i64).abs(); } + lag_diff_sum += (o.lag_index as i64 - r.lag_index as i64).abs(); + } + bytes_ours += *ob as u64; + bytes_ref += *rb as u64; + } + out_str.push_str("=== divergence summary (all frames) ===\n"); + out_str.push_str(&format!("frames compared: {}\n", n)); + out_str.push_str(&format!("signal_type mismatch: {} ({:.1}%)\n", sig_mismatch, 100.0 * sig_mismatch as f64 / n as f64)); + out_str.push_str(&format!("quant_offset mismatch: {} ({:.1}%)\n", qoff_mismatch, 100.0 * qoff_mismatch as f64 / n as f64)); + out_str.push_str(&format!("avg |gain diff| per subframe: {:.2}\n", gain_diff_sum as f64 / (n as f64 * 4.0))); + out_str.push_str(&format!("nlsf_interp mismatch: {} ({:.1}%)\n", nlsf_interp_diff, 100.0 * nlsf_interp_diff as f64 / n as f64)); + out_str.push_str(&format!("voiced_both: {}\n", voiced_both)); + out_str.push_str(&format!(" LTP per_index mismatch: {} ({:.1}%)\n", ltp_per_mismatch, 100.0 * ltp_per_mismatch as f64 / voiced_both.max(1) as f64)); + out_str.push_str(&format!(" avg |ltp_index diff| per subframe: {:.2}\n", ltp_idx_diff_sum as f64 / (voiced_both.max(1) as f64 * 4.0))); + out_str.push_str(&format!(" avg |lag diff|: {:.2}\n", lag_diff_sum as f64 / voiced_both.max(1) as f64)); + out_str.push_str(&format!("total bytes: ours={} ref={} ratio={:.3}\n", bytes_ours, bytes_ref, bytes_ours as f64 / bytes_ref.max(1) as f64)); + + let out_path = lanes_dir.join("opus-silkq-r1.oracle.txt"); + fs::write(&out_path, &out_str).unwrap(); + println!("wrote {}", out_path.display()); + print!("{}", out_str); +} + +/// Decode a SILK stream packet-by-packet through a fresh `SilkDecoder`, +/// snapshotting each frame's coded indices — the oracle diagnostic's view of +/// what the bitstream actually coded (our encoder's packets and a reference +/// encoder's alike). +fn collect_indices(packets: &[Vec]) -> Vec<(ec_opus::SilkDecIndices, usize)> { + let mut silk = ec_opus::SilkDecoder::new(16000, 1); + let mut results = Vec::new(); + let mut silk_pcm = vec![0i16; 320]; // 20ms at 16kHz + for pkt in packets { + if pkt.len() <= 1 { + continue; // DTX / empty + } + let parsed = match ec_opus::Packet::parse(pkt, false) { + Ok(p) => p, + Err(_) => continue, + }; + let toc = parsed.toc; + let mode = toc.mode(); + if mode == ec_opus::Mode::Celt { + continue; + } + let internal_rate = if mode == ec_opus::Mode::Hybrid { + 16000 + } else { + match toc.bandwidth() { + ec_opus::Bandwidth::Narrow => 8000, + ec_opus::Bandwidth::Medium => 12000, + _ => 16000, + } + }; + let payload_ms = (toc.frame_size_48k() / 48).max(10); + let mut first = true; + for frame_data in &parsed.frames { + if frame_data.len() <= 1 { + first = false; + continue; + } + let mut dec = ec_opus::RangeDecoder::new(frame_data); + let _ = silk.decode( + &mut dec, + &mut silk_pcm, + payload_ms, + internal_rate, + 1, + first, + ); + let ix = silk.last_indices(); + let bytes = frame_data.len(); + results.push((ix, bytes)); + first = false; + } + } + results +} + +// --------------------------------------------------------------------------- +// SILK 12k spectral divergence: WHERE the 12 kbps Voip err_ratio outlier +// carries its error. Same machinery as spectral_divergence_vs_libopus, but +// mono/Application::Voip/12 kbps on reelm.wav, both sides decoded through +// ffmpeg libopus (gate symmetry), with the index oracle on the worst frames. +// Run: +// cargo test -p ec-opus --release --test conformance \ +// silk_spectral_divergence_12k -- --ignored --nocapture +// Writes lanes/opus-silkq-r2.bands.txt. +// --------------------------------------------------------------------------- + +#[test] +#[ignore] +fn silk_spectral_divergence_12k() { + const SECS: f64 = 120.0; + const FRAME: usize = 960; // 20 ms at 48 kHz + const CHANNELS: usize = 1; + const MAX_LAG: usize = 2000; + const KBPS: u32 = 12; + + let src = shellexpand("~/Music/reelm.wav"); + assert!(src.exists(), "source missing: {}", src.display()); + let source_pcm = ffmpeg_decode_pcm_mono(&src, SECS); + let source_frames = source_pcm.len() / CHANNELS; + assert!(source_frames > 48_000, "source too short"); + let seconds = source_frames as f64 / 48000.0; + + let lanes_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes"); + fs::create_dir_all(&lanes_dir).unwrap(); + let ref_ogg = temp_path("opus-silkq-r2-ref.opus"); + let ours_ogg = temp_path("opus-silkq-r2-ours.opus"); + + // Reference: ffmpeg libopus mono voip at 12k, decoded by ffmpeg libopus. + ffmpeg_encode_libopus_mono_voip(&src, KBPS, &ref_ogg, SECS); + let ref_bytes = fs::metadata(&ref_ogg).map(|m| m.len() as usize).unwrap_or(0); + let ref_kbps = ref_bytes as f64 * 8.0 / seconds / 1000.0; + let ref_dec = ffmpeg_decode(&ref_ogg, CHANNELS).expect("ffmpeg libopus decode of ref"); + let ref_trim: Vec = ref_dec.into_iter().take(source_frames * CHANNELS).collect(); + let (_, ref_aligned) = align_to_source(&source_pcm, &ref_trim, CHANNELS, MAX_LAG); + let ref_ogg_bytes = fs::read(&ref_ogg).expect("read ref ogg"); + let ref_packets: Vec> = ogg_packets(&ref_ogg_bytes) + .into_iter() + .skip(2) + .filter(|p| !p.is_empty()) + .collect(); + let _ = fs::remove_file(&ref_ogg); + + // Ours: ec-opus Voip at the reference's realised rate; our packets + // re-decoded through ffmpeg libopus so both sides cross the same decoder. + let mut enc = Encoder::new(48000, CHANNELS, Application::Voip).expect("encoder"); + enc.set_bitrate((ref_kbps * 1000.0).round() as u32); + enc.set_vbr_constrained(true); + let pre_skip = enc.look_ahead(FRAME) as i64; + let mut out = vec![0u8; 1500]; + let mut ours_packets: Vec> = Vec::new(); + let mut padded = Vec::new(); + for block in source_pcm.chunks(FRAME * CHANNELS) { + let block = if block.len() < FRAME * CHANNELS { + padded.clear(); + padded.extend_from_slice(block); + padded.resize(FRAME * CHANNELS, 0.0); + &padded[..] + } else { + block + }; + let len = enc.encode_float(block, FRAME, &mut out).expect("encode"); + ours_packets.push(out[..len].to_vec()); + } + write_ogg_opus( + &ours_ogg, + &ours_packets, + opus_head(CHANNELS, pre_skip as u16, None), + CHANNELS, + source_frames, + pre_skip, + ); + let ours_bytes: usize = ours_packets.iter().map(|p| p.len()).sum(); + let ours_kbps = ours_bytes as f64 * 8.0 / seconds / 1000.0; + let ours_dec = ffmpeg_decode(&ours_ogg, CHANNELS).expect("ffmpeg libopus decode of ours"); + let _ = fs::remove_file(&ours_ogg); + let ours_trim: Vec = ours_dec.into_iter().take(source_frames * CHANNELS).collect(); + let (_, ours_aligned) = align_to_source(&source_pcm, &ours_trim, CHANNELS, MAX_LAG); + + // opus_compare totals, per-band eb², per-frame ef² — both vs the source. + let cmp_frames = source_frames + .min(ours_aligned.len() / CHANNELS) + .min(ref_aligned.len() / CHANNELS); + let take = |v: &[f32]| -> Vec { to_i16(&v[..cmp_frames * CHANNELS]) }; + let s_i = take(&source_pcm); + let o_i = take(&ours_aligned); + let r_i = take(&ref_aligned); + let (err_o, eb2_o, ef2_o) = opus_compare_err_parts(&s_i, &o_i, CHANNELS); + let (err_r, eb2_r, ef2_r) = opus_compare_err_parts(&s_i, &r_i, CHANNELS); + let nframes = ef2_o.len(); + assert_eq!(nframes, ef2_r.len(), "frame counts differ"); + + // Raw (unmasked) band energies: spectral shape + dominant-band lookup. + let as_f64 = |v: &[i16]| -> Vec { v.iter().map(|&x| x as f64).collect() }; + let mut bands_s = Vec::new(); + let mut bands_o = Vec::new(); + let mut bands_r = Vec::new(); + let mut scratch_ps = Vec::new(); + band_energy(&as_f64(&s_i), CHANNELS, nframes, &mut Some(&mut bands_s), &mut scratch_ps); + band_energy(&as_f64(&o_i), CHANNELS, nframes, &mut Some(&mut bands_o), &mut scratch_ps); + band_energy(&as_f64(&r_i), CHANNELS, nframes, &mut Some(&mut bands_r), &mut scratch_ps); + + // Oracle indices both sides; FFT frame xi -> 20 ms packet index. + let ours_ix = collect_indices(&ours_packets); + let ref_ix = collect_indices(&ref_packets); + let pkt_of = |xi: usize| xi * WIN_STEP / (FRAME * CHANNELS); + + let mut report = String::new(); + report.push_str("# reelm@12k SILK per-band divergence: ours vs ffmpeg-libopus (r2)\n"); + report.push_str("# mono, 120s, 20ms frames, VBR constrained, 48kHz, Application::Voip\n"); + report.push_str(&format!( + "# rates: ours {ours_kbps:.2} kbps, ref {ref_kbps:.2} kbps; \ + err ours={err_o:.3} ref={err_r:.3} ratio={:.2}; nframes={nframes}\n", + err_o / err_r + )); + + // (1) 21-band table: which bands carry the error. + let sum_o: f64 = eb2_o.iter().sum(); + let sum_r: f64 = eb2_r.iter().sum(); + report.push_str( + "# eb2 = band's mean share of the pre-squared frame error; \ + dln = mean ln(E_test/E_src); band i ends at CELT_EBANDS[i+1]*240 Hz\n", + ); + report.push_str("# band lo_hz hi_hz dln_o dln_r eb2_o eb2_r ratio share_o share_r\n"); + for bi in 0..NBANDS { + let (mut dol, mut drl) = (0.0f64, 0.0f64); + for xi in 0..nframes { + let sl = bands_s[(xi * NBANDS + bi) * CHANNELS].ln(); + dol += bands_o[(xi * NBANDS + bi) * CHANNELS].ln() - sl; + drl += bands_r[(xi * NBANDS + bi) * CHANNELS].ln() - sl; + } + dol /= nframes as f64; + drl /= nframes as f64; + let ratio = if eb2_r[bi] > 0.0 { eb2_o[bi] / eb2_r[bi] } else { f64::INFINITY }; + report.push_str(&format!( + "{:5} {:5} {:6} {:+.3} {:+.3} {:.3e} {:.3e} {:>7} {:5.1}% {:5.1}%\n", + bi, + CELT_EBANDS[bi] * 240, + CELT_EBANDS[bi + 1] * 240, + dol, + drl, + eb2_o[bi], + eb2_r[bi], + ratio, + 100.0 * eb2_o[bi] / sum_o, + 100.0 * eb2_r[bi] / sum_r, + )); + } + + // (2) top-15 frames by ef2(ours), with the dominant band and the oracle. + let mut by_ef2: Vec = (0..nframes).collect(); + by_ef2.sort_by(|&a, &b| ef2_o[b].partial_cmp(&ef2_o[a]).unwrap()); + report.push_str( + "\n# top-15 frames by ef2(ours) (ef2 = frame's squared opus_compare error); \ + dom = argmax_b (lnE_o - lnE_s)^2, raw bands\n", + ); + report.push_str( + "# t(s) fft pkt ef2_o ef2_r dom domband_hz | side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes\n", + ); + for &xi in by_ef2.iter().take(15) { + let pkt = pkt_of(xi); + let t = (xi * WIN_STEP) as f64 / 48000.0; + let (mut dom, mut dom_v) = (0usize, -1.0f64); + for bi in 0..NBANDS { + let sl = bands_s[(xi * NBANDS + bi) * CHANNELS].ln(); + let d = bands_o[(xi * NBANDS + bi) * CHANNELS].ln() - sl; + if d * d > dom_v { + dom_v = d * d; + dom = bi; + } + } + report.push_str(&format!( + "{:7.3} {:5} {:4} {:.3e} {:.3e} {:2} {}-{}Hz\n", + t, + xi, + pkt, + ef2_o[xi], + ef2_r[xi], + dom, + CELT_EBANDS[dom] * 240, + CELT_EBANDS[dom + 1] * 240 + )); + for (side, ixv) in [(" O", ours_ix.get(pkt)), (" R", ref_ix.get(pkt))] { + match ixv { + Some((ix, bytes)) => { + let voiced = ix.signal_type == 2; + let opt = |v: String, on: bool| if on { v } else { "-".to_owned() }; + report.push_str(&format!( + " {side} sig={} qoff={} gains=[{},{},{},{}] nlsf_i={} lag={} cont={} per={} ltp=[{},{},{},{}] ltpscl={} seed={} bytes={}\n", + ix.signal_type, + ix.quant_offset_type, + ix.gains[0], + ix.gains[1], + ix.gains[2], + ix.gains[3], + ix.nlsf_interp_coef_q2, + opt(format!("{}", ix.lag_index), voiced), + opt(format!("{}", ix.contour_index), voiced), + opt(format!("{}", ix.per_index), voiced), + opt(format!("{}", ix.ltp_index[0]), voiced), + opt(format!("{}", ix.ltp_index[1]), voiced), + opt(format!("{}", ix.ltp_index[2]), voiced), + opt(format!("{}", ix.ltp_index[3]), voiced), + opt(format!("{}", ix.ltp_scale_index), voiced), + ix.seed, + bytes + )); + } + None => report.push_str(&format!(" {side} -- missing --\n")), + } + } + } + + // (3) tail vs body: how much of the total error the worst frames carry, + // and whether the 11x ratio survives de-tailing (err = (Σef2/n)^(1/16)). + let tail = |ef2: &[f64]| -> (usize, f64, f64, usize, f64) { + let mut s = ef2.to_vec(); + s.sort_by(|a, b| b.partial_cmp(a).unwrap()); + let tot: f64 = s.iter().sum(); + let k = (s.len() / 100).max(1); + let top1: f64 = s[..k].iter().sum(); + let (mut half, mut acc) = (s.len(), 0.0); + for (i, v) in s.iter().enumerate() { + acc += v; + if acc >= 0.5 * tot { + half = i + 1; + break; + } + } + (k, top1 / tot, half as f64 / s.len() as f64, half, tot) + }; + let root16 = |tot: f64, n: usize| tot.powf(1.0 / 16.0) / (n as f64).powf(1.0 / 16.0); + let (k, sh1_o, halff_o, half_o, _tot_o) = tail(&ef2_o); + let (_, sh1_r, halff_r, half_r, _tot_r) = tail(&ef2_r); + report.push_str(&format!( + "# tail: top-1% ({k} frames) carry {:.2}% of ours' Σef2 vs {:.2}% of ref's; \ + 50% of ours' err sits in the worst {half_o} frames ({:.2}%) \ + vs ref's worst {half_r} ({:.2}%)\n", + 100.0 * sh1_o, 100.0 * sh1_r, 100.0 * halff_o, 100.0 * halff_r + )); + // De-tailed: drop each side's worst 50 frames (of 24k FFT frames/pkt-mapped). + let clip50 = |ef2: &[f64]| -> f64 { + let mut s = ef2.to_vec(); + s.sort_by(|a, b| b.partial_cmp(a).unwrap()); + s[50..].iter().sum() + }; + let err_o_clip = root16(clip50(&ef2_o), nframes); + let err_r_clip = root16(clip50(&ef2_r), nframes); + report.push_str(&format!( + "# de-tailed (worst 50 of {nframes} FFT frames dropped per side): \ + err ours={err_o_clip:.3} ref={err_r_clip:.3} ratio={:.2} (was {err_o:.3}/{err_r:.3}/{:.2})\n", + err_o_clip / err_r_clip, + err_o / err_r + )); + // Burst signature: per 20 ms packet, does first-subframe gain >= 60 or a + // starved packet (<= 20 bytes) line up with the packet's mean ef2? + let mut pkt_ef2 = vec![0.0f64; ours_packets.len()]; + let mut pkt_cnt = vec![0u32; ours_packets.len()]; + for xi in 0..nframes { + let p = pkt_of(xi).min(pkt_ef2.len() - 1); + pkt_ef2[p] += ef2_o[xi]; + pkt_cnt[p] += 1; + } + let mut g_hi = (0.0f64, 0usize); // (sum, count) packets with gains[0] >= 60 + let mut g_lo = (0.0f64, 0usize); + let mut b_lo = (0.0f64, 0usize); // bytes <= 20 + let mut b_hi = (0.0f64, 0usize); + for (i, (ix, bytes)) in ours_ix.iter().enumerate() { + if i >= pkt_ef2.len() { + break; + } + let mean = if pkt_cnt[i] > 0 { pkt_ef2[i] / pkt_cnt[i] as f64 } else { 0.0 }; + if ix.gains[0] >= 60 { + g_hi.0 += mean; + g_hi.1 += 1; + } else { + g_lo.0 += mean; + g_lo.1 += 1; + } + if *bytes <= 20 { + b_lo.0 += mean; + b_lo.1 += 1; + } else { + b_hi.0 += mean; + b_hi.1 += 1; + } + } + report.push_str(&format!( + "# burst signature: packets with gains[0]>=60: {}/{}, mean ef2 {:.3e}; \ + gains[0]<60: mean ef2 {:.3e} || packets <=20 bytes: {}/{}, mean ef2 {:.3e}; \ + >20 bytes: mean ef2 {:.3e}\n", + g_hi.1, + g_hi.1 + g_lo.1, + if g_hi.1 > 0 { g_hi.0 / g_hi.1 as f64 } else { f64::NAN }, + if g_lo.1 > 0 { g_lo.0 / g_lo.1 as f64 } else { f64::NAN }, + b_lo.1, + b_lo.1 + b_hi.1, + if b_lo.1 > 0 { b_lo.0 / b_lo.1 as f64 } else { f64::NAN }, + if b_hi.1 > 0 { b_hi.0 / b_hi.1 as f64 } else { f64::NAN }, + )); + + let out_path = lanes_dir.join("opus-silkq-r2.bands.txt"); + fs::write(&out_path, &report).unwrap(); + println!("wrote {}", out_path.display()); + print!("{}", report); +} + // --------------------------------------------------------------------------- // Harness: feed identical raw PCM (.sw, s16le interleaved) to our opus_compare // so it can be checked against the C `opus_compare` tool on the SAME bytes. diff --git a/lanes/opus-silkq-r1.oracle.txt b/lanes/opus-silkq-r1.oracle.txt new file mode 100644 index 00000000..596ab23c --- /dev/null +++ b/lanes/opus-silkq-r1.oracle.txt @@ -0,0 +1,532 @@ +# reelm@12k SILK oracle: ours vs ffmpeg-libopus indices (r1) +# mono, 120s, 20ms frames, VBR constrained, 48kHz, Application::Voip +# ours_frames=6000 ref_frames=6001 +# sig: 0=unvoiced 2=voiced | per: LTP codebook | nlsf_i: 4=nointerp +# gains/ltp are 4 subframe indices; lag/contour only for voiced + +=== second 3 (frames 150–199) === +frame side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes + 150 O 2 0 [33, 4, 7, 4] 4 40 2 2 [18,31,18,18] 0 0 33 + 150 R 2 0 [27, 4, 4, 5] 2 45 7 2 [20,2,2,11] 0 2 30 + 151 O 2 0 [42, 3, 3, 5] 4 39 1 0 [3,7,3,7] 0 0 29 + 151 R 2 0 [29, 6, 5, 5] 4 43 9 2 [21,4,17,8] 0 3 32 + 152 O 2 0 [47, 3, 4, 5] 4 39 3 2 [25,7,18,31] 0 0 21 + 152 R 2 0 [33, 5, 4, 5] 3 42 0 2 [8,4,16,12] 0 3 33 + 153 O 2 0 [47, 0, 4, 5] 4 40 13 2 [7,25,19,27] 0 0 27 + 153 R 2 0 [35, 4, 4, 5] 2 42 0 2 [12,5,2,21] 0 2 28 + 154 O 2 0 [47, 0, 0, 1] 4 40 1 2 [25,31,0,3] 0 0 36 + 154 R 2 0 [36, 4, 4, 4] 4 41 1 2 [8,3,16,1] 0 3 28 + 155 O 2 0 [41, 4, 2, 1] 4 40 4 2 [31,31,7,0] 0 0 36 + 155 R 2 0 [36, 6, 3, 1] 4 42 1 1 [11,6,9,9] 0 0 32 + 156 O 2 0 [40, 3, 4, 3] 4 39 1 1 [3,15,15,15] 0 0 28 + 156 R 2 0 [32, 4, 3, 4] 3 43 6 2 [16,12,24,13] 0 0 31 + 157 O 2 0 [39, 2, 4, 4] 4 39 1 2 [7,7,7,27] 0 0 33 + 157 R 2 0 [31, 3, 3, 4] 4 44 1 2 [14,0,10,1] 0 2 21 + 158 O 2 0 [37, 2, 1, 4] 4 42 1 1 [9,10,15,0] 0 0 27 + 158 R 2 0 [28, 4, 3, 3] 2 46 6 1 [6,14,13,12] 0 2 28 + 159 O 2 0 [32, 2,15, 4] 4 48 7 0 [3,7,1,1] 0 0 25 + 159 R 2 0 [26, 3, 6,12] 1 50 8 0 [4,3,2,0] 0 0 33 + 160 O 2 0 [44, 1, 3, 6] 4 42 1 2 [7,0,31,7] 0 0 32 + 160 R 2 0 [39, 4, 3, 3] 4 45 1 2 [7,7,0,2] 0 0 32 + 161 O 2 0 [40, 3, 2, 4] 4 44 1 1 [15,15,2,15] 0 0 37 + 161 R 2 0 [36, 4, 4, 4] 4 46 0 2 [0,14,0,18] 0 3 28 + 162 O 2 0 [40, 2, 2, 4] 4 46 1 2 [3,25,31,31] 0 0 22 + 162 R 2 0 [35, 4, 3, 3] 4 47 3 1 [2,1,0,2] 0 2 21 + 163 O 2 0 [37, 1, 3, 5] 4 50 3 2 [19,18,7,18] 0 0 34 + 163 R 2 0 [32, 4, 3, 3] 2 51 8 1 [0,0,0,10] 0 1 23 + 164 O 2 0 [35, 3, 3, 4] 4 52 3 1 [15,15,15,3] 0 0 31 + 164 R 2 0 [28, 4, 4, 4] 4 54 8 1 [8,0,1,7] 0 0 25 + 165 O 2 0 [33, 5, 3, 4] 4 51 3 1 [3,3,3,10] 0 0 25 + 165 R 2 0 [28, 4, 4, 4] 4 58 6 1 [10,0,1,14] 0 2 21 + 166 O 2 0 [33, 3, 4, 4] 4 50 3 0 [1,1,2,0] 0 0 26 + 166 R 2 0 [28, 4, 4, 4] 4 57 11 1 [8,9,12,7] 0 3 34 + 167 O 2 0 [33, 4, 3, 4] 4 51 3 1 [3,3,15,15] 0 0 39 + 167 R 2 0 [29, 4, 4, 3] 4 55 9 0 [0,5,5,2] 0 2 30 + 168 O 2 0 [37, 3, 4, 5] 4 51 3 2 [31,31,7,7] 0 0 32 + 168 R 2 0 [28, 5, 4, 4] 4 54 5 0 [0,4,5,3] 0 2 36 + 169 O 2 0 [34, 2, 4, 6] 4 54 3 1 [15,0,15,4] 0 0 29 + 169 R 2 0 [30, 4, 4, 4] 4 55 4 0 [0,4,2,3] 0 1 33 + 170 O 2 0 [38, 5, 4, 3] 4 51 7 0 [0,7,2,4] 0 0 26 + 170 R 2 0 [31, 5, 6, 3] 2 55 0 2 [7,28,7,11] 0 0 39 + 171 O 2 0 [37, 3, 2, 2] 4 52 3 0 [7,0,0,7] 0 0 23 + 171 R 2 0 [33, 3, 4, 3] 4 54 2 0 [6,5,0,0] 0 2 30 + 172 O 2 0 [31, 5, 3, 4] 4 52 3 1 [10,10,0,15] 0 0 34 + 172 R 2 0 [29, 5, 5, 4] 1 58 7 1 [14,5,12,1] 0 2 29 + 173 O 2 0 [31, 5, 3, 3] 4 53 3 2 [31,27,24,7] 0 0 30 + 173 R 2 1 [31, 4, 4, 4] 4 60 9 0 [0,2,2,5] 0 1 33 + 174 O 2 0 [30, 5, 4, 5] 4 54 3 2 [10,26,20,27] 0 0 31 + 174 R 2 1 [31, 4, 4, 4] 4 59 0 2 [7,23,15,23] 0 1 31 + 175 O 2 0 [35, 4, 3, 5] 4 51 3 1 [15,8,12,13] 0 0 29 + 175 R 2 1 [32, 6, 4, 4] 4 57 9 0 [3,0,0,0] 0 2 30 + 176 O 2 0 [37, 1, 4, 4] 4 50 3 2 [30,7,2,18] 0 0 31 + 176 R 2 1 [34, 4, 4, 4] 4 58 9 1 [0,2,0,10] 0 3 32 + 177 O 2 0 [34, 5, 3, 4] 4 49 7 0 [6,7,7,7] 0 0 28 + 177 R 2 1 [34, 4, 4, 4] 4 57 4 0 [0,7,2,3] 0 1 31 + 178 O 2 0 [36, 1, 4, 5] 4 47 0 1 [2,12,1,15] 0 0 33 + 178 R 2 1 [34, 4, 3, 4] 4 52 14 0 [6,0,3,4] 0 2 29 + 179 O 2 0 [37, 2, 5, 3] 4 48 3 2 [30,0,10,27] 0 0 30 + 179 R 2 0 [33, 4, 4, 4] 4 53 9 0 [2,0,2,2] 0 1 33 + 180 O 2 0 [38, 3, 5, 4] 4 47 4 2 [27,7,7,7] 0 0 25 + 180 R 2 0 [32, 4, 4, 4] 4 52 2 0 [2,0,4,5] 0 2 30 + 181 O 2 0 [36, 5, 5, 4] 4 47 7 0 [5,0,2,2] 0 0 38 + 181 R 2 0 [32, 4, 5, 4] 4 51 2 1 [9,11,9,8] 0 1 38 + 182 O 2 0 [39, 5, 3, 4] 4 47 5 0 [7,6,1,1] 0 0 30 + 182 R 2 0 [35, 4, 4, 4] 4 51 0 0 [0,6,5,5] 0 0 34 + 183 O 2 0 [41, 4, 4, 4] 4 46 1 0 [2,7,1,0] 0 0 25 + 183 R 2 0 [35, 4, 4, 4] 4 50 2 1 [9,9,4,12] 0 2 31 + 184 O 2 0 [42, 4, 3, 4] 4 47 0 2 [23,30,7,7] 0 0 37 + 184 R 2 0 [35, 5, 3, 4] 4 51 0 2 [18,7,1,14] 0 3 31 + 185 O 2 0 [44, 2, 1, 6] 4 50 3 2 [31,31,25,25] 0 0 27 + 185 R 2 0 [35, 3, 4, 4] 4 51 4 0 [0,4,4,6] 0 1 30 + 186 O 2 0 [41, 3, 3, 4] 4 51 3 2 [31,25,25,25] 0 0 29 + 186 R 2 0 [34, 4, 4, 3] 4 52 6 1 [12,9,11,12] 0 1 33 + 187 O 2 0 [63, 4, 4, 4] 4 51 3 0 [1,1,1,1] 0 0 15 + 187 R 2 0 [33, 3, 4, 4] 4 52 1 1 [8,12,12,13] 0 0 30 + 188 O 2 0 [16, 0, 0, 0] 4 53 3 1 [3,3,3,15] 0 0 49 + 188 R 2 0 [32, 3, 4, 4] 4 53 1 0 [0,4,4,3] 0 1 32 + 189 O 2 0 [42, 1, 2, 6] 4 55 3 0 [3,0,3,3] 0 0 39 + 189 R 2 0 [31, 4, 4, 4] 4 56 3 0 [0,5,5,5] 0 2 31 + 190 O 2 0 [44, 1, 0, 5] 4 146 3 2 [10,18,18,31] 0 0 20 + 190 R 2 0 [33, 4, 2, 3] 1 57 3 0 [0,5,4,6] 0 0 28 + 191 O 2 0 [41, 1, 5, 0] 4 146 3 2 [7,7,7,7] 0 0 40 + 191 R 2 0 [29, 4, 4, 4] 4 57 11 1 [9,8,15,9] 0 1 31 + 192 O 2 0 [40, 7, 0, 1] 4 150 3 0 [0,1,0,2] 0 0 26 + 192 R 2 0 [29, 4, 4, 4] 2 148 32 2 [7,18,13,7] 0 1 28 + 193 O 2 0 [40, 4, 1, 6] 4 151 3 0 [0,2,0,7] 0 0 23 + 193 R 2 0 [29, 4, 3, 4] 4 150 0 1 [4,7,14,15] 0 0 26 + 194 O 2 0 [44, 0, 1, 0] 4 153 3 2 [18,7,24,7] 0 0 37 + 194 R 2 0 [28, 4, 4, 5] 4 153 6 2 [7,24,23,23] 0 1 35 + 195 O 2 0 [46, 0, 6, 0] 4 149 3 1 [3,15,3,15] 0 0 23 + 195 R 2 0 [29, 4, 4, 5] 4 153 14 2 [7,12,18,23] 0 3 32 + 196 O 2 0 [63, 4, 2, 3] 4 147 3 0 [1,0,1,1] 0 0 14 + 196 R 2 0 [30, 4, 4, 3] 4 149 14 1 [9,4,12,15] 0 0 25 + 197 O 2 0 [18, 0, 0, 0] 4 146 3 0 [0,1,1,1] 0 0 66 + 197 R 2 0 [29, 3, 5, 4] 4 148 2 1 [9,8,9,6] 0 2 30 + 198 O 2 0 [63, 4, 4, 4] 4 145 3 1 [3,3,3,3] 0 0 14 + 198 R 2 0 [30, 3, 4, 4] 4 147 0 2 [7,20,25,23] 0 3 29 + 199 O 2 0 [16, 0, 0, 0] 4 144 3 2 [7,7,7,7] 0 0 41 + 199 R 2 0 [29, 4, 4, 5] 4 145 5 2 [7,1,18,23] 0 2 29 + +=== second 39 (frames 1950–1999) === +frame side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes + 1950 O 2 0 [28, 4, 5, 5] 4 110 3 2 [7,27,7,27] 0 0 35 + 1950 R 1 0 [27, 3, 4, 6] 4 - - - [-,-,-,-] - 3 27 + 1951 O 2 0 [37, 7, 1,11] 4 45 8 2 [11,18,25,31] 0 0 25 + 1951 R 2 0 [29, 7, 7, 4] 4 45 15 1 [10,11,0,5] 0 1 34 + 1952 O 2 0 [40, 2, 4, 3] 4 47 0 0 [1,7,7,0] 0 0 34 + 1952 R 2 0 [39, 3, 0, 4] 4 50 3 1 [11,0,2,2] 0 2 27 + 1953 O 2 0 [40, 3, 2, 7] 4 49 7 2 [18,18,25,31] 0 0 26 + 1953 R 2 0 [33, 4, 4, 3] 3 51 2 1 [7,1,13,2] 0 3 31 + 1954 O 2 0 [40, 1, 4, 4] 4 49 3 2 [18,18,31,25] 0 0 33 + 1954 R 2 0 [32, 4, 3, 4] 1 51 0 1 [13,2,2,2] 0 1 29 + 1955 O 2 0 [39, 0, 6, 5] 4 50 3 0 [3,3,3,3] 0 0 33 + 1955 R 2 0 [31, 3, 3, 4] 4 53 3 1 [1,13,0,5] 0 0 27 + 1956 O 2 0 [40, 3, 3, 7] 4 50 3 1 [2,15,0,15] 0 0 26 + 1956 R 2 0 [29, 4, 5, 4] 2 54 7 2 [10,17,17,10] 0 2 34 + 1957 O 2 0 [42, 2, 7, 4] 4 51 3 0 [3,3,0,4] 0 0 29 + 1957 R 2 0 [32, 5, 5, 5] 4 54 12 2 [25,15,26,9] 0 0 32 + 1958 O 2 0 [43, 0, 3, 6] 4 54 3 2 [7,18,18,31] 0 0 34 + 1958 R 2 0 [35, 5, 4, 4] 2 56 3 2 [5,12,22,2] 0 2 23 + 1959 O 2 0 [39, 4, 2, 5] 4 55 3 2 [18,20,19,19] 0 0 33 + 1959 R 2 0 [36, 4, 4, 3] 4 55 5 0 [6,3,4,3] 0 0 35 + 1960 O 2 0 [39, 2, 4, 3] 4 53 3 1 [3,15,15,15] 0 0 23 + 1960 R 2 0 [35, 3, 3, 4] 2 55 7 1 [0,8,15,15] 0 1 30 + 1961 O 2 0 [34, 0, 1, 2] 4 242 3 1 [12,3,3,3] 0 0 34 + 1961 R 2 0 [32, 3, 0, 0] 4 56 9 1 [0,0,15,0] 0 2 31 + 1962 O 2 0 [23, 0, 2, 5] 4 51 3 2 [18,7,7,7] 0 0 33 + 1962 R 1 1 [22, 3, 1, 2] 4 - - - [-,-,-,-] - 2 25 + 1963 O 0 0 [24, 4, 3,14] 4 - - - [-,-,-,-] - 0 23 + 1963 R 1 0 [17, 7, 4, 4] 4 - - - [-,-,-,-] - 0 25 + 1964 O 0 0 [28, 4, 3, 8] 4 - - - [-,-,-,-] - 0 26 + 1964 R 1 0 [34, 3, 0, 4] 4 - - - [-,-,-,-] - 1 21 + 1965 O 2 0 [32, 3, 4, 5] 4 220 3 0 [1,3,1,6] 0 0 35 + 1965 R 1 1 [32, 5, 4, 4] 3 - - - [-,-,-,-] - 0 28 + 1966 O 0 0 [34, 5, 3, 5] 4 - - - [-,-,-,-] - 0 29 + 1966 R 1 1 [33, 4, 5, 4] 2 - - - [-,-,-,-] - 3 33 + 1967 O 2 0 [39, 4, 3, 3] 4 48 7 2 [7,25,7,18] 0 0 32 + 1967 R 1 0 [34, 6, 4, 4] 2 - - - [-,-,-,-] - 0 33 + 1968 O 2 0 [40, 5, 0, 5] 4 52 3 1 [0,14,3,0] 0 0 29 + 1968 R 2 0 [34, 5, 6, 0] 1 56 9 0 [2,2,5,0] 0 0 34 + 1969 O 2 0 [38, 3, 3, 5] 4 53 3 2 [7,18,18,31] 0 0 29 + 1969 R 2 0 [32, 3, 4, 4] 4 57 9 1 [7,0,1,15] 0 0 27 + 1970 O 2 0 [38, 2, 2, 6] 4 54 3 1 [0,15,15,15] 0 0 33 + 1970 R 2 0 [30, 4, 3, 4] 3 58 7 1 [5,0,1,2] 0 0 26 + 1971 O 2 0 [41, 1, 2, 6] 4 56 3 2 [18,7,7,7] 0 0 37 + 1971 R 2 0 [28, 4, 4, 4] 4 57 1 1 [0,2,1,6] 0 0 30 + 1972 O 2 0 [43, 0, 0, 1] 4 57 3 2 [31,7,18,18] 0 0 35 + 1972 R 2 0 [28, 4, 3, 4] 4 59 4 1 [1,14,2,7] 0 0 22 + 1973 O 2 0 [44, 1, 6, 2] 4 57 3 0 [0,0,0,0] 0 0 17 + 1973 R 2 0 [26, 4, 4, 4] 4 59 4 2 [10,25,2,10] 0 3 29 + 1974 O 2 0 [44, 2, 0, 6] 4 59 3 1 [15,3,3,3] 0 0 57 + 1974 R 2 0 [26, 6, 5, 4] 4 60 2 2 [27,16,12,16] 0 0 25 + 1975 O 2 0 [49, 0, 0, 1] 4 58 3 2 [7,7,18,25] 0 0 17 + 1975 R 2 0 [29, 4, 3, 3] 4 59 2 2 [16,16,14,5] 0 0 23 + 1976 O 2 0 [43, 2, 0, 1] 4 147 3 1 [15,2,10,2] 0 0 25 + 1976 R 2 0 [27, 5, 4, 4] 4 58 1 2 [19,26,10,20] 0 2 26 + 1977 O 2 0 [41, 0, 4, 3] 4 56 3 0 [1,0,3,7] 0 0 33 + 1977 R 2 0 [28, 3, 4, 4] 4 57 2 2 [26,5,5,15] 0 1 19 + 1978 O 2 0 [40, 0, 3, 5] 4 56 3 1 [2,2,15,0] 0 0 23 + 1978 R 2 0 [27, 4, 4, 4] 4 57 4 2 [24,13,4,19] 0 1 21 + 1979 O 2 0 [35, 2, 0, 1] 4 56 3 2 [25,31,0,18] 0 0 36 + 1979 R 2 0 [28, 4, 3, 4] 2 57 0 2 [2,2,24,1] 0 1 20 + 1980 O 2 0 [42, 6, 1,10] 4 219 3 0 [1,1,1,0] 0 0 44 + 1980 R 2 0 [26, 3, 4, 5] 1 55 11 2 [2,19,28,7] 0 2 30 + 1981 O 2 0 [50, 3, 0, 3] 4 143 3 0 [1,1,1,3] 0 0 17 + 1981 R 2 0 [31, 2, 9, 3] 4 149 5 2 [7,7,28,28] 0 1 33 + 1982 O 2 0 [43, 0, 7, 0] 4 155 3 1 [3,10,2,0] 0 0 18 + 1982 R 2 0 [33, 6, 1, 5] 4 153 13 2 [2,7,30,22] 0 2 31 + 1983 O 2 0 [40, 0, 0, 0] 4 142 3 1 [3,15,3,3] 0 0 41 + 1983 R 2 0 [31, 4, 2, 2] 2 144 17 2 [10,2,25,18] 0 0 21 + 1984 O 2 0 [36, 2, 1, 1] 4 106 3 2 [7,7,10,7] 0 0 24 + 1984 R 2 0 [27, 2, 3, 4] 4 145 13 0 [0,0,2,0] 0 1 27 + 1985 O 2 0 [32, 0, 7, 8] 4 105 3 1 [3,3,0,10] 0 0 31 + 1985 R 1 0 [23, 1, 4, 8] 3 - - - [-,-,-,-] - 0 27 + 1986 O 2 0 [27, 0, 3, 9] 4 35 7 0 [1,1,1,5] 0 0 28 + 1986 R 1 0 [28, 0, 0, 2] 4 - - - [-,-,-,-] - 3 27 + 1987 O 2 0 [25, 0,11, 3] 4 221 3 2 [7,7,21,0] 0 0 30 + 1987 R 1 0 [19, 4, 2, 9] 4 - - - [-,-,-,-] - 1 26 + 1988 O 2 0 [24, 1, 1, 1] 4 193 3 0 [1,1,1,1] 0 0 17 + 1988 R 1 0 [22, 0, 0, 2] 4 - - - [-,-,-,-] - 1 23 + 1989 O 2 0 [12, 3, 4, 3] 4 173 3 1 [3,15,15,3] 0 0 30 + 1989 R 0 1 [12, 4, 4, 4] 4 - - - [-,-,-,-] - 2 21 + 1990 O 2 0 [11, 5, 2, 4] 4 26 17 2 [7,18,7,7] 0 0 40 + 1990 R 0 1 [12, 4, 4, 4] 4 - - - [-,-,-,-] - 0 19 + 1991 O 2 0 [10, 4, 4, 4] 4 237 3 2 [7,7,7,7] 0 0 28 + 1991 R 0 1 [11, 3, 4, 4] 4 - - - [-,-,-,-] - 0 20 + 1992 O 2 0 [ 9, 3, 4, 4] 4 129 3 1 [10,3,2,3] 0 0 25 + 1992 R 0 1 [10, 4, 3, 4] 4 - - - [-,-,-,-] - 0 20 + 1993 O 2 0 [ 7, 4, 5, 3] 4 230 3 0 [0,1,1,0] 0 0 28 + 1993 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 1 20 + 1994 O 2 0 [ 6, 5, 3, 4] 4 174 3 2 [7,31,7,7] 0 0 34 + 1994 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 0 21 + 1995 O 2 0 [ 5, 4, 5, 5] 4 234 3 1 [15,3,7,10] 0 0 30 + 1995 R 0 1 [ 8, 4, 4, 4] 4 - - - [-,-,-,-] - 3 16 + 1996 O 2 0 [30, 0, 8, 8] 4 24 1 2 [24,7,31,28] 0 0 31 + 1996 R 1 0 [18,11, 3, 8] 4 - - - [-,-,-,-] - 0 21 + 1997 O 2 0 [38, 3, 6, 2] 4 47 0 2 [3,18,25,25] 0 0 30 + 1997 R 2 0 [31, 5, 4, 6] 4 48 1 2 [7,15,10,29] 0 1 38 + 1998 O 2 0 [40, 3, 3, 5] 4 49 3 1 [15,13,2,2] 0 0 32 + 1998 R 2 0 [34, 4, 4, 4] 4 50 3 2 [23,1,29,3] 0 1 34 + 1999 O 2 0 [44, 2, 3, 2] 4 50 3 2 [31,25,25,31] 0 0 25 + 1999 R 2 0 [34, 4, 4, 4] 4 51 3 2 [3,1,6,3] 0 0 20 + +=== second 51 (frames 2550–2599) === +frame side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes + 2550 O 2 0 [44, 2, 6, 4] 4 39 1 1 [0,3,3,0] 0 0 42 + 2550 R 2 0 [29, 4, 5, 6] 4 39 8 2 [0,0,0,29] 0 1 33 + 2551 O 2 0 [63, 4, 4, 4] 4 41 1 1 [0,3,3,3] 0 0 14 + 2551 R 2 0 [32, 4, 4, 5] 1 42 3 2 [16,22,4,8] 0 1 31 + 2552 O 2 0 [63, 4, 4, 4] 4 42 11 0 [1,1,1,1] 0 0 14 + 2552 R 2 0 [34, 4, 4, 4] 1 43 0 2 [13,16,3,4] 0 3 29 + 2553 O 2 0 [16, 0, 0, 0] 4 43 1 0 [1,0,2,2] 0 0 60 + 2553 R 2 0 [34, 4, 4, 4] 3 44 3 2 [3,13,16,6] 0 0 33 + 2554 O 2 0 [47, 0, 2, 6] 4 43 2 1 [14,5,0,1] 0 0 24 + 2554 R 2 0 [34, 4, 4, 4] 4 44 0 2 [4,9,13,0] 0 3 33 + 2555 O 2 0 [47, 0, 1, 5] 4 42 1 2 [25,31,25,18] 0 0 25 + 2555 R 2 0 [33, 4, 4, 4] 1 44 0 2 [12,9,16,1] 0 1 27 + 2556 O 2 0 [43, 0, 5, 2] 4 41 2 2 [31,18,31,31] 0 0 28 + 2556 R 2 0 [33, 4, 3, 4] 4 44 0 2 [20,13,22,2] 0 0 25 + 2557 O 2 0 [39, 1, 6, 4] 4 41 17 2 [10,25,31,7] 0 0 30 + 2557 R 2 0 [31, 4, 4, 4] 4 44 3 2 [3,2,2,2] 0 1 22 + 2558 O 2 0 [39, 2, 5, 4] 4 40 2 2 [18,18,31,31] 0 0 33 + 2558 R 2 0 [31, 4, 4, 4] 4 43 5 2 [5,4,3,1] 0 3 29 + 2559 O 2 0 [43, 3, 1, 2] 4 39 1 1 [15,15,2,15] 0 0 26 + 2559 R 2 0 [31, 3, 4, 4] 4 42 5 2 [10,3,3,8] 0 0 26 + 2560 O 2 0 [41, 4, 0, 3] 4 39 1 2 [31,25,25,25] 0 0 21 + 2560 R 2 0 [30, 4, 4, 4] 4 42 0 2 [3,6,14,14] 0 0 23 + 2561 O 2 0 [37, 3, 2, 5] 4 38 1 2 [7,18,31,31] 0 0 33 + 2561 R 2 0 [29, 4, 4, 4] 4 42 0 2 [4,22,1,2] 0 3 32 + 2562 O 2 0 [38, 4, 4, 4] 4 37 1 2 [18,18,31,30] 0 0 31 + 2562 R 2 0 [29, 3, 4, 4] 4 42 0 2 [1,1,5,2] 0 1 18 + 2563 O 2 0 [39, 3, 3, 5] 4 37 1 1 [10,10,15,10] 0 0 30 + 2563 R 2 0 [28, 4, 4, 4] 4 42 0 2 [1,17,16,17] 0 0 27 + 2564 O 2 0 [36, 3, 4, 4] 4 37 1 1 [15,3,15,15] 0 0 34 + 2564 R 2 0 [28, 4, 4, 4] 4 42 0 2 [1,13,17,5] 0 0 24 + 2565 O 2 0 [39, 2, 4, 5] 4 37 1 2 [7,18,18,18] 0 0 27 + 2565 R 2 0 [28, 4, 4, 4] 2 42 0 2 [16,0,8,15] 0 1 21 + 2566 O 2 0 [37, 2, 3, 3] 4 38 1 2 [30,27,30,31] 0 0 38 + 2566 R 2 0 [28, 4, 4, 4] 1 43 3 2 [6,2,1,20] 0 3 25 + 2567 O 2 0 [34, 3, 3, 1] 4 39 1 1 [3,3,9,15] 0 0 30 + 2567 R 2 0 [28, 2, 4, 4] 4 43 1 0 [4,4,3,7] 0 1 37 + 2568 O 2 0 [32, 2, 6, 7] 4 40 17 0 [3,5,0,5] 0 0 27 + 2568 R 2 0 [25, 4, 6, 6] 2 48 3 1 [0,1,12,3] 0 2 34 + 2569 O 2 0 [27, 0, 3, 1] 4 38 2 2 [7,7,7,7] 0 0 29 + 2569 R 1 0 [29, 0, 1, 4] 4 - - - [-,-,-,-] - 1 24 + 2570 O 2 0 [17, 2, 3, 2] 4 40 17 2 [7,7,7,7] 0 0 29 + 2570 R 1 0 [19, 2, 2, 2] 4 - - - [-,-,-,-] - 2 19 + 2571 O 2 0 [25,20, 0, 7] 4 145 3 2 [7,25,11,26] 0 0 31 + 2571 R 1 0 [12,21,12, 5] 0 - - - [-,-,-,-] - 3 34 + 2572 O 2 0 [45, 6, 3, 4] 4 241 3 2 [31,19,27,30] 0 0 26 + 2572 R 1 0 [40, 7, 6, 4] 4 - - - [-,-,-,-] - 1 27 + 2573 O 1 1 [45, 3, 3, 3] 4 - - - [-,-,-,-] - 0 26 + 2573 R 1 1 [45, 4, 4, 3] 4 - - - [-,-,-,-] - 3 31 + 2574 O 2 0 [42, 0, 1, 6] 4 28 4 0 [1,1,1,7] 0 0 37 + 2574 R 1 0 [43, 3, 1, 4] 4 - - - [-,-,-,-] - 3 27 + 2575 O 2 0 [38, 3, 0, 3] 4 41 17 1 [12,1,10,15] 0 0 29 + 2575 R 1 0 [37, 3, 2, 1] 4 - - - [-,-,-,-] - 2 28 + 2576 O 2 0 [28, 3, 3, 2] 4 47 0 1 [0,0,12,12] 0 0 30 + 2576 R 1 1 [28, 3, 2, 3] 4 - - - [-,-,-,-] - 0 35 + 2577 O 2 0 [24, 4, 1, 3] 4 45 1 2 [18,19,27,7] 0 0 30 + 2577 R 1 1 [23, 4, 3, 3] 4 - - - [-,-,-,-] - 0 27 + 2578 O 2 0 [17, 2, 4, 4] 4 226 3 1 [3,3,3,12] 0 0 28 + 2578 R 1 1 [19, 3, 3, 3] 2 - - - [-,-,-,-] - 0 26 + 2579 O 2 0 [15, 2, 2, 5] 4 195 3 2 [7,7,7,7] 0 0 31 + 2579 R 0 1 [16, 4, 3, 2] 4 - - - [-,-,-,-] - 0 19 + 2580 O 2 0 [38, 6, 0, 7] 4 23 12 2 [31,7,7,25] 0 0 32 + 2580 R 1 0 [26,11, 7, 3] 4 - - - [-,-,-,-] - 0 30 + 2581 O 2 0 [44, 4, 4, 5] 4 39 13 2 [27,25,7,7] 0 0 30 + 2581 R 2 0 [35, 6, 4, 4] 4 44 10 1 [3,1,2,2] 0 0 38 + 2582 O 2 0 [45, 4, 9, 0] 4 46 12 0 [7,3,7,2] 0 0 28 + 2582 R 2 0 [38, 5, 5, 9] 2 47 1 2 [18,10,22,10] 0 1 35 + 2583 O 2 0 [46, 1, 4, 3] 4 48 3 2 [25,2,0,19] 0 0 33 + 2583 R 2 0 [45, 0, 4, 3] 2 48 3 2 [0,15,1,3] 0 3 22 + 2584 O 2 0 [43, 1, 4, 6] 4 48 3 2 [25,4,0,28] 0 0 29 + 2584 R 2 0 [40, 3, 4, 4] 4 48 0 2 [3,3,15,0] 0 3 20 + 2585 O 2 0 [44, 2, 5, 3] 4 47 0 2 [25,18,4,3] 0 0 28 + 2585 R 2 0 [39, 4, 4, 4] 4 48 0 1 [1,1,1,1] 0 3 24 + 2586 O 2 0 [46, 0, 4, 4] 4 46 1 0 [3,4,2,7] 0 0 31 + 2586 R 2 0 [39, 3, 4, 3] 1 47 5 2 [10,10,10,19] 0 2 28 + 2587 O 2 0 [43, 0, 0, 3] 4 48 3 1 [9,3,10,0] 0 0 33 + 2587 R 2 0 [36, 2, 0, 2] 4 47 8 0 [3,0,0,3] 0 0 37 + 2588 O 2 0 [33, 4, 0, 3] 4 47 4 2 [25,18,7,18] 0 0 30 + 2588 R 2 0 [26, 3, 7, 3] 1 48 9 1 [10,0,14,0] 0 0 39 + 2589 O 2 0 [37, 1, 0, 2] 4 47 12 0 [3,0,1,2] 0 0 30 + 2589 R 2 0 [26, 9, 3, 0] 4 48 8 0 [3,0,0,0] 0 0 32 + 2590 O 2 0 [32, 5, 0, 7] 4 40 11 0 [4,1,1,1] 0 0 28 + 2590 R 2 1 [24, 8, 8, 0] 1 52 22 1 [0,3,0,3] 0 1 27 + 2591 O 2 0 [29, 7,11, 0] 4 226 3 1 [3,12,3,2] 0 0 30 + 2591 R 1 0 [30, 4, 7, 9] 4 - - - [-,-,-,-] - 0 30 + 2592 O 2 0 [39, 8, 2, 5] 4 51 7 1 [13,3,2,15] 0 0 35 + 2592 R 1 0 [37, 2, 5, 4] 2 - - - [-,-,-,-] - 2 33 + 2593 O 2 0 [44, 2, 3, 6] 4 52 3 0 [7,3,7,7] 0 0 30 + 2593 R 2 0 [35, 4, 4, 4] 4 54 3 2 [0,1,0,14] 0 3 22 + 2594 O 2 0 [45, 6, 0, 0] 4 57 3 2 [10,29,15,18] 0 0 27 + 2594 R 2 0 [35, 6, 6, 3] 4 56 1 2 [2,2,28,3] 0 0 24 + 2595 O 2 0 [43, 0, 3, 1] 4 147 3 2 [7,7,7,7] 0 0 43 + 2595 R 2 0 [35, 1, 3, 2] 3 57 0 1 [0,12,15,14] 0 3 32 + 2596 O 2 0 [50, 0, 0, 0] 4 229 3 0 [1,1,1,1] 0 0 31 + 2596 R 2 0 [29,12, 4, 0] 1 137 18 1 [3,1,0,3] 0 0 34 + 2597 O 2 0 [63, 4, 4, 4] 4 200 3 0 [1,1,1,1] 0 0 15 + 2597 R 1 0 [29, 3, 1, 4] 4 - - - [-,-,-,-] - 2 24 + 2598 O 2 0 [52, 0, 0, 0] 4 210 3 0 [1,1,1,1] 0 0 35 + 2598 R 2 0 [27, 1, 9, 5] 4 206 24 2 [3,10,19,29] 0 1 35 + 2599 O 2 0 [54, 0, 0, 0] 4 146 3 0 [1,1,1,1] 0 0 16 + 2599 R 2 0 [26, 4, 4, 2] 4 183 5 1 [3,7,7,0] 0 2 30 + +=== second 5 (frames 250–299) === +frame side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes + 250 O 2 0 [35, 3, 2, 5] 4 57 3 0 [4,7,3,3] 0 0 23 + 250 R 2 0 [26, 4, 4, 3] 4 60 5 2 [5,13,7,20] 0 2 32 + 251 O 2 0 [29, 6, 4, 3] 4 58 3 0 [3,3,7,0] 0 0 32 + 251 R 2 0 [25, 4, 3, 3] 0 62 2 2 [18,5,26,24] 0 3 24 + 252 O 2 0 [30, 4, 3, 3] 4 58 3 0 [3,2,7,0] 0 0 26 + 252 R 2 0 [23, 4, 4, 4] 2 62 1 1 [1,13,0,0] 0 2 27 + 253 O 2 0 [28, 2, 3, 5] 4 59 3 1 [3,9,3,12] 0 0 36 + 253 R 2 0 [22, 4, 4, 4] 4 64 0 2 [18,23,18,18] 0 2 31 + 254 O 2 0 [26, 3, 6, 5] 4 60 3 0 [7,7,4,7] 0 0 31 + 254 R 2 0 [22, 3, 4, 4] 1 66 5 2 [10,10,18,19] 0 3 27 + 255 O 2 0 [29, 2, 2, 5] 4 58 3 0 [0,7,3,2] 0 0 29 + 255 R 2 0 [21, 4, 4, 4] 4 62 20 0 [7,0,7,3] 0 1 35 + 256 O 2 0 [30, 1, 7, 1] 4 137 3 2 [7,7,7,7] 0 0 33 + 256 R 2 0 [21, 5, 3, 5] 4 64 22 0 [0,0,0,0] 0 3 39 + 257 O 2 0 [30, 1, 7, 2] 4 136 3 1 [3,3,12,15] 0 0 28 + 257 R 2 0 [22, 4, 4, 4] 4 143 1 1 [10,2,0,11] 0 0 19 + 258 O 2 0 [28, 7, 0, 5] 4 138 3 1 [0,9,12,3] 0 0 29 + 258 R 2 0 [22, 4, 5, 4] 1 144 7 1 [7,0,7,10] 0 0 27 + 259 O 2 0 [28, 9, 0, 1] 4 210 3 1 [3,15,3,3] 0 0 31 + 259 R 2 0 [23, 5, 7, 2] 4 133 14 2 [7,7,28,7] 0 0 33 + 260 O 2 0 [28, 2, 7, 1] 4 120 3 0 [7,1,0,2] 0 0 30 + 260 R 1 0 [22, 5, 4, 5] 4 - - - [-,-,-,-] - 1 27 + 261 O 2 0 [28, 2, 4,10] 4 114 3 0 [1,0,5,7] 0 0 29 + 261 R 1 0 [24, 2, 4, 5] 4 - - - [-,-,-,-] - 1 22 + 262 O 2 0 [27, 0, 3, 3] 4 14 2 2 [7,7,19,7] 0 0 29 + 262 R 1 0 [28, 1, 0, 4] 4 - - - [-,-,-,-] - 1 23 + 263 O 2 0 [22, 3, 4, 4] 4 32 8 2 [7,7,7,10] 0 0 29 + 263 R 1 1 [19, 3, 4, 4] 4 - - - [-,-,-,-] - 2 31 + 264 O 2 0 [26, 1, 3, 5] 4 199 3 1 [10,12,3,3] 0 0 28 + 264 R 1 0 [18, 6, 4, 3] 4 - - - [-,-,-,-] - 1 29 + 265 O 2 0 [21, 0, 1, 4] 4 234 3 1 [3,3,3,3] 0 0 31 + 265 R 0 1 [19, 2, 2, 2] 4 - - - [-,-,-,-] - 0 25 + 266 O 0 0 [10, 2, 6, 2] 4 - - - [-,-,-,-] - 0 26 + 266 R 0 1 [12, 3, 3, 4] 4 - - - [-,-,-,-] - 1 20 + 267 O 2 0 [ 8, 5, 2, 4] 4 217 3 2 [7,7,7,7] 0 0 32 + 267 R 0 1 [10, 4, 3, 4] 4 - - - [-,-,-,-] - 1 20 + 268 O 2 0 [ 8, 4, 4, 3] 4 215 3 0 [4,0,1,0] 0 0 29 + 268 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 3 21 + 269 O 2 0 [ 8, 3, 4, 5] 4 197 3 2 [7,7,27,7] 0 0 34 + 269 R 0 1 [ 9, 4, 4, 4] 0 - - - [-,-,-,-] - 1 18 + 270 O 2 0 [ 9, 5, 2, 6] 4 107 3 2 [7,24,3,18] 0 0 28 + 270 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 2 19 + 271 O 0 0 [10, 2, 4, 5] 4 - - - [-,-,-,-] - 0 32 + 271 R 0 1 [ 9, 5, 4, 4] 4 - - - [-,-,-,-] - 1 23 + 272 O 2 0 [12, 3, 4, 6] 4 195 3 0 [1,0,0,1] 0 0 27 + 272 R 0 1 [10, 4, 4, 5] 4 - - - [-,-,-,-] - 0 24 + 273 O 2 0 [12, 4, 4, 4] 4 224 3 2 [0,7,31,7] 0 0 32 + 273 R 0 1 [12, 4, 4, 4] 4 - - - [-,-,-,-] - 0 20 + 274 O 2 0 [14, 3, 4, 5] 4 82 3 2 [7,7,7,25] 0 0 25 + 274 R 0 1 [12, 4, 4, 4] 4 - - - [-,-,-,-] - 0 22 + 275 O 2 0 [12, 4, 3, 3] 4 84 3 1 [9,10,12,15] 0 0 34 + 275 R 0 1 [12, 4, 4, 4] 4 - - - [-,-,-,-] - 0 22 + 276 O 2 0 [11, 5, 2, 4] 4 225 3 1 [3,3,3,12] 0 0 30 + 276 R 0 1 [12, 4, 4, 3] 4 - - - [-,-,-,-] - 0 20 + 277 O 2 0 [10, 5, 4, 3] 4 240 3 2 [7,2,7,7] 0 0 32 + 277 R 0 1 [11, 4, 4, 4] 4 - - - [-,-,-,-] - 0 22 + 278 O 2 0 [12, 3, 4, 5] 4 80 3 0 [3,0,0,1] 0 0 25 + 278 R 0 1 [11, 4, 4, 4] 4 - - - [-,-,-,-] - 3 21 + 279 O 2 0 [10, 4, 5, 2] 4 253 3 0 [0,1,1,1] 0 0 30 + 279 R 0 1 [11, 4, 4, 4] 4 - - - [-,-,-,-] - 2 19 + 280 O 2 0 [10, 5, 3, 4] 4 152 3 0 [1,3,0,1] 0 0 30 + 280 R 0 1 [11, 4, 4, 4] 4 - - - [-,-,-,-] - 0 15 + 281 O 2 0 [11, 3, 4, 4] 4 172 3 0 [1,1,1,0] 0 0 35 + 281 R 0 1 [11, 4, 4, 4] 4 - - - [-,-,-,-] - 0 23 + 282 O 2 0 [ 9, 4, 4, 2] 4 247 3 2 [7,7,7,30] 0 0 29 + 282 R 0 1 [11, 3, 4, 4] 4 - - - [-,-,-,-] - 3 22 + 283 O 2 0 [ 7, 3, 5, 3] 4 247 3 0 [1,1,1,0] 0 0 27 + 283 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 0 16 + 284 O 2 0 [ 6, 3, 4, 4] 4 155 3 0 [7,1,1,1] 0 0 32 + 284 R 0 1 [ 8, 4, 4, 4] 4 - - - [-,-,-,-] - 3 20 + 285 O 2 0 [ 8, 4, 4, 4] 4 188 3 0 [1,1,3,0] 0 0 26 + 285 R 0 1 [ 8, 4, 4, 4] 1 - - - [-,-,-,-] - 0 21 + 286 O 2 0 [ 7, 4, 4, 3] 4 236 3 2 [7,7,7,7] 0 0 34 + 286 R 0 1 [ 8, 4, 4, 4] 4 - - - [-,-,-,-] - 3 17 + 287 O 2 0 [ 8, 4, 4, 5] 4 84 3 0 [1,0,3,0] 0 0 25 + 287 R 0 1 [ 8, 4, 4, 4] 4 - - - [-,-,-,-] - 2 21 + 288 O 2 0 [ 6, 4, 4, 4] 4 54 3 2 [7,7,7,25] 0 0 33 + 288 R 0 1 [ 8, 4, 4, 4] 4 - - - [-,-,-,-] - 0 24 + 289 O 2 0 [ 7, 4, 6, 2] 4 246 3 0 [7,2,1,1] 0 0 30 + 289 R 0 1 [ 8, 4, 4, 5] 4 - - - [-,-,-,-] - 1 24 + 290 O 2 0 [ 8, 3, 5, 3] 4 194 3 2 [7,7,30,20] 0 0 27 + 290 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 0 15 + 291 O 2 0 [ 5, 5, 4, 5] 4 171 3 2 [18,7,7,20] 0 0 36 + 291 R 0 1 [ 8, 4, 4, 4] 4 - - - [-,-,-,-] - 1 19 + 292 O 2 0 [ 7, 3, 6, 4] 4 101 3 1 [3,10,3,3] 0 0 31 + 292 R 0 1 [ 8, 4, 4, 5] 2 - - - [-,-,-,-] - 2 21 + 293 O 2 0 [ 9, 3, 4, 5] 4 0 11 0 [1,1,1,1] 0 0 24 + 293 R 0 1 [ 9, 4, 4, 4] 0 - - - [-,-,-,-] - 2 16 + 294 O 2 0 [ 7, 5, 3, 4] 4 252 3 1 [3,10,3,15] 0 0 28 + 294 R 0 1 [ 9, 4, 4, 4] 4 - - - [-,-,-,-] - 0 17 + 295 O 2 0 [ 6, 4, 4, 3] 4 0 4 0 [3,0,1,0] 0 0 31 + 295 R 0 1 [ 9, 3, 4, 4] 2 - - - [-,-,-,-] - 0 18 + 296 O 2 0 [10, 9,16, 0] 4 216 3 0 [0,1,7,2] 0 0 33 + 296 R 1 0 [ 8, 4,14,12] 1 - - - [-,-,-,-] - 3 21 + 297 O 1 0 [29, 0, 6, 3] 4 - - - [-,-,-,-] - 0 34 + 297 R 1 0 [26, 7, 4, 3] 0 - - - [-,-,-,-] - 0 22 + 298 O 2 0 [32, 4, 5, 5] 4 44 1 2 [1,18,7,7] 0 0 30 + 298 R 1 0 [28, 5, 4, 5] 4 - - - [-,-,-,-] - 2 28 + 299 O 2 0 [34, 0, 2, 5] 4 51 3 1 [10,3,0,0] 0 0 30 + 299 R 2 0 [29, 4, 2, 3] 4 54 13 0 [3,2,0,2] 0 0 34 + +=== second 1 (frames 50–99) === +frame side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes + 50 O 0 0 [17, 3, 3, 3] 4 - - - [-,-,-,-] - 0 27 + 50 R 0 0 [16, 4, 4, 4] 4 - - - [-,-,-,-] - 2 22 + 51 O 0 0 [15, 4, 3, 4] 4 - - - [-,-,-,-] - 0 31 + 51 R 0 1 [16, 4, 4, 3] 4 - - - [-,-,-,-] - 0 22 + 52 O 2 0 [15, 2, 6, 3] 4 224 3 1 [3,3,3,13] 0 0 32 + 52 R 0 1 [15, 4, 3, 4] 4 - - - [-,-,-,-] - 0 27 + 53 O 2 0 [16, 4, 5, 5] 4 3 2 2 [7,18,18,25] 0 0 27 + 53 R 0 1 [14, 4, 4, 6] 1 - - - [-,-,-,-] - 0 26 + 54 O 2 0 [21, 4, 2, 5] 4 4 8 0 [7,0,1,1] 0 0 38 + 54 R 1 0 [17, 6, 4, 3] 4 - - - [-,-,-,-] - 0 27 + 55 O 2 0 [19, 2, 5, 1] 4 190 3 0 [1,7,1,1] 0 0 23 + 55 R 0 1 [18, 3, 4, 3] 4 - - - [-,-,-,-] - 3 25 + 56 O 2 0 [14, 6, 5, 6] 4 7 10 2 [27,7,7,30] 0 0 33 + 56 R 0 1 [14, 4, 5, 5] 4 - - - [-,-,-,-] - 1 27 + 57 O 2 0 [23, 5, 3, 9] 4 19 12 2 [10,19,10,8] 0 0 24 + 57 R 1 1 [18, 6, 4, 4] 4 - - - [-,-,-,-] - 0 31 + 58 O 2 0 [33, 0, 7, 3] 4 244 3 0 [7,1,4,4] 0 0 37 + 58 R 1 0 [27, 7, 1, 7] 4 - - - [-,-,-,-] - 2 25 + 59 O 2 0 [36, 6, 3, 2] 4 29 2 2 [8,31,18,31] 0 0 29 + 59 R 2 0 [30, 6, 5, 4] 4 31 1 2 [3,29,24,5] 0 2 29 + 60 O 2 0 [38, 2, 7, 4] 4 28 2 2 [18,31,31,31] 0 0 32 + 60 R 2 0 [32, 4, 5, 5] 4 31 5 2 [1,22,16,11] 0 2 28 + 61 O 2 0 [45, 0, 0, 7] 4 29 1 2 [31,31,25,18] 0 0 28 + 61 R 2 0 [35, 4, 4, 3] 2 31 6 2 [8,29,19,4] 0 0 21 + 62 O 2 0 [39, 0, 2, 0] 4 32 22 0 [2,0,3,1] 0 0 26 + 62 R 2 0 [34, 3, 2, 3] 4 37 19 1 [1,12,10,3] 0 2 31 + 63 O 2 0 [30, 5, 2, 0] 4 227 3 2 [7,7,7,7] 0 0 33 + 63 R 2 0 [28, 4, 4, 4] 2 91 15 1 [3,9,11,6] 0 1 31 + 64 O 2 0 [29, 2,16, 0] 4 255 3 0 [1,1,1,1] 0 0 32 + 64 R 1 0 [25, 5, 9,12] 4 - - - [-,-,-,-] - 3 32 + 65 O 2 0 [34, 0, 0,18] 4 224 3 1 [3,3,3,4] 0 0 28 + 65 R 1 0 [35, 0, 0, 6] 4 - - - [-,-,-,-] - 1 19 + 66 O 2 0 [37,10, 4, 7] 4 240 3 1 [14,10,3,4] 0 0 32 + 66 R 1 0 [34, 4, 7, 6] 4 - - - [-,-,-,-] - 2 29 + 67 O 2 0 [47, 0, 0, 5] 4 28 2 2 [7,7,7,0] 0 0 27 + 67 R 2 0 [40, 3, 2, 2] 4 32 1 2 [23,3,0,0] 0 3 33 + 68 O 2 0 [42, 2, 5, 5] 4 30 2 1 [15,2,10,15] 0 0 35 + 68 R 2 0 [35, 4, 4, 5] 4 33 4 2 [16,3,10,2] 0 3 34 + 69 O 2 0 [44, 4, 4, 5] 4 28 2 1 [10,10,10,0] 0 0 27 + 69 R 2 0 [36, 5, 4, 5] 4 32 2 2 [18,10,22,12] 0 3 36 + 70 O 2 0 [46, 3, 4, 6] 4 26 1 2 [0,23,31,7] 0 0 29 + 70 R 2 0 [39, 5, 4, 3] 4 31 9 2 [2,0,2,0] 0 1 30 + 71 O 2 0 [50, 0, 1, 6] 4 30 1 2 [0,6,21,0] 0 0 26 + 71 R 2 0 [39, 4, 4, 4] 1 31 3 2 [14,2,2,1] 0 1 31 + 72 O 2 0 [47, 2, 2, 5] 4 31 8 0 [3,3,3,4] 0 0 39 + 72 R 2 0 [40, 4, 4, 4] 4 32 6 2 [15,22,0,22] 0 2 24 + 73 O 2 0 [48, 2, 4, 5] 4 35 8 1 [4,1,14,7] 0 0 22 + 73 R 2 0 [40, 5, 4, 4] 1 35 8 1 [1,1,1,7] 0 0 24 + 74 O 2 0 [48, 6, 0, 5] 4 39 1 1 [7,2,5,4] 0 0 30 + 74 R 2 0 [41, 5, 7, 5] 1 38 8 2 [24,28,13,16] 0 2 27 + 75 O 2 0 [47, 0, 0, 5] 4 42 8 2 [1,5,14,0] 0 0 35 + 75 R 2 0 [46, 3, 3, 2] 4 41 1 2 [5,5,5,25] 0 0 25 + 76 O 2 0 [44, 4, 3, 6] 4 48 3 1 [5,1,15,15] 0 0 26 + 76 R 2 0 [41, 3, 4, 3] 4 47 15 2 [0,3,15,20] 0 2 33 + 77 O 2 0 [47, 1, 4, 4] 4 50 3 0 [1,3,4,2] 0 0 31 + 77 R 2 0 [39, 4, 4, 4] 3 51 0 2 [1,24,3,4] 0 0 32 + 78 O 2 0 [47, 1, 4, 4] 4 45 2 1 [15,15,2,5] 1 0 29 + 78 R 2 0 [39, 5, 4, 4] 1 48 16 2 [2,16,1,4] 0 1 29 + 79 O 2 0 [50, 3, 3, 2] 4 43 1 2 [4,25,30,11] 0 0 21 + 79 R 2 0 [41, 6, 4, 4] 4 44 9 2 [29,26,16,13] 0 1 28 + 80 O 2 0 [49, 0, 0, 0] 4 43 1 2 [25,24,10,0] 0 0 35 + 80 R 2 0 [43, 3, 2, 3] 4 44 7 2 [11,12,1,0] 0 2 23 + 81 O 2 0 [39, 5, 5, 3] 4 45 1 2 [26,29,26,27] 0 0 32 + 81 R 2 0 [39, 4, 7, 4] 4 44 1 2 [3,6,16,28] 0 2 24 + 82 O 2 0 [43, 1, 4, 2] 4 45 5 1 [14,6,4,4] 0 0 32 + 82 R 2 0 [42, 2, 3, 4] 4 45 1 2 [14,1,2,2] 0 0 25 + 83 O 2 0 [42, 1, 3, 8] 4 45 1 2 [3,15,26,27] 0 0 33 + 83 R 2 0 [38, 4, 4, 4] 4 45 2 2 [12,17,15,8] 0 1 18 + 84 O 2 0 [43, 0, 2, 1] 4 44 8 2 [19,14,18,10] 0 0 32 + 84 R 2 0 [40, 4, 2, 2] 2 44 5 1 [11,13,2,2] 0 0 30 + 85 O 2 0 [40, 2, 2, 1] 4 245 3 2 [7,7,7,7] 0 0 26 + 85 R 2 0 [36, 6, 4, 1] 2 47 7 0 [7,4,0,0] 0 1 32 + 86 O 2 0 [29, 3, 3, 5] 4 115 3 0 [1,1,0,4] 0 0 25 + 86 R 1 1 [33, 1, 3, 3] 4 - - - [-,-,-,-] - 2 32 + 87 O 0 0 [27, 3, 6, 6] 4 - - - [-,-,-,-] - 0 40 + 87 R 1 1 [28, 5, 5, 5] 0 - - - [-,-,-,-] - 3 34 + 88 O 1 1 [36, 6, 7, 3] 4 - - - [-,-,-,-] - 0 23 + 88 R 1 0 [34, 5, 7, 6] 2 - - - [-,-,-,-] - 0 26 + 89 O 2 0 [30, 1, 0, 0] 4 127 3 0 [1,1,1,7] 0 0 27 + 89 R 1 0 [41, 0, 0, 0] 4 - - - [-,-,-,-] - 0 20 + 90 O 2 0 [17, 2, 5, 1] 4 246 3 1 [3,3,3,3] 0 0 34 + 90 R 0 0 [25, 0, 2, 3] 1 - - - [-,-,-,-] - 1 14 + 91 O 2 0 [17,21, 6, 3] 4 128 3 1 [15,3,3,6] 1 0 32 + 91 R 1 0 [16, 8,17, 7] 1 - - - [-,-,-,-] - 1 28 + 92 O 2 0 [36, 6, 2, 5] 4 231 3 1 [14,3,3,3] 0 0 24 + 92 R 1 0 [36, 4, 4, 4] 1 - - - [-,-,-,-] - 0 25 + 93 O 1 1 [39, 4, 3, 2] 4 - - - [-,-,-,-] - 0 32 + 93 R 1 1 [36, 5, 5, 4] 3 - - - [-,-,-,-] - 2 36 + 94 O 2 0 [40, 3, 5, 3] 4 26 2 1 [12,3,9,10] 0 0 33 + 94 R 1 1 [37, 4, 4, 4] 4 - - - [-,-,-,-] - 0 35 + 95 O 2 0 [41, 4, 7, 1] 4 30 2 2 [27,25,31,0] 0 0 31 + 95 R 2 0 [38, 4, 4, 5] 4 32 1 1 [3,0,8,1] 0 1 36 + 96 O 2 0 [44, 6, 0, 2] 4 26 11 2 [8,1,26,17] 0 0 38 + 96 R 2 0 [39, 4, 6, 4] 4 28 14 2 [19,16,17,4] 0 1 29 + 97 O 2 0 [45, 0, 7, 0] 4 23 9 2 [8,14,1,1] 0 0 28 + 97 R 2 0 [41, 4, 4, 3] 4 24 9 2 [6,8,21,1] 0 0 23 + 98 O 2 0 [46, 1, 2, 1] 4 18 2 2 [31,7,31,18] 0 0 24 + 98 R 2 0 [39, 3, 2, 2] 2 21 9 2 [14,14,18,3] 0 2 31 + 99 O 2 0 [41, 2, 4, 4] 4 14 2 1 [3,3,3,15] 0 0 34 + 99 R 2 0 [33, 3, 3, 4] 4 19 9 1 [11,6,14,5] 0 1 30 + +=== divergence summary (all frames) === +frames compared: 6000 +signal_type mismatch: 2778 (46.3%) +quant_offset mismatch: 1920 (32.0%) +avg |gain diff| per subframe: 2.67 +nlsf_interp mismatch: 1606 (26.8%) +voiced_both: 2913 + LTP per_index mismatch: 1777 (61.0%) + avg |ltp_index diff| per subframe: 9.66 + avg |lag diff|: 11.56 +total bytes: ours=180009 ref=164253 ratio=1.096 diff --git a/lanes/opus-silkq-r1.seconds.txt b/lanes/opus-silkq-r1.seconds.txt new file mode 100644 index 00000000..fca4e024 --- /dev/null +++ b/lanes/opus-silkq-r1.seconds.txt @@ -0,0 +1,655 @@ +# reelm@12k SILK per-second diagnostic (r1) +# mono, 120s cap, 20ms frames, VBR constrained, 48kHz, Application::Voip +# total frames: ours=6000 ref=6001 +# avg corr: ours=0.8197 ref=0.8010 gap=-0.0186 ref_kbps=12.0 ours_kbps=12.4 + +# sec corr_o corr_r gap gain_idx_mean voiced_n nlsf_interp avg_B_o avg_B_r ltp_gain_mean pitch_l_mean +0 0.8247 0.8502 +0.0255 23.3 38 4 30.0 26.0 0.469 179.4 +1 0.9198 0.9268 +0.0070 36.3 45 4 30.1 28.8 0.753 113.8 +2 0.8531 0.9519 +0.0988 33.5 50 4 29.9 29.1 0.785 120.0 +3 0.5669 0.9353 +0.3684 38.3 50 4 30.6 31.2 0.850 97.2 +4 0.8177 0.9165 +0.0988 25.0 49 4 29.2 24.9 0.723 172.3 +5 0.9809 0.8886 -0.0923 16.3 47 4 30.0 24.1 0.567 172.2 +6 0.7734 0.6995 -0.0738 32.8 40 4 30.0 29.1 0.570 121.8 +7 0.9481 0.9396 -0.0085 20.5 49 4 29.9 24.3 0.725 173.5 +8 0.8356 0.6833 -0.1523 38.0 46 4 30.2 29.1 0.774 95.3 +9 0.7899 0.8454 +0.0556 36.8 49 4 29.8 24.9 0.748 150.7 +10 0.8553 0.8014 -0.0539 31.1 35 4 29.9 28.5 0.519 153.2 +11 0.9439 0.9069 -0.0370 37.4 45 4 29.9 30.2 0.774 67.2 +12 0.9410 0.9599 +0.0188 34.5 48 4 30.0 27.5 0.761 94.3 +13 0.9281 0.9249 -0.0032 27.4 47 4 30.0 25.7 0.616 153.4 +14 0.9621 0.9618 -0.0003 18.4 48 4 29.9 24.1 0.647 171.2 +15 0.7875 0.7502 -0.0373 38.4 39 4 30.0 30.1 0.637 100.2 +16 0.5570 0.2079 -0.3491 28.7 45 4 30.0 28.2 0.632 138.9 +17 0.5736 0.2644 -0.3092 32.7 48 4 29.8 30.2 0.686 132.6 +18 0.7159 0.3400 -0.3759 27.8 44 4 30.0 26.5 0.573 161.5 +19 0.8888 0.7884 -0.1004 33.3 43 4 29.9 28.5 0.607 171.0 +20 0.7558 0.3615 -0.3942 21.4 47 4 30.1 25.0 0.580 200.4 +21 0.4141 0.9460 +0.5319 28.5 44 4 29.8 25.0 0.608 143.2 +22 0.9322 0.9264 -0.0057 36.2 48 4 30.1 29.7 0.774 117.4 +23 0.8556 0.8269 -0.0286 34.6 45 4 29.8 29.5 0.748 147.3 +24 0.9114 0.9419 +0.0305 31.2 48 4 30.1 29.3 0.736 144.4 +25 0.8961 0.8377 -0.0584 34.3 46 4 29.8 28.7 0.663 133.7 +26 0.6878 0.8346 +0.1468 34.4 46 4 29.9 28.6 0.683 126.1 +27 0.8907 0.9581 +0.0674 26.3 47 4 30.1 25.8 0.736 129.8 +28 0.7228 0.5837 -0.1391 30.0 38 4 29.8 27.9 0.431 158.9 +29 0.7742 0.6401 -0.1341 37.9 45 4 29.9 30.1 0.758 101.3 +30 0.8782 0.7973 -0.0809 21.8 40 4 30.1 27.0 0.495 228.0 +31 0.7263 0.4536 -0.2726 36.2 42 4 29.8 30.1 0.620 135.2 +32 0.7227 0.5152 -0.2074 25.1 43 4 30.0 26.3 0.479 198.4 +33 0.8002 0.7558 -0.0444 32.0 42 4 30.0 28.0 0.578 128.6 +34 0.9353 0.9336 -0.0017 34.5 49 4 29.9 29.2 0.713 130.7 +35 0.7784 0.6648 -0.1136 27.9 39 4 30.0 28.3 0.563 181.1 +36 0.2867 0.4971 +0.2104 35.1 41 4 30.0 28.7 0.571 148.1 +37 0.7839 0.7338 -0.0501 37.5 42 4 30.0 29.2 0.641 150.4 +38 0.9043 0.8528 -0.0515 35.5 46 4 29.7 29.9 0.697 98.2 +39 0.6942 0.9528 +0.2586 32.6 47 4 30.0 27.4 0.750 132.1 +40 0.8157 0.7343 -0.0814 35.4 36 4 30.0 29.7 0.568 142.4 +41 0.9648 0.9464 -0.0184 35.7 48 4 29.9 29.3 0.777 101.8 +42 0.9616 0.9304 -0.0312 34.0 50 4 30.0 28.6 0.817 108.6 +43 0.8211 0.6608 -0.1603 41.0 42 4 29.9 30.2 0.714 88.9 +44 0.9500 0.9115 -0.0385 32.2 37 4 29.9 27.8 0.627 109.4 +45 0.9727 0.9346 -0.0381 35.6 50 4 29.9 28.9 0.876 94.8 +46 0.9174 0.9251 +0.0077 33.1 39 4 30.3 28.4 0.583 119.7 +47 0.8824 0.8356 -0.0469 37.0 38 4 29.6 29.1 0.553 105.4 +48 0.7033 0.6620 -0.0413 37.1 44 4 30.0 30.1 0.656 116.0 +49 0.8185 0.7615 -0.0571 37.4 44 4 29.9 28.6 0.614 150.2 +50 0.9593 0.9530 -0.0063 27.4 47 4 30.1 26.9 0.652 134.2 +51 0.6141 0.9269 +0.3128 39.5 50 4 30.0 29.4 0.845 107.0 +52 0.5787 0.7970 +0.2183 38.0 40 4 29.7 30.0 0.620 131.1 +53 0.3918 0.3167 -0.0751 25.7 34 4 29.9 24.7 0.295 169.8 +54 0.8613 0.8378 -0.0235 38.0 43 4 30.0 29.2 0.684 105.6 +55 0.9282 0.9403 +0.0121 32.8 48 4 29.9 26.1 0.733 103.3 +56 0.8919 0.9074 +0.0156 41.6 48 4 29.9 30.3 0.716 111.4 +57 0.8958 0.8877 -0.0081 40.5 45 4 29.9 30.5 0.759 100.4 +58 0.6867 0.9279 +0.2412 38.1 44 4 30.2 26.8 0.700 124.9 +59 0.6639 0.6228 -0.0412 31.5 38 4 29.8 28.9 0.534 186.4 +60 0.8885 0.8682 -0.0203 36.9 44 4 30.2 28.9 0.717 107.9 +61 0.9123 0.8184 -0.0939 34.3 46 4 29.7 27.6 0.741 128.9 +62 0.9189 0.9456 +0.0266 28.4 49 4 30.1 27.0 0.667 142.2 +63 0.9281 0.9344 +0.0063 36.2 48 4 29.8 29.0 0.801 93.8 +64 0.8017 0.8734 +0.0716 40.5 44 4 29.8 29.9 0.698 150.5 +65 0.8081 0.9124 +0.1043 38.1 46 4 30.4 28.5 0.718 124.9 +66 0.7671 0.9463 +0.1792 26.3 48 4 30.0 26.7 0.648 143.2 +67 0.8860 0.9326 +0.0465 28.6 41 4 29.5 28.1 0.569 188.7 +68 0.8851 0.8452 -0.0399 38.2 45 4 29.9 29.5 0.701 119.5 +69 0.6321 0.9361 +0.3040 36.3 45 4 30.0 29.1 0.667 124.2 +70 0.9286 0.9480 +0.0195 33.3 48 4 30.1 28.6 0.742 113.6 +71 0.9244 0.9362 +0.0118 37.2 47 4 29.9 29.7 0.787 131.8 +72 0.9428 0.9102 -0.0326 32.4 45 4 29.7 29.2 0.706 104.7 +73 0.9506 0.9439 -0.0067 39.0 50 4 30.1 29.9 0.901 88.7 +74 0.9256 0.9084 -0.0171 28.0 48 4 29.8 28.1 0.526 140.0 +75 0.9336 0.9484 +0.0148 27.1 50 4 30.1 25.7 0.668 160.4 +76 0.8474 0.8076 -0.0398 40.9 37 4 29.9 30.5 0.599 89.4 +77 0.9612 0.9439 -0.0173 30.2 45 4 29.9 27.5 0.689 129.4 +78 0.9306 0.9444 +0.0138 28.1 47 4 30.1 25.9 0.678 142.4 +79 0.7988 0.7307 -0.0681 38.5 45 4 30.1 30.2 0.684 126.7 +80 0.7712 0.6911 -0.0801 26.2 43 4 29.7 26.1 0.555 181.9 +81 0.9580 0.9279 -0.0301 28.6 46 4 29.9 28.0 0.648 134.0 +82 0.7799 0.7055 -0.0743 39.7 41 4 30.0 29.4 0.597 136.0 +83 0.7745 0.7672 -0.0073 40.2 42 4 29.9 30.7 0.612 119.7 +84 0.8723 0.8918 +0.0195 38.0 48 4 30.0 29.5 0.750 84.3 +85 0.7744 0.6859 -0.0885 31.5 45 4 29.9 29.0 0.649 134.2 +86 0.9394 0.9442 +0.0048 38.7 47 4 30.1 29.7 0.777 111.8 +87 0.6874 0.7982 +0.1108 40.7 43 4 29.8 29.2 0.577 129.6 +88 0.7890 0.5988 -0.1902 35.8 40 4 29.9 29.9 0.612 126.0 +89 0.8913 0.8625 -0.0288 35.4 49 4 30.0 28.4 0.664 144.2 +90 0.9782 0.9556 -0.0226 32.4 37 4 30.1 30.0 0.510 179.0 +91 0.9731 0.9647 -0.0084 40.6 49 4 29.9 29.5 0.865 93.7 +92 0.8500 0.8520 +0.0020 35.5 46 4 29.9 27.8 0.632 140.5 +93 0.6905 0.5236 -0.1668 14.2 49 4 29.9 21.6 0.556 229.3 +94 0.8003 0.7910 -0.0093 27.0 42 4 30.0 25.9 0.504 172.8 +95 0.7230 0.5845 -0.1385 39.5 40 4 29.9 29.4 0.582 123.5 +96 0.7994 0.6902 -0.1091 40.6 46 4 30.1 29.8 0.750 106.5 +97 0.9464 0.9284 -0.0180 33.1 49 4 29.8 28.6 0.683 127.0 +98 0.8912 0.8138 -0.0774 34.4 45 4 30.1 29.5 0.698 128.4 +99 0.7576 0.7480 -0.0096 35.3 45 4 29.9 30.7 0.658 161.6 +100 0.7547 0.5699 -0.1848 38.6 45 4 30.0 30.0 0.723 136.2 +101 0.8651 0.8328 -0.0323 33.4 43 4 29.8 29.3 0.672 188.6 +102 0.8473 0.7527 -0.0946 35.3 43 4 30.0 29.7 0.649 101.3 +103 0.8296 0.7442 -0.0854 36.4 44 4 30.2 29.4 0.579 153.4 +104 0.7923 0.7224 -0.0699 28.1 40 4 29.7 27.4 0.486 193.9 +105 0.9536 0.9237 -0.0299 37.4 46 4 30.1 29.5 0.714 109.5 +106 0.6510 0.8945 +0.2435 41.5 43 4 30.0 29.3 0.715 101.4 +107 0.9480 0.9271 -0.0209 36.5 50 4 29.9 28.7 0.743 103.6 +108 0.9425 0.8806 -0.0619 29.2 47 4 29.8 28.6 0.634 162.3 +109 0.8979 0.9130 +0.0151 25.7 47 4 30.0 27.4 0.511 211.8 +110 0.4876 0.4715 -0.0161 37.2 45 4 30.0 29.2 0.595 144.8 +111 0.6997 0.5212 -0.1786 28.9 41 4 29.9 27.6 0.540 184.0 +112 0.5363 0.9487 +0.4124 34.0 47 4 29.9 29.5 0.769 108.7 +113 0.9393 0.9127 -0.0267 23.7 48 4 30.0 26.7 0.619 165.7 +114 0.9759 0.9356 -0.0403 24.7 48 4 29.9 26.8 0.596 150.0 +115 0.6325 0.4761 -0.1564 39.9 33 4 30.1 29.4 0.507 108.7 +116 0.6736 0.6310 -0.0427 38.4 42 4 29.9 29.5 0.588 131.7 +117 0.7680 0.5467 -0.2213 34.7 42 4 30.0 29.4 0.563 147.5 +118 0.8985 0.8687 -0.0297 32.8 45 4 29.9 29.5 0.601 166.3 +119 0.9527 0.9166 -0.0361 28.6 49 4 30.0 27.1 0.693 172.1 + +# --- 10 worst seconds by gap (per-frame SILK diag) --- +# frame t_ms B_o B_r voiced sig_type gain[0] lag_idx pitch_l nlsf_int ltp_gain nb_subfr +# second 21 gap=+0.5319 +1050 21000 24 24 1 2 34 120 151 4 0.180 4 +1051 21020 31 25 1 2 25 176 207 4 0.180 4 +1052 21040 32 30 1 2 17 21 53 4 0.180 4 +1053 21060 25 21 1 2 14 181 212 4 0.180 4 +1054 21080 24 18 1 2 11 186 217 4 0.180 4 +1055 21100 36 20 1 2 8 255 286 4 0.789 4 +1056 21120 26 20 0 0 9 0 0 4 0.000 4 +1057 21140 33 26 1 2 11 216 247 4 0.961 4 +1058 21160 27 22 1 2 13 212 243 4 0.992 4 +1059 21180 29 20 1 2 10 210 241 4 0.930 4 +1060 21200 32 22 1 2 10 206 237 4 0.180 4 +1061 21220 29 22 1 2 9 247 278 4 0.180 4 +1062 21240 30 18 1 2 9 200 231 4 0.633 4 +1063 21260 34 21 1 2 9 80 111 4 0.180 4 +1064 21280 29 25 1 2 10 80 111 4 0.789 4 +1065 21300 28 16 1 2 10 107 138 4 0.180 4 +1066 21320 27 17 1 2 9 212 243 4 0.180 4 +1067 21340 32 16 0 0 19 0 0 4 0.000 4 +1068 21360 25 16 1 2 12 84 115 4 0.938 4 +1069 21380 35 20 1 2 8 236 267 4 0.180 4 +1070 21400 30 15 0 0 7 0 0 4 0.000 4 +1071 21420 34 17 1 2 9 156 187 4 0.922 4 +1072 21440 30 16 1 2 8 172 203 4 0.180 4 +1073 21460 26 24 0 1 20 0 0 4 0.000 4 +1074 21480 27 30 0 1 36 0 0 4 0.000 4 +1075 21500 38 30 0 0 34 0 0 4 0.000 4 +1076 21520 27 32 1 2 32 251 282 4 0.180 4 +1077 21540 52 32 1 2 38 253 284 4 0.922 4 +1078 21560 16 35 1 2 63 42 76 4 0.852 4 +1079 21580 14 30 1 2 63 46 78 4 0.984 4 +1080 21600 30 28 1 2 52 47 79 4 0.938 4 +1081 21620 41 23 1 2 43 49 80 4 0.969 4 +1082 21640 34 28 1 2 53 51 83 4 0.977 4 +1083 21660 14 34 1 2 63 51 82 4 0.789 4 +1084 21680 17 33 1 2 10 47 77 4 0.938 4 +1085 21700 50 33 1 2 28 43 75 4 0.852 4 +1086 21720 23 30 1 2 41 45 77 4 0.992 4 +1087 21740 42 29 1 2 38 46 78 4 0.969 4 +1088 21760 34 28 1 2 44 47 79 4 0.984 4 +1089 21780 24 28 1 2 44 48 79 4 0.938 4 +1090 21800 35 32 1 2 44 48 79 4 0.938 4 +1091 21820 30 20 1 2 42 49 80 4 0.938 4 +1092 21840 31 33 1 2 39 47 79 4 0.852 4 +1093 21860 29 36 1 2 41 49 80 4 0.852 4 +1094 21880 30 27 1 2 40 49 80 4 0.852 4 +1095 21900 34 25 1 2 41 49 81 4 0.789 4 +1096 21920 16 34 1 2 57 51 82 4 0.938 4 +1097 21940 16 30 1 2 53 52 83 4 0.938 4 +1098 21960 41 22 1 2 42 53 84 4 0.969 4 +1099 21980 38 19 1 2 44 53 84 4 0.969 4 + +# second 112 gap=+0.4124 +5600 112000 32 20 1 2 10 138 169 4 0.180 4 +5601 112020 30 22 1 2 11 241 272 4 0.984 4 +5602 112040 26 22 1 2 12 237 268 4 0.633 4 +5603 112060 33 21 1 2 29 159 190 4 1.039 4 +5604 112080 31 36 1 2 37 49 80 4 0.852 4 +5605 112100 28 34 1 2 38 52 83 4 0.969 4 +5606 112120 31 36 1 2 42 53 84 4 0.852 4 +5607 112140 33 28 1 2 37 53 84 4 0.938 4 +5608 112160 28 32 1 2 34 53 84 4 0.852 4 +5609 112180 31 30 1 2 31 49 81 4 0.789 4 +5610 112200 25 25 1 2 29 219 250 4 0.789 4 +5611 112220 32 25 1 2 29 216 247 4 0.961 4 +5612 112240 41 42 1 2 36 50 81 4 0.938 4 +5613 112260 28 36 1 2 42 56 87 4 0.938 4 +5614 112280 25 38 1 2 41 60 91 4 0.992 4 +5615 112300 27 30 1 2 41 59 90 4 0.977 4 +5616 112320 32 31 1 2 44 59 90 4 0.992 4 +5617 112340 31 31 1 2 38 57 88 4 0.938 4 +5618 112360 34 35 1 2 40 56 87 4 0.938 4 +5619 112380 24 33 1 2 40 55 86 4 0.969 4 +5620 112400 29 27 1 2 37 56 87 4 0.633 4 +5621 112420 29 31 1 2 35 39 69 4 0.961 4 +5622 112440 34 35 1 2 41 52 83 4 0.852 4 +5623 112460 36 32 1 2 47 54 85 4 0.969 4 +5624 112480 14 25 1 2 63 54 85 4 0.984 4 +5625 112500 37 21 1 2 12 52 83 4 0.852 4 +5626 112520 40 24 1 2 40 51 82 4 0.938 4 +5627 112540 22 27 1 2 48 50 81 4 0.938 4 +5628 112560 35 29 1 2 46 49 81 4 0.992 4 +5629 112580 24 23 1 2 48 47 79 4 0.977 4 +5630 112600 42 24 1 2 47 45 77 4 0.969 4 +5631 112620 22 26 1 2 58 43 75 4 0.977 4 +5632 112640 29 31 1 2 45 41 75 4 0.992 4 +5633 112660 29 33 1 2 42 39 71 4 0.938 4 +5634 112680 28 34 1 2 38 38 69 4 0.852 4 +5635 112700 30 29 1 2 28 38 70 4 0.789 4 +5636 112720 27 20 1 2 20 37 69 4 0.789 4 +5637 112740 30 28 1 2 20 111 142 4 0.180 4 +5638 112760 23 32 1 2 25 254 285 4 0.852 4 +5639 112780 36 33 0 0 23 0 0 4 0.000 4 +5640 112800 27 32 1 2 27 255 286 4 0.984 4 +5641 112820 28 30 1 2 28 255 286 4 0.930 4 +5642 112840 35 30 0 0 27 0 0 4 0.000 4 +5643 112860 26 31 0 1 28 0 0 4 0.000 4 +5644 112880 31 30 1 2 29 3 36 4 0.922 4 +5645 112900 32 32 1 2 28 0 33 4 0.180 4 +5646 112920 29 32 1 2 28 0 32 4 0.180 4 +5647 112940 28 33 1 2 29 0 33 4 0.930 4 +5648 112960 35 24 1 2 26 0 32 4 0.180 4 +5649 112980 26 31 1 2 28 1 33 4 0.180 4 + +# second 3 gap=+0.3684 +150 3000 29 31 1 2 34 40 73 4 0.789 4 +151 3020 33 33 1 2 40 39 71 4 0.938 4 +152 3040 32 34 1 2 44 39 70 4 0.180 4 +153 3060 25 29 1 2 50 40 70 4 0.984 4 +154 3080 31 29 1 2 48 40 72 4 0.969 4 +155 3100 33 33 1 2 43 40 72 4 0.938 4 +156 3120 21 32 1 2 41 39 71 4 0.180 4 +157 3140 31 22 1 2 38 39 71 4 0.180 4 +158 3160 33 29 1 2 35 42 74 4 0.789 4 +159 3180 28 34 1 2 30 48 80 4 0.852 4 +160 3200 29 33 1 2 44 44 76 4 0.992 4 +161 3220 31 29 1 2 40 44 76 4 0.938 4 +162 3240 29 22 1 2 40 46 78 4 0.938 4 +163 3260 34 24 1 2 37 50 81 4 0.852 4 +164 3280 27 26 1 2 34 52 83 4 0.852 4 +165 3300 29 22 1 2 33 51 82 4 0.180 4 +166 3320 29 35 1 2 32 50 81 4 0.180 4 +167 3340 26 31 1 2 37 51 82 4 0.789 4 +168 3360 31 37 1 2 37 51 82 4 0.852 4 +169 3380 30 34 1 2 34 54 85 4 0.969 4 +170 3400 34 40 1 2 37 51 83 4 0.789 4 +171 3420 28 31 1 2 36 52 83 4 0.836 4 +172 3440 27 30 1 2 33 52 83 4 0.922 4 +173 3460 36 34 1 2 31 53 84 4 0.992 4 +174 3480 24 32 1 2 31 54 85 4 0.930 4 +175 3500 29 31 1 2 34 51 82 4 0.984 4 +176 3520 32 33 1 2 37 50 81 4 0.977 4 +177 3540 32 32 1 2 34 49 81 4 0.992 4 +178 3560 30 30 1 2 36 47 79 4 0.992 4 +179 3580 31 34 1 2 36 48 79 4 0.984 4 +180 3600 29 31 1 2 36 47 79 4 0.930 4 +181 3620 33 39 1 2 38 47 79 4 0.922 4 +182 3640 28 35 1 2 38 47 80 4 0.992 4 +183 3660 30 32 1 2 40 46 78 4 0.992 4 +184 3680 31 32 1 2 42 47 79 4 0.992 4 +185 3700 23 31 1 2 43 50 81 4 0.938 4 +186 3720 36 34 1 2 40 51 82 4 0.938 4 +187 3740 15 31 1 2 63 51 82 4 0.938 4 +188 3760 50 33 1 2 15 53 84 4 0.938 4 +189 3780 24 32 1 2 43 55 86 4 0.969 4 +190 3800 38 29 1 2 40 57 88 4 0.930 4 +191 3820 29 32 1 2 41 146 177 4 0.938 4 +192 3840 35 29 1 2 39 150 181 4 0.984 4 +193 3860 23 27 1 2 43 151 182 4 0.789 4 +194 3880 35 36 1 2 41 153 184 4 0.992 4 +195 3900 32 33 1 2 43 149 180 4 0.938 4 +196 3920 14 26 1 2 63 147 178 4 0.938 4 +197 3940 68 31 1 2 19 146 177 4 0.969 4 +198 3960 15 30 1 2 63 145 176 4 0.789 4 +199 3980 48 30 1 2 11 144 175 4 0.969 4 + +# second 51 gap=+0.3128 +2550 51000 14 34 1 2 60 39 71 4 0.969 4 +2551 51020 50 32 1 2 57 41 73 4 0.969 4 +2552 51040 18 30 1 2 63 42 76 4 0.969 4 +2553 51060 37 34 1 2 49 43 75 4 0.969 4 +2554 51080 35 34 1 2 47 43 76 4 0.992 4 +2555 51100 28 28 1 2 46 42 74 4 0.969 4 +2556 51120 26 26 1 2 44 41 74 4 0.852 4 +2557 51140 22 23 1 2 39 41 76 4 0.992 4 +2558 51160 35 30 1 2 39 40 73 4 0.852 4 +2559 51180 29 27 1 2 41 39 71 4 0.852 4 +2560 51200 39 24 1 2 36 39 71 4 0.852 4 +2561 51220 21 33 1 2 40 38 70 4 0.852 4 +2562 51240 29 19 1 2 38 37 69 4 0.852 4 +2563 51260 29 28 1 2 38 37 69 4 0.961 4 +2564 51280 35 25 1 2 37 37 69 4 0.836 4 +2565 51300 29 22 1 2 36 37 69 4 0.836 4 +2566 51320 32 26 1 2 37 38 70 4 0.930 4 +2567 51340 33 38 1 2 33 39 71 4 0.789 4 +2568 51360 24 35 1 2 32 40 75 4 0.969 4 +2569 51380 33 25 1 2 25 38 71 4 0.180 4 +2570 51400 24 20 1 2 18 40 75 4 0.789 4 +2571 51420 32 35 1 2 25 145 176 4 1.039 4 +2572 51440 23 28 1 2 45 241 272 4 0.922 4 +2573 51460 36 32 1 2 44 244 275 4 0.938 4 +2574 51480 30 28 1 2 42 28 60 4 0.938 4 +2575 51500 29 29 1 2 38 41 76 4 0.992 4 +2576 51520 31 36 1 2 28 47 79 4 0.789 4 +2577 51540 30 28 1 2 24 45 77 4 0.992 4 +2578 51560 31 27 1 2 17 226 257 4 0.180 4 +2579 51580 28 20 1 2 15 195 226 4 0.180 4 +2580 51600 32 31 1 2 38 23 53 4 0.938 4 +2581 51620 30 39 1 2 44 39 69 4 0.938 4 +2582 51640 28 36 1 2 45 46 76 4 0.992 4 +2583 51660 33 23 1 2 46 48 79 4 0.969 4 +2584 51680 29 21 1 2 43 48 79 4 0.992 4 +2585 51700 28 25 1 2 44 47 79 4 0.984 4 +2586 51720 31 29 1 2 46 46 78 4 0.984 4 +2587 51740 33 38 1 2 43 48 79 4 0.852 4 +2588 51760 30 40 1 2 33 47 79 4 0.992 4 +2589 51780 30 33 1 2 37 47 77 4 0.852 4 +2590 51800 28 28 1 2 33 43 76 4 0.836 4 +2591 51820 30 31 1 2 29 226 257 4 0.961 4 +2592 51840 37 34 1 2 39 51 83 4 0.938 4 +2593 51860 22 23 1 2 45 52 83 4 0.852 4 +2594 51880 24 25 1 2 43 57 88 4 1.039 4 +2595 51900 56 33 1 2 37 57 88 4 0.789 4 +2596 51920 18 35 1 2 54 229 260 4 0.180 4 +2597 51940 15 25 1 2 63 200 231 4 0.992 4 +2598 51960 15 36 1 2 63 210 241 4 0.180 4 +2599 51980 61 31 1 2 15 146 177 4 0.789 4 + +# second 69 gap=+0.3040 +3450 69000 30 34 1 2 34 220 251 4 0.180 4 +3451 69020 32 21 1 2 31 30 62 4 0.992 4 +3452 69040 50 33 1 2 36 42 75 4 0.930 4 +3453 69060 22 27 1 2 45 46 78 4 0.992 4 +3454 69080 35 31 1 2 46 48 79 4 0.977 4 +3455 69100 14 23 1 2 54 48 80 4 0.938 4 +3456 69120 16 32 1 2 63 49 80 4 0.938 4 +3457 69140 35 23 1 2 49 48 80 4 0.938 4 +3458 69160 41 31 1 2 42 48 79 4 0.938 4 +3459 69180 15 22 1 2 58 48 80 4 0.938 4 +3460 69200 56 24 1 2 45 48 79 4 0.938 4 +3461 69220 19 28 1 2 45 48 79 4 0.938 4 +3462 69240 29 32 1 2 40 47 79 4 0.984 4 +3463 69260 28 25 1 2 42 47 79 4 0.938 4 +3464 69280 21 36 1 2 44 46 78 4 0.969 4 +3465 69300 39 31 1 2 45 46 78 4 1.039 4 +3466 69320 35 27 1 2 43 46 78 4 0.984 4 +3467 69340 28 34 1 2 42 47 81 4 0.930 4 +3468 69360 27 34 1 2 38 134 165 4 0.984 4 +3469 69380 27 23 1 2 29 226 257 4 0.836 4 +3470 69400 26 21 1 2 26 222 253 4 0.180 4 +3471 69420 41 25 1 2 15 227 258 4 0.180 4 +3472 69440 27 23 1 2 14 24 54 4 0.992 4 +3473 69460 30 32 1 2 33 122 153 4 0.852 4 +3474 69480 32 37 1 2 36 47 79 4 0.922 4 +3475 69500 29 38 1 2 31 46 78 4 0.180 4 +3476 69520 27 29 1 2 31 47 80 4 0.852 4 +3477 69540 27 26 1 2 31 48 79 4 0.852 4 +3478 69560 32 37 1 2 31 47 81 4 0.180 4 +3479 69580 25 37 0 1 39 0 0 4 0.000 4 +3480 69600 37 32 1 2 42 244 275 4 0.180 4 +3481 69620 29 30 1 2 42 242 273 4 0.180 4 +3482 69640 26 31 1 2 44 241 272 4 0.938 4 +3483 69660 33 32 0 0 41 0 0 4 0.000 4 +3484 69680 33 32 1 2 37 39 70 4 0.852 4 +3485 69700 29 26 1 2 37 42 73 4 0.852 4 +3486 69720 31 30 1 2 30 242 273 4 0.180 4 +3487 69740 27 26 1 2 19 41 73 4 0.180 4 +3488 69760 28 21 1 2 13 236 267 4 0.180 4 +3489 69780 35 18 1 2 11 146 177 4 0.961 4 +3490 69800 26 29 1 2 26 68 99 4 0.969 4 +3491 69820 32 35 1 2 32 39 69 4 0.852 4 +3492 69840 32 33 1 2 36 45 77 4 0.969 4 +3493 69860 31 30 1 2 35 54 85 4 0.789 4 +3494 69880 28 23 1 2 22 50 81 4 0.789 4 +3495 69900 28 27 0 0 24 0 0 4 0.000 4 +3496 69920 26 38 0 1 41 0 0 4 0.000 4 +3497 69940 34 34 1 2 42 242 273 4 0.836 4 +3498 69960 30 31 0 1 45 0 0 4 0.000 4 +3499 69980 30 23 1 2 37 4 38 4 0.180 4 + +# second 39 gap=+0.2586 +1950 39000 36 28 1 2 27 110 141 4 0.992 4 +1951 39020 34 35 1 2 35 45 76 4 0.992 4 +1952 39040 24 28 1 2 42 47 79 4 0.180 4 +1953 39060 27 32 1 2 39 49 81 4 0.938 4 +1954 39080 33 30 1 2 39 49 80 4 0.852 4 +1955 39100 32 28 1 2 38 50 81 4 0.852 4 +1956 39120 32 35 1 2 39 50 81 4 0.984 4 +1957 39140 34 33 1 2 42 51 82 4 0.938 4 +1958 39160 27 24 1 2 46 54 85 4 0.922 4 +1959 39180 31 36 1 2 40 55 86 4 0.922 4 +1960 39200 32 31 1 2 37 53 84 4 0.180 4 +1961 39220 28 32 1 2 36 242 273 4 0.180 4 +1962 39240 31 26 1 2 24 238 269 4 0.180 4 +1963 39260 23 26 0 0 24 0 0 4 0.000 4 +1964 39280 26 22 0 0 28 0 0 4 0.000 4 +1965 39300 35 29 1 2 32 220 251 4 0.938 4 +1966 39320 29 34 0 0 34 0 0 4 0.000 4 +1967 39340 32 34 1 2 39 48 80 4 0.789 4 +1968 39360 29 35 1 2 40 52 83 4 0.992 4 +1969 39380 30 28 1 2 37 53 84 4 0.836 4 +1970 39400 32 27 1 2 37 54 85 4 0.852 4 +1971 39420 40 31 1 2 39 56 87 4 0.852 4 +1972 39440 28 23 1 2 43 57 88 4 0.852 4 +1973 39460 29 30 1 2 42 57 88 4 0.938 4 +1974 39480 15 26 1 2 63 59 90 4 0.992 4 +1975 39500 36 24 1 2 12 58 89 4 0.969 4 +1976 39520 32 27 1 2 38 57 88 4 0.977 4 +1977 39540 34 20 1 2 38 56 87 4 0.938 4 +1978 39560 25 22 1 2 36 56 87 4 0.969 4 +1979 39580 29 21 1 2 36 56 87 4 0.969 4 +1980 39600 44 31 1 2 39 219 250 4 0.938 4 +1981 39620 21 34 1 2 46 143 174 4 0.852 4 +1982 39640 26 32 1 2 43 155 186 4 0.938 4 +1983 39660 35 22 1 2 42 142 173 4 0.789 4 +1984 39680 28 28 1 2 34 106 137 4 0.938 4 +1985 39700 29 28 1 2 32 105 136 4 0.984 4 +1986 39720 26 28 1 2 30 35 67 4 0.930 4 +1987 39740 34 27 1 2 23 221 252 4 0.969 4 +1988 39760 30 24 1 2 22 193 224 4 0.180 4 +1989 39780 24 22 1 2 13 189 220 4 0.180 4 +1990 39800 33 20 1 2 13 26 61 4 0.789 4 +1991 39820 29 21 1 2 10 237 268 4 0.180 4 +1992 39840 27 21 1 2 9 129 160 4 0.180 4 +1993 39860 28 21 1 2 8 230 261 4 0.992 4 +1994 39880 29 22 1 2 7 174 205 4 0.836 4 +1995 39900 30 17 1 2 5 234 265 4 0.992 4 +1996 39920 36 22 1 2 29 24 56 4 0.969 4 +1997 39940 37 39 1 2 37 47 79 4 0.984 4 +1998 39960 23 35 1 2 44 49 80 4 0.969 4 +1999 39980 28 21 1 2 44 50 81 4 0.938 4 + +# second 106 gap=+0.2435 +5300 106000 22 24 1 2 48 48 79 4 0.852 4 +5301 106020 33 27 1 2 44 48 79 4 0.852 4 +5302 106040 26 26 1 2 48 49 81 4 0.938 4 +5303 106060 29 34 1 2 49 51 82 4 0.969 4 +5304 106080 32 30 1 2 46 50 82 4 0.938 4 +5305 106100 32 34 1 2 45 49 80 4 0.969 4 +5306 106120 30 34 1 2 45 47 79 4 0.969 4 +5307 106140 41 32 1 2 45 47 80 4 0.977 4 +5308 106160 19 34 1 2 39 47 79 4 0.969 4 +5309 106180 29 31 1 2 45 43 77 4 0.992 4 +5310 106200 33 33 1 2 45 45 78 4 0.992 4 +5311 106220 36 25 1 2 48 49 80 4 0.984 4 +5312 106240 29 23 1 2 50 51 82 4 0.969 4 +5313 106260 47 24 1 2 52 50 81 4 0.938 4 +5314 106280 24 25 1 2 48 50 81 4 0.938 4 +5315 106300 18 32 1 2 43 47 79 4 0.852 4 +5316 106320 28 30 1 2 41 48 79 4 0.938 4 +5317 106340 29 29 1 2 37 48 79 4 0.922 4 +5318 106360 25 41 1 2 40 49 80 4 0.984 4 +5319 106380 34 31 1 2 41 50 82 4 0.938 4 +5320 106400 27 29 1 2 41 50 81 4 0.938 4 +5321 106420 30 36 1 2 34 51 82 4 0.984 4 +5322 106440 29 34 0 0 43 0 0 4 0.000 4 +5323 106460 21 27 1 2 44 248 279 4 0.180 4 +5324 106480 40 27 0 1 45 0 0 4 0.000 4 +5325 106500 25 23 1 2 35 225 256 4 0.180 4 +5326 106520 30 24 1 2 21 126 157 4 0.180 4 +5327 106540 34 32 1 2 23 0 33 4 0.969 4 +5328 106560 28 35 0 1 37 0 0 4 0.000 4 +5329 106580 29 32 1 2 41 227 258 4 0.180 4 +5330 106600 32 31 1 2 38 227 258 4 0.992 4 +5331 106620 25 33 1 2 39 31 62 4 0.180 4 +5332 106640 36 37 1 2 38 43 76 4 0.922 4 +5333 106660 14 30 1 2 60 48 79 4 0.969 4 +5334 106680 77 29 1 2 53 48 79 4 0.984 4 +5335 106700 15 31 1 2 63 47 79 4 0.977 4 +5336 106720 15 23 1 2 62 46 78 4 0.969 4 +5337 106740 16 28 1 2 63 47 79 4 0.992 4 +5338 106760 84 29 1 2 5 49 81 4 0.852 4 +5339 106780 16 33 1 2 37 47 79 4 0.789 4 +5340 106800 15 29 1 2 28 47 79 4 0.789 4 +5341 106820 20 28 0 1 27 0 0 4 0.000 4 +5342 106840 24 29 0 1 35 0 0 4 0.000 4 +5343 106860 30 15 1 2 16 241 272 4 0.180 4 +5344 106880 32 28 0 1 17 0 0 4 0.000 4 +5345 106900 31 31 0 1 37 0 0 4 0.000 4 +5346 106920 31 33 1 2 46 44 76 4 0.938 4 +5347 106940 27 29 1 2 48 46 80 4 0.938 4 +5348 106960 54 23 1 2 50 47 81 4 0.938 4 +5349 106980 15 19 1 2 52 47 79 4 0.852 4 + +# second 58 gap=+0.2412 +2900 58000 28 28 1 2 46 37 70 4 0.969 4 +2901 58020 35 36 1 2 42 38 69 4 0.938 4 +2902 58040 35 31 1 2 31 39 73 4 0.938 4 +2903 58060 26 25 0 0 40 0 0 4 0.000 4 +2904 58080 26 32 1 2 44 116 147 4 0.180 4 +2905 58100 29 32 1 2 46 247 278 4 0.180 4 +2906 58120 28 29 0 0 43 0 0 4 0.000 4 +2907 58140 34 28 0 0 37 0 0 4 0.000 4 +2908 58160 28 29 0 0 33 0 0 4 0.000 4 +2909 58180 35 27 1 2 28 213 244 4 0.180 4 +2910 58200 31 28 0 0 26 0 0 4 0.000 4 +2911 58220 32 23 1 2 36 33 62 4 0.930 4 +2912 58240 28 28 1 2 43 40 71 4 0.984 4 +2913 58260 37 25 1 2 45 43 76 4 0.969 4 +2914 58280 27 25 1 2 48 44 76 4 1.039 4 +2915 58300 28 23 1 2 45 46 78 4 0.992 4 +2916 58320 31 22 1 2 48 46 78 4 0.992 4 +2917 58340 14 20 1 2 61 47 79 4 0.984 4 +2918 58360 16 28 1 2 63 48 80 4 0.984 4 +2919 58380 57 21 1 2 56 49 80 4 0.992 4 +2920 58400 52 19 1 2 46 50 81 4 0.992 4 +2921 58420 13 20 1 2 63 50 81 4 0.969 4 +2922 58440 34 26 1 2 55 50 81 4 0.992 4 +2923 58460 20 22 1 2 50 50 81 4 0.969 4 +2924 58480 35 33 1 2 41 49 80 4 0.938 4 +2925 58500 31 25 1 2 38 47 80 4 0.852 4 +2926 58520 23 22 1 2 38 45 77 4 0.922 4 +2927 58540 24 35 1 2 47 49 80 4 0.992 4 +2928 58560 44 29 1 2 41 159 190 4 0.180 4 +2929 58580 24 28 1 2 35 250 281 4 0.180 4 +2930 58600 27 27 1 2 25 207 238 4 0.180 4 +2931 58620 26 25 1 2 17 165 196 4 0.180 4 +2932 58640 35 21 1 2 14 241 272 4 0.180 4 +2933 58660 28 26 1 2 14 237 268 4 0.180 4 +2934 58680 26 24 0 0 13 0 0 4 0.000 4 +2935 58700 35 20 1 2 13 218 249 4 0.852 4 +2936 58720 26 19 1 2 14 221 252 4 0.836 4 +2937 58740 36 32 1 2 20 217 248 4 0.984 4 +2938 58760 29 32 1 2 22 39 69 4 0.938 4 +2939 58780 31 27 1 2 21 42 77 4 0.836 4 +2940 58800 23 22 1 2 20 208 239 4 0.789 4 +2941 58820 35 29 1 2 33 39 71 4 0.992 4 +2942 58840 39 36 1 2 39 43 77 4 0.938 4 +2943 58860 24 28 1 2 45 45 77 4 0.984 4 +2944 58880 28 33 1 2 49 46 78 4 0.984 4 +2945 58900 31 27 1 2 47 48 79 4 0.969 4 +2946 58920 36 27 1 2 44 50 81 4 0.969 4 +2947 58940 34 29 1 2 47 51 82 4 0.938 4 +2948 58960 27 32 1 2 48 52 83 4 0.992 4 +2949 58980 27 26 1 2 47 56 87 4 1.039 4 + +# second 52 gap=+0.2183 +2600 52000 16 33 1 2 63 125 156 4 0.938 4 +2601 52020 41 33 1 2 7 196 227 4 0.789 4 +2602 52040 31 33 1 2 40 180 211 4 0.969 4 +2603 52060 31 36 1 2 38 186 217 4 0.992 4 +2604 52080 39 39 1 2 50 107 138 4 0.992 4 +2605 52100 23 31 1 2 46 106 137 4 0.938 4 +2606 52120 23 33 1 2 44 102 133 4 0.938 4 +2607 52140 26 29 1 2 38 173 204 4 0.180 4 +2608 52160 30 26 1 2 29 206 237 4 0.180 4 +2609 52180 27 27 1 2 26 247 278 4 0.969 4 +2610 52200 32 33 1 2 27 245 276 4 0.180 4 +2611 52220 30 18 1 2 19 246 277 4 0.180 4 +2612 52240 29 28 1 2 26 10 43 4 0.969 4 +2613 52260 34 22 1 2 14 203 234 4 0.180 4 +2614 52280 26 20 1 2 10 227 258 4 0.180 4 +2615 52300 34 19 1 2 12 223 254 4 0.930 4 +2616 52320 20 23 0 1 20 0 0 4 0.000 4 +2617 52340 37 30 1 2 42 40 74 4 0.961 4 +2618 52360 26 29 1 2 44 40 71 4 0.984 4 +2619 52380 32 33 1 2 42 42 75 4 0.992 4 +2620 52400 30 29 1 2 44 44 75 4 0.992 4 +2621 52420 36 36 1 2 39 46 79 4 0.992 4 +2622 52440 30 29 1 2 38 43 75 4 0.922 4 +2623 52460 30 33 1 2 39 44 77 4 0.180 4 +2624 52480 27 25 1 2 35 45 77 4 0.852 4 +2625 52500 30 24 1 2 36 45 77 4 0.938 4 +2626 52520 30 25 1 2 35 45 77 4 0.836 4 +2627 52540 31 29 1 2 39 45 77 4 0.938 4 +2628 52560 28 22 1 2 34 47 79 4 0.852 4 +2629 52580 33 29 1 2 30 47 79 4 0.789 4 +2630 52600 27 34 1 2 28 46 79 4 0.836 4 +2631 52620 29 35 0 0 32 0 0 4 0.000 4 +2632 52640 26 36 0 1 44 0 0 4 0.000 4 +2633 52660 31 36 0 1 50 0 0 4 0.000 4 +2634 52680 32 30 1 2 51 230 261 4 0.180 4 +2635 52700 29 34 0 1 51 0 0 4 0.000 4 +2636 52720 24 32 0 1 51 0 0 4 0.000 4 +2637 52740 38 29 0 0 50 0 0 4 0.000 4 +2638 52760 26 32 0 1 50 0 0 4 0.000 4 +2639 52780 27 28 0 0 48 0 0 4 0.000 4 +2640 52800 36 35 1 2 44 31 60 4 0.852 4 +2641 52820 31 30 1 2 42 37 69 4 0.977 4 +2642 52840 32 32 1 2 43 36 69 4 0.938 4 +2643 52860 28 37 1 2 43 43 75 4 0.992 4 +2644 52880 25 30 1 2 40 48 82 4 0.938 4 +2645 52900 32 26 0 0 42 0 0 4 0.000 4 +2646 52920 26 34 1 2 49 34 65 4 0.992 4 +2647 52940 33 39 1 2 46 36 69 4 0.789 4 +2648 52960 34 24 1 2 44 37 69 4 0.836 4 +2649 52980 29 30 1 2 46 40 72 4 0.938 4 + +# second 36 gap=+0.2104 +1800 36000 24 23 0 0 43 0 0 4 0.000 4 +1801 36020 40 33 1 2 38 42 71 4 0.789 4 +1802 36040 35 25 1 2 41 47 79 4 0.789 4 +1803 36060 41 27 1 2 50 49 80 4 0.938 4 +1804 36080 14 32 1 2 55 49 80 4 0.852 4 +1805 36100 12 33 1 2 63 53 84 4 0.180 4 +1806 36120 15 30 1 2 16 124 155 4 0.180 4 +1807 36140 52 28 1 2 28 48 79 4 0.969 4 +1808 36160 36 20 0 0 28 0 0 4 0.000 4 +1809 36180 28 19 1 2 20 246 277 4 0.180 4 +1810 36200 28 22 0 0 27 0 0 4 0.000 4 +1811 36220 33 24 1 2 32 52 83 4 0.992 4 +1812 36240 36 34 1 2 31 49 80 4 0.992 4 +1813 36260 35 35 1 2 36 52 83 4 0.938 4 +1814 36280 30 31 1 2 42 53 84 4 0.789 4 +1815 36300 24 35 1 2 37 56 87 4 0.922 4 +1816 36320 27 35 1 2 35 192 223 4 0.180 4 +1817 36340 32 19 1 2 23 188 219 4 0.180 4 +1818 36360 29 23 1 2 21 0 32 4 0.930 4 +1819 36380 26 29 1 2 35 0 32 4 0.180 4 +1820 36400 26 33 1 2 35 237 268 4 0.789 4 +1821 36420 35 34 0 1 42 0 0 4 0.000 4 +1822 36440 30 32 1 2 47 249 280 4 0.180 4 +1823 36460 30 31 1 2 45 250 281 4 0.180 4 +1824 36480 31 32 1 2 46 251 282 4 0.836 4 +1825 36500 29 35 0 1 47 0 0 4 0.000 4 +1826 36520 32 29 0 0 43 0 0 4 0.000 4 +1827 36540 35 25 1 2 39 45 77 4 0.984 4 +1828 36560 27 24 1 2 43 52 83 4 0.969 4 +1829 36580 29 30 1 2 38 51 82 4 0.992 4 +1830 36600 35 33 1 2 36 55 86 4 0.992 4 +1831 36620 32 31 1 2 37 56 87 4 0.180 4 +1832 36640 26 37 1 2 36 55 86 4 0.930 4 +1833 36660 26 36 1 2 38 51 82 4 0.852 4 +1834 36680 31 28 0 0 38 0 0 4 0.000 4 +1835 36700 25 35 0 0 43 0 0 4 0.000 4 +1836 36720 32 31 0 0 42 0 0 4 0.000 4 +1837 36740 28 31 1 2 36 250 281 4 0.984 4 +1838 36760 30 23 1 2 32 201 232 4 0.180 4 +1839 36780 39 20 1 2 36 51 82 4 0.930 4 +1840 36800 29 27 1 2 32 106 137 4 0.938 4 +1841 36820 26 21 1 2 32 102 133 4 0.938 4 +1842 36840 30 23 1 2 30 48 79 4 0.789 4 +1843 36860 34 29 1 2 24 246 277 4 0.180 4 +1844 36880 30 28 1 2 17 88 119 4 0.836 4 +1845 36900 27 25 1 2 24 140 171 4 0.852 4 +1846 36920 29 28 1 2 28 249 280 4 0.953 4 +1847 36940 29 30 1 2 19 245 276 4 0.180 4 +1848 36960 31 31 1 2 20 180 211 4 0.992 4 +1849 36980 32 27 1 2 27 242 273 4 0.930 4 + +# --- global stats --- +# voiced frames: 5353/6000 +# gain_idx[0] histogram: [(0, 1), (5, 6), (6, 22), (7, 46), (8, 87), (9, 109), (10, 132), (11, 108), (12, 84), (13, 61), (14, 69), (15, 81), (16, 72), (17, 82), (18, 56), (19, 70), (20, 68), (21, 86), (22, 81), (23, 65), (24, 78), (25, 77), (26, 86), (27, 93), (28, 79), (29, 104), (30, 123), (31, 129), (32, 156), (33, 118), (34, 165), (35, 171), (36, 210), (37, 248), (38, 219), (39, 270), (40, 280), (41, 269), (42, 260), (43, 266), (44, 247), (45, 235), (46, 196), (47, 112), (48, 126), (49, 86), (50, 68), (51, 37), (52, 30), (53, 16), (54, 14), (55, 8), (56, 2), (57, 4), (58, 4), (59, 1), (60, 3), (61, 1), (62, 2), (63, 21)] +# nlsf_interp histogram: [(4, 6000)] +# avg bytes/frame: ours=29.9 ref=28.4 +# mean ltp_gain: 0.6571 diff --git a/lanes/opus-silkq-r2.bands.txt b/lanes/opus-silkq-r2.bands.txt new file mode 100644 index 00000000..56e30ad9 --- /dev/null +++ b/lanes/opus-silkq-r2.bands.txt @@ -0,0 +1,77 @@ +# reelm@12k SILK per-band divergence: ours vs ffmpeg-libopus (r2) +# mono, 120s, 20ms frames, VBR constrained, 48kHz, Application::Voip +# rates: ours 12.38 kbps, ref 11.98 kbps; err ours=27.421 ref=2.407 ratio=11.39; nframes=47997 +# eb2 = band's mean share of the pre-squared frame error; dln = mean ln(E_test/E_src); band i ends at CELT_EBANDS[i+1]*240 Hz +# band lo_hz hi_hz dln_o dln_r eb2_o eb2_r ratio share_o share_r + 0 0 240 -0.404 -1.015 9.001e2 8.256e-2 10901.483587521187 8.1% 4.5% + 1 240 480 -0.555 -0.822 1.503e2 3.133e-2 4798.8320168752825 1.4% 1.7% + 2 480 720 -0.321 -0.719 2.740e2 3.078e-2 8903.992616391502 2.5% 1.7% + 3 720 960 -0.203 -0.727 1.979e1 6.301e-2 314.11641684740283 0.2% 3.4% + 4 960 1200 +0.086 -0.653 7.565e2 1.271e-1 5949.7190716845535 6.8% 6.9% + 5 1200 1440 -0.100 -0.722 2.464e2 6.096e-2 4041.469210559519 2.2% 3.3% + 6 1440 1680 -0.053 -0.669 6.312e1 6.228e-2 1013.5273671435615 0.6% 3.4% + 7 1680 1920 +0.090 -0.590 6.521e1 1.371e-1 475.68774048015473 0.6% 7.4% + 8 1920 2400 -0.061 -0.686 6.777e2 1.671e-1 4056.5361856691347 6.1% 9.0% + 9 2400 2880 -0.053 -0.685 3.503e3 7.006e-2 50002.415780327836 31.5% 3.8% + 10 2880 3360 -0.159 -0.713 1.983e3 1.380e-1 14374.382059534017 17.9% 7.5% + 11 3360 3840 -0.193 -0.711 1.443e3 1.083e-1 13319.398793662045 13.0% 5.9% + 12 3840 4800 -0.090 -0.640 7.548e2 1.246e-1 6057.742411724968 6.8% 6.7% + 13 4800 5760 -0.377 -0.734 1.358e2 1.598e-1 850.1916761988703 1.2% 8.6% + 14 5760 6720 -0.345 -0.685 5.009e1 7.785e-2 643.3793387719822 0.5% 4.2% + 15 6720 8160 -0.203 -0.594 3.432e1 7.665e-2 447.77759764424064 0.3% 4.1% + 16 8160 9600 +0.074 -0.366 5.147e1 3.265e-2 1576.4684713915938 0.5% 1.8% + 17 9600 11520 -1.565 -1.530 1.430e-1 1.325e-1 1.0791172707432997 0.0% 7.2% + 18 11520 14400 -1.910 -1.910 1.345e-1 1.226e-1 1.0965271211155312 0.0% 6.6% + 19 14400 18720 -1.103 -1.104 4.699e-2 4.612e-2 1.0188001325977802 0.0% 2.5% + 20 18720 24000 -0.046 -0.046 3.853e-5 3.768e-5 1.0225011087163844 0.0% 0.0% + +# top-15 frames by ef2(ours) (ef2 = frame's squared opus_compare error); dom = argmax_b (lnE_o - lnE_s)^2, raw bands +# t(s) fft pkt ef2_o ef2_r dom domband_hz | side sig qoff gains[4] nlsf_i lag cont per ltp[4] ltpscl seed bytes + 2.780 1112 139 4.051e27 4.494e-8 9 2400-2880Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=49 cont=3 per=0 ltp=[1,1,1,1] ltpscl=0 seed=0 bytes=14 + R sig=2 qoff=0 gains=[23,4,5,4] nlsf_i=4 lag=51 cont=0 per=2 ltp=[11,11,11,11] ltpscl=0 seed=0 bytes=37 + 2.777 1111 138 5.487e26 5.770e-8 9 2400-2880Hz + O sig=2 qoff=0 gains=[40,2,3,5] nlsf_i=4 lag=48 cont=3 per=1 ltp=[0,3,3,3] ltpscl=0 seed=0 bytes=46 + R sig=2 qoff=0 gains=[21,6,4,4] nlsf_i=4 lag=50 cont=1 per=2 ltp=[15,0,10,10] ltpscl=0 seed=2 bytes=39 + 2.783 1113 139 2.959e26 8.289e-8 9 2400-2880Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=49 cont=3 per=0 ltp=[1,1,1,1] ltpscl=0 seed=0 bytes=14 + R sig=2 qoff=0 gains=[23,4,5,4] nlsf_i=4 lag=51 cont=0 per=2 ltp=[11,11,11,11] ltpscl=0 seed=0 bytes=37 + 51.998 20799 2599 2.708e24 3.126e-9 8 1920-2400Hz + O sig=2 qoff=0 gains=[44,0,0,5] nlsf_i=4 lag=146 cont=3 per=0 ltp=[1,1,0,1] ltpscl=0 seed=0 bytes=44 + R sig=2 qoff=0 gains=[26,4,4,2] nlsf_i=4 lag=183 cont=5 per=1 ltp=[3,7,7,0] ltpscl=0 seed=2 bytes=30 + 52.005 20802 2600 2.003e24 1.938e-9 4 960-1200Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 52.000 20800 2600 1.715e24 5.741e-8 4 960-1200Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 52.002 20801 2600 5.132e23 2.970e-8 4 960-1200Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 52.015 20806 2600 1.163e23 3.251e-9 4 960-1200Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 2.775 1110 138 7.458e22 5.930e-8 9 2400-2880Hz + O sig=2 qoff=0 gains=[40,2,3,5] nlsf_i=4 lag=48 cont=3 per=1 ltp=[0,3,3,3] ltpscl=0 seed=0 bytes=46 + R sig=2 qoff=0 gains=[21,6,4,4] nlsf_i=4 lag=50 cont=1 per=2 ltp=[15,0,10,10] ltpscl=0 seed=2 bytes=39 + 52.008 20803 2600 2.201e22 1.857e-8 7 1680-1920Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 2.785 1114 139 8.835e21 4.607e-8 9 2400-2880Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=49 cont=3 per=0 ltp=[1,1,1,1] ltpscl=0 seed=0 bytes=14 + R sig=2 qoff=0 gains=[23,4,5,4] nlsf_i=4 lag=51 cont=0 per=2 ltp=[11,11,11,11] ltpscl=0 seed=0 bytes=37 + 52.013 20805 2600 1.187e21 8.529e-7 4 960-1200Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 51.995 20798 2599 7.481e20 1.221e-9 5 1200-1440Hz + O sig=2 qoff=0 gains=[44,0,0,5] nlsf_i=4 lag=146 cont=3 per=0 ltp=[1,1,0,1] ltpscl=0 seed=0 bytes=44 + R sig=2 qoff=0 gains=[26,4,4,2] nlsf_i=4 lag=183 cont=5 per=1 ltp=[3,7,7,0] ltpscl=0 seed=2 bytes=30 + 52.010 20804 2600 3.759e20 3.219e-6 4 960-1200Hz + O sig=2 qoff=0 gains=[63,4,4,4] nlsf_i=4 lag=125 cont=3 per=2 ltp=[7,7,7,7] ltpscl=0 seed=0 bytes=16 + R sig=2 qoff=0 gains=[24,3,4,4] nlsf_i=4 lag=127 cont=12 per=1 ltp=[3,3,0,3] ltpscl=0 seed=0 bytes=32 + 51.943 20777 2597 2.894e20 2.264e-11 5 1200-1440Hz + O sig=2 qoff=0 gains=[63,0,2,7] nlsf_i=4 lag=200 cont=3 per=0 ltp=[1,1,1,1] ltpscl=0 seed=0 bytes=16 + R sig=1 qoff=0 gains=[29,3,1,4] nlsf_i=4 lag=- cont=- per=- ltp=[-,-,-,-] ltpscl=- seed=2 bytes=24 +# tail: top-1% (479 frames) carry 100.00% of ours' Σef2 vs 100.00% of ref's; 50% of ours' err sits in the worst 1 frames (0.00%) vs ref's worst 1 (0.00%) +# de-tailed (worst 50 of 47997 FFT frames dropped per side): err ours=5.624 ref=0.812 ratio=6.93 (was 27.421/2.407/11.39) +# burst signature: packets with gains[0]>=60: 24/6000, mean ef2 2.266e25; gains[0]<60: mean ef2 1.154e22 || packets <=20 bytes: 141/6000, mean ef2 3.857e24; >20 bytes: mean ef2 1.177e22 diff --git a/lanes/opus-silkq-r2.report.md b/lanes/opus-silkq-r2.report.md new file mode 100644 index 00000000..2f6bb6cc --- /dev/null +++ b/lanes/opus-silkq-r2.report.md @@ -0,0 +1,107 @@ +# opus-silkq r2 — where the 12 kbps SILK-WB error lives + +Setup: reelm.wav @ 12 kbps target, mono, `Application::Voip`, 120 s, 20 ms frames, +VBR-constrained, both sides decoded through ffmpeg libopus (gate symmetry). +Full tables: `lanes/opus-silkq-r2.bands.txt`. +Reproduce: `cargo test -p ec-opus --release --test conformance silk_spectral_divergence_12k -- --ignored --nocapture` + +Headline: err ours=27.421 ref=2.407 **ratio=11.39** (reproduces the gate's ~11×); +rates ours 12.38 kbps vs ref 11.98 kbps (±3%); nframes=47997. + +## Mechanism (named) + +**Burst-starved constrained-VBR frames + uniform body coarseness — not a +bandwidth/aliasing defect.** + +1. **Tail — bit-reservoir starvation bursts.** 141/6000 packets (2.35%) are + starved to ≤20 bytes (worst: 14–16 B on voiced frames libopus codes at 24–39 B). + On the worst 24 of these the first-subframe gain index codes **63 (max)** → + decoder emits a loud mid-band burst (dominant band 2.4–3.8 kHz) where the + source is quiet: ef2 up to 4.05e27 vs ref 4.5e-8 at the same instant. + These ~24 packets carry ~100% of ours' Σef2. Worst clusters: t≈2.78 s + (pkt 138/139: bytes 46→14, gains[0] 40→63 — spend-then-starve alternation) + and t≈51.94–52.02 s (pkts 2597–2600: 16 B, gains[0]=63). +2. **Body — uniform elevation.** Every band 0–16 (0–9.6 kHz) shows ours' mean + eb² at 314×–50 000× ref, tracking signal energy (bands 9–11 hold 62% of + the share simply because speech energy lives there). dln shows ours' mean + level *closer* to source than ref's (ref over-attenuates, dln ≈ −0.6…−1.0; + ours ≈ −0.05…−0.55) — so the error is noise/structure, not level. Consistent + with r1's systematic first-subframe gain-index offset (ours 33–47 vs ref 26–39): + over-coarse quantization everywhere, no single band mechanism. +3. **Not aliasing/bandwidth:** bands 17–20 (>9.6 kHz) ratio 1.02–1.10, ours ≈ ref + (both SILK-WB, nothing up there). Band 16 (8.16–9.6 kHz) ratio 1576× is + SILK's 8 kHz edge leakage, same order as body bands. + +## Table 1 — per-band mean eb² (ours/ref), dln = mean ln(E_test/E_src) + +| band | Hz | dln_o | dln_r | eb2_o | eb2_r | ratio | share_o | share_r | +|---|---|---|---|---|---|---|---|---| +| 0 | 0–240 | −0.404 | −1.015 | 9.0e2 | 8.3e−2 | 1.1e4 | 8.1% | 4.5% | +| 1 | 240–480 | −0.555 | −0.822 | 1.5e2 | 3.1e−2 | 4.8e3 | 1.4% | 1.7% | +| 2 | 480–720 | −0.321 | −0.719 | 2.7e2 | 3.1e−2 | 8.9e3 | 2.5% | 1.7% | +| 3 | 720–960 | −0.203 | −0.727 | 2.0e1 | 6.3e−2 | 3.1e2 | 0.2% | 3.4% | +| 4 | 960–1200 | +0.086 | −0.653 | 7.6e2 | 1.3e−1 | 5.9e3 | 6.8% | 6.9% | +| 5 | 1200–1440 | −0.100 | −0.722 | 2.5e2 | 6.1e−2 | 4.0e3 | 2.2% | 3.3% | +| 6 | 1440–1680 | −0.053 | −0.669 | 6.3e1 | 6.2e−2 | 1.0e3 | 0.6% | 3.4% | +| 7 | 1680–1920 | +0.090 | −0.590 | 6.5e1 | 1.4e−1 | 4.8e2 | 0.6% | 7.4% | +| 8 | 1920–2400 | −0.061 | −0.686 | 6.8e2 | 1.7e−1 | 4.1e3 | 6.1% | 9.0% | +| **9** | **2400–2880** | −0.053 | −0.685 | 3.5e3 | 7.0e−2 | **5.0e4** | **31.5%** | 3.8% | +| **10** | **2880–3360** | −0.159 | −0.713 | 2.0e3 | 1.4e−1 | **1.4e4** | **17.9%** | 7.5% | +| **11** | **3360–3840** | −0.193 | −0.711 | 1.4e3 | 1.1e−1 | **1.3e4** | **13.0%** | 5.9% | +| 12 | 3840–4800 | −0.090 | −0.640 | 7.5e2 | 1.2e−1 | 6.1e3 | 6.8% | 6.7% | +| 13 | 4800–5760 | −0.377 | −0.734 | 1.4e2 | 1.6e−1 | 8.5e2 | 1.2% | 8.6% | +| 14 | 5760–6720 | −0.345 | −0.685 | 5.0e1 | 7.8e−2 | 6.4e2 | 0.5% | 4.2% | +| 15 | 6720–8160 | −0.203 | −0.594 | 3.4e1 | 7.7e−2 | 4.5e2 | 0.3% | 4.1% | +| 16 | 8160–9600 | +0.074 | −0.366 | 5.1e1 | 3.3e−2 | 1.6e3 | 0.5% | 1.8% | +| 17 | 9600–11520 | −1.565 | −1.530 | 1.4e−1 | 1.3e−1 | **1.08** | 0.0% | 7.2% | +| 18 | 11520–14400 | −1.910 | −1.910 | 1.3e−1 | 1.2e−1 | **1.10** | 0.0% | 6.6% | +| 19 | 14400–18720 | −1.103 | −1.104 | 4.7e−2 | 4.6e−2 | **1.02** | 0.0% | 2.5% | +| 20 | 18720–24000 | −0.046 | −0.046 | 3.9e−5 | 3.8e−5 | **1.02** | 0.0% | 0.0% | + +## Table 2 — worst frames (top of 15; full table in bands.txt) + +| t(s) | pkt | ef2_ours | ef2_ref | dom band | ours: B, g0 | ref: B, g0 | +|---|---|---|---|---|---|---| +| 2.780 | 139 | 4.05e27 | 4.5e−8 | 2.4–2.9k | **14, 63** | 37, 23 | +| 2.777 | 138 | 5.49e26 | 5.8e−8 | 2.4–2.9k | 46, 40 | 39, 21 | +| 2.783 | 139 | 2.96e26 | 8.3e−8 | 2.4–2.9k | **14, 63** | 37, 23 | +| 51.998 | 2599 | 2.71e24 | 3.1e−9 | 1.9–2.4k | 44, 44 | 30, 26 | +| 52.005 | 2600 | 2.00e24 | 1.9e−9 | 1.0–1.2k | **16, 63** | 32, 24 | +| 52.000–52.015 | 2600 | 1.2e23–1.7e24 | ~e−9 | 1.0–1.9k | **16, 63** | 32, 24 | +| 51.943 | 2597 | 2.89e20 | 2.3e−11 | 1.2–1.4k | **16, 63** (lag 200) | 24, 29 | + +Oracle rows (sig/qoff/nlsf_i/lag/cont/per/ltp) in bands.txt — both sides code +these frames voiced (sig=2, qoff=0, nlsf_i=4); ours differs in bytes, g0, and +contour (ours cont=3 everywhere vs ref 0/1/5/12) — contour bookkeeping is a +secondary suspect, but bytes+g0 is the load-bearing difference. + +## Table 3 — tail vs body + +- top-1% (479 frames) carry 100.00% of Σef2 **both sides** (ef² is squared + twice before summing — the metric is tail-dominated by construction). +- de-tailed (worst 50 frames dropped per side): err ours=5.624 ref=0.812 → + **ratio 6.93** (was 11.39). Bursts alone explain roughly half the log-scale gap. +- burst signature: packets with gains[0]≥60: **24/6000**, mean ef2 2.27e25 + (vs 1.15e22 for the rest, ≈2000×); packets ≤20 bytes: **141/6000**, mean + ef2 3.86e24 (vs 1.18e22, ≈330×). +- [INFERENCE] If the ≤20 B starvation were eliminated (bursts → body quality): + ours' err ≈ 5.624 vs unclipped ref 2.407 → **ratio ≈ 2.3**, a −80% drop — + far past the gate KEEP threshold (−20%). + +## Fix decision + +**No encoder change this round.** The table names the mechanism but does not +identify a ≤10-line port: the candidate libopus logic (voiced-frame minimum-bit +floor / constrained-VBR reservoir clamp in silk VBR bit assignment) is not +present locally (only opus headers installed) and porting rate-control from +memory is off-limits. r3 pointer: fetch libopus `silk/VBR.c` + +`encode_frame` bit assignment, find the per-frame min/clamp, port behind +`const ON`, gate, SIGN RULE. Expected effect per the inference above. + +## Verification + +- `cargo check -p ec-opus --tests` — clean. +- `silk_spectral_divergence_12k` (release, --ignored): ok, 29.5 s, wrote + `lanes/opus-silkq-r2.bands.txt` (75 lines). +- `cargo test -p ec-opus --release`: **34 + 27 passed, 0 failed** (13 ignored + diagnostics, incl. the new one).