summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/av1_inv_txfm1d_test.cc
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-19 21:52:15 -0500
committertrav90 <travawine@palemoon.org>2018-10-19 21:52:20 -0500
commitbbcc64772580c8a979288791afa02d30bc476d2e (patch)
tree437ce94c3fdd7497508e5b55de06c6d011678597 /third_party/aom/test/av1_inv_txfm1d_test.cc
parent14805f6ddbfb173c327768fff9f81f40ce5e81b0 (diff)
downloadUXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.gz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.lz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.xz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.zip
Update aom to v1.0.0
Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
Diffstat (limited to 'third_party/aom/test/av1_inv_txfm1d_test.cc')
-rw-r--r--third_party/aom/test/av1_inv_txfm1d_test.cc51
1 files changed, 29 insertions, 22 deletions
diff --git a/third_party/aom/test/av1_inv_txfm1d_test.cc b/third_party/aom/test/av1_inv_txfm1d_test.cc
index b44c04116..bf3a44ed1 100644
--- a/third_party/aom/test/av1_inv_txfm1d_test.cc
+++ b/third_party/aom/test/av1_inv_txfm1d_test.cc
@@ -13,39 +13,35 @@
#include "test/av1_txfm_test.h"
#include "test/util.h"
-#include "av1/common/av1_fwd_txfm1d.h"
#include "av1/common/av1_inv_txfm1d.h"
+#include "av1/encoder/av1_fwd_txfm1d.h"
using libaom_test::ACMRandom;
using libaom_test::input_base;
namespace {
const int txfm_type_num = 2;
-const int txfm_size_ls[5] = { 4, 8, 16, 32, 64 };
+const int txfm_size_ls[] = { 4, 8, 16, 32, 64 };
-const TxfmFunc fwd_txfm_func_ls[][2] = {
+const TxfmFunc fwd_txfm_func_ls[][txfm_type_num] = {
{ av1_fdct4_new, av1_fadst4_new },
{ av1_fdct8_new, av1_fadst8_new },
{ av1_fdct16_new, av1_fadst16_new },
- { av1_fdct32_new, av1_fadst32_new },
-#if CONFIG_TX64X64
+ { av1_fdct32_new, NULL },
{ av1_fdct64_new, NULL },
-#endif
};
-const TxfmFunc inv_txfm_func_ls[][2] = {
+const TxfmFunc inv_txfm_func_ls[][txfm_type_num] = {
{ av1_idct4_new, av1_iadst4_new },
{ av1_idct8_new, av1_iadst8_new },
{ av1_idct16_new, av1_iadst16_new },
- { av1_idct32_new, av1_iadst32_new },
-#if CONFIG_TX64X64
+ { av1_idct32_new, NULL },
{ av1_idct64_new, NULL },
-#endif
};
// the maximum stage number of fwd/inv 1d dct/adst txfm is 12
-const int8_t cos_bit[12] = { 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 };
-const int8_t range_bit[12] = { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 };
+const int8_t cos_bit = 13;
+const int8_t range_bit[12] = { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 };
void reference_idct_1d_int(const int32_t *in, int32_t *out, int size) {
double input[64];
@@ -54,8 +50,11 @@ void reference_idct_1d_int(const int32_t *in, int32_t *out, int size) {
double output[64];
libaom_test::reference_idct_1d(input, output, size);
- for (int i = 0; i < size; ++i)
+ for (int i = 0; i < size; ++i) {
+ ASSERT_GE(output[i], INT32_MIN);
+ ASSERT_LE(output[i], INT32_MAX);
out[i] = static_cast<int32_t>(round(output[i]));
+ }
}
void random_matrix(int32_t *dst, int len, ACMRandom *rnd) {
@@ -73,24 +72,32 @@ void random_matrix(int32_t *dst, int len, ACMRandom *rnd) {
TEST(av1_inv_txfm1d, InvAccuracyCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 20000;
- const int max_error[] = { 6, 10, 19, 28 };
+ const int max_error[] = { 6, 10, 19, 31, 40 };
+ ASSERT_EQ(NELEMENTS(max_error), TX_SIZES);
+ ASSERT_EQ(NELEMENTS(inv_txfm_func_ls), TX_SIZES);
for (int k = 0; k < count_test_block; ++k) {
// choose a random transform to test
- const int txfm_type = rnd.Rand8() % NELEMENTS(inv_txfm_func_ls);
- const int txfm_size = txfm_size_ls[txfm_type];
- const TxfmFunc txfm_func = inv_txfm_func_ls[txfm_type][0];
+ const TX_SIZE tx_size = static_cast<TX_SIZE>(rnd.Rand8() % TX_SIZES);
+ const int tx_size_pix = txfm_size_ls[tx_size];
+ const TxfmFunc inv_txfm_func = inv_txfm_func_ls[tx_size][0];
int32_t input[64];
- random_matrix(input, txfm_size, &rnd);
+ random_matrix(input, tx_size_pix, &rnd);
+
+ // 64x64 transform assumes last 32 values are zero.
+ memset(input + 32, 0, 32 * sizeof(input[0]));
int32_t ref_output[64];
- reference_idct_1d_int(input, ref_output, txfm_size);
+ reference_idct_1d_int(input, ref_output, tx_size_pix);
int32_t output[64];
- txfm_func(input, output, cos_bit, range_bit);
+ inv_txfm_func(input, output, cos_bit, range_bit);
- for (int i = 0; i < txfm_size; ++i) {
- EXPECT_LE(abs(output[i] - ref_output[i]), max_error[txfm_type]);
+ for (int i = 0; i < tx_size_pix; ++i) {
+ EXPECT_LE(abs(output[i] - ref_output[i]), max_error[tx_size])
+ << "tx_size = " << tx_size << ", i = " << i
+ << ", output[i] = " << output[i]
+ << ", ref_output[i] = " << ref_output[i];
}
}
}