Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: webrtc/modules/audio_coding/neteq/merge.cc

Issue 1168753002: Match existing type usage better. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_coding/neteq/expand.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/merge.cc
diff --git a/webrtc/modules/audio_coding/neteq/merge.cc b/webrtc/modules/audio_coding/neteq/merge.cc
index 44fc511c45f545848044a914be1f68174afba4c6..8399a78bc8dbfee7be3f911033c3e480823d2271 100644
--- a/webrtc/modules/audio_coding/neteq/merge.cc
+++ b/webrtc/modules/audio_coding/neteq/merge.cc
@@ -108,10 +108,11 @@ int Merge::Process(int16_t* input, size_t input_length,
// Set a suitable muting slope (Q20). 0.004 for NB, 0.002 for WB,
// and so on.
int increment = 4194 / fs_mult_;
- *external_mute_factor = DspHelper::RampSignal(input_channel,
- interpolation_length,
- *external_mute_factor,
- increment);
+ *external_mute_factor =
+ static_cast<int16_t>(DspHelper::RampSignal(input_channel,
+ interpolation_length,
+ *external_mute_factor,
+ increment));
DspHelper::UnmuteSignal(&input_channel[interpolation_length],
input_length_per_channel - interpolation_length,
external_mute_factor, increment,
@@ -125,7 +126,8 @@ int Merge::Process(int16_t* input, size_t input_length,
}
// Do overlap and mix linearly.
- int increment = 16384 / (interpolation_length + 1); // In Q14.
+ int16_t increment =
+ static_cast<int16_t>(16384 / (interpolation_length + 1)); // In Q14.
int16_t mute_factor = 16384 - increment;
memmove(temp_data, expanded_channel,
sizeof(int16_t) * best_correlation_index);
@@ -246,7 +248,8 @@ int16_t Merge::SignalScaling(const int16_t* input, int input_length,
// energy_expanded / energy_input is in Q14.
energy_expanded = WEBRTC_SPL_SHIFT_W32(energy_expanded, temp_shift + 14);
// Calculate sqrt(energy_expanded / energy_input) in Q14.
- mute_factor = WebRtcSpl_SqrtFloor((energy_expanded / energy_input) << 14);
+ mute_factor = static_cast<int16_t>(
+ WebRtcSpl_SqrtFloor((energy_expanded / energy_input) << 14));
} else {
// Set to 1 (in Q14) when |expanded| has higher energy than |input|.
mute_factor = 16384;
« no previous file with comments | « webrtc/modules/audio_coding/neteq/expand.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698