Imported Upstream version 1.4
[deb_x265.git] / source / test / intrapredharness.h
CommitLineData
72b9787e
JB
1/*****************************************************************************
2 * Copyright (C) 2013 x265 project
3 *
4 * Authors: Min Chen <chenm003@163.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
19 *
20 * This program is also available under a commercial proprietary license.
21 * For more information, contact us at license @ x265.com.
22 *****************************************************************************/
23
24#ifndef _INTRAPREDHARNESS_H_1
25#define _INTRAPREDHARNESS_H_1 1
26
27#include "testharness.h"
28#include "primitives.h"
29
30class IntraPredHarness : public TestHarness
31{
32protected:
33
34 enum { INPUT_SIZE = 4 * 65 * 65 * 100 };
35 enum { OUTPUT_SIZE = 64 * FENC_STRIDE };
36 enum { OUTPUT_SIZE_33 = 33 * OUTPUT_SIZE };
37
38 ALIGN_VAR_16(pixel, pixel_buff[INPUT_SIZE]);
39 pixel pixel_out_c[OUTPUT_SIZE];
40 pixel pixel_out_vec[OUTPUT_SIZE];
41 pixel pixel_out_33_c[OUTPUT_SIZE_33];
42 pixel pixel_out_33_vec[OUTPUT_SIZE_33];
43
44 bool check_dc_primitive(intra_pred_t ref, intra_pred_t opt, int width);
45 bool check_planar_primitive(intra_pred_t ref, intra_pred_t opt, int width);
46 bool check_angular_primitive(const intra_pred_t ref[][NUM_TR_SIZE], const intra_pred_t opt[][NUM_TR_SIZE]);
47 bool check_allangs_primitive(const intra_allangs_t ref[], const intra_allangs_t opt[]);
48
49public:
50
51 IntraPredHarness();
52
53 const char *getName() const { return "intrapred"; }
54
55 bool testCorrectness(const EncoderPrimitives& ref, const EncoderPrimitives& opt);
56
57 void measureSpeed(const EncoderPrimitives& ref, const EncoderPrimitives& opt);
58};
59
60#endif // ifndef _INTRAPREDHARNESS_H_1