Commit ef877d84 authored by James Zern's avatar James Zern
Browse files

vp9_ethread_test: replace FramePktHook w/DecompressedFrameHook

this avoids the decoder test which was only correct for vp9, vp10 was
missed in the earlier change

Change-Id: Ib789c906d440c0e4169052cf64c74d5e4b196caa
parent 78cde4f5
...@@ -29,16 +29,9 @@ class VPxEncoderThreadTest ...@@ -29,16 +29,9 @@ class VPxEncoderThreadTest
encoding_mode_(GET_PARAM(1)), encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)) { set_cpu_used_(GET_PARAM(2)) {
init_flags_ = VPX_CODEC_USE_PSNR; init_flags_ = VPX_CODEC_USE_PSNR;
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
cfg.w = 1280;
cfg.h = 720;
decoder_ = codec_->CreateDecoder(cfg, 0);
md5_.clear(); md5_.clear();
} }
virtual ~VPxEncoderThreadTest() { virtual ~VPxEncoderThreadTest() {}
delete decoder_;
}
virtual void SetUp() { virtual void SetUp() {
InitializeConfig(); InitializeConfig();
...@@ -81,31 +74,28 @@ class VPxEncoderThreadTest ...@@ -81,31 +74,28 @@ class VPxEncoderThreadTest
} }
} }
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) { virtual void DecompressedFrameHook(const vpx_image_t &img,
#if CONFIG_VP9_DECODER vpx_codec_pts_t /*pts*/) {
const vpx_codec_err_t res = decoder_->DecodeFrame( ::libvpx_test::MD5 md5_res;
reinterpret_cast<uint8_t*>(pkt->data.frame.buf), pkt->data.frame.sz); md5_res.Add(&img);
md5_.push_back(md5_res.Get());
}
virtual bool HandleDecodeResult(const vpx_codec_err_t res,
const libvpx_test::VideoSource& /*video*/,
libvpx_test::Decoder * /*decoder*/) {
if (res != VPX_CODEC_OK) { if (res != VPX_CODEC_OK) {
abort_ = true; EXPECT_EQ(VPX_CODEC_OK, res);
ASSERT_EQ(VPX_CODEC_OK, res); return false;
} }
const vpx_image_t *img = decoder_->GetDxData().Next();
if (img) { return true;
::libvpx_test::MD5 md5_res;
md5_res.Add(img);
md5_.push_back(md5_res.Get());
}
#else
ASSERT_EQ(NULL, decoder_);
#endif
} }
bool encoder_initialized_; bool encoder_initialized_;
int tiles_; int tiles_;
::libvpx_test::TestMode encoding_mode_; ::libvpx_test::TestMode encoding_mode_;
int set_cpu_used_; int set_cpu_used_;
::libvpx_test::Decoder *decoder_;
std::vector<std::string> md5_; std::vector<std::string> md5_;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment