Split core-decode-wrong from SBR-scrambles-good-core in synthetic_heaac_matrix
Browse files at this commit5f5079875d0d46a1d89a4f63df4fb8a1b52be3ccParent: 93d654a- test
- split core-decode-wrong from SBR-scrambles-good-core in synthetic_heaac_matrix
1 changed file +34 -4
crates/ec-aac/tests/sbr_real_library.rsmodified+34 -4
| @@ -2199,8 +2199,9 @@ fn synthetic_heaac_matrix() { | ||
| 2199 | 2199 | std::env::set_var("EC_AAC_SBR_SIDEINFO_DEBUG", "1"); |
| 2200 | 2200 | } |
| 2201 | 2201 | println!( |
| 2202 | - "{:>5} {:>6} {:>4} {:>4} {:>4} {:>8} {:>8} {:>8} {:>6} {:>11} {:>8}", | |
| 2203 | - "rate", "kbps", "prof", "kx", "k2", "full", "below", "above", "lag", "ours_v_core", "ovc_lag" | |
| 2202 | + "{:>5} {:>6} {:>4} {:>4} {:>4} {:>8} {:>8} {:>8} {:>6} {:>11} {:>8} {:>10} {:>8} {:>9} {:>9}", | |
| 2203 | + "rate", "kbps", "prof", "kx", "k2", "full", "below", "above", "lag", "ours_v_core", "ovc_lag", | |
| 2204 | + "core_v_ref", "cvr_lag", "core_rate", "full_rate" | |
| 2204 | 2205 | ); |
| 2205 | 2206 | // Wide enough that the WIDE_LAG_MAX==LC's own decoder priming delay |
| 2206 | 2207 | // (2048) plus a full SBR-chain worth of extra delay (a few thousand |
| @@ -2286,14 +2287,43 @@ fn synthetic_heaac_matrix() { | ||
| 2286 | 2287 | } else { |
| 2287 | 2288 | None |
| 2288 | 2289 | }; |
| 2290 | + // Coordinator follow-up 2: splits "our core decode of THIS | |
| 2291 | + // fixture is wrong" (core_v_ref ~0) from "the SBR chain | |
| 2292 | + // scrambles a good core" (core_v_ref >= ~0.99 while `below` | |
| 2293 | + // above stays ~0/negative) -- OUR core-only decode (2x | |
| 2294 | + // upsampled, same convention `ours_v_core` uses) against the | |
| 2295 | + // REFERENCE decoder's own decode, below the crossover only, | |
| 2296 | + // wide lag search since this is an independent alignment | |
| 2297 | + // from `full`/`below`'s (core-only carries no SBR delay). | |
| 2298 | + let (core_v_ref, core_rate_str) = if kx > 0 { | |
| 2299 | + match our_decode_core_only(&path, 0) { | |
| 2300 | + Some((core, core_rate)) => { | |
| 2301 | + let up: Vec<f32> = core[0].iter().flat_map(|&s| [s, s]).collect(); | |
| 2302 | + let tl = lowpass(t, our_rate, crossover_hz); | |
| 2303 | + let ul = lowpass(&up, our_rate, crossover_hz); | |
| 2304 | + (Some(best_lag_correlation_wide(&ul, &tl, WIDE_LAG_MAX)), core_rate.to_string()) | |
| 2305 | + } | |
| 2306 | + None => (None, "n/a".into()), | |
| 2307 | + } | |
| 2308 | + } else { | |
| 2309 | + (None, "n/a".into()) | |
| 2310 | + }; | |
| 2289 | 2311 | println!( |
| 2290 | - "{rate:>5} {br:>6} {profile:>4} {kx:>4} {k2:>4} {full:>8.4} {below:>8.4} {above:>8.4} {lag:>6} {:>11} {:>8}", | |
| 2312 | + "{rate:>5} {br:>6} {profile:>4} {kx:>4} {k2:>4} {full:>8.4} {below:>8.4} {above:>8.4} {lag:>6} {:>11} {:>8} {:>10} {:>8} {:>9} {:>9}", | |
| 2291 | 2313 | ours_v_core |
| 2292 | 2314 | .map(|(_, c)| format!("{c:.4}")) |
| 2293 | 2315 | .unwrap_or_else(|| "n/a".into()), |
| 2294 | 2316 | ours_v_core |
| 2295 | 2317 | .map(|(l, _)| l.to_string()) |
| 2296 | - .unwrap_or_else(|| "n/a".into()) | |
| 2318 | + .unwrap_or_else(|| "n/a".into()), | |
| 2319 | + core_v_ref | |
| 2320 | + .map(|(_, c)| format!("{c:.4}")) | |
| 2321 | + .unwrap_or_else(|| "n/a".into()), | |
| 2322 | + core_v_ref | |
| 2323 | + .map(|(l, _)| l.to_string()) | |
| 2324 | + .unwrap_or_else(|| "n/a".into()), | |
| 2325 | + core_rate_str, | |
| 2326 | + our_rate, | |
| 2297 | 2327 | ); |
| 2298 | 2328 | // Coordinator follow-up (4): on the two named rows, probe |
| 2299 | 2329 | // candidate total HE-vs-reference delays built from LC's own |