P2.5: decode twin-mask factory (FUN_18056e3e0 = constant fill 2π/(count·SR)) + band LUT apply (FUN_180563a60: level->gain t^γ/power-law); implement in levelpath.cpp, levelpath_check ALL OK

This commit is contained in:
2026-08-20 01:23:22 +03:00
parent a49e35dc25
commit d3db772121
5 changed files with 142 additions and 24 deletions
+23
View File
@@ -160,6 +160,29 @@
Остаток 0.7 dB (Q=0.1) = LUT-колено 0.574 -> нужен FFT-уровень (0x535a70 + окно 0x540658 + freq-axis
0x540698), см. SESSION_HANDOFF §5-6.
## ============ UPDATE 2026-08-20g: P2.5 twin-mask factory + band LUT apply DECODED ============
Source: decomp_funs2.txt (FUN_18056e3e0:7988, FUN_180563a60:8975, FUN_180563440:7697) +
f_56e3e0.dis + f_563a60.dis. Implemented in dsp/levelpath.cpp (levelpath_check ALL OK).
### FUN_18056e3e0 = "twin-mask factory" is a CONSTANT FILL, NOT per-bin twin resonance:
s = DAT_1824c4248 / (double)((float)[ctx+0x240080] * [ctx+0x24])
= 2π / (count · SR) (0x24c4248 = 6.283185307 = 2π)
fills 0x400 bins of the mask (stride 0x2000/band) with s. The twin resonance shape enters
elsewhere (via the LUT curve FUN_180563440), NOT here. (corrects NOTES:547 "twin resonance".)
### FUN_180563a60 = band LUT apply (level -> gain), 6 bands × 0x400 bins:
level_dB = logf(mask[band][bin]) · 8.6859 (20·log10)
axis[bin] = bin · (1/1024) (0x24c3c50 = 0.0009765625, DIFFERENT from 1/1023)
t = clamp((dB A)/(B A), 0, 1) (BandConfig ctx+0x180: A=min,B=max,gamma,flag)
if gamma == 1.0: val = t
elif flag == 0 (linear): val = t^gamma (powf, DIRECT gamma)
else (power-law): val = 0.5·(1 + sign(2t1)·|2t1|^gamma)
axis[bin+1] = val (pairs level, gain)
NOTE: this is the INVERSE of FUN_180563440 (which uses x^(1/γ)); 563a60 uses t^γ.
### Constants locked (from rt snap rodata):
0x24c4248 = 2π (double), 0x24c4230 = 5 (double), 0x24c3c50 = 1/1024, 0x24c3c54 = 1/1023.
## ============ UPDATE 2026-08-19e: FUN_180529fe0 FULL DECOMP CONFIRMS MASK-CANON ============
Source: /tmp/consumers_out.txt:471-1277 (full Ghidra decomp). Validates + completes the
"CONFIRMED per-band pipeline" section below (lines 237-253). Notes: