Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
9f89c4c2
Commit
9f89c4c2
authored
Jul 24, 2012
by
Johann
Committed by
Gerrit Code Review
Jul 24, 2012
Browse files
Merge "Make random streams consistant"
parents
903efe8a
e3e63fbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/video_source.h
View file @
9f89c4c2
...
...
@@ -9,6 +9,8 @@
*/
#ifndef TEST_VIDEO_SOURCE_H_
#define TEST_VIDEO_SOURCE_H_
#include
"test/acm_random.h"
#include
"vpx/vpx_encoder.h"
namespace
libvpx_test
{
...
...
@@ -99,16 +101,28 @@ class DummyVideoSource : public VideoSource {
class
RandomVideoSource
:
public
DummyVideoSource
{
public:
RandomVideoSource
()
:
rnd_
(
ACMRandom
::
DeterministicSeed
())
{}
protected:
// Reset the RNG to get a matching stream for the second pass
virtual
void
Begin
()
{
frame_
=
0
;
rnd_
.
Reset
(
ACMRandom
::
DeterministicSeed
());
FillFrame
();
}
// 15 frames of noise, followed by 15 static frames. Reset to 0 rather
// than holding previous frames to encourage keyframes to be thrown.
virtual
void
FillFrame
()
{
if
(
frame_
%
30
<
15
)
for
(
size_t
i
=
0
;
i
<
raw_sz_
;
++
i
)
img_
->
img_data
[
i
]
=
rand
();
img_
->
img_data
[
i
]
=
r
nd_
.
R
and
8
();
else
memset
(
img_
->
img_data
,
0
,
raw_sz_
);
}
ACMRandom
rnd_
;
};
}
// namespace libvpx_test
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment