Skip to content
GitLab
Menu
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
b5906291
Commit
b5906291
authored
Jun 27, 2014
by
James Zern
Committed by
Gerrit Code Review
Jun 27, 2014
Browse files
Merge "Add a test using VP9E_SET_LOSSLESS"
parents
8bf4c43d
4bf24488
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/vp9_lossless_test.cc
View file @
b5906291
...
...
@@ -36,6 +36,17 @@ class LosslessTestLarge : public ::libvpx_test::EncoderTest,
SetMode
(
encoding_mode_
);
}
virtual
void
PreEncodeFrameHook
(
::
libvpx_test
::
VideoSource
*
video
,
::
libvpx_test
::
Encoder
*
encoder
)
{
if
(
video
->
frame
()
==
1
)
{
// Only call Control if quantizer > 0 to verify that using quantizer
// alone will activate lossless
if
(
cfg_
.
rc_max_quantizer
>
0
||
cfg_
.
rc_min_quantizer
>
0
)
{
encoder
->
Control
(
VP9E_SET_LOSSLESS
,
1
);
}
}
}
virtual
void
BeginPassHook
(
unsigned
int
/*pass*/
)
{
psnr_
=
kMaxPsnr
;
nframes_
=
0
;
...
...
@@ -91,5 +102,24 @@ TEST_P(LosslessTestLarge, TestLossLessEncoding444) {
EXPECT_GE
(
psnr_lossless
,
kMaxPsnr
);
}
TEST_P
(
LosslessTestLarge
,
TestLossLessEncodingCtrl
)
{
const
vpx_rational
timebase
=
{
33333333
,
1000000000
};
cfg_
.
g_timebase
=
timebase
;
cfg_
.
rc_target_bitrate
=
2000
;
cfg_
.
g_lag_in_frames
=
25
;
// Intentionally set Q > 0, to make sure control can be used to activate
// lossless
cfg_
.
rc_min_quantizer
=
10
;
cfg_
.
rc_max_quantizer
=
20
;
init_flags_
=
VPX_CODEC_USE_PSNR
;
libvpx_test
::
I420VideoSource
video
(
"hantro_collage_w352h288.yuv"
,
352
,
288
,
timebase
.
den
,
timebase
.
num
,
0
,
10
);
ASSERT_NO_FATAL_FAILURE
(
RunLoop
(
&
video
));
const
double
psnr_lossless
=
GetMinPsnr
();
EXPECT_GE
(
psnr_lossless
,
kMaxPsnr
);
}
VP9_INSTANTIATE_TEST_CASE
(
LosslessTestLarge
,
ALL_TEST_MODES
);
}
// namespace
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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