summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/av1_fwd_txfm1d_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/test/av1_fwd_txfm1d_test.cc')
-rw-r--r--third_party/aom/test/av1_fwd_txfm1d_test.cc48
1 files changed, 25 insertions, 23 deletions
diff --git a/third_party/aom/test/av1_fwd_txfm1d_test.cc b/third_party/aom/test/av1_fwd_txfm1d_test.cc
index 9deef3c95..49a666879 100644
--- a/third_party/aom/test/av1_fwd_txfm1d_test.cc
+++ b/third_party/aom/test/av1_fwd_txfm1d_test.cc
@@ -9,36 +9,37 @@
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
-#include "av1/common/av1_fwd_txfm1d.h"
+#include "av1/encoder/av1_fwd_txfm1d.h"
#include "test/av1_txfm_test.h"
using libaom_test::ACMRandom;
+using libaom_test::TYPE_ADST;
+using libaom_test::TYPE_DCT;
+using libaom_test::TYPE_IDTX;
+using libaom_test::TYPE_TXFM;
using libaom_test::input_base;
using libaom_test::reference_hybrid_1d;
-using libaom_test::TYPE_TXFM;
-using libaom_test::TYPE_DCT;
-using libaom_test::TYPE_ADST;
namespace {
-const int txfm_type_num = 2;
-const TYPE_TXFM txfm_type_ls[2] = { TYPE_DCT, TYPE_ADST };
+const int txfm_type_num = 3;
+const TYPE_TXFM txfm_type_ls[txfm_type_num] = { TYPE_DCT, TYPE_ADST,
+ TYPE_IDTX };
const int txfm_size_num = 5;
-const int txfm_size_ls[5] = { 4, 8, 16, 32, 64 };
-
-const TxfmFunc fwd_txfm_func_ls[2][5] = {
-#if CONFIG_TX64X64
- { av1_fdct4_new, av1_fdct8_new, av1_fdct16_new, av1_fdct32_new,
- av1_fdct64_new },
-#else
- { av1_fdct4_new, av1_fdct8_new, av1_fdct16_new, av1_fdct32_new, NULL },
-#endif
- { av1_fadst4_new, av1_fadst8_new, av1_fadst16_new, av1_fadst32_new, NULL }
+
+const int txfm_size_ls[] = { 4, 8, 16, 32, 64 };
+
+const TxfmFunc fwd_txfm_func_ls[][txfm_type_num] = {
+ { av1_fdct4_new, av1_fadst4_new, av1_fidentity4_c },
+ { av1_fdct8_new, av1_fadst8_new, av1_fidentity8_c },
+ { av1_fdct16_new, av1_fadst16_new, av1_fidentity16_c },
+ { av1_fdct32_new, NULL, av1_fidentity32_c },
+ { av1_fdct64_new, NULL, NULL },
};
// 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 range_bit[12] = { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 };
+const int8_t cos_bit = 14;
+const int8_t range_bit[12] = { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 };
TEST(av1_fwd_txfm1d, round_shift) {
EXPECT_EQ(round_shift(7, 1), 4);
@@ -51,10 +52,10 @@ TEST(av1_fwd_txfm1d, round_shift) {
EXPECT_EQ(round_shift(-8, 2), -2);
}
-TEST(av1_fwd_txfm1d, cospi_arr_data) {
+TEST(av1_fwd_txfm1d, av1_cospi_arr_data) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 64; j++) {
- EXPECT_EQ(cospi_arr_data[i][j],
+ EXPECT_EQ(av1_cospi_arr_data[i][j],
(int32_t)round(cos(M_PI * j / 128) * (1 << (cos_bit_min + i))));
}
}
@@ -71,7 +72,7 @@ TEST(av1_fwd_txfm1d, accuracy) {
for (int ti = 0; ti < txfm_type_num; ++ti) {
TYPE_TXFM txfm_type = txfm_type_ls[ti];
- TxfmFunc fwd_txfm_func = fwd_txfm_func_ls[ti][si];
+ TxfmFunc fwd_txfm_func = fwd_txfm_func_ls[si][ti];
int max_error = 7;
const int count_test_block = 5000;
@@ -86,9 +87,10 @@ TEST(av1_fwd_txfm1d, accuracy) {
reference_hybrid_1d(ref_input, ref_output, txfm_size, txfm_type);
for (int ni = 0; ni < txfm_size; ++ni) {
- EXPECT_LE(
+ ASSERT_LE(
abs(output[ni] - static_cast<int32_t>(round(ref_output[ni]))),
- max_error);
+ max_error)
+ << "tx size = " << txfm_size << ", tx type = " << txfm_type;
}
}
}