AEC3: Correct high-band gain for multi-channel
The high-band gain is corrected by fixing the computation of the low-band energy Bug: webrtc:14108 Change-Id: I5033287de57aedcd91bb71623ca2862519ffb35b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263201 Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org> Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36972}
This commit is contained in:
parent
c80a182e55
commit
fbfe6f08a4
@ -136,11 +136,9 @@ float SuppressionGain::UpperBandsGain(
|
||||
const auto sum_of_squares = [](float a, float b) { return a + b * b; };
|
||||
float low_band_energy = 0.f;
|
||||
for (int ch = 0; ch < num_render_channels; ++ch) {
|
||||
// TODO(bugs.webrtc.org/14108): Fix the computation below to compute the
|
||||
// energy for each channel.
|
||||
const float channel_energy = std::accumulate(
|
||||
render.begin(/*band=0*/ 0, /*channel=*/0),
|
||||
render.end(/*band=0*/ 0, /*channel=*/0), 0.f, sum_of_squares);
|
||||
const float channel_energy =
|
||||
std::accumulate(render.begin(/*band=*/0, ch),
|
||||
render.end(/*band=*/0, ch), 0.0f, sum_of_squares);
|
||||
low_band_energy = std::max(low_band_energy, channel_energy);
|
||||
}
|
||||
float high_band_energy = 0.f;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user