Add transform test for 64x64.

This is similar to the ones for 32x32, 32x16 etc.

Change-Id: Iec97f4dc2b0109d39a14e9d8e2d5241a79b9e529
diff --git a/test/av1_fht64x64_test.cc b/test/av1_fht64x64_test.cc
new file mode 100644
index 0000000..f4d58a6
--- /dev/null
+++ b/test/av1_fht64x64_test.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017, Alliance for Open Media. All rights reserved
+ *
+ * This source code is subject to the terms of the BSD 2 Clause License and
+ * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
+ * was not distributed with this source code in the LICENSE file, you can
+ * obtain it at www.aomedia.org/license/software. If the Alliance for Open
+ * Media Patent License 1.0 was not distributed with this source code in the
+ * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+ */
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
+
+#include "./av1_rtcd.h"
+
+#include "aom_ports/mem.h"
+#include "test/acm_random.h"
+#include "test/clear_system_state.h"
+#include "test/register_state_check.h"
+#include "test/transform_test_base.h"
+#include "test/util.h"
+
+#if CONFIG_TX64X64
+
+using libaom_test::ACMRandom;
+
+namespace {
+typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
+                        int tx_type);
+using std::tr1::tuple;
+using libaom_test::FhtFunc;
+typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht64x64Param;
+
+void fht64x64_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
+  av1_fht64x64_c(in, out, stride, tx_type);
+}
+
+void iht64x64_ref(const tran_low_t *in, uint8_t *dest, int stride,
+                  int tx_type) {
+  av1_iht64x64_4096_add_c(in, dest, stride, tx_type);
+}
+
+#if CONFIG_HIGHBITDEPTH
+typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
+                           int tx_type, int bd);
+typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
+                          int tx_type, int bd);
+
+// Target optimized function, tx_type, bit depth
+typedef tuple<HbdHtFunc, int, int> HighbdHt64x64Param;
+
+void highbd_fht64x64_ref(const int16_t *in, int32_t *out, int stride,
+                         int tx_type, int bd) {
+  av1_fwd_txfm2d_64x64_c(in, out, stride, tx_type, bd);
+}
+#endif  // CONFIG_HIGHBITDEPTH
+
+class AV1Trans64x64HT : public libaom_test::TransformTestBase,
+                        public ::testing::TestWithParam<Ht64x64Param> {
+ public:
+  virtual ~AV1Trans64x64HT() {}
+
+  virtual void SetUp() {
+    fwd_txfm_ = GET_PARAM(0);
+    inv_txfm_ = GET_PARAM(1);
+    tx_type_ = GET_PARAM(2);
+    pitch_ = 64;
+    height_ = 64;
+    fwd_txfm_ref = fht64x64_ref;
+    inv_txfm_ref = iht64x64_ref;
+    bit_depth_ = GET_PARAM(3);
+    mask_ = (1 << bit_depth_) - 1;
+    num_coeffs_ = GET_PARAM(4);
+  }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
+
+ protected:
+  void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
+    fwd_txfm_(in, out, stride, tx_type_);
+  }
+
+  void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
+    inv_txfm_(out, dst, stride, tx_type_);
+  }
+
+  FhtFunc fwd_txfm_;
+  IhtFunc inv_txfm_;
+};
+
+TEST_P(AV1Trans64x64HT, AccuracyCheck) { RunAccuracyCheck(4, 0.2); }
+TEST_P(AV1Trans64x64HT, CoeffCheck) { RunCoeffCheck(); }
+TEST_P(AV1Trans64x64HT, MemCheck) { RunMemCheck(); }
+TEST_P(AV1Trans64x64HT, InvCoeffCheck) { RunInvCoeffCheck(); }
+TEST_P(AV1Trans64x64HT, InvAccuracyCheck) { RunInvAccuracyCheck(4); }
+
+using std::tr1::make_tuple;
+
+const Ht64x64Param kArrayHt64x64Param_c[] = {
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 0, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 1, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 2, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 3, AOM_BITS_8, 4096),
+#if CONFIG_EXT_TX
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 4, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 5, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 6, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 7, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 8, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 9, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 10, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 11, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 12, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 13, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 14, AOM_BITS_8, 4096),
+  make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, 15, AOM_BITS_8, 4096)
+#endif  // CONFIG_EXT_TX
+};
+INSTANTIATE_TEST_CASE_P(C, AV1Trans64x64HT,
+                        ::testing::ValuesIn(kArrayHt64x64Param_c));
+
+}  // namespace
+
+#endif  // CONFIG_TX64X64
diff --git a/test/test.cmake b/test/test.cmake
index 2717967..1260deb 100644
--- a/test/test.cmake
+++ b/test/test.cmake
@@ -186,6 +186,12 @@
         "${AOM_ROOT}/test/obmc_sad_test.cc"
         "${AOM_ROOT}/test/obmc_variance_test.cc")
   endif ()
+
+  if (CONFIG_TX64X64)
+    set(AOM_UNIT_TEST_ENCODER_SOURCES
+        ${AOM_UNIT_TEST_ENCODER_SOURCES}
+        "${AOM_ROOT}/test/av1_fht64x64_test.cc")
+  endif ()
 endif ()
 
 if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER)
diff --git a/test/test.mk b/test/test.mk
index e24dc5b..90c947b 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -169,6 +169,9 @@
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_fht8x8_test.cc
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_fht16x16_test.cc
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_fht32x32_test.cc
+ifeq ($(CONFIG_TX64X64),yes)
+LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_fht64x64_test.cc
+endif
 ifeq ($(CONFIG_EXT_TX),yes)
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_fht4x8_test.cc
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_fht8x4_test.cc