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/audio/remix_resample_unittest.cc b/audio/remix_resample_unittest.cc
index 1d8cce7..f1fb5f7 100644
--- a/audio/remix_resample_unittest.cc
+++ b/audio/remix_resample_unittest.cc
@@ -113,7 +113,8 @@
// Computes the best SNR based on the error between |ref_frame| and
// |test_frame|. It allows for up to a |max_delay| in samples between the
// signals to compensate for the resampling delay.
-float ComputeSNR(const AudioFrame& ref_frame, const AudioFrame& test_frame,
+float ComputeSNR(const AudioFrame& ref_frame,
+ const AudioFrame& test_frame,
size_t max_delay) {
VerifyParams(ref_frame, test_frame);
float best_snr = 0;
@@ -123,8 +124,9 @@
float variance = 0;
const int16_t* ref_frame_data = ref_frame.data();
const int16_t* test_frame_data = test_frame.data();
- for (size_t i = 0; i < ref_frame.samples_per_channel_ *
- ref_frame.num_channels_ - delay; i++) {
+ for (size_t i = 0;
+ i < ref_frame.samples_per_channel_ * ref_frame.num_channels_ - delay;
+ i++) {
int error = ref_frame_data[i] - test_frame_data[i + delay];
mse += error * error;
variance += ref_frame_data[i] * ref_frame_data[i];
@@ -145,7 +147,7 @@
const AudioFrame& test_frame) {
VerifyParams(ref_frame, test_frame);
const int16_t* ref_frame_data = ref_frame.data();
- const int16_t* test_frame_data = test_frame.data();
+ const int16_t* test_frame_data = test_frame.data();
for (size_t i = 0;
i < ref_frame.samples_per_channel_ * ref_frame.num_channels_; i++) {
EXPECT_EQ(ref_frame_data[i], test_frame_data[i]);
@@ -161,8 +163,8 @@
const int16_t kSrcCh2 = 15;
const int16_t kSrcCh3 = 22;
const int16_t kSrcCh4 = 8;
- const float resampling_factor = (1.0 * src_sample_rate_hz) /
- dst_sample_rate_hz;
+ const float resampling_factor =
+ (1.0 * src_sample_rate_hz) / dst_sample_rate_hz;
const float dst_ch1 = resampling_factor * kSrcCh1;
const float dst_ch2 = resampling_factor * kSrcCh2;
const float dst_ch3 = resampling_factor * kSrcCh3;
@@ -206,7 +208,7 @@
static_cast<double>(dst_sample_rate_hz) / src_sample_rate_hz *
kInputKernelDelaySamples * dst_channels * 2);
printf("(%d, %d Hz) -> (%d, %d Hz) ", // SNR reported on the same line later.
- src_channels, src_sample_rate_hz, dst_channels, dst_sample_rate_hz);
+ src_channels, src_sample_rate_hz, dst_channels, dst_sample_rate_hz);
RemixAndResample(src_frame_, &resampler, &dst_frame_);
if (src_sample_rate_hz == 96000 && dst_sample_rate_hz == 8000) {
@@ -258,8 +260,7 @@
for (int src_rate = 0; src_rate < kSampleRatesSize; src_rate++) {
for (int dst_rate = 0; dst_rate < kSampleRatesSize; dst_rate++) {
- for (int src_channel = 0; src_channel < kSrcChannelsSize;
- src_channel++) {
+ for (int src_channel = 0; src_channel < kSrcChannelsSize; src_channel++) {
for (int dst_channel = 0; dst_channel < kDstChannelsSize;
dst_channel++) {
RunResampleTest(kSrcChannels[src_channel], kSampleRates[src_rate],