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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 encoder_->SetTargetBitrate(rate); 97 encoder_->SetTargetBitrate(rate);
98 EXPECT_EQ(rate, encoder_->GetTargetBitrate()); 98 EXPECT_EQ(rate, encoder_->GetTargetBitrate());
99 } 99 }
100 } 100 }
101 101
102 namespace { 102 namespace {
103 103
104 // Returns a vector with the n evenly-spaced numbers a, a + (b - a)/(n - 1), 104 // Returns a vector with the n evenly-spaced numbers a, a + (b - a)/(n - 1),
105 // ..., b. 105 // ..., b.
106 std::vector<double> IntervalSteps(double a, double b, size_t n) { 106 std::vector<double> IntervalSteps(double a, double b, size_t n) {
107 DCHECK_GT(n, 1u); 107 RTC_DCHECK_GT(n, 1u);
108 const double step = (b - a) / (n - 1); 108 const double step = (b - a) / (n - 1);
109 std::vector<double> points; 109 std::vector<double> points;
110 for (size_t i = 0; i < n; ++i) 110 for (size_t i = 0; i < n; ++i)
111 points.push_back(a + i * step); 111 points.push_back(a + i * step);
112 return points; 112 return points;
113 } 113 }
114 114
115 // Sets the packet loss rate to each number in the vector in turn, and verifies 115 // Sets the packet loss rate to each number in the vector in turn, and verifies
116 // that the loss rate as reported by the encoder is |expected_return| for all 116 // that the loss rate as reported by the encoder is |expected_return| for all
117 // of them. 117 // of them.
(...skipping 24 matching lines...) Expand all
142 142
143 TestSetPacketLossRate(encoder_.get(), I(1.00 , 0.18 + eps), 0.20); 143 TestSetPacketLossRate(encoder_.get(), I(1.00 , 0.18 + eps), 0.20);
144 TestSetPacketLossRate(encoder_.get(), I(0.18 - eps, 0.09 + eps), 0.10); 144 TestSetPacketLossRate(encoder_.get(), I(0.18 - eps, 0.09 + eps), 0.10);
145 TestSetPacketLossRate(encoder_.get(), I(0.09 - eps, 0.04 + eps), 0.05); 145 TestSetPacketLossRate(encoder_.get(), I(0.09 - eps, 0.04 + eps), 0.05);
146 TestSetPacketLossRate(encoder_.get(), I(0.04 - eps, 0.01 + eps), 0.01); 146 TestSetPacketLossRate(encoder_.get(), I(0.04 - eps, 0.01 + eps), 0.01);
147 TestSetPacketLossRate(encoder_.get(), I(0.01 - eps, 0.00 ), 0.00); 147 TestSetPacketLossRate(encoder_.get(), I(0.01 - eps, 0.00 ), 0.00);
148 // clang-format on 148 // clang-format on
149 } 149 }
150 150
151 } // namespace webrtc 151 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698