| OLD | NEW |
| 1 /* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 1 /* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 2 * | 2 * |
| 3 * Use of this source code is governed by a BSD-style license | 3 * Use of this source code is governed by a BSD-style license |
| 4 * that can be found in the LICENSE file in the root of the source | 4 * that can be found in the LICENSE file in the root of the source |
| 5 * tree. An additional intellectual property rights grant can be found | 5 * tree. An additional intellectual property rights grant can be found |
| 6 * in the file PATENTS. All contributing project authors may | 6 * in the file PATENTS. All contributing project authors may |
| 7 * be found in the AUTHORS file in the root of the source tree. | 7 * be found in the AUTHORS file in the root of the source tree. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #include "webrtc/modules/video_coding/jitter_estimator.h" | 10 #include "webrtc/modules/video_coding/jitter_estimator.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 virtual void SetUp() { regular_estimator_.Reset(); } | 40 virtual void SetUp() { regular_estimator_.Reset(); } |
| 41 | 41 |
| 42 TestEstimator regular_estimator_; | 42 TestEstimator regular_estimator_; |
| 43 TestEstimator low_rate_estimator_; | 43 TestEstimator low_rate_estimator_; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Generates some simple test data in the form of a sawtooth wave. | 46 // Generates some simple test data in the form of a sawtooth wave. |
| 47 class ValueGenerator { | 47 class ValueGenerator { |
| 48 public: | 48 public: |
| 49 ValueGenerator(int32_t amplitude) : amplitude_(amplitude), counter_(0) {} | 49 explicit ValueGenerator(int32_t amplitude) |
| 50 : amplitude_(amplitude), counter_(0) {} |
| 50 virtual ~ValueGenerator() {} | 51 virtual ~ValueGenerator() {} |
| 51 | 52 |
| 52 int64_t Delay() { return ((counter_ % 11) - 5) * amplitude_; } | 53 int64_t Delay() { return ((counter_ % 11) - 5) * amplitude_; } |
| 53 | 54 |
| 54 uint32_t FrameSize() { return 1000 + Delay(); } | 55 uint32_t FrameSize() { return 1000 + Delay(); } |
| 55 | 56 |
| 56 void Advance() { ++counter_; } | 57 void Advance() { ++counter_; } |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 const int32_t amplitude_; | 60 const int32_t amplitude_; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 break; | 151 break; |
| 151 } | 152 } |
| 152 | 153 |
| 153 gen.Advance(); | 154 gen.Advance(); |
| 154 } | 155 } |
| 155 | 156 |
| 156 EXPECT_NE(regular_iterations, 0); | 157 EXPECT_NE(regular_iterations, 0); |
| 157 EXPECT_NE(low_rate_iterations, 0); | 158 EXPECT_NE(low_rate_iterations, 0); |
| 158 EXPECT_LE(low_rate_iterations, regular_iterations); | 159 EXPECT_LE(low_rate_iterations, regular_iterations); |
| 159 } | 160 } |
| 160 } | 161 } // namespace webrtc |
| OLD | NEW |