Reformat the WebRTC code base
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
diff --git a/modules/audio_coding/neteq/time_stretch.cc b/modules/audio_coding/neteq/time_stretch.cc
index 8a1bfa2..560d9be 100644
--- a/modules/audio_coding/neteq/time_stretch.cc
+++ b/modules/audio_coding/neteq/time_stretch.cc
@@ -80,7 +80,7 @@
// Calculate scaling to ensure that |peak_index| samples can be square-summed
// without overflowing.
int scaling = 31 - WebRtcSpl_NormW32(max_input_value_ * max_input_value_) -
- WebRtcSpl_NormW32(static_cast<int32_t>(peak_index));
+ WebRtcSpl_NormW32(static_cast<int32_t>(peak_index));
scaling = std::max(0, scaling);
// |vec1| starts at 15 ms minus one pitch period.
@@ -99,8 +99,8 @@
WebRtcSpl_DotProductWithScale(vec1, vec2, peak_index, scaling);
// Check if the signal seems to be active speech or not (simple VAD).
- bool active_speech = SpeechDetection(vec1_energy, vec2_energy, peak_index,
- scaling);
+ bool active_speech =
+ SpeechDetection(vec1_energy, vec2_energy, peak_index, scaling);
int16_t best_correlation;
if (!active_speech) {
@@ -126,8 +126,8 @@
static_cast<int16_t>(vec2_energy >> energy2_scale);
// Calculate square-root of energy product.
- int16_t sqrt_energy_prod = WebRtcSpl_SqrtFloor(vec1_energy_int16 *
- vec2_energy_int16);
+ int16_t sqrt_energy_prod =
+ WebRtcSpl_SqrtFloor(vec1_energy_int16 * vec2_energy_int16);
// Calculate cross_corr / sqrt(en1*en2) in Q14.
int temp_scale = 14 - (energy1_scale + energy2_scale) / 2;
@@ -138,7 +138,6 @@
best_correlation = std::min(static_cast<int16_t>(16384), best_correlation);
}
-
// Check accelerate criteria and stretch the signal.
ReturnCodes return_value =
CheckCriteriaAndStretch(input, input_len, peak_index, best_correlation,
@@ -172,8 +171,10 @@
auto_corr, scaling);
}
-bool TimeStretch::SpeechDetection(int32_t vec1_energy, int32_t vec2_energy,
- size_t peak_index, int scaling) const {
+bool TimeStretch::SpeechDetection(int32_t vec1_energy,
+ int32_t vec2_energy,
+ size_t peak_index,
+ int scaling) const {
// Check if the signal seems to be active speech or not (simple VAD).
// If (vec1_energy + vec2_energy) / (2 * peak_index) <=
// 8 * background_noise_energy, then we say that the signal contains no