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

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h

Issue 1404953002: Move PRNG from BWE test framework to webrtc/test. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
index 77b03fe7b1277de63ae1ce04eb629953bf7ef01f..1362c870372f37afee2e71527c85160365756293 100644
--- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
+++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h
@@ -29,9 +29,9 @@
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h"
#include "webrtc/modules/remote_bitrate_estimator/test/packet.h"
-#include "webrtc/modules/remote_bitrate_estimator/test/random.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
#include "webrtc/system_wrappers/interface/clock.h"
+#include "webrtc/test/random.h"
namespace webrtc {
@@ -173,32 +173,6 @@ template<typename T> class Stats {
T max_;
};
-class Random {
- public:
- explicit Random(uint32_t seed);
-
- // Return pseudo random number in the interval [0.0, 1.0].
- float Rand();
-
- // Return pseudo rounded random number in interval [low, high].
- int Rand(int low, int high);
-
- // Normal Distribution.
- int Gaussian(int mean, int standard_deviation);
-
- // Exponential Distribution.
- int Exponential(float lambda);
-
- // TODO(solenberg): Random from histogram.
- // template<typename T> int Distribution(const std::vector<T> histogram) {
-
- private:
- uint32_t a_;
- uint32_t b_;
-
- RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Random);
-};
-
bool IsTimeSorted(const Packets& packets);
class PacketProcessor;
@@ -291,7 +265,7 @@ class LossFilter : public PacketProcessor {
virtual void RunFor(int64_t time_ms, Packets* in_out);
private:
- Random random_;
+ test::Random random_;
float loss_fraction_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(LossFilter);
@@ -325,7 +299,7 @@ class JitterFilter : public PacketProcessor {
int64_t MeanUs();
private:
- Random random_;
+ test::Random random_;
int64_t stddev_jitter_us_;
int64_t last_send_time_us_;
bool reordering_; // False by default.
@@ -344,7 +318,7 @@ class ReorderFilter : public PacketProcessor {
virtual void RunFor(int64_t time_ms, Packets* in_out);
private:
- Random random_;
+ test::Random random_;
float reorder_fraction_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ReorderFilter);

Powered by Google App Engine
This is Rietveld 408576698