Skip to content
5 changes: 5 additions & 0 deletions coder/coder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ std::vector<uint8_t> 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);

Expand Down
8 changes: 4 additions & 4 deletions coder/wavelet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions decoder/wavelet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down
Loading