blob: ddaeb561376171df296e76ddcaf55c4fb41fd3dd [file] [log] [blame]
James Zern0d2f3482015-05-11 19:36:59 -07001/*
Yaowu Xu9c01aa12016-09-01 14:32:49 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
James Zern0d2f3482015-05-11 19:36:59 -07003 *
Yaowu Xu9c01aa12016-09-01 14:32:49 -07004 * 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 Xuf883b422016-08-30 14:01:10 -070012// Test and time AOM intra-predictor functions
James Zern0d2f3482015-05-11 19:36:59 -070013
14#include <stdio.h>
15#include <string.h>
16
17#include "third_party/googletest/src/include/gtest/gtest.h"
18
Yaowu Xuf883b422016-08-30 14:01:10 -070019#include "./aom_dsp_rtcd.h"
James Zern0d2f3482015-05-11 19:36:59 -070020#include "test/acm_random.h"
James Zern1898d132015-06-10 12:44:07 -070021#include "test/clear_system_state.h"
James Zern0d2f3482015-05-11 19:36:59 -070022#include "test/md5_helper.h"
Yaowu Xuf883b422016-08-30 14:01:10 -070023#include "aom/aom_integer.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070024#include "aom_ports/mem.h"
Yaowu Xuf883b422016-08-30 14:01:10 -070025#include "aom_ports/aom_timer.h"
James Zern0d2f3482015-05-11 19:36:59 -070026
27// -----------------------------------------------------------------------------
28
29namespace {
30
Yaowu Xuf883b422016-08-30 14:01:10 -070031typedef void (*AvxPredFunc)(uint8_t *dst, ptrdiff_t y_stride,
James Zern0d2f3482015-05-11 19:36:59 -070032 const uint8_t *above, const uint8_t *left);
33
Urvang Joshi6be4a542016-11-03 15:24:05 -070034#if CONFIG_ALT_INTRA
35const int kNumAv1IntraFuncs = 14;
36#else
37const int kNumAv1IntraFuncs = 13;
38#endif // CONFIG_ALT_INTRA
39const char *kAv1IntraPredNames[kNumAv1IntraFuncs] = {
40 "DC_PRED", "DC_LEFT_PRED", "DC_TOP_PRED", "DC_128_PRED", "V_PRED",
41 "H_PRED", "D45_PRED", "D135_PRED", "D117_PRED", "D153_PRED",
42 "D207_PRED", "D63_PRED", "TM_PRED",
43#if CONFIG_ALT_INTRA
44 "SMOOTH_PRED"
45#endif // CONFIG_ALT_INTRA
James Zern0d2f3482015-05-11 19:36:59 -070046};
47
Yaowu Xuf883b422016-08-30 14:01:10 -070048void TestIntraPred(const char name[], AvxPredFunc const *pred_funcs,
James Zern0d2f3482015-05-11 19:36:59 -070049 const char *const pred_func_names[], int num_funcs,
50 const char *const signatures[], int block_size,
51 int num_pixels_per_test) {
Yaowu Xuc27fc142016-08-22 16:08:15 -070052 libaom_test::ACMRandom rnd(libaom_test::ACMRandom::DeterministicSeed());
James Zern0d2f3482015-05-11 19:36:59 -070053 const int kBPS = 32;
54 const int kTotalPixels = 32 * kBPS;
55 DECLARE_ALIGNED(16, uint8_t, src[kTotalPixels]);
56 DECLARE_ALIGNED(16, uint8_t, ref_src[kTotalPixels]);
57 DECLARE_ALIGNED(16, uint8_t, left[kBPS]);
58 DECLARE_ALIGNED(16, uint8_t, above_mem[2 * kBPS + 16]);
59 uint8_t *const above = above_mem + 16;
60 for (int i = 0; i < kTotalPixels; ++i) ref_src[i] = rnd.Rand8();
61 for (int i = 0; i < kBPS; ++i) left[i] = rnd.Rand8();
62 for (int i = -1; i < kBPS; ++i) above[i] = rnd.Rand8();
63 const int kNumTests = static_cast<int>(2.e10 / num_pixels_per_test);
64
65 // some code assumes the top row has been extended:
66 // d45/d63 C-code, for instance, but not the assembly.
67 // TODO(jzern): this style of extension isn't strictly necessary.
68 ASSERT_LE(block_size, kBPS);
69 memset(above + block_size, above[block_size - 1], 2 * kBPS - block_size);
70
71 for (int k = 0; k < num_funcs; ++k) {
72 if (pred_funcs[k] == NULL) continue;
73 memcpy(src, ref_src, sizeof(src));
Yaowu Xuf883b422016-08-30 14:01:10 -070074 aom_usec_timer timer;
75 aom_usec_timer_start(&timer);
James Zern0d2f3482015-05-11 19:36:59 -070076 for (int num_tests = 0; num_tests < kNumTests; ++num_tests) {
77 pred_funcs[k](src, kBPS, above, left);
78 }
Yaowu Xuc27fc142016-08-22 16:08:15 -070079 libaom_test::ClearSystemState();
Yaowu Xuf883b422016-08-30 14:01:10 -070080 aom_usec_timer_mark(&timer);
James Zern0d2f3482015-05-11 19:36:59 -070081 const int elapsed_time =
Yaowu Xuf883b422016-08-30 14:01:10 -070082 static_cast<int>(aom_usec_timer_elapsed(&timer) / 1000);
Yaowu Xuc27fc142016-08-22 16:08:15 -070083 libaom_test::MD5 md5;
James Zern0d2f3482015-05-11 19:36:59 -070084 md5.Add(src, sizeof(src));
85 printf("Mode %s[%12s]: %5d ms MD5: %s\n", name, pred_func_names[k],
86 elapsed_time, md5.Get());
87 EXPECT_STREQ(signatures[k], md5.Get());
88 }
89}
90
Yaowu Xuf883b422016-08-30 14:01:10 -070091void TestIntraPred4(AvxPredFunc const *pred_funcs) {
Yaowu Xuf883b422016-08-30 14:01:10 -070092 static const char *const kSignatures[kNumAv1IntraFuncs] = {
Urvang Joshi6be4a542016-11-03 15:24:05 -070093 "4334156168b34ab599d9b5b30f522fe9",
94 "bc4649d5ba47c7ff178d92e475960fb0",
95 "8d316e5933326dcac24e1064794b5d12",
96 "a27270fed024eafd762c95de85f4da51",
97 "c33dff000d4256c2b8f3bf9e9bab14d2",
98 "44d8cddc2ad8f79b8ed3306051722b4f",
99 "eb54839b2bad6699d8946f01ec041cd0",
100 "ecb0d56ae5f677ea45127ce9d5c058e4",
101 "0b7936841f6813da818275944895b574",
102 "9117972ef64f91a58ff73e1731c81db2",
103 "c56d5e8c729e46825f46dd5d3b5d508a",
104 "c0889e2039bcf7bcb5d2f33cdca69adc",
105#if CONFIG_ALT_INTRA
106 "828c49a4248993cce4876fa26eab697f",
107 "c106e0dc44de3d33c62b7bc0bc63c550"
108#else
James Zern0d2f3482015-05-11 19:36:59 -0700109 "309a618577b27c648f9c5ee45252bc8f",
Urvang Joshi6be4a542016-11-03 15:24:05 -0700110#endif // CONFIG_ALT_INTRA
James Zern0d2f3482015-05-11 19:36:59 -0700111 };
Yaowu Xuf883b422016-08-30 14:01:10 -0700112 TestIntraPred("Intra4", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs,
113 kSignatures, 4, 4 * 4 * kNumAv1IntraFuncs);
James Zern0d2f3482015-05-11 19:36:59 -0700114}
115
Yaowu Xuf883b422016-08-30 14:01:10 -0700116void TestIntraPred8(AvxPredFunc const *pred_funcs) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700117 static const char *const kSignatures[kNumAv1IntraFuncs] = {
Urvang Joshi6be4a542016-11-03 15:24:05 -0700118 "7694ddeeefed887faf9d339d18850928",
119 "7d726b1213591b99f736be6dec65065b",
120 "19c5711281357a485591aaf9c96c0a67",
121 "ba6b66877a089e71cd938e3b8c40caac",
122 "802440c93317e0f8ba93fab02ef74265",
123 "9e09a47a15deb0b9d8372824f9805080",
124 "b7c2d8c662268c0c427da412d7b0311d",
125 "78339c1c60bb1d67d248ab8c4da08b7f",
126 "5c97d70f7d47de1882a6cd86c165c8a9",
127 "8182bf60688b42205acd95e59e967157",
128 "08323400005a297f16d7e57e7fe1eaac",
129 "95f7bfc262329a5849eda66d8f7c68ce",
130#if CONFIG_ALT_INTRA
131 "f6ade499c626d38eb70661184b79bc57",
132 "28a52163fa8bd2216e6af1ce3113af09"
133#else
James Zern0d2f3482015-05-11 19:36:59 -0700134 "815b75c8e0d91cc1ae766dc5d3e445a3",
Urvang Joshi6be4a542016-11-03 15:24:05 -0700135#endif // CONFIG_ALT_INTRA
James Zern0d2f3482015-05-11 19:36:59 -0700136 };
Yaowu Xuf883b422016-08-30 14:01:10 -0700137 TestIntraPred("Intra8", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs,
138 kSignatures, 8, 8 * 8 * kNumAv1IntraFuncs);
James Zern0d2f3482015-05-11 19:36:59 -0700139}
140
Yaowu Xuf883b422016-08-30 14:01:10 -0700141void TestIntraPred16(AvxPredFunc const *pred_funcs) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700142 static const char *const kSignatures[kNumAv1IntraFuncs] = {
Urvang Joshi6be4a542016-11-03 15:24:05 -0700143 "b40dbb555d5d16a043dc361e6694fe53",
144 "fb08118cee3b6405d64c1fd68be878c6",
145 "6c190f341475c837cc38c2e566b64875",
146 "db5c34ccbe2c7f595d9b08b0dc2c698c",
147 "a62cbfd153a1f0b9fed13e62b8408a7a",
148 "143df5b4c89335e281103f610f5052e4",
149 "d87feb124107cdf2cfb147655aa0bb3c",
150 "7841fae7d4d47b519322e6a03eeed9dc",
151 "f6ebed3f71cbcf8d6d0516ce87e11093",
152 "3cc480297dbfeed01a1c2d78dd03d0c5",
153 "b9f69fa6532b372c545397dcb78ef311",
154 "a8fe1c70432f09d0c20c67bdb6432c4d",
155#if CONFIG_ALT_INTRA
156 "7adcaaa3554eb71a81fc48cb9043984b",
157 "3f83cda25a2c1647e1b48803922c33df"
158#else
James Zern0d2f3482015-05-11 19:36:59 -0700159 "b8a41aa968ec108af447af4217cba91b",
Urvang Joshi6be4a542016-11-03 15:24:05 -0700160#endif // CONFIG_ALT_INTRA
James Zern0d2f3482015-05-11 19:36:59 -0700161 };
Yaowu Xuf883b422016-08-30 14:01:10 -0700162 TestIntraPred("Intra16", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs,
163 kSignatures, 16, 16 * 16 * kNumAv1IntraFuncs);
James Zern0d2f3482015-05-11 19:36:59 -0700164}
165
Yaowu Xuf883b422016-08-30 14:01:10 -0700166void TestIntraPred32(AvxPredFunc const *pred_funcs) {
Yaowu Xuf883b422016-08-30 14:01:10 -0700167 static const char *const kSignatures[kNumAv1IntraFuncs] = {
Urvang Joshi6be4a542016-11-03 15:24:05 -0700168 "558541656d84f9ae7896db655826febe",
169 "b3587a1f9a01495fa38c8cd3c8e2a1bf",
170 "4c6501e64f25aacc55a2a16c7e8f0255",
171 "b3b01379ba08916ef6b1b35f7d9ad51c",
172 "0f1eb38b6cbddb3d496199ef9f329071",
173 "911c06efb9ed1c3b4c104b232b55812f",
174 "9225beb0ddfa7a1d24eaa1be430a6654",
175 "0a6d584a44f8db9aa7ade2e2fdb9fc9e",
176 "b01c9076525216925f3456f034fb6eee",
177 "d267e20ad9e5cd2915d1a47254d3d149",
178 "ed012a4a5da71f36c2393023184a0e59",
179 "f162b51ed618d28b936974cff4391da5",
180#if CONFIG_ALT_INTRA
181 "297e8fbb5d33c29b12b228fa9d7c40a4",
182 "7177dd1ae3b49441f997d439a5bd451a"
183#else
James Zern0d2f3482015-05-11 19:36:59 -0700184 "9e1370c6d42e08d357d9612c93a71cfc",
Urvang Joshi6be4a542016-11-03 15:24:05 -0700185#endif // CONFIG_ALT_INTRA
James Zern0d2f3482015-05-11 19:36:59 -0700186 };
Yaowu Xuf883b422016-08-30 14:01:10 -0700187 TestIntraPred("Intra32", pred_funcs, kAv1IntraPredNames, kNumAv1IntraFuncs,
188 kSignatures, 32, 32 * 32 * kNumAv1IntraFuncs);
James Zern0d2f3482015-05-11 19:36:59 -0700189}
190
191} // namespace
192
193// Defines a test case for |arch| (e.g., C, SSE2, ...) passing the predictors
194// to |test_func|. The test name is 'arch.test_func', e.g., C.TestIntraPred4.
Urvang Joshi6be4a542016-11-03 15:24:05 -0700195#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
196 d45, d135, d117, d153, d207, d63, tm, smooth) \
197 TEST(arch, test_func) { \
198 static const AvxPredFunc aom_intra_pred[] = { \
199 dc, dc_left, dc_top, dc_128, v, h, d45, \
200 d135, d117, d153, d207, d63, tm, smooth \
201 }; \
202 test_func(aom_intra_pred); \
James Zern0d2f3482015-05-11 19:36:59 -0700203 }
204
205// -----------------------------------------------------------------------------
206// 4x4
207
Urvang Joshi31744ec2016-09-02 15:05:28 -0700208#if CONFIG_ALT_INTRA
209#define tm_pred_func aom_paeth_predictor_4x4_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700210#define smooth_pred_func aom_smooth_predictor_4x4_c
Urvang Joshi31744ec2016-09-02 15:05:28 -0700211#else
212#define tm_pred_func aom_tm_predictor_4x4_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700213#define smooth_pred_func NULL
Urvang Joshi31744ec2016-09-02 15:05:28 -0700214#endif // CONFIG_ALT_INTRA
Urvang Joshi6be4a542016-11-03 15:24:05 -0700215
Yaowu Xuf883b422016-08-30 14:01:10 -0700216INTRA_PRED_TEST(C, TestIntraPred4, aom_dc_predictor_4x4_c,
217 aom_dc_left_predictor_4x4_c, aom_dc_top_predictor_4x4_c,
218 aom_dc_128_predictor_4x4_c, aom_v_predictor_4x4_c,
219 aom_h_predictor_4x4_c, aom_d45_predictor_4x4_c,
220 aom_d135_predictor_4x4_c, aom_d117_predictor_4x4_c,
221 aom_d153_predictor_4x4_c, aom_d207_predictor_4x4_c,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700222 aom_d63_predictor_4x4_c, tm_pred_func, smooth_pred_func)
223
Urvang Joshi31744ec2016-09-02 15:05:28 -0700224#undef tm_pred_func
Urvang Joshi6be4a542016-11-03 15:24:05 -0700225#undef smooth_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700226
Johann2967bf32016-06-22 16:08:10 -0700227#if HAVE_SSE2
Urvang Joshi31744ec2016-09-02 15:05:28 -0700228#if CONFIG_ALT_INTRA
229#define tm_pred_func NULL
230#else
231#define tm_pred_func aom_tm_predictor_4x4_sse2
232#endif // CONFIG_ALT_INTRA
Urvang Joshi6be4a542016-11-03 15:24:05 -0700233
Yaowu Xuf883b422016-08-30 14:01:10 -0700234INTRA_PRED_TEST(SSE2, TestIntraPred4, aom_dc_predictor_4x4_sse2,
235 aom_dc_left_predictor_4x4_sse2, aom_dc_top_predictor_4x4_sse2,
236 aom_dc_128_predictor_4x4_sse2, aom_v_predictor_4x4_sse2,
237 aom_h_predictor_4x4_sse2, aom_d45_predictor_4x4_sse2, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700238 NULL, NULL, aom_d207_predictor_4x4_sse2, NULL, tm_pred_func,
239 NULL)
240
Urvang Joshi31744ec2016-09-02 15:05:28 -0700241#undef tm_pred_func
Johann2967bf32016-06-22 16:08:10 -0700242#endif // HAVE_SSE2
Jian Zhou79b68622015-11-13 18:42:48 -0800243
Johann2967bf32016-06-22 16:08:10 -0700244#if HAVE_SSSE3
clang-format3a826f12016-08-11 17:46:05 -0700245INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Yaowu Xuf883b422016-08-30 14:01:10 -0700246 NULL, NULL, aom_d153_predictor_4x4_ssse3, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700247 aom_d63_predictor_4x4_ssse3, NULL, NULL)
Johann2967bf32016-06-22 16:08:10 -0700248#endif // HAVE_SSSE3
James Zern0d2f3482015-05-11 19:36:59 -0700249
250#if HAVE_DSPR2
Urvang Joshi31744ec2016-09-02 15:05:28 -0700251#if CONFIG_ALT_INTRA
252#define tm_pred_func NULL
253#else
254#define tm_pred_func aom_tm_predictor_4x4_dspr2
255#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700256INTRA_PRED_TEST(DSPR2, TestIntraPred4, aom_dc_predictor_4x4_dspr2, NULL, NULL,
257 NULL, NULL, aom_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700258 NULL, NULL, tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700259#undef tm_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700260#endif // HAVE_DSPR2
261
262#if HAVE_NEON
Urvang Joshi31744ec2016-09-02 15:05:28 -0700263#if CONFIG_ALT_INTRA
264#define tm_pred_func NULL
265#else
266#define tm_pred_func aom_tm_predictor_4x4_neon
267#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700268INTRA_PRED_TEST(NEON, TestIntraPred4, aom_dc_predictor_4x4_neon,
269 aom_dc_left_predictor_4x4_neon, aom_dc_top_predictor_4x4_neon,
270 aom_dc_128_predictor_4x4_neon, aom_v_predictor_4x4_neon,
271 aom_h_predictor_4x4_neon, aom_d45_predictor_4x4_neon,
272 aom_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700273 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700274#undef tm_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700275#endif // HAVE_NEON
276
Parag Salasakara2288d22015-06-05 17:32:34 +0530277#if HAVE_MSA
Urvang Joshi31744ec2016-09-02 15:05:28 -0700278#if CONFIG_ALT_INTRA
279#define tm_pred_func NULL
280#else
281#define tm_pred_func aom_tm_predictor_4x4_msa
282#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700283INTRA_PRED_TEST(MSA, TestIntraPred4, aom_dc_predictor_4x4_msa,
284 aom_dc_left_predictor_4x4_msa, aom_dc_top_predictor_4x4_msa,
285 aom_dc_128_predictor_4x4_msa, aom_v_predictor_4x4_msa,
286 aom_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700287 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700288#undef tm_pred_func
Parag Salasakara2288d22015-06-05 17:32:34 +0530289#endif // HAVE_MSA
290
James Zern0d2f3482015-05-11 19:36:59 -0700291// -----------------------------------------------------------------------------
292// 8x8
293
Urvang Joshi31744ec2016-09-02 15:05:28 -0700294#if CONFIG_ALT_INTRA
295#define tm_pred_func aom_paeth_predictor_8x8_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700296#define smooth_pred_func aom_smooth_predictor_8x8_c
Urvang Joshi31744ec2016-09-02 15:05:28 -0700297#else
298#define tm_pred_func aom_tm_predictor_8x8_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700299#define smooth_pred_func NULL
Urvang Joshi31744ec2016-09-02 15:05:28 -0700300#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700301INTRA_PRED_TEST(C, TestIntraPred8, aom_dc_predictor_8x8_c,
302 aom_dc_left_predictor_8x8_c, aom_dc_top_predictor_8x8_c,
303 aom_dc_128_predictor_8x8_c, aom_v_predictor_8x8_c,
304 aom_h_predictor_8x8_c, aom_d45_predictor_8x8_c,
305 aom_d135_predictor_8x8_c, aom_d117_predictor_8x8_c,
306 aom_d153_predictor_8x8_c, aom_d207_predictor_8x8_c,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700307 aom_d63_predictor_8x8_c, tm_pred_func, smooth_pred_func)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700308#undef tm_pred_func
Urvang Joshi6be4a542016-11-03 15:24:05 -0700309#undef smooth_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700310
Johann2967bf32016-06-22 16:08:10 -0700311#if HAVE_SSE2
Urvang Joshi31744ec2016-09-02 15:05:28 -0700312#if CONFIG_ALT_INTRA
313#define tm_pred_func NULL
314#else
315#define tm_pred_func aom_tm_predictor_8x8_sse2
316#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700317INTRA_PRED_TEST(SSE2, TestIntraPred8, aom_dc_predictor_8x8_sse2,
318 aom_dc_left_predictor_8x8_sse2, aom_dc_top_predictor_8x8_sse2,
319 aom_dc_128_predictor_8x8_sse2, aom_v_predictor_8x8_sse2,
320 aom_h_predictor_8x8_sse2, aom_d45_predictor_8x8_sse2, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700321 NULL, NULL, NULL, NULL, tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700322#undef tm_pred_func
Johann2967bf32016-06-22 16:08:10 -0700323#endif // HAVE_SSE2
James Zern0d2f3482015-05-11 19:36:59 -0700324
Johann2967bf32016-06-22 16:08:10 -0700325#if HAVE_SSSE3
clang-format3a826f12016-08-11 17:46:05 -0700326INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Yaowu Xuf883b422016-08-30 14:01:10 -0700327 NULL, NULL, aom_d153_predictor_8x8_ssse3,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700328 aom_d207_predictor_8x8_ssse3, aom_d63_predictor_8x8_ssse3, NULL,
329 NULL)
Johann2967bf32016-06-22 16:08:10 -0700330#endif // HAVE_SSSE3
James Zern0d2f3482015-05-11 19:36:59 -0700331
332#if HAVE_DSPR2
Urvang Joshi31744ec2016-09-02 15:05:28 -0700333#if CONFIG_ALT_INTRA
334#define tm_pred_func NULL
335#else
336#define tm_pred_func aom_tm_predictor_8x8_dspr2
337#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700338INTRA_PRED_TEST(DSPR2, TestIntraPred8, aom_dc_predictor_8x8_dspr2, NULL, NULL,
339 NULL, NULL, aom_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700340 NULL, NULL, tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700341#undef tm_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700342#endif // HAVE_DSPR2
343
344#if HAVE_NEON
Urvang Joshi31744ec2016-09-02 15:05:28 -0700345#if CONFIG_ALT_INTRA
346#define tm_pred_func NULL
347#else
348#define tm_pred_func aom_tm_predictor_8x8_neon
349#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700350INTRA_PRED_TEST(NEON, TestIntraPred8, aom_dc_predictor_8x8_neon,
351 aom_dc_left_predictor_8x8_neon, aom_dc_top_predictor_8x8_neon,
352 aom_dc_128_predictor_8x8_neon, aom_v_predictor_8x8_neon,
353 aom_h_predictor_8x8_neon, aom_d45_predictor_8x8_neon, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700354 NULL, NULL, NULL, NULL, tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700355#undef tm_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700356#endif // HAVE_NEON
357
Parag Salasakara2288d22015-06-05 17:32:34 +0530358#if HAVE_MSA
Urvang Joshi31744ec2016-09-02 15:05:28 -0700359#if CONFIG_ALT_INTRA
360#define tm_pred_func NULL
361#else
362#define tm_pred_func aom_tm_predictor_8x8_msa
363#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700364INTRA_PRED_TEST(MSA, TestIntraPred8, aom_dc_predictor_8x8_msa,
365 aom_dc_left_predictor_8x8_msa, aom_dc_top_predictor_8x8_msa,
366 aom_dc_128_predictor_8x8_msa, aom_v_predictor_8x8_msa,
367 aom_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700368 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700369#undef tm_pred_func
Parag Salasakara2288d22015-06-05 17:32:34 +0530370#endif // HAVE_MSA
371
James Zern0d2f3482015-05-11 19:36:59 -0700372// -----------------------------------------------------------------------------
373// 16x16
374
Urvang Joshi31744ec2016-09-02 15:05:28 -0700375#if CONFIG_ALT_INTRA
376#define tm_pred_func aom_paeth_predictor_16x16_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700377#define smooth_pred_func aom_smooth_predictor_16x16_c
Urvang Joshi31744ec2016-09-02 15:05:28 -0700378#else
379#define tm_pred_func aom_tm_predictor_16x16_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700380#define smooth_pred_func NULL
Urvang Joshi31744ec2016-09-02 15:05:28 -0700381#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700382INTRA_PRED_TEST(C, TestIntraPred16, aom_dc_predictor_16x16_c,
383 aom_dc_left_predictor_16x16_c, aom_dc_top_predictor_16x16_c,
384 aom_dc_128_predictor_16x16_c, aom_v_predictor_16x16_c,
385 aom_h_predictor_16x16_c, aom_d45_predictor_16x16_c,
386 aom_d135_predictor_16x16_c, aom_d117_predictor_16x16_c,
387 aom_d153_predictor_16x16_c, aom_d207_predictor_16x16_c,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700388 aom_d63_predictor_16x16_c, tm_pred_func, smooth_pred_func)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700389#undef tm_pred_func
Urvang Joshi6be4a542016-11-03 15:24:05 -0700390#undef smooth_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700391
Johann2967bf32016-06-22 16:08:10 -0700392#if HAVE_SSE2
Urvang Joshi31744ec2016-09-02 15:05:28 -0700393#if CONFIG_ALT_INTRA
394#define tm_pred_func NULL
395#else
396#define tm_pred_func aom_tm_predictor_16x16_sse2
397#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700398INTRA_PRED_TEST(SSE2, TestIntraPred16, aom_dc_predictor_16x16_sse2,
399 aom_dc_left_predictor_16x16_sse2,
400 aom_dc_top_predictor_16x16_sse2,
401 aom_dc_128_predictor_16x16_sse2, aom_v_predictor_16x16_sse2,
402 aom_h_predictor_16x16_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700403 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700404#undef tm_pred_func
Johann2967bf32016-06-22 16:08:10 -0700405#endif // HAVE_SSE2
James Zern0d2f3482015-05-11 19:36:59 -0700406
Johann2967bf32016-06-22 16:08:10 -0700407#if HAVE_SSSE3
clang-format3a826f12016-08-11 17:46:05 -0700408INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL, NULL,
Yaowu Xuf883b422016-08-30 14:01:10 -0700409 aom_d45_predictor_16x16_ssse3, NULL, NULL,
410 aom_d153_predictor_16x16_ssse3, aom_d207_predictor_16x16_ssse3,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700411 aom_d63_predictor_16x16_ssse3, NULL, NULL)
Johann2967bf32016-06-22 16:08:10 -0700412#endif // HAVE_SSSE3
James Zern0d2f3482015-05-11 19:36:59 -0700413
414#if HAVE_DSPR2
Yaowu Xuf883b422016-08-30 14:01:10 -0700415INTRA_PRED_TEST(DSPR2, TestIntraPred16, aom_dc_predictor_16x16_dspr2, NULL,
416 NULL, NULL, NULL, aom_h_predictor_16x16_dspr2, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700417 NULL, NULL, NULL, NULL, NULL)
James Zern0d2f3482015-05-11 19:36:59 -0700418#endif // HAVE_DSPR2
419
420#if HAVE_NEON
Urvang Joshi31744ec2016-09-02 15:05:28 -0700421#if CONFIG_ALT_INTRA
422#define tm_pred_func NULL
423#else
424#define tm_pred_func aom_tm_predictor_16x16_neon
425#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700426INTRA_PRED_TEST(NEON, TestIntraPred16, aom_dc_predictor_16x16_neon,
427 aom_dc_left_predictor_16x16_neon,
428 aom_dc_top_predictor_16x16_neon,
429 aom_dc_128_predictor_16x16_neon, aom_v_predictor_16x16_neon,
430 aom_h_predictor_16x16_neon, aom_d45_predictor_16x16_neon, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700431 NULL, NULL, NULL, NULL, tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700432#undef tm_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700433#endif // HAVE_NEON
434
Parag Salasakara2288d22015-06-05 17:32:34 +0530435#if HAVE_MSA
Urvang Joshi31744ec2016-09-02 15:05:28 -0700436#if CONFIG_ALT_INTRA
437#define tm_pred_func NULL
438#else
439#define tm_pred_func aom_tm_predictor_16x16_msa
440#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700441INTRA_PRED_TEST(MSA, TestIntraPred16, aom_dc_predictor_16x16_msa,
442 aom_dc_left_predictor_16x16_msa, aom_dc_top_predictor_16x16_msa,
443 aom_dc_128_predictor_16x16_msa, aom_v_predictor_16x16_msa,
444 aom_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700445 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700446#undef tm_pred_func
Parag Salasakara2288d22015-06-05 17:32:34 +0530447#endif // HAVE_MSA
448
James Zern0d2f3482015-05-11 19:36:59 -0700449// -----------------------------------------------------------------------------
450// 32x32
451
Urvang Joshi31744ec2016-09-02 15:05:28 -0700452#if CONFIG_ALT_INTRA
453#define tm_pred_func aom_paeth_predictor_32x32_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700454#define smooth_pred_func aom_smooth_predictor_32x32_c
Urvang Joshi31744ec2016-09-02 15:05:28 -0700455#else
456#define tm_pred_func aom_tm_predictor_32x32_c
Urvang Joshi6be4a542016-11-03 15:24:05 -0700457#define smooth_pred_func NULL
Urvang Joshi31744ec2016-09-02 15:05:28 -0700458#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700459INTRA_PRED_TEST(C, TestIntraPred32, aom_dc_predictor_32x32_c,
460 aom_dc_left_predictor_32x32_c, aom_dc_top_predictor_32x32_c,
461 aom_dc_128_predictor_32x32_c, aom_v_predictor_32x32_c,
462 aom_h_predictor_32x32_c, aom_d45_predictor_32x32_c,
463 aom_d135_predictor_32x32_c, aom_d117_predictor_32x32_c,
464 aom_d153_predictor_32x32_c, aom_d207_predictor_32x32_c,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700465 aom_d63_predictor_32x32_c, tm_pred_func, smooth_pred_func)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700466#undef tm_pred_func
Urvang Joshi6be4a542016-11-03 15:24:05 -0700467#undef smooth_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700468
Johann2967bf32016-06-22 16:08:10 -0700469#if HAVE_SSE2
Urvang Joshi31744ec2016-09-02 15:05:28 -0700470#if CONFIG_ALT_INTRA
471#define tm_pred_func NULL
472#else
473#define tm_pred_func aom_tm_predictor_32x32_sse2
474#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700475INTRA_PRED_TEST(SSE2, TestIntraPred32, aom_dc_predictor_32x32_sse2,
476 aom_dc_left_predictor_32x32_sse2,
477 aom_dc_top_predictor_32x32_sse2,
478 aom_dc_128_predictor_32x32_sse2, aom_v_predictor_32x32_sse2,
479 aom_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700480 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700481#undef tm_pred_func
Johann2967bf32016-06-22 16:08:10 -0700482#endif // HAVE_SSE2
James Zern0d2f3482015-05-11 19:36:59 -0700483
Johann2967bf32016-06-22 16:08:10 -0700484#if HAVE_SSSE3
clang-format3a826f12016-08-11 17:46:05 -0700485INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL, NULL,
Yaowu Xuf883b422016-08-30 14:01:10 -0700486 aom_d45_predictor_32x32_ssse3, NULL, NULL,
487 aom_d153_predictor_32x32_ssse3, aom_d207_predictor_32x32_ssse3,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700488 aom_d63_predictor_32x32_ssse3, NULL, NULL)
Johann2967bf32016-06-22 16:08:10 -0700489#endif // HAVE_SSSE3
James Zern0d2f3482015-05-11 19:36:59 -0700490
491#if HAVE_NEON
Urvang Joshi31744ec2016-09-02 15:05:28 -0700492#if CONFIG_ALT_INTRA
493#define tm_pred_func NULL
494#else
495#define tm_pred_func aom_tm_predictor_32x32_neon
496#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700497INTRA_PRED_TEST(NEON, TestIntraPred32, aom_dc_predictor_32x32_neon,
498 aom_dc_left_predictor_32x32_neon,
499 aom_dc_top_predictor_32x32_neon,
500 aom_dc_128_predictor_32x32_neon, aom_v_predictor_32x32_neon,
501 aom_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700502 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700503#undef tm_pred_func
James Zern0d2f3482015-05-11 19:36:59 -0700504#endif // HAVE_NEON
505
Parag Salasakara2288d22015-06-05 17:32:34 +0530506#if HAVE_MSA
Urvang Joshi31744ec2016-09-02 15:05:28 -0700507#if CONFIG_ALT_INTRA
508#define tm_pred_func NULL
509#else
510#define tm_pred_func aom_tm_predictor_32x32_msa
511#endif // CONFIG_ALT_INTRA
Yaowu Xuf883b422016-08-30 14:01:10 -0700512INTRA_PRED_TEST(MSA, TestIntraPred32, aom_dc_predictor_32x32_msa,
513 aom_dc_left_predictor_32x32_msa, aom_dc_top_predictor_32x32_msa,
514 aom_dc_128_predictor_32x32_msa, aom_v_predictor_32x32_msa,
515 aom_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL, NULL,
Urvang Joshi6be4a542016-11-03 15:24:05 -0700516 tm_pred_func, NULL)
Urvang Joshi31744ec2016-09-02 15:05:28 -0700517#undef tm_pred_func
Parag Salasakara2288d22015-06-05 17:32:34 +0530518#endif // HAVE_MSA
519
Yaowu Xuf883b422016-08-30 14:01:10 -0700520#include "test/test_libaom.cc"