diff options
Diffstat (limited to 'third_party/aom/test')
80 files changed, 2632 insertions, 1829 deletions
diff --git a/third_party/aom/test/active_map_refresh_test.cc b/third_party/aom/test/active_map_refresh_test.cc index 7ee86e7e6..184692ca8 100644 --- a/third_party/aom/test/active_map_refresh_test.cc +++ b/third_party/aom/test/active_map_refresh_test.cc @@ -59,8 +59,8 @@ void GenerateMap(int mb_rows, int mb_cols, const aom_image_t ¤t, const int kAqModeCyclicRefresh = 3; class ActiveMapRefreshTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {} virtual ~ActiveMapRefreshTest() {} @@ -108,7 +108,7 @@ TEST_P(ActiveMapRefreshTest, Test) { cfg_.g_lag_in_frames = 0; cfg_.g_profile = 1; cfg_.rc_target_bitrate = 600; - cfg_.rc_resize_allowed = 0; + cfg_.rc_resize_mode = 0; cfg_.rc_min_quantizer = 8; cfg_.rc_max_quantizer = 30; cfg_.g_pass = AOM_RC_ONE_PASS; diff --git a/third_party/aom/test/active_map_test.cc b/third_party/aom/test/active_map_test.cc index a926b0faf..318a8518b 100644 --- a/third_party/aom/test/active_map_test.cc +++ b/third_party/aom/test/active_map_test.cc @@ -20,8 +20,8 @@ namespace { class ActiveMapTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: static const int kWidth = 208; static const int kHeight = 144; @@ -73,7 +73,7 @@ class ActiveMapTest // Validate that this non multiple of 64 wide clip encodes cfg_.g_lag_in_frames = 0; cfg_.rc_target_bitrate = 400; - cfg_.rc_resize_allowed = 0; + cfg_.rc_resize_mode = 0; cfg_.g_pass = AOM_RC_ONE_PASS; cfg_.rc_end_usage = AOM_CBR; cfg_.kf_max_dist = 90000; diff --git a/third_party/aom/test/altref_test.cc b/third_party/aom/test/altref_test.cc index 28b400121..dabb1475a 100644 --- a/third_party/aom/test/altref_test.cc +++ b/third_party/aom/test/altref_test.cc @@ -17,8 +17,8 @@ namespace { class AltRefForcedKeyTestLarge - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: AltRefForcedKeyTestLarge() : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), diff --git a/third_party/aom/test/ans_codec_test.cc b/third_party/aom/test/ans_codec_test.cc index a1b25fbda..59d352b2d 100644 --- a/third_party/aom/test/ans_codec_test.cc +++ b/third_party/aom/test/ans_codec_test.cc @@ -28,8 +28,8 @@ namespace { const char kTestVideoName[] = "niklas_1280_720_30.y4m"; const int kTestVideoFrames = 10; -class AnsCodecTest : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<int> { +class AnsCodecTest : public ::libaom_test::CodecTestWithParam<int>, + public ::libaom_test::EncoderTest { protected: AnsCodecTest() : EncoderTest(GET_PARAM(0)), ans_window_size_log2_(GET_PARAM(1)) {} diff --git a/third_party/aom/test/aq_segment_test.cc b/third_party/aom/test/aq_segment_test.cc index b01f140a0..026b0022b 100644 --- a/third_party/aom/test/aq_segment_test.cc +++ b/third_party/aom/test/aq_segment_test.cc @@ -19,8 +19,8 @@ namespace { class AqSegmentTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: AqSegmentTest() : EncoderTest(GET_PARAM(0)) {} virtual ~AqSegmentTest() {} diff --git a/third_party/aom/test/arf_freq_test.cc b/third_party/aom/test/arf_freq_test.cc index bef58b3e8..b4b17c9ab 100644 --- a/third_party/aom/test/arf_freq_test.cc +++ b/third_party/aom/test/arf_freq_test.cc @@ -76,9 +76,9 @@ int is_extension_y4m(const char *filename) { } class ArfFreqTestLarge - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith3Params<TestVideoParam, - TestEncodeParam, int> { + : public ::libaom_test::CodecTestWith3Params<TestVideoParam, + TestEncodeParam, int>, + public ::libaom_test::EncoderTest { protected: ArfFreqTestLarge() : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(1)), @@ -99,7 +99,6 @@ class ArfFreqTestLarge cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_optimal_sz = 600; } - dec_cfg_.threads = 4; } virtual void BeginPassHook(unsigned int) { diff --git a/third_party/aom/test/av1_convolve_2d_test.cc b/third_party/aom/test/av1_convolve_2d_test.cc new file mode 100644 index 000000000..b066dd4f8 --- /dev/null +++ b/third_party/aom/test/av1_convolve_2d_test.cc @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" +#include "test/av1_convolve_2d_test_util.h" + +using std::tr1::tuple; +using std::tr1::make_tuple; +using libaom_test::ACMRandom; +using libaom_test::AV1Convolve2D::AV1Convolve2DTest; +#if CONFIG_HIGHBITDEPTH +using libaom_test::AV1HighbdConvolve2D::AV1HighbdConvolve2DTest; +#endif + +namespace { + +TEST_P(AV1Convolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); } + +INSTANTIATE_TEST_CASE_P( + SSE2, AV1Convolve2DTest, + libaom_test::AV1Convolve2D::BuildParams(av1_convolve_2d_sse2)); + +#if CONFIG_HIGHBITDEPTH && HAVE_SSSE3 +TEST_P(AV1HighbdConvolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(4)); } + +INSTANTIATE_TEST_CASE_P(SSSE3, AV1HighbdConvolve2DTest, + libaom_test::AV1HighbdConvolve2D::BuildParams( + av1_highbd_convolve_2d_ssse3)); + +#endif + +} // namespace diff --git a/third_party/aom/test/av1_convolve_2d_test_util.cc b/third_party/aom/test/av1_convolve_2d_test_util.cc new file mode 100644 index 000000000..8cec216af --- /dev/null +++ b/third_party/aom/test/av1_convolve_2d_test_util.cc @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2016, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#include "test/av1_convolve_2d_test_util.h" + +#include "av1/common/convolve.h" + +using std::tr1::tuple; +using std::tr1::make_tuple; + +namespace libaom_test { + +namespace AV1Convolve2D { + +::testing::internal::ParamGenerator<Convolve2DParam> BuildParams( + convolve_2d_func filter) { + const Convolve2DParam params[] = { + make_tuple(4, 4, 20, filter), make_tuple(8, 8, 10, filter), + make_tuple(64, 64, 1, filter), make_tuple(4, 16, 10, filter), + make_tuple(32, 8, 5, filter), + }; + return ::testing::ValuesIn(params); +} + +AV1Convolve2DTest::~AV1Convolve2DTest() {} +void AV1Convolve2DTest::SetUp() { rnd_.Reset(ACMRandom::DeterministicSeed()); } + +void AV1Convolve2DTest::TearDown() { libaom_test::ClearSystemState(); } + +void AV1Convolve2DTest::RunCheckOutput(convolve_2d_func test_impl) { + const int w = 128, h = 128; + const int out_w = GET_PARAM(0), out_h = GET_PARAM(1); + const int num_iters = GET_PARAM(2); + int i, j, k; + + uint8_t *input = new uint8_t[h * w]; + + int output_n = out_h * MAX_SB_SIZE; + CONV_BUF_TYPE *output = new CONV_BUF_TYPE[output_n]; + CONV_BUF_TYPE *output2 = new CONV_BUF_TYPE[output_n]; + + for (i = 0; i < h; ++i) + for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand8(); + + memset(output, 0, output_n * sizeof(CONV_BUF_TYPE)); + memset(output2, 0, output_n * sizeof(CONV_BUF_TYPE)); + + int hfilter, vfilter, subx, suby; + for (hfilter = EIGHTTAP_REGULAR; hfilter < INTERP_FILTERS_ALL; ++hfilter) { + for (vfilter = EIGHTTAP_REGULAR; vfilter < INTERP_FILTERS_ALL; ++vfilter) { + InterpFilterParams filter_params_x = + av1_get_interp_filter_params((InterpFilter)hfilter); + InterpFilterParams filter_params_y = + av1_get_interp_filter_params((InterpFilter)vfilter); + ConvolveParams conv_params1 = + get_conv_params_no_round(0, 0, 0, output, MAX_SB_SIZE); + ConvolveParams conv_params2 = + get_conv_params_no_round(0, 0, 0, output2, MAX_SB_SIZE); + + for (subx = 0; subx < 16; ++subx) + for (suby = 0; suby < 16; ++suby) { + for (i = 0; i < num_iters; ++i) { + // Choose random locations within the source block + int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); + av1_convolve_2d_c(input + offset_r * w + offset_c, w, output, + MAX_SB_SIZE, out_w, out_h, &filter_params_x, + &filter_params_y, subx, suby, &conv_params1); + test_impl(input + offset_r * w + offset_c, w, output2, MAX_SB_SIZE, + out_w, out_h, &filter_params_x, &filter_params_y, subx, + suby, &conv_params2); + + for (j = 0; j < out_h; ++j) + for (k = 0; k < out_w; ++k) { + int idx = j * MAX_SB_SIZE + k; + ASSERT_EQ(output[idx], output2[idx]) + << "Pixel mismatch at index " << idx << " = (" << j << ", " + << k << "), sub pixel offset = (" << suby << ", " << subx + << ")"; + } + } + } + } + } + delete[] input; + delete[] output; + delete[] output2; +} +} // namespace AV1Convolve2D + +#if CONFIG_HIGHBITDEPTH +namespace AV1HighbdConvolve2D { + +::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams( + highbd_convolve_2d_func filter) { + const HighbdConvolve2DParam params[] = { + make_tuple(4, 4, 20, 8, filter), make_tuple(8, 8, 10, 8, filter), + make_tuple(64, 64, 1, 8, filter), make_tuple(4, 16, 10, 8, filter), + make_tuple(32, 8, 10, 8, filter), make_tuple(4, 4, 20, 10, filter), + make_tuple(8, 8, 10, 10, filter), make_tuple(64, 64, 1, 10, filter), + make_tuple(4, 16, 10, 10, filter), make_tuple(32, 8, 10, 10, filter), + make_tuple(4, 4, 20, 12, filter), make_tuple(8, 8, 10, 12, filter), + make_tuple(64, 64, 1, 12, filter), make_tuple(4, 16, 10, 12, filter), + make_tuple(32, 8, 10, 12, filter), + }; + return ::testing::ValuesIn(params); +} + +AV1HighbdConvolve2DTest::~AV1HighbdConvolve2DTest() {} +void AV1HighbdConvolve2DTest::SetUp() { + rnd_.Reset(ACMRandom::DeterministicSeed()); +} + +void AV1HighbdConvolve2DTest::TearDown() { libaom_test::ClearSystemState(); } + +void AV1HighbdConvolve2DTest::RunCheckOutput( + highbd_convolve_2d_func test_impl) { + const int w = 128, h = 128; + const int out_w = GET_PARAM(0), out_h = GET_PARAM(1); + const int num_iters = GET_PARAM(2); + const int bd = GET_PARAM(3); + int i, j, k; + + uint16_t *input = new uint16_t[h * w]; + + int output_n = out_h * MAX_SB_SIZE; + CONV_BUF_TYPE *output = new CONV_BUF_TYPE[output_n]; + CONV_BUF_TYPE *output2 = new CONV_BUF_TYPE[output_n]; + + for (i = 0; i < h; ++i) + for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand16() & ((1 << bd) - 1); + + memset(output, 0, output_n * sizeof(CONV_BUF_TYPE)); + memset(output2, 0, output_n * sizeof(CONV_BUF_TYPE)); + + int hfilter, vfilter, subx, suby; + for (hfilter = EIGHTTAP_REGULAR; hfilter < INTERP_FILTERS_ALL; ++hfilter) { + for (vfilter = EIGHTTAP_REGULAR; vfilter < INTERP_FILTERS_ALL; ++vfilter) { + InterpFilterParams filter_params_x = + av1_get_interp_filter_params((InterpFilter)hfilter); + InterpFilterParams filter_params_y = + av1_get_interp_filter_params((InterpFilter)vfilter); + ConvolveParams conv_params1 = + get_conv_params_no_round(0, 0, 0, output, MAX_SB_SIZE); + ConvolveParams conv_params2 = + get_conv_params_no_round(0, 0, 0, output2, MAX_SB_SIZE); + + for (subx = 0; subx < 16; ++subx) + for (suby = 0; suby < 16; ++suby) { + for (i = 0; i < num_iters; ++i) { + // Choose random locations within the source block + int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); + av1_highbd_convolve_2d_c(input + offset_r * w + offset_c, w, output, + MAX_SB_SIZE, out_w, out_h, + &filter_params_x, &filter_params_y, subx, + suby, &conv_params1, bd); + test_impl(input + offset_r * w + offset_c, w, output2, MAX_SB_SIZE, + out_w, out_h, &filter_params_x, &filter_params_y, subx, + suby, &conv_params2, bd); + + for (j = 0; j < out_h; ++j) + for (k = 0; k < out_w; ++k) { + int idx = j * MAX_SB_SIZE + k; + ASSERT_EQ(output[idx], output2[idx]) + << "Pixel mismatch at index " << idx << " = (" << j << ", " + << k << "), sub pixel offset = (" << suby << ", " << subx + << ")"; + } + } + } + } + } + delete[] input; + delete[] output; + delete[] output2; +} +} // namespace AV1HighbdConvolve2D +#endif // CONFIG_HIGHBITDEPTH +} // namespace libaom_test diff --git a/third_party/aom/test/av1_convolve_2d_test_util.h b/third_party/aom/test/av1_convolve_2d_test_util.h new file mode 100644 index 000000000..ed0eeb450 --- /dev/null +++ b/third_party/aom/test/av1_convolve_2d_test_util.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2016, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#ifndef TEST_HIPREC_CONVOLVE_TEST_UTIL_H_ +#define TEST_HIPREC_CONVOLVE_TEST_UTIL_H_ + +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" +#include "test/acm_random.h" +#include "test/util.h" +#include "./av1_rtcd.h" +#include "./aom_dsp_rtcd.h" +#include "test/clear_system_state.h" +#include "test/register_state_check.h" + +namespace libaom_test { + +namespace AV1Convolve2D { + +typedef void (*convolve_2d_func)(const uint8_t *src, int src_stride, + CONV_BUF_TYPE *dst, int dst_stride, int w, + int h, InterpFilterParams *filter_params_x, + InterpFilterParams *filter_params_y, + const int subpel_x_q4, const int subpel_y_q4, + ConvolveParams *conv_params); + +typedef std::tr1::tuple<int, int, int, convolve_2d_func> Convolve2DParam; + +::testing::internal::ParamGenerator<Convolve2DParam> BuildParams( + convolve_2d_func filter); + +class AV1Convolve2DTest : public ::testing::TestWithParam<Convolve2DParam> { + public: + virtual ~AV1Convolve2DTest(); + virtual void SetUp(); + + virtual void TearDown(); + + protected: + void RunCheckOutput(convolve_2d_func test_impl); + + libaom_test::ACMRandom rnd_; +}; + +} // namespace AV1Convolve2D + +#if CONFIG_HIGHBITDEPTH +namespace AV1HighbdConvolve2D { +typedef void (*highbd_convolve_2d_func)( + const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride, + int w, int h, InterpFilterParams *filter_params_x, + InterpFilterParams *filter_params_y, const int subpel_x_q4, + const int subpel_y_q4, ConvolveParams *conv_params, int bd); + +typedef std::tr1::tuple<int, int, int, int, highbd_convolve_2d_func> + HighbdConvolve2DParam; + +::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams( + highbd_convolve_2d_func filter); + +class AV1HighbdConvolve2DTest + : public ::testing::TestWithParam<HighbdConvolve2DParam> { + public: + virtual ~AV1HighbdConvolve2DTest(); + virtual void SetUp(); + + virtual void TearDown(); + + protected: + void RunCheckOutput(highbd_convolve_2d_func test_impl); + + libaom_test::ACMRandom rnd_; +}; + +} // namespace AV1HighbdConvolve2D +#endif // CONFIG_HIGHBITDEPTH + +} // namespace libaom_test + +#endif // TEST_HIPREC_CONVOLVE_TEST_UTIL_H_ diff --git a/third_party/aom/test/av1_convolve_optimz_test.cc b/third_party/aom/test/av1_convolve_optimz_test.cc index c32f4cb95..95bf63f44 100644 --- a/third_party/aom/test/av1_convolve_optimz_test.cc +++ b/third_party/aom/test/av1_convolve_optimz_test.cc @@ -74,7 +74,7 @@ class AV1ConvolveOptimzTest : public ::testing::TestWithParam<ConvParams> { subpel_ = GET_PARAM(5); int ref = GET_PARAM(6); const int plane = 0; - conv_params_ = get_conv_params(ref, plane); + conv_params_ = get_conv_params(ref, ref, plane); alloc_ = new uint8_t[maxBlockSize * 4]; src_ = alloc_ + (vertiOffset * maxWidth); diff --git a/third_party/aom/test/av1_convolve_test.cc b/third_party/aom/test/av1_convolve_test.cc index 9ea662381..3947c7166 100644 --- a/third_party/aom/test/av1_convolve_test.cc +++ b/third_party/aom/test/av1_convolve_test.cc @@ -145,11 +145,11 @@ class Av1ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { }; int bsize_ls[] = { 1, 2, 4, 8, 16, 32, 64, 3, 7, 15, 31, 63 }; -int bsize_num = sizeof(bsize_ls) / sizeof(bsize_ls[0]); +int bsize_num = NELEMENTS(bsize_ls); TEST_P(Av1ConvolveTest, av1_convolve_vert) { const int y_step_q4 = 16; - ConvolveParams conv_params = get_conv_params(0, 0); + ConvolveParams conv_params = get_conv_params(0, 0, 0); int in_stride, out_stride, ref_out_stride, avg_out_stride, ref_avg_out_stride; uint8_t *in = add_input(MAX_SB_SIZE, MAX_SB_SIZE, &in_stride); @@ -172,6 +172,7 @@ TEST_P(Av1ConvolveTest, av1_convolve_vert) { ref_out, ref_out_stride, w, h); conv_params.ref = 0; + conv_params.do_average = 0; cfs_->vf_(in, in_stride, out, out_stride, w, h, param_vert, subpel_y_q4, y_step_q4, &conv_params); EXPECT_EQ(match(out, out_stride, ref_out, ref_out_stride, w, h), 1) @@ -186,6 +187,7 @@ TEST_P(Av1ConvolveTest, av1_convolve_vert) { } } conv_params.ref = 1; + conv_params.do_average = 1; cfs_->vf_(in, in_stride, avg_out, avg_out_stride, w, h, param_vert, subpel_y_q4, y_step_q4, &conv_params); EXPECT_EQ(match(avg_out, avg_out_stride, ref_avg_out, @@ -200,7 +202,7 @@ TEST_P(Av1ConvolveTest, av1_convolve_vert) { TEST_P(Av1ConvolveTest, av1_convolve_horiz) { const int x_step_q4 = 16; - ConvolveParams conv_params = get_conv_params(0, 0); + ConvolveParams conv_params = get_conv_params(0, 0, 0); int in_stride, out_stride, ref_out_stride, avg_out_stride, ref_avg_out_stride; uint8_t *in = add_input(MAX_SB_SIZE, MAX_SB_SIZE, &in_stride); @@ -223,6 +225,7 @@ TEST_P(Av1ConvolveTest, av1_convolve_horiz) { ref_out, ref_out_stride, w, h); conv_params.ref = 0; + conv_params.do_average = 0; cfs_->hf_(in, in_stride, out, out_stride, w, h, param_horiz, subpel_x_q4, x_step_q4, &conv_params); EXPECT_EQ(match(out, out_stride, ref_out, ref_out_stride, w, h), 1) @@ -237,6 +240,7 @@ TEST_P(Av1ConvolveTest, av1_convolve_horiz) { } } conv_params.ref = 1; + conv_params.do_average = 1; cfs_->hf_(in, in_stride, avg_out, avg_out_stride, w, h, param_horiz, subpel_x_q4, x_step_q4, &conv_params); EXPECT_EQ(match(avg_out, avg_out_stride, ref_avg_out, diff --git a/third_party/aom/test/av1_dct_test.cc b/third_party/aom/test/av1_dct_test.cc index 691cc8b79..8ce7a79d4 100644 --- a/third_party/aom/test/av1_dct_test.cc +++ b/third_party/aom/test/av1_dct_test.cc @@ -23,6 +23,9 @@ #define CONFIG_COEFFICIENT_RANGE_CHECKING 1 #define AV1_DCT_GTEST #include "av1/encoder/dct.c" +#if CONFIG_DAALA_DCT4 || CONFIG_DAALA_DCT8 +#include "av1/common/daala_tx.c" +#endif using libaom_test::ACMRandom; diff --git a/third_party/aom/test/av1_ext_tile_test.cc b/third_party/aom/test/av1_ext_tile_test.cc index f96447965..034b07167 100644 --- a/third_party/aom/test/av1_ext_tile_test.cc +++ b/third_party/aom/test/av1_ext_tile_test.cc @@ -30,11 +30,11 @@ const int kTIleSizeInPixels = (kTileSize << 6); const int kImgWidth = 704; const int kImgHeight = 576; -// This test tests "tile_encoding_mode = TILE_VR" case. The TILE_NORMAL case is -// tested by the tile_independence test. +// This test tests large scale tile coding case. Non-large-scale tile coding +// is tested by the tile_independence test. class AV1ExtTileTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: AV1ExtTileTest() : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), @@ -43,6 +43,7 @@ class AV1ExtTileTest aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t(); cfg.w = kImgWidth; cfg.h = kImgHeight; + cfg.allow_lowbitdepth = 1; decoder_ = codec_->CreateDecoder(cfg, 0); decoder_->Control(AV1_SET_DECODE_TILE_ROW, -1); @@ -83,11 +84,15 @@ class AV1ExtTileTest // The tile size is 64x64. encoder->Control(AV1E_SET_TILE_COLUMNS, kTileSize); encoder->Control(AV1E_SET_TILE_ROWS, kTileSize); - encoder->Control(AV1E_SET_TILE_ENCODING_MODE, 1); // TILE_VR + // TODO(yunqingwang): test single_tile_decoding = 0. + encoder->Control(AV1E_SET_SINGLE_TILE_DECODING, 1); #if CONFIG_EXT_PARTITION // Always use 64x64 max partition. encoder->Control(AV1E_SET_SUPERBLOCK_SIZE, AOM_SUPERBLOCK_SIZE_64X64); #endif +#if CONFIG_LOOPFILTERING_ACROSS_TILES + encoder->Control(AV1E_SET_TILE_LOOPFILTER, 0); +#endif } if (video->frame() == 1) { @@ -182,6 +187,7 @@ TEST_P(AV1ExtTileTest, DecoderResultTest) { kImgHeight, 30, 1, 0, kLimit); cfg_.rc_target_bitrate = 500; cfg_.g_error_resilient = AOM_ERROR_RESILIENT_DEFAULT; + cfg_.large_scale_tile = 1; cfg_.g_lag_in_frames = 0; cfg_.g_threads = 1; diff --git a/third_party/aom/test/av1_fht16x16_test.cc b/third_party/aom/test/av1_fht16x16_test.cc index e1032ef24..c0f6974c6 100644 --- a/third_party/aom/test/av1_fht16x16_test.cc +++ b/third_party/aom/test/av1_fht16x16_test.cc @@ -25,18 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x16Param; -void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x16_c(in, out, stride, tx_type); +void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht16x16_c(in, out, stride, txfm_param); } void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, - int tx_type) { - av1_iht16x16_256_add_c(in, dest, stride, tx_type); + const TxfmParam *txfm_param) { + av1_iht16x16_256_add_c(in, dest, stride, txfm_param); } #if CONFIG_HIGHBITDEPTH @@ -62,7 +63,6 @@ class AV1Trans16x16HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 16; height_ = 16; fwd_txfm_ref = fht16x16_ref; @@ -70,16 +70,17 @@ class AV1Trans16x16HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht16x32_test.cc b/third_party/aom/test/av1_fht16x32_test.cc index 43d025327..099a312e3 100644 --- a/third_party/aom/test/av1_fht16x32_test.cc +++ b/third_party/aom/test/av1_fht16x32_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x32Param; -void fht16x32_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x32_c(in, out, stride, tx_type); +void fht16x32_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht16x32_c(in, out, stride, txfm_param); } -void iht16x32_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht16x32_512_add_c(in, out, stride, tx_type); +void iht16x32_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht16x32_512_add_c(in, out, stride, txfm_param); } class AV1Trans16x32HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans16x32HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 16; height_ = 32; fwd_txfm_ref = fht16x32_ref; @@ -54,16 +55,17 @@ class AV1Trans16x32HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht16x8_test.cc b/third_party/aom/test/av1_fht16x8_test.cc index d99bec5eb..8277e2865 100644 --- a/third_party/aom/test/av1_fht16x8_test.cc +++ b/third_party/aom/test/av1_fht16x8_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x8Param; -void fht16x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x8_c(in, out, stride, tx_type); +void fht16x8_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht16x8_c(in, out, stride, txfm_param); } -void iht16x8_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht16x8_128_add_c(in, out, stride, tx_type); +void iht16x8_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht16x8_128_add_c(in, out, stride, txfm_param); } class AV1Trans16x8HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans16x8HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 16; height_ = 8; inv_txfm_ref = iht16x8_ref; @@ -54,16 +55,17 @@ class AV1Trans16x8HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht32x16_test.cc b/third_party/aom/test/av1_fht32x16_test.cc index e38283f86..1c70fd4fc 100644 --- a/third_party/aom/test/av1_fht32x16_test.cc +++ b/third_party/aom/test/av1_fht32x16_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht32x16Param; -void fht32x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht32x16_c(in, out, stride, tx_type); +void fht32x16_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht32x16_c(in, out, stride, txfm_param); } -void iht32x16_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht32x16_512_add_c(in, out, stride, tx_type); +void iht32x16_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht32x16_512_add_c(in, out, stride, txfm_param); } class AV1Trans32x16HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans32x16HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 32; height_ = 16; fwd_txfm_ref = fht32x16_ref; @@ -54,16 +55,17 @@ class AV1Trans32x16HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht32x32_test.cc b/third_party/aom/test/av1_fht32x32_test.cc index cdd915337..e96ffffc2 100644 --- a/third_party/aom/test/av1_fht32x32_test.cc +++ b/third_party/aom/test/av1_fht32x32_test.cc @@ -25,13 +25,14 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht32x32Param; -void fht32x32_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht32x32_c(in, out, stride, tx_type); +void fht32x32_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht32x32_c(in, out, stride, txfm_param); } #if CONFIG_HIGHBITDEPTH @@ -51,11 +52,11 @@ void highbd_fht32x32_ref(const int16_t *in, int32_t *out, int stride, #if HAVE_SSE2 || HAVE_AVX2 void dummy_inv_txfm(const tran_low_t *in, uint8_t *out, int stride, - int tx_type) { + const TxfmParam *txfm_param) { (void)in; (void)out; (void)stride; - (void)tx_type; + (void)txfm_param; } #endif @@ -67,23 +68,23 @@ class AV1Trans32x32HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 32; height_ = 32; fwd_txfm_ref = fht32x32_ref; bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht4x4_test.cc b/third_party/aom/test/av1_fht4x4_test.cc index 42837d3a4..f49d7368d 100644 --- a/third_party/aom/test/av1_fht4x4_test.cc +++ b/third_party/aom/test/av1_fht4x4_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param; -void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht4x4_c(in, out, stride, tx_type); +void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht4x4_c(in, out, stride, txfm_param); } -void iht4x4_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht4x4_16_add_c(in, out, stride, tx_type); +void iht4x4_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht4x4_16_add_c(in, out, stride, txfm_param); } #if CONFIG_HIGHBITDEPTH @@ -62,7 +64,6 @@ class AV1Trans4x4HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fht4x4_ref; @@ -70,16 +71,17 @@ class AV1Trans4x4HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht4x8_test.cc b/third_party/aom/test/av1_fht4x8_test.cc index a899c8739..e447d8e2e 100644 --- a/third_party/aom/test/av1_fht4x8_test.cc +++ b/third_party/aom/test/av1_fht4x8_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x8Param; -void fht4x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht4x8_c(in, out, stride, tx_type); +void fht4x8_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht4x8_c(in, out, stride, txfm_param); } -void iht4x8_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht4x8_32_add_c(in, out, stride, tx_type); +void iht4x8_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht4x8_32_add_c(in, out, stride, txfm_param); } class AV1Trans4x8HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans4x8HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 8; fwd_txfm_ref = fht4x8_ref; @@ -54,16 +55,17 @@ class AV1Trans4x8HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht64x64_test.cc b/third_party/aom/test/av1_fht64x64_test.cc index cde1d0ca3..61ea9f1f3 100644 --- a/third_party/aom/test/av1_fht64x64_test.cc +++ b/third_party/aom/test/av1_fht64x64_test.cc @@ -26,18 +26,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht64x64Param; -void fht64x64_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht64x64_c(in, out, stride, tx_type); +void fht64x64_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht64x64_c(in, out, stride, txfm_param); } void iht64x64_ref(const tran_low_t *in, uint8_t *dest, int stride, - int tx_type) { - av1_iht64x64_4096_add_c(in, dest, stride, tx_type); + const TxfmParam *txfm_param) { + av1_iht64x64_4096_add_c(in, dest, stride, txfm_param); } class AV1Trans64x64HT : public libaom_test::TransformTestBase, @@ -48,7 +49,6 @@ class AV1Trans64x64HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 64; height_ = 64; fwd_txfm_ref = fht64x64_ref; @@ -56,16 +56,17 @@ class AV1Trans64x64HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht8x16_test.cc b/third_party/aom/test/av1_fht8x16_test.cc index ace9a8f47..11f085885 100644 --- a/third_party/aom/test/av1_fht8x16_test.cc +++ b/third_party/aom/test/av1_fht8x16_test.cc @@ -24,17 +24,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x16Param; -void fht8x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x16_c(in, out, stride, tx_type); +void fht8x16_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht8x16_c(in, out, stride, txfm_param); } -void iht8x16_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht8x16_128_add_c(in, out, stride, tx_type); +void iht8x16_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht8x16_128_add_c(in, out, stride, txfm_param); } class AV1Trans8x16HT : public libaom_test::TransformTestBase, @@ -45,7 +47,6 @@ class AV1Trans8x16HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; height_ = 16; inv_txfm_ref = iht8x16_ref; @@ -53,16 +54,17 @@ class AV1Trans8x16HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht8x4_test.cc b/third_party/aom/test/av1_fht8x4_test.cc index 9bf4ff647..c797421af 100644 --- a/third_party/aom/test/av1_fht8x4_test.cc +++ b/third_party/aom/test/av1_fht8x4_test.cc @@ -24,17 +24,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x4Param; -void fht8x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x4_c(in, out, stride, tx_type); +void fht8x4_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht8x4_c(in, out, stride, txfm_param); } -void iht8x4_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht8x4_32_add_c(in, out, stride, tx_type); +void iht8x4_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht8x4_32_add_c(in, out, stride, txfm_param); } class AV1Trans8x4HT : public libaom_test::TransformTestBase, @@ -45,7 +47,6 @@ class AV1Trans8x4HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; height_ = 4; fwd_txfm_ref = fht8x4_ref; @@ -53,16 +54,17 @@ class AV1Trans8x4HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fht8x8_test.cc b/third_party/aom/test/av1_fht8x8_test.cc index 99cff1014..259557cfb 100644 --- a/third_party/aom/test/av1_fht8x8_test.cc +++ b/third_party/aom/test/av1_fht8x8_test.cc @@ -25,18 +25,20 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using libaom_test::FhtFunc; using std::tr1::tuple; typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x8Param; -void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x8_c(in, out, stride, tx_type); +void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht8x8_c(in, out, stride, txfm_param); } -void iht8x8_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht8x8_64_add_c(in, out, stride, tx_type); +void iht8x8_ref(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_iht8x8_64_add_c(in, out, stride, txfm_param); } #if CONFIG_HIGHBITDEPTH @@ -61,7 +63,6 @@ class AV1Trans8x8HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; height_ = 8; fwd_txfm_ref = fht8x8_ref; @@ -69,16 +70,17 @@ class AV1Trans8x8HT : public libaom_test::TransformTestBase, bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; diff --git a/third_party/aom/test/av1_fwd_txfm1d_test.cc b/third_party/aom/test/av1_fwd_txfm1d_test.cc index 511e057fa..b10e84d2c 100644 --- a/third_party/aom/test/av1_fwd_txfm1d_test.cc +++ b/third_party/aom/test/av1_fwd_txfm1d_test.cc @@ -82,7 +82,7 @@ TEST(av1_fwd_txfm1d, clamp_block) { int col = 1; int block_size = 3; int stride = 5; - clamp_block(block[row] + col, block_size, stride, -4, 2); + clamp_block(block[row] + col, block_size, block_size, stride, -4, 2); for (int r = 0; r < stride; r++) { for (int c = 0; c < stride; c++) { EXPECT_EQ(block[r][c], ref_block[r][c]); diff --git a/third_party/aom/test/av1_inv_txfm1d_test.cc b/third_party/aom/test/av1_inv_txfm1d_test.cc index 9cf33a2fd..b871105eb 100644 --- a/third_party/aom/test/av1_inv_txfm1d_test.cc +++ b/third_party/aom/test/av1_inv_txfm1d_test.cc @@ -10,6 +10,7 @@ */ #include "test/av1_txfm_test.h" +#include "test/util.h" #include "av1/common/av1_fwd_txfm1d.h" #include "av1/common/av1_inv_txfm1d.h" @@ -41,14 +42,12 @@ const TxfmFunc inv_txfm_func_ls[][2] = { }; // the maximum stage number of fwd/inv 1d dct/adst txfm is 12 -const int8_t cos_bit[12] = { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 }; +const int8_t cos_bit[12] = { 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 }; const int8_t range_bit[12] = { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 }; -#define ARRAY_SIZE(x) (int)(sizeof(x) / sizeof(x[0])) - TEST(av1_inv_txfm1d, round_trip) { ACMRandom rnd(ACMRandom::DeterministicSeed()); - for (int si = 0; si < ARRAY_SIZE(fwd_txfm_func_ls); ++si) { + for (int si = 0; si < NELEMENTS(fwd_txfm_func_ls); ++si) { int txfm_size = txfm_size_ls[si]; for (int ti = 0; ti < txfm_type_num; ++ti) { @@ -64,7 +63,7 @@ TEST(av1_inv_txfm1d, round_trip) { int32_t output[64]; int32_t round_trip_output[64]; - assert(txfm_size <= ARRAY_SIZE(input)); + ASSERT_LE(txfm_size, NELEMENTS(input)); for (int ni = 0; ni < txfm_size; ++ni) { input[ni] = rnd.Rand16() % input_base - rnd.Rand16() % input_base; diff --git a/third_party/aom/test/av1_inv_txfm2d_test.cc b/third_party/aom/test/av1_inv_txfm2d_test.cc index 89ae34b01..5185c1ca8 100644 --- a/third_party/aom/test/av1_inv_txfm2d_test.cc +++ b/third_party/aom/test/av1_inv_txfm2d_test.cc @@ -42,14 +42,6 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> { max_avg_error_ = GET_PARAM(3); txfm1d_size_ = libaom_test::get_txfm1d_size(tx_size_); txfm2d_size_ = txfm1d_size_ * txfm1d_size_; - count_ = 500; - - input_ = reinterpret_cast<int16_t *>( - aom_memalign(16, sizeof(int16_t) * txfm2d_size_)); - ref_input_ = reinterpret_cast<uint16_t *>( - aom_memalign(16, sizeof(uint16_t) * txfm2d_size_)); - output_ = reinterpret_cast<int32_t *>( - aom_memalign(16, sizeof(int32_t) * txfm2d_size_)); } void RunRoundtripCheck() { @@ -59,52 +51,51 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> { libaom_test::inv_txfm_func_ls[tx_size_]; double avg_abs_error = 0; ACMRandom rnd(ACMRandom::DeterministicSeed()); - for (int ci = 0; ci < count_; ci++) { + + const int count = 500; + + for (int ci = 0; ci < count; ci++) { + int16_t expected[64 * 64] = { 0 }; + ASSERT_LT(txfm2d_size_, NELEMENTS(expected)); + for (int ni = 0; ni < txfm2d_size_; ++ni) { if (ci == 0) { int extreme_input = input_base - 1; - input_[ni] = extreme_input; // extreme case - ref_input_[ni] = 0; + expected[ni] = extreme_input; // extreme case } else { - input_[ni] = rnd.Rand16() % input_base; - ref_input_[ni] = 0; + expected[ni] = rnd.Rand16() % input_base; } } - fwd_txfm_func(input_, output_, txfm1d_size_, tx_type_, bd); - inv_txfm_func(output_, ref_input_, txfm1d_size_, tx_type_, bd); + int32_t coeffs[64 * 64] = { 0 }; + ASSERT_LT(txfm2d_size_, NELEMENTS(coeffs)); + fwd_txfm_func(expected, coeffs, txfm1d_size_, tx_type_, bd); + + uint16_t actual[64 * 64] = { 0 }; + ASSERT_LT(txfm2d_size_, NELEMENTS(actual)); + inv_txfm_func(coeffs, actual, txfm1d_size_, tx_type_, bd); for (int ni = 0; ni < txfm2d_size_; ++ni) { - EXPECT_GE(max_error_, abs(input_[ni] - ref_input_[ni])); + EXPECT_GE(max_error_, abs(expected[ni] - actual[ni])); } avg_abs_error += compute_avg_abs_error<int16_t, uint16_t>( - input_, ref_input_, txfm2d_size_); + expected, actual, txfm2d_size_); } - avg_abs_error /= count_; + avg_abs_error /= count; // max_abs_avg_error comes from upper bound of // printf("txfm1d_size: %d accuracy_avg_abs_error: %f\n", // txfm1d_size_, avg_abs_error); EXPECT_GE(max_avg_error_, avg_abs_error); } - virtual void TearDown() { - aom_free(input_); - aom_free(output_); - aom_free(ref_input_); - } - private: - int count_; int max_error_; double max_avg_error_; TX_TYPE tx_type_; TX_SIZE tx_size_; int txfm1d_size_; int txfm2d_size_; - int16_t *input_; - uint16_t *ref_input_; - int32_t *output_; }; TEST_P(AV1InvTxfm2d, RunRoundtripCheck) { RunRoundtripCheck(); } diff --git a/third_party/aom/test/av1_inv_txfm_test.cc b/third_party/aom/test/av1_inv_txfm_test.cc index af3fee872..34d45e08b 100644 --- a/third_party/aom/test/av1_inv_txfm_test.cc +++ b/third_party/aom/test/av1_inv_txfm_test.cc @@ -43,7 +43,6 @@ void reference_idct_1d(const double *in, double *out, int size) { } } -typedef void (*IdctFuncRef)(const double *in, double *out, int size); typedef void (*IdctFunc)(const tran_low_t *in, tran_low_t *out); class TransTestBase { @@ -52,10 +51,10 @@ class TransTestBase { protected: void RunInvAccuracyCheck() { - tran_low_t *input = new tran_low_t[txfm_size_]; - tran_low_t *output = new tran_low_t[txfm_size_]; - double *ref_input = new double[txfm_size_]; - double *ref_output = new double[txfm_size_]; + tran_low_t input[64]; + tran_low_t output[64]; + double ref_input[64]; + double ref_output[64]; ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 5000; @@ -65,8 +64,8 @@ class TransTestBase { ref_input[ni] = static_cast<double>(input[ni]); } - fwd_txfm_(input, output); - fwd_txfm_ref_(ref_input, ref_output, txfm_size_); + inv_txfm_(input, output); + reference_idct_1d(ref_input, ref_output, txfm_size_); for (int ni = 0; ni < txfm_size_; ++ni) { EXPECT_LE( @@ -74,40 +73,32 @@ class TransTestBase { max_error_); } } - - delete[] input; - delete[] output; - delete[] ref_input; - delete[] ref_output; } double max_error_; int txfm_size_; - IdctFunc fwd_txfm_; - IdctFuncRef fwd_txfm_ref_; + IdctFunc inv_txfm_; }; -typedef std::tr1::tuple<IdctFunc, IdctFuncRef, int, int> IdctParam; +typedef std::tr1::tuple<IdctFunc, int, int> IdctParam; class AV1InvTxfm : public TransTestBase, public ::testing::TestWithParam<IdctParam> { public: virtual void SetUp() { - fwd_txfm_ = GET_PARAM(0); - fwd_txfm_ref_ = GET_PARAM(1); - txfm_size_ = GET_PARAM(2); - max_error_ = GET_PARAM(3); + inv_txfm_ = GET_PARAM(0); + txfm_size_ = GET_PARAM(1); + max_error_ = GET_PARAM(2); } virtual void TearDown() {} }; TEST_P(AV1InvTxfm, RunInvAccuracyCheck) { RunInvAccuracyCheck(); } -INSTANTIATE_TEST_CASE_P( - C, AV1InvTxfm, - ::testing::Values(IdctParam(&aom_idct4_c, &reference_idct_1d, 4, 1), - IdctParam(&aom_idct8_c, &reference_idct_1d, 8, 2), - IdctParam(&aom_idct16_c, &reference_idct_1d, 16, 4), - IdctParam(&aom_idct32_c, &reference_idct_1d, 32, 6))); +INSTANTIATE_TEST_CASE_P(C, AV1InvTxfm, + ::testing::Values(IdctParam(&aom_idct4_c, 4, 1), + IdctParam(&aom_idct8_c, 8, 2), + IdctParam(&aom_idct16_c, 16, 4), + IdctParam(&aom_idct32_c, 32, 6))); #if CONFIG_AV1_ENCODER typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride); @@ -140,6 +131,13 @@ class AV1PartialIDctTest }; #if !CONFIG_ADAPT_SCAN +static MB_MODE_INFO get_mbmi() { + MB_MODE_INFO mbmi; + mbmi.ref_frame[0] = LAST_FRAME; + assert(is_inter_block(&mbmi)); + return mbmi; +} + TEST_P(AV1PartialIDctTest, RunQuantCheck) { int size; switch (tx_size_) { @@ -186,9 +184,10 @@ TEST_P(AV1PartialIDctTest, RunQuantCheck) { // quantization with maximum allowed step sizes test_coef_block1[0] = (output_ref_block[0] / 1336) * 1336; + MB_MODE_INFO mbmi = get_mbmi(); for (int j = 1; j < last_nonzero_; ++j) test_coef_block1[get_scan((const AV1_COMMON *)NULL, tx_size_, DCT_DCT, - 0) + &mbmi) ->scan[j]] = (output_ref_block[j] / 1828) * 1828; } @@ -239,7 +238,9 @@ TEST_P(AV1PartialIDctTest, ResultsMatch) { max_energy_leftover = 0; coef = 0; } - test_coef_block1[get_scan((const AV1_COMMON *)NULL, tx_size_, DCT_DCT, 0) + MB_MODE_INFO mbmi = get_mbmi(); + test_coef_block1[get_scan((const AV1_COMMON *)NULL, tx_size_, DCT_DCT, + &mbmi) ->scan[j]] = coef; } diff --git a/third_party/aom/test/block_error_test.cc b/third_party/aom/test/block_error_test.cc new file mode 100644 index 000000000..4364af422 --- /dev/null +++ b/third_party/aom/test/block_error_test.cc @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2017, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" + +#include "./aom_config.h" +#include "./av1_rtcd.h" + +#include "test/acm_random.h" +#include "test/clear_system_state.h" +#include "test/register_state_check.h" +#include "test/util.h" + +namespace { +using libaom_test::ACMRandom; + +typedef int64_t (*BlockErrorFunc)(const tran_low_t *coeff, + const tran_low_t *dqcoeff, intptr_t size, + int64_t *ssz); +#if CONFIG_HIGHBITDEPTH +typedef int64_t (*HbdBlockErrorFunc)(const tran_low_t *coeff, + const tran_low_t *dqcoeff, intptr_t size, + int64_t *ssz, int bd); +#endif + +typedef std::tr1::tuple<BlockErrorFunc, BlockErrorFunc, TX_SIZE, + aom_bit_depth_t> + BlockErrorParam; + +const int kTestNum = 10000; + +class BlockErrorTest : public ::testing::TestWithParam<BlockErrorParam> { + public: + BlockErrorTest() + : blk_err_ref_(GET_PARAM(0)), blk_err_(GET_PARAM(1)), + tx_size_(GET_PARAM(2)), bd_(GET_PARAM(3)) {} + + virtual ~BlockErrorTest() {} + + virtual void SetUp() { + const intptr_t block_size = getCoeffNum(); + coeff_ = reinterpret_cast<tran_low_t *>( + aom_memalign(16, 2 * block_size * sizeof(tran_low_t))); + } + + virtual void TearDown() { + aom_free(coeff_); + coeff_ = NULL; + libaom_test::ClearSystemState(); + } + + void BlockErrorRun(int testNum) { + int i; + int64_t error_ref, error; + int64_t sse_ref, sse; + const intptr_t block_size = getCoeffNum(); + tran_low_t *dqcoeff = coeff_ + block_size; + for (i = 0; i < testNum; ++i) { + FillRandomData(); + + error_ref = blk_err_ref_(coeff_, dqcoeff, block_size, &sse_ref); + ASM_REGISTER_STATE_CHECK(error = + blk_err_(coeff_, dqcoeff, block_size, &sse)); + + EXPECT_EQ(error_ref, error) << "Error doesn't match on test: " << i; + EXPECT_EQ(sse_ref, sse) << "SSE doesn't match on test: " << i; + } + } + + intptr_t getCoeffNum() { return tx_size_2d[tx_size_]; } + + void FillRandomData() { + const intptr_t block_size = getCoeffNum(); + tran_low_t *dqcoeff = coeff_ + block_size; + intptr_t i; + int16_t margin = 512; + for (i = 0; i < block_size; ++i) { + coeff_[i] = GetRandomNumWithRange(INT16_MIN + margin, INT16_MAX - margin); + dqcoeff[i] = coeff_[i] + GetRandomDeltaWithRange(margin); + } + } + + void FillConstantData() { + const intptr_t block_size = getCoeffNum(); + tran_low_t *dqcoeff = coeff_ + block_size; + intptr_t i; + for (i = 0; i < block_size; ++i) { + coeff_[i] = 5; + dqcoeff[i] = 7; + } + } + + tran_low_t GetRandomNumWithRange(int16_t min, int16_t max) { + return clamp((int16_t)rnd_.Rand16(), min, max); + } + + tran_low_t GetRandomDeltaWithRange(int16_t delta) { + tran_low_t value = (int16_t)rnd_.Rand16(); + value %= delta; + return value; + } + + BlockErrorFunc blk_err_ref_; + BlockErrorFunc blk_err_; + TX_SIZE tx_size_; + aom_bit_depth_t bd_; + ACMRandom rnd_; + tran_low_t *coeff_; +}; + +TEST_P(BlockErrorTest, BitExact) { BlockErrorRun(kTestNum); } + +using std::tr1::make_tuple; + +#if !CONFIG_HIGHBITDEPTH && HAVE_SSE2 +const BlockErrorParam kBlkErrParamArraySse2[] = { make_tuple( + &av1_block_error_c, &av1_block_error_sse2, TX_32X32, AOM_BITS_8) }; +INSTANTIATE_TEST_CASE_P(SSE2, BlockErrorTest, + ::testing::ValuesIn(kBlkErrParamArraySse2)); +#endif + +#if HAVE_AVX2 +const BlockErrorParam kBlkErrParamArrayAvx2[] = { make_tuple( + &av1_block_error_c, &av1_block_error_avx2, TX_32X32, AOM_BITS_8) }; +INSTANTIATE_TEST_CASE_P(AVX2, BlockErrorTest, + ::testing::ValuesIn(kBlkErrParamArrayAvx2)); +#endif +} // namespace diff --git a/third_party/aom/test/borders_test.cc b/third_party/aom/test/borders_test.cc index d4e8dea23..ee771707c 100644 --- a/third_party/aom/test/borders_test.cc +++ b/third_party/aom/test/borders_test.cc @@ -20,8 +20,8 @@ namespace { class BordersTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: BordersTest() : EncoderTest(GET_PARAM(0)) {} virtual ~BordersTest() {} diff --git a/third_party/aom/test/coding_path_sync.cc b/third_party/aom/test/coding_path_sync.cc new file mode 100644 index 000000000..68ee160bf --- /dev/null +++ b/third_party/aom/test/coding_path_sync.cc @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2016, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#include <vector> +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" +#include "test/acm_random.h" + +#include "./aom_config.h" + +#if CONFIG_AV1_ENCODER && CONFIG_AV1_DECODER + +#include "aom_ports/mem.h" // ROUND_POWER_OF_TWO +#include "aom/aomcx.h" +#include "aom/aomdx.h" +#include "aom/aom_encoder.h" +#include "aom/aom_decoder.h" + +using libaom_test::ACMRandom; +namespace { + +struct CompressedSource { + explicit CompressedSource(int seed) : rnd_(seed) { + frame_count_ = 0; + aom_codec_iface_t *algo = &aom_codec_av1_cx_algo; + + aom_codec_enc_cfg_t cfg; + aom_codec_enc_config_default(algo, &cfg, 0); + + const int max_q = cfg.rc_max_quantizer; + + cfg.rc_end_usage = AOM_CQ; + cfg.rc_max_quantizer = max_q; + cfg.rc_min_quantizer = max_q; + cfg.g_w = WIDTH; + cfg.g_h = HEIGHT; + cfg.g_lag_in_frames = 0; + + aom_codec_enc_init(&enc_, algo, &cfg, 0); + } + + ~CompressedSource() { aom_codec_destroy(&enc_); } + + const aom_codec_cx_pkt_t *readFrame() { + uint8_t buf[WIDTH * HEIGHT * 3 / 2] = { 0 }; + + // render regular pattern + const int period = rnd_.Rand8() % 32 + 1; + const int phase = rnd_.Rand8() % period; + + const int val_a = rnd_.Rand8(); + const int val_b = rnd_.Rand8(); + for (int i = 0; i < (int)sizeof buf; ++i) + buf[i] = (i + phase) % period < period / 2 ? val_a : val_b; + + aom_image_t img; + aom_img_wrap(&img, AOM_IMG_FMT_I420, WIDTH, HEIGHT, 0, buf); + aom_codec_encode(&enc_, &img, frame_count_++, 1, 0, 0); + + aom_codec_iter_t iter = NULL; + return aom_codec_get_cx_data(&enc_, &iter); + } + + private: + ACMRandom rnd_; + aom_codec_ctx_t enc_; + int frame_count_; + static const int WIDTH = 32; + static const int HEIGHT = 32; +}; + +// lowers an aom_image_t to a easily comparable/printable form +std::vector<int16_t> serialize(const aom_image_t *img) { + const int w_uv = ROUND_POWER_OF_TWO(img->d_w, img->x_chroma_shift); + const int h_uv = ROUND_POWER_OF_TWO(img->d_h, img->y_chroma_shift); + const int w[] = { (int)img->d_w, w_uv, w_uv }; + const int h[] = { (int)img->d_h, h_uv, h_uv }; + + std::vector<int16_t> bytes; + bytes.reserve(img->d_w * img->d_h * 3); + for (int plane = 0; plane < 3; ++plane) + for (int r = 0; r < h[plane]; ++r) + for (int c = 0; c < w[plane]; ++c) { + const int offset = r * img->stride[plane] + c; + if (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) + bytes.push_back(img->planes[plane][offset * 2]); + else + bytes.push_back(img->planes[plane][offset]); + } + + return bytes; +} + +struct Decoder { + explicit Decoder(int allowLowbitdepth) { + aom_codec_iface_t *algo = &aom_codec_av1_dx_algo; + + aom_codec_dec_cfg cfg = { 0 }; + cfg.allow_lowbitdepth = allowLowbitdepth; + + aom_codec_dec_init(&dec_, algo, &cfg, 0); + } + + ~Decoder() { aom_codec_destroy(&dec_); } + + std::vector<int16_t> decode(const aom_codec_cx_pkt_t *pkt) { + aom_codec_decode(&dec_, (uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz, + NULL, 0); + + aom_codec_iter_t iter = NULL; + return serialize(aom_codec_get_frame(&dec_, &iter)); + } + + private: + aom_codec_ctx_t dec_; +}; + +// Try to reveal a mismatch between LBD and HBD coding paths. +TEST(CodingPathSync, SearchForHbdLbdMismatch) { + // disable test. Re-enable it locally to help diagnosing LBD/HBD mismatches. + // And re-enable it once both coding paths match + // so they don't diverge anymore. + return; + + const int count_tests = 100; + for (int i = 0; i < count_tests; ++i) { + Decoder dec_HBD(0); + Decoder dec_LBD(1); + + CompressedSource enc(i); + const aom_codec_cx_pkt_t *frame = enc.readFrame(); + ASSERT_EQ(dec_LBD.decode(frame), dec_HBD.decode(frame)); + } +} + +} // namespace + +#endif diff --git a/third_party/aom/test/convolve_round_test.cc b/third_party/aom/test/convolve_round_test.cc new file mode 100644 index 000000000..6f77dbb80 --- /dev/null +++ b/third_party/aom/test/convolve_round_test.cc @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2017, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#include <assert.h> + +#include "./av1_rtcd.h" +#include "test/acm_random.h" +#include "test/clear_system_state.h" +#include "test/register_state_check.h" +#include "test/util.h" +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" +#include "aom/aom_integer.h" +#include "aom_ports/aom_timer.h" + +using libaom_test::ACMRandom; + +namespace { +#define CONVOLVE_ROUNDING_PARAM \ + const int32_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, \ + int h, int bits + +typedef void (*ConvolveRoundFunc)(CONVOLVE_ROUNDING_PARAM); + +typedef void (*ConvolveRoundFuncHbd)(CONVOLVE_ROUNDING_PARAM, int bd); + +template <ConvolveRoundFuncHbd fn> +void highbd_convolve_rounding_8(CONVOLVE_ROUNDING_PARAM) { + const int bd = 8; + fn(src, src_stride, dst, dst_stride, w, h, bits, bd); +} + +template <ConvolveRoundFuncHbd fn> +void highbd_convolve_rounding_10(CONVOLVE_ROUNDING_PARAM) { + const int bd = 10; + fn(src, src_stride, dst, dst_stride, w, h, bits, bd); +} + +template <ConvolveRoundFuncHbd fn> +void highbd_convolve_rounding_12(CONVOLVE_ROUNDING_PARAM) { + const int bd = 12; + fn(src, src_stride, dst, dst_stride, w, h, bits, bd); +} + +typedef enum { LOWBITDEPTH_TEST, HIGHBITDEPTH_TEST } DataPathType; + +using std::tr1::tuple; + +typedef tuple<ConvolveRoundFunc, ConvolveRoundFunc, DataPathType> + ConvolveRoundParam; + +const int kTestNum = 5000; + +class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> { + protected: + ConvolveRoundTest() + : func_ref_(GET_PARAM(0)), func_(GET_PARAM(1)), data_path_(GET_PARAM(2)) { + } + virtual ~ConvolveRoundTest() {} + + virtual void SetUp() { + const size_t block_size = 128 * 128; + src_ = reinterpret_cast<int32_t *>( + aom_memalign(16, 3 * block_size * sizeof(int32_t))); + dst_ref_ = reinterpret_cast<uint16_t *>(src_ + block_size); + dst_ = dst_ref_ + block_size; + } + + virtual void TearDown() { aom_free(src_); } + + void ConvolveRoundingRun() { + int test_num = 0; + const int src_stride = 128; + const int dst_stride = 128; + int bits = 13; + uint8_t *dst = 0; + uint8_t *dst_ref = 0; + int diff_wide; + + if (data_path_ == LOWBITDEPTH_TEST) { + dst = reinterpret_cast<uint8_t *>(dst_); + dst_ref = reinterpret_cast<uint8_t *>(dst_ref_); +#if CONFIG_HIGHBITDEPTH + } else if (data_path_ == HIGHBITDEPTH_TEST) { + dst = CONVERT_TO_BYTEPTR(dst_); + dst_ref = CONVERT_TO_BYTEPTR(dst_ref_); +#endif + } else { + assert(0); + } + + while (test_num < kTestNum) { + int block_size = test_num % BLOCK_SIZES_ALL; + int w = block_size_wide[block_size]; + int h = block_size_high[block_size]; + + if (test_num % 2 == 0) + bits -= 1; + else + bits += 1; + + GenerateBufferWithRandom(src_, src_stride, bits, w, h); + + func_ref_(src_, src_stride, dst_ref, dst_stride, w, h, bits); + func_(src_, src_stride, dst, dst_stride, w, h, bits); + + diff_wide = w; + if (data_path_ == LOWBITDEPTH_TEST) diff_wide >>= 1; + for (int r = 0; r < h; ++r) { + for (int c = 0; c < diff_wide; ++c) { + ASSERT_EQ(dst_ref_[r * dst_stride + c], dst_[r * dst_stride + c]) + << "Mismatch at r: " << r << " c: " << c << " test: " << test_num; + } + } + + test_num++; + } + } + + void GenerateBufferWithRandom(int32_t *src, int src_stride, int bits, int w, + int h) { + int32_t number; + for (int r = 0; r < h; ++r) { + for (int c = 0; c < w; ++c) { + number = static_cast<int32_t>(rand_.Rand31()); + number %= 1 << (bits + 9); + src[r * src_stride + c] = number; + } + } + } + + ACMRandom rand_; + int32_t *src_; + uint16_t *dst_ref_; + uint16_t *dst_; + + ConvolveRoundFunc func_ref_; + ConvolveRoundFunc func_; + DataPathType data_path_; +}; + +TEST_P(ConvolveRoundTest, BitExactCheck) { ConvolveRoundingRun(); } + +using std::tr1::make_tuple; + +#if HAVE_AVX2 +#if CONFIG_HIGHBITDEPTH +const ConvolveRoundParam kConvRndParamArray[] = { + make_tuple(&av1_convolve_rounding_c, &av1_convolve_rounding_avx2, + LOWBITDEPTH_TEST), + make_tuple(&highbd_convolve_rounding_8<av1_highbd_convolve_rounding_c>, + &highbd_convolve_rounding_8<av1_highbd_convolve_rounding_avx2>, + HIGHBITDEPTH_TEST), + make_tuple(&highbd_convolve_rounding_10<av1_highbd_convolve_rounding_c>, + &highbd_convolve_rounding_10<av1_highbd_convolve_rounding_avx2>, + HIGHBITDEPTH_TEST), + make_tuple(&highbd_convolve_rounding_12<av1_highbd_convolve_rounding_c>, + &highbd_convolve_rounding_12<av1_highbd_convolve_rounding_avx2>, + HIGHBITDEPTH_TEST) +}; +#else +const ConvolveRoundParam kConvRndParamArray[] = { make_tuple( + &av1_convolve_rounding_c, &av1_convolve_rounding_avx2, LOWBITDEPTH_TEST) }; +#endif + +INSTANTIATE_TEST_CASE_P(AVX2, ConvolveRoundTest, + ::testing::ValuesIn(kConvRndParamArray)); +#endif // HAVE_AVX2 +} // namespace diff --git a/third_party/aom/test/cpu_speed_test.cc b/third_party/aom/test/cpu_speed_test.cc index ad0f2a874..bde00472d 100644 --- a/third_party/aom/test/cpu_speed_test.cc +++ b/third_party/aom/test/cpu_speed_test.cc @@ -21,8 +21,8 @@ namespace { const int kMaxPSNR = 100; class CpuSpeedTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: CpuSpeedTest() : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), diff --git a/third_party/aom/test/datarate_test.cc b/third_party/aom/test/datarate_test.cc index a4a682681..6a1b4e101 100644 --- a/third_party/aom/test/datarate_test.cc +++ b/third_party/aom/test/datarate_test.cc @@ -21,8 +21,8 @@ namespace { class DatarateTestLarge - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { public: DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {} diff --git a/third_party/aom/test/dct16x16_test.cc b/third_party/aom/test/dct16x16_test.cc index 89263ce89..c2c072494 100644 --- a/third_party/aom/test/dct16x16_test.cc +++ b/third_party/aom/test/dct16x16_test.cc @@ -226,9 +226,9 @@ void reference_16x16_dct_2d(int16_t input[256], double output[256]) { typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, - int tx_type); + TxfmParam *txfm_param); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct16x16Param; typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht16x16Param; @@ -236,31 +236,46 @@ typedef std::tr1::tuple<IdctFunc, IdctFunc, int, aom_bit_depth_t> Idct16x16Param; void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + TxfmParam * /*txfm_param*/) { aom_fdct16x16_c(in, out, stride); } void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, - int /*tx_type*/) { + const TxfmParam * /*txfm_param*/) { aom_idct16x16_256_add_c(in, dest, stride); } -void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x16_c(in, out, stride, tx_type); +void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht16x16_c(in, out, stride, txfm_param); } void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, - int tx_type) { - av1_iht16x16_256_add_c(in, dest, stride, tx_type); + const TxfmParam *txfm_param) { + av1_iht16x16_256_add_c(in, dest, stride, txfm_param); } #if CONFIG_HIGHBITDEPTH -void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10); +void fht16x16_10(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 10); } -void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12); +void fht16x16_12(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 12); +} + +void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride, + txfm_param->tx_type, 10); +} + +void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride, + txfm_param->tx_type, 12); } #endif // CONFIG_HIGHBITDEPTH @@ -346,7 +361,7 @@ class Trans16x16TestBase { for (int j = 0; j < kNumCoeffs; ++j) input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_); - fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_); + fwd_txfm_ref(input_block, output_ref_block, pitch_, &txfm_param_); ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_)); // The minimum quant value is 4. @@ -373,7 +388,7 @@ class Trans16x16TestBase { for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_; } - fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); + fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_); ASM_REGISTER_STATE_CHECK( RunFwdTxfm(input_extreme_block, output_block, pitch_)); @@ -409,7 +424,7 @@ class Trans16x16TestBase { if (i == 1) for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_; - fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); + fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_); // clear reconstructed pixel buffers memset(dst, 0, kNumCoeffs * sizeof(uint8_t)); @@ -424,12 +439,12 @@ class Trans16x16TestBase { for (int j = 1; j < kNumCoeffs; ++j) output_ref_block[j] = (output_ref_block[j] / ac_thred) * ac_thred; if (bit_depth_ == AOM_BITS_8) { - inv_txfm_ref(output_ref_block, ref, pitch_, tx_type_); + inv_txfm_ref(output_ref_block, ref, pitch_, &txfm_param_); ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_)); #if CONFIG_HIGHBITDEPTH } else { inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_, - tx_type_); + &txfm_param_); ASM_REGISTER_STATE_CHECK( RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_)); #endif @@ -558,11 +573,11 @@ class Trans16x16TestBase { } int pitch_; - int tx_type_; aom_bit_depth_t bit_depth_; int mask_; FhtFunc fwd_txfm_ref; IhtFunc inv_txfm_ref; + TxfmParam txfm_param_; }; class Trans16x16DCT : public Trans16x16TestBase, @@ -573,13 +588,13 @@ class Trans16x16DCT : public Trans16x16TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); bit_depth_ = GET_PARAM(3); pitch_ = 16; fwd_txfm_ref = fdct16x16_ref; inv_txfm_ref = idct16x16_ref; mask_ = (1 << bit_depth_) - 1; inv_txfm_ref = idct16x16_ref; + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } @@ -617,19 +632,27 @@ class Trans16x16HT : public Trans16x16TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); bit_depth_ = GET_PARAM(3); pitch_ = 16; - fwd_txfm_ref = fht16x16_ref; - inv_txfm_ref = iht16x16_ref; mask_ = (1 << bit_depth_) - 1; + txfm_param_.tx_type = GET_PARAM(2); #if CONFIG_HIGHBITDEPTH switch (bit_depth_) { - case AOM_BITS_10: inv_txfm_ref = iht16x16_10; break; - case AOM_BITS_12: inv_txfm_ref = iht16x16_12; break; - default: inv_txfm_ref = iht16x16_ref; break; + case AOM_BITS_10: + fwd_txfm_ref = fht16x16_10; + inv_txfm_ref = iht16x16_10; + break; + case AOM_BITS_12: + fwd_txfm_ref = fht16x16_12; + inv_txfm_ref = iht16x16_12; + break; + default: + fwd_txfm_ref = fht16x16_ref; + inv_txfm_ref = iht16x16_ref; + break; } #else + fwd_txfm_ref = fht16x16_ref; inv_txfm_ref = iht16x16_ref; #endif } @@ -637,10 +660,10 @@ class Trans16x16HT : public Trans16x16TestBase, protected: void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; @@ -767,23 +790,18 @@ INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT, INSTANTIATE_TEST_CASE_P( C, Trans16x16HT, ::testing::Values( - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 0, AOM_BITS_10), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 1, AOM_BITS_10), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 2, AOM_BITS_10), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 3, AOM_BITS_10), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 0, AOM_BITS_12), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 1, AOM_BITS_12), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 2, AOM_BITS_12), - make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 3, AOM_BITS_12), + make_tuple(&fht16x16_10, &iht16x16_10, 0, AOM_BITS_10), + make_tuple(&fht16x16_10, &iht16x16_10, 1, AOM_BITS_10), + make_tuple(&fht16x16_10, &iht16x16_10, 2, AOM_BITS_10), + make_tuple(&fht16x16_10, &iht16x16_10, 3, AOM_BITS_10), + make_tuple(&fht16x16_12, &iht16x16_12, 0, AOM_BITS_12), + make_tuple(&fht16x16_12, &iht16x16_12, 1, AOM_BITS_12), + make_tuple(&fht16x16_12, &iht16x16_12, 2, AOM_BITS_12), + make_tuple(&fht16x16_12, &iht16x16_12, 3, AOM_BITS_12), make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 0, AOM_BITS_8), make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 1, AOM_BITS_8), make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 2, AOM_BITS_8), make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 3, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P( - C, PartialTrans16x16Test, - ::testing::Values(make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_8), - make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_10), - make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_12))); #else INSTANTIATE_TEST_CASE_P( C, Trans16x16HT, @@ -792,9 +810,6 @@ INSTANTIATE_TEST_CASE_P( make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 1, AOM_BITS_8), make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 2, AOM_BITS_8), make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 3, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P(C, PartialTrans16x16Test, - ::testing::Values(make_tuple(&aom_fdct16x16_1_c, - AOM_BITS_8))); #endif // CONFIG_HIGHBITDEPTH #if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH @@ -819,17 +834,8 @@ INSTANTIATE_TEST_CASE_P( 2, AOM_BITS_8), make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 3, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test, - ::testing::Values(make_tuple(&aom_fdct16x16_1_sse2, - AOM_BITS_8))); #endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH -#if HAVE_AVX2 && !CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P(AVX2, PartialTrans16x16Test, - ::testing::Values(make_tuple(&aom_fdct16x16_1_avx2, - AOM_BITS_8))); -#endif // HAVE_AVX2 && !CONFIG_HIGHBITDEPTH - #if HAVE_SSE2 && CONFIG_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P(SSE2, Trans16x16DCT, ::testing::Values(make_tuple(&aom_fdct16x16_sse2, @@ -843,14 +849,6 @@ INSTANTIATE_TEST_CASE_P( make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 2, AOM_BITS_8), make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 3, AOM_BITS_8))); -// TODO(luoyi): -// For this test case, we should test function: aom_highbd_fdct16x16_1_sse2. -// However this function is not available yet. if we mistakely test -// aom_fdct16x16_1_sse2, it could only pass AOM_BITS_8/AOM_BITS_10 but not -// AOM_BITS_12. -INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test, - ::testing::Values(make_tuple(&aom_fdct16x16_1_sse2, - AOM_BITS_8))); #endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH #if HAVE_MSA && !CONFIG_HIGHBITDEPTH @@ -869,8 +867,5 @@ INSTANTIATE_TEST_CASE_P( make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 3, AOM_BITS_8))); #endif // !CONFIG_EXT_TX -INSTANTIATE_TEST_CASE_P(MSA, PartialTrans16x16Test, - ::testing::Values(make_tuple(&aom_fdct16x16_1_msa, - AOM_BITS_8))); #endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH } // namespace diff --git a/third_party/aom/test/dct32x32_test.cc b/third_party/aom/test/dct32x32_test.cc index 7c1db6501..0a30f7f38 100644 --- a/third_party/aom/test/dct32x32_test.cc +++ b/third_party/aom/test/dct32x32_test.cc @@ -350,11 +350,6 @@ INSTANTIATE_TEST_CASE_P( AOM_BITS_8), make_tuple(&aom_fdct32x32_rd_c, &aom_idct32x32_1024_add_c, 1, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P( - C, PartialTrans32x32Test, - ::testing::Values(make_tuple(&aom_highbd_fdct32x32_1_c, AOM_BITS_8), - make_tuple(&aom_highbd_fdct32x32_1_c, AOM_BITS_10), - make_tuple(&aom_highbd_fdct32x32_1_c, AOM_BITS_12))); #else INSTANTIATE_TEST_CASE_P( C, Trans32x32Test, @@ -362,9 +357,6 @@ INSTANTIATE_TEST_CASE_P( AOM_BITS_8), make_tuple(&aom_fdct32x32_rd_c, &aom_idct32x32_1024_add_c, 1, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test, - ::testing::Values(make_tuple(&aom_fdct32x32_1_c, - AOM_BITS_8))); #endif // CONFIG_HIGHBITDEPTH #if HAVE_NEON && !CONFIG_HIGHBITDEPTH @@ -383,17 +375,8 @@ INSTANTIATE_TEST_CASE_P( &aom_idct32x32_1024_add_sse2, 0, AOM_BITS_8), make_tuple(&aom_fdct32x32_rd_sse2, &aom_idct32x32_1024_add_sse2, 1, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test, - ::testing::Values(make_tuple(&aom_fdct32x32_1_sse2, - AOM_BITS_8))); #endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH -#if HAVE_AVX2 && !CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P(AVX2, PartialTrans32x32Test, - ::testing::Values(make_tuple(&aom_fdct32x32_1_avx2, - AOM_BITS_8))); -#endif // HAVE_AVX2 && !CONFIG_HIGHBITDEPTH - #if HAVE_SSE2 && CONFIG_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( SSE2, Trans32x32Test, @@ -401,9 +384,6 @@ INSTANTIATE_TEST_CASE_P( 0, AOM_BITS_8), make_tuple(&aom_fdct32x32_rd_sse2, &aom_idct32x32_1024_add_c, 1, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test, - ::testing::Values(make_tuple(&aom_fdct32x32_1_sse2, - AOM_BITS_8))); #endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH #if HAVE_AVX2 && !CONFIG_HIGHBITDEPTH @@ -431,8 +411,5 @@ INSTANTIATE_TEST_CASE_P( &aom_idct32x32_1024_add_msa, 0, AOM_BITS_8), make_tuple(&aom_fdct32x32_rd_msa, &aom_idct32x32_1024_add_msa, 1, AOM_BITS_8))); -INSTANTIATE_TEST_CASE_P(MSA, PartialTrans32x32Test, - ::testing::Values(make_tuple(&aom_fdct32x32_1_msa, - AOM_BITS_8))); #endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH } // namespace diff --git a/third_party/aom/test/decode_api_test.cc b/third_party/aom/test/decode_api_test.cc index 6bd72a45d..8b1c9d268 100644 --- a/third_party/aom/test/decode_api_test.cc +++ b/third_party/aom/test/decode_api_test.cc @@ -13,13 +13,12 @@ #include "./aom_config.h" #include "test/ivf_video_source.h" +#include "test/util.h" #include "aom/aomdx.h" #include "aom/aom_decoder.h" namespace { -#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0])) - TEST(DecodeAPI, InvalidParams) { static const aom_codec_iface_t *kCodecs[] = { #if CONFIG_AV1_DECODER diff --git a/third_party/aom/test/decode_perf_test.cc b/third_party/aom/test/decode_perf_test.cc index ede4f8849..a24d02a6c 100644 --- a/third_party/aom/test/decode_perf_test.cc +++ b/third_party/aom/test/decode_perf_test.cc @@ -63,6 +63,7 @@ TEST_P(DecodePerfTest, PerfTest) { aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t(); cfg.threads = threads; + cfg.allow_lowbitdepth = 1; libaom_test::AV1Decoder decoder(cfg, 0); aom_usec_timer t; @@ -93,8 +94,8 @@ TEST_P(DecodePerfTest, PerfTest) { // ::testing::ValuesIn(kAV1DecodePerfVectors)); class AV1NewEncodeDecodePerfTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: AV1NewEncodeDecodePerfTest() : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0), @@ -115,7 +116,6 @@ class AV1NewEncodeDecodePerfTest cfg_.rc_buf_sz = 1000; cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_optimal_sz = 600; - cfg_.rc_resize_allowed = 0; cfg_.rc_end_usage = AOM_VBR; } @@ -211,6 +211,7 @@ TEST_P(AV1NewEncodeDecodePerfTest, PerfTest) { aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t(); cfg.threads = threads; + cfg.allow_lowbitdepth = 1; libaom_test::AV1Decoder decoder(cfg, 0); aom_usec_timer t; diff --git a/third_party/aom/test/encode_api_test.cc b/third_party/aom/test/encode_api_test.cc index 14e43c847..80c42fee4 100644 --- a/third_party/aom/test/encode_api_test.cc +++ b/third_party/aom/test/encode_api_test.cc @@ -12,13 +12,12 @@ #include "third_party/googletest/src/googletest/include/gtest/gtest.h" #include "./aom_config.h" +#include "test/util.h" #include "aom/aomcx.h" #include "aom/aom_encoder.h" namespace { -#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0])) - TEST(EncodeAPI, InvalidParams) { static const aom_codec_iface_t *kCodecs[] = { #if CONFIG_AV1_ENCODER diff --git a/third_party/aom/test/encode_perf_test.cc b/third_party/aom/test/encode_perf_test.cc index e2a4f2b71..5a37b480b 100644 --- a/third_party/aom/test/encode_perf_test.cc +++ b/third_party/aom/test/encode_perf_test.cc @@ -53,11 +53,9 @@ const EncodePerfTestVideo kAV1EncodePerfTestVectors[] = { const int kEncodePerfTestSpeeds[] = { 5, 6, 7, 8 }; const int kEncodePerfTestThreads[] = { 1, 2, 4 }; -#define NELEMENTS(x) (sizeof((x)) / sizeof((x)[0])) - class AV1EncodePerfTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: AV1EncodePerfTest() : EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0), @@ -78,7 +76,6 @@ class AV1EncodePerfTest cfg_.rc_buf_sz = 1000; cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_optimal_sz = 600; - cfg_.rc_resize_allowed = 0; cfg_.rc_end_usage = AOM_CBR; cfg_.g_error_resilient = 1; cfg_.g_threads = threads_; diff --git a/third_party/aom/test/encode_test_driver.cc b/third_party/aom/test/encode_test_driver.cc index 80f155ab2..ec168e969 100644 --- a/third_party/aom/test/encode_test_driver.cc +++ b/third_party/aom/test/encode_test_driver.cc @@ -99,7 +99,6 @@ void Encoder::Flush() { void EncoderTest::InitializeConfig() { const aom_codec_err_t res = codec_->DefaultEncoderConfig(&cfg_, 0); - dec_cfg_ = aom_codec_dec_cfg_t(); ASSERT_EQ(AOM_CODEC_OK, res); } @@ -211,6 +210,7 @@ void EncoderTest::MismatchHook(const aom_image_t *img_enc, void EncoderTest::RunLoop(VideoSource *video) { aom_codec_dec_cfg_t dec_cfg = aom_codec_dec_cfg_t(); + dec_cfg.allow_lowbitdepth = 1; stats_.Reset(); diff --git a/third_party/aom/test/encode_test_driver.h b/third_party/aom/test/encode_test_driver.h index 91027b4f6..97c1bf860 100644 --- a/third_party/aom/test/encode_test_driver.h +++ b/third_party/aom/test/encode_test_driver.h @@ -232,7 +232,6 @@ class EncoderTest { bool abort_; aom_codec_enc_cfg_t cfg_; - aom_codec_dec_cfg_t dec_cfg_; unsigned int passes_; unsigned long deadline_; TwopassStatsStore stats_; diff --git a/third_party/aom/test/encoder_parms_get_to_decoder.cc b/third_party/aom/test/encoder_parms_get_to_decoder.cc index ca6a24ebe..227ee8246 100644 --- a/third_party/aom/test/encoder_parms_get_to_decoder.cc +++ b/third_party/aom/test/encoder_parms_get_to_decoder.cc @@ -41,6 +41,10 @@ struct EncodeParameters { int32_t frame_parallel; aom_color_range_t color_range; aom_color_space_t cs; +#if CONFIG_COLORSPACE_HEADERS + aom_transfer_function_t tf; + aom_chroma_sample_position_t csp; +#endif int render_size[2]; // TODO(JBB): quantizers / bitrate }; @@ -48,15 +52,20 @@ struct EncodeParameters { const EncodeParameters kAV1EncodeParameterSet[] = { { 0, 0, 0, 1, 0, AOM_CR_STUDIO_RANGE, AOM_CS_BT_601, { 0, 0 } }, { 0, 0, 0, 0, 0, AOM_CR_FULL_RANGE, AOM_CS_BT_709, { 0, 0 } }, +#if CONFIG_COLORSPACE_HEADERS + { 0, 0, 1, 0, 0, AOM_CR_FULL_RANGE, AOM_CS_BT_2020_NCL, { 0, 0 } }, +#else { 0, 0, 1, 0, 0, AOM_CR_FULL_RANGE, AOM_CS_BT_2020, { 0, 0 } }, +#endif { 0, 2, 0, 0, 1, AOM_CR_STUDIO_RANGE, AOM_CS_UNKNOWN, { 640, 480 } }, // TODO(JBB): Test profiles (requires more work). }; class AvxEncoderParmsGetToDecoder - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<EncodeParameters, - EncodePerfTestVideo> { + : public ::libaom_test::CodecTestWith2Params<EncodeParameters, + EncodePerfTestVideo>, + public ::libaom_test::EncoderTest, +{ protected: AvxEncoderParmsGetToDecoder() : EncoderTest(GET_PARAM(0)), encode_parms(GET_PARAM(1)) {} @@ -77,6 +86,10 @@ class AvxEncoderParmsGetToDecoder ::libaom_test::Encoder *encoder) { if (video->frame() == 1) { encoder->Control(AV1E_SET_COLOR_SPACE, encode_parms.cs); +#if CONFIG_COLORSPACE_HEADERS + encoder->Control(AV1E_SET_TRANSFER_FUNCTION, encode_parms.tf); + encoder->Control(AV1E_SET_CHROMA_SAMPLE_POSITION, encode_parms.csp); +#endif encoder->Control(AV1E_SET_COLOR_RANGE, encode_parms.color_range); encoder->Control(AV1E_SET_LOSSLESS, encode_parms.lossless); encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, @@ -114,6 +127,10 @@ class AvxEncoderParmsGetToDecoder } EXPECT_EQ(encode_parms.color_range, common->color_range); EXPECT_EQ(encode_parms.cs, common->color_space); +#if CONFIG_COLORSPACE_HEADERS + EXPECT_EQ(encode_parms.tf, common->transfer_function); + EXPECT_EQ(encode_parms.csp, common->chroma_sample_position); +#endif if (encode_parms.render_size[0] > 0 && encode_parms.render_size[1] > 0) { EXPECT_EQ(encode_parms.render_size[0], common->render_width); EXPECT_EQ(encode_parms.render_size[1], common->render_height); diff --git a/third_party/aom/test/end_to_end_test.cc b/third_party/aom/test/end_to_end_test.cc index 0c8cbe274..93bc1625e 100644 --- a/third_party/aom/test/end_to_end_test.cc +++ b/third_party/aom/test/end_to_end_test.cc @@ -86,9 +86,9 @@ int is_extension_y4m(const char *filename) { } class EndToEndTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, - TestVideoParam, int> { + : public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, + TestVideoParam, int>, + public ::libaom_test::EncoderTest { protected: EndToEndTest() : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(2)), @@ -110,7 +110,6 @@ class EndToEndTest cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_optimal_sz = 600; } - dec_cfg_.threads = 4; } virtual void BeginPassHook(unsigned int) { diff --git a/third_party/aom/test/error_resilience_test.cc b/third_party/aom/test/error_resilience_test.cc index b1d93a01f..e9abdde6d 100644 --- a/third_party/aom/test/error_resilience_test.cc +++ b/third_party/aom/test/error_resilience_test.cc @@ -21,8 +21,8 @@ const int kMaxErrorFrames = 12; const int kMaxDroppableFrames = 12; class ErrorResilienceTestLarge - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: ErrorResilienceTestLarge() : EncoderTest(GET_PARAM(0)), psnr_(0.0), nframes_(0), mismatch_psnr_(0.0), diff --git a/third_party/aom/test/ethread_test.cc b/third_party/aom/test/ethread_test.cc index 5b519f8fe..86eb3228e 100644 --- a/third_party/aom/test/ethread_test.cc +++ b/third_party/aom/test/ethread_test.cc @@ -20,8 +20,8 @@ namespace { class AVxEncoderThreadTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: AVxEncoderThreadTest() : EncoderTest(GET_PARAM(0)), encoder_initialized_(false), @@ -30,8 +30,9 @@ class AVxEncoderThreadTest aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t(); cfg.w = 1280; cfg.h = 720; + cfg.allow_lowbitdepth = 1; decoder_ = codec_->CreateDecoder(cfg, 0); -#if CONFIG_AV1 && CONFIG_EXT_TILE +#if CONFIG_AV1 if (decoder_->IsAV1()) { decoder_->Control(AV1_SET_DECODE_TILE_ROW, -1); decoder_->Control(AV1_SET_DECODE_TILE_COL, -1); @@ -69,20 +70,7 @@ class AVxEncoderThreadTest virtual void PreEncodeFrameHook(::libaom_test::VideoSource * /*video*/, ::libaom_test::Encoder *encoder) { if (!encoder_initialized_) { -#if CONFIG_AV1 && CONFIG_EXT_TILE - encoder->Control(AV1E_SET_TILE_COLUMNS, 1); - if (codec_ == &libaom_test::kAV1) { - // TODO(geza): Start using multiple tile rows when the multi-threaded - // encoder can handle them - encoder->Control(AV1E_SET_TILE_ROWS, 32); - } else { - encoder->Control(AV1E_SET_TILE_ROWS, 0); - } -#else - // Encode 4 tile columns. - encoder->Control(AV1E_SET_TILE_COLUMNS, 2); - encoder->Control(AV1E_SET_TILE_ROWS, 0); -#endif // CONFIG_AV1 && CONFIG_EXT_TILE + SetTileSize(encoder); #if CONFIG_LOOPFILTERING_ACROSS_TILES encoder->Control(AV1E_SET_TILE_LOOPFILTER, 0); #endif // CONFIG_LOOPFILTERING_ACROSS_TILES @@ -100,6 +88,12 @@ class AVxEncoderThreadTest } } + virtual void SetTileSize(libaom_test::Encoder *encoder) { + // Encode 4 tile columns. + encoder->Control(AV1E_SET_TILE_COLUMNS, 2); + encoder->Control(AV1E_SET_TILE_ROWS, 0); + } + virtual void FramePktHook(const aom_codec_cx_pkt_t *pkt) { size_enc_.push_back(pkt->data.frame.sz); @@ -169,11 +163,21 @@ class AVxEncoderThreadTest std::vector<std::string> md5_dec_; }; -TEST_P(AVxEncoderThreadTest, EncoderResultTest) { DoTest(); } +TEST_P(AVxEncoderThreadTest, EncoderResultTest) { +#if CONFIG_AV1 && CONFIG_EXT_TILE + cfg_.large_scale_tile = 0; +#endif // CONFIG_AV1 && CONFIG_EXT_TILE + DoTest(); +} class AVxEncoderThreadTestLarge : public AVxEncoderThreadTest {}; -TEST_P(AVxEncoderThreadTestLarge, EncoderResultTest) { DoTest(); } +TEST_P(AVxEncoderThreadTestLarge, EncoderResultTest) { +#if CONFIG_AV1 && CONFIG_EXT_TILE + cfg_.large_scale_tile = 0; +#endif // CONFIG_AV1 && CONFIG_EXT_TILE + DoTest(); +} // For AV1, only test speed 0 to 3. AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadTest, @@ -185,4 +189,36 @@ AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadTestLarge, ::testing::Values(::libaom_test::kTwoPassGood, ::libaom_test::kOnePassGood), ::testing::Range(0, 2)); + +#if CONFIG_AV1 && CONFIG_EXT_TILE +class AVxEncoderThreadLSTest : public AVxEncoderThreadTest { + virtual void SetTileSize(libaom_test::Encoder *encoder) { + encoder->Control(AV1E_SET_TILE_COLUMNS, 1); + // TODO(geza): Start using multiple tile rows when the multi-threaded + // encoder can handle them + encoder->Control(AV1E_SET_TILE_ROWS, 32); + } +}; + +TEST_P(AVxEncoderThreadLSTest, EncoderResultTest) { + cfg_.large_scale_tile = 1; + DoTest(); +} + +class AVxEncoderThreadLSTestLarge : public AVxEncoderThreadLSTest {}; + +TEST_P(AVxEncoderThreadLSTestLarge, EncoderResultTest) { + cfg_.large_scale_tile = 1; + DoTest(); +} + +AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadLSTest, + ::testing::Values(::libaom_test::kTwoPassGood, + ::libaom_test::kOnePassGood), + ::testing::Range(2, 4)); +AV1_INSTANTIATE_TEST_CASE(AVxEncoderThreadLSTestLarge, + ::testing::Values(::libaom_test::kTwoPassGood, + ::libaom_test::kOnePassGood), + ::testing::Range(0, 2)); +#endif // CONFIG_AV1 && CONFIG_EXT_TILE } // namespace diff --git a/third_party/aom/test/fdct4x4_test.cc b/third_party/aom/test/fdct4x4_test.cc index ed265e84f..e1bd61254 100644 --- a/third_party/aom/test/fdct4x4_test.cc +++ b/third_party/aom/test/fdct4x4_test.cc @@ -33,7 +33,7 @@ namespace { typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); using libaom_test::FhtFunc; typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t, int> @@ -41,34 +41,41 @@ typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t, int> typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param; void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + TxfmParam * /*txfm_param*/) { aom_fdct4x4_c(in, out, stride); } -void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht4x4_c(in, out, stride, tx_type); +void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht4x4_c(in, out, stride, txfm_param); } void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + TxfmParam * /*txfm_param*/) { av1_fwht4x4_c(in, out, stride); } #if CONFIG_HIGHBITDEPTH -void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) { - aom_highbd_idct4x4_16_add_c(in, out, stride, 10); +void fht4x4_10(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fwd_txfm2d_4x4_c(in, out, stride, txfm_param->tx_type, 10); } -void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) { - aom_highbd_idct4x4_16_add_c(in, out, stride, 12); +void fht4x4_12(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fwd_txfm2d_4x4_c(in, out, stride, txfm_param->tx_type, 12); } -void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 10); +void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride, + txfm_param->tx_type, 10); } -void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 12); +void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride, + txfm_param->tx_type, 12); } void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) { @@ -78,16 +85,6 @@ void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) { void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) { aom_highbd_iwht4x4_16_add_c(in, out, stride, 12); } - -#if HAVE_SSE2 -void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) { - aom_highbd_idct4x4_16_add_sse2(in, out, stride, 10); -} - -void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) { - aom_highbd_idct4x4_16_add_sse2(in, out, stride, 12); -} -#endif // HAVE_SSE2 #endif // CONFIG_HIGHBITDEPTH class Trans4x4DCT : public libaom_test::TransformTestBase, @@ -98,13 +95,13 @@ class Trans4x4DCT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fdct4x4_ref; bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } @@ -136,23 +133,30 @@ class Trans4x4HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fht4x4_ref; bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; num_coeffs_ = GET_PARAM(4); + txfm_param_.tx_type = GET_PARAM(2); +#if CONFIG_HIGHBITDEPTH + switch (bit_depth_) { + case AOM_BITS_10: fwd_txfm_ref = fht4x4_10; break; + case AOM_BITS_12: fwd_txfm_ref = fht4x4_12; break; + default: fwd_txfm_ref = fht4x4_ref; break; + } +#endif } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; @@ -175,7 +179,6 @@ class Trans4x4WHT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fwht4x4_ref; @@ -206,32 +209,26 @@ TEST_P(Trans4x4WHT, MemCheck) { RunMemCheck(); } TEST_P(Trans4x4WHT, InvAccuracyCheck) { RunInvAccuracyCheck(0); } using std::tr1::make_tuple; -#if CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P( - C, Trans4x4DCT, - ::testing::Values( - make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_10, 0, AOM_BITS_10, 16), - make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_12, 0, AOM_BITS_12, 16), - make_tuple(&aom_fdct4x4_c, &aom_idct4x4_16_add_c, 0, AOM_BITS_8, 16))); -#else INSTANTIATE_TEST_CASE_P(C, Trans4x4DCT, ::testing::Values(make_tuple(&aom_fdct4x4_c, &aom_idct4x4_16_add_c, 0, AOM_BITS_8, 16))); -#endif // CONFIG_HIGHBITDEPTH #if CONFIG_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( + DISABLED_C, Trans4x4HT, + ::testing::Values(make_tuple(&fht4x4_12, &iht4x4_12, 0, AOM_BITS_12, 16), + make_tuple(&fht4x4_12, &iht4x4_12, 1, AOM_BITS_12, 16), + make_tuple(&fht4x4_12, &iht4x4_12, 2, AOM_BITS_12, 16), + make_tuple(&fht4x4_12, &iht4x4_12, 3, AOM_BITS_12, 16))); + +INSTANTIATE_TEST_CASE_P( C, Trans4x4HT, ::testing::Values( - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 0, AOM_BITS_10, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 1, AOM_BITS_10, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 2, AOM_BITS_10, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_10, 3, AOM_BITS_10, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 0, AOM_BITS_12, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 1, AOM_BITS_12, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 2, AOM_BITS_12, 16), - make_tuple(&av1_highbd_fht4x4_c, &iht4x4_12, 3, AOM_BITS_12, 16), + make_tuple(&fht4x4_10, &iht4x4_10, 0, AOM_BITS_10, 16), + make_tuple(&fht4x4_10, &iht4x4_10, 1, AOM_BITS_10, 16), + make_tuple(&fht4x4_10, &iht4x4_10, 2, AOM_BITS_10, 16), + make_tuple(&fht4x4_10, &iht4x4_10, 3, AOM_BITS_10, 16), make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16), make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16), make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16), @@ -305,18 +302,6 @@ INSTANTIATE_TEST_CASE_P( #if HAVE_SSE2 && CONFIG_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( - SSE2, Trans4x4DCT, - ::testing::Values( - make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, AOM_BITS_10, 16), - make_tuple(&aom_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, AOM_BITS_10, - 16), - make_tuple(&aom_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, AOM_BITS_12, 16), - make_tuple(&aom_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, AOM_BITS_12, - 16), - make_tuple(&aom_fdct4x4_sse2, &aom_idct4x4_16_add_c, 0, AOM_BITS_8, - 16))); - -INSTANTIATE_TEST_CASE_P( SSE2, Trans4x4HT, ::testing::Values( make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16), diff --git a/third_party/aom/test/fdct8x8_test.cc b/third_party/aom/test/fdct8x8_test.cc index 0e86c70aa..62cdf6229 100644 --- a/third_party/aom/test/fdct8x8_test.cc +++ b/third_party/aom/test/fdct8x8_test.cc @@ -7,7 +7,7 @@ * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. -*/ + */ #include <math.h> #include <stdlib.h> @@ -40,9 +40,9 @@ const int kSignBiasMaxDiff15 = 10000; typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, - int tx_type); + TxfmParam *txfm_param); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct8x8Param; typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht8x8Param; @@ -78,21 +78,36 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs], } void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + TxfmParam * /*txfm_param*/) { aom_fdct8x8_c(in, out, stride); } -void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x8_c(in, out, stride, tx_type); +void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fht8x8_c(in, out, stride, txfm_param); } #if CONFIG_HIGHBITDEPTH -void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_highbd_iht8x8_64_add_c(in, out, stride, tx_type, 10); +void fht8x8_10(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 10); } -void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_highbd_iht8x8_64_add_c(in, out, stride, tx_type, 12); +void fht8x8_12(const int16_t *in, tran_low_t *out, int stride, + TxfmParam *txfm_param) { + av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 12); +} + +void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, + txfm_param->tx_type, 10); +} + +void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, + const TxfmParam *txfm_param) { + av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, + txfm_param->tx_type, 12); } #endif // CONFIG_HIGHBITDEPTH @@ -296,7 +311,7 @@ class FwdTrans8x8TestBase { ASM_REGISTER_STATE_CHECK( RunFwdTxfm(test_input_block, test_temp_block, pitch_)); ASM_REGISTER_STATE_CHECK( - fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, tx_type_)); + fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, &txfm_param_)); if (bit_depth_ == AOM_BITS_8) { ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_)); #if CONFIG_HIGHBITDEPTH @@ -476,10 +491,10 @@ class FwdTrans8x8TestBase { } } int pitch_; - int tx_type_; FhtFunc fwd_txfm_ref; aom_bit_depth_t bit_depth_; int mask_; + TxfmParam txfm_param_; }; class FwdTrans8x8DCT : public FwdTrans8x8TestBase, @@ -490,11 +505,11 @@ class FwdTrans8x8DCT : public FwdTrans8x8TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; fwd_txfm_ref = fdct8x8_ref; bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; + txfm_param_.tx_type = GET_PARAM(2); } virtual void TearDown() { libaom_test::ClearSystemState(); } @@ -529,21 +544,28 @@ class FwdTrans8x8HT : public FwdTrans8x8TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; fwd_txfm_ref = fht8x8_ref; bit_depth_ = GET_PARAM(3); mask_ = (1 << bit_depth_) - 1; + txfm_param_.tx_type = GET_PARAM(2); +#if CONFIG_HIGHBITDEPTH + switch (bit_depth_) { + case AOM_BITS_10: fwd_txfm_ref = fht8x8_10; break; + case AOM_BITS_12: fwd_txfm_ref = fht8x8_12; break; + default: fwd_txfm_ref = fht8x8_ref; break; + } +#endif } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &txfm_param_); } void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &txfm_param_); } FhtFunc fwd_txfm_; @@ -606,14 +628,14 @@ INSTANTIATE_TEST_CASE_P( C, FwdTrans8x8HT, ::testing::Values( make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 0, AOM_BITS_8), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_10, 0, AOM_BITS_10), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_10, 1, AOM_BITS_10), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_10, 2, AOM_BITS_10), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_10, 3, AOM_BITS_10), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_12, 0, AOM_BITS_12), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_12, 1, AOM_BITS_12), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_12, 2, AOM_BITS_12), - make_tuple(&av1_highbd_fht8x8_c, &iht8x8_12, 3, AOM_BITS_12), + make_tuple(&fht8x8_10, &iht8x8_10, 0, AOM_BITS_10), + make_tuple(&fht8x8_10, &iht8x8_10, 1, AOM_BITS_10), + make_tuple(&fht8x8_10, &iht8x8_10, 2, AOM_BITS_10), + make_tuple(&fht8x8_10, &iht8x8_10, 3, AOM_BITS_10), + make_tuple(&fht8x8_12, &iht8x8_12, 0, AOM_BITS_12), + make_tuple(&fht8x8_12, &iht8x8_12, 1, AOM_BITS_12), + make_tuple(&fht8x8_12, &iht8x8_12, 2, AOM_BITS_12), + make_tuple(&fht8x8_12, &iht8x8_12, 3, AOM_BITS_12), make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 1, AOM_BITS_8), make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 2, AOM_BITS_8), make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 3, AOM_BITS_8))); diff --git a/third_party/aom/test/frame_size_tests.cc b/third_party/aom/test/frame_size_tests.cc index d2e762ff9..442f2523d 100644 --- a/third_party/aom/test/frame_size_tests.cc +++ b/third_party/aom/test/frame_size_tests.cc @@ -15,8 +15,8 @@ namespace { -class AV1FrameSizeTests : public ::libaom_test::EncoderTest, - public ::testing::Test { +class AV1FrameSizeTests : public ::testing::Test, + public ::libaom_test::EncoderTest { protected: AV1FrameSizeTests() : EncoderTest(&::libaom_test::kAV1), expected_res_(AOM_CODEC_OK) {} diff --git a/third_party/aom/test/hiprec_convolve_test_util.cc b/third_party/aom/test/hiprec_convolve_test_util.cc index d53384c5b..f5661ec07 100644 --- a/third_party/aom/test/hiprec_convolve_test_util.cc +++ b/third_party/aom/test/hiprec_convolve_test_util.cc @@ -92,8 +92,8 @@ void AV1HiprecConvolveTest::RunCheckOutput(hiprec_convolve_func test_impl) { for (i = 0; i < num_iters; ++i) { // Choose random locations within the source block - int offset_r = 3 + rnd_.PseudoUniform(w - out_w - 7); - int offset_c = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); aom_convolve8_add_src_hip_c(input + offset_r * w + offset_c, w, output, out_w, hkernel, 16, vkernel, 16, out_w, out_h); test_impl(input + offset_r * w + offset_c, w, output2, out_w, hkernel, 16, @@ -166,8 +166,8 @@ void AV1HighbdHiprecConvolveTest::RunCheckOutput( for (i = 0; i < num_iters; ++i) { // Choose random locations within the source block - int offset_r = 3 + rnd_.PseudoUniform(w - out_w - 7); - int offset_c = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7); + int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7); aom_highbd_convolve8_add_src_hip_c(input_ptr + offset_r * w + offset_c, w, output_ptr, out_w, hkernel, 16, vkernel, 16, out_w, out_h, bd); diff --git a/third_party/aom/test/idct_test.cc b/third_party/aom/test/idct_test.cc deleted file mode 100644 index a880a9182..000000000 --- a/third_party/aom/test/idct_test.cc +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2016, Alliance for Open Media. All rights reserved - * - * This source code is subject to the terms of the BSD 2 Clause License and - * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License - * was not distributed with this source code in the LICENSE file, you can - * obtain it at www.aomedia.org/license/software. If the Alliance for Open - * Media Patent License 1.0 was not distributed with this source code in the - * PATENTS file, you can obtain it at www.aomedia.org/license/patent. -*/ - -#include "./aom_config.h" -#include "./aom_rtcd.h" - -#include "third_party/googletest/src/googletest/include/gtest/gtest.h" - -#include "test/clear_system_state.h" -#include "test/register_state_check.h" -#include "aom/aom_integer.h" - -typedef void (*IdctFunc)(int16_t *input, unsigned char *pred_ptr, - int pred_stride, unsigned char *dst_ptr, - int dst_stride); -namespace { -class IDCTTest : public ::testing::TestWithParam<IdctFunc> { - protected: - virtual void SetUp() { - int i; - - UUT = GetParam(); - memset(input, 0, sizeof(input)); - /* Set up guard blocks */ - for (i = 0; i < 256; i++) output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1; - } - - virtual void TearDown() { libaom_test::ClearSystemState(); } - - IdctFunc UUT; - int16_t input[16]; - unsigned char output[256]; - unsigned char predict[256]; -}; - -TEST_P(IDCTTest, TestGuardBlocks) { - int i; - - for (i = 0; i < 256; i++) - if ((i & 0xF) < 4 && i < 64) - EXPECT_EQ(0, output[i]) << i; - else - EXPECT_EQ(255, output[i]); -} - -TEST_P(IDCTTest, TestAllZeros) { - int i; - - ASM_REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16)); - - for (i = 0; i < 256; i++) - if ((i & 0xF) < 4 && i < 64) - EXPECT_EQ(0, output[i]) << "i==" << i; - else - EXPECT_EQ(255, output[i]) << "i==" << i; -} - -TEST_P(IDCTTest, TestAllOnes) { - int i; - - input[0] = 4; - ASM_REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16)); - - for (i = 0; i < 256; i++) - if ((i & 0xF) < 4 && i < 64) - EXPECT_EQ(1, output[i]) << "i==" << i; - else - EXPECT_EQ(255, output[i]) << "i==" << i; -} - -TEST_P(IDCTTest, TestAddOne) { - int i; - - for (i = 0; i < 256; i++) predict[i] = i; - input[0] = 4; - ASM_REGISTER_STATE_CHECK(UUT(input, predict, 16, output, 16)); - - for (i = 0; i < 256; i++) - if ((i & 0xF) < 4 && i < 64) - EXPECT_EQ(i + 1, output[i]) << "i==" << i; - else - EXPECT_EQ(255, output[i]) << "i==" << i; -} - -TEST_P(IDCTTest, TestWithData) { - int i; - - for (i = 0; i < 16; i++) input[i] = i; - - ASM_REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16)); - - for (i = 0; i < 256; i++) - if ((i & 0xF) > 3 || i > 63) - EXPECT_EQ(255, output[i]) << "i==" << i; - else if (i == 0) - EXPECT_EQ(11, output[i]) << "i==" << i; - else if (i == 34) - EXPECT_EQ(1, output[i]) << "i==" << i; - else if (i == 2 || i == 17 || i == 32) - EXPECT_EQ(3, output[i]) << "i==" << i; - else - EXPECT_EQ(0, output[i]) << "i==" << i; -} - -INSTANTIATE_TEST_CASE_P(C, IDCTTest, ::testing::Values(aom_short_idct4x4llm_c)); -#if HAVE_MMX -INSTANTIATE_TEST_CASE_P(MMX, IDCTTest, - ::testing::Values(aom_short_idct4x4llm_mmx)); -#endif -#if HAVE_MSA -INSTANTIATE_TEST_CASE_P(MSA, IDCTTest, - ::testing::Values(aom_short_idct4x4llm_msa)); -#endif -} diff --git a/third_party/aom/test/level_test.cc b/third_party/aom/test/level_test.cc index 1049d4901..12f391817 100644 --- a/third_party/aom/test/level_test.cc +++ b/third_party/aom/test/level_test.cc @@ -17,8 +17,8 @@ namespace { class LevelTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: LevelTest() : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), diff --git a/third_party/aom/test/lossless_test.cc b/third_party/aom/test/lossless_test.cc index 5c5b32d93..f4978fe21 100644 --- a/third_party/aom/test/lossless_test.cc +++ b/third_party/aom/test/lossless_test.cc @@ -23,8 +23,8 @@ namespace { const int kMaxPsnr = 100; class LosslessTestLarge - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: LosslessTestLarge() : EncoderTest(GET_PARAM(0)), psnr_(kMaxPsnr), nframes_(0), diff --git a/third_party/aom/test/lpf_8_test.cc b/third_party/aom/test/lpf_8_test.cc index cee0d3b81..f050718bb 100644 --- a/third_party/aom/test/lpf_8_test.cc +++ b/third_party/aom/test/lpf_8_test.cc @@ -410,77 +410,75 @@ TEST_P(Loop8Test9Param, ValueCheck) { using std::tr1::make_tuple; -#if HAVE_SSE2 +#if HAVE_SSE2 && (!CONFIG_PARALLEL_DEBLOCKING) #if CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P( - SSE2, Loop8Test6Param, - ::testing::Values(make_tuple(&aom_highbd_lpf_horizontal_4_sse2, - &aom_highbd_lpf_horizontal_4_c, 8), - make_tuple(&aom_highbd_lpf_vertical_4_sse2, - &aom_highbd_lpf_vertical_4_c, 8), - make_tuple(&aom_highbd_lpf_horizontal_8_sse2, - &aom_highbd_lpf_horizontal_8_c, 8), - make_tuple(&aom_highbd_lpf_horizontal_edge_8_sse2, - &aom_highbd_lpf_horizontal_edge_8_c, 8), - make_tuple(&aom_highbd_lpf_horizontal_edge_16_sse2, - &aom_highbd_lpf_horizontal_edge_16_c, 8), - make_tuple(&aom_highbd_lpf_vertical_8_sse2, - &aom_highbd_lpf_vertical_8_c, 8), - make_tuple(&aom_highbd_lpf_vertical_16_sse2, - &aom_highbd_lpf_vertical_16_c, 8), - make_tuple(&aom_highbd_lpf_horizontal_4_sse2, - &aom_highbd_lpf_horizontal_4_c, 10), - make_tuple(&aom_highbd_lpf_vertical_4_sse2, - &aom_highbd_lpf_vertical_4_c, 10), - make_tuple(&aom_highbd_lpf_horizontal_8_sse2, - &aom_highbd_lpf_horizontal_8_c, 10), - make_tuple(&aom_highbd_lpf_horizontal_edge_8_sse2, - &aom_highbd_lpf_horizontal_edge_8_c, 10), - make_tuple(&aom_highbd_lpf_horizontal_edge_16_sse2, - &aom_highbd_lpf_horizontal_edge_16_c, 10), - make_tuple(&aom_highbd_lpf_vertical_8_sse2, - &aom_highbd_lpf_vertical_8_c, 10), - make_tuple(&aom_highbd_lpf_vertical_16_sse2, - &aom_highbd_lpf_vertical_16_c, 10), - make_tuple(&aom_highbd_lpf_horizontal_4_sse2, - &aom_highbd_lpf_horizontal_4_c, 12), - make_tuple(&aom_highbd_lpf_vertical_4_sse2, - &aom_highbd_lpf_vertical_4_c, 12), - make_tuple(&aom_highbd_lpf_horizontal_8_sse2, - &aom_highbd_lpf_horizontal_8_c, 12), - make_tuple(&aom_highbd_lpf_horizontal_edge_8_sse2, - &aom_highbd_lpf_horizontal_edge_8_c, 12), - make_tuple(&aom_highbd_lpf_horizontal_edge_16_sse2, - &aom_highbd_lpf_horizontal_edge_16_c, 12), - make_tuple(&aom_highbd_lpf_vertical_8_sse2, - &aom_highbd_lpf_vertical_8_c, 12), - make_tuple(&aom_highbd_lpf_vertical_16_sse2, - &aom_highbd_lpf_vertical_16_c, 12), - make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2, - &aom_highbd_lpf_vertical_16_dual_c, 8), - make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2, - &aom_highbd_lpf_vertical_16_dual_c, 10), - make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2, - &aom_highbd_lpf_vertical_16_dual_c, 12))); + +const loop8_param_t kHbdLoop8Test6[] = { + make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c, + 8), + make_tuple(&aom_highbd_lpf_vertical_4_sse2, &aom_highbd_lpf_vertical_4_c, 8), + make_tuple(&aom_highbd_lpf_horizontal_8_sse2, &aom_highbd_lpf_horizontal_8_c, + 8), + make_tuple(&aom_highbd_lpf_horizontal_edge_8_sse2, + &aom_highbd_lpf_horizontal_edge_8_c, 8), + make_tuple(&aom_highbd_lpf_horizontal_edge_16_sse2, + &aom_highbd_lpf_horizontal_edge_16_c, 8), + make_tuple(&aom_highbd_lpf_vertical_8_sse2, &aom_highbd_lpf_vertical_8_c, 8), + make_tuple(&aom_highbd_lpf_vertical_16_sse2, &aom_highbd_lpf_vertical_16_c, + 8), + make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c, + 10), + make_tuple(&aom_highbd_lpf_vertical_4_sse2, &aom_highbd_lpf_vertical_4_c, 10), + make_tuple(&aom_highbd_lpf_horizontal_8_sse2, &aom_highbd_lpf_horizontal_8_c, + 10), + make_tuple(&aom_highbd_lpf_horizontal_edge_8_sse2, + &aom_highbd_lpf_horizontal_edge_8_c, 10), + make_tuple(&aom_highbd_lpf_horizontal_edge_16_sse2, + &aom_highbd_lpf_horizontal_edge_16_c, 10), + make_tuple(&aom_highbd_lpf_vertical_8_sse2, &aom_highbd_lpf_vertical_8_c, 10), + make_tuple(&aom_highbd_lpf_vertical_16_sse2, &aom_highbd_lpf_vertical_16_c, + 10), + make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c, + 12), + make_tuple(&aom_highbd_lpf_vertical_4_sse2, &aom_highbd_lpf_vertical_4_c, 12), + make_tuple(&aom_highbd_lpf_horizontal_8_sse2, &aom_highbd_lpf_horizontal_8_c, + 12), + make_tuple(&aom_highbd_lpf_horizontal_edge_8_sse2, + &aom_highbd_lpf_horizontal_edge_8_c, 12), + make_tuple(&aom_highbd_lpf_horizontal_edge_16_sse2, + &aom_highbd_lpf_horizontal_edge_16_c, 12), + make_tuple(&aom_highbd_lpf_vertical_8_sse2, &aom_highbd_lpf_vertical_8_c, 12), + make_tuple(&aom_highbd_lpf_vertical_16_sse2, &aom_highbd_lpf_vertical_16_c, + 12), + make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2, + &aom_highbd_lpf_vertical_16_dual_c, 8), + make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2, + &aom_highbd_lpf_vertical_16_dual_c, 10), + make_tuple(&aom_highbd_lpf_vertical_16_dual_sse2, + &aom_highbd_lpf_vertical_16_dual_c, 12) +}; + +INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param, + ::testing::ValuesIn(kHbdLoop8Test6)); #else -INSTANTIATE_TEST_CASE_P( - SSE2, Loop8Test6Param, - ::testing::Values( - make_tuple(&aom_lpf_horizontal_4_sse2, &aom_lpf_horizontal_4_c, 8), - make_tuple(&aom_lpf_horizontal_8_sse2, &aom_lpf_horizontal_8_c, 8), - make_tuple(&aom_lpf_horizontal_edge_8_sse2, - &aom_lpf_horizontal_edge_8_c, 8), - make_tuple(&aom_lpf_horizontal_edge_16_sse2, - &aom_lpf_horizontal_edge_16_c, 8), - make_tuple(&aom_lpf_vertical_4_sse2, &aom_lpf_vertical_4_c, 8), - make_tuple(&aom_lpf_vertical_8_sse2, &aom_lpf_vertical_8_c, 8), - make_tuple(&aom_lpf_vertical_16_sse2, &aom_lpf_vertical_16_c, 8), - make_tuple(&aom_lpf_vertical_16_dual_sse2, &aom_lpf_vertical_16_dual_c, - 8))); +const loop8_param_t kLoop8Test6[] = { + make_tuple(&aom_lpf_horizontal_4_sse2, &aom_lpf_horizontal_4_c, 8), + make_tuple(&aom_lpf_horizontal_8_sse2, &aom_lpf_horizontal_8_c, 8), + make_tuple(&aom_lpf_horizontal_edge_8_sse2, &aom_lpf_horizontal_edge_8_c, 8), + make_tuple(&aom_lpf_horizontal_edge_16_sse2, &aom_lpf_horizontal_edge_16_c, + 8), + make_tuple(&aom_lpf_vertical_4_sse2, &aom_lpf_vertical_4_c, 8), + make_tuple(&aom_lpf_vertical_8_sse2, &aom_lpf_vertical_8_c, 8), + make_tuple(&aom_lpf_vertical_16_sse2, &aom_lpf_vertical_16_c, 8), + make_tuple(&aom_lpf_vertical_16_dual_sse2, &aom_lpf_vertical_16_dual_c, 8) +}; + +INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param, + ::testing::ValuesIn(kLoop8Test6)); #endif // CONFIG_HIGHBITDEPTH #endif -#if HAVE_AVX2 && (!CONFIG_HIGHBITDEPTH) +#if HAVE_AVX2 && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING) INSTANTIATE_TEST_CASE_P( AVX2, Loop8Test6Param, ::testing::Values(make_tuple(&aom_lpf_horizontal_edge_8_avx2, @@ -489,49 +487,51 @@ INSTANTIATE_TEST_CASE_P( &aom_lpf_horizontal_edge_16_c, 8))); #endif -#if HAVE_SSE2 +#if HAVE_SSE2 && (!CONFIG_PARALLEL_DEBLOCKING) #if CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P( - SSE2, Loop8Test9Param, - ::testing::Values(make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2, - &aom_highbd_lpf_horizontal_4_dual_c, 8), - make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2, - &aom_highbd_lpf_horizontal_8_dual_c, 8), - make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2, - &aom_highbd_lpf_vertical_4_dual_c, 8), - make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2, - &aom_highbd_lpf_vertical_8_dual_c, 8), - make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2, - &aom_highbd_lpf_horizontal_4_dual_c, 10), - make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2, - &aom_highbd_lpf_horizontal_8_dual_c, 10), - make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2, - &aom_highbd_lpf_vertical_4_dual_c, 10), - make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2, - &aom_highbd_lpf_vertical_8_dual_c, 10), - make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2, - &aom_highbd_lpf_horizontal_4_dual_c, 12), - make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2, - &aom_highbd_lpf_horizontal_8_dual_c, 12), - make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2, - &aom_highbd_lpf_vertical_4_dual_c, 12), - make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2, - &aom_highbd_lpf_vertical_8_dual_c, 12))); +const dualloop8_param_t kHbdLoop8Test9[] = { + make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2, + &aom_highbd_lpf_horizontal_4_dual_c, 8), + make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2, + &aom_highbd_lpf_horizontal_8_dual_c, 8), + make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2, + &aom_highbd_lpf_vertical_4_dual_c, 8), + make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2, + &aom_highbd_lpf_vertical_8_dual_c, 8), + make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2, + &aom_highbd_lpf_horizontal_4_dual_c, 10), + make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2, + &aom_highbd_lpf_horizontal_8_dual_c, 10), + make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2, + &aom_highbd_lpf_vertical_4_dual_c, 10), + make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2, + &aom_highbd_lpf_vertical_8_dual_c, 10), + make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2, + &aom_highbd_lpf_horizontal_4_dual_c, 12), + make_tuple(&aom_highbd_lpf_horizontal_8_dual_sse2, + &aom_highbd_lpf_horizontal_8_dual_c, 12), + make_tuple(&aom_highbd_lpf_vertical_4_dual_sse2, + &aom_highbd_lpf_vertical_4_dual_c, 12), + make_tuple(&aom_highbd_lpf_vertical_8_dual_sse2, + &aom_highbd_lpf_vertical_8_dual_c, 12) +}; + +INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param, + ::testing::ValuesIn(kHbdLoop8Test9)); #else -INSTANTIATE_TEST_CASE_P( - SSE2, Loop8Test9Param, - ::testing::Values(make_tuple(&aom_lpf_horizontal_4_dual_sse2, - &aom_lpf_horizontal_4_dual_c, 8), - make_tuple(&aom_lpf_horizontal_8_dual_sse2, - &aom_lpf_horizontal_8_dual_c, 8), - make_tuple(&aom_lpf_vertical_4_dual_sse2, - &aom_lpf_vertical_4_dual_c, 8), - make_tuple(&aom_lpf_vertical_8_dual_sse2, - &aom_lpf_vertical_8_dual_c, 8))); +const dualloop8_param_t kLoop8Test9[] = { + make_tuple(&aom_lpf_horizontal_4_dual_sse2, &aom_lpf_horizontal_4_dual_c, 8), + make_tuple(&aom_lpf_horizontal_8_dual_sse2, &aom_lpf_horizontal_8_dual_c, 8), + make_tuple(&aom_lpf_vertical_4_dual_sse2, &aom_lpf_vertical_4_dual_c, 8), + make_tuple(&aom_lpf_vertical_8_dual_sse2, &aom_lpf_vertical_8_dual_c, 8) +}; + +INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param, + ::testing::ValuesIn(kLoop8Test9)); #endif // CONFIG_HIGHBITDEPTH #endif -#if HAVE_NEON +#if HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING) #if CONFIG_HIGHBITDEPTH // No neon high bitdepth functions. #else @@ -567,9 +567,9 @@ INSTANTIATE_TEST_CASE_P(NEON, Loop8Test9Param, make_tuple(&aom_lpf_vertical_4_dual_neon, &aom_lpf_vertical_4_dual_c, 8))); #endif // CONFIG_HIGHBITDEPTH -#endif // HAVE_NEON +#endif // HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING) -#if HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH +#if HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH && (!CONFIG_PARALLEL_DEBLOCKING) INSTANTIATE_TEST_CASE_P( DSPR2, Loop8Test6Param, ::testing::Values( @@ -593,9 +593,9 @@ INSTANTIATE_TEST_CASE_P( &aom_lpf_vertical_4_dual_c, 8), make_tuple(&aom_lpf_vertical_8_dual_dspr2, &aom_lpf_vertical_8_dual_c, 8))); -#endif // HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH +#endif // HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH && (!CONFIG_PARALLEL_DEBLOCKING) -#if HAVE_MSA && (!CONFIG_HIGHBITDEPTH) +#if HAVE_MSA && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING) INSTANTIATE_TEST_CASE_P( MSA, Loop8Test6Param, ::testing::Values( @@ -619,6 +619,6 @@ INSTANTIATE_TEST_CASE_P( &aom_lpf_vertical_4_dual_c, 8), make_tuple(&aom_lpf_vertical_8_dual_msa, &aom_lpf_vertical_8_dual_c, 8))); -#endif // HAVE_MSA && (!CONFIG_HIGHBITDEPTH) +#endif // HAVE_MSA && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING) } // namespace diff --git a/third_party/aom/test/masked_sad_test.cc b/third_party/aom/test/masked_sad_test.cc index 2dde3c537..19f97718d 100644 --- a/third_party/aom/test/masked_sad_test.cc +++ b/third_party/aom/test/masked_sad_test.cc @@ -160,64 +160,56 @@ TEST_P(HighbdMaskedSADTest, OperationCheck) { using std::tr1::make_tuple; #if HAVE_SSSE3 -INSTANTIATE_TEST_CASE_P( - SSSE3_C_COMPARE, MaskedSADTest, - ::testing::Values( +const MaskedSADParam msad_test[] = { #if CONFIG_EXT_PARTITION - make_tuple(&aom_masked_sad128x128_ssse3, &aom_masked_sad128x128_c), - make_tuple(&aom_masked_sad128x64_ssse3, &aom_masked_sad128x64_c), - make_tuple(&aom_masked_sad64x128_ssse3, &aom_masked_sad64x128_c), + make_tuple(&aom_masked_sad128x128_ssse3, &aom_masked_sad128x128_c), + make_tuple(&aom_masked_sad128x64_ssse3, &aom_masked_sad128x64_c), + make_tuple(&aom_masked_sad64x128_ssse3, &aom_masked_sad64x128_c), #endif // CONFIG_EXT_PARTITION - make_tuple(&aom_masked_sad64x64_ssse3, &aom_masked_sad64x64_c), - make_tuple(&aom_masked_sad64x32_ssse3, &aom_masked_sad64x32_c), - make_tuple(&aom_masked_sad32x64_ssse3, &aom_masked_sad32x64_c), - make_tuple(&aom_masked_sad32x32_ssse3, &aom_masked_sad32x32_c), - make_tuple(&aom_masked_sad32x16_ssse3, &aom_masked_sad32x16_c), - make_tuple(&aom_masked_sad16x32_ssse3, &aom_masked_sad16x32_c), - make_tuple(&aom_masked_sad16x16_ssse3, &aom_masked_sad16x16_c), - make_tuple(&aom_masked_sad16x8_ssse3, &aom_masked_sad16x8_c), - make_tuple(&aom_masked_sad8x16_ssse3, &aom_masked_sad8x16_c), - make_tuple(&aom_masked_sad8x8_ssse3, &aom_masked_sad8x8_c), - make_tuple(&aom_masked_sad8x4_ssse3, &aom_masked_sad8x4_c), - make_tuple(&aom_masked_sad4x8_ssse3, &aom_masked_sad4x8_c), - make_tuple(&aom_masked_sad4x4_ssse3, &aom_masked_sad4x4_c))); + make_tuple(&aom_masked_sad64x64_ssse3, &aom_masked_sad64x64_c), + make_tuple(&aom_masked_sad64x32_ssse3, &aom_masked_sad64x32_c), + make_tuple(&aom_masked_sad32x64_ssse3, &aom_masked_sad32x64_c), + make_tuple(&aom_masked_sad32x32_ssse3, &aom_masked_sad32x32_c), + make_tuple(&aom_masked_sad32x16_ssse3, &aom_masked_sad32x16_c), + make_tuple(&aom_masked_sad16x32_ssse3, &aom_masked_sad16x32_c), + make_tuple(&aom_masked_sad16x16_ssse3, &aom_masked_sad16x16_c), + make_tuple(&aom_masked_sad16x8_ssse3, &aom_masked_sad16x8_c), + make_tuple(&aom_masked_sad8x16_ssse3, &aom_masked_sad8x16_c), + make_tuple(&aom_masked_sad8x8_ssse3, &aom_masked_sad8x8_c), + make_tuple(&aom_masked_sad8x4_ssse3, &aom_masked_sad8x4_c), + make_tuple(&aom_masked_sad4x8_ssse3, &aom_masked_sad4x8_c), + make_tuple(&aom_masked_sad4x4_ssse3, &aom_masked_sad4x4_c) +}; + +INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, MaskedSADTest, + ::testing::ValuesIn(msad_test)); #if CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, HighbdMaskedSADTest, - ::testing::Values( +const HighbdMaskedSADParam hbd_msad_test[] = { #if CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_masked_sad128x128_ssse3, - &aom_highbd_masked_sad128x128_c), - make_tuple(&aom_highbd_masked_sad128x64_ssse3, - &aom_highbd_masked_sad128x64_c), - make_tuple(&aom_highbd_masked_sad64x128_ssse3, - &aom_highbd_masked_sad64x128_c), + make_tuple(&aom_highbd_masked_sad128x128_ssse3, + &aom_highbd_masked_sad128x128_c), + make_tuple(&aom_highbd_masked_sad128x64_ssse3, + &aom_highbd_masked_sad128x64_c), + make_tuple(&aom_highbd_masked_sad64x128_ssse3, + &aom_highbd_masked_sad64x128_c), #endif // CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_masked_sad64x64_ssse3, - &aom_highbd_masked_sad64x64_c), - make_tuple(&aom_highbd_masked_sad64x32_ssse3, - &aom_highbd_masked_sad64x32_c), - make_tuple(&aom_highbd_masked_sad32x64_ssse3, - &aom_highbd_masked_sad32x64_c), - make_tuple(&aom_highbd_masked_sad32x32_ssse3, - &aom_highbd_masked_sad32x32_c), - make_tuple(&aom_highbd_masked_sad32x16_ssse3, - &aom_highbd_masked_sad32x16_c), - make_tuple(&aom_highbd_masked_sad16x32_ssse3, - &aom_highbd_masked_sad16x32_c), - make_tuple(&aom_highbd_masked_sad16x16_ssse3, - &aom_highbd_masked_sad16x16_c), - make_tuple(&aom_highbd_masked_sad16x8_ssse3, - &aom_highbd_masked_sad16x8_c), - make_tuple(&aom_highbd_masked_sad8x16_ssse3, - &aom_highbd_masked_sad8x16_c), - make_tuple(&aom_highbd_masked_sad8x8_ssse3, - &aom_highbd_masked_sad8x8_c), - make_tuple(&aom_highbd_masked_sad8x4_ssse3, - &aom_highbd_masked_sad8x4_c), - make_tuple(&aom_highbd_masked_sad4x8_ssse3, - &aom_highbd_masked_sad4x8_c), - make_tuple(&aom_highbd_masked_sad4x4_ssse3, - &aom_highbd_masked_sad4x4_c))); + make_tuple(&aom_highbd_masked_sad64x64_ssse3, &aom_highbd_masked_sad64x64_c), + make_tuple(&aom_highbd_masked_sad64x32_ssse3, &aom_highbd_masked_sad64x32_c), + make_tuple(&aom_highbd_masked_sad32x64_ssse3, &aom_highbd_masked_sad32x64_c), + make_tuple(&aom_highbd_masked_sad32x32_ssse3, &aom_highbd_masked_sad32x32_c), + make_tuple(&aom_highbd_masked_sad32x16_ssse3, &aom_highbd_masked_sad32x16_c), + make_tuple(&aom_highbd_masked_sad16x32_ssse3, &aom_highbd_masked_sad16x32_c), + make_tuple(&aom_highbd_masked_sad16x16_ssse3, &aom_highbd_masked_sad16x16_c), + make_tuple(&aom_highbd_masked_sad16x8_ssse3, &aom_highbd_masked_sad16x8_c), + make_tuple(&aom_highbd_masked_sad8x16_ssse3, &aom_highbd_masked_sad8x16_c), + make_tuple(&aom_highbd_masked_sad8x8_ssse3, &aom_highbd_masked_sad8x8_c), + make_tuple(&aom_highbd_masked_sad8x4_ssse3, &aom_highbd_masked_sad8x4_c), + make_tuple(&aom_highbd_masked_sad4x8_ssse3, &aom_highbd_masked_sad4x8_c), + make_tuple(&aom_highbd_masked_sad4x4_ssse3, &aom_highbd_masked_sad4x4_c) +}; + +INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, HighbdMaskedSADTest, + ::testing::ValuesIn(hbd_msad_test)); #endif // CONFIG_HIGHBITDEPTH #endif // HAVE_SSSE3 } // namespace diff --git a/third_party/aom/test/masked_variance_test.cc b/third_party/aom/test/masked_variance_test.cc index bf113c69e..a9cbdc80d 100644 --- a/third_party/aom/test/masked_variance_test.cc +++ b/third_party/aom/test/masked_variance_test.cc @@ -59,30 +59,25 @@ TEST_P(MaskedSubPixelVarianceTest, OperationCheck) { unsigned int ref_ret, opt_ret; unsigned int ref_sse, opt_sse; ACMRandom rnd(ACMRandom::DeterministicSeed()); - // Note: We pad the input arrays out with 15 extra elements, since the SSE - // implementations can read up to 15 elements off the end of the main data. - // The extra data is never actually used, but it simplifies the code - // if we can do this. + // Note: We pad out the input array to a multiple of 16 bytes wide, so that + // consecutive rows keep the 16-byte alignment. + DECLARE_ALIGNED(16, uint8_t, src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); + DECLARE_ALIGNED(16, uint8_t, ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); DECLARE_ALIGNED(16, uint8_t, - src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); - DECLARE_ALIGNED(16, uint8_t, - ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); - DECLARE_ALIGNED(16, uint8_t, - second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); - DECLARE_ALIGNED(16, uint8_t, - msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); + second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); + DECLARE_ALIGNED(16, uint8_t, msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); int err_count = 0; int first_failure = -1; - int src_stride = (MAX_SB_SIZE + 1); - int ref_stride = (MAX_SB_SIZE + 1); - int msk_stride = (MAX_SB_SIZE + 1); + int src_stride = (MAX_SB_SIZE + 16); + int ref_stride = (MAX_SB_SIZE + 16); + int msk_stride = (MAX_SB_SIZE + 16); int xoffset; int yoffset; for (int i = 0; i < number_of_iterations; ++i) { int xoffsets[] = { 0, 4, rnd(BIL_SUBPEL_SHIFTS) }; int yoffsets[] = { 0, 4, rnd(BIL_SUBPEL_SHIFTS) }; - for (int j = 0; j < (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1); j++) { + for (int j = 0; j < (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16); j++) { src_ptr[j] = rnd.Rand8(); ref_ptr[j] = rnd.Rand8(); second_pred_ptr[j] = rnd.Rand8(); @@ -120,33 +115,30 @@ TEST_P(MaskedSubPixelVarianceTest, ExtremeValues) { unsigned int ref_ret, opt_ret; unsigned int ref_sse, opt_sse; ACMRandom rnd(ACMRandom::DeterministicSeed()); + DECLARE_ALIGNED(16, uint8_t, src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); + DECLARE_ALIGNED(16, uint8_t, ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); DECLARE_ALIGNED(16, uint8_t, - src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); - DECLARE_ALIGNED(16, uint8_t, - ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); - DECLARE_ALIGNED(16, uint8_t, - second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); - DECLARE_ALIGNED(16, uint8_t, - msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 15]); + second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); + DECLARE_ALIGNED(16, uint8_t, msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)]); int first_failure_x = -1; int first_failure_y = -1; int err_count = 0; int first_failure = -1; - int src_stride = (MAX_SB_SIZE + 1); - int ref_stride = (MAX_SB_SIZE + 1); - int msk_stride = (MAX_SB_SIZE + 1); + int src_stride = (MAX_SB_SIZE + 16); + int ref_stride = (MAX_SB_SIZE + 16); + int msk_stride = (MAX_SB_SIZE + 16); for (int xoffset = 0; xoffset < BIL_SUBPEL_SHIFTS; xoffset++) { for (int yoffset = 0; yoffset < BIL_SUBPEL_SHIFTS; yoffset++) { for (int i = 0; i < 16; ++i) { memset(src_ptr, (i & 0x1) ? 255 : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)); memset(ref_ptr, (i & 0x2) ? 255 : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)); memset(second_pred_ptr, (i & 0x4) ? 255 : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)); memset(msk_ptr, (i & 0x8) ? 64 : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 16)); for (int invert_mask = 0; invert_mask < 2; ++invert_mask) { ref_ret = ref_func_(src_ptr, src_stride, xoffset, yoffset, ref_ptr, @@ -204,18 +196,11 @@ TEST_P(HighbdMaskedSubPixelVarianceTest, OperationCheck) { unsigned int ref_ret, opt_ret; unsigned int ref_sse, opt_sse; ACMRandom rnd(ACMRandom::DeterministicSeed()); - // Note: We pad the input arrays out with 7 extra elements, since the SSE - // implementations can read up to 7 elements off the end of the main data. - // The extra data is never actually used, but it simplifies the code - // if we can do this. - DECLARE_ALIGNED(16, uint16_t, - src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); + DECLARE_ALIGNED(16, uint16_t, src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); + DECLARE_ALIGNED(16, uint16_t, ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); DECLARE_ALIGNED(16, uint16_t, - ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); - DECLARE_ALIGNED(16, uint16_t, - second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); - DECLARE_ALIGNED(16, uint8_t, - msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); + second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); + DECLARE_ALIGNED(16, uint8_t, msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); uint8_t *src8_ptr = CONVERT_TO_BYTEPTR(src_ptr); uint8_t *ref8_ptr = CONVERT_TO_BYTEPTR(ref_ptr); uint8_t *second_pred8_ptr = CONVERT_TO_BYTEPTR(second_pred_ptr); @@ -223,13 +208,13 @@ TEST_P(HighbdMaskedSubPixelVarianceTest, OperationCheck) { int first_failure = -1; int first_failure_x = -1; int first_failure_y = -1; - int src_stride = (MAX_SB_SIZE + 1); - int ref_stride = (MAX_SB_SIZE + 1); - int msk_stride = (MAX_SB_SIZE + 1); + int src_stride = (MAX_SB_SIZE + 8); + int ref_stride = (MAX_SB_SIZE + 8); + int msk_stride = (MAX_SB_SIZE + 8); int xoffset, yoffset; for (int i = 0; i < number_of_iterations; ++i) { - for (int j = 0; j < (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1); j++) { + for (int j = 0; j < (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8); j++) { src_ptr[j] = rnd.Rand16() & ((1 << bit_depth_) - 1); ref_ptr[j] = rnd.Rand16() & ((1 << bit_depth_) - 1); second_pred_ptr[j] = rnd.Rand16() & ((1 << bit_depth_) - 1); @@ -270,14 +255,11 @@ TEST_P(HighbdMaskedSubPixelVarianceTest, ExtremeValues) { unsigned int ref_ret, opt_ret; unsigned int ref_sse, opt_sse; ACMRandom rnd(ACMRandom::DeterministicSeed()); + DECLARE_ALIGNED(16, uint16_t, src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); + DECLARE_ALIGNED(16, uint16_t, ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); + DECLARE_ALIGNED(16, uint8_t, msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); DECLARE_ALIGNED(16, uint16_t, - src_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); - DECLARE_ALIGNED(16, uint16_t, - ref_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); - DECLARE_ALIGNED(16, uint8_t, - msk_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); - DECLARE_ALIGNED(16, uint16_t, - second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1) + 7]); + second_pred_ptr[(MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)]); uint8_t *src8_ptr = CONVERT_TO_BYTEPTR(src_ptr); uint8_t *ref8_ptr = CONVERT_TO_BYTEPTR(ref_ptr); uint8_t *second_pred8_ptr = CONVERT_TO_BYTEPTR(second_pred_ptr); @@ -285,21 +267,21 @@ TEST_P(HighbdMaskedSubPixelVarianceTest, ExtremeValues) { int first_failure_y = -1; int err_count = 0; int first_failure = -1; - int src_stride = (MAX_SB_SIZE + 1); - int ref_stride = (MAX_SB_SIZE + 1); - int msk_stride = (MAX_SB_SIZE + 1); + int src_stride = (MAX_SB_SIZE + 8); + int ref_stride = (MAX_SB_SIZE + 8); + int msk_stride = (MAX_SB_SIZE + 8); for (int xoffset = 0; xoffset < BIL_SUBPEL_SHIFTS; xoffset++) { for (int yoffset = 0; yoffset < BIL_SUBPEL_SHIFTS; yoffset++) { for (int i = 0; i < 16; ++i) { aom_memset16(src_ptr, (i & 0x1) ? ((1 << bit_depth_) - 1) : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)); aom_memset16(ref_ptr, (i & 0x2) ? ((1 << bit_depth_) - 1) : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)); aom_memset16(second_pred_ptr, (i & 0x4) ? ((1 << bit_depth_) - 1) : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)); memset(msk_ptr, (i & 0x8) ? 64 : 0, - (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 1)); + (MAX_SB_SIZE + 1) * (MAX_SB_SIZE + 8)); for (int invert_mask = 0; invert_mask < 2; ++invert_mask) { ref_ret = ref_func_(src8_ptr, src_stride, xoffset, yoffset, ref8_ptr, @@ -334,172 +316,155 @@ TEST_P(HighbdMaskedSubPixelVarianceTest, ExtremeValues) { using std::tr1::make_tuple; #if HAVE_SSSE3 -INSTANTIATE_TEST_CASE_P( - SSSE3_C_COMPARE, MaskedSubPixelVarianceTest, - ::testing::Values( + +const MaskedSubPixelVarianceParam sub_pel_var_test[] = { #if CONFIG_EXT_PARTITION - make_tuple(&aom_masked_sub_pixel_variance128x128_ssse3, - &aom_masked_sub_pixel_variance128x128_c), - make_tuple(&aom_masked_sub_pixel_variance128x64_ssse3, - &aom_masked_sub_pixel_variance128x64_c), - make_tuple(&aom_masked_sub_pixel_variance64x128_ssse3, - &aom_masked_sub_pixel_variance64x128_c), + make_tuple(&aom_masked_sub_pixel_variance128x128_ssse3, + &aom_masked_sub_pixel_variance128x128_c), + make_tuple(&aom_masked_sub_pixel_variance128x64_ssse3, + &aom_masked_sub_pixel_variance128x64_c), + make_tuple(&aom_masked_sub_pixel_variance64x128_ssse3, + &aom_masked_sub_pixel_variance64x128_c), #endif // CONFIG_EXT_PARTITION - make_tuple(&aom_masked_sub_pixel_variance64x64_ssse3, - &aom_masked_sub_pixel_variance64x64_c), - make_tuple(&aom_masked_sub_pixel_variance64x32_ssse3, - &aom_masked_sub_pixel_variance64x32_c), - make_tuple(&aom_masked_sub_pixel_variance32x64_ssse3, - &aom_masked_sub_pixel_variance32x64_c), - make_tuple(&aom_masked_sub_pixel_variance32x32_ssse3, - &aom_masked_sub_pixel_variance32x32_c), - make_tuple(&aom_masked_sub_pixel_variance32x16_ssse3, - &aom_masked_sub_pixel_variance32x16_c), - make_tuple(&aom_masked_sub_pixel_variance16x32_ssse3, - &aom_masked_sub_pixel_variance16x32_c), - make_tuple(&aom_masked_sub_pixel_variance16x16_ssse3, - &aom_masked_sub_pixel_variance16x16_c), - make_tuple(&aom_masked_sub_pixel_variance16x8_ssse3, - &aom_masked_sub_pixel_variance16x8_c), - make_tuple(&aom_masked_sub_pixel_variance8x16_ssse3, - &aom_masked_sub_pixel_variance8x16_c), - make_tuple(&aom_masked_sub_pixel_variance8x8_ssse3, - &aom_masked_sub_pixel_variance8x8_c), - make_tuple(&aom_masked_sub_pixel_variance8x4_ssse3, - &aom_masked_sub_pixel_variance8x4_c), - make_tuple(&aom_masked_sub_pixel_variance4x8_ssse3, - &aom_masked_sub_pixel_variance4x8_c), - make_tuple(&aom_masked_sub_pixel_variance4x4_ssse3, - &aom_masked_sub_pixel_variance4x4_c))); + make_tuple(&aom_masked_sub_pixel_variance64x64_ssse3, + &aom_masked_sub_pixel_variance64x64_c), + make_tuple(&aom_masked_sub_pixel_variance64x32_ssse3, + &aom_masked_sub_pixel_variance64x32_c), + make_tuple(&aom_masked_sub_pixel_variance32x64_ssse3, + &aom_masked_sub_pixel_variance32x64_c), + make_tuple(&aom_masked_sub_pixel_variance32x32_ssse3, + &aom_masked_sub_pixel_variance32x32_c), + make_tuple(&aom_masked_sub_pixel_variance32x16_ssse3, + &aom_masked_sub_pixel_variance32x16_c), + make_tuple(&aom_masked_sub_pixel_variance16x32_ssse3, + &aom_masked_sub_pixel_variance16x32_c), + make_tuple(&aom_masked_sub_pixel_variance16x16_ssse3, + &aom_masked_sub_pixel_variance16x16_c), + make_tuple(&aom_masked_sub_pixel_variance16x8_ssse3, + &aom_masked_sub_pixel_variance16x8_c), + make_tuple(&aom_masked_sub_pixel_variance8x16_ssse3, + &aom_masked_sub_pixel_variance8x16_c), + make_tuple(&aom_masked_sub_pixel_variance8x8_ssse3, + &aom_masked_sub_pixel_variance8x8_c), + make_tuple(&aom_masked_sub_pixel_variance8x4_ssse3, + &aom_masked_sub_pixel_variance8x4_c), + make_tuple(&aom_masked_sub_pixel_variance4x8_ssse3, + &aom_masked_sub_pixel_variance4x8_c), + make_tuple(&aom_masked_sub_pixel_variance4x4_ssse3, + &aom_masked_sub_pixel_variance4x4_c) +}; + +INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, MaskedSubPixelVarianceTest, + ::testing::ValuesIn(sub_pel_var_test)); #if CONFIG_HIGHBITDEPTH -INSTANTIATE_TEST_CASE_P( - SSSE3_C_COMPARE, HighbdMaskedSubPixelVarianceTest, - ::testing::Values( +const HighbdMaskedSubPixelVarianceParam hbd_sub_pel_var_test[] = { #if CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_8_masked_sub_pixel_variance128x128_ssse3, - &aom_highbd_8_masked_sub_pixel_variance128x128_c, - AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance128x64_ssse3, - &aom_highbd_8_masked_sub_pixel_variance128x64_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance64x128_ssse3, - &aom_highbd_8_masked_sub_pixel_variance64x128_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance128x128_ssse3, + &aom_highbd_8_masked_sub_pixel_variance128x128_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance128x64_ssse3, + &aom_highbd_8_masked_sub_pixel_variance128x64_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance64x128_ssse3, + &aom_highbd_8_masked_sub_pixel_variance64x128_c, AOM_BITS_8), #endif // CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_8_masked_sub_pixel_variance64x64_ssse3, - &aom_highbd_8_masked_sub_pixel_variance64x64_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance64x32_ssse3, - &aom_highbd_8_masked_sub_pixel_variance64x32_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance32x64_ssse3, - &aom_highbd_8_masked_sub_pixel_variance32x64_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance32x32_ssse3, - &aom_highbd_8_masked_sub_pixel_variance32x32_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance32x16_ssse3, - &aom_highbd_8_masked_sub_pixel_variance32x16_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance16x32_ssse3, - &aom_highbd_8_masked_sub_pixel_variance16x32_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance16x16_ssse3, - &aom_highbd_8_masked_sub_pixel_variance16x16_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance16x8_ssse3, - &aom_highbd_8_masked_sub_pixel_variance16x8_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance8x16_ssse3, - &aom_highbd_8_masked_sub_pixel_variance8x16_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance8x8_ssse3, - &aom_highbd_8_masked_sub_pixel_variance8x8_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance8x4_ssse3, - &aom_highbd_8_masked_sub_pixel_variance8x4_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance4x8_ssse3, - &aom_highbd_8_masked_sub_pixel_variance4x8_c, AOM_BITS_8), - make_tuple(&aom_highbd_8_masked_sub_pixel_variance4x4_ssse3, - &aom_highbd_8_masked_sub_pixel_variance4x4_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance64x64_ssse3, + &aom_highbd_8_masked_sub_pixel_variance64x64_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance64x32_ssse3, + &aom_highbd_8_masked_sub_pixel_variance64x32_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance32x64_ssse3, + &aom_highbd_8_masked_sub_pixel_variance32x64_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance32x32_ssse3, + &aom_highbd_8_masked_sub_pixel_variance32x32_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance32x16_ssse3, + &aom_highbd_8_masked_sub_pixel_variance32x16_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance16x32_ssse3, + &aom_highbd_8_masked_sub_pixel_variance16x32_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance16x16_ssse3, + &aom_highbd_8_masked_sub_pixel_variance16x16_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance16x8_ssse3, + &aom_highbd_8_masked_sub_pixel_variance16x8_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance8x16_ssse3, + &aom_highbd_8_masked_sub_pixel_variance8x16_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance8x8_ssse3, + &aom_highbd_8_masked_sub_pixel_variance8x8_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance8x4_ssse3, + &aom_highbd_8_masked_sub_pixel_variance8x4_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance4x8_ssse3, + &aom_highbd_8_masked_sub_pixel_variance4x8_c, AOM_BITS_8), + make_tuple(&aom_highbd_8_masked_sub_pixel_variance4x4_ssse3, + &aom_highbd_8_masked_sub_pixel_variance4x4_c, AOM_BITS_8), #if CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_10_masked_sub_pixel_variance128x128_ssse3, - &aom_highbd_10_masked_sub_pixel_variance128x128_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance128x64_ssse3, - &aom_highbd_10_masked_sub_pixel_variance128x64_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance64x128_ssse3, - &aom_highbd_10_masked_sub_pixel_variance64x128_c, - AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance128x128_ssse3, + &aom_highbd_10_masked_sub_pixel_variance128x128_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance128x64_ssse3, + &aom_highbd_10_masked_sub_pixel_variance128x64_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance64x128_ssse3, + &aom_highbd_10_masked_sub_pixel_variance64x128_c, AOM_BITS_10), #endif // CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_10_masked_sub_pixel_variance64x64_ssse3, - &aom_highbd_10_masked_sub_pixel_variance64x64_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance64x32_ssse3, - &aom_highbd_10_masked_sub_pixel_variance64x32_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance32x64_ssse3, - &aom_highbd_10_masked_sub_pixel_variance32x64_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance32x32_ssse3, - &aom_highbd_10_masked_sub_pixel_variance32x32_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance32x16_ssse3, - &aom_highbd_10_masked_sub_pixel_variance32x16_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance16x32_ssse3, - &aom_highbd_10_masked_sub_pixel_variance16x32_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance16x16_ssse3, - &aom_highbd_10_masked_sub_pixel_variance16x16_c, - AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance16x8_ssse3, - &aom_highbd_10_masked_sub_pixel_variance16x8_c, AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance8x16_ssse3, - &aom_highbd_10_masked_sub_pixel_variance8x16_c, AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance8x8_ssse3, - &aom_highbd_10_masked_sub_pixel_variance8x8_c, AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance8x4_ssse3, - &aom_highbd_10_masked_sub_pixel_variance8x4_c, AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance4x8_ssse3, - &aom_highbd_10_masked_sub_pixel_variance4x8_c, AOM_BITS_10), - make_tuple(&aom_highbd_10_masked_sub_pixel_variance4x4_ssse3, - &aom_highbd_10_masked_sub_pixel_variance4x4_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance64x64_ssse3, + &aom_highbd_10_masked_sub_pixel_variance64x64_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance64x32_ssse3, + &aom_highbd_10_masked_sub_pixel_variance64x32_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance32x64_ssse3, + &aom_highbd_10_masked_sub_pixel_variance32x64_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance32x32_ssse3, + &aom_highbd_10_masked_sub_pixel_variance32x32_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance32x16_ssse3, + &aom_highbd_10_masked_sub_pixel_variance32x16_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance16x32_ssse3, + &aom_highbd_10_masked_sub_pixel_variance16x32_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance16x16_ssse3, + &aom_highbd_10_masked_sub_pixel_variance16x16_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance16x8_ssse3, + &aom_highbd_10_masked_sub_pixel_variance16x8_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance8x16_ssse3, + &aom_highbd_10_masked_sub_pixel_variance8x16_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance8x8_ssse3, + &aom_highbd_10_masked_sub_pixel_variance8x8_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance8x4_ssse3, + &aom_highbd_10_masked_sub_pixel_variance8x4_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance4x8_ssse3, + &aom_highbd_10_masked_sub_pixel_variance4x8_c, AOM_BITS_10), + make_tuple(&aom_highbd_10_masked_sub_pixel_variance4x4_ssse3, + &aom_highbd_10_masked_sub_pixel_variance4x4_c, AOM_BITS_10), #if CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_12_masked_sub_pixel_variance128x128_ssse3, - &aom_highbd_12_masked_sub_pixel_variance128x128_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance128x64_ssse3, - &aom_highbd_12_masked_sub_pixel_variance128x64_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance64x128_ssse3, - &aom_highbd_12_masked_sub_pixel_variance64x128_c, - AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance128x128_ssse3, + &aom_highbd_12_masked_sub_pixel_variance128x128_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance128x64_ssse3, + &aom_highbd_12_masked_sub_pixel_variance128x64_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance64x128_ssse3, + &aom_highbd_12_masked_sub_pixel_variance64x128_c, AOM_BITS_12), #endif // CONFIG_EXT_PARTITION - make_tuple(&aom_highbd_12_masked_sub_pixel_variance64x64_ssse3, - &aom_highbd_12_masked_sub_pixel_variance64x64_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance64x32_ssse3, - &aom_highbd_12_masked_sub_pixel_variance64x32_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance32x64_ssse3, - &aom_highbd_12_masked_sub_pixel_variance32x64_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance32x32_ssse3, - &aom_highbd_12_masked_sub_pixel_variance32x32_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance32x16_ssse3, - &aom_highbd_12_masked_sub_pixel_variance32x16_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance16x32_ssse3, - &aom_highbd_12_masked_sub_pixel_variance16x32_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance16x16_ssse3, - &aom_highbd_12_masked_sub_pixel_variance16x16_c, - AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance16x8_ssse3, - &aom_highbd_12_masked_sub_pixel_variance16x8_c, AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance8x16_ssse3, - &aom_highbd_12_masked_sub_pixel_variance8x16_c, AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance8x8_ssse3, - &aom_highbd_12_masked_sub_pixel_variance8x8_c, AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance8x4_ssse3, - &aom_highbd_12_masked_sub_pixel_variance8x4_c, AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance4x8_ssse3, - &aom_highbd_12_masked_sub_pixel_variance4x8_c, AOM_BITS_12), - make_tuple(&aom_highbd_12_masked_sub_pixel_variance4x4_ssse3, - &aom_highbd_12_masked_sub_pixel_variance4x4_c, - AOM_BITS_12))); + make_tuple(&aom_highbd_12_masked_sub_pixel_variance64x64_ssse3, + &aom_highbd_12_masked_sub_pixel_variance64x64_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance64x32_ssse3, + &aom_highbd_12_masked_sub_pixel_variance64x32_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance32x64_ssse3, + &aom_highbd_12_masked_sub_pixel_variance32x64_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance32x32_ssse3, + &aom_highbd_12_masked_sub_pixel_variance32x32_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance32x16_ssse3, + &aom_highbd_12_masked_sub_pixel_variance32x16_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance16x32_ssse3, + &aom_highbd_12_masked_sub_pixel_variance16x32_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance16x16_ssse3, + &aom_highbd_12_masked_sub_pixel_variance16x16_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance16x8_ssse3, + &aom_highbd_12_masked_sub_pixel_variance16x8_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance8x16_ssse3, + &aom_highbd_12_masked_sub_pixel_variance8x16_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance8x8_ssse3, + &aom_highbd_12_masked_sub_pixel_variance8x8_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance8x4_ssse3, + &aom_highbd_12_masked_sub_pixel_variance8x4_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance4x8_ssse3, + &aom_highbd_12_masked_sub_pixel_variance4x8_c, AOM_BITS_12), + make_tuple(&aom_highbd_12_masked_sub_pixel_variance4x4_ssse3, + &aom_highbd_12_masked_sub_pixel_variance4x4_c, AOM_BITS_12) +}; + +INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, HighbdMaskedSubPixelVarianceTest, + ::testing::ValuesIn(hbd_sub_pel_var_test)); #endif // CONFIG_HIGHBITDEPTH #endif // HAVE_SSSE3 diff --git a/third_party/aom/test/motion_vector_test.cc b/third_party/aom/test/motion_vector_test.cc index fa47494e8..fe20fd10a 100644 --- a/third_party/aom/test/motion_vector_test.cc +++ b/third_party/aom/test/motion_vector_test.cc @@ -32,9 +32,9 @@ const int kCpuUsedVectors[] = { 1, 5 }; const int kMVTestModes[] = { MAX_EXTREME_MV, MIN_EXTREME_MV }; class MotionVectorTestLarge - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, int, - int> { + : public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, int, + int>, + public ::libaom_test::EncoderTest { protected: MotionVectorTestLarge() : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), diff --git a/third_party/aom/test/partial_idct_test.cc b/third_party/aom/test/partial_idct_test.cc index 033f18294..b2ea176e8 100644 --- a/third_party/aom/test/partial_idct_test.cc +++ b/third_party/aom/test/partial_idct_test.cc @@ -41,13 +41,6 @@ void wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) { fn(in, out, stride); } -#if CONFIG_HIGHBITDEPTH -template <InvTxfmWithBdFunc fn> -void highbd_wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) { - fn(in, CONVERT_TO_BYTEPTR(out), stride, bd); -} -#endif - typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmWithBdFunc, InvTxfmWithBdFunc, TX_SIZE, int, int, int> PartialInvTxfmParam; @@ -285,26 +278,6 @@ TEST_P(PartialIDctTest, DISABLED_Speed) { using std::tr1::make_tuple; const PartialInvTxfmParam c_partial_idct_tests[] = { -#if CONFIG_HIGHBITDEPTH - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, TX_4X4, 16, 8, 2), - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, TX_4X4, 16, 10, 2), - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, TX_4X4, 16, 12, 2), - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_1_add_c>, TX_4X4, 1, 8, 2), - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_1_add_c>, TX_4X4, 1, 10, 2), - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_1_add_c>, TX_4X4, 1, 12, 2), -#endif // CONFIG_HIGHBITDEPTH make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>, &wrapper<aom_idct32x32_1024_add_c>, TX_32X32, 1024, 8, 1), make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>, @@ -358,17 +331,6 @@ INSTANTIATE_TEST_CASE_P(NEON, PartialIDctTest, #if HAVE_SSE2 const PartialInvTxfmParam sse2_partial_idct_tests[] = { -#if CONFIG_HIGHBITDEPTH - make_tuple(&aom_highbd_fdct4x4_c, - &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 8, 2), - make_tuple( - &aom_highbd_fdct4x4_c, &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 10, 2), - make_tuple( - &aom_highbd_fdct4x4_c, &highbd_wrapper<aom_highbd_idct4x4_16_add_c>, - &highbd_wrapper<aom_highbd_idct4x4_16_add_sse2>, TX_4X4, 16, 12, 2), -#endif // CONFIG_HIGHBITDEPTH make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>, &wrapper<aom_idct32x32_1024_add_sse2>, TX_32X32, 1024, 8, 1), make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>, diff --git a/third_party/aom/test/quantize_func_test.cc b/third_party/aom/test/quantize_func_test.cc index 32b1d5139..94dd056b4 100644 --- a/third_party/aom/test/quantize_func_test.cc +++ b/third_party/aom/test/quantize_func_test.cc @@ -12,8 +12,10 @@ #include "third_party/googletest/src/googletest/include/gtest/gtest.h" #include "./aom_config.h" +#include "./aom_dsp_rtcd.h" #include "./av1_rtcd.h" #include "aom/aom_codec.h" +#include "aom_ports/aom_timer.h" #include "av1/encoder/encoder.h" #include "av1/encoder/av1_quantize.h" #include "test/acm_random.h" @@ -24,26 +26,44 @@ namespace { using libaom_test::ACMRandom; -#if !CONFIG_AOM_QM -typedef void (*QuantizeFunc)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t *zbin_ptr, - const int16_t *round_ptr, const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan); -#else -typedef void (*QuantizeFunc)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, - int skip_block, const int16_t *zbin_ptr, - const int16_t *round_ptr, const int16_t *quant_ptr, - const int16_t *quant_shift_ptr, - tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, - const int16_t *dequant_ptr, uint16_t *eob_ptr, - const int16_t *scan, const int16_t *iscan, - const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr); -#endif +#define QUAN_PARAM_LIST \ + const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, \ + const int16_t *zbin_ptr, const int16_t *round_ptr, \ + const int16_t *quant_ptr, const int16_t *quant_shift_ptr, \ + tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, \ + const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, \ + const int16_t *iscan + +typedef void (*QuantizeFunc)(QUAN_PARAM_LIST); +typedef void (*QuantizeFuncHbd)(QUAN_PARAM_LIST, int log_scale); + +#define HBD_QUAN_FUNC \ + fn(coeff_ptr, n_coeffs, skip_block, zbin_ptr, round_ptr, quant_ptr, \ + quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr, scan, \ + iscan, log_scale) + +template <QuantizeFuncHbd fn> +void highbd_quan16x16_wrapper(QUAN_PARAM_LIST) { + const int log_scale = 0; + HBD_QUAN_FUNC; +} -typedef std::tr1::tuple<QuantizeFunc, QuantizeFunc, TX_SIZE, aom_bit_depth_t> +template <QuantizeFuncHbd fn> +void highbd_quan32x32_wrapper(QUAN_PARAM_LIST) { + const int log_scale = 1; + HBD_QUAN_FUNC; +} + +template <QuantizeFuncHbd fn> +void highbd_quan64x64_wrapper(QUAN_PARAM_LIST) { + const int log_scale = 2; + HBD_QUAN_FUNC; +} + +typedef enum { TYPE_B, TYPE_DC, TYPE_FP } QuantType; + +typedef std::tr1::tuple<QuantizeFunc, QuantizeFunc, TX_SIZE, QuantType, + aom_bit_depth_t> QuantizeParam; typedef struct { @@ -57,15 +77,15 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { protected: QuantizeTest() : quant_ref_(GET_PARAM(0)), quant_(GET_PARAM(1)), tx_size_(GET_PARAM(2)), - bd_(GET_PARAM(3)) {} + type_(GET_PARAM(3)), bd_(GET_PARAM(4)) {} virtual ~QuantizeTest() {} virtual void SetUp() { - qtab_ = reinterpret_cast<QuanTable *>(aom_memalign(16, sizeof(*qtab_))); - const int n_coeffs = getCoeffNum(); + qtab_ = reinterpret_cast<QuanTable *>(aom_memalign(32, sizeof(*qtab_))); + const int n_coeffs = coeff_num(); coeff_ = reinterpret_cast<tran_low_t *>( - aom_memalign(16, 6 * n_coeffs * sizeof(tran_low_t))); + aom_memalign(32, 6 * n_coeffs * sizeof(tran_low_t))); InitQuantizer(); } @@ -81,9 +101,9 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { av1_build_quantizer(bd_, 0, 0, 0, &qtab_->quant, &qtab_->dequant); } - void QuantizeRun(bool isLoop, int q = 0, int testNum = 1) { + void QuantizeRun(bool is_loop, int q = 0, int test_num = 1) { tran_low_t *coeff_ptr = coeff_; - const intptr_t n_coeffs = getCoeffNum(); + const intptr_t n_coeffs = coeff_num(); const int skip_block = 0; tran_low_t *qcoeff_ref = coeff_ptr + n_coeffs; @@ -98,31 +118,47 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { // Testing uses luminance quantization table const int16_t *zbin = qtab_->quant.y_zbin[q]; - const int16_t *round_fp = qtab_->quant.y_round_fp[q]; - const int16_t *quant_fp = qtab_->quant.y_quant_fp[q]; + + const int16_t *round = 0; + const int16_t *quant = 0; + if (type_ == TYPE_B) { + round = qtab_->quant.y_round[q]; + quant = qtab_->quant.y_quant[q]; + } else if (type_ == TYPE_FP) { + round = qtab_->quant.y_round_fp[q]; + quant = qtab_->quant.y_quant_fp[q]; + } + const int16_t *quant_shift = qtab_->quant.y_quant_shift[q]; const int16_t *dequant = qtab_->dequant.y_dequant[q]; - const size_t bufferSize = n_coeffs; - int i = 0; - while (i < testNum) { - if (isLoop) FillCoeffRandom(); + for (int i = 0; i < test_num; ++i) { + if (is_loop) FillCoeffRandom(); memset(qcoeff_ref, 0, 5 * n_coeffs * sizeof(*qcoeff_ref)); - quant_ref_(coeff_ptr, n_coeffs, skip_block, zbin, round_fp, quant_fp, + quant_ref_(coeff_ptr, n_coeffs, skip_block, zbin, round, quant, quant_shift, qcoeff_ref, dqcoeff_ref, dequant, &eob[0], sc->scan, sc->iscan); ASM_REGISTER_STATE_CHECK(quant_( - coeff_ptr, n_coeffs, skip_block, zbin, round_fp, quant_fp, - quant_shift, qcoeff, dqcoeff, dequant, &eob[1], sc->scan, sc->iscan)); + coeff_ptr, n_coeffs, skip_block, zbin, round, quant, quant_shift, + qcoeff, dqcoeff, dequant, &eob[1], sc->scan, sc->iscan)); - CompareResults(qcoeff_ref, qcoeff, bufferSize, "Qcoeff", q, i); - CompareResults(dqcoeff_ref, dqcoeff, bufferSize, "Dqcoeff", q, i); - ASSERT_EQ(eob[0], eob[1]) << "eobs mismatch on test: " << i; + for (int j = 0; j < n_coeffs; ++j) { + ASSERT_EQ(qcoeff_ref[j], qcoeff[j]) + << "Q mismatch on test: " << i << " at position: " << j + << " Q: " << q << " coeff: " << coeff_ptr[j]; + } - i++; + for (int j = 0; j < n_coeffs; ++j) { + ASSERT_EQ(dqcoeff_ref[j], dqcoeff[j]) + << "Dq mismatch on test: " << i << " at position: " << j + << " Q: " << q << " coeff: " << coeff_ptr[j]; + } + + ASSERT_EQ(eob[0], eob[1]) << "eobs mismatch on test: " << i + << " Q: " << q; } } @@ -135,29 +171,29 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { } } - int getCoeffNum() { return tx_size_2d[tx_size_]; } + int coeff_num() const { return tx_size_2d[tx_size_]; } - void FillCoeffGeneric(bool isConstant, tran_low_t c = 0) { - const int n_coeffs = getCoeffNum(); - int i; - if (isConstant) { - for (i = 0; i < n_coeffs; ++i) { - coeff_[i] = c; - } - } else { - FillCoeffZero(); - int num = rnd_.Rand16() % n_coeffs; - for (i = 0; i < num; ++i) { - coeff_[i] = GetRandomCoeff(); - } + void FillCoeff(tran_low_t c) { + const int n_coeffs = coeff_num(); + for (int i = 0; i < n_coeffs; ++i) { + coeff_[i] = c; } } - void FillCoeffZero() { FillCoeffGeneric(true); } + void FillCoeffRandom() { + const int n_coeffs = coeff_num(); + FillCoeffZero(); + int num = rnd_.Rand16() % n_coeffs; + for (int i = 0; i < num; ++i) { + coeff_[i] = GetRandomCoeff(); + } + } + + void FillCoeffZero() { FillCoeff(0); } void FillCoeffConstant() { tran_low_t c = GetRandomCoeff(); - FillCoeffGeneric(true, c); + FillCoeff(c); } void FillDcOnly() { @@ -173,10 +209,17 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { coeff_[0] = -8191; } - void FillCoeffRandom() { FillCoeffGeneric(false); } - tran_low_t GetRandomCoeff() { - return clamp((int16_t)rnd_.Rand16(), INT16_MIN + 1, INT16_MAX); + tran_low_t coeff; + if (bd_ == AOM_BITS_8) { + coeff = + clamp(static_cast<int16_t>(rnd_.Rand16()), INT16_MIN + 1, INT16_MAX); + } else { + tran_low_t min = -(1 << (7 + bd_)); + tran_low_t max = -min - 1; + coeff = clamp(static_cast<tran_low_t>(rnd_.Rand31()), min, max); + } + return coeff; } ACMRandom rnd_; @@ -185,6 +228,7 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { QuantizeFunc quant_ref_; QuantizeFunc quant_; TX_SIZE tx_size_; + QuantType type_; aom_bit_depth_t bd_; }; @@ -195,12 +239,12 @@ TEST_P(QuantizeTest, ZeroInput) { TEST_P(QuantizeTest, LargeNegativeInput) { FillDcLargeNegative(); - QuantizeRun(false); + QuantizeRun(false, 0, 1); } TEST_P(QuantizeTest, DcOnlyInput) { FillDcOnly(); - QuantizeRun(false); + QuantizeRun(false, 0, 1); } TEST_P(QuantizeTest, RandomInput) { QuantizeRun(true, 0, kTestNum); } @@ -211,26 +255,134 @@ TEST_P(QuantizeTest, MultipleQ) { } } +TEST_P(QuantizeTest, DISABLED_Speed) { + tran_low_t *coeff_ptr = coeff_; + const intptr_t n_coeffs = coeff_num(); + const int skip_block = 0; + + tran_low_t *qcoeff_ref = coeff_ptr + n_coeffs; + tran_low_t *dqcoeff_ref = qcoeff_ref + n_coeffs; + + tran_low_t *qcoeff = dqcoeff_ref + n_coeffs; + tran_low_t *dqcoeff = qcoeff + n_coeffs; + uint16_t *eob = (uint16_t *)(dqcoeff + n_coeffs); + + // Testing uses 2-D DCT scan order table + const SCAN_ORDER *const sc = get_default_scan(tx_size_, DCT_DCT, 0); + + // Testing uses luminance quantization table + const int q = 22; + const int16_t *zbin = qtab_->quant.y_zbin[q]; + const int16_t *round_fp = qtab_->quant.y_round_fp[q]; + const int16_t *quant_fp = qtab_->quant.y_quant_fp[q]; + const int16_t *quant_shift = qtab_->quant.y_quant_shift[q]; + const int16_t *dequant = qtab_->dequant.y_dequant[q]; + const int kNumTests = 5000000; + aom_usec_timer timer; + + FillCoeffRandom(); + + aom_usec_timer_start(&timer); + for (int n = 0; n < kNumTests; ++n) { + quant_(coeff_ptr, n_coeffs, skip_block, zbin, round_fp, quant_fp, + quant_shift, qcoeff, dqcoeff, dequant, eob, sc->scan, sc->iscan); + } + aom_usec_timer_mark(&timer); + + const int elapsed_time = static_cast<int>(aom_usec_timer_elapsed(&timer)); + printf("Elapsed time: %d us\n", elapsed_time); +} + using std::tr1::make_tuple; +#if HAVE_AVX2 +const QuantizeParam kQParamArrayAvx2[] = { + make_tuple(&av1_quantize_fp_c, &av1_quantize_fp_avx2, TX_16X16, TYPE_FP, + AOM_BITS_8), + make_tuple(&av1_quantize_fp_32x32_c, &av1_quantize_fp_32x32_avx2, TX_32X32, + TYPE_FP, AOM_BITS_8), +#if CONFIG_HIGHBITDEPTH + make_tuple(&highbd_quan16x16_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan16x16_wrapper<av1_highbd_quantize_fp_avx2>, TX_16X16, + TYPE_FP, AOM_BITS_8), + make_tuple(&highbd_quan16x16_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan16x16_wrapper<av1_highbd_quantize_fp_avx2>, TX_16X16, + TYPE_FP, AOM_BITS_10), + make_tuple(&highbd_quan16x16_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan16x16_wrapper<av1_highbd_quantize_fp_avx2>, TX_16X16, + TYPE_FP, AOM_BITS_12), + make_tuple(&highbd_quan32x32_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan32x32_wrapper<av1_highbd_quantize_fp_avx2>, TX_32X32, + TYPE_FP, AOM_BITS_8), + make_tuple(&highbd_quan32x32_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan32x32_wrapper<av1_highbd_quantize_fp_avx2>, TX_32X32, + TYPE_FP, AOM_BITS_10), + make_tuple(&highbd_quan32x32_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan32x32_wrapper<av1_highbd_quantize_fp_avx2>, TX_32X32, + TYPE_FP, AOM_BITS_12), +#if CONFIG_TX64X64 + make_tuple(&highbd_quan64x64_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan64x64_wrapper<av1_highbd_quantize_fp_avx2>, TX_64X64, + TYPE_FP, AOM_BITS_8), + make_tuple(&highbd_quan64x64_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan64x64_wrapper<av1_highbd_quantize_fp_avx2>, TX_64X64, + TYPE_FP, AOM_BITS_10), + make_tuple(&highbd_quan64x64_wrapper<av1_highbd_quantize_fp_c>, + &highbd_quan64x64_wrapper<av1_highbd_quantize_fp_avx2>, TX_64X64, + TYPE_FP, AOM_BITS_12), +#endif // CONFIG_TX64X64 + make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_avx2, TX_16X16, + TYPE_B, AOM_BITS_8), + make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_avx2, TX_16X16, + TYPE_B, AOM_BITS_10), + make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_avx2, TX_16X16, + TYPE_B, AOM_BITS_12), +#endif // CONFIG_HIGHBITDEPTH +}; + +INSTANTIATE_TEST_CASE_P(AVX2, QuantizeTest, + ::testing::ValuesIn(kQParamArrayAvx2)); +#endif // HAVE_AVX2 + #if HAVE_SSE2 -const QuantizeParam kQParamArraySSE2[] = { make_tuple( - &av1_quantize_fp_c, &av1_quantize_fp_sse2, TX_16X16, AOM_BITS_8) }; +const QuantizeParam kQParamArraySSE2[] = { + make_tuple(&av1_quantize_fp_c, &av1_quantize_fp_sse2, TX_16X16, TYPE_FP, + AOM_BITS_8), +#if CONFIG_HIGHBITDEPTH + make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_sse2, TX_16X16, + TYPE_B, AOM_BITS_8), + make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_sse2, TX_16X16, + TYPE_B, AOM_BITS_10), + make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_sse2, TX_16X16, + TYPE_B, AOM_BITS_12), + make_tuple(&aom_highbd_quantize_b_32x32_c, &aom_highbd_quantize_b_32x32_sse2, + TX_32X32, TYPE_B, AOM_BITS_8), + make_tuple(&aom_highbd_quantize_b_32x32_c, &aom_highbd_quantize_b_32x32_sse2, + TX_32X32, TYPE_B, AOM_BITS_10), + make_tuple(&aom_highbd_quantize_b_32x32_c, &aom_highbd_quantize_b_32x32_sse2, + TX_32X32, TYPE_B, AOM_BITS_12), +#endif +}; INSTANTIATE_TEST_CASE_P(SSE2, QuantizeTest, ::testing::ValuesIn(kQParamArraySSE2)); #endif #if !CONFIG_HIGHBITDEPTH && HAVE_SSSE3 && ARCH_X86_64 -const QuantizeParam kQParamArraySSSE3[] = { - make_tuple(&av1_quantize_fp_c, &av1_quantize_fp_ssse3, TX_16X16, AOM_BITS_8), - // TODO(any): - // The following test couldn't pass yet - // make_tuple(av1_quantize_fp_c, av1_quantize_fp_32x32_ssse3, TX_32X32, - // AOM_BITS_8) +const QuantizeParam kQ16x16ParamArraySSSE3[] = { + make_tuple(&av1_quantize_fp_c, &av1_quantize_fp_ssse3, TX_16X16, TYPE_FP, + AOM_BITS_8), }; INSTANTIATE_TEST_CASE_P(SSSE3, QuantizeTest, - ::testing::ValuesIn(kQParamArraySSSE3)); + ::testing::ValuesIn(kQ16x16ParamArraySSSE3)); + +// TODO(any): +// The following test does not pass yet +const QuantizeParam kQ32x32ParamArraySSSE3[] = { make_tuple( + &av1_quantize_fp_32x32_c, &av1_quantize_fp_32x32_ssse3, TX_32X32, TYPE_FP, + AOM_BITS_8) }; +INSTANTIATE_TEST_CASE_P(DISABLED_SSSE3, QuantizeTest, + ::testing::ValuesIn(kQ32x32ParamArraySSSE3)); #endif } // namespace diff --git a/third_party/aom/test/quantize_test.cc b/third_party/aom/test/quantize_test.cc deleted file mode 100644 index 4f61484a2..000000000 --- a/third_party/aom/test/quantize_test.cc +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2016, Alliance for Open Media. All rights reserved - * - * This source code is subject to the terms of the BSD 2 Clause License and - * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License - * was not distributed with this source code in the LICENSE file, you can - * obtain it at www.aomedia.org/license/software. If the Alliance for Open - * Media Patent License 1.0 was not distributed with this source code in the - * PATENTS file, you can obtain it at www.aomedia.org/license/patent. -*/ - -#include <string.h> - -#include "third_party/googletest/src/googletest/include/gtest/gtest.h" - -#include "./aom_config.h" -#include "test/acm_random.h" -#include "test/clear_system_state.h" -#include "test/register_state_check.h" -#include "test/util.h" -#include "vp8/common/blockd.h" -#include "vp8/common/onyx.h" -#include "vp8/encoder/block.h" -#include "vp8/encoder/onyx_int.h" -#include "vp8/encoder/quantize.h" -#include "aom/aom_integer.h" -#include "aom_mem/aom_mem.h" - -namespace { -#if !CONFIG_AOM_QM - -const int kNumBlocks = 25; -const int kNumBlockEntries = 16; - -typedef void (*VP8Quantize)(BLOCK *b, BLOCKD *d); - -typedef std::tr1::tuple<VP8Quantize, VP8Quantize> VP8QuantizeParam; - -using libaom_test::ACMRandom; -using std::tr1::make_tuple; - -// Create and populate a VP8_COMP instance which has a complete set of -// quantization inputs as well as a second MACROBLOCKD for output. -class QuantizeTestBase { - public: - virtual ~QuantizeTestBase() { - vp8_remove_compressor(&vp8_comp_); - vp8_comp_ = NULL; - aom_free(macroblockd_dst_); - macroblockd_dst_ = NULL; - libaom_test::ClearSystemState(); - } - - protected: - void SetupCompressor() { - rnd_.Reset(ACMRandom::DeterministicSeed()); - - // The full configuration is necessary to generate the quantization tables. - VP8_CONFIG vp8_config; - memset(&vp8_config, 0, sizeof(vp8_config)); - - vp8_comp_ = vp8_create_compressor(&vp8_config); - - // Set the tables based on a quantizer of 0. - vp8_set_quantizer(vp8_comp_, 0); - - // Set up all the block/blockd pointers for the mb in vp8_comp_. - vp8cx_frame_init_quantizer(vp8_comp_); - - // Copy macroblockd from the reference to get pre-set-up dequant values. - macroblockd_dst_ = reinterpret_cast<MACROBLOCKD *>( - aom_memalign(32, sizeof(*macroblockd_dst_))); - memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_)); - // Fix block pointers - currently they point to the blocks in the reference - // structure. - vp8_setup_block_dptrs(macroblockd_dst_); - } - - void UpdateQuantizer(int q) { - vp8_set_quantizer(vp8_comp_, q); - - memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_)); - vp8_setup_block_dptrs(macroblockd_dst_); - } - - void FillCoeffConstant(int16_t c) { - for (int i = 0; i < kNumBlocks * kNumBlockEntries; ++i) { - vp8_comp_->mb.coeff[i] = c; - } - } - - void FillCoeffRandom() { - for (int i = 0; i < kNumBlocks * kNumBlockEntries; ++i) { - vp8_comp_->mb.coeff[i] = rnd_.Rand8(); - } - } - - void CheckOutput() { - EXPECT_EQ(0, memcmp(vp8_comp_->mb.e_mbd.qcoeff, macroblockd_dst_->qcoeff, - sizeof(*macroblockd_dst_->qcoeff) * kNumBlocks * - kNumBlockEntries)) - << "qcoeff mismatch"; - EXPECT_EQ(0, memcmp(vp8_comp_->mb.e_mbd.dqcoeff, macroblockd_dst_->dqcoeff, - sizeof(*macroblockd_dst_->dqcoeff) * kNumBlocks * - kNumBlockEntries)) - << "dqcoeff mismatch"; - EXPECT_EQ(0, memcmp(vp8_comp_->mb.e_mbd.eobs, macroblockd_dst_->eobs, - sizeof(*macroblockd_dst_->eobs) * kNumBlocks)) - << "eobs mismatch"; - } - - VP8_COMP *vp8_comp_; - MACROBLOCKD *macroblockd_dst_; - - private: - ACMRandom rnd_; -}; - -class QuantizeTest : public QuantizeTestBase, - public ::testing::TestWithParam<VP8QuantizeParam> { - protected: - virtual void SetUp() { - SetupCompressor(); - asm_quant_ = GET_PARAM(0); - c_quant_ = GET_PARAM(1); - } - - void RunComparison() { - for (int i = 0; i < kNumBlocks; ++i) { - ASM_REGISTER_STATE_CHECK( - c_quant_(&vp8_comp_->mb.block[i], &vp8_comp_->mb.e_mbd.block[i])); - ASM_REGISTER_STATE_CHECK( - asm_quant_(&vp8_comp_->mb.block[i], ¯oblockd_dst_->block[i])); - } - - CheckOutput(); - } - - private: - VP8Quantize asm_quant_; - VP8Quantize c_quant_; -}; - -TEST_P(QuantizeTest, TestZeroInput) { - FillCoeffConstant(0); - RunComparison(); -} - -TEST_P(QuantizeTest, TestLargeNegativeInput) { - FillCoeffConstant(0); - // Generate a qcoeff which contains 512/-512 (0x0100/0xFE00) to catch issues - // like BUG=883 where the constant being compared was incorrectly initialized. - vp8_comp_->mb.coeff[0] = -8191; - RunComparison(); -} - -TEST_P(QuantizeTest, TestRandomInput) { - FillCoeffRandom(); - RunComparison(); -} - -TEST_P(QuantizeTest, TestMultipleQ) { - for (int q = 0; q < QINDEX_RANGE; ++q) { - UpdateQuantizer(q); - FillCoeffRandom(); - RunComparison(); - } -} - -#if HAVE_SSE2 -INSTANTIATE_TEST_CASE_P( - SSE2, QuantizeTest, - ::testing::Values( - make_tuple(&vp8_fast_quantize_b_sse2, &vp8_fast_quantize_b_c), - make_tuple(&vp8_regular_quantize_b_sse2, &vp8_regular_quantize_b_c))); -#endif // HAVE_SSE2 - -#if HAVE_SSSE3 -INSTANTIATE_TEST_CASE_P(SSSE3, QuantizeTest, - ::testing::Values(make_tuple(&vp8_fast_quantize_b_ssse3, - &vp8_fast_quantize_b_c))); -#endif // HAVE_SSSE3 - -#if HAVE_SSE4_1 -INSTANTIATE_TEST_CASE_P( - SSE4_1, QuantizeTest, - ::testing::Values(make_tuple(&vp8_regular_quantize_b_sse4_1, - &vp8_regular_quantize_b_c))); -#endif // HAVE_SSE4_1 - -#if HAVE_NEON -INSTANTIATE_TEST_CASE_P(NEON, QuantizeTest, - ::testing::Values(make_tuple(&vp8_fast_quantize_b_neon, - &vp8_fast_quantize_b_c))); -#endif // HAVE_NEON - -#if HAVE_MSA -INSTANTIATE_TEST_CASE_P( - MSA, QuantizeTest, - ::testing::Values( - make_tuple(&vp8_fast_quantize_b_msa, &vp8_fast_quantize_b_c), - make_tuple(&vp8_regular_quantize_b_msa, &vp8_regular_quantize_b_c))); -#endif // HAVE_MSA -#endif // CONFIG_AOM_QM -} // namespace diff --git a/third_party/aom/test/realtime_test.cc b/third_party/aom/test/realtime_test.cc index ffe4a3146..11d2a3241 100644 --- a/third_party/aom/test/realtime_test.cc +++ b/third_party/aom/test/realtime_test.cc @@ -22,8 +22,8 @@ const int kVideoSourceHeight = 240; const int kFramesToEncode = 2; class RealtimeTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: RealtimeTest() : EncoderTest(GET_PARAM(0)), frame_packets_(0) {} virtual ~RealtimeTest() {} diff --git a/third_party/aom/test/resize_test.cc b/third_party/aom/test/resize_test.cc index 994b30117..802713d32 100644 --- a/third_party/aom/test/resize_test.cc +++ b/third_party/aom/test/resize_test.cc @@ -265,8 +265,8 @@ class ResizingVideoSource : public ::libaom_test::DummyVideoSource { }; class ResizeTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { + : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>, + public ::libaom_test::EncoderTest { protected: ResizeTest() : EncoderTest(GET_PARAM(0)) {} @@ -427,8 +427,8 @@ TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) { } class ResizeRealtimeTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { + : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, + public ::libaom_test::EncoderTest { protected: ResizeRealtimeTest() : EncoderTest(GET_PARAM(0)) {} virtual ~ResizeRealtimeTest() {} @@ -482,8 +482,6 @@ class ResizeRealtimeTest cfg_.rc_dropframe_thresh = 1; // Enable error_resilience mode. cfg_.g_error_resilient = 1; - // Enable dynamic resizing. - cfg_.rc_resize_allowed = 1; // Run at low bitrate. cfg_.rc_target_bitrate = 200; } @@ -499,8 +497,6 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) { ResizingVideoSource video; video.flag_codec_ = 1; DefaultConfig(); - // Disable internal resize for this test. - cfg_.rc_resize_allowed = 0; change_bitrate_ = false; mismatch_psnr_ = 0.0; mismatch_nframes_ = 0; diff --git a/third_party/aom/test/sad_test.cc b/third_party/aom/test/sad_test.cc index 7564a6760..9ac58e653 100644 --- a/third_party/aom/test/sad_test.cc +++ b/third_party/aom/test/sad_test.cc @@ -231,8 +231,8 @@ class SADTestBase : public ::testing::Test { ACMRandom rnd_; }; -class SADx4Test : public SADTestBase, - public ::testing::WithParamInterface<SadMxNx4Param> { +class SADx4Test : public ::testing::WithParamInterface<SadMxNx4Param>, + public SADTestBase { public: SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} @@ -257,8 +257,8 @@ class SADx4Test : public SADTestBase, } }; -class SADTest : public SADTestBase, - public ::testing::WithParamInterface<SadMxNParam> { +class SADTest : public ::testing::WithParamInterface<SadMxNParam>, + public SADTestBase { public: SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} @@ -288,8 +288,8 @@ class SADTest : public SADTestBase, } }; -class SADavgTest : public SADTestBase, - public ::testing::WithParamInterface<SadMxNAvgParam> { +class SADavgTest : public ::testing::WithParamInterface<SadMxNAvgParam>, + public SADTestBase { public: SADavgTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1), GET_PARAM(3)) {} diff --git a/third_party/aom/test/selfguided_filter_test.cc b/third_party/aom/test/selfguided_filter_test.cc index e87fe339a..736e3f4c0 100644 --- a/third_party/aom/test/selfguided_filter_test.cc +++ b/third_party/aom/test/selfguided_filter_test.cc @@ -47,7 +47,6 @@ class AV1SelfguidedFilterTest uint8_t *input = (uint8_t *)aom_memalign(16, w * h * sizeof(uint8_t)); uint8_t *output = (uint8_t *)aom_memalign(16, w * h * sizeof(uint8_t)); int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE); - memset(tmpbuf, 0, RESTORATION_TMPBUF_SIZE); ACMRandom rnd(ACMRandom::DeterministicSeed()); @@ -96,7 +95,6 @@ class AV1SelfguidedFilterTest uint8_t *output2 = (uint8_t *)aom_memalign(16, out_stride * max_h * sizeof(uint8_t)); int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE); - memset(tmpbuf, 0, RESTORATION_TMPBUF_SIZE); ACMRandom rnd(ACMRandom::DeterministicSeed()); @@ -167,7 +165,6 @@ class AV1HighbdSelfguidedFilterTest uint16_t *input = (uint16_t *)aom_memalign(16, w * h * sizeof(uint16_t)); uint16_t *output = (uint16_t *)aom_memalign(16, w * h * sizeof(uint16_t)); int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE); - memset(tmpbuf, 0, RESTORATION_TMPBUF_SIZE); ACMRandom rnd(ACMRandom::DeterministicSeed()); @@ -219,7 +216,6 @@ class AV1HighbdSelfguidedFilterTest uint16_t *output2 = (uint16_t *)aom_memalign(16, out_stride * max_h * sizeof(uint16_t)); int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE); - memset(tmpbuf, 0, RESTORATION_TMPBUF_SIZE); ACMRandom rnd(ACMRandom::DeterministicSeed()); diff --git a/third_party/aom/test/simd_cmp_impl.h b/third_party/aom/test/simd_cmp_impl.h index 4a9c1f7be..46f46d751 100644 --- a/third_party/aom/test/simd_cmp_impl.h +++ b/third_party/aom/test/simd_cmp_impl.h @@ -1590,10 +1590,10 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth, typeid(CArg2) == typeid(c_v256)) { // S64_V256V256 error = CompareSimd2Args<int64_t, v256, v256, CRet, CArg1, CArg2>( - reinterpret_cast<fptr>(u64_store_aligned), + reinterpret_cast<fptr>(s64_store_aligned), reinterpret_cast<fptr>(v256_load_aligned), reinterpret_cast<fptr>(v256_load_aligned), simd, d, - reinterpret_cast<fptr>(c_u64_store_aligned), + reinterpret_cast<fptr>(c_s64_store_aligned), reinterpret_cast<fptr>(c_v256_load_aligned), reinterpret_cast<fptr>(c_v256_load_aligned), reinterpret_cast<fptr>(ref_simd), ref_d, s1, s2); diff --git a/third_party/aom/test/subtract_test.cc b/third_party/aom/test/subtract_test.cc index c90ca8d56..ad39f56b3 100644 --- a/third_party/aom/test/subtract_test.cc +++ b/third_party/aom/test/subtract_test.cc @@ -213,40 +213,44 @@ TEST_P(AV1HBDSubtractBlockTest, CheckSpeed) { RunForSpeed(); } #endif // USE_SPEED_TEST #if HAVE_SSE2 -INSTANTIATE_TEST_CASE_P( - SSE2, AV1HBDSubtractBlockTest, - ::testing::Values(make_tuple(4, 4, 12, &aom_highbd_subtract_block_sse2), - make_tuple(4, 4, 12, &aom_highbd_subtract_block_c), - make_tuple(4, 8, 12, &aom_highbd_subtract_block_sse2), - make_tuple(4, 8, 12, &aom_highbd_subtract_block_c), - make_tuple(8, 4, 12, &aom_highbd_subtract_block_sse2), - make_tuple(8, 4, 12, &aom_highbd_subtract_block_c), - make_tuple(8, 8, 12, &aom_highbd_subtract_block_sse2), - make_tuple(8, 8, 12, &aom_highbd_subtract_block_c), - make_tuple(8, 16, 12, &aom_highbd_subtract_block_sse2), - make_tuple(8, 16, 12, &aom_highbd_subtract_block_c), - make_tuple(16, 8, 12, &aom_highbd_subtract_block_sse2), - make_tuple(16, 8, 12, &aom_highbd_subtract_block_c), - make_tuple(16, 16, 12, &aom_highbd_subtract_block_sse2), - make_tuple(16, 16, 12, &aom_highbd_subtract_block_c), - make_tuple(16, 32, 12, &aom_highbd_subtract_block_sse2), - make_tuple(16, 32, 12, &aom_highbd_subtract_block_c), - make_tuple(32, 16, 12, &aom_highbd_subtract_block_sse2), - make_tuple(32, 16, 12, &aom_highbd_subtract_block_c), - make_tuple(32, 32, 12, &aom_highbd_subtract_block_sse2), - make_tuple(32, 32, 12, &aom_highbd_subtract_block_c), - make_tuple(32, 64, 12, &aom_highbd_subtract_block_sse2), - make_tuple(32, 64, 12, &aom_highbd_subtract_block_c), - make_tuple(64, 32, 12, &aom_highbd_subtract_block_sse2), - make_tuple(64, 32, 12, &aom_highbd_subtract_block_c), - make_tuple(64, 64, 12, &aom_highbd_subtract_block_sse2), - make_tuple(64, 64, 12, &aom_highbd_subtract_block_c), - make_tuple(64, 128, 12, &aom_highbd_subtract_block_sse2), - make_tuple(64, 128, 12, &aom_highbd_subtract_block_c), - make_tuple(128, 64, 12, &aom_highbd_subtract_block_sse2), - make_tuple(128, 64, 12, &aom_highbd_subtract_block_c), - make_tuple(128, 128, 12, &aom_highbd_subtract_block_sse2), - make_tuple(128, 128, 12, &aom_highbd_subtract_block_c))); + +const Params kAV1HBDSubtractBlock_sse2[] = { + make_tuple(4, 4, 12, &aom_highbd_subtract_block_sse2), + make_tuple(4, 4, 12, &aom_highbd_subtract_block_c), + make_tuple(4, 8, 12, &aom_highbd_subtract_block_sse2), + make_tuple(4, 8, 12, &aom_highbd_subtract_block_c), + make_tuple(8, 4, 12, &aom_highbd_subtract_block_sse2), + make_tuple(8, 4, 12, &aom_highbd_subtract_block_c), + make_tuple(8, 8, 12, &aom_highbd_subtract_block_sse2), + make_tuple(8, 8, 12, &aom_highbd_subtract_block_c), + make_tuple(8, 16, 12, &aom_highbd_subtract_block_sse2), + make_tuple(8, 16, 12, &aom_highbd_subtract_block_c), + make_tuple(16, 8, 12, &aom_highbd_subtract_block_sse2), + make_tuple(16, 8, 12, &aom_highbd_subtract_block_c), + make_tuple(16, 16, 12, &aom_highbd_subtract_block_sse2), + make_tuple(16, 16, 12, &aom_highbd_subtract_block_c), + make_tuple(16, 32, 12, &aom_highbd_subtract_block_sse2), + make_tuple(16, 32, 12, &aom_highbd_subtract_block_c), + make_tuple(32, 16, 12, &aom_highbd_subtract_block_sse2), + make_tuple(32, 16, 12, &aom_highbd_subtract_block_c), + make_tuple(32, 32, 12, &aom_highbd_subtract_block_sse2), + make_tuple(32, 32, 12, &aom_highbd_subtract_block_c), + make_tuple(32, 64, 12, &aom_highbd_subtract_block_sse2), + make_tuple(32, 64, 12, &aom_highbd_subtract_block_c), + make_tuple(64, 32, 12, &aom_highbd_subtract_block_sse2), + make_tuple(64, 32, 12, &aom_highbd_subtract_block_c), + make_tuple(64, 64, 12, &aom_highbd_subtract_block_sse2), + make_tuple(64, 64, 12, &aom_highbd_subtract_block_c), + make_tuple(64, 128, 12, &aom_highbd_subtract_block_sse2), + make_tuple(64, 128, 12, &aom_highbd_subtract_block_c), + make_tuple(128, 64, 12, &aom_highbd_subtract_block_sse2), + make_tuple(128, 64, 12, &aom_highbd_subtract_block_c), + make_tuple(128, 128, 12, &aom_highbd_subtract_block_sse2), + make_tuple(128, 128, 12, &aom_highbd_subtract_block_c) +}; + +INSTANTIATE_TEST_CASE_P(SSE2, AV1HBDSubtractBlockTest, + ::testing::ValuesIn(kAV1HBDSubtractBlock_sse2)); #endif // HAVE_SSE2 #endif // CONFIG_HIGHBITDEPTH } // namespace diff --git a/third_party/aom/test/superframe_test.cc b/third_party/aom/test/superframe_test.cc index a28d35d5f..c8f663e5c 100644 --- a/third_party/aom/test/superframe_test.cc +++ b/third_party/aom/test/superframe_test.cc @@ -10,6 +10,7 @@ */ #include <climits> +#include <vector> #include "third_party/googletest/src/googletest/include/gtest/gtest.h" #include "test/codec_factory.h" #include "test/encode_test_driver.h" @@ -25,11 +26,10 @@ const int kTileRows = 2; typedef std::tr1::tuple<libaom_test::TestMode, int, int> SuperframeTestParam; class SuperframeTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWithParam<SuperframeTestParam> { + : public ::libaom_test::CodecTestWithParam<SuperframeTestParam>, + public ::libaom_test::EncoderTest { protected: - SuperframeTest() - : EncoderTest(GET_PARAM(0)), modified_buf_(NULL), last_sf_pts_(0) {} + SuperframeTest() : EncoderTest(GET_PARAM(0)), last_sf_pts_(0) {} virtual ~SuperframeTest() {} virtual void SetUp() { @@ -43,8 +43,6 @@ class SuperframeTest n_tile_rows_ = std::tr1::get<kTileRows>(input); } - virtual void TearDown() { delete[] modified_buf_; } - virtual void PreEncodeFrameHook(libaom_test::VideoSource *video, libaom_test::Encoder *encoder) { if (video->frame() == 1) { @@ -63,18 +61,18 @@ class SuperframeTest if (pkt->kind != AOM_CODEC_CX_FRAME_PKT) return pkt; const uint8_t *buffer = reinterpret_cast<uint8_t *>(pkt->data.frame.buf); - const uint8_t marker = buffer[pkt->data.frame.sz - 1]; + const uint8_t marker = buffer[0]; const int frames = (marker & 0x7) + 1; const int mag = ((marker >> 3) & 3) + 1; const unsigned int index_sz = 2 + mag * (frames - 1); if ((marker & 0xe0) == 0xc0 && pkt->data.frame.sz >= index_sz && - buffer[pkt->data.frame.sz - index_sz] == marker) { + buffer[index_sz - 1] == marker) { // frame is a superframe. strip off the index. - if (modified_buf_) delete[] modified_buf_; - modified_buf_ = new uint8_t[pkt->data.frame.sz - index_sz]; - memcpy(modified_buf_, pkt->data.frame.buf, pkt->data.frame.sz - index_sz); + modified_buf_.resize(pkt->data.frame.sz - index_sz); + memcpy(&modified_buf_[0], (uint8_t *)pkt->data.frame.buf + index_sz, + pkt->data.frame.sz - index_sz); modified_pkt_ = *pkt; - modified_pkt_.data.frame.buf = modified_buf_; + modified_pkt_.data.frame.buf = &modified_buf_[0]; modified_pkt_.data.frame.sz -= index_sz; sf_count_++; @@ -91,7 +89,7 @@ class SuperframeTest int sf_count_; int sf_count_max_; aom_codec_cx_pkt_t modified_pkt_; - uint8_t *modified_buf_; + std::vector<uint8_t> modified_buf_; aom_codec_pts_t last_sf_pts_; private: @@ -102,7 +100,9 @@ class SuperframeTest TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) { sf_count_max_ = 0; // early exit on successful test. cfg_.g_lag_in_frames = 25; - +#if CONFIG_EXT_TILE + cfg_.large_scale_tile = 1; +#endif // CONFIG_EXT_TILE ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, 30, 1, 0, 40); ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); diff --git a/third_party/aom/test/test.cmake b/third_party/aom/test/test.cmake index d72a784ad..a02f9203f 100644 --- a/third_party/aom/test/test.cmake +++ b/third_party/aom/test/test.cmake @@ -11,6 +11,7 @@ if (NOT AOM_TEST_TEST_CMAKE_) set(AOM_TEST_TEST_CMAKE_ 1) +include(FindPythonInterp) include(ProcessorCount) include("${AOM_ROOT}/test/test_data_util.cmake") @@ -25,7 +26,6 @@ set(AOM_UNIT_TEST_COMMON_SOURCES "${AOM_ROOT}/test/acm_random.h" "${AOM_ROOT}/test/clear_system_state.h" "${AOM_ROOT}/test/codec_factory.h" - "${AOM_ROOT}/test/convolve_test.cc" "${AOM_ROOT}/test/decode_test_driver.cc" "${AOM_ROOT}/test/decode_test_driver.h" "${AOM_ROOT}/test/function_equivalence_test.h" @@ -35,25 +35,58 @@ set(AOM_UNIT_TEST_COMMON_SOURCES "${AOM_ROOT}/test/util.h" "${AOM_ROOT}/test/video_source.h") -if (CONFIG_ACCOUNTING) +if (NOT BUILD_SHARED_LIBS) set(AOM_UNIT_TEST_COMMON_SOURCES ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/accounting_test.cc") -endif () + "${AOM_ROOT}/test/convolve_test.cc" + "${AOM_ROOT}/test/simd_impl.h") -if (CONFIG_ADAPT_SCAN) - set(AOM_UNIT_TEST_COMMON_SOURCES - ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/scan_test.cc") -endif () - -if (CONFIG_GLOBAL_MOTION OR CONFIG_WARPED_MOTION) + if (HAVE_NEON) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/simd_neon_test.cc") + endif () if (HAVE_SSE2) set(AOM_UNIT_TEST_COMMON_SOURCES ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/warp_filter_test.cc" - "${AOM_ROOT}/test/warp_filter_test_util.cc" - "${AOM_ROOT}/test/warp_filter_test_util.h") + "${AOM_ROOT}/test/simd_sse2_test.cc") + endif () + if (HAVE_SSSE3) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/simd_ssse3_test.cc") + endif () + if (HAVE_SSE4) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/simd_sse4_test.cc") + endif () + if (HAVE_AVX2) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/simd_avx2_test.cc") + endif () + + if (CONFIG_ACCOUNTING) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/accounting_test.cc") + endif () + + if (CONFIG_ADAPT_SCAN) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/scan_test.cc") + endif () + + if (CONFIG_GLOBAL_MOTION OR CONFIG_WARPED_MOTION) + if (HAVE_SSE2) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/warp_filter_test.cc" + "${AOM_ROOT}/test/warp_filter_test_util.cc" + "${AOM_ROOT}/test/warp_filter_test_util.h") + endif () endif () endif () @@ -65,18 +98,23 @@ set(AOM_UNIT_TEST_ENCODER_SOURCES "${AOM_ROOT}/test/altref_test.cc" "${AOM_ROOT}/test/aq_segment_test.cc" "${AOM_ROOT}/test/datarate_test.cc" - "${AOM_ROOT}/test/dct16x16_test.cc" - "${AOM_ROOT}/test/dct32x32_test.cc" "${AOM_ROOT}/test/encode_api_test.cc" "${AOM_ROOT}/test/encode_test_driver.cc" "${AOM_ROOT}/test/encode_test_driver.h" "${AOM_ROOT}/test/error_resilience_test.cc" "${AOM_ROOT}/test/i420_video_source.h" - "${AOM_ROOT}/test/sad_test.cc" "${AOM_ROOT}/test/y4m_test.cc" "${AOM_ROOT}/test/y4m_video_source.h" "${AOM_ROOT}/test/yuv_video_source.h") +if (NOT BUILD_SHARED_LIBS) + set(AOM_UNIT_TEST_ENCODER_SOURCES + ${AOM_UNIT_TEST_ENCODER_SOURCES} + "${AOM_ROOT}/test/dct16x16_test.cc" + "${AOM_ROOT}/test/dct32x32_test.cc" + "${AOM_ROOT}/test/sad_test.cc") +endif () + set(AOM_DECODE_PERF_TEST_SOURCES "${AOM_ROOT}/test/decode_perf_test.cc") set(AOM_ENCODE_PERF_TEST_SOURCES "${AOM_ROOT}/test/encode_perf_test.cc") set(AOM_UNIT_TEST_WEBM_SOURCES "${AOM_ROOT}/test/webm_video_source.h") @@ -85,149 +123,186 @@ set(AOM_TEST_INTRA_PRED_SPEED_SOURCES "${AOM_CONFIG_DIR}/usage_exit.c" "${AOM_ROOT}/test/test_intra_pred_speed.cc") -if (CONFIG_AV1) - set(AOM_UNIT_TEST_COMMON_SOURCES - ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/av1_convolve_optimz_test.cc" - "${AOM_ROOT}/test/av1_convolve_test.cc" - "${AOM_ROOT}/test/av1_txfm_test.cc" - "${AOM_ROOT}/test/av1_txfm_test.h" - "${AOM_ROOT}/test/intrapred_test.cc" - "${AOM_ROOT}/test/lpf_8_test.cc" - "${AOM_ROOT}/test/simd_cmp_impl.h") - - if (CONFIG_CDEF) +if (NOT BUILD_SHARED_LIBS) + if (CONFIG_AV1_DECODER OR CONFIG_AV1_ENCODER) set(AOM_UNIT_TEST_COMMON_SOURCES ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/clpf_test.cc") - endif () + "${AOM_ROOT}/test/av1_convolve_optimz_test.cc" + "${AOM_ROOT}/test/av1_convolve_test.cc" + "${AOM_ROOT}/test/av1_txfm_test.cc" + "${AOM_ROOT}/test/av1_txfm_test.h" + "${AOM_ROOT}/test/intrapred_test.cc" + "${AOM_ROOT}/test/lpf_8_test.cc" + "${AOM_ROOT}/test/motion_vector_test.cc" + "${AOM_ROOT}/test/simd_cmp_impl.h") + + if (CONFIG_CDEF) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/clpf_test.cc" + "${AOM_ROOT}/test/dering_test.cc") + endif () + + if (CONFIG_FILTER_INTRA) + if (HAVE_SSE4_1) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/filterintra_predictors_test.cc") + endif () + endif () + + if (CONFIG_INTRABC) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/intrabc_test.cc") + endif () - if (CONFIG_FILTER_INTRA) - if (HAVE_SSE4_1) + if (CONFIG_LOOP_RESTORATION) set(AOM_UNIT_TEST_COMMON_SOURCES ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/filterintra_predictors_test.cc") + "${AOM_ROOT}/test/hiprec_convolve_test.cc" + "${AOM_ROOT}/test/hiprec_convolve_test_util.cc" + "${AOM_ROOT}/test/hiprec_convolve_test_util.h" + "${AOM_ROOT}/test/selfguided_filter_test.cc") endif () - endif () - set(AOM_UNIT_TEST_COMMON_INTRIN_NEON - ${AOM_UNIT_TEST_COMMON_INTRIN_NEON} - "${AOM_ROOT}/test/simd_cmp_neon.cc" - "${AOM_ROOT}/test/simd_neon_test.cc") - set(AOM_UNIT_TEST_COMMON_INTRIN_SSE2 - ${AOM_UNIT_TEST_COMMON_INTRIN_SSE2} - "${AOM_ROOT}/test/simd_cmp_sse2.cc") - set(AOM_UNIT_TEST_COMMON_INTRIN_SSSE3 - ${AOM_UNIT_TEST_COMMON_INTRIN_SSSE3} - "${AOM_ROOT}/test/simd_cmp_ssse3.cc") - set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1 - ${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1} - "${AOM_ROOT}/test/simd_cmp_sse4.cc") + set(AOM_UNIT_TEST_COMMON_INTRIN_NEON + ${AOM_UNIT_TEST_COMMON_INTRIN_NEON} + "${AOM_ROOT}/test/simd_cmp_neon.cc") + set(AOM_UNIT_TEST_COMMON_INTRIN_SSE2 + ${AOM_UNIT_TEST_COMMON_INTRIN_SSE2} + "${AOM_ROOT}/test/simd_cmp_sse2.cc") + set(AOM_UNIT_TEST_COMMON_INTRIN_SSSE3 + ${AOM_UNIT_TEST_COMMON_INTRIN_SSSE3} + "${AOM_ROOT}/test/simd_cmp_ssse3.cc") + set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1 + ${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1} + "${AOM_ROOT}/test/simd_cmp_sse4.cc") + set(AOM_UNIT_TEST_COMMON_INTRIN_AVX2 + ${AOM_UNIT_TEST_COMMON_INTRIN_AVX2} + "${AOM_ROOT}/test/simd_cmp_avx2.cc") + endif () endif () if (CONFIG_AV1_ENCODER) set(AOM_UNIT_TEST_ENCODER_SOURCES ${AOM_UNIT_TEST_ENCODER_SOURCES} "${AOM_ROOT}/test/active_map_test.cc" - "${AOM_ROOT}/test/arf_freq_test.cc" - "${AOM_ROOT}/test/av1_dct_test.cc" - "${AOM_ROOT}/test/av1_fht16x16_test.cc" - "${AOM_ROOT}/test/av1_fht32x32_test.cc" - "${AOM_ROOT}/test/av1_fht8x8_test.cc" - "${AOM_ROOT}/test/av1_inv_txfm_test.cc" - "${AOM_ROOT}/test/av1_fwd_txfm1d_test.cc" - "${AOM_ROOT}/test/av1_fwd_txfm2d_test.cc" - "${AOM_ROOT}/test/av1_inv_txfm1d_test.cc" - "${AOM_ROOT}/test/av1_inv_txfm2d_test.cc" - "${AOM_ROOT}/test/avg_test.cc" - "${AOM_ROOT}/test/blend_a64_mask_1d_test.cc" - "${AOM_ROOT}/test/blend_a64_mask_test.cc" "${AOM_ROOT}/test/borders_test.cc" "${AOM_ROOT}/test/cpu_speed_test.cc" "${AOM_ROOT}/test/end_to_end_test.cc" - "${AOM_ROOT}/test/error_block_test.cc" - "${AOM_ROOT}/test/fdct4x4_test.cc" - "${AOM_ROOT}/test/fdct8x8_test.cc" "${AOM_ROOT}/test/frame_size_tests.cc" - "${AOM_ROOT}/test/hadamard_test.cc" - "${AOM_ROOT}/test/lossless_test.cc" - "${AOM_ROOT}/test/minmax_test.cc" - "${AOM_ROOT}/test/subtract_test.cc" - "${AOM_ROOT}/test/sum_squares_test.cc" - "${AOM_ROOT}/test/variance_test.cc") - - if (CONFIG_EXT_INTER) - set(AOM_UNIT_TEST_ENCODER_SOURCES - ${AOM_UNIT_TEST_ENCODER_SOURCES} - "${AOM_ROOT}/test/av1_wedge_utils_test.cc" - "${AOM_ROOT}/test/masked_sad_test.cc" - "${AOM_ROOT}/test/masked_variance_test.cc") - endif () + "${AOM_ROOT}/test/lossless_test.cc") - if (CONFIG_EXT_TX) + if (NOT BUILD_SHARED_LIBS) set(AOM_UNIT_TEST_ENCODER_SOURCES ${AOM_UNIT_TEST_ENCODER_SOURCES} - "${AOM_ROOT}/test/av1_fht16x32_test.cc" - "${AOM_ROOT}/test/av1_fht16x8_test.cc" - "${AOM_ROOT}/test/av1_fht32x16_test.cc" - "${AOM_ROOT}/test/av1_fht4x4_test.cc" - "${AOM_ROOT}/test/av1_fht4x8_test.cc" - "${AOM_ROOT}/test/av1_fht8x16_test.cc" - "${AOM_ROOT}/test/av1_fht8x4_test.cc") - - endif () + "${AOM_ROOT}/test/arf_freq_test.cc" + "${AOM_ROOT}/test/av1_dct_test.cc" + "${AOM_ROOT}/test/av1_fht16x16_test.cc" + "${AOM_ROOT}/test/av1_fht32x32_test.cc" + "${AOM_ROOT}/test/av1_fht8x8_test.cc" + "${AOM_ROOT}/test/av1_inv_txfm_test.cc" + "${AOM_ROOT}/test/av1_fwd_txfm1d_test.cc" + "${AOM_ROOT}/test/av1_fwd_txfm2d_test.cc" + "${AOM_ROOT}/test/av1_inv_txfm1d_test.cc" + "${AOM_ROOT}/test/av1_inv_txfm2d_test.cc" + "${AOM_ROOT}/test/avg_test.cc" + "${AOM_ROOT}/test/blend_a64_mask_1d_test.cc" + "${AOM_ROOT}/test/blend_a64_mask_test.cc" + "${AOM_ROOT}/test/error_block_test.cc" + "${AOM_ROOT}/test/fdct4x4_test.cc" + "${AOM_ROOT}/test/fdct8x8_test.cc" + "${AOM_ROOT}/test/hadamard_test.cc" + "${AOM_ROOT}/test/minmax_test.cc" + "${AOM_ROOT}/test/quantize_func_test.cc" + "${AOM_ROOT}/test/subtract_test.cc" + "${AOM_ROOT}/test/sum_squares_test.cc" + "${AOM_ROOT}/test/variance_test.cc") + + if (CONFIG_CONVOLVE_ROUND) + set(AOM_UNIT_TEST_ENCODER_SOURCES + ${AOM_UNIT_TEST_ENCODER_SOURCES} + "${AOM_ROOT}/test/av1_convolve_2d_test.cc" + "${AOM_ROOT}/test/av1_convolve_2d_test_util.cc" + "${AOM_ROOT}/test/av1_convolve_2d_test_util.h" + "${AOM_ROOT}/test/convolve_round_test.cc") + endif () - if (CONFIG_GLOBAL_MOTION) - set(AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1 - ${AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1} - "${AOM_ROOT}/test/corner_match_test.cc") - endif () + if (CONFIG_EXT_INTER) + set(AOM_UNIT_TEST_ENCODER_SOURCES + ${AOM_UNIT_TEST_ENCODER_SOURCES} + "${AOM_ROOT}/test/av1_wedge_utils_test.cc" + "${AOM_ROOT}/test/masked_sad_test.cc" + "${AOM_ROOT}/test/masked_variance_test.cc") + endif () - if (CONFIG_MOTION_VAR) - set(AOM_UNIT_TEST_ENCODER_SOURCES - ${AOM_UNIT_TEST_ENCODER_SOURCES} - "${AOM_ROOT}/test/obmc_sad_test.cc" - "${AOM_ROOT}/test/obmc_variance_test.cc") - endif () + if (CONFIG_EXT_TX) + set(AOM_UNIT_TEST_ENCODER_SOURCES + ${AOM_UNIT_TEST_ENCODER_SOURCES} + "${AOM_ROOT}/test/av1_fht16x32_test.cc" + "${AOM_ROOT}/test/av1_fht16x8_test.cc" + "${AOM_ROOT}/test/av1_fht32x16_test.cc" + "${AOM_ROOT}/test/av1_fht4x4_test.cc" + "${AOM_ROOT}/test/av1_fht4x8_test.cc" + "${AOM_ROOT}/test/av1_fht8x16_test.cc" + "${AOM_ROOT}/test/av1_fht8x4_test.cc") + endif () - if (CONFIG_TX64X64) - set(AOM_UNIT_TEST_ENCODER_SOURCES - ${AOM_UNIT_TEST_ENCODER_SOURCES} - "${AOM_ROOT}/test/av1_fht64x64_test.cc") + if (CONFIG_GLOBAL_MOTION) + set(AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1 + ${AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1} + "${AOM_ROOT}/test/corner_match_test.cc") + endif () + + if (CONFIG_MOTION_VAR) + set(AOM_UNIT_TEST_ENCODER_SOURCES + ${AOM_UNIT_TEST_ENCODER_SOURCES} + "${AOM_ROOT}/test/obmc_sad_test.cc" + "${AOM_ROOT}/test/obmc_variance_test.cc") + endif () + + if (CONFIG_TX64X64) + set(AOM_UNIT_TEST_ENCODER_SOURCES + ${AOM_UNIT_TEST_ENCODER_SOURCES} + "${AOM_ROOT}/test/av1_fht64x64_test.cc") + endif () endif () endif () -if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER) - set(AOM_UNIT_TEST_COMMON_SOURCES - ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/divu_small_test.cc" - "${AOM_ROOT}/test/ethread_test.cc" - "${AOM_ROOT}/test/idct8x8_test.cc" - "${AOM_ROOT}/test/partial_idct_test.cc" - "${AOM_ROOT}/test/superframe_test.cc" - "${AOM_ROOT}/test/binary_codes_test.cc" - "${AOM_ROOT}/test/tile_independence_test.cc") - - if (CONFIG_ANS) +if (NOT BUILD_SHARED_LIBS) + if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER) set(AOM_UNIT_TEST_COMMON_SOURCES ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/ans_codec_test.cc" - "${AOM_ROOT}/test/ans_test.cc") - else () - set(AOM_UNIT_TEST_COMMON_SOURCES - ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/boolcoder_test.cc") - endif () + "${AOM_ROOT}/test/binary_codes_test.cc" + "${AOM_ROOT}/test/divu_small_test.cc" + "${AOM_ROOT}/test/ethread_test.cc" + "${AOM_ROOT}/test/idct8x8_test.cc" + "${AOM_ROOT}/test/partial_idct_test.cc" + "${AOM_ROOT}/test/superframe_test.cc" + "${AOM_ROOT}/test/tile_independence_test.cc") + + if (CONFIG_ANS) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/ans_codec_test.cc" + "${AOM_ROOT}/test/ans_test.cc") + else () + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/boolcoder_test.cc") + endif () - if (CONFIG_EXT_TILE) - set(AOM_UNIT_TEST_COMMON_SOURCES - ${AOM_UNIT_TEST_COMMON_SOURCES} - "${AOM_ROOT}/test/av1_ext_tile_test.cc") + if (CONFIG_EXT_TILE) + set(AOM_UNIT_TEST_COMMON_SOURCES + ${AOM_UNIT_TEST_COMMON_SOURCES} + "${AOM_ROOT}/test/av1_ext_tile_test.cc") + endif () endif () endif () if (CONFIG_HIGHBITDEPTH) - if (CONFIG_AV1_ENCODER) + if (CONFIG_AV1_ENCODER AND NOT BUILD_SHARED_LIBS) set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1 ${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1} "${AOM_ROOT}/test/av1_highbd_iht_test.cc" @@ -242,6 +317,12 @@ if (CONFIG_HIGHBITDEPTH) endif () if (CONFIG_UNIT_TESTS) + find_package(PythonInterp) + if (NOT PYTHONINTERP_FOUND) + message(WARNING "--- Unit tests disabled: Python not found.") + set(CONFIG_UNIT_TESTS 0) + endif () + if (MSVC) # Force static run time to avoid collisions with googletest. include("${AOM_ROOT}/build/cmake/msvc_runtime.cmake") @@ -249,6 +330,11 @@ if (CONFIG_UNIT_TESTS) include_directories( "${AOM_ROOT}/third_party/googletest/src/googletest/src" "${AOM_ROOT}/third_party/googletest/src/googletest/include") + + if (BUILD_SHARED_LIBS AND APPLE) + # Silence an RPATH warning. + set(CMAKE_MACOSX_RPATH 1) + endif () add_subdirectory("${AOM_ROOT}/third_party/googletest/src/googletest" EXCLUDE_FROM_ALL) @@ -263,55 +349,57 @@ endif () # exist before this function is called. function (setup_aom_test_targets) add_library(test_aom_common OBJECT ${AOM_UNIT_TEST_COMMON_SOURCES}) + add_dependencies(test_aom_common aom) if (CONFIG_AV1_DECODER) add_library(test_aom_decoder OBJECT ${AOM_UNIT_TEST_DECODER_SOURCES}) + add_dependencies(test_aom_decoder aom) endif () if (CONFIG_AV1_ENCODER) add_library(test_aom_encoder OBJECT ${AOM_UNIT_TEST_ENCODER_SOURCES}) + add_dependencies(test_aom_encoder aom) endif () - set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} test_aom_common test_aom_decoder - test_aom_encoder PARENT_SCOPE) - add_executable(test_libaom ${AOM_UNIT_TEST_WRAPPER_SOURCES} $<TARGET_OBJECTS:aom_common_app_util> $<TARGET_OBJECTS:test_aom_common>) if (CONFIG_AV1_DECODER) - target_sources(test_libaom PUBLIC + target_sources(test_libaom PRIVATE $<TARGET_OBJECTS:aom_decoder_app_util> $<TARGET_OBJECTS:test_aom_decoder>) if (CONFIG_DECODE_PERF_TESTS AND CONFIG_WEBM_IO) - target_sources(test_libaom PUBLIC ${AOM_DECODE_PERF_TEST_SOURCES}) + target_sources(test_libaom PRIVATE ${AOM_DECODE_PERF_TEST_SOURCES}) endif () endif () if (CONFIG_AV1_ENCODER) - target_sources(test_libaom PUBLIC + target_sources(test_libaom PRIVATE $<TARGET_OBJECTS:test_aom_encoder> $<TARGET_OBJECTS:aom_encoder_app_util>) if (CONFIG_ENCODE_PERF_TESTS) - target_sources(test_libaom PUBLIC ${AOM_ENCODE_PERF_TEST_SOURCES}) + target_sources(test_libaom PRIVATE ${AOM_ENCODE_PERF_TEST_SOURCES}) endif () - add_executable(test_intra_pred_speed - ${AOM_TEST_INTRA_PRED_SPEED_SOURCES} - $<TARGET_OBJECTS:aom_common_app_util>) - target_link_libraries(test_intra_pred_speed ${AOM_LIB_LINK_TYPE} aom gtest) + if (NOT BUILD_SHARED_LIBS) + add_executable(test_intra_pred_speed + ${AOM_TEST_INTRA_PRED_SPEED_SOURCES} + $<TARGET_OBJECTS:aom_common_app_util>) + target_link_libraries(test_intra_pred_speed ${AOM_LIB_LINK_TYPE} + aom gtest) + endif () endif () target_link_libraries(test_libaom ${AOM_LIB_LINK_TYPE} aom gtest) if (CONFIG_LIBYUV) - target_sources(test_libaom PUBLIC $<TARGET_OBJECTS:yuv>) + target_sources(test_libaom PRIVATE $<TARGET_OBJECTS:yuv>) endif () if (CONFIG_WEBM_IO) - target_sources(test_libaom PUBLIC ${AOM_UNIT_TEST_WEBM_SOURCES} - $<TARGET_OBJECTS:webm>) + target_sources(test_libaom PRIVATE $<TARGET_OBJECTS:webm>) endif () if (HAVE_SSE2) add_intrinsics_source_to_target("-msse2" "test_libaom" @@ -331,11 +419,26 @@ function (setup_aom_test_targets) endif () endif () endif () + if (HAVE_AVX2) + add_intrinsics_source_to_target("-mavx2" "test_libaom" + "AOM_UNIT_TEST_COMMON_INTRIN_AVX2") + endif () if (HAVE_NEON) add_intrinsics_source_to_target("${AOM_NEON_INTRIN_FLAG}" "test_libaom" "AOM_UNIT_TEST_COMMON_INTRIN_NEON") endif () + if (NOT ENABLE_IDE_TEST_HOSTING) + if (MSVC OR XCODE) + # Skip creation of test data download and test run targets when generating + # for Visual Studio and Xcode unless the user explicitly requests IDE test + # hosting. This is done to make build cycles in the IDE tolerable when the + # IDE command for build project is used to build AOM. Default behavior in + # IDEs is to build all targets, and the test run takes hours. + return () + endif () + endif () + make_test_data_lists("${AOM_UNIT_TEST_DATA_LIST_FILE}" test_files test_file_checksums) list(LENGTH test_files num_test_files) @@ -366,8 +469,6 @@ function (setup_aom_test_targets) set(num_test_targets 10) endif () - # TODO(tomfinegan): This needs some work for MSVC and Xcode. Executable suffix - # and config based executable output paths are the obvious issues. math(EXPR max_shard_index "${num_test_targets} - 1") foreach (shard_index RANGE ${max_shard_index}) set(test_name "test_${shard_index}") @@ -382,15 +483,6 @@ function (setup_aom_test_targets) endforeach () add_custom_target(runtests) add_dependencies(runtests ${test_targets}) - - if (MSVC) - set_target_properties(${testdata_targets} PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD TRUE) - set_target_properties(${test_targets} PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD TRUE) - set_target_properties(testdata runtests PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD TRUE) - endif () endfunction () endif () # AOM_TEST_TEST_CMAKE_ diff --git a/third_party/aom/test/test.mk b/third_party/aom/test/test.mk index 45bb21286..4132e4f74 100644 --- a/third_party/aom/test/test.mk +++ b/third_party/aom/test/test.mk @@ -33,6 +33,7 @@ LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += altref_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += aq_segment_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += datarate_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += encode_api_test.cc +LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += coding_path_sync.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += error_resilience_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += i420_video_source.h #LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += realtime_test.cc @@ -167,6 +168,7 @@ ifneq ($(CONFIG_NEW_QUANT), yes) LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += quantize_func_test.cc endif endif +LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += block_error_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_inv_txfm_test.cc LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_dct_test.cc @@ -243,6 +245,12 @@ LIBAOM_TEST_SRCS-$(HAVE_SSE2) += hiprec_convolve_test.cc LIBAOM_TEST_SRCS-$(HAVE_SSE2) += hiprec_convolve_test_util.cc LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += selfguided_filter_test.cc endif +ifeq ($(CONFIG_CONVOLVE_ROUND),yes) +LIBAOM_TEST_SRCS-$(HAVE_SSE2) += av1_convolve_2d_test_util.h +LIBAOM_TEST_SRCS-$(HAVE_SSE2) += av1_convolve_2d_test.cc +LIBAOM_TEST_SRCS-$(HAVE_SSE2) += av1_convolve_2d_test_util.cc +LIBAOM_TEST_SRCS-yes += convolve_round_test.cc +endif ifeq ($(CONFIG_GLOBAL_MOTION)$(CONFIG_AV1_ENCODER),yesyes) LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += corner_match_test.cc diff --git a/third_party/aom/test/test_data_download_worker.cmake b/third_party/aom/test/test_data_download_worker.cmake index d7bf99edd..b252dd960 100644 --- a/third_party/aom/test/test_data_download_worker.cmake +++ b/third_party/aom/test/test_data_download_worker.cmake @@ -19,7 +19,10 @@ endif () set(AOM_TEST_DATA_URL "https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx") -set(AOM_TEST_DATA_PATH "$ENV{LIBAOM_TEST_DATA_PATH}") + +if (NOT AOM_TEST_DATA_PATH) + set(AOM_TEST_DATA_PATH "$ENV{LIBAOM_TEST_DATA_PATH}") +endif () if ("${AOM_TEST_DATA_PATH}" STREQUAL "") message(WARNING "Writing test data to ${AOM_CONFIG_DIR}, set " diff --git a/third_party/aom/test/test_runner.cmake b/third_party/aom/test/test_runner.cmake index 48ebaf570..a1f399642 100644 --- a/third_party/aom/test/test_runner.cmake +++ b/third_party/aom/test/test_runner.cmake @@ -17,4 +17,6 @@ endif () set($ENV{GTEST_SHARD_INDEX} ${GTEST_SHARD_INDEX}) set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS}) -execute_process(COMMAND ${TEST_LIBAOM}) +execute_process(COMMAND ${TEST_LIBAOM} RESULT_VARIABLE test_result) +set(test_message "Test shard ${GTEST_SHARD_INDEX}/${GTEST_TOTAL_SHARDS} result") +message("${test_message}: ${test_result}") diff --git a/third_party/aom/test/tile_independence_test.cc b/third_party/aom/test/tile_independence_test.cc index a29051f2f..832227fb8 100644 --- a/third_party/aom/test/tile_independence_test.cc +++ b/third_party/aom/test/tile_independence_test.cc @@ -22,8 +22,8 @@ namespace { class TileIndependenceTest - : public ::libaom_test::EncoderTest, - public ::libaom_test::CodecTestWith2Params<int, int> { + : public ::libaom_test::CodecTestWith2Params<int, int>, + public ::libaom_test::EncoderTest { protected: TileIndependenceTest() : EncoderTest(GET_PARAM(0)), md5_fw_order_(), md5_inv_order_(), @@ -33,11 +33,12 @@ class TileIndependenceTest cfg.w = 704; cfg.h = 144; cfg.threads = 1; + cfg.allow_lowbitdepth = 1; fw_dec_ = codec_->CreateDecoder(cfg, 0); inv_dec_ = codec_->CreateDecoder(cfg, 0); inv_dec_->Control(AV1_INVERT_TILE_DECODE_ORDER, 1); -#if CONFIG_AV1 && CONFIG_EXT_TILE +#if CONFIG_AV1 if (fw_dec_->IsAV1() && inv_dec_->IsAV1()) { fw_dec_->Control(AV1_SET_DECODE_TILE_ROW, -1); fw_dec_->Control(AV1_SET_DECODE_TILE_COL, -1); @@ -62,9 +63,6 @@ class TileIndependenceTest if (video->frame() == 1) { encoder->Control(AV1E_SET_TILE_COLUMNS, n_tile_cols_); encoder->Control(AV1E_SET_TILE_ROWS, n_tile_rows_); -#if CONFIG_EXT_TILE - encoder->Control(AV1E_SET_TILE_ENCODING_MODE, 0); // TILE_NORMAL -#endif // CONFIG_EXT_TILE #if CONFIG_LOOPFILTERING_ACROSS_TILES encoder->Control(AV1E_SET_TILE_LOOPFILTER, 0); #endif // CONFIG_LOOPFILTERING_ACROSS_TILES @@ -121,7 +119,12 @@ class TileIndependenceTest // run an encode with 2 or 4 tiles, and do the decode both in normal and // inverted tile ordering. Ensure that the MD5 of the output in both cases // is identical. If so, tiles are considered independent and the test passes. -TEST_P(TileIndependenceTest, MD5Match) { DoTest(); } +TEST_P(TileIndependenceTest, MD5Match) { +#if CONFIG_EXT_TILE + cfg_.large_scale_tile = 0; +#endif // CONFIG_EXT_TILE + DoTest(); +} class TileIndependenceTestLarge : public TileIndependenceTest { virtual void SetCpuUsed(libaom_test::Encoder *encoder) { @@ -130,18 +133,37 @@ class TileIndependenceTestLarge : public TileIndependenceTest { } }; -TEST_P(TileIndependenceTestLarge, MD5Match) { DoTest(); } - +TEST_P(TileIndependenceTestLarge, MD5Match) { #if CONFIG_EXT_TILE -AV1_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Values(1, 2, 32), - ::testing::Values(1, 2, 32)); -AV1_INSTANTIATE_TEST_CASE(TileIndependenceTestLarge, - ::testing::Values(1, 2, 32), - ::testing::Values(1, 2, 32)); -#else + cfg_.large_scale_tile = 0; +#endif // CONFIG_EXT_TILE + DoTest(); +} + AV1_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Values(0, 1), ::testing::Values(0, 1)); AV1_INSTANTIATE_TEST_CASE(TileIndependenceTestLarge, ::testing::Values(0, 1), ::testing::Values(0, 1)); + +#if CONFIG_EXT_TILE +class TileIndependenceLSTest : public TileIndependenceTest {}; + +TEST_P(TileIndependenceLSTest, MD5Match) { + cfg_.large_scale_tile = 1; + DoTest(); +} + +class TileIndependenceLSTestLarge : public TileIndependenceTestLarge {}; + +TEST_P(TileIndependenceLSTestLarge, MD5Match) { + cfg_.large_scale_tile = 1; + DoTest(); +} + +AV1_INSTANTIATE_TEST_CASE(TileIndependenceLSTest, ::testing::Values(1, 2, 32), + ::testing::Values(1, 2, 32)); +AV1_INSTANTIATE_TEST_CASE(TileIndependenceLSTestLarge, + ::testing::Values(1, 2, 32), + ::testing::Values(1, 2, 32)); #endif // CONFIG_EXT_TILE } // namespace diff --git a/third_party/aom/test/tools_common.sh b/third_party/aom/test/tools_common.sh index 254e6b296..c1262b6c8 100755 --- a/third_party/aom/test/tools_common.sh +++ b/third_party/aom/test/tools_common.sh @@ -48,6 +48,21 @@ test_end() { # Echoes the target configuration being tested. test_configuration_target() { aom_config_mk="${LIBAOM_CONFIG_PATH}/config.mk" + # TODO(tomfinegan): Remove the parts requiring config.mk when the configure + # script is removed from the repository. + if [ ! -f "${aom_config_mk}" ]; then + aom_config_c="${LIBAOM_CONFIG_PATH}/aom_config.c" + # Clean up the cfg pointer line from aom_config.c for easier re-use by + # someone examining a failure in the example tests. + # 1. Run grep on aom_config.c for cfg and limit the results to 1. + # 2. Split the line using ' = ' as separator. + # 3. Abuse sed to consume the leading " and trailing "; from the assignment + # to the cfg pointer. + cmake_config=$(awk -F ' = ' '/cfg/ { print $NF; exit }' "${aom_config_c}" \ + | sed -e s/\"// -e s/\"\;//) + echo cmake generated via command: cmake path/to/aom ${cmake_config} + return + fi # Find the TOOLCHAIN line, split it using ':=' as the field separator, and # print the last field to get the value. Then pipe the value to tr to consume # any leading/trailing spaces while allowing tr to echo the output to stdout. @@ -71,6 +86,18 @@ cleanup() { # no git hash is contained in VERSION_STRING. config_hash() { aom_config_mk="${LIBAOM_CONFIG_PATH}/config.mk" + if [ ! -f "${aom_config_mk}" ]; then + aom_config_c="${LIBAOM_CONFIG_PATH}/aom_config.c" + # Clean up the aom_git_hash pointer line from aom_config.c. + # 1. Run grep on aom_config.c for aom_git_hash and limit results to 1. + # 2. Split the line using ' = "' as separator. + # 3. Abuse sed to consume the trailing "; from the assignment to the + # aom_git_hash pointer. + awk -F ' = "' '/aom_git_hash/ { print $NF; exit }' "${aom_config_c}" \ + | sed s/\"\;// + return + fi + # Find VERSION_STRING line, split it with "-g" and print the last field to # output the git hash to stdout. aom_version=$(awk -F -g '/VERSION_STRING/ {print $NF}' "${aom_config_mk}") @@ -87,7 +114,7 @@ config_hash() { current_hash() { if git --version > /dev/null 2>&1; then (cd "$(dirname "${0}")" - git rev-parse --short HEAD) + git rev-parse HEAD) else # Return the config hash if git is unavailable: Fail silently, git hashes # are used only for warnings. @@ -103,6 +130,7 @@ check_git_hashes() { if [ "${hash_at_configure_time}" != "${hash_now}" ]; then echo "Warning: git hash has changed since last configure." + vlog " config hash: ${hash_at_configure_time} hash now: ${hash_now}" fi } diff --git a/third_party/aom/test/transform_test_base.h b/third_party/aom/test/transform_test_base.h index 4c1a55496..21441beef 100644 --- a/third_party/aom/test/transform_test_base.h +++ b/third_party/aom/test/transform_test_base.h @@ -15,6 +15,7 @@ #include "./aom_config.h" #include "aom_mem/aom_mem.h" #include "aom/aom_codec.h" +#include "aom_dsp/txfm_common.h" namespace libaom_test { @@ -28,10 +29,10 @@ namespace libaom_test { const int kDctMaxValue = 16384; typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, - int tx_type); + TxfmParam *txfm_param); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const TxfmParam *txfm_param); class TransformTestBase { public: @@ -157,7 +158,7 @@ class TransformTestBase { } } - fwd_txfm_ref(input_block, output_ref_block, stride, tx_type_); + fwd_txfm_ref(input_block, output_ref_block, stride, &txfm_param_); ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, stride)); // The minimum quant value is 4. @@ -205,9 +206,9 @@ class TransformTestBase { } } - fwd_txfm_ref(input_block, trans_block, pitch_, tx_type_); + fwd_txfm_ref(input_block, trans_block, pitch_, &txfm_param_); - inv_txfm_ref(trans_block, output_ref_block, stride, tx_type_); + inv_txfm_ref(trans_block, output_ref_block, stride, &txfm_param_); ASM_REGISTER_STATE_CHECK(RunInvTxfm(trans_block, output_block, stride)); for (j = 0; j < height_; ++j) { @@ -247,7 +248,7 @@ class TransformTestBase { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_; } - fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); + fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_); ASM_REGISTER_STATE_CHECK( RunFwdTxfm(input_extreme_block, output_block, pitch_)); @@ -303,7 +304,7 @@ class TransformTestBase { } } - fwd_txfm_ref(in, coeff, pitch_, tx_type_); + fwd_txfm_ref(in, coeff, pitch_, &txfm_param_); if (bit_depth_ == AOM_BITS_8) { ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); @@ -338,12 +339,12 @@ class TransformTestBase { int pitch_; int height_; - int tx_type_; FhtFunc fwd_txfm_ref; IhtFunc inv_txfm_ref; aom_bit_depth_t bit_depth_; int mask_; int num_coeffs_; + TxfmParam txfm_param_; private: // Assume transform size is 4x4, 8x8, 16x16,... diff --git a/third_party/aom/test/user_priv_test.cc b/third_party/aom/test/user_priv_test.cc index 3052b27b1..da289c990 100644 --- a/third_party/aom/test/user_priv_test.cc +++ b/third_party/aom/test/user_priv_test.cc @@ -49,6 +49,7 @@ string DecodeFile(const string &filename) { video.Init(); aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t(); + cfg.allow_lowbitdepth = 1; libaom_test::AV1Decoder decoder(cfg, 0); libaom_test::MD5 md5; diff --git a/third_party/aom/test/util.h b/third_party/aom/test/util.h index a20fab65c..d1587b6ea 100644 --- a/third_party/aom/test/util.h +++ b/third_party/aom/test/util.h @@ -15,6 +15,7 @@ #include <stdio.h> #include <math.h> #include "third_party/googletest/src/googletest/include/gtest/gtest.h" +#include "aom/aom_integer.h" #include "aom/aom_image.h" // Macros diff --git a/third_party/aom/test/variance_test.cc b/third_party/aom/test/variance_test.cc index c712f96e2..2f5c22283 100644 --- a/third_party/aom/test/variance_test.cc +++ b/third_party/aom/test/variance_test.cc @@ -531,42 +531,26 @@ using ::std::tr1::get; using ::std::tr1::make_tuple; using ::std::tr1::tuple; -template <typename SubpelVarianceFunctionType> +template <typename FunctionType> class SubpelVarianceTest - : public ::testing::TestWithParam< - tuple<int, int, SubpelVarianceFunctionType, int> > { + : public ::testing::TestWithParam<TestParams<FunctionType> > { public: virtual void SetUp() { - const tuple<int, int, SubpelVarianceFunctionType, int> ¶ms = - this->GetParam(); - log2width_ = get<0>(params); - width_ = 1 << log2width_; - log2height_ = get<1>(params); - height_ = 1 << log2height_; - subpel_variance_ = get<2>(params); - if (get<3>(params)) { - bit_depth_ = (aom_bit_depth_t)get<3>(params); - use_high_bit_depth_ = true; - } else { - bit_depth_ = AOM_BITS_8; - use_high_bit_depth_ = false; - } - mask_ = (1 << bit_depth_) - 1; + params_ = this->GetParam(); rnd_.Reset(ACMRandom::DeterministicSeed()); - block_size_ = width_ * height_; - if (!use_high_bit_depth_) { - src_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size_)); - sec_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size_)); - ref_ = new uint8_t[block_size_ + width_ + height_ + 1]; + if (!use_high_bit_depth()) { + src_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size())); + sec_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size())); + ref_ = new uint8_t[block_size() + width() + height() + 1]; #if CONFIG_HIGHBITDEPTH } else { src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>( - aom_memalign(16, block_size_ * sizeof(uint16_t)))); + aom_memalign(16, block_size() * sizeof(uint16_t)))); sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>( - aom_memalign(16, block_size_ * sizeof(uint16_t)))); + aom_memalign(16, block_size() * sizeof(uint16_t)))); ref_ = CONVERT_TO_BYTEPTR(aom_memalign( - 16, (block_size_ + width_ + height_ + 1) * sizeof(uint16_t))); + 16, (block_size() + width() + height() + 1) * sizeof(uint16_t))); #endif // CONFIG_HIGHBITDEPTH } ASSERT_TRUE(src_ != NULL); @@ -575,7 +559,7 @@ class SubpelVarianceTest } virtual void TearDown() { - if (!use_high_bit_depth_) { + if (!use_high_bit_depth()) { aom_free(src_); delete[] ref_; aom_free(sec_); @@ -597,42 +581,45 @@ class SubpelVarianceTest uint8_t *src_; uint8_t *ref_; uint8_t *sec_; - bool use_high_bit_depth_; - aom_bit_depth_t bit_depth_; - int width_, log2width_; - int height_, log2height_; - int block_size_, mask_; - SubpelVarianceFunctionType subpel_variance_; + TestParams<FunctionType> params_; + + // some relay helpers + bool use_high_bit_depth() const { return params_.use_high_bit_depth; } + int byte_shift() const { return params_.bit_depth - 8; } + int block_size() const { return params_.block_size; } + int width() const { return params_.width; } + int height() const { return params_.height; } + uint32_t mask() const { return params_.mask; } }; template <typename SubpelVarianceFunctionType> void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { for (int x = 0; x < 8; ++x) { for (int y = 0; y < 8; ++y) { - if (!use_high_bit_depth_) { - for (int j = 0; j < block_size_; j++) { + if (!use_high_bit_depth()) { + for (int j = 0; j < block_size(); j++) { src_[j] = rnd_.Rand8(); } - for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { + for (int j = 0; j < block_size() + width() + height() + 1; j++) { ref_[j] = rnd_.Rand8(); } #if CONFIG_HIGHBITDEPTH } else { - for (int j = 0; j < block_size_; j++) { - CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; + for (int j = 0; j < block_size(); j++) { + CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask(); } - for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { - CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; + for (int j = 0; j < block_size() + width() + height() + 1; j++) { + CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask(); } #endif // CONFIG_HIGHBITDEPTH } unsigned int sse1, sse2; unsigned int var1; ASM_REGISTER_STATE_CHECK( - var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1)); - const unsigned int var2 = - subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2, - use_high_bit_depth_, bit_depth_); + var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1)); + const unsigned int var2 = subpel_variance_ref( + ref_, src_, params_.log2width, params_.log2height, x, y, &sse2, + use_high_bit_depth(), params_.bit_depth); EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; } @@ -646,28 +633,28 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() { // Ref: Set the first half of values to the maximum, the second half to 0. for (int x = 0; x < 8; ++x) { for (int y = 0; y < 8; ++y) { - const int half = block_size_ / 2; - if (!use_high_bit_depth_) { + const int half = block_size() / 2; + if (!use_high_bit_depth()) { memset(src_, 0, half); memset(src_ + half, 255, half); memset(ref_, 255, half); - memset(ref_ + half, 0, half + width_ + height_ + 1); + memset(ref_ + half, 0, half + width() + height() + 1); #if CONFIG_HIGHBITDEPTH } else { - aom_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half); + aom_memset16(CONVERT_TO_SHORTPTR(src_), mask(), half); aom_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half); aom_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half); - aom_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_, - half + width_ + height_ + 1); + aom_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask(), + half + width() + height() + 1); #endif // CONFIG_HIGHBITDEPTH } unsigned int sse1, sse2; unsigned int var1; ASM_REGISTER_STATE_CHECK( - var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1)); - const unsigned int var2 = - subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2, - use_high_bit_depth_, bit_depth_); + var1 = params_.func(ref_, width() + 1, x, y, src_, width(), &sse1)); + const unsigned int var2 = subpel_variance_ref( + ref_, src_, params_.log2width, params_.log2height, x, y, &sse2, + use_high_bit_depth(), params_.bit_depth); EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y; EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y; } @@ -678,33 +665,32 @@ template <> void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() { for (int x = 0; x < 8; ++x) { for (int y = 0; y < 8; ++y) { - if (!use_high_bit_depth_) { - for (int j = 0; j < block_size_; j++) { + if (!use_high_bit_depth()) { + for (int j = 0; j < block_size(); j++) { src_[j] = rnd_.Rand8(); sec_[j] = rnd_.Rand8(); } - for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { + for (int j = 0; j < block_size() + width() + height() + 1; j++) { ref_[j] = rnd_.Rand8(); } #if CONFIG_HIGHBITDEPTH } else { - for (int j = 0; j < block_size_; j++) { - CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_; - CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask_; + for (int j = 0; j < block_size(); j++) { + CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask(); + CONVERT_TO_SHORTPTR(sec_)[j] = rnd_.Rand16() & mask(); } - for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) { - CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_; + for (int j = 0; j < block_size() + width() + height() + 1; j++) { + CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask(); } #endif // CONFIG_HIGHBITDEPTH } uint32_t sse1, sse2; uint32_t var1, var2; - ASM_REGISTER_STATE_CHECK(var1 = - subpel_variance_(ref_, width_ + 1, x, y, - src_, width_, &sse1, sec_)); - var2 = subpel_avg_variance_ref(ref_, src_, sec_, log2width_, log2height_, - x, y, &sse2, use_high_bit_depth_, - static_cast<aom_bit_depth_t>(bit_depth_)); + ASM_REGISTER_STATE_CHECK(var1 = params_.func(ref_, width() + 1, x, y, + src_, width(), &sse1, sec_)); + var2 = subpel_avg_variance_ref(ref_, src_, sec_, params_.log2width, + params_.log2height, x, y, &sse2, + use_high_bit_depth(), params_.bit_depth); EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; } @@ -763,37 +749,41 @@ INSTANTIATE_TEST_CASE_P( VarianceParams(2, 3, &aom_variance4x8_c), VarianceParams(2, 2, &aom_variance4x4_c))); +typedef TestParams<SubpixVarMxNFunc> SubpelVarianceParams; INSTANTIATE_TEST_CASE_P( C, AvxSubpelVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_c, 0), - make_tuple(6, 5, &aom_sub_pixel_variance64x32_c, 0), - make_tuple(5, 6, &aom_sub_pixel_variance32x64_c, 0), - make_tuple(5, 5, &aom_sub_pixel_variance32x32_c, 0), - make_tuple(5, 4, &aom_sub_pixel_variance32x16_c, 0), - make_tuple(4, 5, &aom_sub_pixel_variance16x32_c, 0), - make_tuple(4, 4, &aom_sub_pixel_variance16x16_c, 0), - make_tuple(4, 3, &aom_sub_pixel_variance16x8_c, 0), - make_tuple(3, 4, &aom_sub_pixel_variance8x16_c, 0), - make_tuple(3, 3, &aom_sub_pixel_variance8x8_c, 0), - make_tuple(3, 2, &aom_sub_pixel_variance8x4_c, 0), - make_tuple(2, 3, &aom_sub_pixel_variance4x8_c, 0), - make_tuple(2, 2, &aom_sub_pixel_variance4x4_c, 0))); - + ::testing::Values( + SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_c, 0), + SubpelVarianceParams(6, 5, &aom_sub_pixel_variance64x32_c, 0), + SubpelVarianceParams(5, 6, &aom_sub_pixel_variance32x64_c, 0), + SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_c, 0), + SubpelVarianceParams(5, 4, &aom_sub_pixel_variance32x16_c, 0), + SubpelVarianceParams(4, 5, &aom_sub_pixel_variance16x32_c, 0), + SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_c, 0), + SubpelVarianceParams(4, 3, &aom_sub_pixel_variance16x8_c, 0), + SubpelVarianceParams(3, 4, &aom_sub_pixel_variance8x16_c, 0), + SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_c, 0), + SubpelVarianceParams(3, 2, &aom_sub_pixel_variance8x4_c, 0), + SubpelVarianceParams(2, 3, &aom_sub_pixel_variance4x8_c, 0), + SubpelVarianceParams(2, 2, &aom_sub_pixel_variance4x4_c, 0))); + +typedef TestParams<SubpixAvgVarMxNFunc> SubpelAvgVarianceParams; INSTANTIATE_TEST_CASE_P( C, AvxSubpelAvgVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_c, 0), - make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_c, 0), - make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_c, 0), - make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_c, 0), - make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_c, 0), - make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_c, 0), - make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_c, 0), - make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_c, 0), - make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_c, 0), - make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_c, 0), - make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_c, 0), - make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_c, 0), - make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_c, 0))); + ::testing::Values( + SubpelAvgVarianceParams(6, 6, &aom_sub_pixel_avg_variance64x64_c, 0), + SubpelAvgVarianceParams(6, 5, &aom_sub_pixel_avg_variance64x32_c, 0), + SubpelAvgVarianceParams(5, 6, &aom_sub_pixel_avg_variance32x64_c, 0), + SubpelAvgVarianceParams(5, 5, &aom_sub_pixel_avg_variance32x32_c, 0), + SubpelAvgVarianceParams(5, 4, &aom_sub_pixel_avg_variance32x16_c, 0), + SubpelAvgVarianceParams(4, 5, &aom_sub_pixel_avg_variance16x32_c, 0), + SubpelAvgVarianceParams(4, 4, &aom_sub_pixel_avg_variance16x16_c, 0), + SubpelAvgVarianceParams(4, 3, &aom_sub_pixel_avg_variance16x8_c, 0), + SubpelAvgVarianceParams(3, 4, &aom_sub_pixel_avg_variance8x16_c, 0), + SubpelAvgVarianceParams(3, 3, &aom_sub_pixel_avg_variance8x8_c, 0), + SubpelAvgVarianceParams(3, 2, &aom_sub_pixel_avg_variance8x4_c, 0), + SubpelAvgVarianceParams(2, 3, &aom_sub_pixel_avg_variance4x8_c, 0), + SubpelAvgVarianceParams(2, 2, &aom_sub_pixel_avg_variance4x4_c, 0))); #if CONFIG_HIGHBITDEPTH typedef MainTestClass<VarianceMxNFunc> AvxHBDMseTest; @@ -896,120 +886,147 @@ INSTANTIATE_TEST_CASE_P( VarianceParams(2, 2, &aom_highbd_12_variance4x4_sse4_1, 12))); #endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH -const AvxHBDSubpelVarianceTest::ParamType kArrayHBDSubpelVariance_c[] = { +const SubpelVarianceParams kArrayHBDSubpelVariance_c[] = { #if CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(7, 7, &aom_highbd_8_sub_pixel_variance128x128_c, 8), - make_tuple(7, 6, &aom_highbd_8_sub_pixel_variance128x64_c, 8), - make_tuple(6, 7, &aom_highbd_8_sub_pixel_variance64x128_c, 8), + SubpelVarianceParams(7, 7, &aom_highbd_8_sub_pixel_variance128x128_c, 8), + SubpelVarianceParams(7, 6, &aom_highbd_8_sub_pixel_variance128x64_c, 8), + SubpelVarianceParams(6, 7, &aom_highbd_8_sub_pixel_variance64x128_c, 8), #endif // CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(6, 6, &aom_highbd_8_sub_pixel_variance64x64_c, 8), - make_tuple(6, 5, &aom_highbd_8_sub_pixel_variance64x32_c, 8), - make_tuple(5, 6, &aom_highbd_8_sub_pixel_variance32x64_c, 8), - make_tuple(5, 5, &aom_highbd_8_sub_pixel_variance32x32_c, 8), - make_tuple(5, 4, &aom_highbd_8_sub_pixel_variance32x16_c, 8), - make_tuple(4, 5, &aom_highbd_8_sub_pixel_variance16x32_c, 8), - make_tuple(4, 4, &aom_highbd_8_sub_pixel_variance16x16_c, 8), - make_tuple(4, 3, &aom_highbd_8_sub_pixel_variance16x8_c, 8), - make_tuple(3, 4, &aom_highbd_8_sub_pixel_variance8x16_c, 8), - make_tuple(3, 3, &aom_highbd_8_sub_pixel_variance8x8_c, 8), - make_tuple(3, 2, &aom_highbd_8_sub_pixel_variance8x4_c, 8), - make_tuple(2, 3, &aom_highbd_8_sub_pixel_variance4x8_c, 8), - make_tuple(2, 2, &aom_highbd_8_sub_pixel_variance4x4_c, 8), + SubpelVarianceParams(6, 6, &aom_highbd_8_sub_pixel_variance64x64_c, 8), + SubpelVarianceParams(6, 5, &aom_highbd_8_sub_pixel_variance64x32_c, 8), + SubpelVarianceParams(5, 6, &aom_highbd_8_sub_pixel_variance32x64_c, 8), + SubpelVarianceParams(5, 5, &aom_highbd_8_sub_pixel_variance32x32_c, 8), + SubpelVarianceParams(5, 4, &aom_highbd_8_sub_pixel_variance32x16_c, 8), + SubpelVarianceParams(4, 5, &aom_highbd_8_sub_pixel_variance16x32_c, 8), + SubpelVarianceParams(4, 4, &aom_highbd_8_sub_pixel_variance16x16_c, 8), + SubpelVarianceParams(4, 3, &aom_highbd_8_sub_pixel_variance16x8_c, 8), + SubpelVarianceParams(3, 4, &aom_highbd_8_sub_pixel_variance8x16_c, 8), + SubpelVarianceParams(3, 3, &aom_highbd_8_sub_pixel_variance8x8_c, 8), + SubpelVarianceParams(3, 2, &aom_highbd_8_sub_pixel_variance8x4_c, 8), + SubpelVarianceParams(2, 3, &aom_highbd_8_sub_pixel_variance4x8_c, 8), + SubpelVarianceParams(2, 2, &aom_highbd_8_sub_pixel_variance4x4_c, 8), #if CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(7, 7, &aom_highbd_10_sub_pixel_variance128x128_c, 10), - make_tuple(7, 6, &aom_highbd_10_sub_pixel_variance128x64_c, 10), - make_tuple(6, 7, &aom_highbd_10_sub_pixel_variance64x128_c, 10), + SubpelVarianceParams(7, 7, &aom_highbd_10_sub_pixel_variance128x128_c, 10), + SubpelVarianceParams(7, 6, &aom_highbd_10_sub_pixel_variance128x64_c, 10), + SubpelVarianceParams(6, 7, &aom_highbd_10_sub_pixel_variance64x128_c, 10), #endif // CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(6, 6, &aom_highbd_10_sub_pixel_variance64x64_c, 10), - make_tuple(6, 5, &aom_highbd_10_sub_pixel_variance64x32_c, 10), - make_tuple(5, 6, &aom_highbd_10_sub_pixel_variance32x64_c, 10), - make_tuple(5, 5, &aom_highbd_10_sub_pixel_variance32x32_c, 10), - make_tuple(5, 4, &aom_highbd_10_sub_pixel_variance32x16_c, 10), - make_tuple(4, 5, &aom_highbd_10_sub_pixel_variance16x32_c, 10), - make_tuple(4, 4, &aom_highbd_10_sub_pixel_variance16x16_c, 10), - make_tuple(4, 3, &aom_highbd_10_sub_pixel_variance16x8_c, 10), - make_tuple(3, 4, &aom_highbd_10_sub_pixel_variance8x16_c, 10), - make_tuple(3, 3, &aom_highbd_10_sub_pixel_variance8x8_c, 10), - make_tuple(3, 2, &aom_highbd_10_sub_pixel_variance8x4_c, 10), - make_tuple(2, 3, &aom_highbd_10_sub_pixel_variance4x8_c, 10), - make_tuple(2, 2, &aom_highbd_10_sub_pixel_variance4x4_c, 10), + SubpelVarianceParams(6, 6, &aom_highbd_10_sub_pixel_variance64x64_c, 10), + SubpelVarianceParams(6, 5, &aom_highbd_10_sub_pixel_variance64x32_c, 10), + SubpelVarianceParams(5, 6, &aom_highbd_10_sub_pixel_variance32x64_c, 10), + SubpelVarianceParams(5, 5, &aom_highbd_10_sub_pixel_variance32x32_c, 10), + SubpelVarianceParams(5, 4, &aom_highbd_10_sub_pixel_variance32x16_c, 10), + SubpelVarianceParams(4, 5, &aom_highbd_10_sub_pixel_variance16x32_c, 10), + SubpelVarianceParams(4, 4, &aom_highbd_10_sub_pixel_variance16x16_c, 10), + SubpelVarianceParams(4, 3, &aom_highbd_10_sub_pixel_variance16x8_c, 10), + SubpelVarianceParams(3, 4, &aom_highbd_10_sub_pixel_variance8x16_c, 10), + SubpelVarianceParams(3, 3, &aom_highbd_10_sub_pixel_variance8x8_c, 10), + SubpelVarianceParams(3, 2, &aom_highbd_10_sub_pixel_variance8x4_c, 10), + SubpelVarianceParams(2, 3, &aom_highbd_10_sub_pixel_variance4x8_c, 10), + SubpelVarianceParams(2, 2, &aom_highbd_10_sub_pixel_variance4x4_c, 10), #if CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(7, 7, &aom_highbd_12_sub_pixel_variance128x128_c, 12), - make_tuple(7, 6, &aom_highbd_12_sub_pixel_variance128x64_c, 12), - make_tuple(6, 7, &aom_highbd_12_sub_pixel_variance64x128_c, 12), + SubpelVarianceParams(7, 7, &aom_highbd_12_sub_pixel_variance128x128_c, 12), + SubpelVarianceParams(7, 6, &aom_highbd_12_sub_pixel_variance128x64_c, 12), + SubpelVarianceParams(6, 7, &aom_highbd_12_sub_pixel_variance64x128_c, 12), #endif // CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(6, 6, &aom_highbd_12_sub_pixel_variance64x64_c, 12), - make_tuple(6, 5, &aom_highbd_12_sub_pixel_variance64x32_c, 12), - make_tuple(5, 6, &aom_highbd_12_sub_pixel_variance32x64_c, 12), - make_tuple(5, 5, &aom_highbd_12_sub_pixel_variance32x32_c, 12), - make_tuple(5, 4, &aom_highbd_12_sub_pixel_variance32x16_c, 12), - make_tuple(4, 5, &aom_highbd_12_sub_pixel_variance16x32_c, 12), - make_tuple(4, 4, &aom_highbd_12_sub_pixel_variance16x16_c, 12), - make_tuple(4, 3, &aom_highbd_12_sub_pixel_variance16x8_c, 12), - make_tuple(3, 4, &aom_highbd_12_sub_pixel_variance8x16_c, 12), - make_tuple(3, 3, &aom_highbd_12_sub_pixel_variance8x8_c, 12), - make_tuple(3, 2, &aom_highbd_12_sub_pixel_variance8x4_c, 12), - make_tuple(2, 3, &aom_highbd_12_sub_pixel_variance4x8_c, 12), - make_tuple(2, 2, &aom_highbd_12_sub_pixel_variance4x4_c, 12), + SubpelVarianceParams(6, 6, &aom_highbd_12_sub_pixel_variance64x64_c, 12), + SubpelVarianceParams(6, 5, &aom_highbd_12_sub_pixel_variance64x32_c, 12), + SubpelVarianceParams(5, 6, &aom_highbd_12_sub_pixel_variance32x64_c, 12), + SubpelVarianceParams(5, 5, &aom_highbd_12_sub_pixel_variance32x32_c, 12), + SubpelVarianceParams(5, 4, &aom_highbd_12_sub_pixel_variance32x16_c, 12), + SubpelVarianceParams(4, 5, &aom_highbd_12_sub_pixel_variance16x32_c, 12), + SubpelVarianceParams(4, 4, &aom_highbd_12_sub_pixel_variance16x16_c, 12), + SubpelVarianceParams(4, 3, &aom_highbd_12_sub_pixel_variance16x8_c, 12), + SubpelVarianceParams(3, 4, &aom_highbd_12_sub_pixel_variance8x16_c, 12), + SubpelVarianceParams(3, 3, &aom_highbd_12_sub_pixel_variance8x8_c, 12), + SubpelVarianceParams(3, 2, &aom_highbd_12_sub_pixel_variance8x4_c, 12), + SubpelVarianceParams(2, 3, &aom_highbd_12_sub_pixel_variance4x8_c, 12), + SubpelVarianceParams(2, 2, &aom_highbd_12_sub_pixel_variance4x4_c, 12), }; INSTANTIATE_TEST_CASE_P(C, AvxHBDSubpelVarianceTest, ::testing::ValuesIn(kArrayHBDSubpelVariance_c)); -const AvxHBDSubpelAvgVarianceTest::ParamType kArrayHBDSubpelAvgVariance_c[] = { +const SubpelAvgVarianceParams kArrayHBDSubpelAvgVariance_c[] = { #if CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(7, 7, &aom_highbd_8_sub_pixel_avg_variance128x128_c, 8), - make_tuple(7, 6, &aom_highbd_8_sub_pixel_avg_variance128x64_c, 8), - make_tuple(6, 7, &aom_highbd_8_sub_pixel_avg_variance64x128_c, 8), + SubpelAvgVarianceParams(7, 7, &aom_highbd_8_sub_pixel_avg_variance128x128_c, + 8), + SubpelAvgVarianceParams(7, 6, &aom_highbd_8_sub_pixel_avg_variance128x64_c, + 8), + SubpelAvgVarianceParams(6, 7, &aom_highbd_8_sub_pixel_avg_variance64x128_c, + 8), #endif // CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_c, 8), - make_tuple(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_c, 8), - make_tuple(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_c, 8), - make_tuple(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_c, 8), - make_tuple(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_c, 8), - make_tuple(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_c, 8), - make_tuple(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_c, 8), - make_tuple(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_c, 8), - make_tuple(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_c, 8), - make_tuple(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_c, 8), - make_tuple(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_c, 8), - make_tuple(2, 3, &aom_highbd_8_sub_pixel_avg_variance4x8_c, 8), - make_tuple(2, 2, &aom_highbd_8_sub_pixel_avg_variance4x4_c, 8), + SubpelAvgVarianceParams(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_c, 8), + SubpelAvgVarianceParams(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_c, 8), + SubpelAvgVarianceParams(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_c, 8), + SubpelAvgVarianceParams(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_c, 8), + SubpelAvgVarianceParams(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_c, 8), + SubpelAvgVarianceParams(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_c, 8), + SubpelAvgVarianceParams(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_c, 8), + SubpelAvgVarianceParams(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_c, 8), + SubpelAvgVarianceParams(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_c, 8), + SubpelAvgVarianceParams(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_c, 8), + SubpelAvgVarianceParams(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_c, 8), + SubpelAvgVarianceParams(2, 3, &aom_highbd_8_sub_pixel_avg_variance4x8_c, 8), + SubpelAvgVarianceParams(2, 2, &aom_highbd_8_sub_pixel_avg_variance4x4_c, 8), #if CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(7, 7, &aom_highbd_10_sub_pixel_avg_variance128x128_c, 10), - make_tuple(7, 6, &aom_highbd_10_sub_pixel_avg_variance128x64_c, 10), - make_tuple(6, 7, &aom_highbd_10_sub_pixel_avg_variance64x128_c, 10), + SubpelAvgVarianceParams(7, 7, &aom_highbd_10_sub_pixel_avg_variance128x128_c, + 10), + SubpelAvgVarianceParams(7, 6, &aom_highbd_10_sub_pixel_avg_variance128x64_c, + 10), + SubpelAvgVarianceParams(6, 7, &aom_highbd_10_sub_pixel_avg_variance64x128_c, + 10), #endif // CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_c, 10), - make_tuple(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_c, 10), - make_tuple(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_c, 10), - make_tuple(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_c, 10), - make_tuple(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_c, 10), - make_tuple(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_c, 10), - make_tuple(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_c, 10), - make_tuple(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_c, 10), - make_tuple(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_c, 10), - make_tuple(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_c, 10), - make_tuple(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_c, 10), - make_tuple(2, 3, &aom_highbd_10_sub_pixel_avg_variance4x8_c, 10), - make_tuple(2, 2, &aom_highbd_10_sub_pixel_avg_variance4x4_c, 10), + SubpelAvgVarianceParams(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_c, + 10), + SubpelAvgVarianceParams(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_c, + 10), + SubpelAvgVarianceParams(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_c, + 10), + SubpelAvgVarianceParams(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_c, + 10), + SubpelAvgVarianceParams(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_c, + 10), + SubpelAvgVarianceParams(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_c, + 10), + SubpelAvgVarianceParams(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_c, + 10), + SubpelAvgVarianceParams(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_c, + 10), + SubpelAvgVarianceParams(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_c, + 10), + SubpelAvgVarianceParams(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_c, 10), + SubpelAvgVarianceParams(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_c, 10), + SubpelAvgVarianceParams(2, 3, &aom_highbd_10_sub_pixel_avg_variance4x8_c, 10), + SubpelAvgVarianceParams(2, 2, &aom_highbd_10_sub_pixel_avg_variance4x4_c, 10), #if CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(7, 7, &aom_highbd_12_sub_pixel_avg_variance128x128_c, 12), - make_tuple(7, 6, &aom_highbd_12_sub_pixel_avg_variance128x64_c, 12), - make_tuple(6, 7, &aom_highbd_12_sub_pixel_avg_variance64x128_c, 12), + SubpelAvgVarianceParams(7, 7, &aom_highbd_12_sub_pixel_avg_variance128x128_c, + 12), + SubpelAvgVarianceParams(7, 6, &aom_highbd_12_sub_pixel_avg_variance128x64_c, + 12), + SubpelAvgVarianceParams(6, 7, &aom_highbd_12_sub_pixel_avg_variance64x128_c, + 12), #endif // CONFIG_AV1 && CONFIG_EXT_PARTITION - make_tuple(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_c, 12), - make_tuple(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_c, 12), - make_tuple(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_c, 12), - make_tuple(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_c, 12), - make_tuple(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_c, 12), - make_tuple(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_c, 12), - make_tuple(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_c, 12), - make_tuple(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_c, 12), - make_tuple(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_c, 12), - make_tuple(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_c, 12), - make_tuple(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_c, 12), - make_tuple(2, 3, &aom_highbd_12_sub_pixel_avg_variance4x8_c, 12), - make_tuple(2, 2, &aom_highbd_12_sub_pixel_avg_variance4x4_c, 12) + SubpelAvgVarianceParams(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_c, + 12), + SubpelAvgVarianceParams(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_c, + 12), + SubpelAvgVarianceParams(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_c, + 12), + SubpelAvgVarianceParams(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_c, + 12), + SubpelAvgVarianceParams(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_c, + 12), + SubpelAvgVarianceParams(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_c, + 12), + SubpelAvgVarianceParams(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_c, + 12), + SubpelAvgVarianceParams(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_c, + 12), + SubpelAvgVarianceParams(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_c, + 12), + SubpelAvgVarianceParams(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_c, 12), + SubpelAvgVarianceParams(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_c, 12), + SubpelAvgVarianceParams(2, 3, &aom_highbd_12_sub_pixel_avg_variance4x8_c, 12), + SubpelAvgVarianceParams(2, 2, &aom_highbd_12_sub_pixel_avg_variance4x4_c, 12) }; INSTANTIATE_TEST_CASE_P(C, AvxHBDSubpelAvgVarianceTest, ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_c)); @@ -1043,51 +1060,61 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( SSE2, AvxSubpelVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_sse2, 0), - make_tuple(6, 5, &aom_sub_pixel_variance64x32_sse2, 0), - make_tuple(5, 6, &aom_sub_pixel_variance32x64_sse2, 0), - make_tuple(5, 5, &aom_sub_pixel_variance32x32_sse2, 0), - make_tuple(5, 4, &aom_sub_pixel_variance32x16_sse2, 0), - make_tuple(4, 5, &aom_sub_pixel_variance16x32_sse2, 0), - make_tuple(4, 4, &aom_sub_pixel_variance16x16_sse2, 0), - make_tuple(4, 3, &aom_sub_pixel_variance16x8_sse2, 0), - make_tuple(3, 4, &aom_sub_pixel_variance8x16_sse2, 0), - make_tuple(3, 3, &aom_sub_pixel_variance8x8_sse2, 0), - make_tuple(3, 2, &aom_sub_pixel_variance8x4_sse2, 0), - make_tuple(2, 3, &aom_sub_pixel_variance4x8_sse2, 0), - make_tuple(2, 2, &aom_sub_pixel_variance4x4_sse2, 0))); + ::testing::Values( + SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_sse2, 0), + SubpelVarianceParams(6, 5, &aom_sub_pixel_variance64x32_sse2, 0), + SubpelVarianceParams(5, 6, &aom_sub_pixel_variance32x64_sse2, 0), + SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_sse2, 0), + SubpelVarianceParams(5, 4, &aom_sub_pixel_variance32x16_sse2, 0), + SubpelVarianceParams(4, 5, &aom_sub_pixel_variance16x32_sse2, 0), + SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_sse2, 0), + SubpelVarianceParams(4, 3, &aom_sub_pixel_variance16x8_sse2, 0), + SubpelVarianceParams(3, 4, &aom_sub_pixel_variance8x16_sse2, 0), + SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_sse2, 0), + SubpelVarianceParams(3, 2, &aom_sub_pixel_variance8x4_sse2, 0), + SubpelVarianceParams(2, 3, &aom_sub_pixel_variance4x8_sse2, 0), + SubpelVarianceParams(2, 2, &aom_sub_pixel_variance4x4_sse2, 0))); INSTANTIATE_TEST_CASE_P( SSE2, AvxSubpelAvgVarianceTest, ::testing::Values( - make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_sse2, 0), - make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_sse2, 0), - make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_sse2, 0), - make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_sse2, 0), - make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_sse2, 0), - make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_sse2, 0), - make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_sse2, 0), - make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_sse2, 0), - make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_sse2, 0), - make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_sse2, 0), - make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_sse2, 0), - make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_sse2, 0), - make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_sse2, 0))); + SubpelAvgVarianceParams(6, 6, &aom_sub_pixel_avg_variance64x64_sse2, 0), + SubpelAvgVarianceParams(6, 5, &aom_sub_pixel_avg_variance64x32_sse2, 0), + SubpelAvgVarianceParams(5, 6, &aom_sub_pixel_avg_variance32x64_sse2, 0), + SubpelAvgVarianceParams(5, 5, &aom_sub_pixel_avg_variance32x32_sse2, 0), + SubpelAvgVarianceParams(5, 4, &aom_sub_pixel_avg_variance32x16_sse2, 0), + SubpelAvgVarianceParams(4, 5, &aom_sub_pixel_avg_variance16x32_sse2, 0), + SubpelAvgVarianceParams(4, 4, &aom_sub_pixel_avg_variance16x16_sse2, 0), + SubpelAvgVarianceParams(4, 3, &aom_sub_pixel_avg_variance16x8_sse2, 0), + SubpelAvgVarianceParams(3, 4, &aom_sub_pixel_avg_variance8x16_sse2, 0), + SubpelAvgVarianceParams(3, 3, &aom_sub_pixel_avg_variance8x8_sse2, 0), + SubpelAvgVarianceParams(3, 2, &aom_sub_pixel_avg_variance8x4_sse2, 0), + SubpelAvgVarianceParams(2, 3, &aom_sub_pixel_avg_variance4x8_sse2, 0), + SubpelAvgVarianceParams(2, 2, &aom_sub_pixel_avg_variance4x4_sse2, 0))); #if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( SSE4_1, AvxSubpelVarianceTest, ::testing::Values( - make_tuple(2, 2, &aom_highbd_8_sub_pixel_variance4x4_sse4_1, 8), - make_tuple(2, 2, &aom_highbd_10_sub_pixel_variance4x4_sse4_1, 10), - make_tuple(2, 2, &aom_highbd_12_sub_pixel_variance4x4_sse4_1, 12))); + SubpelVarianceParams(2, 2, &aom_highbd_8_sub_pixel_variance4x4_sse4_1, + 8), + SubpelVarianceParams(2, 2, &aom_highbd_10_sub_pixel_variance4x4_sse4_1, + 10), + SubpelVarianceParams(2, 2, &aom_highbd_12_sub_pixel_variance4x4_sse4_1, + 12))); INSTANTIATE_TEST_CASE_P( SSE4_1, AvxSubpelAvgVarianceTest, ::testing::Values( - make_tuple(2, 2, &aom_highbd_8_sub_pixel_avg_variance4x4_sse4_1, 8), - make_tuple(2, 2, &aom_highbd_10_sub_pixel_avg_variance4x4_sse4_1, 10), - make_tuple(2, 2, &aom_highbd_12_sub_pixel_avg_variance4x4_sse4_1, 12))); + SubpelAvgVarianceParams(2, 2, + &aom_highbd_8_sub_pixel_avg_variance4x4_sse4_1, + 8), + SubpelAvgVarianceParams(2, 2, + &aom_highbd_10_sub_pixel_avg_variance4x4_sse4_1, + 10), + SubpelAvgVarianceParams(2, 2, + &aom_highbd_12_sub_pixel_avg_variance4x4_sse4_1, + 12))); #endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH #if CONFIG_HIGHBITDEPTH @@ -1142,115 +1169,160 @@ INSTANTIATE_TEST_CASE_P( VarianceParams(3, 4, &aom_highbd_8_variance8x16_sse2, 8), VarianceParams(3, 3, &aom_highbd_8_variance8x8_sse2, 8))); -INSTANTIATE_TEST_CASE_P( - SSE2, AvxHBDSubpelVarianceTest, - ::testing::Values( - make_tuple(6, 6, &aom_highbd_12_sub_pixel_variance64x64_sse2, 12), - make_tuple(6, 5, &aom_highbd_12_sub_pixel_variance64x32_sse2, 12), - make_tuple(5, 6, &aom_highbd_12_sub_pixel_variance32x64_sse2, 12), - make_tuple(5, 5, &aom_highbd_12_sub_pixel_variance32x32_sse2, 12), - make_tuple(5, 4, &aom_highbd_12_sub_pixel_variance32x16_sse2, 12), - make_tuple(4, 5, &aom_highbd_12_sub_pixel_variance16x32_sse2, 12), - make_tuple(4, 4, &aom_highbd_12_sub_pixel_variance16x16_sse2, 12), - make_tuple(4, 3, &aom_highbd_12_sub_pixel_variance16x8_sse2, 12), - make_tuple(3, 4, &aom_highbd_12_sub_pixel_variance8x16_sse2, 12), - make_tuple(3, 3, &aom_highbd_12_sub_pixel_variance8x8_sse2, 12), - make_tuple(3, 2, &aom_highbd_12_sub_pixel_variance8x4_sse2, 12), - make_tuple(6, 6, &aom_highbd_10_sub_pixel_variance64x64_sse2, 10), - make_tuple(6, 5, &aom_highbd_10_sub_pixel_variance64x32_sse2, 10), - make_tuple(5, 6, &aom_highbd_10_sub_pixel_variance32x64_sse2, 10), - make_tuple(5, 5, &aom_highbd_10_sub_pixel_variance32x32_sse2, 10), - make_tuple(5, 4, &aom_highbd_10_sub_pixel_variance32x16_sse2, 10), - make_tuple(4, 5, &aom_highbd_10_sub_pixel_variance16x32_sse2, 10), - make_tuple(4, 4, &aom_highbd_10_sub_pixel_variance16x16_sse2, 10), - make_tuple(4, 3, &aom_highbd_10_sub_pixel_variance16x8_sse2, 10), - make_tuple(3, 4, &aom_highbd_10_sub_pixel_variance8x16_sse2, 10), - make_tuple(3, 3, &aom_highbd_10_sub_pixel_variance8x8_sse2, 10), - make_tuple(3, 2, &aom_highbd_10_sub_pixel_variance8x4_sse2, 10), - make_tuple(6, 6, &aom_highbd_8_sub_pixel_variance64x64_sse2, 8), - make_tuple(6, 5, &aom_highbd_8_sub_pixel_variance64x32_sse2, 8), - make_tuple(5, 6, &aom_highbd_8_sub_pixel_variance32x64_sse2, 8), - make_tuple(5, 5, &aom_highbd_8_sub_pixel_variance32x32_sse2, 8), - make_tuple(5, 4, &aom_highbd_8_sub_pixel_variance32x16_sse2, 8), - make_tuple(4, 5, &aom_highbd_8_sub_pixel_variance16x32_sse2, 8), - make_tuple(4, 4, &aom_highbd_8_sub_pixel_variance16x16_sse2, 8), - make_tuple(4, 3, &aom_highbd_8_sub_pixel_variance16x8_sse2, 8), - make_tuple(3, 4, &aom_highbd_8_sub_pixel_variance8x16_sse2, 8), - make_tuple(3, 3, &aom_highbd_8_sub_pixel_variance8x8_sse2, 8), - make_tuple(3, 2, &aom_highbd_8_sub_pixel_variance8x4_sse2, 8))); +const SubpelVarianceParams kArrayHBDSubpelVariance_sse2[] = { + SubpelVarianceParams(6, 6, &aom_highbd_12_sub_pixel_variance64x64_sse2, 12), + SubpelVarianceParams(6, 5, &aom_highbd_12_sub_pixel_variance64x32_sse2, 12), + SubpelVarianceParams(5, 6, &aom_highbd_12_sub_pixel_variance32x64_sse2, 12), + SubpelVarianceParams(5, 5, &aom_highbd_12_sub_pixel_variance32x32_sse2, 12), + SubpelVarianceParams(5, 4, &aom_highbd_12_sub_pixel_variance32x16_sse2, 12), + SubpelVarianceParams(4, 5, &aom_highbd_12_sub_pixel_variance16x32_sse2, 12), + SubpelVarianceParams(4, 4, &aom_highbd_12_sub_pixel_variance16x16_sse2, 12), + SubpelVarianceParams(4, 3, &aom_highbd_12_sub_pixel_variance16x8_sse2, 12), + SubpelVarianceParams(3, 4, &aom_highbd_12_sub_pixel_variance8x16_sse2, 12), + SubpelVarianceParams(3, 3, &aom_highbd_12_sub_pixel_variance8x8_sse2, 12), + SubpelVarianceParams(3, 2, &aom_highbd_12_sub_pixel_variance8x4_sse2, 12), + SubpelVarianceParams(6, 6, &aom_highbd_10_sub_pixel_variance64x64_sse2, 10), + SubpelVarianceParams(6, 5, &aom_highbd_10_sub_pixel_variance64x32_sse2, 10), + SubpelVarianceParams(5, 6, &aom_highbd_10_sub_pixel_variance32x64_sse2, 10), + SubpelVarianceParams(5, 5, &aom_highbd_10_sub_pixel_variance32x32_sse2, 10), + SubpelVarianceParams(5, 4, &aom_highbd_10_sub_pixel_variance32x16_sse2, 10), + SubpelVarianceParams(4, 5, &aom_highbd_10_sub_pixel_variance16x32_sse2, 10), + SubpelVarianceParams(4, 4, &aom_highbd_10_sub_pixel_variance16x16_sse2, 10), + SubpelVarianceParams(4, 3, &aom_highbd_10_sub_pixel_variance16x8_sse2, 10), + SubpelVarianceParams(3, 4, &aom_highbd_10_sub_pixel_variance8x16_sse2, 10), + SubpelVarianceParams(3, 3, &aom_highbd_10_sub_pixel_variance8x8_sse2, 10), + SubpelVarianceParams(3, 2, &aom_highbd_10_sub_pixel_variance8x4_sse2, 10), + SubpelVarianceParams(6, 6, &aom_highbd_8_sub_pixel_variance64x64_sse2, 8), + SubpelVarianceParams(6, 5, &aom_highbd_8_sub_pixel_variance64x32_sse2, 8), + SubpelVarianceParams(5, 6, &aom_highbd_8_sub_pixel_variance32x64_sse2, 8), + SubpelVarianceParams(5, 5, &aom_highbd_8_sub_pixel_variance32x32_sse2, 8), + SubpelVarianceParams(5, 4, &aom_highbd_8_sub_pixel_variance32x16_sse2, 8), + SubpelVarianceParams(4, 5, &aom_highbd_8_sub_pixel_variance16x32_sse2, 8), + SubpelVarianceParams(4, 4, &aom_highbd_8_sub_pixel_variance16x16_sse2, 8), + SubpelVarianceParams(4, 3, &aom_highbd_8_sub_pixel_variance16x8_sse2, 8), + SubpelVarianceParams(3, 4, &aom_highbd_8_sub_pixel_variance8x16_sse2, 8), + SubpelVarianceParams(3, 3, &aom_highbd_8_sub_pixel_variance8x8_sse2, 8), + SubpelVarianceParams(3, 2, &aom_highbd_8_sub_pixel_variance8x4_sse2, 8) +}; -INSTANTIATE_TEST_CASE_P( - SSE2, AvxHBDSubpelAvgVarianceTest, - ::testing::Values( - make_tuple(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_sse2, 12), - make_tuple(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_sse2, 12), - make_tuple(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_sse2, 12), - make_tuple(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_sse2, 12), - make_tuple(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_sse2, 12), - make_tuple(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_sse2, 12), - make_tuple(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_sse2, 12), - make_tuple(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_sse2, 12), - make_tuple(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_sse2, 12), - make_tuple(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_sse2, 12), - make_tuple(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_sse2, 12), - make_tuple(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_sse2, 10), - make_tuple(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_sse2, 10), - make_tuple(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_sse2, 10), - make_tuple(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_sse2, 10), - make_tuple(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_sse2, 10), - make_tuple(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_sse2, 10), - make_tuple(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_sse2, 10), - make_tuple(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_sse2, 10), - make_tuple(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_sse2, 10), - make_tuple(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_sse2, 10), - make_tuple(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_sse2, 10), - make_tuple(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_sse2, 8), - make_tuple(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_sse2, 8), - make_tuple(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_sse2, 8), - make_tuple(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_sse2, 8), - make_tuple(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_sse2, 8), - make_tuple(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_sse2, 8), - make_tuple(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_sse2, 8), - make_tuple(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_sse2, 8), - make_tuple(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_sse2, 8), - make_tuple(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_sse2, 8), - make_tuple(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_sse2, 8))); +INSTANTIATE_TEST_CASE_P(SSE2, AvxHBDSubpelVarianceTest, + ::testing::ValuesIn(kArrayHBDSubpelVariance_sse2)); + +const SubpelAvgVarianceParams kArrayHBDSubpelAvgVariance_sse2[] = { + SubpelAvgVarianceParams(6, 6, &aom_highbd_12_sub_pixel_avg_variance64x64_sse2, + 12), + SubpelAvgVarianceParams(6, 5, &aom_highbd_12_sub_pixel_avg_variance64x32_sse2, + 12), + SubpelAvgVarianceParams(5, 6, &aom_highbd_12_sub_pixel_avg_variance32x64_sse2, + 12), + SubpelAvgVarianceParams(5, 5, &aom_highbd_12_sub_pixel_avg_variance32x32_sse2, + 12), + SubpelAvgVarianceParams(5, 4, &aom_highbd_12_sub_pixel_avg_variance32x16_sse2, + 12), + SubpelAvgVarianceParams(4, 5, &aom_highbd_12_sub_pixel_avg_variance16x32_sse2, + 12), + SubpelAvgVarianceParams(4, 4, &aom_highbd_12_sub_pixel_avg_variance16x16_sse2, + 12), + SubpelAvgVarianceParams(4, 3, &aom_highbd_12_sub_pixel_avg_variance16x8_sse2, + 12), + SubpelAvgVarianceParams(3, 4, &aom_highbd_12_sub_pixel_avg_variance8x16_sse2, + 12), + SubpelAvgVarianceParams(3, 3, &aom_highbd_12_sub_pixel_avg_variance8x8_sse2, + 12), + SubpelAvgVarianceParams(3, 2, &aom_highbd_12_sub_pixel_avg_variance8x4_sse2, + 12), + SubpelAvgVarianceParams(6, 6, &aom_highbd_10_sub_pixel_avg_variance64x64_sse2, + 10), + SubpelAvgVarianceParams(6, 5, &aom_highbd_10_sub_pixel_avg_variance64x32_sse2, + 10), + SubpelAvgVarianceParams(5, 6, &aom_highbd_10_sub_pixel_avg_variance32x64_sse2, + 10), + SubpelAvgVarianceParams(5, 5, &aom_highbd_10_sub_pixel_avg_variance32x32_sse2, + 10), + SubpelAvgVarianceParams(5, 4, &aom_highbd_10_sub_pixel_avg_variance32x16_sse2, + 10), + SubpelAvgVarianceParams(4, 5, &aom_highbd_10_sub_pixel_avg_variance16x32_sse2, + 10), + SubpelAvgVarianceParams(4, 4, &aom_highbd_10_sub_pixel_avg_variance16x16_sse2, + 10), + SubpelAvgVarianceParams(4, 3, &aom_highbd_10_sub_pixel_avg_variance16x8_sse2, + 10), + SubpelAvgVarianceParams(3, 4, &aom_highbd_10_sub_pixel_avg_variance8x16_sse2, + 10), + SubpelAvgVarianceParams(3, 3, &aom_highbd_10_sub_pixel_avg_variance8x8_sse2, + 10), + SubpelAvgVarianceParams(3, 2, &aom_highbd_10_sub_pixel_avg_variance8x4_sse2, + 10), + SubpelAvgVarianceParams(6, 6, &aom_highbd_8_sub_pixel_avg_variance64x64_sse2, + 8), + SubpelAvgVarianceParams(6, 5, &aom_highbd_8_sub_pixel_avg_variance64x32_sse2, + 8), + SubpelAvgVarianceParams(5, 6, &aom_highbd_8_sub_pixel_avg_variance32x64_sse2, + 8), + SubpelAvgVarianceParams(5, 5, &aom_highbd_8_sub_pixel_avg_variance32x32_sse2, + 8), + SubpelAvgVarianceParams(5, 4, &aom_highbd_8_sub_pixel_avg_variance32x16_sse2, + 8), + SubpelAvgVarianceParams(4, 5, &aom_highbd_8_sub_pixel_avg_variance16x32_sse2, + 8), + SubpelAvgVarianceParams(4, 4, &aom_highbd_8_sub_pixel_avg_variance16x16_sse2, + 8), + SubpelAvgVarianceParams(4, 3, &aom_highbd_8_sub_pixel_avg_variance16x8_sse2, + 8), + SubpelAvgVarianceParams(3, 4, &aom_highbd_8_sub_pixel_avg_variance8x16_sse2, + 8), + SubpelAvgVarianceParams(3, 3, &aom_highbd_8_sub_pixel_avg_variance8x8_sse2, + 8), + SubpelAvgVarianceParams(3, 2, &aom_highbd_8_sub_pixel_avg_variance8x4_sse2, 8) +}; + +INSTANTIATE_TEST_CASE_P(SSE2, AvxHBDSubpelAvgVarianceTest, + ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_sse2)); #endif // CONFIG_HIGHBITDEPTH #endif // HAVE_SSE2 #if HAVE_SSSE3 INSTANTIATE_TEST_CASE_P( SSSE3, AvxSubpelVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_ssse3, 0), - make_tuple(6, 5, &aom_sub_pixel_variance64x32_ssse3, 0), - make_tuple(5, 6, &aom_sub_pixel_variance32x64_ssse3, 0), - make_tuple(5, 5, &aom_sub_pixel_variance32x32_ssse3, 0), - make_tuple(5, 4, &aom_sub_pixel_variance32x16_ssse3, 0), - make_tuple(4, 5, &aom_sub_pixel_variance16x32_ssse3, 0), - make_tuple(4, 4, &aom_sub_pixel_variance16x16_ssse3, 0), - make_tuple(4, 3, &aom_sub_pixel_variance16x8_ssse3, 0), - make_tuple(3, 4, &aom_sub_pixel_variance8x16_ssse3, 0), - make_tuple(3, 3, &aom_sub_pixel_variance8x8_ssse3, 0), - make_tuple(3, 2, &aom_sub_pixel_variance8x4_ssse3, 0), - make_tuple(2, 3, &aom_sub_pixel_variance4x8_ssse3, 0), - make_tuple(2, 2, &aom_sub_pixel_variance4x4_ssse3, 0))); + ::testing::Values( + SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_ssse3, 0), + SubpelVarianceParams(6, 5, &aom_sub_pixel_variance64x32_ssse3, 0), + SubpelVarianceParams(5, 6, &aom_sub_pixel_variance32x64_ssse3, 0), + SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_ssse3, 0), + SubpelVarianceParams(5, 4, &aom_sub_pixel_variance32x16_ssse3, 0), + SubpelVarianceParams(4, 5, &aom_sub_pixel_variance16x32_ssse3, 0), + SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_ssse3, 0), + SubpelVarianceParams(4, 3, &aom_sub_pixel_variance16x8_ssse3, 0), + SubpelVarianceParams(3, 4, &aom_sub_pixel_variance8x16_ssse3, 0), + SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_ssse3, 0), + SubpelVarianceParams(3, 2, &aom_sub_pixel_variance8x4_ssse3, 0), + SubpelVarianceParams(2, 3, &aom_sub_pixel_variance4x8_ssse3, 0), + SubpelVarianceParams(2, 2, &aom_sub_pixel_variance4x4_ssse3, 0))); INSTANTIATE_TEST_CASE_P( SSSE3, AvxSubpelAvgVarianceTest, ::testing::Values( - make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_ssse3, 0), - make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_ssse3, 0), - make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_ssse3, 0), - make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_ssse3, 0), - make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_ssse3, 0), - make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_ssse3, 0), - make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_ssse3, 0), - make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_ssse3, 0), - make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_ssse3, 0), - make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_ssse3, 0), - make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_ssse3, 0), - make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_ssse3, 0), - make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_ssse3, 0))); + SubpelAvgVarianceParams(6, 6, &aom_sub_pixel_avg_variance64x64_ssse3, + 0), + SubpelAvgVarianceParams(6, 5, &aom_sub_pixel_avg_variance64x32_ssse3, + 0), + SubpelAvgVarianceParams(5, 6, &aom_sub_pixel_avg_variance32x64_ssse3, + 0), + SubpelAvgVarianceParams(5, 5, &aom_sub_pixel_avg_variance32x32_ssse3, + 0), + SubpelAvgVarianceParams(5, 4, &aom_sub_pixel_avg_variance32x16_ssse3, + 0), + SubpelAvgVarianceParams(4, 5, &aom_sub_pixel_avg_variance16x32_ssse3, + 0), + SubpelAvgVarianceParams(4, 4, &aom_sub_pixel_avg_variance16x16_ssse3, + 0), + SubpelAvgVarianceParams(4, 3, &aom_sub_pixel_avg_variance16x8_ssse3, 0), + SubpelAvgVarianceParams(3, 4, &aom_sub_pixel_avg_variance8x16_ssse3, 0), + SubpelAvgVarianceParams(3, 3, &aom_sub_pixel_avg_variance8x8_ssse3, 0), + SubpelAvgVarianceParams(3, 2, &aom_sub_pixel_avg_variance8x4_ssse3, 0), + SubpelAvgVarianceParams(2, 3, &aom_sub_pixel_avg_variance4x8_ssse3, 0), + SubpelAvgVarianceParams(2, 2, &aom_sub_pixel_avg_variance4x4_ssse3, + 0))); #endif // HAVE_SSSE3 #if HAVE_AVX2 @@ -1267,14 +1339,16 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( AVX2, AvxSubpelVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_avx2, 0), - make_tuple(5, 5, &aom_sub_pixel_variance32x32_avx2, 0))); + ::testing::Values( + SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_avx2, 0), + SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_avx2, 0))); INSTANTIATE_TEST_CASE_P( AVX2, AvxSubpelAvgVarianceTest, ::testing::Values( - make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_avx2, 0), - make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_avx2, 0))); + SubpelAvgVarianceParams(6, 6, &aom_sub_pixel_avg_variance64x64_avx2, 0), + SubpelAvgVarianceParams(5, 5, &aom_sub_pixel_avg_variance32x32_avx2, + 0))); #endif // HAVE_AVX2 #if HAVE_NEON @@ -1298,10 +1372,11 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( NEON, AvxSubpelVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_variance64x64_neon, 0), - make_tuple(5, 5, &aom_sub_pixel_variance32x32_neon, 0), - make_tuple(4, 4, &aom_sub_pixel_variance16x16_neon, 0), - make_tuple(3, 3, &aom_sub_pixel_variance8x8_neon, 0))); + ::testing::Values( + SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_neon, 0), + SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_neon, 0), + SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_neon, 0), + SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_neon, 0))); #endif // HAVE_NEON #if HAVE_MSA @@ -1336,34 +1411,36 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( MSA, AvxSubpelVarianceTest, - ::testing::Values(make_tuple(2, 2, &aom_sub_pixel_variance4x4_msa, 0), - make_tuple(2, 3, &aom_sub_pixel_variance4x8_msa, 0), - make_tuple(3, 2, &aom_sub_pixel_variance8x4_msa, 0), - make_tuple(3, 3, &aom_sub_pixel_variance8x8_msa, 0), - make_tuple(3, 4, &aom_sub_pixel_variance8x16_msa, 0), - make_tuple(4, 3, &aom_sub_pixel_variance16x8_msa, 0), - make_tuple(4, 4, &aom_sub_pixel_variance16x16_msa, 0), - make_tuple(4, 5, &aom_sub_pixel_variance16x32_msa, 0), - make_tuple(5, 4, &aom_sub_pixel_variance32x16_msa, 0), - make_tuple(5, 5, &aom_sub_pixel_variance32x32_msa, 0), - make_tuple(5, 6, &aom_sub_pixel_variance32x64_msa, 0), - make_tuple(6, 5, &aom_sub_pixel_variance64x32_msa, 0), - make_tuple(6, 6, &aom_sub_pixel_variance64x64_msa, 0))); + ::testing::Values( + SubpelVarianceParams(2, 2, &aom_sub_pixel_variance4x4_msa, 0), + SubpelVarianceParams(2, 3, &aom_sub_pixel_variance4x8_msa, 0), + SubpelVarianceParams(3, 2, &aom_sub_pixel_variance8x4_msa, 0), + SubpelVarianceParams(3, 3, &aom_sub_pixel_variance8x8_msa, 0), + SubpelVarianceParams(3, 4, &aom_sub_pixel_variance8x16_msa, 0), + SubpelVarianceParams(4, 3, &aom_sub_pixel_variance16x8_msa, 0), + SubpelVarianceParams(4, 4, &aom_sub_pixel_variance16x16_msa, 0), + SubpelVarianceParams(4, 5, &aom_sub_pixel_variance16x32_msa, 0), + SubpelVarianceParams(5, 4, &aom_sub_pixel_variance32x16_msa, 0), + SubpelVarianceParams(5, 5, &aom_sub_pixel_variance32x32_msa, 0), + SubpelVarianceParams(5, 6, &aom_sub_pixel_variance32x64_msa, 0), + SubpelVarianceParams(6, 5, &aom_sub_pixel_variance64x32_msa, 0), + SubpelVarianceParams(6, 6, &aom_sub_pixel_variance64x64_msa, 0))); INSTANTIATE_TEST_CASE_P( MSA, AvxSubpelAvgVarianceTest, - ::testing::Values(make_tuple(6, 6, &aom_sub_pixel_avg_variance64x64_msa, 0), - make_tuple(6, 5, &aom_sub_pixel_avg_variance64x32_msa, 0), - make_tuple(5, 6, &aom_sub_pixel_avg_variance32x64_msa, 0), - make_tuple(5, 5, &aom_sub_pixel_avg_variance32x32_msa, 0), - make_tuple(5, 4, &aom_sub_pixel_avg_variance32x16_msa, 0), - make_tuple(4, 5, &aom_sub_pixel_avg_variance16x32_msa, 0), - make_tuple(4, 4, &aom_sub_pixel_avg_variance16x16_msa, 0), - make_tuple(4, 3, &aom_sub_pixel_avg_variance16x8_msa, 0), - make_tuple(3, 4, &aom_sub_pixel_avg_variance8x16_msa, 0), - make_tuple(3, 3, &aom_sub_pixel_avg_variance8x8_msa, 0), - make_tuple(3, 2, &aom_sub_pixel_avg_variance8x4_msa, 0), - make_tuple(2, 3, &aom_sub_pixel_avg_variance4x8_msa, 0), - make_tuple(2, 2, &aom_sub_pixel_avg_variance4x4_msa, 0))); + ::testing::Values( + SubpelAvgVarianceParams(6, 6, &aom_sub_pixel_avg_variance64x64_msa, 0), + SubpelAvgVarianceParams(6, 5, &aom_sub_pixel_avg_variance64x32_msa, 0), + SubpelAvgVarianceParams(5, 6, &aom_sub_pixel_avg_variance32x64_msa, 0), + SubpelAvgVarianceParams(5, 5, &aom_sub_pixel_avg_variance32x32_msa, 0), + SubpelAvgVarianceParams(5, 4, &aom_sub_pixel_avg_variance32x16_msa, 0), + SubpelAvgVarianceParams(4, 5, &aom_sub_pixel_avg_variance16x32_msa, 0), + SubpelAvgVarianceParams(4, 4, &aom_sub_pixel_avg_variance16x16_msa, 0), + SubpelAvgVarianceParams(4, 3, &aom_sub_pixel_avg_variance16x8_msa, 0), + SubpelAvgVarianceParams(3, 4, &aom_sub_pixel_avg_variance8x16_msa, 0), + SubpelAvgVarianceParams(3, 3, &aom_sub_pixel_avg_variance8x8_msa, 0), + SubpelAvgVarianceParams(3, 2, &aom_sub_pixel_avg_variance8x4_msa, 0), + SubpelAvgVarianceParams(2, 3, &aom_sub_pixel_avg_variance4x8_msa, 0), + SubpelAvgVarianceParams(2, 2, &aom_sub_pixel_avg_variance4x4_msa, 0))); #endif // HAVE_MSA } // namespace diff --git a/third_party/aom/test/warp_filter_test.cc b/third_party/aom/test/warp_filter_test.cc index 2e4e6c32b..0353c074e 100644 --- a/third_party/aom/test/warp_filter_test.cc +++ b/third_party/aom/test/warp_filter_test.cc @@ -28,9 +28,11 @@ INSTANTIATE_TEST_CASE_P( SSE2, AV1WarpFilterTest, libaom_test::AV1WarpFilter::BuildParams(av1_warp_affine_sse2)); +#if HAVE_SSSE3 INSTANTIATE_TEST_CASE_P( SSSE3, AV1WarpFilterTest, libaom_test::AV1WarpFilter::BuildParams(av1_warp_affine_ssse3)); +#endif #if CONFIG_HIGHBITDEPTH && HAVE_SSSE3 TEST_P(AV1HighbdWarpFilterTest, CheckOutput) { diff --git a/third_party/aom/test/warp_filter_test_util.cc b/third_party/aom/test/warp_filter_test_util.cc index ac7518f47..ab3c153e7 100644 --- a/third_party/aom/test/warp_filter_test_util.cc +++ b/third_party/aom/test/warp_filter_test_util.cc @@ -112,6 +112,7 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) { uint8_t *output2 = new uint8_t[output_n]; int32_t mat[8]; int16_t alpha, beta, gamma, delta; + ConvolveParams conv_params = get_conv_params(0, 0, 0); // Generate an input block and extend its borders horizontally for (i = 0; i < h; ++i) @@ -126,10 +127,10 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) { for (sub_y = 0; sub_y < 2; ++sub_y) { generate_model(mat, &alpha, &beta, &gamma, &delta); av1_warp_affine_c(mat, input, w, h, stride, output, 32, 32, out_w, - out_h, out_w, sub_x, sub_y, 0, alpha, beta, gamma, - delta); + out_h, out_w, sub_x, sub_y, &conv_params, alpha, beta, + gamma, delta); test_impl(mat, input, w, h, stride, output2, 32, 32, out_w, out_h, - out_w, sub_x, sub_y, 0, alpha, beta, gamma, delta); + out_w, sub_x, sub_y, &conv_params, alpha, beta, gamma, delta); for (j = 0; j < out_w * out_h; ++j) ASSERT_EQ(output[j], output2[j]) @@ -248,6 +249,7 @@ void AV1HighbdWarpFilterTest::RunCheckOutput( uint16_t *output2 = new uint16_t[output_n]; int32_t mat[8]; int16_t alpha, beta, gamma, delta; + ConvolveParams conv_params = get_conv_params(0, 0, 0); // Generate an input block and extend its borders horizontally for (i = 0; i < h; ++i) @@ -265,10 +267,11 @@ void AV1HighbdWarpFilterTest::RunCheckOutput( generate_model(mat, &alpha, &beta, &gamma, &delta); av1_highbd_warp_affine_c(mat, input, w, h, stride, output, 32, 32, - out_w, out_h, out_w, sub_x, sub_y, bd, 0, - alpha, beta, gamma, delta); + out_w, out_h, out_w, sub_x, sub_y, bd, + &conv_params, alpha, beta, gamma, delta); test_impl(mat, input, w, h, stride, output2, 32, 32, out_w, out_h, - out_w, sub_x, sub_y, bd, 0, alpha, beta, gamma, delta); + out_w, sub_x, sub_y, bd, &conv_params, alpha, beta, gamma, + delta); for (j = 0; j < out_w * out_h; ++j) ASSERT_EQ(output[j], output2[j]) diff --git a/third_party/aom/test/warp_filter_test_util.h b/third_party/aom/test/warp_filter_test_util.h index 651a9f830..4828f3785 100644 --- a/third_party/aom/test/warp_filter_test_util.h +++ b/third_party/aom/test/warp_filter_test_util.h @@ -31,8 +31,8 @@ typedef void (*warp_affine_func)(const int32_t *mat, const uint8_t *ref, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, - int ref_frm, int16_t alpha, int16_t beta, - int16_t gamma, int16_t delta); + ConvolveParams *conv_params, int16_t alpha, + int16_t beta, int16_t gamma, int16_t delta); typedef std::tr1::tuple<int, int, int, warp_affine_func> WarpTestParam; @@ -60,11 +60,14 @@ class AV1WarpFilterTest : public ::testing::TestWithParam<WarpTestParam> { #if CONFIG_HIGHBITDEPTH namespace AV1HighbdWarpFilter { -typedef void (*highbd_warp_affine_func)( - const int32_t *mat, const uint16_t *ref, int width, int height, int stride, - uint16_t *pred, int p_col, int p_row, int p_width, int p_height, - int p_stride, int subsampling_x, int subsampling_y, int bd, int ref_frm, - int16_t alpha, int16_t beta, int16_t gamma, int16_t delta); +typedef void (*highbd_warp_affine_func)(const int32_t *mat, const uint16_t *ref, + int width, int height, int stride, + uint16_t *pred, int p_col, int p_row, + int p_width, int p_height, int p_stride, + int subsampling_x, int subsampling_y, + int bd, ConvolveParams *conv_params, + int16_t alpha, int16_t beta, + int16_t gamma, int16_t delta); typedef std::tr1::tuple<int, int, int, int> HighbdWarpTestParam; |