diff --git a/crates/ec-opus/src/celt_enc.rs b/crates/ec-opus/src/celt_enc.rs index db36d63f..3216bb7c 100644 --- a/crates/ec-opus/src/celt_enc.rs +++ b/crates/ec-opus/src/celt_enc.rs @@ -32,7 +32,7 @@ use ec_core::{Error, Result}; -use crate::analysis::{AnalysisInfo, TonalityAnalysis}; +use crate::analysis::AnalysisInfo; use crate::celt::{ self, BETA_COEF, BETA_INTRA, BITRES, CACHE_CAPS, E_BANDS, E_MEANS, E_PROB_MODEL, LOG_N, MAX_FINE_BITS, NB_BANDS, OVERLAP, PRED_COEF, PREEMPH, QTHETA_OFFSET, QTHETA_OFFSET_TWOPHASE, @@ -68,7 +68,9 @@ fn tf_boost_params() -> (f32, f32, bool, f32) { /// `EC_OPUS_TRIM_TONAL` (`alloc_trim`'s `tonality_slope` term), /// `EC_OPUS_TRIM13` (the continuous 1.3 trim the term belongs to), /// `EC_OPUS_VBR_TONAL` (`compute_vbr`'s tonality boost) and -/// `EC_OPUS_VBR_ACT` (`compute_vbr`'s low-activity cut). +/// `EC_OPUS_VBR_ACT` (`compute_vbr`'s low-activity cut), +/// `EC_OPUS_LEAK` (`dynalloc_analysis`'s per-band leakage boost) and +/// `EC_OPUS_BW_DETECT` (the detected bandwidth lowering the coded one). /// /// MEASURED (lane opustonal, four detached 12-row library-gate runs against /// the shipped rows `lanes/opus-opustr2-r1.sweep.txt`). The analysis itself is @@ -81,6 +83,9 @@ fn tf_boost_params() -> (f32, f32, bool, f32) { /// | 1.3 trim + tonality term (`-r1`) | nik@64 .708→.647, reelo@64 1.510→1.071, reelo@96 .940→.898, reell@96 4.499→2.458, dl8a .552/.374→.512/.336 | nik@96 .985→1.006, her@64 1.103→1.109, her@96 1.051→1.085, reell@64 2.697→2.872 | /// | vbr tonality + activity (`-r2`) | hein@64 .853→.327, hein@96 .528→.426, nik@64 →.672, dl8a@64 →.541 | nik@96 →1.061, reelo@96 →1.165, her@64 →1.104, her@96 →1.060, dl8a@96 →.414 | /// | vbr activity alone (`-r3`) | hein@64 →.430, hein@96 →.408, nik@64 →.657, dl8a@64 →.511 | nik@96 →.990, her@64 →1.104, her@96 →1.071, dl8a@96 →.382 | +/// | `EC_OPUS_BW_DETECT` (`opusmode -r1`) | -- | -- (byte-identical: `analysis.bandwidth` is 20 on every valid frame of every gate source, so the clamp never fires) | +/// | `EC_OPUS_LEAK` (`opusmode -r2`) | -- | nik@64 .708→.709, nik@96 .985→.986, her@96 1.051→1.052 (the rest identical) | +/// | `EC_OPUS_BW_DETECT` + `EC_OPUS_VBR_ACT` + `EC_OPUS_TF_K=1.25` (`opusmode -r3`) | reell@96 4.499→2.516, reell@64 2.697→1.440, hein@64 .853→.470, hein@96 .528→.404, dl8a@96 .374→.315, dl8a@64 →.535, nik@64 →.651, **nik@96 .985→.957**, reelo@96 →.928, reelo@64 →1.509 | her@96 1.051→1.071, her@64 1.103→1.104 | /// | all four + `EC_OPUS_ALIGN=1` (`-r4`) | reell@64 →1.865, reell@96 →3.986, reelo@64 →1.123, reelo@96 →.891, her@64 →.952 | nik@64 →1.014, nik@96 →1.842, her@96 →1.217, dl8a →1.162/.988, hein →.971/1.514 | /// /// `corr_ours` is never worse by more than .0005 on any unaligned arm (it is @@ -91,21 +96,32 @@ fn tf_boost_params() -> (f32, f32, bool, f32) { /// discrete-ladder arm was run. The activity cut is the nearest miss ever /// measured on this gate for a speech source (hein halves) and is blocked by /// her@96 +.020 and nik@96 +.005 -- the same two rows that have blocked the -/// tf boost. Aligned, the analysis moves reell/reelo/her@64 a long way but leaves +/// The combined arm (`opusmode -r3`) is the first arm ever measured on this +/// gate that moves a blocking row the right way: nik@96 .985→.957. It is +/// **rejected by the per-row KEEP rule** (her@96 +.020, her@64 +.001) and +/// **passes the aggregate rule** (geometric-mean err_ratio 1.0218→0.8378, +/// -18.0%; worst row her@96 +1.9%, under the 5% bound; `corr_ours` within +/// .0001 on every row). Which rule ships is the user's call; the default is +/// off either way. Aligned, the analysis moves reell/reelo/her@64 a long way but leaves /// the aligned blocking set (nik, her@96, dl8a, hein) exactly where the /// analysis-free aligned arms left it, so the alignment default stays off. -fn analysis_params() -> (bool, bool, bool, bool) { - static P: std::sync::OnceLock<(bool, bool, bool, bool)> = std::sync::OnceLock::new(); +pub(crate) fn analysis_params() -> (bool, bool, bool, bool, bool, bool) { + static P: std::sync::OnceLock<(bool, bool, bool, bool, bool, bool)> = std::sync::OnceLock::new(); *P.get_or_init(|| { let b = |name: &str, dflt: bool| { std::env::var(name).map(|v| v != "0").unwrap_or(dflt) }; - ( - b("EC_OPUS_ANALYSIS", true), - b("EC_OPUS_TRIM_TONAL", false), - b("EC_OPUS_VBR_TONAL", false), - b("EC_OPUS_VBR_ACT", false), - ) + let trim = b("EC_OPUS_TRIM_TONAL", false); + let vbr_tonal = b("EC_OPUS_VBR_TONAL", false); + let vbr_act = b("EC_OPUS_VBR_ACT", false); + // The analysis costs ~25% of the encoder (5.1 384k: 126x -> 100x + // realtime), so it only runs when something reads it: any consumer + // switch, an explicit `EC_OPUS_ANALYSIS=1`, or + // `Encoder::set_analysis(true)` for the diagnostics. + let leak = b("EC_OPUS_LEAK", false); + let bw = b("EC_OPUS_BW_DETECT", false); + let any = trim || vbr_tonal || vbr_act || leak || bw; + (b("EC_OPUS_ANALYSIS", any), trim, vbr_tonal, vbr_act, leak, bw) }) } @@ -516,12 +532,10 @@ pub struct CeltEncoder { urow: Vec, /// Per-frame diagnostics captured at the end of the last `encode` call. last_diag: CeltFrameDiag, - /// libopus `st->analysis`: the tonality/music-probability estimator, run - /// on the *undelayed* API input at the top of every `encode` call exactly - /// where `opus_encode()` runs `run_analysis()`. - analysis: TonalityAnalysis, - /// The window that covers the frame being coded, or the default - /// (`valid == false`) state when the analysis is off. + /// libopus `st->analysis`'s per-frame output, handed in by + /// [`crate::Encoder`] (which owns the estimator and runs it once per API + /// frame, libopus's order); the `valid == false` default when the + /// analysis is off. info: AnalysisInfo, } @@ -580,7 +594,6 @@ impl CeltEncoder { pvq_sign: vec![0; max_n], urow: vec![0; 1280], last_diag: CeltFrameDiag::default(), - analysis: TonalityAnalysis::new((48000 / upsample) as u32), info: AnalysisInfo::default(), } } @@ -624,7 +637,6 @@ impl CeltEncoder { self.vbr_count = 0; self.stereo_saving = 0.0; self.spec_avg = 0.0; - self.analysis.reset(); self.info = AnalysisInfo::default(); } @@ -638,7 +650,7 @@ impl CeltEncoder { /// postfilter bit, allocation over the coded span only. With /// `vbr_rate_bps` set, the frame may be shrunk below that budget /// (constrained VBR); the return value is the final frame size in bytes. - pub fn encode( + pub(crate) fn encode( &mut self, enc: &mut RangeEncoder, pcm: &[f32], @@ -646,6 +658,7 @@ impl CeltEncoder { start: usize, end: usize, vbr_rate_bps: u32, + info: &AnalysisInfo, ) -> Result { let lm: usize = match frame_size { 120 => 0, @@ -672,14 +685,9 @@ impl CeltEncoder { let end = end.clamp(start + 1, NB_BANDS); // libopus `opus_encode_native` runs the tonality analysis on the raw - // API frame before anything else; the CELT layer's own delay does not - // apply to it, so this reads `pcm` and not the delayed buffer. 24 is - // libopus's `lsb_depth` default for the float API. - self.info = if analysis_params().0 { - self.analysis.run(pcm, in_n, c, 24) - } else { - AnalysisInfo::default() - }; + // API frame before the mode decision, so the estimator lives in + // `Encoder` and its result is handed down here. + self.info = *info; let mut nb_compressed = enc.storage(); let mut nb_available = nb_compressed as i32; @@ -1031,7 +1039,7 @@ impl CeltEncoder { let base_target = vbr_rate + (self.vbr_offset >> lm_diff) - ((40 * c as i32 + 20) << BITRES); let mut target = base_target; - let (_, _, vbr_tonal, vbr_act) = analysis_params(); + let (_, _, vbr_tonal, vbr_act, _, _) = analysis_params(); // compute_vbr (libopus celt_encoder.c:1605-1716), float-mode. // Skipped: activity, tonality, surround_mask (analysis->valid= // false, has_surround_mask=0, pitch_change=0, lfe=0). The qext @@ -1553,6 +1561,13 @@ impl CeltEncoder { follower[i] *= 0.5; } } + // libopus `celt_encoder.c:1226-1230`: the analysis's per-band + // leakage boost, in 1/64 dB units, on top of the follower. + if analysis_params().4 && self.info.valid { + for i in start..crate::analysis::LEAK_BANDS.min(end) { + follower[i] += f32::from(self.info.leak_boost[i]) / 64.0; + } + } let mut tot_boost = 0i32; for i in start..end { let f = follower[i].min(4.0); diff --git a/crates/ec-opus/src/encoder.rs b/crates/ec-opus/src/encoder.rs index 3530f5d7..e6a9193b 100644 --- a/crates/ec-opus/src/encoder.rs +++ b/crates/ec-opus/src/encoder.rs @@ -21,6 +21,7 @@ use ec_core::{Error, Result}; +use crate::analysis::{AnalysisInfo, TonalityAnalysis}; use crate::celt_enc::CeltEncoder; use crate::packet::{Bandwidth, Mode}; use crate::range::RangeEncoder; @@ -120,6 +121,17 @@ pub struct Encoder { hp_mem: [f32; 2], /// Scratch space for that filter's output, sized once. hp_buf: Vec, + /// libopus `st->analysis`: the tonality/music-probability estimator. It + /// lives here, not in the CELT layer, because `opus_encode_native` runs + /// `run_analysis()` on the API frame *before* the SILK/CELT mode and + /// bandwidth decisions, so its state advances on SILK frames too. + analysis: TonalityAnalysis, + /// The current frame's analysis output, handed to `celt.encode`. + info: AnalysisInfo, + /// Whether the analysis runs at all — see `celt_enc::analysis_params`. + analysis_on: bool, + /// Whether the detected bandwidth may lower the coded one (`EC_OPUS_BW_DETECT`). + bw_detect: bool, } /// SILK's internal sample rate (kHz) for a target bandwidth: Narrow → 8, @@ -182,6 +194,10 @@ impl Encoder { align_input: false, hp_mem: [0.0; 2], hp_buf: Vec::new(), + analysis: TonalityAnalysis::new(sample_rate), + info: AnalysisInfo::default(), + analysis_on: crate::celt_enc::analysis_params().0, + bw_detect: crate::celt_enc::analysis_params().5, }; // `EC_OPUS_ALIGN=1` turns the alignment on for a whole process — how // the gate rows at `set_libopus_input_alignment` were produced. @@ -191,6 +207,15 @@ impl Encoder { Ok(enc) } + /// Turns the tonality analysis on or off for this encoder. It is off + /// unless one of its consumers is switched on (see + /// `celt_enc::analysis_params`), because it costs ~25% of the encoder; + /// turn it on to read `music_prob`/`tonality` back through + /// [`Encoder::last_celt_diag`]. + pub fn set_analysis(&mut self, on: bool) { + self.analysis_on = on; + } + /// Overrides the automatic SILK/Hybrid/CELT choice `wants_silk` and /// `hybrid_choice` make from the application and bitrate; pass `None` to /// restore the automatic pick. Requests this encoder cannot honour @@ -361,6 +386,8 @@ impl Encoder { self.silk_delay.clear(); self.hp_mem = [0.0; 2]; self.final_range = 0; + self.analysis.reset(); + self.info = AnalysisInfo::default(); } /// Whether the application/bitrate (or an explicit [`Encoder::set_mode`]) @@ -591,6 +618,15 @@ impl Encoder { cap: usize, ) -> Result<(u8, &[u8])> { let frame_48k = frame_size * self.upsample; + // libopus `opus_encode_native`: `run_analysis()` runs on the API frame + // before the mode/bandwidth decisions, so the estimator state advances + // on every frame, SILK ones included. 24 is libopus's float-API + // `lsb_depth` default. + self.info = if self.analysis_on { + self.analysis.run(pcm, frame_size, self.channels, 24) + } else { + AnalysisInfo::default() + }; if let Some(fs_khz) = self.silk_choice(frame_48k) { if self.channels == 2 { Self::zero_stuff_stereo(pcm, frame_size, self.upsample, &mut self.silk_stuff); @@ -766,7 +802,47 @@ impl Encoder { 12000 => Bandwidth::Medium, _ => Bandwidth::Narrow, }; - BWS[idx].min(ceiling) + let bw = BWS[idx].min(ceiling); + match self.detected_bandwidth(equiv, !self.auto_silk(equiv, ve)) { + Some(d) => bw.min(d), + None => bw, + } + } + + /// libopus `opus_encoder.c:1278-1305`: the tonality analysis's own + /// bandwidth estimate as an Opus bandwidth, raised by the conservative + /// floor of `opus_encoder.c:1652-1674` (which depends on `equiv_rate` per + /// channel and on whether the frame is CELT-only) before it is allowed to + /// lower the coded bandwidth. `None` when the analysis did not run, which + /// is libopus's `st->detected_bandwidth == 0`. + /// + /// Only the caller's automatic path consults this — libopus guards the + /// clamp with `st->user_bandwidth == OPUS_AUTO`, which is exactly the + /// `self.bandwidth.is_none()` branch that reaches `auto_bandwidth_at`. + fn detected_bandwidth(&self, equiv: i32, celt_only: bool) -> Option { + if !self.bw_detect || !self.info.valid { + return None; + } + let detected = match self.info.bandwidth { + i32::MIN..=12 => Bandwidth::Narrow, + 13..=14 => Bandwidth::Medium, + 15..=16 => Bandwidth::Wide, + 17..=18 => Bandwidth::SuperWide, + _ => Bandwidth::Full, + }; + let ch = self.channels as i32; + let floor = if celt_only && equiv <= 18000 * ch { + Bandwidth::Narrow + } else if celt_only && equiv <= 24000 * ch { + Bandwidth::Medium + } else if equiv <= 30000 * ch { + Bandwidth::Wide + } else if equiv <= 44000 * ch { + Bandwidth::SuperWide + } else { + Bandwidth::Full + }; + Some(detected.max(floor)) } /// libopus `opus_encoder.c`'s `dc_reject(pcm, 3, ...)`: a 3 Hz one-pole @@ -947,6 +1023,7 @@ impl Encoder { 17, bandwidth.celt_end_band(), 0, + &self.info, )?; self.final_range = self.range.range(); let payload = &self.range.data()[..n]; @@ -989,9 +1066,9 @@ impl Encoder { (b.saturating_sub(1).clamp(2, cap), 0) }; self.range.reset(budget); - let n = self - .celt - .encode(&mut self.range, pcm, frame_size, 0, end, vbr_rate)?; + let n = + self.celt + .encode(&mut self.range, pcm, frame_size, 0, end, vbr_rate, &self.info)?; self.final_range = self.range.range(); Ok(n) } @@ -1001,6 +1078,36 @@ impl Encoder { mod tests { use super::*; + /// The detected-bandwidth clamp (`opus_encoder.c:1652-1674`): a band-limited + /// analysis result lowers the coded bandwidth, but never below the + /// rate-dependent floor, and never when the analysis did not run. + #[test] + fn detected_bandwidth_lowers_the_coded_bandwidth_but_not_below_its_floor() { + let mut e = Encoder::new(48000, 2, Application::Audio).unwrap(); + e.set_vbr_constrained(true); // the library gate's setting + e.set_bitrate(64_000); + // Analysis off (the default): fullband, whatever the estimate says. + e.info.valid = true; + e.info.bandwidth = 15; // wideband + assert_eq!(e.auto_bandwidth(), Bandwidth::Full); + // On: 64 kbps stereo is under 44000*2, so the floor is superwide — + // a wideband estimate is raised to it, not honoured as wideband. + e.bw_detect = true; + assert_eq!(e.auto_bandwidth(), Bandwidth::SuperWide); + // Above the floor the estimate passes through unchanged. + e.info.bandwidth = 20; + assert_eq!(e.auto_bandwidth(), Bandwidth::Full); + // 96 kbps stereo is above 44000*2: the floor is fullband, so the + // clamp is inert there — which is why it cannot move the @96 rows. + e.info.bandwidth = 15; + e.set_bitrate(96_000); + assert_eq!(e.auto_bandwidth(), Bandwidth::Full); + // An invalid analysis is libopus's `detected_bandwidth == 0`. + e.set_bitrate(64_000); + e.info.valid = false; + assert_eq!(e.auto_bandwidth(), Bandwidth::Full); + } + /// The private half of the bandwidth decision: the thresholds themselves, /// which the TOC config only reports. #[test] diff --git a/crates/ec-opus/tests/conformance.rs b/crates/ec-opus/tests/conformance.rs index 87c804eb..6437aa9c 100644 --- a/crates/ec-opus/tests/conformance.rs +++ b/crates/ec-opus/tests/conformance.rs @@ -5757,10 +5757,17 @@ fn analysis_music_prob_separates_speech_from_music() { let mut enc = Encoder::new(48000, CHANNELS, Application::Audio).expect("encoder"); enc.set_bitrate(96_000); enc.set_vbr_constrained(true); + // The analysis is off unless a consumer needs it (it costs ~25% of the + // encoder); the diagnostics are exactly the "explicitly asked for it" + // case. + enc.set_analysis(true); let mut out = vec![0u8; 4000]; let mut sum = [0.0f64; 4]; let mut n = 0usize; let mut valid = 0usize; + // Histogram of the detected bandwidth index, which drives + // `opus_encoder.c`'s `detected_bandwidth` clamp. + let mut bw_hist = [0u32; 21]; for chunk in pcm.chunks_exact(FRAME * CHANNELS) { enc.encode_float(chunk, FRAME, &mut out).expect("encode"); let d = enc.last_celt_diag(); @@ -5771,9 +5778,17 @@ fn analysis_music_prob_separates_speech_from_music() { sum[1] += f64::from(d.tonality); sum[2] += f64::from(d.tonality_slope); sum[3] += f64::from(d.activity); + bw_hist[(d.analysis_bandwidth.clamp(0, 20)) as usize] += 1; } } assert!(valid * 10 > n * 9, "{tag}: analysis valid on only {valid}/{n} frames"); + let bw: Vec = bw_hist + .iter() + .enumerate() + .filter(|&(_, &c)| c > 0) + .map(|(i, c)| format!("{i}:{c}")) + .collect(); + println!("analysis {tag}: bandwidth histogram {}", bw.join(" ")); let m = sum.map(|v| v / valid as f64); println!( "analysis {tag}: music {:.3} tonality {:.3} slope {:.4} activity {:.3} over {valid}/{n} frames (music={is_music})", diff --git a/lanes/opus-opusmode-r1.sweep.txt b/lanes/opus-opusmode-r1.sweep.txt new file mode 100644 index 00000000..752325d4 --- /dev/null +++ b/lanes/opus-opusmode-r1.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusmode r1: EC_OPUS_BW_DETECT=1 (detected-bandwidth clamp) -- byte-identical to shipped +# ec-opus encoder vs ffmpeg libopus — encoders-only gate (r1) +# both bitstreams decoded by ec-opus; 120s cap; VBR; 48kHz stereo +# source kbps ours_kbps ref_kbps rate% corr_ours corr_ref gap Q_ours Q_ref err_ratio minsec_ours minsec_ref drop_ours drop_ref +nik 64 69.1 69.2 -0.1 0.9887 0.9864 -0.0024 -95.23 -154.78 0.708 0.9766 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9947 0.9940 -0.0007 -29.86 -31.55 0.985 0.9889 0.9888 0 0 +reelo 64 63.6 63.6 -0.0 0.9893 0.9866 -0.0027 -202.82 -123.36 1.510 0.9702 0.9686 0 0 +reelo 96 93.4 93.9 -0.5 0.9947 0.9937 -0.0009 -114.74 -125.18 0.940 0.9862 0.9854 0 0 +her 64 67.7 67.9 -0.4 0.9834 0.9794 -0.0040 -365.72 -339.00 1.103 0.9477 0.9406 0 0 +her 96 101.0 101.5 -0.5 0.9914 0.9902 -0.0012 -202.07 -191.50 1.051 0.9728 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9908 0.9880 -0.0029 -351.70 -128.39 2.697 0.9721 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9956 0.9948 -0.0008 -301.83 -29.16 4.499 0.9856 0.9804 0 0 +dl8a 64 65.7 65.8 -0.1 0.9889 0.9865 -0.0025 -227.54 -378.84 0.552 0.9787 0.9723 0 0 +dl8a 96 96.5 96.8 -0.3 0.9942 0.9934 -0.0009 -177.70 -423.47 0.374 0.9881 0.9864 0 0 +hein 64 64.8 64.9 -0.2 0.9888 0.9874 -0.0014 -344.06 -388.31 0.853 0.9318 0.9148 0 0 +hein 96 86.8 86.9 -0.2 0.9946 0.9930 -0.0016 -117.91 -246.46 0.528 0.9689 0.9499 0 0 diff --git a/lanes/opus-opusmode-r2.sweep.txt b/lanes/opus-opusmode-r2.sweep.txt new file mode 100644 index 00000000..a2576bcd --- /dev/null +++ b/lanes/opus-opusmode-r2.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusmode r2: EC_OPUS_LEAK=1 (dynalloc leak_boost) +# ec-opus encoder vs ffmpeg libopus — encoders-only gate (r1) +# both bitstreams decoded by ec-opus; 120s cap; VBR; 48kHz stereo +# source kbps ours_kbps ref_kbps rate% corr_ours corr_ref gap Q_ours Q_ref err_ratio minsec_ours minsec_ref drop_ours drop_ref +nik 64 69.1 69.2 -0.1 0.9888 0.9864 -0.0024 -95.46 -154.78 0.709 0.9767 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9947 0.9940 -0.0007 -29.96 -31.55 0.986 0.9888 0.9888 0 0 +reelo 64 63.6 63.6 -0.0 0.9893 0.9866 -0.0027 -202.82 -123.36 1.510 0.9702 0.9686 0 0 +reelo 96 93.4 93.9 -0.5 0.9947 0.9937 -0.0009 -114.74 -125.18 0.940 0.9862 0.9854 0 0 +her 64 67.7 67.9 -0.4 0.9834 0.9794 -0.0040 -365.79 -339.00 1.103 0.9475 0.9406 0 0 +her 96 101.0 101.5 -0.5 0.9914 0.9902 -0.0012 -202.14 -191.50 1.052 0.9728 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9908 0.9880 -0.0029 -351.70 -128.39 2.697 0.9721 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9956 0.9948 -0.0008 -301.83 -29.16 4.499 0.9856 0.9804 0 0 +dl8a 64 65.7 65.8 -0.1 0.9889 0.9865 -0.0025 -227.47 -378.84 0.552 0.9787 0.9723 0 0 +dl8a 96 96.6 96.8 -0.3 0.9942 0.9934 -0.0009 -177.70 -423.47 0.374 0.9881 0.9864 0 0 +hein 64 64.8 64.9 -0.2 0.9888 0.9874 -0.0014 -344.06 -388.31 0.853 0.9318 0.9148 0 0 +hein 96 86.8 86.9 -0.2 0.9946 0.9930 -0.0016 -117.94 -246.46 0.528 0.9689 0.9499 0 0 diff --git a/lanes/opus-opusmode-r3.sweep.txt b/lanes/opus-opusmode-r3.sweep.txt new file mode 100644 index 00000000..41e0d45a --- /dev/null +++ b/lanes/opus-opusmode-r3.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusmode r3: EC_OPUS_BW_DETECT=1 EC_OPUS_VBR_ACT=1 EC_OPUS_TF_K=1.25 (combined arm) +# ec-opus encoder vs ffmpeg libopus — encoders-only gate (r1) +# both bitstreams decoded by ec-opus; 120s cap; VBR; 48kHz stereo +# source kbps ours_kbps ref_kbps rate% corr_ours corr_ref gap Q_ours Q_ref err_ratio minsec_ours minsec_ref drop_ours drop_ref +nik 64 69.1 69.2 -0.1 0.9887 0.9864 -0.0024 -82.60 -154.78 0.651 0.9767 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9947 0.9940 -0.0007 -26.70 -31.55 0.957 0.9887 0.9888 0 0 +reelo 64 63.5 63.6 -0.1 0.9893 0.9866 -0.0027 -202.81 -123.36 1.509 0.9699 0.9686 0 0 +reelo 96 93.3 93.9 -0.6 0.9946 0.9937 -0.0008 -112.55 -125.18 0.928 0.9861 0.9854 0 0 +her 64 67.6 67.9 -0.5 0.9833 0.9794 -0.0039 -366.09 -339.00 1.104 0.9472 0.9406 0 0 +her 96 100.8 101.5 -0.7 0.9913 0.9902 -0.0011 -205.98 -191.50 1.071 0.9725 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9908 0.9880 -0.0028 -198.89 -128.39 1.440 0.9719 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9956 0.9948 -0.0008 -169.83 -29.16 2.516 0.9854 0.9804 0 0 +dl8a 64 65.7 65.8 -0.2 0.9889 0.9865 -0.0024 -220.65 -378.84 0.535 0.9790 0.9723 0 0 +dl8a 96 96.5 96.8 -0.3 0.9942 0.9934 -0.0008 -144.24 -423.47 0.315 0.9879 0.9864 0 0 +hein 64 64.6 64.9 -0.5 0.9888 0.9874 -0.0015 -199.94 -388.31 0.470 0.9299 0.9148 0 0 +hein 96 86.5 86.9 -0.5 0.9946 0.9930 -0.0015 -76.33 -246.46 0.404 0.9678 0.9499 0 0