Commit | Line | Data |
---|---|---|
72b9787e JB |
1 | /***************************************************************************** |
2 | * Copyright (C) 2013 x265 project | |
3 | * | |
4 | * Authors: Deepthi Devaki <deepthidevaki@multicorewareinc.com>, | |
5 | * Rajesh Paulraj <rajesh@multicorewareinc.com> | |
6 | * Praveen Kumar Tiwari <praveen@multicorewareinc.com> | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. | |
21 | * | |
22 | * This program is also available under a commercial proprietary license. | |
23 | * For more information, contact us at license @ x265.com. | |
24 | *****************************************************************************/ | |
25 | ||
26 | #ifndef _IPFILTERHARNESS_H_1 | |
27 | #define _IPFILTERHARNESS_H_1 1 | |
28 | ||
29 | #include "testharness.h" | |
30 | #include "primitives.h" | |
31 | ||
32 | class IPFilterHarness : public TestHarness | |
33 | { | |
34 | protected: | |
35 | ||
36 | // Assuming max_height = max_width = max_srcStride = max_dstStride = 100 | |
37 | enum { TEST_BUF_SIZE = 200 * 200 }; | |
38 | enum { ITERS = 100 }; | |
39 | enum { TEST_CASES = 3 }; | |
40 | enum { SMAX = 1 << 12 }; | |
41 | enum { SMIN = -1 << 12 }; | |
42 | ||
43 | ALIGN_VAR_32(pixel, pixel_buff[TEST_BUF_SIZE]); | |
44 | int16_t short_buff[TEST_BUF_SIZE]; | |
45 | int16_t IPF_vec_output_s[TEST_BUF_SIZE]; | |
46 | int16_t IPF_C_output_s[TEST_BUF_SIZE]; | |
47 | pixel IPF_vec_output_p[TEST_BUF_SIZE]; | |
48 | pixel IPF_C_output_p[TEST_BUF_SIZE]; | |
49 | ||
50 | pixel pixel_test_buff[TEST_CASES][TEST_BUF_SIZE]; | |
51 | int16_t short_test_buff[TEST_CASES][TEST_BUF_SIZE]; | |
52 | ||
53 | bool check_IPFilter_primitive(filter_p2s_t ref, filter_p2s_t opt, int isChroma, int csp); | |
54 | bool check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_t opt); | |
55 | bool check_IPFilterChroma_ps_primitive(filter_ps_t ref, filter_ps_t opt); | |
56 | bool check_IPFilterChroma_hps_primitive(filter_hps_t ref, filter_hps_t opt); | |
57 | bool check_IPFilterChroma_sp_primitive(filter_sp_t ref, filter_sp_t opt); | |
58 | bool check_IPFilterChroma_ss_primitive(filter_ss_t ref, filter_ss_t opt); | |
59 | bool check_IPFilterLuma_primitive(filter_pp_t ref, filter_pp_t opt); | |
60 | bool check_IPFilterLuma_ps_primitive(filter_ps_t ref, filter_ps_t opt); | |
61 | bool check_IPFilterLuma_hps_primitive(filter_hps_t ref, filter_hps_t opt); | |
62 | bool check_IPFilterLuma_sp_primitive(filter_sp_t ref, filter_sp_t opt); | |
63 | bool check_IPFilterLuma_ss_primitive(filter_ss_t ref, filter_ss_t opt); | |
64 | bool check_IPFilterLumaHV_primitive(filter_hv_pp_t ref, filter_hv_pp_t opt); | |
65 | ||
66 | public: | |
67 | ||
68 | IPFilterHarness(); | |
69 | ||
70 | const char *getName() const { return "interp"; } | |
71 | ||
72 | bool testCorrectness(const EncoderPrimitives& ref, const EncoderPrimitives& opt); | |
73 | ||
74 | void measureSpeed(const EncoderPrimitives& ref, const EncoderPrimitives& opt); | |
75 | }; | |
76 | ||
77 | #endif // ifndef _FILTERHARNESS_H_1 |