diff --git a/crates/ec-opus/src/celt_enc.rs b/crates/ec-opus/src/celt_enc.rs index a314f8a1..23919409 100644 --- a/crates/ec-opus/src/celt_enc.rs +++ b/crates/ec-opus/src/celt_enc.rs @@ -391,6 +391,9 @@ pub struct CeltEncoder { /// so its analysis window sits 4 ms behind the API frame. Interleaved, /// `CELT_DELAY_48K / upsample` samples per channel. delay_buf: Vec, + /// Whether that delay is applied at all — see + /// [`crate::Encoder::set_libopus_input_alignment`] for why it ships off. + align_input: bool, preemph_mem: [f32; 2], /// Coarse-energy prediction state, `2 * NB_BANDS`. old_band_e: Vec, @@ -460,6 +463,7 @@ impl CeltEncoder { plans: (0..4).map(|lm| MdctPlan::new(SHORT_MDCT << lm)).collect(), in_mem: vec![0.0; channels * OVERLAP], delay_buf: vec![0.0; channels * CELT_DELAY_48K], + align_input: false, preemph_mem: [0.0; 2], old_band_e: vec![0.0; 2 * NB_BANDS], delayed_intra: 1.0, @@ -516,6 +520,13 @@ impl CeltEncoder { &self.last_diag } + /// Feeds the layer the input delayed by `CELT_DELAY_48K`, as libopus + /// does; see [`crate::Encoder::set_libopus_input_alignment`]. + pub fn set_align_input(&mut self, on: bool) { + self.align_input = on; + self.delay_buf.fill(0.0); + } + /// Drops all inter-frame state. pub fn reset(&mut self) { self.in_mem.fill(0.0); @@ -621,7 +632,7 @@ impl CeltEncoder { // `src(j)`: input sample `j` of the delayed stream libopus's CELT // layer sees -- the `d` samples held over from the previous call // first, then this frame's. - let d = CELT_DELAY_48K / up; + let d = if self.align_input { CELT_DELAY_48K / up } else { 0 }; let src = |j: usize| { if j < d { delay[j * c + ch] } else { pcm[(j - d) * c + ch] } }; @@ -652,8 +663,10 @@ impl CeltEncoder { self.in_mem[ch * OVERLAP..(ch + 1) * OVERLAP] .copy_from_slice(&self.in_buf[base + n..base + n + OVERLAP]); } - delay[..c * (CELT_DELAY_48K / self.upsample)] - .copy_from_slice(&next_delay[..c * (CELT_DELAY_48K / self.upsample)]); + if self.align_input { + delay[..c * (CELT_DELAY_48K / self.upsample)] + .copy_from_slice(&next_delay[..c * (CELT_DELAY_48K / self.upsample)]); + } self.delay_buf = delay; // --- Silence flag (first symbol of the frame) ----------------------- diff --git a/crates/ec-opus/src/encoder.rs b/crates/ec-opus/src/encoder.rs index cce43dbe..1b1d3c70 100644 --- a/crates/ec-opus/src/encoder.rs +++ b/crates/ec-opus/src/encoder.rs @@ -40,16 +40,12 @@ const MAX_SILK_PACKET_BYTES: usize = 1 + 1 + 2 * 2 + 3 * MAX_FRAME_BYTES; const SILK_LOOK_AHEAD_48K_NB: usize = 58; const SILK_LOOK_AHEAD_48K_MB: usize = 54; const SILK_LOOK_AHEAD_48K_WB: usize = 50; -/// The CELT layer's own delay: one MDCT overlap (120) plus libopus's -/// `delay_compensation = Fs/250` (`CELT_DELAY_48K`, 192 at 48 kHz), which the -/// CELT encoder applies to its input so its analysis window sits where -/// libopus's does. -const CELT_LOOK_AHEAD_48K: usize = 120 + 192; -/// How far the hybrid path delays the SILK layer's input so its output lines -/// up with the CELT layer's at the decoder (which sums them as-is): CELT's -/// delay minus SILK's WB round trip, click-measured through the -/// decoder with one layer muted (`hybrid_layers_align` in conformance.rs). -const HYBRID_SILK_DELAY_48K: usize = CELT_LOOK_AHEAD_48K - SILK_LOOK_AHEAD_48K_WB; +/// One MDCT overlap: the CELT layer's delay without libopus's input +/// alignment ([`Encoder::set_libopus_input_alignment`]), which adds +/// `delay_compensation = Fs/250` (192 at 48 kHz) on top. +const CELT_OVERLAP_48K: usize = 120; +/// libopus `opus_encoder.c`'s `delay_compensation = Fs/250`. +const CELT_DELAY_COMP_48K: usize = 192; /// Bytes the CELT layer of a hybrid packet always keeps, whatever SILK spent. /// Was 8: at 16 kbps SILK takes 37 of the 40-byte budget, so 8 expanded /// 5133/6001 packets (+12.9% rate on the speech gate); libopus leaves CELT @@ -111,11 +107,13 @@ pub struct Encoder { /// Scratch space for the SILK packet payload, sized once so the steady-state /// loop (`steady_state_encode_loop_zero_alloc`) doesn't allocate. silk_buf: [u8; MAX_SILK_PACKET_BYTES], - /// Hybrid: the last [`HYBRID_SILK_DELAY_48K`] samples of SILK-layer input. + /// Hybrid: the last [`Encoder::hybrid_silk_delay_48k`] samples of SILK-layer input. silk_delay: Vec, /// Scratch space for the zero-stuffed SILK/hybrid input, sized once so /// the steady-state loop doesn't allocate a `Vec` per frame. silk_stuff: Vec, + /// [`Encoder::set_libopus_input_alignment`]: off by default. + align_input: bool, /// libopus `opus_encoder.c`'s `hp_mem`: the one-pole state of the /// [`Encoder::dc_reject`] filter every frame of API input goes through, /// one per channel. @@ -181,6 +179,7 @@ impl Encoder { silk_buf: [0u8; MAX_SILK_PACKET_BYTES], silk_delay: Vec::new(), silk_stuff: Vec::new(), + align_input: false, hp_mem: [0.0; 2], hp_buf: Vec::new(), }) @@ -215,7 +214,7 @@ impl Encoder { /// on, so this always matches which layer actually codes the frame): /// [`SILK_LOOK_AHEAD_48K_NB`], [`SILK_LOOK_AHEAD_48K_MB`] or /// [`SILK_LOOK_AHEAD_48K_WB`]. Hybrid: CELT's 120, the SILK layer being - /// delayed to meet it ([`HYBRID_SILK_DELAY_48K`]). Any other frame size + /// delayed to meet it ([`Encoder::hybrid_silk_delay_48k`]). Any other frame size /// falls back to CELT here exactly as `encode_toc_and_payload` does. pub fn look_ahead(&self, frame_size: usize) -> usize { let frame_48k = frame_size * self.upsample; @@ -227,7 +226,56 @@ impl Encoder { }; return delay / self.upsample; } - CELT_LOOK_AHEAD_48K / self.upsample + self.celt_look_ahead_48k() / self.upsample + } + + /// The CELT layer's delay in 48 kHz samples: one MDCT overlap, plus + /// libopus's `delay_compensation` when the alignment is on. + fn celt_look_ahead_48k(&self) -> usize { + CELT_OVERLAP_48K + if self.align_input { CELT_DELAY_COMP_48K } else { 0 } + } + + /// How far the hybrid path delays the SILK layer's input so its output + /// lines up with the CELT layer's at the decoder (which sums them as-is): + /// CELT's delay minus SILK's WB round trip, click-measured through the + /// decoder with one layer muted (`hybrid_layers_align` in conformance.rs). + fn hybrid_silk_delay_48k(&self) -> usize { + self.celt_look_ahead_48k() - SILK_LOOK_AHEAD_48K_WB + } + + /// Puts our CELT analysis window exactly where libopus's is: the layer is + /// fed the input delayed by `delay_compensation = Fs/250` (192 samples at + /// 48 kHz, `opus_encoder.c` ~:1955) and every frame first goes through + /// libopus's 3 Hz `dc_reject`. The alignment is *exact* — on the reell + /// attack frame (frame 2, 20 ms, LM=3, transient) our first eight band + /// log-energies become + /// 3.4386 4.0055 3.2603 4.5954 1.1790 4.2774 4.7584 3.7169 against + /// libopus's 3.439 4.005 3.260 4.595 1.179 4.277 4.758 3.717, all eight + /// within .0006 (the unaligned encoder is .06-.21 apart). + /// + /// It ships OFF because the 12-row library gate rejects it, and because + /// re-tuning the constants that were fitted on the misaligned spectrum + /// does not rescue it. Against the shipped rows + /// (`lanes/opus-opustr2-r1.sweep.txt`), err_ratio: + /// + /// | arm | better | worse (blocking) | + /// |---|---|---| + /// | delay only (`opus-opusx-r1`) | 7 | nik@64 .708→.800, nik@96 .985→1.763, her@96 1.051→1.292, hein@64 .853→.980, hein@96 .528→1.602 | + /// | delay + `dc_reject` (`opus-opusx2-r1`) | 5 | those, plus dl8a@64 .552→1.074, dl8a@96 .374→1.011 | + /// | + two-pass coarse energy (`-r2`) | 5 | same 7 rows (nik@96 1.809, dl8a@64 1.200) | + /// | + continuous 1.3 `alloc_trim` (`-r3`) | 5 | same 7, and corr worse by >.0005 on 9 rows | + /// | + tf boost k=1.25 (`-r4`) | 5 | same 7 | + /// | + tf boost k=1.5 (`-r5`) | 5 | same 7 | + /// + /// The blocking set (nik, her@96, dl8a, hein) is the same in every arm and + /// no arm moves any of those rows back towards its shipped value, so the + /// misfit is not one of the swept constants. Turning this on also costs + /// 4 ms of algorithmic delay: [`Encoder::look_ahead`] for a CELT frame + /// becomes 312, not 120, and the Ogg pre-skip must follow it. + pub fn set_libopus_input_alignment(&mut self, on: bool) { + self.align_input = on; + self.celt.set_align_input(on); + self.hp_mem = [0.0; 2]; } /// Forces the coded bandwidth; [`None`] (the default) picks it from the @@ -711,7 +759,12 @@ impl Encoder { /// libopus takes the `hp_cutoff` branch instead for /// `OPUS_APPLICATION_VOIP` (a bandwidth-dependent second-order section); /// not ported — every VoIP frame still gets this DC reject. - fn dc_reject(&mut self, pcm: &[f32], frame_size: usize, out: &mut Vec) { + /// Ships off with the alignment knob: `dc_reject` alone (without the + /// input delay) has never been measured on the library gate. + fn dc_reject<'a>(&mut self, pcm: &'a [f32], frame_size: usize, out: &'a mut Vec) -> &'a [f32] { + if !self.align_input { + return pcm; + } let c = self.channels; let coef = 6.3 * 3.0 / self.sample_rate as f32; out.clear(); @@ -725,6 +778,7 @@ impl Encoder { } self.hp_mem[ch] = m; } + out } /// Encodes one frame — `frame_size` samples per channel of interleaved @@ -737,8 +791,8 @@ impl Encoder { out: &mut [u8], ) -> Result { let mut hp = std::mem::take(&mut self.hp_buf); - self.dc_reject(pcm, frame_size, &mut hp); - let r = match self.encode_toc_and_payload(&hp, frame_size, out.len().saturating_sub(1)) { + let input = self.dc_reject(pcm, frame_size, &mut hp); + let r = match self.encode_toc_and_payload(input, frame_size, out.len().saturating_sub(1)) { Err(e) => Err(e), Ok((toc, payload)) => { let n = payload.len(); @@ -775,8 +829,8 @@ impl Encoder { out: &mut [u8], ) -> Result { let mut hp = std::mem::take(&mut self.hp_buf); - self.dc_reject(pcm, frame_size, &mut hp); - let r = match self.encode_toc_and_payload(&hp, frame_size, out.len().saturating_sub(3)) { + let input = self.dc_reject(pcm, frame_size, &mut hp); + let r = match self.encode_toc_and_payload(input, frame_size, out.len().saturating_sub(3)) { Err(e) => Err(e), Ok((toc, payload)) => { let n = payload.len(); @@ -808,7 +862,7 @@ impl Encoder { /// One hybrid frame (10 or 20 ms, mono or stereo, `bandwidth` SWB or FB) /// into the internal range coder, returning its byte length: the SILK /// layer's symbols (WB, 16 kHz internal, fed the input delayed by - /// [`HYBRID_SILK_DELAY_48K`]), the no-redundancy flag under the decoder's + /// [`Encoder::hybrid_silk_delay_48k`]), the no-redundancy flag under the decoder's /// exact presence rule, then the CELT layer from band 17 in the same /// coder. CBR: the packet is the bitrate's size unless SILK alone needs /// more, in which case CELT keeps [`HYBRID_CELT_MIN_BYTES`] on top. @@ -834,7 +888,7 @@ impl Encoder { } else { Self::zero_stuff_mono(pcm, frame_size, self.upsample, &mut self.silk_stuff); } - let d = HYBRID_SILK_DELAY_48K * self.channels; + let d = self.hybrid_silk_delay_48k() * self.channels; if self.silk_delay.len() != d { self.silk_delay.clear(); self.silk_delay.resize(d, 0.0); @@ -953,7 +1007,7 @@ mod tests { let mut e = Encoder::new(24000, 2, Application::Audio).unwrap(); e.set_bitrate(256_000); assert_eq!(e.auto_bandwidth(), Bandwidth::SuperWide); - assert_eq!(e.look_ahead(960), CELT_LOOK_AHEAD_48K / 2); + assert_eq!(e.look_ahead(960), CELT_OVERLAP_48K / 2); } /// `look_ahead` must use the same 10-or-20 ms-frame predicate dispatch @@ -965,21 +1019,27 @@ mod tests { let mut e = Encoder::new(48000, 1, Application::Voip).unwrap(); e.set_bitrate(8000); assert_eq!(e.look_ahead(480), 58, "10ms NB SILK"); - assert_eq!(e.look_ahead(240), CELT_LOOK_AHEAD_48K, "5ms frame falls back to CELT"); + assert_eq!(e.look_ahead(240), CELT_OVERLAP_48K, "5ms frame falls back to CELT"); assert_eq!(e.look_ahead(960), 58, "20ms NB SILK"); // 16k VoIP is hybrid-FB since the libopus threshold port (CELT overlap). e.set_bitrate(16000); - assert_eq!(e.look_ahead(960), CELT_LOOK_AHEAD_48K, "20ms hybrid FB"); + assert_eq!(e.look_ahead(960), CELT_OVERLAP_48K, "20ms hybrid FB"); e.set_bitrate(32000); - assert_eq!(e.look_ahead(960), CELT_LOOK_AHEAD_48K, "20ms hybrid, CELT's delay"); + assert_eq!(e.look_ahead(960), CELT_OVERLAP_48K, "20ms hybrid, CELT's delay"); let mut e = Encoder::new(48000, 2, Application::Voip).unwrap(); e.set_bitrate(8000); assert_eq!(e.look_ahead(960), 58, "stereo 20ms NB SILK"); e.set_bitrate(64_000); - assert_eq!(e.look_ahead(960), CELT_LOOK_AHEAD_48K, "stereo 20ms hybrid"); + assert_eq!(e.look_ahead(960), CELT_OVERLAP_48K, "stereo 20ms hybrid"); + e.set_libopus_input_alignment(true); + assert_eq!( + e.look_ahead(960), + CELT_OVERLAP_48K + CELT_DELAY_COMP_48K, + "the alignment adds libopus's delay_compensation to the advertised delay" + ); } #[test] diff --git a/crates/ec-opus/tests/conformance.rs b/crates/ec-opus/tests/conformance.rs index 1f5c1942..27dc8956 100644 --- a/crates/ec-opus/tests/conformance.rs +++ b/crates/ec-opus/tests/conformance.rs @@ -907,6 +907,30 @@ fn encoder_roundtrips_at_every_rate() { } } +/// The libopus input alignment ([`Encoder::set_libopus_input_alignment`]): +/// with it on the CELT layer's advertised delay grows by libopus's +/// `delay_compensation`, and the decoded signal tracks the source at exactly +/// that lag and not at the old one — the knob is usable, not just present. +/// It ships off; the gate tables that rejected it are at the setter. +#[test] +fn libopus_input_alignment_delays_and_still_decodes() { + let pcm = test_signal(2, 1.0); + let mut enc = Encoder::new(48000, 2, Application::Audio).unwrap(); + enc.set_bitrate(128_000); + assert_eq!(enc.look_ahead(960), 120, "default: one MDCT overlap"); + enc.set_libopus_input_alignment(true); + assert_eq!(enc.look_ahead(960), 312, "overlap + delay_compensation"); + let (decoded, _) = roundtrip_own(&mut enc, &pcm, 2, 960); + let aligned = delayed_corr(&pcm, &decoded, 2, enc.look_ahead(960)); + let old = delayed_corr(&pcm, &decoded, 2, 120); + println!("aligned: corr at 312 {aligned:.4}, at 120 {old:.4}"); + assert!(aligned >= 0.85, "aligned round trip corr {aligned:.4}"); + assert!( + aligned > old, + "advertised delay 312 correlates {aligned:.4}, worse than the old 120 ({old:.4})" + ); +} + #[test] // Expectations are libopus 1.6's (opus_encoder.c mode_thresholds and the // voice/music bandwidth tables blended by voice_est) since lane opus-mode; diff --git a/lanes/opus-gate-r1.sweep.txt b/lanes/opus-gate-r1.sweep.txt index de2e38f0..46918f2a 100644 --- a/lanes/opus-gate-r1.sweep.txt +++ b/lanes/opus-gate-r1.sweep.txt @@ -1,15 +1,15 @@ # 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.0023 -114.88 -154.78 0.800 0.9769 0.9745 0 0 -nik 96 100.9 101.0 -0.1 0.9947 0.9940 -0.0007 -109.44 -31.55 1.763 0.9891 0.9888 0 0 -reelo 64 63.6 63.6 -0.0 0.9894 0.9866 -0.0028 -170.07 -123.36 1.287 0.9709 0.9686 0 0 -reelo 96 93.4 93.9 -0.5 0.9950 0.9937 -0.0013 -100.39 -125.18 0.861 0.9875 0.9854 0 0 -her 64 67.6 67.9 -0.4 0.9837 0.9794 -0.0042 -333.52 -339.00 0.980 0.9481 0.9406 0 0 -her 96 101.0 101.5 -0.5 0.9925 0.9902 -0.0022 -248.22 -191.50 1.292 0.9774 0.9728 0 0 -reell 64 71.3 71.3 -0.0 0.9908 0.9880 -0.0028 -263.61 -128.39 1.916 0.9717 0.9644 0 0 -reell 96 105.3 105.4 -0.0 0.9956 0.9948 -0.0008 -266.25 -29.16 3.900 0.9856 0.9804 0 0 -dl8a 64 65.7 65.8 -0.1 0.9890 0.9865 -0.0025 -204.82 -378.84 0.498 0.9789 0.9723 0 0 -dl8a 96 96.6 96.8 -0.3 0.9943 0.9934 -0.0009 -170.45 -423.47 0.361 0.9882 0.9864 0 0 -hein 64 64.8 64.9 -0.2 0.9888 0.9874 -0.0014 -382.47 -388.31 0.980 0.9345 0.9148 0 0 -hein 96 86.8 86.9 -0.2 0.9945 0.9930 -0.0015 -367.35 -246.46 1.602 0.9700 0.9499 0 0 +nik 64 69.1 69.2 -0.2 0.9883 0.9864 -0.0019 -155.70 -154.78 1.005 0.9765 0.9745 0 0 +nik 96 100.8 101.0 -0.2 0.9943 0.9940 -0.0003 -111.16 -31.55 1.781 0.9888 0.9888 0 0 +reelo 64 63.5 63.6 -0.2 0.9886 0.9866 -0.0020 -179.06 -123.36 1.347 0.9699 0.9686 0 0 +reelo 96 93.2 93.9 -0.7 0.9942 0.9937 -0.0004 -89.99 -125.18 0.805 0.9869 0.9854 0 0 +her 64 67.5 67.9 -0.7 0.9825 0.9794 -0.0030 -347.44 -339.00 1.032 0.9466 0.9406 0 0 +her 96 100.7 101.5 -0.8 0.9913 0.9902 -0.0011 -247.70 -191.50 1.289 0.9760 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9904 0.9880 -0.0024 -272.52 -128.39 1.987 0.9710 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9952 0.9948 -0.0004 -261.59 -29.16 3.825 0.9849 0.9804 0 0 +dl8a 64 65.5 65.8 -0.4 0.9883 0.9865 -0.0019 -394.10 -378.84 1.055 0.9784 0.9723 0 0 +dl8a 96 96.3 96.8 -0.5 0.9936 0.9934 -0.0002 -406.85 -423.47 0.945 0.9865 0.9864 0 0 +hein 64 64.6 64.9 -0.4 0.9876 0.9874 -0.0003 -374.22 -388.31 0.951 0.9258 0.9148 0 0 +hein 96 86.5 86.9 -0.4 0.9938 0.9930 -0.0007 -373.59 -246.46 1.638 0.9651 0.9499 0 0 diff --git a/lanes/opus-opusx2-r1.sweep.txt b/lanes/opus-opusx2-r1.sweep.txt new file mode 100644 index 00000000..71980025 --- /dev/null +++ b/lanes/opus-opusx2-r1.sweep.txt @@ -0,0 +1,17 @@ +# lane-opusx2 r1: CELT input delayed by Fs/250 + libopus dc_reject (3 Hz) on the API input +# baseline lanes/opus-opustr2-r1.sweep.txt (shipped); delay-only arm = lanes/opus-opusx-r1.sweep.txt +# 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.9883 0.9864 -0.0020 -116.02 -154.78 0.805 0.9766 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9944 0.9940 -0.0003 -111.04 -31.55 1.780 0.9888 0.9888 0 0 +reelo 64 63.6 63.6 -0.0 0.9887 0.9866 -0.0021 -172.14 -123.36 1.301 0.9708 0.9686 0 0 +reelo 96 93.4 93.9 -0.5 0.9943 0.9937 -0.0006 -101.22 -125.18 0.866 0.9875 0.9854 0 0 +her 64 67.6 67.9 -0.4 0.9828 0.9794 -0.0033 -333.52 -339.00 0.980 0.9474 0.9406 0 0 +her 96 101.0 101.5 -0.5 0.9916 0.9902 -0.0014 -248.38 -191.50 1.293 0.9770 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9904 0.9880 -0.0024 -264.15 -128.39 1.920 0.9714 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9952 0.9948 -0.0004 -271.16 -29.16 3.980 0.9853 0.9804 0 0 +dl8a 64 65.7 65.8 -0.1 0.9885 0.9865 -0.0020 -399.15 -378.84 1.074 0.9787 0.9723 0 0 +dl8a 96 96.6 96.8 -0.3 0.9938 0.9934 -0.0004 -426.78 -423.47 1.011 0.9876 0.9864 0 0 +hein 64 64.8 64.9 -0.2 0.9887 0.9874 -0.0013 -383.53 -388.31 0.983 0.9345 0.9148 0 0 +hein 96 86.8 86.9 -0.2 0.9944 0.9930 -0.0014 -351.66 -246.46 1.513 0.9701 0.9499 0 0 diff --git a/lanes/opus-opusx2-r2.sweep.txt b/lanes/opus-opusx2-r2.sweep.txt new file mode 100644 index 00000000..d7cd53ea --- /dev/null +++ b/lanes/opus-opusx2-r2.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusx2 r2: EC_OPUS_TWO_PASS=1 (libopus two-pass coarse energy) (on the aligned tree: Fs/250 delay + dc_reject) +# 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.9884 0.9864 -0.0020 -114.86 -154.78 0.799 0.9767 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9944 0.9940 -0.0003 -113.73 -31.55 1.809 0.9889 0.9888 0 0 +reelo 64 63.6 63.6 -0.0 0.9888 0.9866 -0.0021 -168.90 -123.36 1.280 0.9708 0.9686 0 0 +reelo 96 93.4 93.9 -0.5 0.9943 0.9937 -0.0006 -98.26 -125.18 0.850 0.9874 0.9854 0 0 +her 64 67.7 67.9 -0.4 0.9828 0.9794 -0.0034 -342.89 -339.00 1.015 0.9477 0.9406 0 0 +her 96 101.0 101.5 -0.5 0.9916 0.9902 -0.0014 -245.44 -191.50 1.277 0.9773 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9904 0.9880 -0.0024 -270.85 -128.39 1.974 0.9715 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9952 0.9948 -0.0004 -271.17 -29.16 3.980 0.9853 0.9804 0 0 +dl8a 64 65.7 65.8 -0.1 0.9885 0.9865 -0.0020 -431.62 -378.84 1.200 0.9784 0.9723 0 0 +dl8a 96 96.6 96.8 -0.3 0.9938 0.9934 -0.0004 -429.71 -423.47 1.021 0.9877 0.9864 0 0 +hein 64 64.8 64.9 -0.1 0.9889 0.9874 -0.0016 -398.79 -388.31 1.037 0.9355 0.9148 0 0 +hein 96 86.8 86.9 -0.2 0.9945 0.9930 -0.0015 -348.20 -246.46 1.494 0.9705 0.9499 0 0 diff --git a/lanes/opus-opusx2-r3.sweep.txt b/lanes/opus-opusx2-r3.sweep.txt new file mode 100644 index 00000000..1c024d68 --- /dev/null +++ b/lanes/opus-opusx2-r3.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusx2 r3: EC_OPUS_TRIM13=1 (continuous 1.3 alloc_trim) (on the aligned tree: Fs/250 delay + dc_reject) +# 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.9875 0.9864 -0.0011 -117.01 -154.78 0.810 0.9760 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9938 0.9940 +0.0003 -128.36 -31.55 1.971 0.9880 0.9888 0 0 +reelo 64 63.6 63.6 -0.0 0.9883 0.9866 -0.0017 -157.11 -123.36 1.204 0.9707 0.9686 0 0 +reelo 96 93.4 93.9 -0.5 0.9940 0.9937 -0.0002 -74.67 -125.18 0.726 0.9866 0.9854 0 0 +her 64 67.6 67.9 -0.4 0.9820 0.9794 -0.0026 -334.21 -339.00 0.982 0.9455 0.9406 0 0 +her 96 101.0 101.5 -0.5 0.9911 0.9902 -0.0008 -251.84 -191.50 1.312 0.9757 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9896 0.9880 -0.0016 -268.76 -128.39 1.957 0.9704 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9947 0.9948 +0.0001 -265.83 -29.16 3.893 0.9845 0.9804 0 0 +dl8a 64 65.7 65.8 -0.1 0.9874 0.9865 -0.0009 -387.57 -378.84 1.031 0.9762 0.9723 0 0 +dl8a 96 96.6 96.8 -0.3 0.9931 0.9934 +0.0003 -413.74 -423.47 0.967 0.9858 0.9864 0 0 +hein 64 64.8 64.9 -0.2 0.9886 0.9874 -0.0012 -383.53 -388.31 0.983 0.9345 0.9148 0 0 +hein 96 86.8 86.9 -0.2 0.9944 0.9930 -0.0014 -351.67 -246.46 1.513 0.9699 0.9499 0 0 diff --git a/lanes/opus-opusx2-r4.sweep.txt b/lanes/opus-opusx2-r4.sweep.txt new file mode 100644 index 00000000..df172db6 --- /dev/null +++ b/lanes/opus-opusx2-r4.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusx2 r4: EC_OPUS_TF_K=1.25 (CVBR tf boost) (on the aligned tree: Fs/250 delay + dc_reject) +# 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.9883 0.9864 -0.0020 -110.52 -154.78 0.779 0.9765 0.9745 0 0 +nik 96 100.9 101.0 -0.1 0.9943 0.9940 -0.0003 -111.87 -31.55 1.789 0.9888 0.9888 0 0 +reelo 64 63.5 63.6 -0.1 0.9887 0.9866 -0.0020 -180.92 -123.36 1.359 0.9704 0.9686 0 0 +reelo 96 93.3 93.9 -0.6 0.9942 0.9937 -0.0005 -90.05 -125.18 0.806 0.9870 0.9854 0 0 +her 64 67.5 67.9 -0.6 0.9826 0.9794 -0.0032 -311.93 -339.00 0.903 0.9471 0.9406 0 0 +her 96 100.7 101.5 -0.7 0.9914 0.9902 -0.0012 -230.30 -191.50 1.195 0.9765 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9904 0.9880 -0.0024 -269.89 -128.39 1.966 0.9712 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9952 0.9948 -0.0004 -263.44 -29.16 3.855 0.9852 0.9804 0 0 +dl8a 64 65.6 65.8 -0.2 0.9884 0.9865 -0.0020 -424.09 -378.84 1.170 0.9791 0.9723 0 0 +dl8a 96 96.4 96.8 -0.4 0.9937 0.9934 -0.0003 -434.84 -423.47 1.039 0.9872 0.9864 0 0 +hein 64 64.7 64.9 -0.3 0.9882 0.9874 -0.0008 -376.99 -388.31 0.961 0.9314 0.9148 0 0 +hein 96 86.7 86.9 -0.3 0.9941 0.9930 -0.0011 -363.54 -246.46 1.580 0.9677 0.9499 0 0 diff --git a/lanes/opus-opusx2-r5.sweep.txt b/lanes/opus-opusx2-r5.sweep.txt new file mode 100644 index 00000000..3d5a5fb1 --- /dev/null +++ b/lanes/opus-opusx2-r5.sweep.txt @@ -0,0 +1,16 @@ +# lane-opusx2 r5: EC_OPUS_TF_K=1.5 (CVBR tf boost) (on the aligned tree: Fs/250 delay + dc_reject) +# 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.2 0.9883 0.9864 -0.0019 -155.70 -154.78 1.005 0.9765 0.9745 0 0 +nik 96 100.8 101.0 -0.2 0.9943 0.9940 -0.0003 -111.16 -31.55 1.781 0.9888 0.9888 0 0 +reelo 64 63.5 63.6 -0.2 0.9886 0.9866 -0.0020 -179.06 -123.36 1.347 0.9699 0.9686 0 0 +reelo 96 93.2 93.9 -0.7 0.9942 0.9937 -0.0004 -89.99 -125.18 0.805 0.9869 0.9854 0 0 +her 64 67.5 67.9 -0.7 0.9825 0.9794 -0.0030 -347.44 -339.00 1.032 0.9466 0.9406 0 0 +her 96 100.7 101.5 -0.8 0.9913 0.9902 -0.0011 -247.70 -191.50 1.289 0.9760 0.9728 0 0 +reell 64 71.3 71.3 -0.0 0.9904 0.9880 -0.0024 -272.52 -128.39 1.987 0.9710 0.9644 0 0 +reell 96 105.3 105.4 -0.0 0.9952 0.9948 -0.0004 -261.59 -29.16 3.825 0.9849 0.9804 0 0 +dl8a 64 65.5 65.8 -0.4 0.9883 0.9865 -0.0019 -394.10 -378.84 1.055 0.9784 0.9723 0 0 +dl8a 96 96.3 96.8 -0.5 0.9936 0.9934 -0.0002 -406.85 -423.47 0.945 0.9865 0.9864 0 0 +hein 64 64.6 64.9 -0.4 0.9876 0.9874 -0.0003 -374.22 -388.31 0.951 0.9258 0.9148 0 0 +hein 96 86.5 86.9 -0.4 0.9938 0.9930 -0.0007 -373.59 -246.46 1.638 0.9651 0.9499 0 0