diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/codec_factory.h | 43 | ||||
-rw-r--r-- | test/decode_test_driver.cc | 2 | ||||
-rw-r--r-- | test/decode_test_driver.h | 15 | ||||
-rw-r--r-- | test/encode_test_driver.cc | 2 | ||||
-rw-r--r-- | test/lpf_8_test.cc | 26 | ||||
-rw-r--r-- | test/vp9_frame_parallel_test.cc | 4 |
6 files changed, 44 insertions, 48 deletions
diff --git a/test/codec_factory.h b/test/codec_factory.h index acbc0a645..e867dacaf 100644 --- a/test/codec_factory.h +++ b/test/codec_factory.h @@ -32,13 +32,10 @@ class CodecFactory { virtual ~CodecFactory() {} - virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, - unsigned long deadline) const = 0; + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const = 0; virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, - const vpx_codec_flags_t flags, - unsigned long deadline) // NOLINT(runtime/int) - const = 0; + const vpx_codec_flags_t flags) const = 0; virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline, @@ -74,12 +71,10 @@ class CodecTestWith3Params #if CONFIG_VP8 class VP8Decoder : public Decoder { public: - VP8Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) - : Decoder(cfg, deadline) {} + explicit VP8Decoder(vpx_codec_dec_cfg_t cfg) : Decoder(cfg) {} - VP8Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, - unsigned long deadline) // NOLINT - : Decoder(cfg, flag, deadline) {} + VP8Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag) + : Decoder(cfg, flag) {} protected: virtual vpx_codec_iface_t *CodecInterface() const { @@ -111,16 +106,14 @@ class VP8CodecFactory : public CodecFactory { public: VP8CodecFactory() : CodecFactory() {} - virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, - unsigned long deadline) const { - return CreateDecoder(cfg, 0, deadline); + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const { + return CreateDecoder(cfg, 0); } virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, - const vpx_codec_flags_t flags, - unsigned long deadline) const { // NOLINT + const vpx_codec_flags_t flags) const { #if CONFIG_VP8_DECODER - return new VP8Decoder(cfg, flags, deadline); + return new VP8Decoder(cfg, flags); #else return NULL; #endif @@ -166,12 +159,10 @@ const libvpx_test::VP8CodecFactory kVP8; #if CONFIG_VP9 class VP9Decoder : public Decoder { public: - VP9Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) - : Decoder(cfg, deadline) {} + explicit VP9Decoder(vpx_codec_dec_cfg_t cfg) : Decoder(cfg) {} - VP9Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, - unsigned long deadline) // NOLINT - : Decoder(cfg, flag, deadline) {} + VP9Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag) + : Decoder(cfg, flag) {} protected: virtual vpx_codec_iface_t *CodecInterface() const { @@ -203,16 +194,14 @@ class VP9CodecFactory : public CodecFactory { public: VP9CodecFactory() : CodecFactory() {} - virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, - unsigned long deadline) const { - return CreateDecoder(cfg, 0, deadline); + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const { + return CreateDecoder(cfg, 0); } virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, - const vpx_codec_flags_t flags, - unsigned long deadline) const { // NOLINT + const vpx_codec_flags_t flags) const { #if CONFIG_VP9_DECODER - return new VP9Decoder(cfg, flags, deadline); + return new VP9Decoder(cfg, flags); #else return NULL; #endif diff --git a/test/decode_test_driver.cc b/test/decode_test_driver.cc index 3417e57b6..58eff7fa4 100644 --- a/test/decode_test_driver.cc +++ b/test/decode_test_driver.cc @@ -65,7 +65,7 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder, void DecoderTest::RunLoop(CompressedVideoSource *video, const vpx_codec_dec_cfg_t &dec_cfg) { - Decoder *const decoder = codec_->CreateDecoder(dec_cfg, flags_, 0); + Decoder *const decoder = codec_->CreateDecoder(dec_cfg, flags_); ASSERT_TRUE(decoder != NULL); bool end_of_file = false; diff --git a/test/decode_test_driver.h b/test/decode_test_driver.h index 553e81ab3..644fc9e90 100644 --- a/test/decode_test_driver.h +++ b/test/decode_test_driver.h @@ -38,17 +38,13 @@ class DxDataIterator { // as more tests are added. class Decoder { public: - Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline) - : cfg_(cfg), flags_(0), deadline_(deadline), init_done_(false) { + explicit Decoder(vpx_codec_dec_cfg_t cfg) + : cfg_(cfg), flags_(0), init_done_(false) { memset(&decoder_, 0, sizeof(decoder_)); } - Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, - unsigned long deadline) // NOLINT - : cfg_(cfg), - flags_(flag), - deadline_(deadline), - init_done_(false) { + Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag) + : cfg_(cfg), flags_(flag), init_done_(false) { memset(&decoder_, 0, sizeof(decoder_)); } @@ -64,8 +60,6 @@ class Decoder { DxDataIterator GetDxData() { return DxDataIterator(&decoder_); } - void set_deadline(unsigned long deadline) { deadline_ = deadline; } - void Control(int ctrl_id, int arg) { Control(ctrl_id, arg, VPX_CODEC_OK); } void Control(int ctrl_id, const void *arg) { @@ -117,7 +111,6 @@ class Decoder { vpx_codec_ctx_t decoder_; vpx_codec_dec_cfg_t cfg_; vpx_codec_flags_t flags_; - unsigned int deadline_; bool init_done_; }; diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc index 6154d3ead..32269afef 100644 --- a/test/encode_test_driver.cc +++ b/test/encode_test_driver.cc @@ -185,7 +185,7 @@ void EncoderTest::RunLoop(VideoSource *video) { if (init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) dec_init_flags |= VPX_CODEC_USE_INPUT_FRAGMENTS; testing::internal::scoped_ptr<Decoder> decoder( - codec_->CreateDecoder(dec_cfg, dec_init_flags, 0)); + codec_->CreateDecoder(dec_cfg, dec_init_flags)); bool again; for (again = true; again; video->Next()) { again = (video->img() != NULL); diff --git a/test/lpf_8_test.cc b/test/lpf_8_test.cc index 4d28f8cad..2f843d799 100644 --- a/test/lpf_8_test.cc +++ b/test/lpf_8_test.cc @@ -126,8 +126,7 @@ TEST_P(Loop8Test6Param, OperationCheck) { if (val & 0x80) { // 50% chance to choose a new value. tmp_s[j] = rnd.Rand16(); j++; - } else if (val & 0x40) { - // 25% chance to repeat previous value in row X times. + } else { // 50% chance to repeat previous value in row X times. int k = 0; while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { if (j < 1) { @@ -139,7 +138,14 @@ TEST_P(Loop8Test6Param, OperationCheck) { } j++; } - } else { // 25% chance to repeat previous value in column X times. + } + } + + for (j = 0; j < kNumCoeffs;) { + const uint8_t val = rnd.Rand8(); + if (val & 0x80) { + j++; + } else { // 50% chance to repeat previous value in column X times. int k = 0; while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { if (j < 1) { @@ -155,6 +161,7 @@ TEST_P(Loop8Test6Param, OperationCheck) { } } } + for (j = 0; j < kNumCoeffs; j++) { if (i % 2) { s[j] = tmp_s[j] & mask_; @@ -304,8 +311,7 @@ TEST_P(Loop8Test9Param, OperationCheck) { if (val & 0x80) { // 50% chance to choose a new value. tmp_s[j] = rnd.Rand16(); j++; - } else if (val & 0x40) { - // 25% chance to repeat previous value in row X times. + } else { // 50% chance to repeat previous value in row X times. int k = 0; while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { if (j < 1) { @@ -317,7 +323,14 @@ TEST_P(Loop8Test9Param, OperationCheck) { } j++; } - } else { // 25% chance to repeat previous value in column X times. + } + } + + for (j = 0; j < kNumCoeffs;) { + const uint8_t val = rnd.Rand8(); + if (val & 0x80) { + j++; + } else { // 50% chance to repeat previous value in column X times. int k = 0; while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { if (j < 1) { @@ -333,6 +346,7 @@ TEST_P(Loop8Test9Param, OperationCheck) { } } } + for (j = 0; j < kNumCoeffs; j++) { if (i % 2) { s[j] = tmp_s[j] & mask_; diff --git a/test/vp9_frame_parallel_test.cc b/test/vp9_frame_parallel_test.cc index 3701b9908..b4db14e00 100644 --- a/test/vp9_frame_parallel_test.cc +++ b/test/vp9_frame_parallel_test.cc @@ -50,7 +50,7 @@ string DecodeFileWithPause(const string &filename, int num_threads, cfg.threads = num_threads; vpx_codec_flags_t flags = 0; flags |= VPX_CODEC_USE_FRAME_THREADING; - libvpx_test::VP9Decoder decoder(cfg, flags, 0); + libvpx_test::VP9Decoder decoder(cfg, flags); libvpx_test::MD5 md5; video.Begin(); @@ -136,7 +136,7 @@ string DecodeFile(const string &filename, int num_threads, vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t(); cfg.threads = num_threads; const vpx_codec_flags_t flags = VPX_CODEC_USE_FRAME_THREADING; - libvpx_test::VP9Decoder decoder(cfg, flags, 0); + libvpx_test::VP9Decoder decoder(cfg, flags); libvpx_test::MD5 md5; video.Begin(); |