2016-02-29 20:53:42 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
*/
|
|
|
|
#ifndef TEST_TRANSFORM_TEST_BASE_H_
|
|
|
|
#define TEST_TRANSFORM_TEST_BASE_H_
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "./aom_config.h"
|
|
|
|
#include "aom_mem/aom_mem.h"
|
|
|
|
#include "aom/aom_codec.h"
|
2016-02-29 20:53:42 +03:00
|
|
|
|
2016-08-23 02:08:15 +03:00
|
|
|
namespace libaom_test {
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
// Note:
|
2016-08-31 00:01:10 +03:00
|
|
|
// Same constant are defined in av1/common/av1_entropy.h and
|
2016-08-23 02:08:15 +03:00
|
|
|
// av1/common/entropy.h. Goal is to make this base class
|
2016-02-29 20:53:42 +03:00
|
|
|
// to use for future codec transform testing. But including
|
|
|
|
// either of them would lead to compiling error when we do
|
|
|
|
// unit test for another codec. Suggest to move the definition
|
2016-08-31 00:01:10 +03:00
|
|
|
// to a aom header file.
|
2016-02-29 20:53:42 +03:00
|
|
|
const int kDctMaxValue = 16384;
|
|
|
|
|
|
|
|
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
|
|
|
|
int tx_type);
|
|
|
|
|
2016-09-29 11:14:54 +03:00
|
|
|
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|
|
|
int tx_type);
|
|
|
|
|
2016-02-29 20:53:42 +03:00
|
|
|
class TransformTestBase {
|
|
|
|
public:
|
|
|
|
virtual ~TransformTestBase() {}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) = 0;
|
|
|
|
|
|
|
|
virtual void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) = 0;
|
|
|
|
|
|
|
|
void RunAccuracyCheck(int limit) {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
uint32_t max_error = 0;
|
|
|
|
int64_t total_error = 0;
|
|
|
|
const int count_test_block = 10000;
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
int16_t *test_input_block = reinterpret_cast<int16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(int16_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
tran_low_t *test_temp_block = reinterpret_cast<tran_low_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
uint8_t *dst = reinterpret_cast<uint8_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
uint8_t *src = reinterpret_cast<uint8_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
|
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-08-12 03:46:05 +03:00
|
|
|
uint16_t *dst16 = reinterpret_cast<uint16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
uint16_t *src16 = reinterpret_cast<uint16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
|
2016-02-29 20:53:42 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
|
|
|
// Initialize a test block with input range [-255, 255].
|
|
|
|
for (int j = 0; j < num_coeffs_; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2016-02-29 20:53:42 +03:00
|
|
|
src[j] = rnd.Rand8();
|
|
|
|
dst[j] = rnd.Rand8();
|
|
|
|
test_input_block[j] = src[j] - dst[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-02-29 20:53:42 +03:00
|
|
|
} else {
|
|
|
|
src16[j] = rnd.Rand16() & mask_;
|
|
|
|
dst16[j] = rnd.Rand16() & mask_;
|
|
|
|
test_input_block[j] = src16[j] - dst16[j];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunFwdTxfm(test_input_block, test_temp_block, pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2016-02-29 20:53:42 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-02-29 20:53:42 +03:00
|
|
|
} else {
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
|
2016-02-29 20:53:42 +03:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int j = 0; j < num_coeffs_; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-02-29 20:53:42 +03:00
|
|
|
const uint32_t diff =
|
2016-08-31 00:01:10 +03:00
|
|
|
bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
2016-02-29 20:53:42 +03:00
|
|
|
#else
|
2016-08-31 00:01:10 +03:00
|
|
|
ASSERT_EQ(AOM_BITS_8, bit_depth_);
|
2016-02-29 20:53:42 +03:00
|
|
|
const uint32_t diff = dst[j] - src[j];
|
|
|
|
#endif
|
|
|
|
const uint32_t error = diff * diff;
|
2016-08-12 03:46:05 +03:00
|
|
|
if (max_error < error) max_error = error;
|
2016-02-29 20:53:42 +03:00
|
|
|
total_error += error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EXPECT_GE(static_cast<uint32_t>(limit), max_error)
|
2016-08-12 03:46:05 +03:00
|
|
|
<< "Error: 4x4 FHT/IHT has an individual round trip error > " << limit;
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
EXPECT_GE(count_test_block * limit, total_error)
|
|
|
|
<< "Error: 4x4 FHT/IHT has average round trip error > " << limit
|
|
|
|
<< " per block";
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_free(test_input_block);
|
|
|
|
aom_free(test_temp_block);
|
|
|
|
aom_free(dst);
|
|
|
|
aom_free(src);
|
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
|
|
|
aom_free(dst16);
|
|
|
|
aom_free(src16);
|
2016-02-29 20:53:42 +03:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void RunCoeffCheck() {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 5000;
|
|
|
|
|
2016-10-13 17:10:14 +03:00
|
|
|
// Use a stride value which is not the width of any transform, to catch
|
|
|
|
// cases where the transforms use the stride incorrectly.
|
|
|
|
int stride = 96;
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
int16_t *input_block = reinterpret_cast<int16_t *>(
|
2016-10-13 17:10:14 +03:00
|
|
|
aom_memalign(16, sizeof(int16_t) * stride * height_));
|
2016-08-12 03:46:05 +03:00
|
|
|
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
tran_low_t *output_block = reinterpret_cast<tran_low_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
2016-10-13 17:10:14 +03:00
|
|
|
int j, k;
|
|
|
|
for (j = 0; j < height_; ++j) {
|
|
|
|
for (k = 0; k < pitch_; ++k) {
|
|
|
|
int in_idx = j * stride + k;
|
|
|
|
int out_idx = j * pitch_ + k;
|
|
|
|
input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
|
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
|
|
|
output_block[out_idx] = output_ref_block[out_idx] = rnd.Rand8();
|
2016-09-29 11:14:54 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-10-13 17:10:14 +03:00
|
|
|
} else {
|
|
|
|
output_block[out_idx] = output_ref_block[out_idx] =
|
|
|
|
rnd.Rand16() & mask_;
|
2016-09-29 11:14:54 +03:00
|
|
|
#endif
|
2016-10-13 17:10:14 +03:00
|
|
|
}
|
2016-09-29 11:14:54 +03:00
|
|
|
}
|
|
|
|
}
|
2016-02-29 20:53:42 +03:00
|
|
|
|
2016-10-13 17:10:14 +03:00
|
|
|
fwd_txfm_ref(input_block, output_ref_block, stride, tx_type_);
|
|
|
|
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, stride));
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
// The minimum quant value is 4.
|
2016-10-13 17:10:14 +03:00
|
|
|
for (j = 0; j < height_; ++j) {
|
|
|
|
for (k = 0; k < pitch_; ++k) {
|
|
|
|
int out_idx = j * pitch_ + k;
|
|
|
|
ASSERT_EQ(output_block[out_idx], output_ref_block[out_idx])
|
|
|
|
<< "Error: not bit-exact result at index: " << out_idx
|
|
|
|
<< " at test block: " << i;
|
|
|
|
}
|
2016-02-29 20:53:42 +03:00
|
|
|
}
|
|
|
|
}
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_free(input_block);
|
|
|
|
aom_free(output_ref_block);
|
|
|
|
aom_free(output_block);
|
2016-02-29 20:53:42 +03:00
|
|
|
}
|
|
|
|
|
2016-09-29 11:14:54 +03:00
|
|
|
void RunInvCoeffCheck() {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 5000;
|
|
|
|
|
2016-10-13 17:10:14 +03:00
|
|
|
// Use a stride value which is not the width of any transform, to catch
|
|
|
|
// cases where the transforms use the stride incorrectly.
|
|
|
|
int stride = 96;
|
|
|
|
|
2016-09-29 11:14:54 +03:00
|
|
|
int16_t *input_block = reinterpret_cast<int16_t *>(
|
|
|
|
aom_memalign(16, sizeof(int16_t) * num_coeffs_));
|
|
|
|
tran_low_t *trans_block = reinterpret_cast<tran_low_t *>(
|
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
|
|
|
uint8_t *output_block = reinterpret_cast<uint8_t *>(
|
2016-10-13 17:10:14 +03:00
|
|
|
aom_memalign(16, sizeof(uint8_t) * stride * height_));
|
2016-09-29 11:14:54 +03:00
|
|
|
uint8_t *output_ref_block = reinterpret_cast<uint8_t *>(
|
2016-10-13 17:10:14 +03:00
|
|
|
aom_memalign(16, sizeof(uint8_t) * stride * height_));
|
2016-09-29 11:14:54 +03:00
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
2016-10-13 17:10:14 +03:00
|
|
|
int j, k;
|
|
|
|
for (j = 0; j < height_; ++j) {
|
|
|
|
for (k = 0; k < pitch_; ++k) {
|
|
|
|
int in_idx = j * pitch_ + k;
|
|
|
|
int out_idx = j * stride + k;
|
|
|
|
input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
|
|
|
|
output_ref_block[out_idx] = rnd.Rand16() & mask_;
|
|
|
|
output_block[out_idx] = output_ref_block[out_idx];
|
|
|
|
}
|
2016-09-29 11:14:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fwd_txfm_ref(input_block, trans_block, pitch_, tx_type_);
|
|
|
|
|
2016-10-13 17:10:14 +03:00
|
|
|
inv_txfm_ref(trans_block, output_ref_block, stride, tx_type_);
|
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(trans_block, output_block, stride));
|
2016-09-29 11:14:54 +03:00
|
|
|
|
2016-10-13 17:10:14 +03:00
|
|
|
for (j = 0; j < height_; ++j) {
|
|
|
|
for (k = 0; k < pitch_; ++k) {
|
|
|
|
int out_idx = j * stride + k;
|
|
|
|
ASSERT_EQ(output_block[out_idx], output_ref_block[out_idx])
|
|
|
|
<< "Error: not bit-exact result at index: " << out_idx
|
|
|
|
<< " at test block: " << i;
|
|
|
|
}
|
2016-09-29 11:14:54 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
aom_free(input_block);
|
|
|
|
aom_free(trans_block);
|
|
|
|
aom_free(output_ref_block);
|
|
|
|
aom_free(output_block);
|
|
|
|
}
|
|
|
|
|
2016-02-29 20:53:42 +03:00
|
|
|
void RunMemCheck() {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 5000;
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
int16_t *input_extreme_block = reinterpret_cast<int16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(int16_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
tran_low_t *output_ref_block = reinterpret_cast<tran_low_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
tran_low_t *output_block = reinterpret_cast<tran_low_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
|
|
|
for (int j = 0; j < num_coeffs_; ++j) {
|
|
|
|
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
|
|
|
|
}
|
|
|
|
if (i == 0) {
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = mask_;
|
2016-02-29 20:53:42 +03:00
|
|
|
} else if (i == 1) {
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_;
|
2016-02-29 20:53:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunFwdTxfm(input_extreme_block, output_block, pitch_));
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
int row_length = FindRowLength();
|
|
|
|
// The minimum quant value is 4.
|
|
|
|
for (int j = 0; j < num_coeffs_; ++j) {
|
|
|
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
|
|
|
EXPECT_GE(row_length * kDctMaxValue << (bit_depth_ - 8),
|
|
|
|
abs(output_block[j]))
|
|
|
|
<< "Error: NxN FDCT has coefficient larger than N*DCT_MAX_VALUE";
|
|
|
|
}
|
|
|
|
}
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_free(input_extreme_block);
|
|
|
|
aom_free(output_ref_block);
|
|
|
|
aom_free(output_block);
|
2016-02-29 20:53:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void RunInvAccuracyCheck(int limit) {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 1000;
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
int16_t *in = reinterpret_cast<int16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(int16_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
tran_low_t *coeff = reinterpret_cast<tran_low_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(tran_low_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
uint8_t *dst = reinterpret_cast<uint8_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
uint8_t *src = reinterpret_cast<uint8_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
|
2016-02-29 20:53:42 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-08-12 03:46:05 +03:00
|
|
|
uint16_t *dst16 = reinterpret_cast<uint16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
|
2016-08-12 03:46:05 +03:00
|
|
|
uint16_t *src16 = reinterpret_cast<uint16_t *>(
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
|
2016-02-29 20:53:42 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
|
|
|
for (int j = 0; j < num_coeffs_; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2016-02-29 20:53:42 +03:00
|
|
|
src[j] = rnd.Rand8();
|
|
|
|
dst[j] = rnd.Rand8();
|
|
|
|
in[j] = src[j] - dst[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-02-29 20:53:42 +03:00
|
|
|
} else {
|
|
|
|
src16[j] = rnd.Rand16() & mask_;
|
|
|
|
dst16[j] = rnd.Rand16() & mask_;
|
|
|
|
in[j] = src16[j] - dst16[j];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fwd_txfm_ref(in, coeff, pitch_, tx_type_);
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2016-02-29 20:53:42 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-02-29 20:53:42 +03:00
|
|
|
} else {
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
|
2016-02-29 20:53:42 +03:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int j = 0; j < num_coeffs_; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-02-29 20:53:42 +03:00
|
|
|
const uint32_t diff =
|
2016-08-31 00:01:10 +03:00
|
|
|
bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
2016-02-29 20:53:42 +03:00
|
|
|
#else
|
|
|
|
const uint32_t diff = dst[j] - src[j];
|
|
|
|
#endif
|
|
|
|
const uint32_t error = diff * diff;
|
|
|
|
EXPECT_GE(static_cast<uint32_t>(limit), error)
|
2016-08-12 03:46:05 +03:00
|
|
|
<< "Error: 4x4 IDCT has error " << error << " at index " << j;
|
2016-02-29 20:53:42 +03:00
|
|
|
}
|
|
|
|
}
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_free(in);
|
|
|
|
aom_free(coeff);
|
|
|
|
aom_free(dst);
|
|
|
|
aom_free(src);
|
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
|
|
|
aom_free(src16);
|
|
|
|
aom_free(dst16);
|
2016-02-29 20:53:42 +03:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int pitch_;
|
2016-10-13 17:10:14 +03:00
|
|
|
int height_;
|
2016-02-29 20:53:42 +03:00
|
|
|
int tx_type_;
|
|
|
|
FhtFunc fwd_txfm_ref;
|
2016-09-29 11:14:54 +03:00
|
|
|
IhtFunc inv_txfm_ref;
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_bit_depth_t bit_depth_;
|
2016-02-29 20:53:42 +03:00
|
|
|
int mask_;
|
|
|
|
int num_coeffs_;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Assume transform size is 4x4, 8x8, 16x16,...
|
|
|
|
int FindRowLength() const {
|
|
|
|
int row = 4;
|
|
|
|
if (16 == num_coeffs_) {
|
|
|
|
row = 4;
|
|
|
|
} else if (64 == num_coeffs_) {
|
|
|
|
row = 8;
|
|
|
|
} else if (256 == num_coeffs_) {
|
|
|
|
row = 16;
|
|
|
|
} else if (1024 == num_coeffs_) {
|
|
|
|
row = 32;
|
|
|
|
}
|
|
|
|
return row;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-08-23 02:08:15 +03:00
|
|
|
} // namespace libaom_test
|
2016-02-29 20:53:42 +03:00
|
|
|
|
|
|
|
#endif // TEST_TRANSFORM_TEST_BASE_H_
|