forge
Explore
Log in

Don't you dare go Hollow

Whole-file windowed corr mean was double-applying the alignment lag

Browse files at this commit

dd00c7cff2bb2ab8d73ef6cc7d8ffc0bae97d757Ahmet Kaan GümüşParent: 83c5aea
  • fix
    • whole-file windowed corr mean was double-applying the alignment lag
Show full message
fix(aac-sbr-test): whole-file windowed corr mean was double-applying the alignment lag

197cd44's cheap default path (no per-window search) added the global
`lag` on top of `oa`/`ob`, which already encode that same shift via
their differing base offsets -- every window ended up an extra `lag`
samples out of alignment. That collapsed reeln's reported
WHOLE-FILE windowed corr mean from ~0.95 to 0.14/0.21 while the
single-WINDOW full/low numbers (which don't go through this path)
stayed at 0.96-0.97, making it look like a real late-file collapse.
Corrected mean: ch0 0.953189, ch1 0.949116 -- in line with round 41's
0.9565/0.9512, decode itself never regressed. Round 48's feed-forward
FIR verdict is unaffected: it was based on `full`/`low`/QMF-witness
numbers, none of which go through this buggy path.
crates/ec-aac/tests/sbr_real_library.rsmodified+8 -1
@@ -2383,7 +2383,14 @@ fn sbr_real_library_matches_reference() {
23832383 } else {
23842384 (0..windows)
23852385 .filter_map(|w| {
2386- let base_o = (oa as i64 + lag + (w * 4_096) as i64).try_into().ok()?;
2386+ // `oa`/`ob` (computed above from `lag`) already encode the
2387+ // alignment shift via their differing base offsets -- do NOT
2388+ // add `lag` again here, that double-applies it and shifts
2389+ // every window an extra `lag` samples out of alignment
2390+ // (this collapsed the whole-file mean from ~0.96 to ~0.14
2391+ // while leaving the single-WINDOW `full`/`low` numbers,
2392+ // which don't go through this path, unaffected).
2393+ let base_o = oa + w * 4_096;
23872394 let base_t = ob + w * 4_096;
23882395 if base_o + 4_096 > o.len() || base_t + 4_096 > t.len() {
23892396 return None;