audit fixes: dead conditional, DBG_CASC gate, dup loop, fft comments, blend doc

- framed_model: remove `if (pool_w > 0 && !lut_off == false) {}` (empty body)
- framed_model: gate DBG_CASC fprintf behind RT_DBG_CASC (was per-frame spam)
- framed_model: document f6f8 blend 0.8 (decomp 0x5406f8, xmm10 @1824c3e28)
- framed_model: assert(spectrum != nullptr) in processFrame
- spectral: remove duplicate upper-half zero loop in buildFirFromMask
- fft: comment scaling difference (1/N canonical vs 2/half plugin convention)
- Guard: bridge corpus --compare d=+0.000 (exact parity)
This commit is contained in:
2026-09-02 22:37:09 +03:00
parent 197f5edea4
commit e4c53480ad
3 changed files with 7 additions and 7 deletions
+5 -2
View File
@@ -8,6 +8,7 @@
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>
namespace {
@@ -151,7 +152,6 @@ static void process_band_structural(
for (size_t k = 0; k < nbin; k++) lvl_in[k] = static_cast<float>(lvl_in[k] / k_tot);
}
}
if (pool_w > 0 && !lut_off == false) {}
if (pool_w > 0) {
std::vector<float> pooled(nbin);
for (size_t k = 0; k < nbin; k++) {
@@ -396,6 +396,8 @@ static void process_band_structural(
band_level[nfft - 1 - k] = band_level[k];
}
// f6f8 blend: freqaxis*(1-mix) + mix*0.8 (source: decomp 0x5406f8 blend buffer,
// xmm10=0.8 @1824c3e28; mix hardcoded 1.0 → constant 0.8 pedestal)
for (size_t k = 0; k < nfft; k++) {
f6f8[k] = 1.0f * (1.0f - mix) + mix * 0.8f;
}
@@ -684,6 +686,7 @@ void FramedDetector::processFrame(const std::complex<double>* spectrum, float* m
// the slow adaptation the real plugin exhibits on sustained content.
static const int env_live = getenv("RT_ENV") ? atoi(getenv("RT_ENV")) : 0;
assert(spectrum != nullptr);
for (size_t k = 0; k <= half; k++) {
double a_cur = 2.0 * std::abs(spectrum[k]) / wsum_;
if (env_live) {
@@ -724,7 +727,7 @@ void FramedDetector::processFrame(const std::complex<double>* spectrum, float* m
// Cascade computes: |audio_spectrum × twin_response| → Haar smooth → sin-peak floor
// Output replaces am/res in the structural chain.
static thread_local std::vector<float> casc_curve;
fprintf(stderr, "DBG_CASC casc_on=%d nfft=%zu twin=%zu b=%zu bands=%zu\n", casc_on, nfft_, twin_resp_complex_.size(), b, bands_.size());
if (getenv("RT_DBG_CASC")) fprintf(stderr, "DBG_CASC casc_on=%d nfft=%zu twin=%zu b=%zu bands=%zu\n", casc_on, nfft_, twin_resp_complex_.size(), b, bands_.size());
if (casc_on && nfft_ == 4096 && twin_resp_complex_.size() > b) {
size_t nbin = half + 1;
std::vector<float> complex_input(2 * nbin);