commit 951d0e29e428397ec33624c33359e5328a944c6f
parent 4e35f18c97fada13565b69d335b32437efdd0b78
Author: Dan Baker <dbaker@mozilla.com>
Date: Mon, 27 Oct 2025 16:50:00 -0600
Bug 1995393 - Vendor libwebrtc from 24c9f61399
Upstream commit: https://webrtc.googlesource.com/src/+/24c9f613999589f1067f62e7d3cc47b7bf3a2d85
Fix integer division issue in AGC2 limiter interpolation
i / n was always 0 because both were integers.
This changes the computation to use floating point.
I have confirmed that the output values change with this modification.
However, I couldn't hear any difference in the sound.
Bug: webrtc:440589870
Change-Id: Ie5e36e445390d2bdc7b046f163da53a9282c2abc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/406561
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Lionel Koenig <lionelk@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45504}
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor
@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
-libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T22:47:37.434841+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T22:49:49.261284+00:00.
# base of lastest vendoring
-d110b78168
+24c9f61399
diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/limiter.cc b/third_party/libwebrtc/modules/audio_processing/agc2/limiter.cc
@@ -42,8 +42,9 @@ void InterpolateFirstSubframe(float last_factor,
const int n = dchecked_cast<int>(subframe.size());
constexpr float p = kAttackFirstSubframeInterpolationPower;
for (int i = 0; i < n; ++i) {
- subframe[i] = std::pow(1.f - i / n, p) * (last_factor - current_factor) +
- current_factor;
+ float t = static_cast<float>(i) / n;
+ subframe[i] =
+ std::pow(1.f - t, p) * (last_factor - current_factor) + current_factor;
}
}