Reading from urandom seems to be faster than using the standard
PRNG.

Signed-off-by: Scott D Phillips <scott.d.phill...@intel.com>
---
 test/i965_jpeg_test_data.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/i965_jpeg_test_data.cpp b/test/i965_jpeg_test_data.cpp
index 956f7cf..082d43f 100644
--- a/test/i965_jpeg_test_data.cpp
+++ b/test/i965_jpeg_test_data.cpp
@@ -28,6 +28,7 @@
 #include "test_utils.h"
 
 #include <algorithm>
+#include <fstream>
 #include <numeric>
 
 namespace JPEG {
@@ -988,9 +989,8 @@ namespace Encode {
 
         TestInput::Shared input(TestInput::create(fourcc, res[0], res[1]));
         if (input.get()) {
-            std::generate_n(
-                std::begin(input->bytes), input->bytes.size(),
-                RandomValueGenerator<uint8_t>(0x00, 0xff));
+            std::basic_ifstream<uint8_t> urandom("/dev/urandom");
+            urandom.read(input->bytes.data(), input->bytes.size());
         }
         return input;
     }
-- 
2.7.4

_______________________________________________
Libva mailing list
Libva@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libva

Reply via email to