Remove dead tx: fht16x16_256_add
Change-Id: I8f912b1d887336d5bd1ddcfb8cb597d46eace393
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl
index 2c2197c..a66b99f 100755
--- a/av1/common/av1_rtcd_defs.pl
+++ b/av1/common/av1_rtcd_defs.pl
@@ -102,9 +102,6 @@
add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
specialize qw/av1_iht8x8_64_add sse2/;
-add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
-specialize qw/av1_iht16x16_256_add sse2 avx2/;
-
add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
@@ -152,8 +149,6 @@
add_proto qw/void av1_highbd_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
-add_proto qw/void av1_highbd_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
-
#inv txfm
add_proto qw/void av1_inv_txfm_add/, "const tran_low_t *dqcoeff, uint8_t *dst, int stride, const TxfmParam *txfm_param";
specialize qw/av1_inv_txfm_add ssse3 avx2/;
@@ -222,9 +217,6 @@
add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
specialize qw/av1_fht8x8 sse2/;
- add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
- specialize qw/av1_fht16x16 sse2 avx2/;
-
add_proto qw/void av1_fht32x32/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
specialize qw/av1_fht32x32 sse2 avx2/;
diff --git a/av1/common/idct.c b/av1/common/idct.c
index d3f131a..7007556 100644
--- a/av1/common/idct.c
+++ b/av1/common/idct.c
@@ -461,61 +461,6 @@
}
}
-void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
- const TxfmParam *txfm_param) {
- const TX_TYPE tx_type = txfm_param->tx_type;
- static const transform_2d IHT_16[] = {
- { aom_idct16_c, aom_idct16_c }, // DCT_DCT = 0
- { aom_iadst16_c, aom_idct16_c }, // ADST_DCT = 1
- { aom_idct16_c, aom_iadst16_c }, // DCT_ADST = 2
- { aom_iadst16_c, aom_iadst16_c }, // ADST_ADST = 3
- { aom_iadst16_c, aom_idct16_c }, // FLIPADST_DCT
- { aom_idct16_c, aom_iadst16_c }, // DCT_FLIPADST
- { aom_iadst16_c, aom_iadst16_c }, // FLIPADST_FLIPADST
- { aom_iadst16_c, aom_iadst16_c }, // ADST_FLIPADST
- { aom_iadst16_c, aom_iadst16_c }, // FLIPADST_ADST
- { iidtx16_c, iidtx16_c }, // IDTX
- { aom_idct16_c, iidtx16_c }, // V_DCT
- { iidtx16_c, aom_idct16_c }, // H_DCT
- { aom_iadst16_c, iidtx16_c }, // V_ADST
- { iidtx16_c, aom_iadst16_c }, // H_ADST
- { aom_iadst16_c, iidtx16_c }, // V_FLIPADST
- { iidtx16_c, aom_iadst16_c }, // H_FLIPADST
- };
-
- tran_low_t tmp[16][16];
- tran_low_t out[16][16];
- tran_low_t *outp = &out[0][0];
- int outstride = 16;
-
- // inverse transform row vectors
- for (int i = 0; i < 16; ++i) {
- IHT_16[tx_type].rows(input, out[i]);
- input += 16;
- }
-
- // transpose
- for (int i = 0; i < 16; i++) {
- for (int j = 0; j < 16; j++) {
- tmp[j][i] = out[i][j];
- }
- }
-
- // inverse transform column vectors
- for (int i = 0; i < 16; ++i) IHT_16[tx_type].cols(tmp[i], out[i]);
-
- maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, 16, 16);
-
- // Sum with the destination
- for (int i = 0; i < 16; ++i) {
- for (int j = 0; j < 16; ++j) {
- int d = i * stride + j;
- int s = j * outstride + i;
- dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 6));
- }
- }
-}
-
void av1_iht32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride,
const TxfmParam *txfm_param) {
const TX_TYPE tx_type = txfm_param->tx_type;
diff --git a/av1/common/x86/idct_intrin_sse2.c b/av1/common/x86/idct_intrin_sse2.c
index e0d4dab..fa78ebc 100644
--- a/av1/common/x86/idct_intrin_sse2.c
+++ b/av1/common/x86/idct_intrin_sse2.c
@@ -237,101 +237,3 @@
RECON_AND_STORE(dest + 6 * stride, in[6]);
RECON_AND_STORE(dest + 7 * stride, in[7]);
}
-
-static void iidtx16_sse2(__m128i *in0, __m128i *in1) {
- array_transpose_16x16(in0, in1);
- idtx16_8col(in0);
- idtx16_8col(in1);
-}
-
-void av1_iht16x16_256_add_sse2(const tran_low_t *input, uint8_t *dest,
- int stride, const TxfmParam *txfm_param) {
- __m128i in[32];
- __m128i *in0 = &in[0];
- __m128i *in1 = &in[16];
- const TX_TYPE tx_type = txfm_param->tx_type;
-
- load_buffer_8x16(input, in0);
- input += 8;
- load_buffer_8x16(input, in1);
-
- switch (tx_type) {
- case DCT_DCT:
- aom_idct16_sse2(in0, in1);
- aom_idct16_sse2(in0, in1);
- break;
- case ADST_DCT:
- aom_idct16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- break;
- case DCT_ADST:
- aom_iadst16_sse2(in0, in1);
- aom_idct16_sse2(in0, in1);
- break;
- case ADST_ADST:
- aom_iadst16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- break;
- case FLIPADST_DCT:
- aom_idct16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- FLIPUD_PTR(dest, stride, 16);
- break;
- case DCT_FLIPADST:
- aom_iadst16_sse2(in0, in1);
- aom_idct16_sse2(in0, in1);
- FLIPLR_16x16(in0, in1);
- break;
- case FLIPADST_FLIPADST:
- aom_iadst16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- FLIPUD_PTR(dest, stride, 16);
- FLIPLR_16x16(in0, in1);
- break;
- case ADST_FLIPADST:
- aom_iadst16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- FLIPLR_16x16(in0, in1);
- break;
- case FLIPADST_ADST:
- aom_iadst16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- FLIPUD_PTR(dest, stride, 16);
- break;
- case IDTX:
- iidtx16_sse2(in0, in1);
- iidtx16_sse2(in0, in1);
- break;
- case V_DCT:
- iidtx16_sse2(in0, in1);
- aom_idct16_sse2(in0, in1);
- break;
- case H_DCT:
- aom_idct16_sse2(in0, in1);
- iidtx16_sse2(in0, in1);
- break;
- case V_ADST:
- iidtx16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- break;
- case H_ADST:
- aom_iadst16_sse2(in0, in1);
- iidtx16_sse2(in0, in1);
- break;
- case V_FLIPADST:
- iidtx16_sse2(in0, in1);
- aom_iadst16_sse2(in0, in1);
- FLIPUD_PTR(dest, stride, 16);
- break;
- case H_FLIPADST:
- aom_iadst16_sse2(in0, in1);
- iidtx16_sse2(in0, in1);
- FLIPLR_16x16(in0, in1);
- break;
- default: assert(0); break;
- }
-
- write_buffer_8x16(dest, in0, stride);
- dest += 8;
- write_buffer_8x16(dest, in1, stride);
-}
diff --git a/test/av1_fht16x16_test.cc b/test/av1_fht16x16_test.cc
deleted file mode 100644
index 24f4c78..0000000
--- a/test/av1_fht16x16_test.cc
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2016, 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_dsp_rtcd.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"
-#include "aom_ports/mem.h"
-
-using libaom_test::ACMRandom;
-
-namespace {
-typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
- const TxfmParam *txfm_param);
-using libaom_test::FhtFunc;
-using std::tr1::tuple;
-typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht16x16Param;
-
-void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
- TxfmParam *txfm_param) {
- av1_fht16x16_c(in, out, stride, txfm_param);
-}
-
-void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
- const TxfmParam *txfm_param) {
- av1_iht16x16_256_add_c(in, dest, stride, txfm_param);
-}
-
-typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
- TX_TYPE tx_type, int bd);
-typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
- TX_TYPE tx_type, int bd);
-
-// Target optimized function, tx_type, bit depth
-typedef tuple<HbdHtFunc, TX_TYPE, int> HighbdHt16x16Param;
-
-void highbd_fht16x16_ref(const int16_t *in, int32_t *out, int stride,
- TX_TYPE tx_type, int bd) {
- av1_fwd_txfm2d_16x16_c(in, out, stride, tx_type, bd);
-}
-
-class AV1Trans16x16HT : public libaom_test::TransformTestBase,
- public ::testing::TestWithParam<Ht16x16Param> {
- public:
- virtual ~AV1Trans16x16HT() {}
-
- virtual void SetUp() {
- fwd_txfm_ = GET_PARAM(0);
- inv_txfm_ = GET_PARAM(1);
- pitch_ = 16;
- height_ = 16;
- fwd_txfm_ref = fht16x16_ref;
- inv_txfm_ref = iht16x16_ref;
- bit_depth_ = GET_PARAM(3);
- mask_ = (1 << bit_depth_) - 1;
- num_coeffs_ = GET_PARAM(4);
- txfm_param_.tx_type = GET_PARAM(2);
- }
- virtual void TearDown() { libaom_test::ClearSystemState(); }
-
- protected:
- void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
- fwd_txfm_(in, out, stride, &txfm_param_);
- }
-
- void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
- inv_txfm_(out, dst, stride, &txfm_param_);
- }
-
- FhtFunc fwd_txfm_;
- IhtFunc inv_txfm_;
-};
-
-TEST_P(AV1Trans16x16HT, MemCheck) { RunMemCheck(); }
-TEST_P(AV1Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(1, 0.001); }
-TEST_P(AV1Trans16x16HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
-TEST_P(AV1Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
-TEST_P(AV1Trans16x16HT, InvCoeffCheck) { RunInvCoeffCheck(); }
-
-class AV1HighbdTrans16x16HT
- : public ::testing::TestWithParam<HighbdHt16x16Param> {
- public:
- virtual ~AV1HighbdTrans16x16HT() {}
-
- virtual void SetUp() {
- fwd_txfm_ = GET_PARAM(0);
- fwd_txfm_ref_ = highbd_fht16x16_ref;
- tx_type_ = GET_PARAM(1);
- bit_depth_ = GET_PARAM(2);
- mask_ = (1 << bit_depth_) - 1;
- num_coeffs_ = 256;
-
- input_ = reinterpret_cast<int16_t *>(
- aom_memalign(32, sizeof(int16_t) * num_coeffs_));
- output_ = reinterpret_cast<int32_t *>(
- aom_memalign(32, sizeof(int32_t) * num_coeffs_));
- output_ref_ = reinterpret_cast<int32_t *>(
- aom_memalign(32, sizeof(int32_t) * num_coeffs_));
- }
-
- virtual void TearDown() {
- aom_free(input_);
- aom_free(output_);
- aom_free(output_ref_);
- libaom_test::ClearSystemState();
- }
-
- protected:
- void RunBitexactCheck();
-
- private:
- HbdHtFunc fwd_txfm_;
- HbdHtFunc fwd_txfm_ref_;
- TX_TYPE tx_type_;
- int bit_depth_;
- int mask_;
- int num_coeffs_;
- int16_t *input_;
- int32_t *output_;
- int32_t *output_ref_;
-};
-
-void AV1HighbdTrans16x16HT::RunBitexactCheck() {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- int i, j;
- const int stride = 16;
- const int num_tests = 1000;
-
- for (i = 0; i < num_tests; ++i) {
- for (j = 0; j < num_coeffs_; ++j) {
- input_[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
- }
-
- fwd_txfm_ref_(input_, output_ref_, stride, tx_type_, bit_depth_);
- ASM_REGISTER_STATE_CHECK(
- fwd_txfm_(input_, output_, stride, tx_type_, bit_depth_));
-
- for (j = 0; j < num_coeffs_; ++j) {
- EXPECT_EQ(output_ref_[j], output_[j])
- << "Not bit-exact result at index: " << j << " at test block: " << i;
- }
- }
-}
-
-TEST_P(AV1HighbdTrans16x16HT, HighbdCoeffCheck) { RunBitexactCheck(); }
-
-using std::tr1::make_tuple;
-
-#if HAVE_SSE2
-const Ht16x16Param kArrayHt16x16Param_sse2[] = {
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, DCT_DCT,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, ADST_DCT,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, DCT_ADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, ADST_ADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, FLIPADST_DCT,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, DCT_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, FLIPADST_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, ADST_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, FLIPADST_ADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, IDTX, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, V_DCT, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, H_DCT, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, V_ADST, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, H_ADST, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, V_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, H_FLIPADST,
- AOM_BITS_8, 256)
-};
-INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans16x16HT,
- ::testing::ValuesIn(kArrayHt16x16Param_sse2));
-#endif // HAVE_SSE2
-
-#if HAVE_AVX2
-const Ht16x16Param kArrayHt16x16Param_avx2[] = {
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, DCT_DCT,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, ADST_DCT,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, DCT_ADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, ADST_ADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, FLIPADST_DCT,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, DCT_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, FLIPADST_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, ADST_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, FLIPADST_ADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, IDTX, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, V_DCT, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, H_DCT, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, V_ADST, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, H_ADST, AOM_BITS_8,
- 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, V_FLIPADST,
- AOM_BITS_8, 256),
- make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, H_FLIPADST,
- AOM_BITS_8, 256)
-};
-INSTANTIATE_TEST_CASE_P(AVX2, AV1Trans16x16HT,
- ::testing::ValuesIn(kArrayHt16x16Param_avx2));
-#endif // HAVE_AVX2
-
-#if HAVE_SSE4_1
-const HighbdHt16x16Param kArrayHBDHt16x16Param_sse4_1[] = {
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_DCT, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_DCT, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, ADST_DCT, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, ADST_DCT, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_ADST, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_ADST, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, ADST_ADST, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, ADST_ADST, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, FLIPADST_DCT, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, FLIPADST_DCT, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_FLIPADST, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_FLIPADST, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, FLIPADST_FLIPADST, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, FLIPADST_FLIPADST, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, ADST_FLIPADST, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, ADST_FLIPADST, 12),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, FLIPADST_ADST, 10),
- make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, FLIPADST_ADST, 12),
-};
-INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans16x16HT,
- ::testing::ValuesIn(kArrayHBDHt16x16Param_sse4_1));
-#endif // HAVE_SSE4_1
-
-} // namespace
diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc
deleted file mode 100644
index 9c1a70f..0000000
--- a/test/dct16x16_test.cc
+++ /dev/null
@@ -1,704 +0,0 @@
-/*
- * Copyright (c) 2016, 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 <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
-
-#include "./av1_rtcd.h"
-#include "./aom_dsp_rtcd.h"
-#include "test/acm_random.h"
-#include "test/clear_system_state.h"
-#include "test/register_state_check.h"
-#include "test/util.h"
-#include "av1/common/entropy.h"
-#include "av1/common/scan.h"
-#include "aom/aom_codec.h"
-#include "aom/aom_integer.h"
-#include "aom_ports/mem.h"
-#include "aom_ports/msvc.h" // for round()
-
-using libaom_test::ACMRandom;
-
-namespace {
-
-const int kNumCoeffs = 256;
-const double C1 = 0.995184726672197;
-const double C2 = 0.98078528040323;
-const double C3 = 0.956940335732209;
-const double C4 = 0.923879532511287;
-const double C5 = 0.881921264348355;
-const double C6 = 0.831469612302545;
-const double C7 = 0.773010453362737;
-const double C8 = 0.707106781186548;
-const double C9 = 0.634393284163646;
-const double C10 = 0.555570233019602;
-const double C11 = 0.471396736825998;
-const double C12 = 0.38268343236509;
-const double C13 = 0.290284677254462;
-const double C14 = 0.195090322016128;
-const double C15 = 0.098017140329561;
-
-void butterfly_16x16_dct_1d(double input[16], double output[16]) {
- double step[16];
- double intermediate[16];
- double temp1, temp2;
-
- // step 1
- step[0] = input[0] + input[15];
- step[1] = input[1] + input[14];
- step[2] = input[2] + input[13];
- step[3] = input[3] + input[12];
- step[4] = input[4] + input[11];
- step[5] = input[5] + input[10];
- step[6] = input[6] + input[9];
- step[7] = input[7] + input[8];
- step[8] = input[7] - input[8];
- step[9] = input[6] - input[9];
- step[10] = input[5] - input[10];
- step[11] = input[4] - input[11];
- step[12] = input[3] - input[12];
- step[13] = input[2] - input[13];
- step[14] = input[1] - input[14];
- step[15] = input[0] - input[15];
-
- // step 2
- output[0] = step[0] + step[7];
- output[1] = step[1] + step[6];
- output[2] = step[2] + step[5];
- output[3] = step[3] + step[4];
- output[4] = step[3] - step[4];
- output[5] = step[2] - step[5];
- output[6] = step[1] - step[6];
- output[7] = step[0] - step[7];
-
- temp1 = step[8] * C7;
- temp2 = step[15] * C9;
- output[8] = temp1 + temp2;
-
- temp1 = step[9] * C11;
- temp2 = step[14] * C5;
- output[9] = temp1 - temp2;
-
- temp1 = step[10] * C3;
- temp2 = step[13] * C13;
- output[10] = temp1 + temp2;
-
- temp1 = step[11] * C15;
- temp2 = step[12] * C1;
- output[11] = temp1 - temp2;
-
- temp1 = step[11] * C1;
- temp2 = step[12] * C15;
- output[12] = temp2 + temp1;
-
- temp1 = step[10] * C13;
- temp2 = step[13] * C3;
- output[13] = temp2 - temp1;
-
- temp1 = step[9] * C5;
- temp2 = step[14] * C11;
- output[14] = temp2 + temp1;
-
- temp1 = step[8] * C9;
- temp2 = step[15] * C7;
- output[15] = temp2 - temp1;
-
- // step 3
- step[0] = output[0] + output[3];
- step[1] = output[1] + output[2];
- step[2] = output[1] - output[2];
- step[3] = output[0] - output[3];
-
- temp1 = output[4] * C14;
- temp2 = output[7] * C2;
- step[4] = temp1 + temp2;
-
- temp1 = output[5] * C10;
- temp2 = output[6] * C6;
- step[5] = temp1 + temp2;
-
- temp1 = output[5] * C6;
- temp2 = output[6] * C10;
- step[6] = temp2 - temp1;
-
- temp1 = output[4] * C2;
- temp2 = output[7] * C14;
- step[7] = temp2 - temp1;
-
- step[8] = output[8] + output[11];
- step[9] = output[9] + output[10];
- step[10] = output[9] - output[10];
- step[11] = output[8] - output[11];
-
- step[12] = output[12] + output[15];
- step[13] = output[13] + output[14];
- step[14] = output[13] - output[14];
- step[15] = output[12] - output[15];
-
- // step 4
- output[0] = (step[0] + step[1]);
- output[8] = (step[0] - step[1]);
-
- temp1 = step[2] * C12;
- temp2 = step[3] * C4;
- temp1 = temp1 + temp2;
- output[4] = 2 * (temp1 * C8);
-
- temp1 = step[2] * C4;
- temp2 = step[3] * C12;
- temp1 = temp2 - temp1;
- output[12] = 2 * (temp1 * C8);
-
- output[2] = 2 * ((step[4] + step[5]) * C8);
- output[14] = 2 * ((step[7] - step[6]) * C8);
-
- temp1 = step[4] - step[5];
- temp2 = step[6] + step[7];
- output[6] = (temp1 + temp2);
- output[10] = (temp1 - temp2);
-
- intermediate[8] = step[8] + step[14];
- intermediate[9] = step[9] + step[15];
-
- temp1 = intermediate[8] * C12;
- temp2 = intermediate[9] * C4;
- temp1 = temp1 - temp2;
- output[3] = 2 * (temp1 * C8);
-
- temp1 = intermediate[8] * C4;
- temp2 = intermediate[9] * C12;
- temp1 = temp2 + temp1;
- output[13] = 2 * (temp1 * C8);
-
- output[9] = 2 * ((step[10] + step[11]) * C8);
-
- intermediate[11] = step[10] - step[11];
- intermediate[12] = step[12] + step[13];
- intermediate[13] = step[12] - step[13];
- intermediate[14] = step[8] - step[14];
- intermediate[15] = step[9] - step[15];
-
- output[15] = (intermediate[11] + intermediate[12]);
- output[1] = -(intermediate[11] - intermediate[12]);
-
- output[7] = 2 * (intermediate[13] * C8);
-
- temp1 = intermediate[14] * C12;
- temp2 = intermediate[15] * C4;
- temp1 = temp1 - temp2;
- output[11] = -2 * (temp1 * C8);
-
- temp1 = intermediate[14] * C4;
- temp2 = intermediate[15] * C12;
- temp1 = temp2 + temp1;
- output[5] = 2 * (temp1 * C8);
-}
-
-void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
- // First transform columns
- for (int i = 0; i < 16; ++i) {
- double temp_in[16], temp_out[16];
- for (int j = 0; j < 16; ++j) temp_in[j] = input[j * 16 + i];
- butterfly_16x16_dct_1d(temp_in, temp_out);
- for (int j = 0; j < 16; ++j) output[j * 16 + i] = temp_out[j];
- }
- // Then transform rows
- for (int i = 0; i < 16; ++i) {
- double temp_in[16], temp_out[16];
- for (int j = 0; j < 16; ++j) temp_in[j] = output[j + i * 16];
- butterfly_16x16_dct_1d(temp_in, temp_out);
- // Scale by some magic number
- for (int j = 0; j < 16; ++j) output[j + i * 16] = temp_out[j] / 2;
- }
-}
-
-typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
-typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
-typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
- TxfmParam *txfm_param);
-typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
- const TxfmParam *txfm_param);
-
-typedef std::tr1::tuple<FdctFunc, IdctFunc, TX_TYPE, aom_bit_depth_t>
- Dct16x16Param;
-typedef std::tr1::tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t>
- Ht16x16Param;
-typedef std::tr1::tuple<IdctFunc, IdctFunc, TX_TYPE, aom_bit_depth_t>
- Idct16x16Param;
-
-void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
- TxfmParam *txfm_param) {
- av1_fht16x16_c(in, out, stride, txfm_param);
-}
-
-void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
- const TxfmParam *txfm_param) {
- av1_iht16x16_256_add_c(in, dest, stride, txfm_param);
-}
-
-void fht16x16_10(const int16_t *in, tran_low_t *out, int stride,
- TxfmParam *txfm_param) {
- av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 10);
-}
-
-void fht16x16_12(const int16_t *in, tran_low_t *out, int stride,
- TxfmParam *txfm_param) {
- av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 12);
-}
-
-void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride,
- const TxfmParam *txfm_param) {
- av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride,
- txfm_param->tx_type, 10);
-}
-
-void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride,
- const TxfmParam *txfm_param) {
- av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride,
- txfm_param->tx_type, 12);
-}
-
-class Trans16x16TestBase {
- public:
- virtual ~Trans16x16TestBase() {}
-
- protected:
- virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0;
-
- virtual void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) = 0;
-
- void RunAccuracyCheck() {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- uint32_t max_error = 0;
- int64_t total_error = 0;
- const int count_test_block = 10000;
- for (int i = 0; i < count_test_block; ++i) {
- DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
-
- // Initialize a test block with input range [-mask_, mask_].
- for (int j = 0; j < kNumCoeffs; ++j) {
- if (bit_depth_ == AOM_BITS_8) {
- src[j] = rnd.Rand8();
- dst[j] = rnd.Rand8();
- test_input_block[j] = src[j] - dst[j];
- } else {
- src16[j] = rnd.Rand16() & mask_;
- dst16[j] = rnd.Rand16() & mask_;
- test_input_block[j] = src16[j] - dst16[j];
- }
- }
-
- ASM_REGISTER_STATE_CHECK(
- RunFwdTxfm(test_input_block, test_temp_block, pitch_));
- if (bit_depth_ == AOM_BITS_8) {
- ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
- } else {
- ASM_REGISTER_STATE_CHECK(
- RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
- }
-
- for (int j = 0; j < kNumCoeffs; ++j) {
- const int32_t diff =
- bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
- const uint32_t error = diff * diff;
- if (max_error < error) max_error = error;
- total_error += error;
- }
- }
-
- EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
- << "Error: 16x16 FHT/IHT has an individual round trip error > 1";
-
- EXPECT_GE(count_test_block << 2 * (bit_depth_ - 8), total_error)
- << "Error: 16x16 FHT/IHT has average round trip error > 1 per block";
- }
-
- void RunCoeffCheck() {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- const int count_test_block = 1000;
- DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
-
- for (int i = 0; i < count_test_block; ++i) {
- // Initialize a test block with input range [-mask_, mask_].
- for (int j = 0; j < kNumCoeffs; ++j)
- input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
-
- fwd_txfm_ref(input_block, output_ref_block, pitch_, &txfm_param_);
- ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
-
- // The minimum quant value is 4.
- for (int j = 0; j < kNumCoeffs; ++j)
- EXPECT_EQ(output_block[j], output_ref_block[j]);
- }
- }
-
- void RunMemCheck() {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- const int count_test_block = 1000;
- DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
-
- for (int i = 0; i < count_test_block; ++i) {
- // Initialize a test block with input range [-mask_, mask_].
- for (int j = 0; j < kNumCoeffs; ++j) {
- input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
- }
- if (i == 0) {
- for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
- } else if (i == 1) {
- for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
- }
-
- fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_);
- ASM_REGISTER_STATE_CHECK(
- RunFwdTxfm(input_extreme_block, output_block, pitch_));
-
- // The minimum quant value is 4.
- for (int j = 0; j < kNumCoeffs; ++j) {
- EXPECT_EQ(output_block[j], output_ref_block[j]);
- EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j]))
- << "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
- }
- }
- }
-
- void RunQuantCheck(int dc_thred, int ac_thred) {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- const int count_test_block = 100000;
- DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
-
- DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
-
- for (int i = 0; i < count_test_block; ++i) {
- // Initialize a test block with input range [-mask_, mask_].
- for (int j = 0; j < kNumCoeffs; ++j) {
- input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
- }
- if (i == 0)
- for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
- if (i == 1)
- for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
-
- fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_);
-
- // clear reconstructed pixel buffers
- memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
- memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
- memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
- memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
-
- // quantization with maximum allowed step sizes
- output_ref_block[0] = (output_ref_block[0] / dc_thred) * dc_thred;
- for (int j = 1; j < kNumCoeffs; ++j)
- output_ref_block[j] = (output_ref_block[j] / ac_thred) * ac_thred;
- if (bit_depth_ == AOM_BITS_8) {
- inv_txfm_ref(output_ref_block, ref, pitch_, &txfm_param_);
- ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
- } else {
- inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
- &txfm_param_);
- ASM_REGISTER_STATE_CHECK(
- RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
- }
- if (bit_depth_ == AOM_BITS_8) {
- for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref[j], dst[j]);
- } else {
- for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref16[j], dst16[j]);
- }
- }
- }
-
- void RunInvAccuracyCheck() {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- const int count_test_block = 1000;
- DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
-
- for (int i = 0; i < count_test_block; ++i) {
- double out_r[kNumCoeffs];
-
- // Initialize a test block with input range [-255, 255].
- for (int j = 0; j < kNumCoeffs; ++j) {
- if (bit_depth_ == AOM_BITS_8) {
- src[j] = rnd.Rand8();
- dst[j] = rnd.Rand8();
- in[j] = src[j] - dst[j];
- } else {
- src16[j] = rnd.Rand16() & mask_;
- dst16[j] = rnd.Rand16() & mask_;
- in[j] = src16[j] - dst16[j];
- }
- }
-
- reference_16x16_dct_2d(in, out_r);
- for (int j = 0; j < kNumCoeffs; ++j)
- coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
-
- if (bit_depth_ == AOM_BITS_8) {
- ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
- } else {
- ASM_REGISTER_STATE_CHECK(
- RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), 16));
- }
-
- for (int j = 0; j < kNumCoeffs; ++j) {
- const int diff =
- bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
- const uint32_t error = diff * diff;
- EXPECT_GE(1u, error)
- << "Error: 16x16 IDCT has error " << error << " at index " << j;
- }
- }
- }
-
- void CompareInvReference(IdctFunc ref_txfm, int thresh) {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- const int count_test_block = 10000;
- const int eob = 10;
- const int16_t *scan = av1_default_scan_orders[TX_16X16].scan;
- DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
- DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
-
- for (int i = 0; i < count_test_block; ++i) {
- for (int j = 0; j < kNumCoeffs; ++j) {
- if (j < eob) {
- // Random values less than the threshold, either positive or negative
- coeff[scan[j]] = rnd(thresh) * (1 - 2 * (i % 2));
- } else {
- coeff[scan[j]] = 0;
- }
- if (bit_depth_ == AOM_BITS_8) {
- dst[j] = 0;
- ref[j] = 0;
- } else {
- dst16[j] = 0;
- ref16[j] = 0;
- }
- }
- if (bit_depth_ == AOM_BITS_8) {
- ref_txfm(coeff, ref, pitch_);
- ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
- } else {
- ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
- ASM_REGISTER_STATE_CHECK(
- RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
- }
-
- for (int j = 0; j < kNumCoeffs; ++j) {
- const int diff =
- bit_depth_ == AOM_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
- const uint32_t error = diff * diff;
- EXPECT_EQ(0u, error) << "Error: 16x16 IDCT Comparison has error "
- << error << " at index " << j;
- }
- }
- }
-
- int pitch_;
- aom_bit_depth_t bit_depth_;
- int mask_;
- FhtFunc fwd_txfm_ref;
- IhtFunc inv_txfm_ref;
- TxfmParam txfm_param_;
-};
-
-class Trans16x16HT : public Trans16x16TestBase,
- public ::testing::TestWithParam<Ht16x16Param> {
- public:
- virtual ~Trans16x16HT() {}
-
- virtual void SetUp() {
- fwd_txfm_ = GET_PARAM(0);
- inv_txfm_ = GET_PARAM(1);
- bit_depth_ = GET_PARAM(3);
- pitch_ = 16;
- mask_ = (1 << bit_depth_) - 1;
- txfm_param_.tx_type = GET_PARAM(2);
- switch (bit_depth_) {
- case AOM_BITS_10:
- fwd_txfm_ref = fht16x16_10;
- inv_txfm_ref = iht16x16_10;
- break;
- case AOM_BITS_12:
- fwd_txfm_ref = fht16x16_12;
- inv_txfm_ref = iht16x16_12;
- break;
- default:
- fwd_txfm_ref = fht16x16_ref;
- inv_txfm_ref = iht16x16_ref;
- break;
- }
- }
- virtual void TearDown() { libaom_test::ClearSystemState(); }
-
- protected:
- void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
- fwd_txfm_(in, out, stride, &txfm_param_);
- }
- void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
- inv_txfm_(out, dst, stride, &txfm_param_);
- }
-
- FhtFunc fwd_txfm_;
- IhtFunc inv_txfm_;
-};
-
-TEST_P(Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(); }
-
-TEST_P(Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
-
-TEST_P(Trans16x16HT, MemCheck) { RunMemCheck(); }
-
-TEST_P(Trans16x16HT, QuantCheck) {
- // The encoder skips any non-DC intra prediction modes,
- // when the quantization step size goes beyond 988.
- RunQuantCheck(429, 729);
-}
-
-class InvTrans16x16DCT : public Trans16x16TestBase,
- public ::testing::TestWithParam<Idct16x16Param> {
- public:
- virtual ~InvTrans16x16DCT() {}
-
- virtual void SetUp() {
- ref_txfm_ = GET_PARAM(0);
- inv_txfm_ = GET_PARAM(1);
- thresh_ = GET_PARAM(2);
- bit_depth_ = GET_PARAM(3);
- pitch_ = 16;
- mask_ = (1 << bit_depth_) - 1;
- }
- virtual void TearDown() { libaom_test::ClearSystemState(); }
-
- protected:
- void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/, int /*stride*/) {}
- void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
- inv_txfm_(out, dst, stride);
- }
-
- IdctFunc ref_txfm_;
- IdctFunc inv_txfm_;
- int thresh_;
-};
-
-TEST_P(InvTrans16x16DCT, CompareReference) {
- CompareInvReference(ref_txfm_, thresh_);
-}
-
-class PartialTrans16x16Test : public ::testing::TestWithParam<
- std::tr1::tuple<FdctFunc, aom_bit_depth_t> > {
- public:
- virtual ~PartialTrans16x16Test() {}
- virtual void SetUp() {
- fwd_txfm_ = GET_PARAM(0);
- bit_depth_ = GET_PARAM(1);
- }
-
- virtual void TearDown() { libaom_test::ClearSystemState(); }
-
- protected:
- aom_bit_depth_t bit_depth_;
- FdctFunc fwd_txfm_;
-};
-
-TEST_P(PartialTrans16x16Test, Extremes) {
- const int16_t maxval =
- static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
- const int minval = -maxval;
- DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
-
- for (int i = 0; i < kNumCoeffs; ++i) input[i] = maxval;
- output[0] = 0;
- ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
- EXPECT_EQ((maxval * kNumCoeffs) >> 1, output[0]);
-
- for (int i = 0; i < kNumCoeffs; ++i) input[i] = minval;
- output[0] = 0;
- ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
- EXPECT_EQ((minval * kNumCoeffs) >> 1, output[0]);
-}
-
-TEST_P(PartialTrans16x16Test, Random) {
- const int16_t maxval =
- static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
- DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
- DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
- ACMRandom rnd(ACMRandom::DeterministicSeed());
-
- int sum = 0;
- for (int i = 0; i < kNumCoeffs; ++i) {
- const int val = (i & 1) ? -rnd(maxval + 1) : rnd(maxval + 1);
- input[i] = val;
- sum += val;
- }
- output[0] = 0;
- ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
- EXPECT_EQ(sum >> 1, output[0]);
-}
-
-using std::tr1::make_tuple;
-
-INSTANTIATE_TEST_CASE_P(
- C, Trans16x16HT,
- ::testing::Values(
- make_tuple(&fht16x16_10, &iht16x16_10, DCT_DCT, AOM_BITS_10),
- make_tuple(&fht16x16_10, &iht16x16_10, ADST_DCT, AOM_BITS_10),
- make_tuple(&fht16x16_10, &iht16x16_10, DCT_ADST, AOM_BITS_10),
- make_tuple(&fht16x16_10, &iht16x16_10, ADST_ADST, AOM_BITS_10),
- make_tuple(&fht16x16_12, &iht16x16_12, DCT_DCT, AOM_BITS_12),
- make_tuple(&fht16x16_12, &iht16x16_12, ADST_DCT, AOM_BITS_12),
- make_tuple(&fht16x16_12, &iht16x16_12, DCT_ADST, AOM_BITS_12),
- make_tuple(&fht16x16_12, &iht16x16_12, ADST_ADST, AOM_BITS_12),
- make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, DCT_DCT,
- AOM_BITS_8),
- make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, ADST_DCT,
- AOM_BITS_8),
- make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, DCT_ADST,
- AOM_BITS_8),
- make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, ADST_ADST,
- AOM_BITS_8)));
-
-#if HAVE_SSE2
-INSTANTIATE_TEST_CASE_P(
- SSE2, Trans16x16HT,
- ::testing::Values(make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c,
- DCT_DCT, AOM_BITS_8),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c,
- ADST_DCT, AOM_BITS_8),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c,
- DCT_ADST, AOM_BITS_8),
- make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c,
- ADST_ADST, AOM_BITS_8)));
-#endif // HAVE_SSE2
-} // namespace
diff --git a/test/test.cmake b/test/test.cmake
index c1af523..44ea05c 100644
--- a/test/test.cmake
+++ b/test/test.cmake
@@ -112,7 +112,6 @@
if (NOT BUILD_SHARED_LIBS)
set(AOM_UNIT_TEST_ENCODER_SOURCES
${AOM_UNIT_TEST_ENCODER_SOURCES}
- "${AOM_ROOT}/test/dct16x16_test.cc"
"${AOM_ROOT}/test/dct32x32_test.cc"
"${AOM_ROOT}/test/sad_test.cc")
endif ()
@@ -206,7 +205,6 @@
${AOM_UNIT_TEST_ENCODER_SOURCES}
"${AOM_ROOT}/test/arf_freq_test.cc"
"${AOM_ROOT}/test/av1_dct_test.cc"
- "${AOM_ROOT}/test/av1_fht16x16_test.cc"
"${AOM_ROOT}/test/av1_fht8x8_test.cc"
"${AOM_ROOT}/test/av1_fwd_txfm1d_test.cc"
"${AOM_ROOT}/test/av1_fwd_txfm2d_test.cc"