]> granicus.if.org Git - libvpx/commitdiff
Allow specifying the seed
authorJohann <johannkoenig@google.com>
Mon, 23 Jul 2012 22:06:12 +0000 (15:06 -0700)
committerJohann <johannkoenig@google.com>
Mon, 23 Jul 2012 23:19:05 +0000 (16:19 -0700)
Change-Id: Ie933998b08cd2b3f0e379b8fa7d394c95bd08cac

test/video_source.h

index 7347c8dd09994c34fea0e34a9b6806d43ce48c3f..688e185fdaca8e45f1c18f9f3d39978297892d47 100644 (file)
@@ -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