Make the decoder Cfg available to encoder tests..

Adds decoder config as a changeable parameter to unit tests, and
changes end to end test to use commonly used parameters to enable
base test of tiles encoding and frame parallel decoding.

Change-Id: I5d23a6857303b4d68b92b15c3f2f04a1bcb4c2bb
This commit is contained in:
Jim Bankoski 2014-12-07 11:28:51 -08:00
parent da464c483f
commit be7a285820
3 changed files with 6 additions and 3 deletions

View File

@ -77,6 +77,7 @@ void Encoder::Flush() {
void EncoderTest::InitializeConfig() { void EncoderTest::InitializeConfig() {
const vpx_codec_err_t res = codec_->DefaultEncoderConfig(&cfg_, 0); const vpx_codec_err_t res = codec_->DefaultEncoderConfig(&cfg_, 0);
dec_cfg_ = vpx_codec_dec_cfg_t();
ASSERT_EQ(VPX_CODEC_OK, res); ASSERT_EQ(VPX_CODEC_OK, res);
} }
@ -139,8 +140,6 @@ void EncoderTest::MismatchHook(const vpx_image_t* /*img1*/,
} }
void EncoderTest::RunLoop(VideoSource *video) { void EncoderTest::RunLoop(VideoSource *video) {
vpx_codec_dec_cfg_t dec_cfg = vpx_codec_dec_cfg_t();
stats_.Reset(); stats_.Reset();
ASSERT_TRUE(passes_ == 1 || passes_ == 2); ASSERT_TRUE(passes_ == 1 || passes_ == 2);
@ -158,7 +157,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
Encoder* const encoder = codec_->CreateEncoder(cfg_, deadline_, init_flags_, Encoder* const encoder = codec_->CreateEncoder(cfg_, deadline_, init_flags_,
&stats_); &stats_);
ASSERT_TRUE(encoder != NULL); ASSERT_TRUE(encoder != NULL);
Decoder* const decoder = codec_->CreateDecoder(dec_cfg, 0); Decoder* const decoder = codec_->CreateDecoder(dec_cfg_, 0);
bool again; bool again;
for (again = true, video->Begin(); again; video->Next()) { for (again = true, video->Begin(); again; video->Next()) {
again = (video->img() != NULL); again = (video->img() != NULL);

View File

@ -238,6 +238,7 @@ class EncoderTest {
bool abort_; bool abort_;
vpx_codec_enc_cfg_t cfg_; vpx_codec_enc_cfg_t cfg_;
vpx_codec_dec_cfg_t dec_cfg_;
unsigned int passes_; unsigned int passes_;
unsigned long deadline_; unsigned long deadline_;
TwopassStatsStore stats_; TwopassStatsStore stats_;

View File

@ -82,6 +82,7 @@ class EndToEndTestLarge
cfg_.g_lag_in_frames = 0; cfg_.g_lag_in_frames = 0;
cfg_.rc_end_usage = VPX_CBR; cfg_.rc_end_usage = VPX_CBR;
} }
dec_cfg_.threads = 4;
test_video_param_ = GET_PARAM(2); test_video_param_ = GET_PARAM(2);
} }
@ -98,6 +99,8 @@ class EndToEndTestLarge
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) { ::libvpx_test::Encoder *encoder) {
if (video->frame() == 1) { if (video->frame() == 1) {
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1);
encoder->Control(VP9E_SET_TILE_COLUMNS, 4);
encoder->Control(VP8E_SET_CPUUSED, kCpuUsed); encoder->Control(VP8E_SET_CPUUSED, kCpuUsed);
if (encoding_mode_ != ::libvpx_test::kRealTime) { if (encoding_mode_ != ::libvpx_test::kRealTime) {
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1); encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);