forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to lanes/opus-opus64-r2.frames.txtClear filter

2026-09-06

perf(opus): two-pass coarse energy ships off; err_ratio at 64k is an outlier-window statisticAhmet Kaan Gümüş · 48b35d9
perf(opus): two-pass coarse energy ships off; err_ratio at 64k is an outlier-window statistic

The 64k err_ratio gap is not band-energy fidelity. On every source whose
ratio is above 1 the per-band mean log-energy error is LOWER than libopus's
in nearly every one of the 15 compare bands; the ratio is carried by a
handful of 40 ms windows, which opus_compare raises to the 4th power twice.
The diagnostic now recomputes both sides' err with the worst k windows
dropped (same denominator):

  source     drop-0   drop-1   drop-8   drop-1%
  reell@64      2.697    1.025    0.992    0.918
  her@64      1.103    0.995    0.962    0.955
  reelo@64     1.510    1.563    1.217    1.036
  nik@64      0.708    0.843    0.959    0.939
  dl8a@64     0.552    0.540    0.586    0.957
  hein@64     0.853    0.634    0.491    0.864

reell and her are ONE window each (a silence -> attack transition where our
decode is orders of magnitude quieter than the source's -110 dBFS ramp while
libopus tracks it); reelo is the only source with a distributed gap, and its
worst windows are all transient frames.

The mechanism ported whole meanwhile is libopus's two-pass coarse energy
(quant_coarse_energy + quant_coarse_energy_impl badness, enc_start_state
rewind): it codes both the intra and the inter-predicted pass and keeps the
lower-badness one. Gated on the 12-row library gate it moved 6 rows better
and 4 worse (reelo@64 1.510->1.581, her@64 1.102->1.135, her@96 1.052->1.059,
nik@96 .982->.990 against dl8a .551/.374->.503/.346, hein .855/.528->
.771/.419, reelo@96 .940->.872, nik@64 .708->.703), corr within +.0001
everywhere, so under the KEEP rule (err_ratio not worse on any row) it ships
behind TWO_PASS_COARSE_ENERGY = false with the numbers at the decision site.

- range: EncSnapshot save/restore of the coder scalars plus the front bytes,
  so a trial pass can be rewound exactly.
- conformance: the spectral divergence diagnostic gains reelo/nik sources, a
  SWEEP_TAG output name and the drop-k err recomputation; the hop-energy
  instrument gains HOP_KBPS.