James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | */ |
| 11 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 12 | // Test and time AOM intra-predictor functions |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 13 | |
| 14 | #include <stdio.h> |
| 15 | #include <string.h> |
| 16 | |
| 17 | #include "third_party/googletest/src/include/gtest/gtest.h" |
| 18 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 19 | #include "./aom_dsp_rtcd.h" |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 20 | #include "test/acm_random.h" |
James Zern | 1898d13 | 2015-06-10 12:44:07 -0700 | [diff] [blame] | 21 | #include "test/clear_system_state.h" |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 22 | #include "test/md5_helper.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 23 | #include "aom/aom_integer.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 24 | #include "aom_ports/mem.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 25 | #include "aom_ports/aom_timer.h" |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 26 | |
| 27 | // ----------------------------------------------------------------------------- |
| 28 | |
| 29 | namespace { |
| 30 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 31 | typedef void (*AvxPredFunc)(uint8_t *dst, ptrdiff_t y_stride, |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 32 | const uint8_t *above, const uint8_t *left); |
| 33 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 34 | const int kNumAv1IntraPredFuncs = 13; |
| 35 | const char *kAv1IntraPredNames[kNumAv1IntraPredFuncs] = { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 36 | "DC_PRED", "DC_LEFT_PRED", "DC_TOP_PRED", "DC_128_PRED", "V_PRED", |
| 37 | "H_PRED", "D45_PRED", "D135_PRED", "D117_PRED", "D153_PRED", |
| 38 | "D207_PRED", "D63_PRED", "TM_PRED" |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 39 | }; |
| 40 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 41 | void TestIntraPred(const char name[], AvxPredFunc const *pred_funcs, |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 42 | const char *const pred_func_names[], int num_funcs, |
| 43 | const char *const signatures[], int block_size, |
| 44 | int num_pixels_per_test) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 45 | libaom_test::ACMRandom rnd(libaom_test::ACMRandom::DeterministicSeed()); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 46 | const int kBPS = 32; |
| 47 | const int kTotalPixels = 32 * kBPS; |
| 48 | DECLARE_ALIGNED(16, uint8_t, src[kTotalPixels]); |
| 49 | DECLARE_ALIGNED(16, uint8_t, ref_src[kTotalPixels]); |
| 50 | DECLARE_ALIGNED(16, uint8_t, left[kBPS]); |
| 51 | DECLARE_ALIGNED(16, uint8_t, above_mem[2 * kBPS + 16]); |
| 52 | uint8_t *const above = above_mem + 16; |
| 53 | for (int i = 0; i < kTotalPixels; ++i) ref_src[i] = rnd.Rand8(); |
| 54 | for (int i = 0; i < kBPS; ++i) left[i] = rnd.Rand8(); |
| 55 | for (int i = -1; i < kBPS; ++i) above[i] = rnd.Rand8(); |
| 56 | const int kNumTests = static_cast<int>(2.e10 / num_pixels_per_test); |
| 57 | |
| 58 | // some code assumes the top row has been extended: |
| 59 | // d45/d63 C-code, for instance, but not the assembly. |
| 60 | // TODO(jzern): this style of extension isn't strictly necessary. |
| 61 | ASSERT_LE(block_size, kBPS); |
| 62 | memset(above + block_size, above[block_size - 1], 2 * kBPS - block_size); |
| 63 | |
| 64 | for (int k = 0; k < num_funcs; ++k) { |
| 65 | if (pred_funcs[k] == NULL) continue; |
| 66 | memcpy(src, ref_src, sizeof(src)); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 67 | aom_usec_timer timer; |
| 68 | aom_usec_timer_start(&timer); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 69 | for (int num_tests = 0; num_tests < kNumTests; ++num_tests) { |
| 70 | pred_funcs[k](src, kBPS, above, left); |
| 71 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 72 | libaom_test::ClearSystemState(); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 73 | aom_usec_timer_mark(&timer); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 74 | const int elapsed_time = |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 75 | static_cast<int>(aom_usec_timer_elapsed(&timer) / 1000); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 76 | libaom_test::MD5 md5; |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 77 | md5.Add(src, sizeof(src)); |
| 78 | printf("Mode %s[%12s]: %5d ms MD5: %s\n", name, pred_func_names[k], |
| 79 | elapsed_time, md5.Get()); |
| 80 | EXPECT_STREQ(signatures[k], md5.Get()); |
| 81 | } |
| 82 | } |
| 83 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 84 | void TestIntraPred4(AvxPredFunc const *pred_funcs) { |
| 85 | static const int kNumAv1IntraFuncs = 13; |
| 86 | static const char *const kSignatures[kNumAv1IntraFuncs] = { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 87 | "4334156168b34ab599d9b5b30f522fe9", "bc4649d5ba47c7ff178d92e475960fb0", |
| 88 | "8d316e5933326dcac24e1064794b5d12", "a27270fed024eafd762c95de85f4da51", |
| 89 | "c33dff000d4256c2b8f3bf9e9bab14d2", "44d8cddc2ad8f79b8ed3306051722b4f", |
| 90 | "eb54839b2bad6699d8946f01ec041cd0", "ecb0d56ae5f677ea45127ce9d5c058e4", |
| 91 | "0b7936841f6813da818275944895b574", "9117972ef64f91a58ff73e1731c81db2", |
| 92 | "c56d5e8c729e46825f46dd5d3b5d508a", "c0889e2039bcf7bcb5d2f33cdca69adc", |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 93 | "309a618577b27c648f9c5ee45252bc8f", |
| 94 | }; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 95 | TestIntraPred("Intra4", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs, |
| 96 | kSignatures, 4, 4 * 4 * kNumAv1IntraFuncs); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 97 | } |
| 98 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 99 | void TestIntraPred8(AvxPredFunc const *pred_funcs) { |
| 100 | static const int kNumAv1IntraFuncs = 13; |
| 101 | static const char *const kSignatures[kNumAv1IntraFuncs] = { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 102 | "7694ddeeefed887faf9d339d18850928", "7d726b1213591b99f736be6dec65065b", |
| 103 | "19c5711281357a485591aaf9c96c0a67", "ba6b66877a089e71cd938e3b8c40caac", |
| 104 | "802440c93317e0f8ba93fab02ef74265", "9e09a47a15deb0b9d8372824f9805080", |
| 105 | "b7c2d8c662268c0c427da412d7b0311d", "78339c1c60bb1d67d248ab8c4da08b7f", |
| 106 | "5c97d70f7d47de1882a6cd86c165c8a9", "8182bf60688b42205acd95e59e967157", |
| 107 | "08323400005a297f16d7e57e7fe1eaac", "95f7bfc262329a5849eda66d8f7c68ce", |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 108 | "815b75c8e0d91cc1ae766dc5d3e445a3", |
| 109 | }; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 110 | TestIntraPred("Intra8", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs, |
| 111 | kSignatures, 8, 8 * 8 * kNumAv1IntraFuncs); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 114 | void TestIntraPred16(AvxPredFunc const *pred_funcs) { |
| 115 | static const int kNumAv1IntraFuncs = 13; |
| 116 | static const char *const kSignatures[kNumAv1IntraFuncs] = { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 117 | "b40dbb555d5d16a043dc361e6694fe53", "fb08118cee3b6405d64c1fd68be878c6", |
| 118 | "6c190f341475c837cc38c2e566b64875", "db5c34ccbe2c7f595d9b08b0dc2c698c", |
| 119 | "a62cbfd153a1f0b9fed13e62b8408a7a", "143df5b4c89335e281103f610f5052e4", |
| 120 | "d87feb124107cdf2cfb147655aa0bb3c", "7841fae7d4d47b519322e6a03eeed9dc", |
| 121 | "f6ebed3f71cbcf8d6d0516ce87e11093", "3cc480297dbfeed01a1c2d78dd03d0c5", |
| 122 | "b9f69fa6532b372c545397dcb78ef311", "a8fe1c70432f09d0c20c67bdb6432c4d", |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 123 | "b8a41aa968ec108af447af4217cba91b", |
| 124 | }; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 125 | TestIntraPred("Intra16", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs, |
| 126 | kSignatures, 16, 16 * 16 * kNumAv1IntraFuncs); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 127 | } |
| 128 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 129 | void TestIntraPred32(AvxPredFunc const *pred_funcs) { |
| 130 | static const int kNumAv1IntraFuncs = 13; |
| 131 | static const char *const kSignatures[kNumAv1IntraFuncs] = { |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 132 | "558541656d84f9ae7896db655826febe", "b3587a1f9a01495fa38c8cd3c8e2a1bf", |
| 133 | "4c6501e64f25aacc55a2a16c7e8f0255", "b3b01379ba08916ef6b1b35f7d9ad51c", |
| 134 | "0f1eb38b6cbddb3d496199ef9f329071", "911c06efb9ed1c3b4c104b232b55812f", |
| 135 | "9225beb0ddfa7a1d24eaa1be430a6654", "0a6d584a44f8db9aa7ade2e2fdb9fc9e", |
| 136 | "b01c9076525216925f3456f034fb6eee", "d267e20ad9e5cd2915d1a47254d3d149", |
| 137 | "ed012a4a5da71f36c2393023184a0e59", "f162b51ed618d28b936974cff4391da5", |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 138 | "9e1370c6d42e08d357d9612c93a71cfc", |
| 139 | }; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 140 | TestIntraPred("Intra32", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs, |
| 141 | kSignatures, 32, 32 * 32 * kNumAv1IntraFuncs); |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | } // namespace |
| 145 | |
| 146 | // Defines a test case for |arch| (e.g., C, SSE2, ...) passing the predictors |
| 147 | // to |test_func|. The test name is 'arch.test_func', e.g., C.TestIntraPred4. |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 148 | #define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \ |
| 149 | d45, d135, d117, d153, d207, d63, tm) \ |
| 150 | TEST(arch, test_func) { \ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 151 | static const AvxPredFunc aom_intra_pred[] = { \ |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 152 | dc, dc_left, dc_top, dc_128, v, h, d45, d135, d117, d153, d207, d63, tm \ |
| 153 | }; \ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 154 | test_func(aom_intra_pred); \ |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | // ----------------------------------------------------------------------------- |
| 158 | // 4x4 |
| 159 | |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 160 | #if CONFIG_ALT_INTRA |
| 161 | #define tm_pred_func aom_paeth_predictor_4x4_c |
| 162 | #else |
| 163 | #define tm_pred_func aom_tm_predictor_4x4_c |
| 164 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 165 | INTRA_PRED_TEST(C, TestIntraPred4, aom_dc_predictor_4x4_c, |
| 166 | aom_dc_left_predictor_4x4_c, aom_dc_top_predictor_4x4_c, |
| 167 | aom_dc_128_predictor_4x4_c, aom_v_predictor_4x4_c, |
| 168 | aom_h_predictor_4x4_c, aom_d45_predictor_4x4_c, |
| 169 | aom_d135_predictor_4x4_c, aom_d117_predictor_4x4_c, |
| 170 | aom_d153_predictor_4x4_c, aom_d207_predictor_4x4_c, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 171 | aom_d63_predictor_4x4_c, tm_pred_func) |
| 172 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 173 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 174 | #if HAVE_SSE2 |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 175 | #if CONFIG_ALT_INTRA |
| 176 | #define tm_pred_func NULL |
| 177 | #else |
| 178 | #define tm_pred_func aom_tm_predictor_4x4_sse2 |
| 179 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 180 | INTRA_PRED_TEST(SSE2, TestIntraPred4, aom_dc_predictor_4x4_sse2, |
| 181 | aom_dc_left_predictor_4x4_sse2, aom_dc_top_predictor_4x4_sse2, |
| 182 | aom_dc_128_predictor_4x4_sse2, aom_v_predictor_4x4_sse2, |
| 183 | aom_h_predictor_4x4_sse2, aom_d45_predictor_4x4_sse2, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 184 | NULL, NULL, aom_d207_predictor_4x4_sse2, NULL, tm_pred_func) |
| 185 | #undef tm_pred_func |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 186 | #endif // HAVE_SSE2 |
Jian Zhou | 79b6862 | 2015-11-13 18:42:48 -0800 | [diff] [blame] | 187 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 188 | #if HAVE_SSSE3 |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 189 | INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 190 | NULL, NULL, aom_d153_predictor_4x4_ssse3, NULL, |
| 191 | aom_d63_predictor_4x4_ssse3, NULL) |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 192 | #endif // HAVE_SSSE3 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 193 | |
| 194 | #if HAVE_DSPR2 |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 195 | #if CONFIG_ALT_INTRA |
| 196 | #define tm_pred_func NULL |
| 197 | #else |
| 198 | #define tm_pred_func aom_tm_predictor_4x4_dspr2 |
| 199 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 200 | INTRA_PRED_TEST(DSPR2, TestIntraPred4, aom_dc_predictor_4x4_dspr2, NULL, NULL, |
| 201 | NULL, NULL, aom_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 202 | NULL, NULL, tm_pred_func) |
| 203 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 204 | #endif // HAVE_DSPR2 |
| 205 | |
| 206 | #if HAVE_NEON |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 207 | #if CONFIG_ALT_INTRA |
| 208 | #define tm_pred_func NULL |
| 209 | #else |
| 210 | #define tm_pred_func aom_tm_predictor_4x4_neon |
| 211 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 212 | INTRA_PRED_TEST(NEON, TestIntraPred4, aom_dc_predictor_4x4_neon, |
| 213 | aom_dc_left_predictor_4x4_neon, aom_dc_top_predictor_4x4_neon, |
| 214 | aom_dc_128_predictor_4x4_neon, aom_v_predictor_4x4_neon, |
| 215 | aom_h_predictor_4x4_neon, aom_d45_predictor_4x4_neon, |
| 216 | aom_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 217 | tm_pred_func) |
| 218 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 219 | #endif // HAVE_NEON |
| 220 | |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 221 | #if HAVE_MSA |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 222 | #if CONFIG_ALT_INTRA |
| 223 | #define tm_pred_func NULL |
| 224 | #else |
| 225 | #define tm_pred_func aom_tm_predictor_4x4_msa |
| 226 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 227 | INTRA_PRED_TEST(MSA, TestIntraPred4, aom_dc_predictor_4x4_msa, |
| 228 | aom_dc_left_predictor_4x4_msa, aom_dc_top_predictor_4x4_msa, |
| 229 | aom_dc_128_predictor_4x4_msa, aom_v_predictor_4x4_msa, |
| 230 | aom_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 231 | tm_pred_func) |
| 232 | #undef tm_pred_func |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 233 | #endif // HAVE_MSA |
| 234 | |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 235 | // ----------------------------------------------------------------------------- |
| 236 | // 8x8 |
| 237 | |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 238 | #if CONFIG_ALT_INTRA |
| 239 | #define tm_pred_func aom_paeth_predictor_8x8_c |
| 240 | #else |
| 241 | #define tm_pred_func aom_tm_predictor_8x8_c |
| 242 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 243 | INTRA_PRED_TEST(C, TestIntraPred8, aom_dc_predictor_8x8_c, |
| 244 | aom_dc_left_predictor_8x8_c, aom_dc_top_predictor_8x8_c, |
| 245 | aom_dc_128_predictor_8x8_c, aom_v_predictor_8x8_c, |
| 246 | aom_h_predictor_8x8_c, aom_d45_predictor_8x8_c, |
| 247 | aom_d135_predictor_8x8_c, aom_d117_predictor_8x8_c, |
| 248 | aom_d153_predictor_8x8_c, aom_d207_predictor_8x8_c, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 249 | aom_d63_predictor_8x8_c, tm_pred_func) |
| 250 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 251 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 252 | #if HAVE_SSE2 |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 253 | #if CONFIG_ALT_INTRA |
| 254 | #define tm_pred_func NULL |
| 255 | #else |
| 256 | #define tm_pred_func aom_tm_predictor_8x8_sse2 |
| 257 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 258 | INTRA_PRED_TEST(SSE2, TestIntraPred8, aom_dc_predictor_8x8_sse2, |
| 259 | aom_dc_left_predictor_8x8_sse2, aom_dc_top_predictor_8x8_sse2, |
| 260 | aom_dc_128_predictor_8x8_sse2, aom_v_predictor_8x8_sse2, |
| 261 | aom_h_predictor_8x8_sse2, aom_d45_predictor_8x8_sse2, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 262 | NULL, NULL, NULL, NULL, tm_pred_func) |
| 263 | #undef tm_pred_func |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 264 | #endif // HAVE_SSE2 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 265 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 266 | #if HAVE_SSSE3 |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 267 | INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 268 | NULL, NULL, aom_d153_predictor_8x8_ssse3, |
| 269 | aom_d207_predictor_8x8_ssse3, aom_d63_predictor_8x8_ssse3, NULL) |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 270 | #endif // HAVE_SSSE3 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 271 | |
| 272 | #if HAVE_DSPR2 |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 273 | #if CONFIG_ALT_INTRA |
| 274 | #define tm_pred_func NULL |
| 275 | #else |
| 276 | #define tm_pred_func aom_tm_predictor_8x8_dspr2 |
| 277 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 278 | INTRA_PRED_TEST(DSPR2, TestIntraPred8, aom_dc_predictor_8x8_dspr2, NULL, NULL, |
| 279 | NULL, NULL, aom_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 280 | NULL, NULL, tm_pred_func) |
| 281 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 282 | #endif // HAVE_DSPR2 |
| 283 | |
| 284 | #if HAVE_NEON |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 285 | #if CONFIG_ALT_INTRA |
| 286 | #define tm_pred_func NULL |
| 287 | #else |
| 288 | #define tm_pred_func aom_tm_predictor_8x8_neon |
| 289 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 290 | INTRA_PRED_TEST(NEON, TestIntraPred8, aom_dc_predictor_8x8_neon, |
| 291 | aom_dc_left_predictor_8x8_neon, aom_dc_top_predictor_8x8_neon, |
| 292 | aom_dc_128_predictor_8x8_neon, aom_v_predictor_8x8_neon, |
| 293 | aom_h_predictor_8x8_neon, aom_d45_predictor_8x8_neon, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 294 | NULL, NULL, NULL, NULL, tm_pred_func) |
| 295 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 296 | #endif // HAVE_NEON |
| 297 | |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 298 | #if HAVE_MSA |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 299 | #if CONFIG_ALT_INTRA |
| 300 | #define tm_pred_func NULL |
| 301 | #else |
| 302 | #define tm_pred_func aom_tm_predictor_8x8_msa |
| 303 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 304 | INTRA_PRED_TEST(MSA, TestIntraPred8, aom_dc_predictor_8x8_msa, |
| 305 | aom_dc_left_predictor_8x8_msa, aom_dc_top_predictor_8x8_msa, |
| 306 | aom_dc_128_predictor_8x8_msa, aom_v_predictor_8x8_msa, |
| 307 | aom_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 308 | tm_pred_func) |
| 309 | #undef tm_pred_func |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 310 | #endif // HAVE_MSA |
| 311 | |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 312 | // ----------------------------------------------------------------------------- |
| 313 | // 16x16 |
| 314 | |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 315 | #if CONFIG_ALT_INTRA |
| 316 | #define tm_pred_func aom_paeth_predictor_16x16_c |
| 317 | #else |
| 318 | #define tm_pred_func aom_tm_predictor_16x16_c |
| 319 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 320 | INTRA_PRED_TEST(C, TestIntraPred16, aom_dc_predictor_16x16_c, |
| 321 | aom_dc_left_predictor_16x16_c, aom_dc_top_predictor_16x16_c, |
| 322 | aom_dc_128_predictor_16x16_c, aom_v_predictor_16x16_c, |
| 323 | aom_h_predictor_16x16_c, aom_d45_predictor_16x16_c, |
| 324 | aom_d135_predictor_16x16_c, aom_d117_predictor_16x16_c, |
| 325 | aom_d153_predictor_16x16_c, aom_d207_predictor_16x16_c, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 326 | aom_d63_predictor_16x16_c, tm_pred_func) |
| 327 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 328 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 329 | #if HAVE_SSE2 |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 330 | #if CONFIG_ALT_INTRA |
| 331 | #define tm_pred_func NULL |
| 332 | #else |
| 333 | #define tm_pred_func aom_tm_predictor_16x16_sse2 |
| 334 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 335 | INTRA_PRED_TEST(SSE2, TestIntraPred16, aom_dc_predictor_16x16_sse2, |
| 336 | aom_dc_left_predictor_16x16_sse2, |
| 337 | aom_dc_top_predictor_16x16_sse2, |
| 338 | aom_dc_128_predictor_16x16_sse2, aom_v_predictor_16x16_sse2, |
| 339 | aom_h_predictor_16x16_sse2, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 340 | tm_pred_func) |
| 341 | #undef tm_pred_func |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 342 | #endif // HAVE_SSE2 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 343 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 344 | #if HAVE_SSSE3 |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 345 | INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL, NULL, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 346 | aom_d45_predictor_16x16_ssse3, NULL, NULL, |
| 347 | aom_d153_predictor_16x16_ssse3, aom_d207_predictor_16x16_ssse3, |
| 348 | aom_d63_predictor_16x16_ssse3, NULL) |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 349 | #endif // HAVE_SSSE3 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 350 | |
| 351 | #if HAVE_DSPR2 |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 352 | INTRA_PRED_TEST(DSPR2, TestIntraPred16, aom_dc_predictor_16x16_dspr2, NULL, |
| 353 | NULL, NULL, NULL, aom_h_predictor_16x16_dspr2, NULL, NULL, NULL, |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 354 | NULL, NULL, NULL, NULL) |
| 355 | #endif // HAVE_DSPR2 |
| 356 | |
| 357 | #if HAVE_NEON |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 358 | #if CONFIG_ALT_INTRA |
| 359 | #define tm_pred_func NULL |
| 360 | #else |
| 361 | #define tm_pred_func aom_tm_predictor_16x16_neon |
| 362 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 363 | INTRA_PRED_TEST(NEON, TestIntraPred16, aom_dc_predictor_16x16_neon, |
| 364 | aom_dc_left_predictor_16x16_neon, |
| 365 | aom_dc_top_predictor_16x16_neon, |
| 366 | aom_dc_128_predictor_16x16_neon, aom_v_predictor_16x16_neon, |
| 367 | aom_h_predictor_16x16_neon, aom_d45_predictor_16x16_neon, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 368 | NULL, NULL, NULL, NULL, tm_pred_func) |
| 369 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 370 | #endif // HAVE_NEON |
| 371 | |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 372 | #if HAVE_MSA |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 373 | #if CONFIG_ALT_INTRA |
| 374 | #define tm_pred_func NULL |
| 375 | #else |
| 376 | #define tm_pred_func aom_tm_predictor_16x16_msa |
| 377 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 378 | INTRA_PRED_TEST(MSA, TestIntraPred16, aom_dc_predictor_16x16_msa, |
| 379 | aom_dc_left_predictor_16x16_msa, aom_dc_top_predictor_16x16_msa, |
| 380 | aom_dc_128_predictor_16x16_msa, aom_v_predictor_16x16_msa, |
| 381 | aom_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 382 | tm_pred_func) |
| 383 | #undef tm_pred_func |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 384 | #endif // HAVE_MSA |
| 385 | |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 386 | // ----------------------------------------------------------------------------- |
| 387 | // 32x32 |
| 388 | |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 389 | #if CONFIG_ALT_INTRA |
| 390 | #define tm_pred_func aom_paeth_predictor_32x32_c |
| 391 | #else |
| 392 | #define tm_pred_func aom_tm_predictor_32x32_c |
| 393 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 394 | INTRA_PRED_TEST(C, TestIntraPred32, aom_dc_predictor_32x32_c, |
| 395 | aom_dc_left_predictor_32x32_c, aom_dc_top_predictor_32x32_c, |
| 396 | aom_dc_128_predictor_32x32_c, aom_v_predictor_32x32_c, |
| 397 | aom_h_predictor_32x32_c, aom_d45_predictor_32x32_c, |
| 398 | aom_d135_predictor_32x32_c, aom_d117_predictor_32x32_c, |
| 399 | aom_d153_predictor_32x32_c, aom_d207_predictor_32x32_c, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 400 | aom_d63_predictor_32x32_c, tm_pred_func) |
| 401 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 402 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 403 | #if HAVE_SSE2 |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 404 | #if CONFIG_ALT_INTRA |
| 405 | #define tm_pred_func NULL |
| 406 | #else |
| 407 | #define tm_pred_func aom_tm_predictor_32x32_sse2 |
| 408 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 409 | INTRA_PRED_TEST(SSE2, TestIntraPred32, aom_dc_predictor_32x32_sse2, |
| 410 | aom_dc_left_predictor_32x32_sse2, |
| 411 | aom_dc_top_predictor_32x32_sse2, |
| 412 | aom_dc_128_predictor_32x32_sse2, aom_v_predictor_32x32_sse2, |
| 413 | aom_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 414 | tm_pred_func) |
| 415 | #undef tm_pred_func |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 416 | #endif // HAVE_SSE2 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 417 | |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 418 | #if HAVE_SSSE3 |
clang-format | 3a826f1 | 2016-08-11 17:46:05 -0700 | [diff] [blame] | 419 | INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL, NULL, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 420 | aom_d45_predictor_32x32_ssse3, NULL, NULL, |
| 421 | aom_d153_predictor_32x32_ssse3, aom_d207_predictor_32x32_ssse3, |
| 422 | aom_d63_predictor_32x32_ssse3, NULL) |
Johann | 2967bf3 | 2016-06-22 16:08:10 -0700 | [diff] [blame] | 423 | #endif // HAVE_SSSE3 |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 424 | |
| 425 | #if HAVE_NEON |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 426 | #if CONFIG_ALT_INTRA |
| 427 | #define tm_pred_func NULL |
| 428 | #else |
| 429 | #define tm_pred_func aom_tm_predictor_32x32_neon |
| 430 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 431 | INTRA_PRED_TEST(NEON, TestIntraPred32, aom_dc_predictor_32x32_neon, |
| 432 | aom_dc_left_predictor_32x32_neon, |
| 433 | aom_dc_top_predictor_32x32_neon, |
| 434 | aom_dc_128_predictor_32x32_neon, aom_v_predictor_32x32_neon, |
| 435 | aom_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 436 | tm_pred_func) |
| 437 | #undef tm_pred_func |
James Zern | 0d2f348 | 2015-05-11 19:36:59 -0700 | [diff] [blame] | 438 | #endif // HAVE_NEON |
| 439 | |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 440 | #if HAVE_MSA |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 441 | #if CONFIG_ALT_INTRA |
| 442 | #define tm_pred_func NULL |
| 443 | #else |
| 444 | #define tm_pred_func aom_tm_predictor_32x32_msa |
| 445 | #endif // CONFIG_ALT_INTRA |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 446 | INTRA_PRED_TEST(MSA, TestIntraPred32, aom_dc_predictor_32x32_msa, |
| 447 | aom_dc_left_predictor_32x32_msa, aom_dc_top_predictor_32x32_msa, |
| 448 | aom_dc_128_predictor_32x32_msa, aom_v_predictor_32x32_msa, |
| 449 | aom_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL, NULL, |
Urvang Joshi | 31744ec | 2016-09-02 15:05:28 -0700 | [diff] [blame] | 450 | tm_pred_func) |
| 451 | #undef tm_pred_func |
Parag Salasakar | a2288d2 | 2015-06-05 17:32:34 +0530 | [diff] [blame] | 452 | #endif // HAVE_MSA |
| 453 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 454 | #include "test/test_libaom.cc" |