Reland "Upconvert various types to int.", neteq portion.
This reverts portions of commit cb180976dd0e9672cde4523d87b5f4857478b5e9, which
reverted commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24. Specifically, the
files in webrtc/modules/audio_coding/neteq/ are relanded.
The original commit message is below:
Upconvert various types to int.
Per comments from HL/kwiberg on https://webrtc-codereview.appspot.com/42569004 , when there is existing usage of mixed types (int16_t, int, etc.), we'd prefer to standardize on larger types like int and phase out use of int16_t.
Specifically, "Using int16 just because we're sure all reasonable values will fit in 16 bits isn't usually meaningful in C."
This converts some existing uses of int16_t (and, in a few cases, other types such as uint16_t) to int (or, in a few places, int32_t). Other locations will be converted to size_t in a separate change.
BUG=none
TBR=kwiberg
Review URL: https://codereview.webrtc.org/1181073002
Cr-Original-Commit-Position: refs/heads/master@{#9427}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 36b7cc32643bae0379d8102ce05dae82ecc466a1
diff --git a/modules/audio_coding/neteq/dsp_helper.cc b/modules/audio_coding/neteq/dsp_helper.cc
index 7451ae2..289e66d 100644
--- a/modules/audio_coding/neteq/dsp_helper.cc
+++ b/modules/audio_coding/neteq/dsp_helper.cc
@@ -272,7 +272,7 @@
}
void DspHelper::UnmuteSignal(const int16_t* input, size_t length,
- int16_t* factor, int16_t increment,
+ int16_t* factor, int increment,
int16_t* output) {
uint16_t factor_16b = *factor;
int32_t factor_32b = (static_cast<int32_t>(factor_16b) << 6) + 32;
@@ -284,7 +284,7 @@
*factor = factor_16b;
}
-void DspHelper::MuteSignal(int16_t* signal, int16_t mute_slope, size_t length) {
+void DspHelper::MuteSignal(int16_t* signal, int mute_slope, size_t length) {
int32_t factor = (16384 << 6) + 32;
for (size_t i = 0; i < length; i++) {
signal[i] = ((factor >> 6) * signal[i] + 8192) >> 14;