diff --git a/coder/coder.cpp b/coder/coder.cpp index 5354ad8..f12a654 100644 --- a/coder/coder.cpp +++ b/coder/coder.cpp @@ -216,6 +216,11 @@ std::vector compress_block_adaptive_joint( for (float v : ch1_bands[i]) energy1[i] += v * v; } + for (int i = 0; i < band_count; i++) { + energy0[i] = std::pow(energy0[i], 0.75); + energy1[i] = std::pow(energy1[i], 0.75); + } + bool has_transient = detect_strong_transient(energy0, energy1, band_count, stereo, SETTINGS.transient_ratio_threshold); diff --git a/coder/wavelet.h b/coder/wavelet.h index 541c4fa..7b93c24 100644 --- a/coder/wavelet.h +++ b/coder/wavelet.h @@ -149,10 +149,10 @@ class PWPT : public DD64in { const int total_bands = 1 << levels; const size_t band_size = N >> levels; - for (float& x : data) { - float absv = std::fabs(x); - x = std::copysign(fast_pow_075(absv), x); - } + // for (float& x : data) { + // float absv = std::fabs(x); + // x = std::copysign(fast_pow_075(absv), x); + // } if (levels > 1) { auto perm = gray_permutation(levels); diff --git a/decoder/wavelet.h b/decoder/wavelet.h index 6000df2..b3c65d9 100644 --- a/decoder/wavelet.h +++ b/decoder/wavelet.h @@ -144,12 +144,12 @@ class PWPT : public DD64out { reordered[i] = std::move(subbands[perm[i]]); subbands = std::move(reordered); } - for (auto& band : subbands) { - for (float& coeff : band) { - float absv = std::fabs(coeff); - coeff = std::copysign(fast_pow_1333(absv), coeff); - } - } + // for (auto& band : subbands) { + // for (float& coeff : band) { + // float absv = std::fabs(coeff); + // coeff = std::copysign(fast_pow_1333(absv), coeff); + // } + // } return wpt_reconstruct(subbands, levels); } };