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:
+2
-2
@@ -87,7 +87,7 @@ void execute_inverse(const FFTPlan* plan, std::complex<double>* buf) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < N; i++) {
|
||||
buf[i] /= N;
|
||||
buf[i] /= N; // canonical 1/N normalization (inverse FFT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ void execute_real_inverse_exact(const FFTPlan* plan,
|
||||
}
|
||||
}
|
||||
|
||||
// Scale by 1/(N/2)
|
||||
// Scale by 2/half (= 4/N) — plugin convention, differs from canonical 1/N in execute_inverse
|
||||
for (uint32_t i = 0; i < half; i++) {
|
||||
z[i] *= 2.0 / half;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -207,9 +207,6 @@ void SpectralProcessor::buildFirFromMask(const float* mask, std::complex<double>
|
||||
for (size_t i = half + 1; i < nfft; i++) {
|
||||
time_domain[i] = 0.0; // xmm9 = 0 zeros upper half
|
||||
}
|
||||
for (size_t i = half + 1; i < nfft; i++) {
|
||||
time_domain[i] = 0.0;
|
||||
}
|
||||
|
||||
// Step 4: opB = fwd-RFFT (th1a90): time_domain (real) → complex
|
||||
std::vector<std::complex<double>> freq_domain(half + 1);
|
||||
|
||||
Reference in New Issue
Block a user