22r: affine dB law (RT_LAWAFFINE) ported onto bare chain — TOTAL 1.931 beats canon 2.286; A=7.4/S=1.85 best, tradeoffs mapped

This commit is contained in:
2026-08-23 11:01:42 +03:00
parent d160acaa27
commit 3b9158e63e
2 changed files with 39 additions and 0 deletions
+10
View File
@@ -210,6 +210,16 @@ static void process_band_structural(
double mm = std::exp2(-static_cast<double>(band_level[k]));
static const int noblend = getenv("RT_NOBLEND") ? atoi(getenv("RT_NOBLEND")) : 0;
if (!noblend) mm *= f6f8[k];
// RT_LAWAFFINE="A,S" (NOTES 22q): cut_dB = A + S*log2(lvl) — affine dB law
static const char* la = getenv("RT_LAWAFFINE");
if (la && lut_off) {
double A_db = atof(la); const char* cm = strchr(la, ',');
double S_db = cm ? atof(cm + 1) : 2.17;
if (band_level[k] > 1e-6) {
double y = (A_db + S_db * std::log2(band_level[k])) / 6.0174;
mm = std::exp2(-y);
}
}
mask_out[k] = static_cast<float>(mm);
}