ref: 5d27ee1c08af8351a2a1159fce3819f3c4c207fa
parent: 706bd3d57a2f2b871b1eefb462ce66ecbd4a4c2b
parent: ef877d846f7c5a023033ed5201938f31e4ff2e35
author: James Zern <[email protected]>
date: Fri Apr 29 15:56:55 EDT 2016
Merge "vp9_ethread_test: replace FramePktHook w/DecompressedFrameHook"
--- a/test/vp9_ethread_test.cc
+++ b/test/vp9_ethread_test.cc
@@ -29,16 +29,9 @@
encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)) {
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();
}
- virtual ~VPxEncoderThreadTest() {
- delete decoder_;
- }
+ virtual ~VPxEncoderThreadTest() {}
virtual void SetUp() {
InitializeConfig();
@@ -81,24 +74,22 @@
}
}
- virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
-#if CONFIG_VP9_DECODER
- const vpx_codec_err_t res = decoder_->DecodeFrame(
- reinterpret_cast<uint8_t*>(pkt->data.frame.buf), pkt->data.frame.sz);
+ virtual void DecompressedFrameHook(const vpx_image_t &img,
+ vpx_codec_pts_t /*pts*/) {
+ ::libvpx_test::MD5 md5_res;
+ 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) {
- abort_ = true;
- ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_EQ(VPX_CODEC_OK, res);
+ return false;
}
- const vpx_image_t *img = decoder_->GetDxData().Next();
- if (img) {
- ::libvpx_test::MD5 md5_res;
- md5_res.Add(img);
- md5_.push_back(md5_res.Get());
- }
-#else
- ASSERT_EQ(NULL, decoder_);
-#endif
+ return true;
}
bool encoder_initialized_;
@@ -105,7 +96,6 @@
int tiles_;
::libvpx_test::TestMode encoding_mode_;
int set_cpu_used_;
- ::libvpx_test::Decoder *decoder_;
std::vector<std::string> md5_;
};