From 9ec2552792638af8473d33be735f43c04605e1a6 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 23 Jul 2012 15:06:12 -0700 Subject: [PATCH] Allow specifying the seed Change-Id: Ie933998b08cd2b3f0e379b8fa7d394c95bd08cac --- test/video_source.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/video_source.h b/test/video_source.h index 7347c8dd0..688e185fd 100644 --- a/test/video_source.h +++ b/test/video_source.h @@ -102,13 +102,15 @@ class DummyVideoSource : public VideoSource { class RandomVideoSource : public DummyVideoSource { public: - RandomVideoSource() : rnd_(ACMRandom::DeterministicSeed()) {} + RandomVideoSource(int seed = ACMRandom::DeterministicSeed()) + : rnd_(seed), + seed_(seed) { } protected: // Reset the RNG to get a matching stream for the second pass virtual void Begin() { frame_ = 0; - rnd_.Reset(ACMRandom::DeterministicSeed()); + rnd_.Reset(seed_); FillFrame(); } @@ -123,6 +125,7 @@ class RandomVideoSource : public DummyVideoSource { } ACMRandom rnd_; + int seed_; }; } // namespace libvpx_test -- 2.40.0