Index: source/libvpx/test/decode_test_driver.h |
=================================================================== |
--- source/libvpx/test/decode_test_driver.h (revision 191054) |
+++ source/libvpx/test/decode_test_driver.h (working copy) |
@@ -44,13 +44,14 @@ |
Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) |
: cfg_(cfg), deadline_(deadline) { |
memset(&decoder_, 0, sizeof(decoder_)); |
+ Init(); |
} |
~Decoder() { |
vpx_codec_destroy(&decoder_); |
} |
- void DecodeFrame(const uint8_t *cxdata, int size); |
+ vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, int size); |
DxDataIterator GetDxData() { |
return DxDataIterator(&decoder_); |
@@ -65,12 +66,24 @@ |
ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError(); |
} |
- protected: |
+ void Control(int ctrl_id, const void *arg) { |
+ const vpx_codec_err_t res = vpx_codec_control_(&decoder_, ctrl_id, arg); |
+ ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError(); |
+ } |
+ |
const char *DecodeError() { |
const char *detail = vpx_codec_error_detail(&decoder_); |
return detail ? detail : vpx_codec_error(&decoder_); |
} |
+ protected: |
+ void Init() { |
+ const vpx_codec_err_t res = vpx_codec_dec_init(&decoder_, |
+ &vpx_codec_vp8_dx_algo, |
+ &cfg_, 0); |
+ ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError(); |
+ } |
+ |
vpx_codec_ctx_t decoder_; |
vpx_codec_dec_cfg_t cfg_; |
unsigned int deadline_; |