From: Johann Date: Mon, 23 Jul 2012 22:06:12 +0000 (-0700) Subject: Allow specifying the seed X-Git-Tag: v1.2.0~135^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ec2552792638af8473d33be735f43c04605e1a6;p=libvpx Allow specifying the seed Change-Id: Ie933998b08cd2b3f0e379b8fa7d394c95bd08cac --- 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