P4: decode FUN_180529fe0 mono-path exactly + extract live mask tables
Full decomp of the per-band mask-apply loop (scale -> IIR1/2/3 leaky ->
blend -> exp2 bigkernel -> combine/accumulate -> dual warp -> dry/wet -> FFT-conv).
Extracted runtime tables to rt_mask_tables.{hpp,cpp}: IIR A1/B1,A2/B2,A3/B3
(leaky y=A*acc+B*x, B=1-A), warp 0x5406a8, per-band 0x540768, PRNG LUT 0x5408b0.
bigkernel 0x26b820 = vectorized exp2 (log2e/floor/mantissa tables). Fixed the
broken warp line in framed_model.cpp (compiles again).
This commit is contained in:
@@ -17,9 +17,9 @@ constexpr double MASK_N = 0.25966;
|
||||
constexpr float SENS_SCALE = 2.054f;
|
||||
constexpr int RT_WEIGHTS_N = 2049; // captured attack/release tables size
|
||||
|
||||
double mask_lut(double acc) {
|
||||
double mask_lut(double acc, double K, double n) {
|
||||
if (acc <= 0.0) return 1.0;
|
||||
return std::pow(1.0 / (1.0 + MASK_K * acc), MASK_N);
|
||||
return std::pow(1.0 / (1.0 + K * acc), n);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -108,7 +108,13 @@ void FramedDetector::processFrame(const std::complex<double>* spectrum, float* m
|
||||
track_[b][k] = static_cast<float>(track);
|
||||
// Accumulator (FUN_180529fe0 step 5: 0x5407c8 = diff; += level).
|
||||
double acc = diff + level;
|
||||
double g = mask_lut(acc);
|
||||
// LUT fitted against live mask band0 (0x540678), which ALREADY
|
||||
// includes the step-6 warp tilt (0x5406a8) — so no extra warp.
|
||||
// Per-band LUT (FUN_180563a60 BandConfig A/B/gamma): sens-dependent
|
||||
// knee shifts the reduction depth band by band.
|
||||
double K = bands_[b].lut_k, n = bands_[b].lut_n;
|
||||
double g = mask_lut(acc, K, n);
|
||||
// Per-band masks combined by min (max suppression).
|
||||
if (g < gain) gain = g;
|
||||
}
|
||||
mask[k] = static_cast<float>(gain);
|
||||
|
||||
Reference in New Issue
Block a user