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

Side by Side Diff: webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc

Issue 1172163004: Reformat existing code. There should be no functional effects. (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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 payload_len = WebRtcPcm16b_Encode(const_cast<int16_t*>(input_samples), 96 payload_len = WebRtcPcm16b_Encode(const_cast<int16_t*>(input_samples),
97 kInputBlockSizeSamples, 97 kInputBlockSizeSamples,
98 input_payload); 98 input_payload);
99 assert(payload_len == kInputBlockSizeSamples * sizeof(int16_t)); 99 assert(payload_len == kInputBlockSizeSamples * sizeof(int16_t));
100 } 100 }
101 101
102 // Get output audio, but don't do anything with it. 102 // Get output audio, but don't do anything with it.
103 static const int kMaxChannels = 1; 103 static const int kMaxChannels = 1;
104 static const int kMaxSamplesPerMs = 48000 / 1000; 104 static const int kMaxSamplesPerMs = 48000 / 1000;
105 static const int kOutputBlockSizeMs = 10; 105 static const int kOutputBlockSizeMs = 10;
106 static const int kOutDataLen = kOutputBlockSizeMs * kMaxSamplesPerMs * 106 static const int kOutDataLen =
107 kMaxChannels; 107 kOutputBlockSizeMs * kMaxSamplesPerMs * kMaxChannels;
108 int16_t out_data[kOutDataLen]; 108 int16_t out_data[kOutDataLen];
109 int num_channels; 109 int num_channels;
110 int samples_per_channel; 110 int samples_per_channel;
111 int error = neteq->GetAudio(kOutDataLen, out_data, &samples_per_channel, 111 int error = neteq->GetAudio(kOutDataLen, out_data, &samples_per_channel,
112 &num_channels, NULL); 112 &num_channels, NULL);
113 if (error != NetEq::kOK) 113 if (error != NetEq::kOK)
114 return -1; 114 return -1;
115 115
116 assert(samples_per_channel == kSampRateHz * 10 / 1000); 116 assert(samples_per_channel == kSampRateHz * 10 / 1000);
117 117
118 time_now_ms += kOutputBlockSizeMs; 118 time_now_ms += kOutputBlockSizeMs;
119 if (time_now_ms >= runtime_ms / 2 && !drift_flipped) { 119 if (time_now_ms >= runtime_ms / 2 && !drift_flipped) {
120 // Apply negative drift second half of simulation. 120 // Apply negative drift second half of simulation.
121 rtp_gen.set_drift_factor(-drift_factor); 121 rtp_gen.set_drift_factor(-drift_factor);
122 drift_flipped = true; 122 drift_flipped = true;
123 } 123 }
124 } 124 }
125 int64_t end_time_ms = clock->TimeInMilliseconds(); 125 int64_t end_time_ms = clock->TimeInMilliseconds();
126 delete neteq; 126 delete neteq;
127 return end_time_ms - start_time_ms; 127 return end_time_ms - start_time_ms;
128 } 128 }
129 129
130 } // namespace test 130 } // namespace test
131 } // namespace webrtc 131 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698