[Libva] [PATCH intel-driver 2/2] test: read jpeg test data from /dev/urandom
Scott D Phillips
scott.d.phillips at intel.com
Fri Oct 14 23:59:05 UTC 2016
Reading from urandom seems to be faster than using the standard
PRNG.
Signed-off-by: Scott D Phillips <scott.d.phillips at 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
More information about the Libva
mailing list