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

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

Issue 2223933004: Migrated GN target :neteq_opus_quality_test (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed chromium-style clang errors in neteq_quality_test Created 4 years, 4 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return (drop_this < loss_rate_ * RAND_MAX); 269 return (drop_this < loss_rate_ * RAND_MAX);
270 } 270 }
271 271
272 GilbertElliotLoss::GilbertElliotLoss(double prob_trans_11, double prob_trans_01) 272 GilbertElliotLoss::GilbertElliotLoss(double prob_trans_11, double prob_trans_01)
273 : prob_trans_11_(prob_trans_11), 273 : prob_trans_11_(prob_trans_11),
274 prob_trans_01_(prob_trans_01), 274 prob_trans_01_(prob_trans_01),
275 lost_last_(false), 275 lost_last_(false),
276 uniform_loss_model_(new UniformLoss(0)) { 276 uniform_loss_model_(new UniformLoss(0)) {
277 } 277 }
278 278
279 GilbertElliotLoss::~GilbertElliotLoss() {}
280
279 bool GilbertElliotLoss::Lost() { 281 bool GilbertElliotLoss::Lost() {
280 // Simulate bursty channel (Gilbert model). 282 // Simulate bursty channel (Gilbert model).
281 // (1st order) Markov chain model with memory of the previous/last 283 // (1st order) Markov chain model with memory of the previous/last
282 // packet state (lost or received). 284 // packet state (lost or received).
283 if (lost_last_) { 285 if (lost_last_) {
284 // Previous packet was not received. 286 // Previous packet was not received.
285 uniform_loss_model_->set_loss_rate(prob_trans_11_); 287 uniform_loss_model_->set_loss_rate(prob_trans_11_);
286 return lost_last_ = uniform_loss_model_->Lost(); 288 return lost_last_ = uniform_loss_model_->Lost();
287 } else { 289 } else {
288 uniform_loss_model_->set_loss_rate(prob_trans_01_); 290 uniform_loss_model_->set_loss_rate(prob_trans_01_);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 } 432 }
431 } 433 }
432 Log() << "Average bit rate was " 434 Log() << "Average bit rate was "
433 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms 435 << 8.0f * total_payload_size_bytes_ / FLAGS_runtime_ms
434 << " kbps" 436 << " kbps"
435 << std::endl; 437 << std::endl;
436 } 438 }
437 439
438 } // namespace test 440 } // namespace test
439 } // namespace webrtc 441 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698