diff options
-rw-r--r-- | args.c | 10 | ||||
-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 | 219 | ||||
-rw-r--r-- | test/vp9_frame_parallel_test.cc | 4 | ||||
-rwxr-xr-x | tools/ftfy.sh | 7 | ||||
-rwxr-xr-x | tools/vpx-astyle.sh | 27 | ||||
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_encoder.h | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_lookahead.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_lookahead.h | 6 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 9 | ||||
-rw-r--r-- | webmdec.cc | 2 |
15 files changed, 134 insertions, 218 deletions
@@ -124,7 +124,7 @@ unsigned int arg_parse_uint(const struct arg *arg) { rawval = strtol(arg->val, &endptr, 10); if (arg->val[0] != '\0' && endptr[0] == '\0') { - if (rawval >= 0 && rawval <= UINT_MAX) return rawval; + if (rawval >= 0 && rawval <= UINT_MAX) return (unsigned int)rawval; die("Option %s: Value %ld out of range for unsigned int\n", arg->name, rawval); @@ -141,7 +141,7 @@ int arg_parse_int(const struct arg *arg) { rawval = strtol(arg->val, &endptr, 10); if (arg->val[0] != '\0' && endptr[0] == '\0') { - if (rawval >= INT_MIN && rawval <= INT_MAX) return rawval; + if (rawval >= INT_MIN && rawval <= INT_MAX) return (int)rawval; die("Option %s: Value %ld out of range for signed int\n", arg->name, rawval); @@ -165,7 +165,7 @@ struct vpx_rational arg_parse_rational(const struct arg *arg) { if (arg->val[0] != '\0' && endptr[0] == '/') { if (rawval >= INT_MIN && rawval <= INT_MAX) - rat.num = rawval; + rat.num = (int)rawval; else die("Option %s: Value %ld out of range for signed int\n", arg->name, rawval); @@ -177,7 +177,7 @@ struct vpx_rational arg_parse_rational(const struct arg *arg) { if (arg->val[0] != '\0' && endptr[0] == '\0') { if (rawval >= INT_MIN && rawval <= INT_MAX) - rat.den = rawval; + rat.den = (int)rawval; else die("Option %s: Value %ld out of range for signed int\n", arg->name, rawval); @@ -197,7 +197,7 @@ int arg_parse_enum(const struct arg *arg) { if (arg->val[0] != '\0' && endptr[0] == '\0') { /* Got a raw value, make sure it's valid */ for (listptr = arg->def->enums; listptr->name; listptr++) - if (listptr->val == rawval) return rawval; + if (listptr->val == rawval) return (int)rawval; } /* Next see if it can be parsed as a string */ 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 ea31c0da8..b738e0db1 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 7822361d1..632c98f05 100644 --- a/test/encode_test_driver.cc +++ b/test/encode_test_driver.cc @@ -192,7 +192,7 @@ void EncoderTest::RunLoop(VideoSource *video) { 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..1ab04d935 100644 --- a/test/lpf_8_test.cc +++ b/test/lpf_8_test.cc @@ -35,16 +35,22 @@ const int kNumCoeffs = 1024; const int number_of_iterations = 10000; #if CONFIG_VP9_HIGHBITDEPTH -typedef void (*loop_op_t)(uint16_t *s, int p, const uint8_t *blimit, +typedef uint16_t Pixel; +#define PIXEL_WIDTH 16 + +typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd); -typedef void (*dual_loop_op_t)(uint16_t *s, int p, const uint8_t *blimit0, +typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd); #else -typedef void (*loop_op_t)(uint8_t *s, int p, const uint8_t *blimit, +typedef uint8_t Pixel; +#define PIXEL_WIDTH 8 + +typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh); -typedef void (*dual_loop_op_t)(uint8_t *s, int p, const uint8_t *blimit0, +typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1); @@ -53,6 +59,61 @@ typedef void (*dual_loop_op_t)(uint8_t *s, int p, const uint8_t *blimit0, typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t; typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t; +void InitInput(Pixel *s, Pixel *ref_s, ACMRandom *rnd, const uint8_t limit, + const int mask, const int32_t p, const int i) { + uint16_t tmp_s[kNumCoeffs]; + + for (int j = 0; j < kNumCoeffs;) { + const uint8_t val = rnd->Rand8(); + if (val & 0x80) { // 50% chance to choose a new value. + tmp_s[j] = rnd->Rand16(); + j++; + } else { // 50% chance to repeat previous value in row X times. + int k = 0; + while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { + if (j < 1) { + tmp_s[j] = rnd->Rand16(); + } else if (val & 0x20) { // Increment by a value within the limit. + tmp_s[j] = tmp_s[j - 1] + (limit - 1); + } else { // Decrement by a value within the limit. + tmp_s[j] = tmp_s[j - 1] - (limit - 1); + } + j++; + } + } + } + + for (int 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) { + tmp_s[j] = rnd->Rand16(); + } else if (val & 0x20) { // Increment by a value within the limit. + tmp_s[(j % 32) * 32 + j / 32] = + tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1); + } else { // Decrement by a value within the limit. + tmp_s[(j % 32) * 32 + j / 32] = + tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1); + } + j++; + } + } + } + + for (int j = 0; j < kNumCoeffs; j++) { + if (i % 2) { + s[j] = tmp_s[j] & mask; + } else { + s[j] = tmp_s[p * (j % p) + j / p] & mask; + } + ref_s[j] = s[j]; + } +} + class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> { public: virtual ~Loop8Test6Param() {} @@ -94,14 +155,9 @@ class Loop8Test9Param : public ::testing::TestWithParam<dualloop8_param_t> { TEST_P(Loop8Test6Param, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = number_of_iterations; -#if CONFIG_VP9_HIGHBITDEPTH - const int32_t bd = bit_depth_; - DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); - DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); -#else - DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); - DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); -#endif // CONFIG_VP9_HIGHBITDEPTH + const int32_t p = kNumCoeffs / 32; + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < count_test_block; ++i) { @@ -118,55 +174,11 @@ TEST_P(Loop8Test6Param, OperationCheck) { DECLARE_ALIGNED(16, const uint8_t, thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; - int32_t p = kNumCoeffs / 32; - uint16_t tmp_s[kNumCoeffs]; - int j = 0; - while (j < kNumCoeffs) { - uint8_t val = rnd.Rand8(); - 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. - int k = 0; - while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { - if (j < 1) { - tmp_s[j] = rnd.Rand16(); - } else if (val & 0x20) { // Increment by a value within the limit. - tmp_s[j] = tmp_s[j - 1] + (*limit - 1); - } else { // Decrement by a value within the limit. - tmp_s[j] = tmp_s[j - 1] - (*limit - 1); - } - j++; - } - } else { // 25% chance to repeat previous value in column X times. - int k = 0; - while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { - if (j < 1) { - tmp_s[j] = rnd.Rand16(); - } else if (val & 0x20) { // Increment by a value within the limit. - tmp_s[(j % 32) * 32 + j / 32] = - tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (*limit - 1); - } else { // Decrement by a value within the limit. - tmp_s[(j % 32) * 32 + j / 32] = - tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (*limit - 1); - } - j++; - } - } - } - for (j = 0; j < kNumCoeffs; j++) { - if (i % 2) { - s[j] = tmp_s[j] & mask_; - } else { - s[j] = tmp_s[p * (j % p) + j / p] & mask_; - } - ref_s[j] = s[j]; - } + InitInput(s, ref_s, &rnd, *limit, mask_, p, i); #if CONFIG_VP9_HIGHBITDEPTH - ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bd); + ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_); ASM_REGISTER_STATE_CHECK( - loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd)); + loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_)); #else ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh); ASM_REGISTER_STATE_CHECK( @@ -190,14 +202,8 @@ TEST_P(Loop8Test6Param, OperationCheck) { TEST_P(Loop8Test6Param, ValueCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = number_of_iterations; -#if CONFIG_VP9_HIGHBITDEPTH - const int32_t bd = bit_depth_; - DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); - DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); -#else - DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); - DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); -#endif // CONFIG_VP9_HIGHBITDEPTH + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); int err_count_total = 0; int first_failure = -1; @@ -233,9 +239,9 @@ TEST_P(Loop8Test6Param, ValueCheck) { ref_s[j] = s[j]; } #if CONFIG_VP9_HIGHBITDEPTH - ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bd); + ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_); ASM_REGISTER_STATE_CHECK( - loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd)); + loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_)); #else ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh); ASM_REGISTER_STATE_CHECK( @@ -259,14 +265,8 @@ TEST_P(Loop8Test6Param, ValueCheck) { TEST_P(Loop8Test9Param, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = number_of_iterations; -#if CONFIG_VP9_HIGHBITDEPTH - const int32_t bd = bit_depth_; - DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); - DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); -#else - DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); - DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); -#endif // CONFIG_VP9_HIGHBITDEPTH + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < count_test_block; ++i) { @@ -296,63 +296,21 @@ TEST_P(Loop8Test9Param, OperationCheck) { thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp }; int32_t p = kNumCoeffs / 32; - uint16_t tmp_s[kNumCoeffs]; - int j = 0; const uint8_t limit = *limit0 < *limit1 ? *limit0 : *limit1; - while (j < kNumCoeffs) { - uint8_t val = rnd.Rand8(); - 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. - int k = 0; - while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { - if (j < 1) { - tmp_s[j] = rnd.Rand16(); - } else if (val & 0x20) { // Increment by a value within the limit. - tmp_s[j] = tmp_s[j - 1] + (limit - 1); - } else { // Decrement by a value within the limit. - tmp_s[j] = tmp_s[j - 1] - (limit - 1); - } - j++; - } - } else { // 25% chance to repeat previous value in column X times. - int k = 0; - while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) { - if (j < 1) { - tmp_s[j] = rnd.Rand16(); - } else if (val & 0x20) { // Increment by a value within the limit. - tmp_s[(j % 32) * 32 + j / 32] = - tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1); - } else { // Decrement by a value within the limit. - tmp_s[(j % 32) * 32 + j / 32] = - tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1); - } - j++; - } - } - } - for (j = 0; j < kNumCoeffs; j++) { - if (i % 2) { - s[j] = tmp_s[j] & mask_; - } else { - s[j] = tmp_s[p * (j % p) + j / p] & mask_; - } - ref_s[j] = s[j]; - } + InitInput(s, ref_s, &rnd, limit, mask_, p, i); #if CONFIG_VP9_HIGHBITDEPTH ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, - limit1, thresh1, bd); + limit1, thresh1, bit_depth_); ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1, thresh1, - bd)); + bit_depth_)); #else ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1, thresh1); ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1, thresh1)); #endif // CONFIG_VP9_HIGHBITDEPTH + for (int j = 0; j < kNumCoeffs; ++j) { err_count += ref_s[j] != s[j]; } @@ -370,13 +328,8 @@ TEST_P(Loop8Test9Param, OperationCheck) { TEST_P(Loop8Test9Param, ValueCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = number_of_iterations; -#if CONFIG_VP9_HIGHBITDEPTH - DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); - DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); -#else - DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); - DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); -#endif // CONFIG_VP9_HIGHBITDEPTH + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, s[kNumCoeffs]); + DECLARE_ALIGNED(PIXEL_WIDTH, Pixel, ref_s[kNumCoeffs]); int err_count_total = 0; int first_failure = -1; for (int i = 0; i < count_test_block; ++i) { @@ -411,18 +364,18 @@ TEST_P(Loop8Test9Param, ValueCheck) { ref_s[j] = s[j]; } #if CONFIG_VP9_HIGHBITDEPTH - const int32_t bd = bit_depth_; ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, - limit1, thresh1, bd); + limit1, thresh1, bit_depth_); ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1, thresh1, - bd)); + bit_depth_)); #else ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1, thresh1); ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1, thresh1)); #endif // CONFIG_VP9_HIGHBITDEPTH + for (int j = 0; j < kNumCoeffs; ++j) { err_count += ref_s[j] != s[j]; } 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(); diff --git a/tools/ftfy.sh b/tools/ftfy.sh index 29ae95e9b..c005918fe 100755 --- a/tools/ftfy.sh +++ b/tools/ftfy.sh @@ -32,7 +32,7 @@ vpx_style() { for f; do case "$f" in *.h|*.c|*.cc) - "${dirname_self}"/vpx-astyle.sh "$f" + clang-format -i --style=file "$f" ;; esac done @@ -102,9 +102,8 @@ CLEAN_FILES="${CLEAN_FILES} ${ORIG_COMMIT_MSG} ${NEW_COMMIT_MSG}" # Preconditions [ $# -lt 2 ] || usage -# Check that astyle supports pad-header and align-pointer=name -if ! astyle --pad-header --align-pointer=name < /dev/null; then - log "Install astyle v1.24 or newer" +if ! clang-format -version >/dev/null 2>&1; then + log "clang-format not found" exit 1 fi diff --git a/tools/vpx-astyle.sh b/tools/vpx-astyle.sh deleted file mode 100755 index 6340426bd..000000000 --- a/tools/vpx-astyle.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -set -e -astyle --style=java --indent=spaces=2 --indent-switches\ - --min-conditional-indent=0 \ - --pad-oper --pad-header --unpad-paren \ - --align-pointer=name \ - --indent-preprocessor --convert-tabs --indent-labels \ - --suffix=none --quiet --max-instatement-indent=80 "$@" -# Disabled, too greedy? -#sed -i 's;[[:space:]]\{1,\}\[;[;g' "$@" - -sed_i() { - # Incompatible sed parameter parsing. - if sed -i 2>&1 | grep -q 'requires an argument'; then - sed -i '' "$@" - else - sed -i "$@" - fi -} - -sed_i -e 's/[[:space:]]\{1,\}\([,;]\)/\1/g' \ - -e 's/[[:space:]]\{1,\}\([+-]\{2\};\)/\1/g' \ - -e 's/,[[:space:]]*}/}/g' \ - -e 's;//\([^/[:space:]].*$\);// \1;g' \ - -e 's/^\(public\|private\|protected\):$/ \1:/g' \ - -e 's/[[:space:]]\{1,\}$//g' \ - "$@" diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 6de366c5b..421fcd115 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4051,7 +4051,7 @@ static void check_initial_width(VP9_COMP *cpi, } } -int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, +int vp9_receive_raw_frame(VP9_COMP *cpi, vpx_enc_frame_flags_t frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time) { VP9_COMMON *const cm = &cpi->common; diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index b6d7cabad..1abfaced6 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -602,7 +602,7 @@ void vp9_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf); // receive a frames worth of data. caller can assume that a copy of this // frame is made and not just a copy of the pointer.. -int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, +int vp9_receive_raw_frame(VP9_COMP *cpi, vpx_enc_frame_flags_t frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp); diff --git a/vp9/encoder/vp9_lookahead.c b/vp9/encoder/vp9_lookahead.c index bfcb2ae85..392cd5d41 100644 --- a/vp9/encoder/vp9_lookahead.c +++ b/vp9/encoder/vp9_lookahead.c @@ -87,7 +87,7 @@ int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src, #if CONFIG_VP9_HIGHBITDEPTH int use_highbitdepth, #endif - unsigned int flags) { + vpx_enc_frame_flags_t flags) { struct lookahead_entry *buf; #if USE_PARTIAL_COPY int row, col, active_end; diff --git a/vp9/encoder/vp9_lookahead.h b/vp9/encoder/vp9_lookahead.h index 413c894d7..88be0ffcd 100644 --- a/vp9/encoder/vp9_lookahead.h +++ b/vp9/encoder/vp9_lookahead.h @@ -12,11 +12,11 @@ #define VP9_ENCODER_VP9_LOOKAHEAD_H_ #include "vpx_scale/yv12config.h" +#include "vpx/vpx_encoder.h" #include "vpx/vpx_integer.h" #if CONFIG_SPATIAL_SVC #include "vpx/vp8cx.h" -#include "vpx/vpx_encoder.h" #endif #ifdef __cplusplus @@ -29,7 +29,7 @@ struct lookahead_entry { YV12_BUFFER_CONFIG img; int64_t ts_start; int64_t ts_end; - unsigned int flags; + vpx_enc_frame_flags_t flags; }; // The max of past frames we want to keep in the queue. @@ -81,7 +81,7 @@ int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src, #if CONFIG_VP9_HIGHBITDEPTH int use_highbitdepth, #endif - unsigned int flags); + vpx_enc_frame_flags_t flags); /**\brief Get the next source buffer to encode * diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index a3ef5e5db..707dd5bfb 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1958,6 +1958,10 @@ static int64_t rd_pick_best_sub8x8_mode( MV mvp_full; int max_mv; int cost_list[5]; + int tmp_col_min = x->mv_col_min; + int tmp_col_max = x->mv_col_max; + int tmp_row_min = x->mv_row_min; + int tmp_row_max = x->mv_row_max; /* Is the best so far sufficiently good that we cant justify doing * and new motion search. */ @@ -2005,6 +2009,11 @@ static int64_t rd_pick_best_sub8x8_mode( sf->mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL, &bsi->ref_mv[0]->as_mv, new_mv, INT_MAX, 1); + x->mv_col_min = tmp_col_min; + x->mv_col_max = tmp_col_max; + x->mv_row_min = tmp_row_min; + x->mv_row_max = tmp_row_max; + if (bestsme < UINT_MAX) { uint32_t distortion; cpi->find_fractional_mv_step( diff --git a/webmdec.cc b/webmdec.cc index 8f7797038..ed4bd700d 100644 --- a/webmdec.cc +++ b/webmdec.cc @@ -89,7 +89,7 @@ int file_is_webm(struct WebmInputContext *webm_ctx, const mkvparser::Track *const track = tracks->GetTrackByIndex(i); if (track->GetType() == mkvparser::Track::kVideo) { video_track = static_cast<const mkvparser::VideoTrack *>(track); - webm_ctx->video_track_index = track->GetNumber(); + webm_ctx->video_track_index = static_cast<int>(track->GetNumber()); break; } } |