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

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

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 iter ++; 203 iter ++;
204 } 204 }
205 return x; 205 return x;
206 } 206 }
207 207
208 NetEqQualityTest::NetEqQualityTest(int block_duration_ms, 208 NetEqQualityTest::NetEqQualityTest(int block_duration_ms,
209 int in_sampling_khz, 209 int in_sampling_khz,
210 int out_sampling_khz, 210 int out_sampling_khz,
211 NetEqDecoder decoder_type) 211 NetEqDecoder decoder_type)
212 : decoder_type_(decoder_type), 212 : decoder_type_(decoder_type),
213 channels_(FLAGS_channels), 213 channels_(static_cast<size_t>(FLAGS_channels)),
214 decoded_time_ms_(0), 214 decoded_time_ms_(0),
215 decodable_time_ms_(0), 215 decodable_time_ms_(0),
216 drift_factor_(FLAGS_drift_factor), 216 drift_factor_(FLAGS_drift_factor),
217 packet_loss_rate_(FLAGS_packet_loss_rate), 217 packet_loss_rate_(FLAGS_packet_loss_rate),
218 block_duration_ms_(block_duration_ms), 218 block_duration_ms_(block_duration_ms),
219 in_sampling_khz_(in_sampling_khz), 219 in_sampling_khz_(in_sampling_khz),
220 out_sampling_khz_(out_sampling_khz), 220 out_sampling_khz_(out_sampling_khz),
221 in_size_samples_( 221 in_size_samples_(
222 static_cast<size_t>(in_sampling_khz_ * block_duration_ms_)), 222 static_cast<size_t>(in_sampling_khz_ * block_duration_ms_)),
223 out_size_samples_(static_cast<size_t>(out_sampling_khz_ * kOutputSizeMs)), 223 out_size_samples_(static_cast<size_t>(out_sampling_khz_ * kOutputSizeMs)),
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 Log() << "was sent."; 387 Log() << "was sent.";
388 } else { 388 } else {
389 Log() << "was lost."; 389 Log() << "was lost.";
390 } 390 }
391 } 391 }
392 Log() << std::endl; 392 Log() << std::endl;
393 return packet_input_time_ms; 393 return packet_input_time_ms;
394 } 394 }
395 395
396 int NetEqQualityTest::DecodeBlock() { 396 int NetEqQualityTest::DecodeBlock() {
397 int channels; 397 size_t channels;
398 size_t samples; 398 size_t samples;
399 int ret = neteq_->GetAudio(out_size_samples_ * channels_, &out_data_[0], 399 int ret = neteq_->GetAudio(out_size_samples_ * channels_, &out_data_[0],
400 &samples, &channels, NULL); 400 &samples, &channels, NULL);
401 401
402 if (ret != NetEq::kOK) { 402 if (ret != NetEq::kOK) {
403 return -1; 403 return -1;
404 } else { 404 } else {
405 assert(channels == channels_); 405 assert(channels == channels_);
406 assert(samples == static_cast<size_t>(kOutputSizeMs * out_sampling_khz_)); 406 assert(samples == static_cast<size_t>(kOutputSizeMs * out_sampling_khz_));
407 RTC_CHECK(output_->WriteArray(out_data_.get(), samples * channels)); 407 RTC_CHECK(output_->WriteArray(out_data_.get(), samples * channels));
(...skipping 20 matching lines...) Expand all
428 } 428 }
429 } 429 }
430 Log() << "Average bit rate was " 430 Log() << "Average bit rate was "
431 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms 431 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms
432 << " kbps" 432 << " kbps"
433 << std::endl; 433 << std::endl;
434 } 434 }
435 435
436 } // namespace test 436 } // namespace test
437 } // namespace webrtc 437 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h ('k') | webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698