| OLD | NEW |
| 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 Loading... |
| 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 enum NetEqDecoder decoder_type) | 211 enum 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 Log() << "was sent."; | 385 Log() << "was sent."; |
| 386 } else { | 386 } else { |
| 387 Log() << "was lost."; | 387 Log() << "was lost."; |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 Log() << std::endl; | 390 Log() << std::endl; |
| 391 return packet_input_time_ms; | 391 return packet_input_time_ms; |
| 392 } | 392 } |
| 393 | 393 |
| 394 int NetEqQualityTest::DecodeBlock() { | 394 int NetEqQualityTest::DecodeBlock() { |
| 395 int channels; | 395 size_t channels; |
| 396 size_t samples; | 396 size_t samples; |
| 397 int ret = neteq_->GetAudio(out_size_samples_ * channels_, &out_data_[0], | 397 int ret = neteq_->GetAudio(out_size_samples_ * channels_, &out_data_[0], |
| 398 &samples, &channels, NULL); | 398 &samples, &channels, NULL); |
| 399 | 399 |
| 400 if (ret != NetEq::kOK) { | 400 if (ret != NetEq::kOK) { |
| 401 return -1; | 401 return -1; |
| 402 } else { | 402 } else { |
| 403 assert(channels == channels_); | 403 assert(channels == channels_); |
| 404 assert(samples == static_cast<size_t>(kOutputSizeMs * out_sampling_khz_)); | 404 assert(samples == static_cast<size_t>(kOutputSizeMs * out_sampling_khz_)); |
| 405 CHECK(output_->WriteArray(out_data_.get(), samples * channels)); | 405 CHECK(output_->WriteArray(out_data_.get(), samples * channels)); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 Log() << "Average bit rate was " | 428 Log() << "Average bit rate was " |
| 429 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms | 429 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms |
| 430 << " kbps" | 430 << " kbps" |
| 431 << std::endl; | 431 << std::endl; |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace test | 434 } // namespace test |
| 435 } // namespace webrtc | 435 } // namespace webrtc |
| OLD | NEW |