mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 23:07:33 +09:00
Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614
This commit is contained in:
parent
debbee1e2a
commit
992c6637e3
429 changed files with 76047 additions and 40937 deletions
6
third_party/aom/test/ans_test.cc
vendored
6
third_party/aom/test/ans_test.cc
vendored
|
|
@ -51,7 +51,8 @@ PvVec abs_encode_build_vals(int iters) {
|
|||
|
||||
bool check_rabs(const PvVec &pv_vec, uint8_t *buf) {
|
||||
BufAnsCoder a;
|
||||
aom_buf_ans_alloc(&a, NULL, kBufAnsSize);
|
||||
a.size = kBufAnsSize;
|
||||
aom_buf_ans_alloc(&a, NULL);
|
||||
buf_ans_write_init(&a, buf);
|
||||
|
||||
std::clock_t start = std::clock();
|
||||
|
|
@ -125,7 +126,8 @@ void rans_build_dec_tab(const struct rans_sym sym_tab[],
|
|||
bool check_rans(const std::vector<int> &sym_vec, const rans_sym *const tab,
|
||||
uint8_t *buf) {
|
||||
BufAnsCoder a;
|
||||
aom_buf_ans_alloc(&a, NULL, kBufAnsSize);
|
||||
a.size = kBufAnsSize;
|
||||
aom_buf_ans_alloc(&a, NULL);
|
||||
buf_ans_write_init(&a, buf);
|
||||
aom_cdf_prob dec_tab[kRansSymbols];
|
||||
rans_build_dec_tab(tab, dec_tab);
|
||||
|
|
|
|||
2
third_party/aom/test/aq_segment_test.cc
vendored
2
third_party/aom/test/aq_segment_test.cc
vendored
|
|
@ -90,7 +90,7 @@ TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ2) { DoTest(2); }
|
|||
|
||||
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ3) { DoTest(3); }
|
||||
|
||||
#if CONFIG_DELTA_Q & !CONFIG_EXT_DELTA_Q
|
||||
#if !CONFIG_EXT_DELTA_Q
|
||||
// Validate that this AQ mode (AQ=4, delta q)
|
||||
// encodes and decodes without a mismatch.
|
||||
TEST_P(AqSegmentTest, TestNoMisMatchAQ4) {
|
||||
|
|
|
|||
4
third_party/aom/test/av1_convolve_2d_test.cc
vendored
4
third_party/aom/test/av1_convolve_2d_test.cc
vendored
|
|
@ -22,14 +22,14 @@ using libaom_test::AV1HighbdConvolve2D::AV1HighbdConvolve2DTest;
|
|||
|
||||
namespace {
|
||||
|
||||
TEST_P(AV1Convolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); }
|
||||
TEST_P(AV1Convolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(2)); }
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, AV1Convolve2DTest,
|
||||
libaom_test::AV1Convolve2D::BuildParams(av1_convolve_2d_sse2));
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH && HAVE_SSSE3
|
||||
TEST_P(AV1HighbdConvolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(4)); }
|
||||
TEST_P(AV1HighbdConvolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); }
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, AV1HighbdConvolve2DTest,
|
||||
libaom_test::AV1HighbdConvolve2D::BuildParams(
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ namespace AV1Convolve2D {
|
|||
::testing::internal::ParamGenerator<Convolve2DParam> BuildParams(
|
||||
convolve_2d_func filter) {
|
||||
const Convolve2DParam params[] = {
|
||||
make_tuple(4, 4, 20, filter), make_tuple(8, 8, 10, filter),
|
||||
make_tuple(64, 64, 1, filter), make_tuple(4, 16, 10, filter),
|
||||
make_tuple(32, 8, 5, filter),
|
||||
make_tuple(4, 4, filter), make_tuple(8, 8, filter),
|
||||
make_tuple(64, 64, filter), make_tuple(4, 16, filter),
|
||||
make_tuple(32, 8, filter),
|
||||
};
|
||||
return ::testing::ValuesIn(params);
|
||||
}
|
||||
|
|
@ -38,7 +38,6 @@ void AV1Convolve2DTest::TearDown() { libaom_test::ClearSystemState(); }
|
|||
void AV1Convolve2DTest::RunCheckOutput(convolve_2d_func test_impl) {
|
||||
const int w = 128, h = 128;
|
||||
const int out_w = GET_PARAM(0), out_h = GET_PARAM(1);
|
||||
const int num_iters = GET_PARAM(2);
|
||||
int i, j, k;
|
||||
|
||||
uint8_t *input = new uint8_t[h * w];
|
||||
|
|
@ -50,9 +49,6 @@ void AV1Convolve2DTest::RunCheckOutput(convolve_2d_func test_impl) {
|
|||
for (i = 0; i < h; ++i)
|
||||
for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand8();
|
||||
|
||||
memset(output, 0, output_n * sizeof(CONV_BUF_TYPE));
|
||||
memset(output2, 0, output_n * sizeof(CONV_BUF_TYPE));
|
||||
|
||||
int hfilter, vfilter, subx, suby;
|
||||
for (hfilter = EIGHTTAP_REGULAR; hfilter < INTERP_FILTERS_ALL; ++hfilter) {
|
||||
for (vfilter = EIGHTTAP_REGULAR; vfilter < INTERP_FILTERS_ALL; ++vfilter) {
|
||||
|
|
@ -60,13 +56,20 @@ void AV1Convolve2DTest::RunCheckOutput(convolve_2d_func test_impl) {
|
|||
av1_get_interp_filter_params((InterpFilter)hfilter);
|
||||
InterpFilterParams filter_params_y =
|
||||
av1_get_interp_filter_params((InterpFilter)vfilter);
|
||||
const int do_average = rnd_.Rand8() & 1;
|
||||
ConvolveParams conv_params1 =
|
||||
get_conv_params_no_round(0, 0, 0, output, MAX_SB_SIZE);
|
||||
get_conv_params_no_round(0, do_average, 0, output, MAX_SB_SIZE);
|
||||
ConvolveParams conv_params2 =
|
||||
get_conv_params_no_round(0, 0, 0, output2, MAX_SB_SIZE);
|
||||
get_conv_params_no_round(0, do_average, 0, output2, MAX_SB_SIZE);
|
||||
|
||||
for (subx = 0; subx < 16; ++subx)
|
||||
for (suby = 0; suby < 16; ++suby) {
|
||||
// av1_convolve_2d is designed for accumulate two predicted blocks for
|
||||
// compound mode, so we set num_iter to two here.
|
||||
// A larger number may introduce overflow
|
||||
const int num_iters = 2;
|
||||
memset(output, 0, output_n * sizeof(*output));
|
||||
memset(output2, 0, output_n * sizeof(*output2));
|
||||
for (i = 0; i < num_iters; ++i) {
|
||||
// Choose random locations within the source block
|
||||
int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7);
|
||||
|
|
@ -102,14 +105,14 @@ namespace AV1HighbdConvolve2D {
|
|||
::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams(
|
||||
highbd_convolve_2d_func filter) {
|
||||
const HighbdConvolve2DParam params[] = {
|
||||
make_tuple(4, 4, 20, 8, filter), make_tuple(8, 8, 10, 8, filter),
|
||||
make_tuple(64, 64, 1, 8, filter), make_tuple(4, 16, 10, 8, filter),
|
||||
make_tuple(32, 8, 10, 8, filter), make_tuple(4, 4, 20, 10, filter),
|
||||
make_tuple(8, 8, 10, 10, filter), make_tuple(64, 64, 1, 10, filter),
|
||||
make_tuple(4, 16, 10, 10, filter), make_tuple(32, 8, 10, 10, filter),
|
||||
make_tuple(4, 4, 20, 12, filter), make_tuple(8, 8, 10, 12, filter),
|
||||
make_tuple(64, 64, 1, 12, filter), make_tuple(4, 16, 10, 12, filter),
|
||||
make_tuple(32, 8, 10, 12, filter),
|
||||
make_tuple(4, 4, 8, filter), make_tuple(8, 8, 8, filter),
|
||||
make_tuple(64, 64, 8, filter), make_tuple(4, 16, 8, filter),
|
||||
make_tuple(32, 8, 8, filter), make_tuple(4, 4, 10, filter),
|
||||
make_tuple(8, 8, 10, filter), make_tuple(64, 64, 10, filter),
|
||||
make_tuple(4, 16, 10, filter), make_tuple(32, 8, 10, filter),
|
||||
make_tuple(4, 4, 12, filter), make_tuple(8, 8, 12, filter),
|
||||
make_tuple(64, 64, 12, filter), make_tuple(4, 16, 12, filter),
|
||||
make_tuple(32, 8, 12, filter),
|
||||
};
|
||||
return ::testing::ValuesIn(params);
|
||||
}
|
||||
|
|
@ -125,8 +128,7 @@ void AV1HighbdConvolve2DTest::RunCheckOutput(
|
|||
highbd_convolve_2d_func test_impl) {
|
||||
const int w = 128, h = 128;
|
||||
const int out_w = GET_PARAM(0), out_h = GET_PARAM(1);
|
||||
const int num_iters = GET_PARAM(2);
|
||||
const int bd = GET_PARAM(3);
|
||||
const int bd = GET_PARAM(2);
|
||||
int i, j, k;
|
||||
|
||||
uint16_t *input = new uint16_t[h * w];
|
||||
|
|
@ -138,9 +140,6 @@ void AV1HighbdConvolve2DTest::RunCheckOutput(
|
|||
for (i = 0; i < h; ++i)
|
||||
for (j = 0; j < w; ++j) input[i * w + j] = rnd_.Rand16() & ((1 << bd) - 1);
|
||||
|
||||
memset(output, 0, output_n * sizeof(CONV_BUF_TYPE));
|
||||
memset(output2, 0, output_n * sizeof(CONV_BUF_TYPE));
|
||||
|
||||
int hfilter, vfilter, subx, suby;
|
||||
for (hfilter = EIGHTTAP_REGULAR; hfilter < INTERP_FILTERS_ALL; ++hfilter) {
|
||||
for (vfilter = EIGHTTAP_REGULAR; vfilter < INTERP_FILTERS_ALL; ++vfilter) {
|
||||
|
|
@ -155,6 +154,12 @@ void AV1HighbdConvolve2DTest::RunCheckOutput(
|
|||
|
||||
for (subx = 0; subx < 16; ++subx)
|
||||
for (suby = 0; suby < 16; ++suby) {
|
||||
// av1_convolve_2d is designed for accumulate two predicted blocks for
|
||||
// compound mode, so we set num_iter to two here.
|
||||
// A larger number may introduce overflow
|
||||
const int num_iters = 2;
|
||||
memset(output, 0, output_n * sizeof(*output));
|
||||
memset(output2, 0, output_n * sizeof(*output2));
|
||||
for (i = 0; i < num_iters; ++i) {
|
||||
// Choose random locations within the source block
|
||||
int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ typedef void (*convolve_2d_func)(const uint8_t *src, int src_stride,
|
|||
const int subpel_x_q4, const int subpel_y_q4,
|
||||
ConvolveParams *conv_params);
|
||||
|
||||
typedef std::tr1::tuple<int, int, int, convolve_2d_func> Convolve2DParam;
|
||||
typedef std::tr1::tuple<int, int, convolve_2d_func> Convolve2DParam;
|
||||
|
||||
::testing::internal::ParamGenerator<Convolve2DParam> BuildParams(
|
||||
convolve_2d_func filter);
|
||||
|
|
@ -59,7 +59,7 @@ typedef void (*highbd_convolve_2d_func)(
|
|||
InterpFilterParams *filter_params_y, const int subpel_x_q4,
|
||||
const int subpel_y_q4, ConvolveParams *conv_params, int bd);
|
||||
|
||||
typedef std::tr1::tuple<int, int, int, int, highbd_convolve_2d_func>
|
||||
typedef std::tr1::tuple<int, int, int, highbd_convolve_2d_func>
|
||||
HighbdConvolve2DParam;
|
||||
|
||||
::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams(
|
||||
|
|
|
|||
469
third_party/aom/test/av1_convolve_scale_test.cc
vendored
Normal file
469
third_party/aom/test/av1_convolve_scale_test.cc
vendored
Normal file
|
|
@ -0,0 +1,469 @@
|
|||
/*
|
||||
* 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 <vector>
|
||||
|
||||
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
|
||||
|
||||
#include "./av1_rtcd.h"
|
||||
#include "aom_ports/aom_timer.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
namespace {
|
||||
const int kTestIters = 10;
|
||||
const int kPerfIters = 1000;
|
||||
|
||||
const int kVPad = 32;
|
||||
const int kHPad = 32;
|
||||
const int kXStepQn = 16;
|
||||
const int kYStepQn = 20;
|
||||
|
||||
using std::tr1::tuple;
|
||||
using std::tr1::make_tuple;
|
||||
using libaom_test::ACMRandom;
|
||||
|
||||
enum NTaps { EIGHT_TAP, TEN_TAP, TWELVE_TAP };
|
||||
int NTapsToInt(NTaps ntaps) { return 8 + static_cast<int>(ntaps) * 2; }
|
||||
|
||||
// A 16-bit filter with a configurable number of taps.
|
||||
class TestFilter {
|
||||
public:
|
||||
void set(NTaps ntaps, bool backwards);
|
||||
|
||||
InterpFilterParams params_;
|
||||
|
||||
private:
|
||||
std::vector<int16_t> coeffs_;
|
||||
};
|
||||
|
||||
void TestFilter::set(NTaps ntaps, bool backwards) {
|
||||
const int n = NTapsToInt(ntaps);
|
||||
assert(n >= 8 && n <= 12);
|
||||
|
||||
// The filter has n * SUBPEL_SHIFTS proper elements and an extra 8 bogus
|
||||
// elements at the end so that convolutions can read off the end safely.
|
||||
coeffs_.resize(n * SUBPEL_SHIFTS + 8);
|
||||
|
||||
// The coefficients are pretty much arbitrary, but convolutions shouldn't
|
||||
// over or underflow. For the first filter (subpels = 0), we use an
|
||||
// increasing or decreasing ramp (depending on the backwards parameter). We
|
||||
// don't want any zero coefficients, so we make it have an x-intercept at -1
|
||||
// or n. To ensure absence of under/overflow, we normalise the area under the
|
||||
// ramp to be I = 1 << FILTER_BITS (so that convolving a constant function
|
||||
// gives the identity).
|
||||
//
|
||||
// When increasing, the function has the form:
|
||||
//
|
||||
// f(x) = A * (x + 1)
|
||||
//
|
||||
// Summing and rearranging for A gives A = 2 * I / (n * (n + 1)). If the
|
||||
// filter is reversed, we have the same A but with formula
|
||||
//
|
||||
// g(x) = A * (n - x)
|
||||
const int I = 1 << FILTER_BITS;
|
||||
const float A = 2.f * I / (n * (n + 1.f));
|
||||
for (int i = 0; i < n; ++i) {
|
||||
coeffs_[i] = static_cast<int16_t>(A * (backwards ? (n - i) : (i + 1)));
|
||||
}
|
||||
|
||||
// For the other filters, make them slightly different by swapping two
|
||||
// columns. Filter k will have the columns (k % n) and (7 * k) % n swapped.
|
||||
const size_t filter_size = sizeof(coeffs_[0] * n);
|
||||
int16_t *const filter0 = &coeffs_[0];
|
||||
for (int k = 1; k < SUBPEL_SHIFTS; ++k) {
|
||||
int16_t *filterk = &coeffs_[k * n];
|
||||
memcpy(filterk, filter0, filter_size);
|
||||
|
||||
const int idx0 = k % n;
|
||||
const int idx1 = (7 * k) % n;
|
||||
|
||||
const int16_t tmp = filterk[idx0];
|
||||
filterk[idx0] = filterk[idx1];
|
||||
filterk[idx1] = tmp;
|
||||
}
|
||||
|
||||
// Finally, write some rubbish at the end to make sure we don't use it.
|
||||
for (int i = 0; i < 8; ++i) coeffs_[n * SUBPEL_SHIFTS + i] = 123 + i;
|
||||
|
||||
// Fill in params
|
||||
params_.filter_ptr = &coeffs_[0];
|
||||
params_.taps = n;
|
||||
// These are ignored by the functions being tested. Set them to whatever.
|
||||
params_.subpel_shifts = SUBPEL_SHIFTS;
|
||||
params_.interp_filter = EIGHTTAP_REGULAR;
|
||||
}
|
||||
|
||||
template <typename SrcPixel>
|
||||
class TestImage {
|
||||
public:
|
||||
TestImage(int w, int h, int bd) : w_(w), h_(h), bd_(bd) {
|
||||
assert(bd < 16);
|
||||
assert(bd <= 8 * static_cast<int>(sizeof(SrcPixel)));
|
||||
|
||||
// Pad width by 2*kHPad and then round up to the next multiple of 16
|
||||
// to get src_stride_. Add another 16 for dst_stride_ (to make sure
|
||||
// something goes wrong if we use the wrong one)
|
||||
src_stride_ = (w_ + 2 * kHPad + 15) & ~15;
|
||||
dst_stride_ = src_stride_ + 16;
|
||||
|
||||
// Allocate image data
|
||||
src_data_.resize(2 * src_block_size());
|
||||
dst_data_.resize(2 * dst_block_size());
|
||||
}
|
||||
|
||||
void Initialize(ACMRandom *rnd);
|
||||
void Check() const;
|
||||
|
||||
int src_stride() const { return src_stride_; }
|
||||
int dst_stride() const { return dst_stride_; }
|
||||
|
||||
int src_block_size() const { return (h_ + 2 * kVPad) * src_stride(); }
|
||||
int dst_block_size() const { return (h_ + 2 * kVPad) * dst_stride(); }
|
||||
|
||||
const SrcPixel *GetSrcData(bool ref, bool borders) const {
|
||||
const SrcPixel *block = &src_data_[ref ? 0 : src_block_size()];
|
||||
return borders ? block : block + kHPad + src_stride_ * kVPad;
|
||||
}
|
||||
|
||||
int32_t *GetDstData(bool ref, bool borders) {
|
||||
int32_t *block = &dst_data_[ref ? 0 : dst_block_size()];
|
||||
return borders ? block : block + kHPad + dst_stride_ * kVPad;
|
||||
}
|
||||
|
||||
private:
|
||||
int w_, h_, bd_;
|
||||
int src_stride_, dst_stride_;
|
||||
|
||||
std::vector<SrcPixel> src_data_;
|
||||
std::vector<int32_t> dst_data_;
|
||||
};
|
||||
|
||||
template <typename Pixel>
|
||||
void FillEdge(ACMRandom *rnd, int num_pixels, int bd, bool trash, Pixel *data) {
|
||||
if (!trash) {
|
||||
memset(data, 0, sizeof(*data) * num_pixels);
|
||||
return;
|
||||
}
|
||||
const Pixel mask = (1 << bd) - 1;
|
||||
for (int i = 0; i < num_pixels; ++i) data[i] = rnd->Rand16() & mask;
|
||||
}
|
||||
|
||||
template <typename Pixel>
|
||||
void PrepBuffers(ACMRandom *rnd, int w, int h, int stride, int bd,
|
||||
bool trash_edges, Pixel *data) {
|
||||
assert(rnd);
|
||||
const Pixel mask = (1 << bd) - 1;
|
||||
|
||||
// Fill in the first buffer with random data
|
||||
// Top border
|
||||
FillEdge(rnd, stride * kVPad, bd, trash_edges, data);
|
||||
for (int r = 0; r < h; ++r) {
|
||||
Pixel *row_data = data + (kVPad + r) * stride;
|
||||
// Left border, contents, right border
|
||||
FillEdge(rnd, kHPad, bd, trash_edges, row_data);
|
||||
for (int c = 0; c < w; ++c) row_data[kHPad + c] = rnd->Rand16() & mask;
|
||||
FillEdge(rnd, kHPad, bd, trash_edges, row_data + kHPad + w);
|
||||
}
|
||||
// Bottom border
|
||||
FillEdge(rnd, stride * kVPad, bd, trash_edges, data + stride * (kVPad + h));
|
||||
|
||||
const int bpp = sizeof(*data);
|
||||
const int block_elts = stride * (h + 2 * kVPad);
|
||||
const int block_size = bpp * block_elts;
|
||||
|
||||
// Now copy that to the second buffer
|
||||
memcpy(data + block_elts, data, block_size);
|
||||
}
|
||||
|
||||
template <typename SrcPixel>
|
||||
void TestImage<SrcPixel>::Initialize(ACMRandom *rnd) {
|
||||
PrepBuffers(rnd, w_, h_, src_stride_, bd_, false, &src_data_[0]);
|
||||
PrepBuffers(rnd, w_, h_, dst_stride_, bd_, true, &dst_data_[0]);
|
||||
}
|
||||
|
||||
template <typename SrcPixel>
|
||||
void TestImage<SrcPixel>::Check() const {
|
||||
// If memcmp returns 0, there's nothing to do.
|
||||
const int num_pixels = dst_block_size();
|
||||
const int32_t *ref_dst = &dst_data_[0];
|
||||
const int32_t *tst_dst = &dst_data_[num_pixels];
|
||||
|
||||
if (0 == memcmp(ref_dst, tst_dst, sizeof(*ref_dst) * num_pixels)) return;
|
||||
|
||||
// Otherwise, iterate through the buffer looking for differences (including
|
||||
// the edges)
|
||||
const int stride = dst_stride_;
|
||||
for (int r = 0; r < h_ + 2 * kVPad; ++r) {
|
||||
for (int c = 0; c < w_ + 2 * kHPad; ++c) {
|
||||
const int32_t ref_value = ref_dst[r * stride + c];
|
||||
const int32_t tst_value = tst_dst[r * stride + c];
|
||||
|
||||
EXPECT_EQ(tst_value, ref_value)
|
||||
<< "Error at row: " << (r - kVPad) << ", col: " << (c - kHPad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef tuple<int, int> BlockDimension;
|
||||
|
||||
struct BaseParams {
|
||||
BaseParams(BlockDimension dims, NTaps ntaps_x, NTaps ntaps_y, bool avg)
|
||||
: dims(dims), ntaps_x(ntaps_x), ntaps_y(ntaps_y), avg(avg) {}
|
||||
|
||||
BlockDimension dims;
|
||||
NTaps ntaps_x, ntaps_y;
|
||||
bool avg;
|
||||
};
|
||||
|
||||
template <typename SrcPixel>
|
||||
class ConvolveScaleTestBase : public ::testing::Test {
|
||||
public:
|
||||
ConvolveScaleTestBase() : image_(NULL) {}
|
||||
virtual ~ConvolveScaleTestBase() { delete image_; }
|
||||
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
||||
|
||||
// Implemented by subclasses (SetUp depends on the parameters passed
|
||||
// in and RunOne depends on the function to be tested. These can't
|
||||
// be templated for low/high bit depths because they have different
|
||||
// numbers of parameters)
|
||||
virtual void SetUp() = 0;
|
||||
virtual void RunOne(bool ref) = 0;
|
||||
|
||||
protected:
|
||||
void SetParams(const BaseParams ¶ms, int bd) {
|
||||
width_ = std::tr1::get<0>(params.dims);
|
||||
height_ = std::tr1::get<1>(params.dims);
|
||||
ntaps_x_ = params.ntaps_x;
|
||||
ntaps_y_ = params.ntaps_y;
|
||||
bd_ = bd;
|
||||
avg_ = params.avg;
|
||||
|
||||
filter_x_.set(ntaps_x_, false);
|
||||
filter_y_.set(ntaps_y_, true);
|
||||
convolve_params_ = get_conv_params_no_round(0, avg_ != false, 0, NULL, 0);
|
||||
|
||||
delete image_;
|
||||
image_ = new TestImage<SrcPixel>(width_, height_, bd_);
|
||||
}
|
||||
|
||||
void Run() {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
for (int i = 0; i < kTestIters; ++i) {
|
||||
Prep(&rnd);
|
||||
RunOne(true);
|
||||
RunOne(false);
|
||||
image_->Check();
|
||||
}
|
||||
}
|
||||
|
||||
void SpeedTest() {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
Prep(&rnd);
|
||||
|
||||
aom_usec_timer ref_timer;
|
||||
aom_usec_timer_start(&ref_timer);
|
||||
for (int i = 0; i < kPerfIters; ++i) RunOne(true);
|
||||
aom_usec_timer_mark(&ref_timer);
|
||||
const int64_t ref_time = aom_usec_timer_elapsed(&ref_timer);
|
||||
|
||||
aom_usec_timer tst_timer;
|
||||
aom_usec_timer_start(&tst_timer);
|
||||
for (int i = 0; i < kPerfIters; ++i) RunOne(false);
|
||||
aom_usec_timer_mark(&tst_timer);
|
||||
const int64_t tst_time = aom_usec_timer_elapsed(&tst_timer);
|
||||
|
||||
std::cout << "[ ] C time = " << ref_time / 1000
|
||||
<< " ms, SIMD time = " << tst_time / 1000 << " ms\n";
|
||||
|
||||
EXPECT_GT(ref_time, tst_time)
|
||||
<< "Error: CDEFSpeedTest, SIMD slower than C.\n"
|
||||
<< "C time: " << ref_time << " us\n"
|
||||
<< "SIMD time: " << tst_time << " us\n";
|
||||
}
|
||||
|
||||
static int RandomSubpel(ACMRandom *rnd) {
|
||||
const uint8_t subpel_mode = rnd->Rand8();
|
||||
if ((subpel_mode & 7) == 0) {
|
||||
return 0;
|
||||
} else if ((subpel_mode & 7) == 1) {
|
||||
return SCALE_SUBPEL_SHIFTS - 1;
|
||||
} else {
|
||||
return 1 + rnd->PseudoUniform(SCALE_SUBPEL_SHIFTS - 2);
|
||||
}
|
||||
}
|
||||
|
||||
void Prep(ACMRandom *rnd) {
|
||||
assert(rnd);
|
||||
|
||||
// Choose subpel_x_ and subpel_y_. They should be less than
|
||||
// SCALE_SUBPEL_SHIFTS; we also want to add extra weight to "interesting"
|
||||
// values: 0 and SCALE_SUBPEL_SHIFTS - 1
|
||||
subpel_x_ = RandomSubpel(rnd);
|
||||
subpel_y_ = RandomSubpel(rnd);
|
||||
|
||||
image_->Initialize(rnd);
|
||||
}
|
||||
|
||||
int width_, height_, bd_;
|
||||
NTaps ntaps_x_, ntaps_y_;
|
||||
bool avg_;
|
||||
int subpel_x_, subpel_y_;
|
||||
TestFilter filter_x_, filter_y_;
|
||||
TestImage<SrcPixel> *image_;
|
||||
ConvolveParams convolve_params_;
|
||||
};
|
||||
|
||||
typedef tuple<int, int> BlockDimension;
|
||||
|
||||
typedef void (*LowbdConvolveFunc)(const uint8_t *src, int src_stride,
|
||||
int32_t *dst, int dst_stride, int w, int h,
|
||||
InterpFilterParams *filter_params_x,
|
||||
InterpFilterParams *filter_params_y,
|
||||
const int subpel_x_qn, const int x_step_qn,
|
||||
const int subpel_y_qn, const int y_step_qn,
|
||||
ConvolveParams *conv_params);
|
||||
|
||||
// Test parameter list:
|
||||
// <tst_fun, dims, ntaps_x, ntaps_y, avg>
|
||||
typedef tuple<LowbdConvolveFunc, BlockDimension, NTaps, NTaps, bool>
|
||||
LowBDParams;
|
||||
|
||||
class LowBDConvolveScaleTest
|
||||
: public ConvolveScaleTestBase<uint8_t>,
|
||||
public ::testing::WithParamInterface<LowBDParams> {
|
||||
public:
|
||||
virtual ~LowBDConvolveScaleTest() {}
|
||||
|
||||
void SetUp() {
|
||||
tst_fun_ = GET_PARAM(0);
|
||||
|
||||
const BlockDimension &block = GET_PARAM(1);
|
||||
const NTaps ntaps_x = GET_PARAM(2);
|
||||
const NTaps ntaps_y = GET_PARAM(3);
|
||||
const int bd = 8;
|
||||
const bool avg = GET_PARAM(4);
|
||||
|
||||
SetParams(BaseParams(block, ntaps_x, ntaps_y, avg), bd);
|
||||
}
|
||||
|
||||
void RunOne(bool ref) {
|
||||
const uint8_t *src = image_->GetSrcData(ref, false);
|
||||
CONV_BUF_TYPE *dst = image_->GetDstData(ref, false);
|
||||
const int src_stride = image_->src_stride();
|
||||
const int dst_stride = image_->dst_stride();
|
||||
|
||||
if (ref) {
|
||||
av1_convolve_2d_scale_c(src, src_stride, dst, dst_stride, width_, height_,
|
||||
&filter_x_.params_, &filter_y_.params_, subpel_x_,
|
||||
kXStepQn, subpel_y_, kYStepQn, &convolve_params_);
|
||||
} else {
|
||||
tst_fun_(src, src_stride, dst, dst_stride, width_, height_,
|
||||
&filter_x_.params_, &filter_y_.params_, subpel_x_, kXStepQn,
|
||||
subpel_y_, kYStepQn, &convolve_params_);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
LowbdConvolveFunc tst_fun_;
|
||||
};
|
||||
|
||||
const BlockDimension kBlockDim[] = {
|
||||
make_tuple(2, 2), make_tuple(2, 4), make_tuple(4, 4),
|
||||
make_tuple(4, 8), make_tuple(8, 4), make_tuple(8, 8),
|
||||
make_tuple(8, 16), make_tuple(16, 8), make_tuple(16, 16),
|
||||
make_tuple(16, 32), make_tuple(32, 16), make_tuple(32, 32),
|
||||
make_tuple(32, 64), make_tuple(64, 32), make_tuple(64, 64),
|
||||
make_tuple(64, 128), make_tuple(128, 64), make_tuple(128, 128),
|
||||
};
|
||||
|
||||
const NTaps kNTaps[] = { EIGHT_TAP, TEN_TAP, TWELVE_TAP };
|
||||
|
||||
TEST_P(LowBDConvolveScaleTest, Check) { Run(); }
|
||||
TEST_P(LowBDConvolveScaleTest, DISABLED_Speed) { SpeedTest(); }
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE4_1, LowBDConvolveScaleTest,
|
||||
::testing::Combine(::testing::Values(av1_convolve_2d_scale_sse4_1),
|
||||
::testing::ValuesIn(kBlockDim),
|
||||
::testing::ValuesIn(kNTaps), ::testing::ValuesIn(kNTaps),
|
||||
::testing::Bool()));
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
typedef void (*HighbdConvolveFunc)(const uint16_t *src, int src_stride,
|
||||
int32_t *dst, int dst_stride, int w, int h,
|
||||
InterpFilterParams *filter_params_x,
|
||||
InterpFilterParams *filter_params_y,
|
||||
const int subpel_x_qn, const int x_step_qn,
|
||||
const int subpel_y_qn, const int y_step_qn,
|
||||
ConvolveParams *conv_params, int bd);
|
||||
|
||||
// Test parameter list:
|
||||
// <tst_fun, dims, ntaps_x, ntaps_y, avg, bd>
|
||||
typedef tuple<HighbdConvolveFunc, BlockDimension, NTaps, NTaps, bool, int>
|
||||
HighBDParams;
|
||||
|
||||
class HighBDConvolveScaleTest
|
||||
: public ConvolveScaleTestBase<uint16_t>,
|
||||
public ::testing::WithParamInterface<HighBDParams> {
|
||||
public:
|
||||
virtual ~HighBDConvolveScaleTest() {}
|
||||
|
||||
void SetUp() {
|
||||
tst_fun_ = GET_PARAM(0);
|
||||
|
||||
const BlockDimension &block = GET_PARAM(1);
|
||||
const NTaps ntaps_x = GET_PARAM(2);
|
||||
const NTaps ntaps_y = GET_PARAM(3);
|
||||
const bool avg = GET_PARAM(4);
|
||||
const int bd = GET_PARAM(5);
|
||||
|
||||
SetParams(BaseParams(block, ntaps_x, ntaps_y, avg), bd);
|
||||
}
|
||||
|
||||
void RunOne(bool ref) {
|
||||
const uint16_t *src = image_->GetSrcData(ref, false);
|
||||
CONV_BUF_TYPE *dst = image_->GetDstData(ref, false);
|
||||
const int src_stride = image_->src_stride();
|
||||
const int dst_stride = image_->dst_stride();
|
||||
|
||||
if (ref) {
|
||||
av1_highbd_convolve_2d_scale_c(
|
||||
src, src_stride, dst, dst_stride, width_, height_, &filter_x_.params_,
|
||||
&filter_y_.params_, subpel_x_, kXStepQn, subpel_y_, kYStepQn,
|
||||
&convolve_params_, bd_);
|
||||
} else {
|
||||
tst_fun_(src, src_stride, dst, dst_stride, width_, height_,
|
||||
&filter_x_.params_, &filter_y_.params_, subpel_x_, kXStepQn,
|
||||
subpel_y_, kYStepQn, &convolve_params_, bd_);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
HighbdConvolveFunc tst_fun_;
|
||||
};
|
||||
|
||||
const int kBDs[] = { 8, 10, 12 };
|
||||
|
||||
TEST_P(HighBDConvolveScaleTest, Check) { Run(); }
|
||||
TEST_P(HighBDConvolveScaleTest, DISABLED_Speed) { SpeedTest(); }
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE4_1, HighBDConvolveScaleTest,
|
||||
::testing::Combine(::testing::Values(av1_highbd_convolve_2d_scale_sse4_1),
|
||||
::testing::ValuesIn(kBlockDim),
|
||||
::testing::ValuesIn(kNTaps), ::testing::ValuesIn(kNTaps),
|
||||
::testing::Bool(), ::testing::ValuesIn(kBDs)));
|
||||
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
} // namespace
|
||||
32
third_party/aom/test/av1_convolve_test.cc
vendored
32
third_party/aom/test/av1_convolve_test.cc
vendored
|
|
@ -269,16 +269,9 @@ INSTANTIATE_TEST_CASE_P(
|
|||
#ifndef __clang_analyzer__
|
||||
TEST(AV1ConvolveTest, av1_highbd_convolve) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
#if CONFIG_DUAL_FILTER
|
||||
InterpFilter interp_filter[4] = { EIGHTTAP_REGULAR, EIGHTTAP_REGULAR,
|
||||
EIGHTTAP_REGULAR, EIGHTTAP_REGULAR };
|
||||
InterpFilters interp_filters = av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
|
||||
InterpFilterParams filter_params =
|
||||
av1_get_interp_filter_params(interp_filter[0]);
|
||||
#else
|
||||
InterpFilter interp_filter = EIGHTTAP_REGULAR;
|
||||
InterpFilterParams filter_params =
|
||||
av1_get_interp_filter_params(interp_filter);
|
||||
#endif
|
||||
av1_get_interp_filter_params(EIGHTTAP_REGULAR);
|
||||
int filter_size = filter_params.taps;
|
||||
int filter_center = filter_size / 2 - 1;
|
||||
uint16_t src[12 * 12];
|
||||
|
|
@ -303,7 +296,7 @@ TEST(AV1ConvolveTest, av1_highbd_convolve) {
|
|||
for (subpel_y_q4 = 0; subpel_y_q4 < SUBPEL_SHIFTS; subpel_y_q4++) {
|
||||
av1_highbd_convolve(
|
||||
CONVERT_TO_BYTEPTR(src + src_stride * filter_center + filter_center),
|
||||
src_stride, CONVERT_TO_BYTEPTR(dst), dst_stride, w, h, interp_filter,
|
||||
src_stride, CONVERT_TO_BYTEPTR(dst), dst_stride, w, h, interp_filters,
|
||||
subpel_x_q4, x_step_q4, subpel_y_q4, y_step_q4, avg, bd);
|
||||
|
||||
const int16_t *x_filter =
|
||||
|
|
@ -331,16 +324,9 @@ TEST(AV1ConvolveTest, av1_highbd_convolve) {
|
|||
|
||||
TEST(AV1ConvolveTest, av1_highbd_convolve_avg) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
#if CONFIG_DUAL_FILTER
|
||||
InterpFilter interp_filter[4] = { EIGHTTAP_REGULAR, EIGHTTAP_REGULAR,
|
||||
EIGHTTAP_REGULAR, EIGHTTAP_REGULAR };
|
||||
InterpFilters interp_filters = av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
|
||||
InterpFilterParams filter_params =
|
||||
av1_get_interp_filter_params(interp_filter[0]);
|
||||
#else
|
||||
InterpFilter interp_filter = EIGHTTAP_REGULAR;
|
||||
InterpFilterParams filter_params =
|
||||
av1_get_interp_filter_params(interp_filter);
|
||||
#endif
|
||||
av1_get_interp_filter_params(EIGHTTAP_REGULAR);
|
||||
int filter_size = filter_params.taps;
|
||||
int filter_center = filter_size / 2 - 1;
|
||||
uint16_t src0[12 * 12];
|
||||
|
|
@ -373,23 +359,23 @@ TEST(AV1ConvolveTest, av1_highbd_convolve_avg) {
|
|||
avg = 0;
|
||||
av1_highbd_convolve(CONVERT_TO_BYTEPTR(src0 + offset), src_stride,
|
||||
CONVERT_TO_BYTEPTR(dst0), dst_stride, w, h,
|
||||
interp_filter, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
interp_filters, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
y_step_q4, avg, bd);
|
||||
avg = 0;
|
||||
av1_highbd_convolve(CONVERT_TO_BYTEPTR(src1 + offset), src_stride,
|
||||
CONVERT_TO_BYTEPTR(dst1), dst_stride, w, h,
|
||||
interp_filter, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
interp_filters, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
y_step_q4, avg, bd);
|
||||
|
||||
avg = 0;
|
||||
av1_highbd_convolve(CONVERT_TO_BYTEPTR(src0 + offset), src_stride,
|
||||
CONVERT_TO_BYTEPTR(dst), dst_stride, w, h,
|
||||
interp_filter, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
interp_filters, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
y_step_q4, avg, bd);
|
||||
avg = 1;
|
||||
av1_highbd_convolve(CONVERT_TO_BYTEPTR(src1 + offset), src_stride,
|
||||
CONVERT_TO_BYTEPTR(dst), dst_stride, w, h,
|
||||
interp_filter, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
interp_filters, subpel_x_q4, x_step_q4, subpel_y_q4,
|
||||
y_step_q4, avg, bd);
|
||||
|
||||
EXPECT_EQ(dst[0], ROUND_POWER_OF_TWO(dst0[0] + dst1[0], 1));
|
||||
|
|
|
|||
3
third_party/aom/test/av1_dct_test.cc
vendored
3
third_party/aom/test/av1_dct_test.cc
vendored
|
|
@ -23,7 +23,8 @@
|
|||
#define CONFIG_COEFFICIENT_RANGE_CHECKING 1
|
||||
#define AV1_DCT_GTEST
|
||||
#include "av1/encoder/dct.c"
|
||||
#if CONFIG_DAALA_DCT4 || CONFIG_DAALA_DCT8
|
||||
#if CONFIG_DAALA_DCT4 || CONFIG_DAALA_DCT8 || CONFIG_DAALA_DCT16 || \
|
||||
CONFIG_DAALA_DCT32
|
||||
#include "av1/common/daala_tx.c"
|
||||
#endif
|
||||
|
||||
|
|
|
|||
164
third_party/aom/test/av1_fht16x16_test.cc
vendored
164
third_party/aom/test/av1_fht16x16_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x16Param;
|
||||
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) {
|
||||
|
|
@ -42,15 +42,15 @@ void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
|||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
|
||||
// Target optimized function, tx_type, bit depth
|
||||
typedef tuple<HbdHtFunc, int, int> HighbdHt16x16Param;
|
||||
typedef tuple<HbdHtFunc, TX_TYPE, int> HighbdHt16x16Param;
|
||||
|
||||
void highbd_fht16x16_ref(const int16_t *in, int32_t *out, int stride,
|
||||
int tx_type, int bd) {
|
||||
TX_TYPE tx_type, int bd) {
|
||||
av1_fwd_txfm2d_16x16_c(in, out, stride, tx_type, bd);
|
||||
}
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
|
@ -128,7 +128,7 @@ class AV1HighbdTrans16x16HT
|
|||
private:
|
||||
HbdHtFunc fwd_txfm_;
|
||||
HbdHtFunc fwd_txfm_ref_;
|
||||
int tx_type_;
|
||||
TX_TYPE tx_type_;
|
||||
int bit_depth_;
|
||||
int mask_;
|
||||
int num_coeffs_;
|
||||
|
|
@ -164,113 +164,113 @@ TEST_P(AV1HighbdTrans16x16HT, HighbdCoeffCheck) { RunBitexactCheck(); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if HAVE_SSE2 && !CONFIG_DAALA_DCT16
|
||||
const Ht16x16Param kArrayHt16x16Param_sse2[] = {
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 0, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 1, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 2, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 3, AOM_BITS_8,
|
||||
256),
|
||||
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),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 4, AOM_BITS_8,
|
||||
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, 5, AOM_BITS_8,
|
||||
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, 6, AOM_BITS_8,
|
||||
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, 7, AOM_BITS_8,
|
||||
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, 8, AOM_BITS_8,
|
||||
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, 9, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 10, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 11, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 12, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 13, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 14, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, 15, 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)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans16x16HT,
|
||||
::testing::ValuesIn(kArrayHt16x16Param_sse2));
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_AVX2
|
||||
#if HAVE_AVX2 && !CONFIG_DAALA_DCT16
|
||||
const Ht16x16Param kArrayHt16x16Param_avx2[] = {
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 0, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 1, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 2, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 3, AOM_BITS_8,
|
||||
256),
|
||||
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),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 4, AOM_BITS_8,
|
||||
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, 5, AOM_BITS_8,
|
||||
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, 6, AOM_BITS_8,
|
||||
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, 7, AOM_BITS_8,
|
||||
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, 8, AOM_BITS_8,
|
||||
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, 9, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 10, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 11, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 12, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 13, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 14, AOM_BITS_8,
|
||||
256),
|
||||
make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, 15, 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)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, AV1Trans16x16HT,
|
||||
::testing::ValuesIn(kArrayHt16x16Param_avx2));
|
||||
#endif // HAVE_AVX2
|
||||
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT16
|
||||
const HighbdHt16x16Param kArrayHBDHt16x16Param_sse4_1[] = {
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 0, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 0, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 1, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 1, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 2, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 2, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 3, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 3, 12),
|
||||
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),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 4, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 4, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 5, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 5, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 6, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 6, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 7, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 7, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 8, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, 8, 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),
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans16x16HT,
|
||||
::testing::ValuesIn(kArrayHBDHt16x16Param_sse4_1));
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT16
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
99
third_party/aom/test/av1_fht16x32_test.cc
vendored
99
third_party/aom/test/av1_fht16x32_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x32Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht16x32Param;
|
||||
|
||||
void fht16x32_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -80,23 +80,34 @@ TEST_P(AV1Trans16x32HT, InvAccuracyCheck) { RunInvAccuracyCheck(4); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
const Ht16x32Param kArrayHt16x32Param_c[] = {
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 0, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 1, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 2, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 3, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, DCT_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, ADST_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, DCT_ADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, ADST_ADST, AOM_BITS_8,
|
||||
512),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 4, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 5, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 6, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 7, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 8, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 9, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 10, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 11, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 12, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 13, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 14, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, 15, AOM_BITS_8, 512)
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, FLIPADST_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, DCT_FLIPADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, ADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, FLIPADST_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, IDTX, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, V_DCT, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, H_DCT, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, V_ADST, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, H_ADST, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, V_FLIPADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_c, &av1_iht16x32_512_add_c, H_FLIPADST, AOM_BITS_8,
|
||||
512)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans16x32HT,
|
||||
|
|
@ -104,39 +115,39 @@ INSTANTIATE_TEST_CASE_P(C, AV1Trans16x32HT,
|
|||
|
||||
#if HAVE_SSE2
|
||||
const Ht16x32Param kArrayHt16x32Param_sse2[] = {
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 0, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 1, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 2, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 3, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, DCT_DCT,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, ADST_DCT,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, DCT_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, ADST_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 4, AOM_BITS_8,
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, IDTX, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 5, AOM_BITS_8,
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, V_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 6, AOM_BITS_8,
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, H_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 7, AOM_BITS_8,
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, V_ADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 8, AOM_BITS_8,
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, H_ADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 9, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 10, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 11, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 12, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 13, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 14, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, 15, AOM_BITS_8,
|
||||
512)
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, V_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht16x32_sse2, &av1_iht16x32_512_add_sse2, H_FLIPADST,
|
||||
AOM_BITS_8, 512)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans16x32HT,
|
||||
|
|
|
|||
90
third_party/aom/test/av1_fht16x8_test.cc
vendored
90
third_party/aom/test/av1_fht16x8_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x8Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht16x8Param;
|
||||
|
||||
void fht16x8_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -81,23 +81,31 @@ TEST_P(AV1Trans16x8HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
|
|||
using std::tr1::make_tuple;
|
||||
|
||||
const Ht16x8Param kArrayHt16x8Param_c[] = {
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 0, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 1, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 2, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 3, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, DCT_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, ADST_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, DCT_ADST, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, ADST_ADST, AOM_BITS_8,
|
||||
128),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 4, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 5, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 6, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 7, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 8, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 9, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 10, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 11, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 12, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 13, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 14, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, 15, AOM_BITS_8, 128)
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, FLIPADST_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, DCT_FLIPADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, ADST_FLIPADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, FLIPADST_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, IDTX, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, V_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, H_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, V_ADST, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, H_ADST, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, V_FLIPADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_c, &av1_iht16x8_128_add_c, H_FLIPADST, AOM_BITS_8,
|
||||
128)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans16x8HT,
|
||||
|
|
@ -105,23 +113,39 @@ INSTANTIATE_TEST_CASE_P(C, AV1Trans16x8HT,
|
|||
|
||||
#if HAVE_SSE2
|
||||
const Ht16x8Param kArrayHt16x8Param_sse2[] = {
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 0, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 1, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 2, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 3, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, DCT_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, ADST_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, DCT_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, ADST_ADST,
|
||||
AOM_BITS_8, 128),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 4, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 5, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 6, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 7, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 8, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 9, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 10, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 11, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 12, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 13, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 14, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, 15, AOM_BITS_8, 128)
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, IDTX, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, V_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, H_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, V_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, H_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, V_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht16x8_sse2, &av1_iht16x8_128_add_sse2, H_FLIPADST,
|
||||
AOM_BITS_8, 128)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans16x8HT,
|
||||
|
|
|
|||
99
third_party/aom/test/av1_fht32x16_test.cc
vendored
99
third_party/aom/test/av1_fht32x16_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht32x16Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht32x16Param;
|
||||
|
||||
void fht32x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -80,23 +80,34 @@ TEST_P(AV1Trans32x16HT, InvAccuracyCheck) { RunInvAccuracyCheck(4); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
const Ht32x16Param kArrayHt32x16Param_c[] = {
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 0, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 1, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 2, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 3, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, DCT_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, ADST_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, DCT_ADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, ADST_ADST, AOM_BITS_8,
|
||||
512),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 4, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 5, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 6, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 7, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 8, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 9, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 10, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 11, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 12, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 13, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 14, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, 15, AOM_BITS_8, 512)
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, FLIPADST_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, DCT_FLIPADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, ADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, FLIPADST_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, IDTX, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, V_DCT, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, H_DCT, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, V_ADST, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, H_ADST, AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, V_FLIPADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_c, &av1_iht32x16_512_add_c, H_FLIPADST, AOM_BITS_8,
|
||||
512)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans32x16HT,
|
||||
|
|
@ -104,39 +115,39 @@ INSTANTIATE_TEST_CASE_P(C, AV1Trans32x16HT,
|
|||
|
||||
#if HAVE_SSE2
|
||||
const Ht32x16Param kArrayHt32x16Param_sse2[] = {
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 0, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 1, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 2, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 3, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, DCT_DCT,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, ADST_DCT,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, DCT_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, ADST_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 4, AOM_BITS_8,
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, IDTX, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 5, AOM_BITS_8,
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, V_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 6, AOM_BITS_8,
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, H_DCT, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 7, AOM_BITS_8,
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, V_ADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 8, AOM_BITS_8,
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, H_ADST, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 9, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 10, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 11, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 12, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 13, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 14, AOM_BITS_8,
|
||||
512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, 15, AOM_BITS_8,
|
||||
512)
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, V_FLIPADST,
|
||||
AOM_BITS_8, 512),
|
||||
make_tuple(&av1_fht32x16_sse2, &av1_iht32x16_512_add_sse2, H_FLIPADST,
|
||||
AOM_BITS_8, 512)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans32x16HT,
|
||||
|
|
|
|||
96
third_party/aom/test/av1_fht32x32_test.cc
vendored
96
third_party/aom/test/av1_fht32x32_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht32x32Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht32x32Param;
|
||||
|
||||
void fht32x32_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -37,20 +37,20 @@ void fht32x32_ref(const int16_t *in, tran_low_t *out, int stride,
|
|||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
|
||||
// Target optimized function, tx_type, bit depth
|
||||
typedef tuple<HbdHtFunc, int, int> HighbdHt32x32Param;
|
||||
typedef tuple<HbdHtFunc, TX_TYPE, int> HighbdHt32x32Param;
|
||||
|
||||
void highbd_fht32x32_ref(const int16_t *in, int32_t *out, int stride,
|
||||
int tx_type, int bd) {
|
||||
TX_TYPE tx_type, int bd) {
|
||||
av1_fwd_txfm2d_32x32_c(in, out, stride, tx_type, bd);
|
||||
}
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 || HAVE_AVX2
|
||||
#if (HAVE_SSE2 || HAVE_AVX2) && !CONFIG_DAALA_DCT32
|
||||
void dummy_inv_txfm(const tran_low_t *in, uint8_t *out, int stride,
|
||||
const TxfmParam *txfm_param) {
|
||||
(void)in;
|
||||
|
|
@ -129,7 +129,7 @@ class AV1HighbdTrans32x32HT
|
|||
private:
|
||||
HbdHtFunc fwd_txfm_;
|
||||
HbdHtFunc fwd_txfm_ref_;
|
||||
int tx_type_;
|
||||
TX_TYPE tx_type_;
|
||||
int bit_depth_;
|
||||
int mask_;
|
||||
int num_coeffs_;
|
||||
|
|
@ -165,53 +165,63 @@ TEST_P(AV1HighbdTrans32x32HT, HighbdCoeffCheck) { RunBitexactCheck(); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if HAVE_SSE2 && !CONFIG_DAALA_DCT32
|
||||
const Ht32x32Param kArrayHt32x32Param_sse2[] = {
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 0, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 1, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 2, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 3, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, DCT_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, ADST_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, DCT_ADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, ADST_ADST, AOM_BITS_8, 1024),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 4, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 5, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 6, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 7, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 8, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 9, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 10, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 11, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 12, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 13, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 14, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, 15, AOM_BITS_8, 1024)
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, FLIPADST_DCT, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, DCT_FLIPADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, FLIPADST_FLIPADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, ADST_FLIPADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, FLIPADST_ADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, IDTX, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, V_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, H_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, V_ADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, H_ADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, V_FLIPADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_sse2, &dummy_inv_txfm, H_FLIPADST, AOM_BITS_8, 1024)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans32x32HT,
|
||||
::testing::ValuesIn(kArrayHt32x32Param_sse2));
|
||||
#endif // HAVE_SSE2
|
||||
#endif // HAVE_SSE2 && !CONFIG_DAALA_DCT32
|
||||
|
||||
#if HAVE_AVX2
|
||||
#if HAVE_AVX2 && !CONFIG_DAALA_DCT32
|
||||
const Ht32x32Param kArrayHt32x32Param_avx2[] = {
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 0, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 1, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 2, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 3, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, DCT_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, ADST_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, DCT_ADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, ADST_ADST, AOM_BITS_8, 1024),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 4, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 5, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 6, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 7, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 8, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 9, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 10, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 11, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 12, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 13, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 14, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, 15, AOM_BITS_8, 1024)
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, FLIPADST_DCT, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, DCT_FLIPADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, FLIPADST_FLIPADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, ADST_FLIPADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, FLIPADST_ADST, AOM_BITS_8,
|
||||
1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, IDTX, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, V_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, H_DCT, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, V_ADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, H_ADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, V_FLIPADST, AOM_BITS_8, 1024),
|
||||
make_tuple(&av1_fht32x32_avx2, &dummy_inv_txfm, H_FLIPADST, AOM_BITS_8, 1024)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, AV1Trans32x32HT,
|
||||
::testing::ValuesIn(kArrayHt32x32Param_avx2));
|
||||
#endif // HAVE_AVX2
|
||||
#endif // HAVE_AVX2 && !CONFIG_DAALA_DCT32
|
||||
} // namespace
|
||||
|
|
|
|||
99
third_party/aom/test/av1_fht4x4_test.cc
vendored
99
third_party/aom/test/av1_fht4x4_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht4x4Param;
|
||||
|
||||
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -42,16 +42,16 @@ void iht4x4_ref(const tran_low_t *in, uint8_t *out, int stride,
|
|||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
typedef void (*IhighbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
typedef void (*HBDFhtFunc)(const int16_t *input, int32_t *output, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
|
||||
// HighbdHt4x4Param argument list:
|
||||
// <Target optimized function, tx_type, bit depth>
|
||||
typedef tuple<HBDFhtFunc, int, int> HighbdHt4x4Param;
|
||||
typedef tuple<HBDFhtFunc, TX_TYPE, int> HighbdHt4x4Param;
|
||||
|
||||
void highbe_fht4x4_ref(const int16_t *in, int32_t *out, int stride, int tx_type,
|
||||
int bd) {
|
||||
void highbe_fht4x4_ref(const int16_t *in, int32_t *out, int stride,
|
||||
TX_TYPE tx_type, int bd) {
|
||||
av1_fwd_txfm2d_4x4_c(in, out, stride, tx_type, bd);
|
||||
}
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
|
@ -131,7 +131,7 @@ class AV1HighbdTrans4x4HT : public ::testing::TestWithParam<HighbdHt4x4Param> {
|
|||
private:
|
||||
HBDFhtFunc fwd_txfm_;
|
||||
HBDFhtFunc fwd_txfm_ref_;
|
||||
int tx_type_;
|
||||
TX_TYPE tx_type_;
|
||||
int bit_depth_;
|
||||
int mask_;
|
||||
int num_coeffs_;
|
||||
|
|
@ -167,58 +167,69 @@ TEST_P(AV1HighbdTrans4x4HT, HighbdCoeffCheck) { RunBitexactCheck(); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if HAVE_SSE2 && !CONFIG_DAALA_DCT4
|
||||
const Ht4x4Param kArrayHt4x4Param_sse2[] = {
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 0, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 1, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 2, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 3, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, DCT_DCT, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, ADST_DCT, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, DCT_ADST, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, ADST_ADST, AOM_BITS_8,
|
||||
16),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 4, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 5, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 6, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 7, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 8, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 9, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 10, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 11, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 12, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 13, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 14, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 15, AOM_BITS_8, 16)
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, IDTX, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, V_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, H_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, V_ADST, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, H_ADST, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, V_FLIPADST, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, H_FLIPADST, AOM_BITS_8,
|
||||
16)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans4x4HT,
|
||||
::testing::ValuesIn(kArrayHt4x4Param_sse2));
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT4
|
||||
const HighbdHt4x4Param kArrayHighbdHt4x4Param[] = {
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 0, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 0, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 1, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 1, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 2, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 2, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 3, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 3, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_DCT, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_DCT, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, ADST_DCT, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, ADST_DCT, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_ADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_ADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, ADST_ADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, ADST_ADST, 12),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 4, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 4, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 5, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 5, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 6, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 6, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 7, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 7, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 8, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, 8, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, FLIPADST_DCT, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, FLIPADST_DCT, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_FLIPADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_FLIPADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, FLIPADST_FLIPADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, FLIPADST_FLIPADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, ADST_FLIPADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, ADST_FLIPADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, FLIPADST_ADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, FLIPADST_ADST, 12),
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans4x4HT,
|
||||
::testing::ValuesIn(kArrayHighbdHt4x4Param));
|
||||
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT4
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
80
third_party/aom/test/av1_fht4x8_test.cc
vendored
80
third_party/aom/test/av1_fht4x8_test.cc
vendored
|
|
@ -28,7 +28,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x8Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht4x8Param;
|
||||
|
||||
void fht4x8_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -81,23 +81,26 @@ TEST_P(AV1Trans4x8HT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
|
|||
using std::tr1::make_tuple;
|
||||
|
||||
const Ht4x8Param kArrayHt4x8Param_c[] = {
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 0, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 1, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 2, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 3, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, DCT_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, ADST_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, DCT_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, ADST_ADST, AOM_BITS_8, 32),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 4, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 5, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 6, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 7, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 8, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 9, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 10, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 11, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 12, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 13, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 14, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, 15, AOM_BITS_8, 32)
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, FLIPADST_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, DCT_FLIPADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, FLIPADST_FLIPADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, ADST_FLIPADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, FLIPADST_ADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, IDTX, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, V_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, H_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, V_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, H_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, V_FLIPADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_c, &av1_iht4x8_32_add_c, H_FLIPADST, AOM_BITS_8, 32)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans4x8HT,
|
||||
|
|
@ -105,23 +108,34 @@ INSTANTIATE_TEST_CASE_P(C, AV1Trans4x8HT,
|
|||
|
||||
#if HAVE_SSE2
|
||||
const Ht4x8Param kArrayHt4x8Param_sse2[] = {
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 0, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 1, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 2, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 3, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, DCT_DCT, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, ADST_DCT, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, DCT_ADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, ADST_ADST, AOM_BITS_8,
|
||||
32),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 4, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 5, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 6, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 7, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 8, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 9, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 10, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 11, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 12, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 13, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 14, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, 15, AOM_BITS_8, 32)
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, IDTX, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, V_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, H_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, V_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, H_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, V_FLIPADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht4x8_sse2, &av1_iht4x8_32_add_sse2, H_FLIPADST, AOM_BITS_8,
|
||||
32)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans4x8HT,
|
||||
|
|
|
|||
49
third_party/aom/test/av1_fht64x64_test.cc
vendored
49
third_party/aom/test/av1_fht64x64_test.cc
vendored
|
|
@ -29,7 +29,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht64x64Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht64x64Param;
|
||||
|
||||
void fht64x64_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -82,23 +82,38 @@ 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),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, DCT_DCT, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, ADST_DCT, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, DCT_ADST, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, ADST_ADST, 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)
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, FLIPADST_DCT,
|
||||
AOM_BITS_8, 4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, DCT_FLIPADST,
|
||||
AOM_BITS_8, 4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, ADST_FLIPADST,
|
||||
AOM_BITS_8, 4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, FLIPADST_ADST,
|
||||
AOM_BITS_8, 4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, IDTX, AOM_BITS_8, 4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, V_DCT, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, H_DCT, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, V_ADST, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, H_ADST, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, V_FLIPADST, AOM_BITS_8,
|
||||
4096),
|
||||
make_tuple(&av1_fht64x64_c, &av1_iht64x64_4096_add_c, H_FLIPADST, AOM_BITS_8,
|
||||
4096)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans64x64HT,
|
||||
|
|
|
|||
90
third_party/aom/test/av1_fht8x16_test.cc
vendored
90
third_party/aom/test/av1_fht8x16_test.cc
vendored
|
|
@ -27,7 +27,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x16Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht8x16Param;
|
||||
|
||||
void fht8x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -80,23 +80,31 @@ TEST_P(AV1Trans8x16HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
|
|||
using std::tr1::make_tuple;
|
||||
|
||||
const Ht8x16Param kArrayHt8x16Param_c[] = {
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 0, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 1, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 2, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 3, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, DCT_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, ADST_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, DCT_ADST, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, ADST_ADST, AOM_BITS_8,
|
||||
128),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 4, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 5, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 6, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 7, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 8, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 9, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 10, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 11, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 12, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 13, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 14, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, 15, AOM_BITS_8, 128)
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, FLIPADST_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, DCT_FLIPADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, ADST_FLIPADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, FLIPADST_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, IDTX, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, V_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, H_DCT, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, V_ADST, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, H_ADST, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, V_FLIPADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_c, &av1_iht8x16_128_add_c, H_FLIPADST, AOM_BITS_8,
|
||||
128)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans8x16HT,
|
||||
|
|
@ -104,23 +112,39 @@ INSTANTIATE_TEST_CASE_P(C, AV1Trans8x16HT,
|
|||
|
||||
#if HAVE_SSE2
|
||||
const Ht8x16Param kArrayHt8x16Param_sse2[] = {
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 0, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 1, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 2, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 3, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, DCT_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, ADST_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, DCT_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, ADST_ADST,
|
||||
AOM_BITS_8, 128),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 4, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 5, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 6, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 7, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 8, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 9, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 10, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 11, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 12, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 13, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 14, AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, 15, AOM_BITS_8, 128)
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, IDTX, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, V_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, H_DCT, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, V_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, H_ADST, AOM_BITS_8,
|
||||
128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, V_FLIPADST,
|
||||
AOM_BITS_8, 128),
|
||||
make_tuple(&av1_fht8x16_sse2, &av1_iht8x16_128_add_sse2, H_FLIPADST,
|
||||
AOM_BITS_8, 128)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans8x16HT,
|
||||
|
|
|
|||
80
third_party/aom/test/av1_fht8x4_test.cc
vendored
80
third_party/aom/test/av1_fht8x4_test.cc
vendored
|
|
@ -27,7 +27,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using std::tr1::tuple;
|
||||
using libaom_test::FhtFunc;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x4Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht8x4Param;
|
||||
|
||||
void fht8x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -80,23 +80,26 @@ TEST_P(AV1Trans8x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
|
|||
using std::tr1::make_tuple;
|
||||
|
||||
const Ht8x4Param kArrayHt8x4Param_c[] = {
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 0, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 1, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 2, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 3, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, DCT_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, ADST_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, DCT_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, ADST_ADST, AOM_BITS_8, 32),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 4, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 5, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 6, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 7, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 8, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 9, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 10, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 11, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 12, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 13, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 14, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, 15, AOM_BITS_8, 32)
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, FLIPADST_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, DCT_FLIPADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, FLIPADST_FLIPADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, ADST_FLIPADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, FLIPADST_ADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, IDTX, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, V_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, H_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, V_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, H_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, V_FLIPADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_c, &av1_iht8x4_32_add_c, H_FLIPADST, AOM_BITS_8, 32)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, AV1Trans8x4HT,
|
||||
|
|
@ -104,23 +107,34 @@ INSTANTIATE_TEST_CASE_P(C, AV1Trans8x4HT,
|
|||
|
||||
#if HAVE_SSE2
|
||||
const Ht8x4Param kArrayHt8x4Param_sse2[] = {
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 0, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 1, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 2, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 3, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, DCT_DCT, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, ADST_DCT, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, DCT_ADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, ADST_ADST, AOM_BITS_8,
|
||||
32),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 4, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 5, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 6, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 7, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 8, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 9, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 10, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 11, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 12, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 13, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 14, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, 15, AOM_BITS_8, 32)
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, IDTX, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, V_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, H_DCT, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, V_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, H_ADST, AOM_BITS_8, 32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, V_FLIPADST, AOM_BITS_8,
|
||||
32),
|
||||
make_tuple(&av1_fht8x4_sse2, &av1_iht8x4_32_add_sse2, H_FLIPADST, AOM_BITS_8,
|
||||
32)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans8x4HT,
|
||||
|
|
|
|||
99
third_party/aom/test/av1_fht8x8_test.cc
vendored
99
third_party/aom/test/av1_fht8x8_test.cc
vendored
|
|
@ -29,7 +29,7 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
|
||||
using libaom_test::FhtFunc;
|
||||
using std::tr1::tuple;
|
||||
typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x8Param;
|
||||
typedef tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int> Ht8x8Param;
|
||||
|
||||
void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam *txfm_param) {
|
||||
|
|
@ -43,14 +43,14 @@ void iht8x8_ref(const tran_low_t *in, uint8_t *out, int stride,
|
|||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
// Target optimized function, tx_type, bit depth
|
||||
typedef tuple<HbdHtFunc, int, int> HighbdHt8x8Param;
|
||||
typedef tuple<HbdHtFunc, TX_TYPE, int> HighbdHt8x8Param;
|
||||
|
||||
void highbd_fht8x8_ref(const int16_t *in, int32_t *out, int stride, int tx_type,
|
||||
int bd) {
|
||||
void highbd_fht8x8_ref(const int16_t *in, int32_t *out, int stride,
|
||||
TX_TYPE tx_type, int bd) {
|
||||
av1_fwd_txfm2d_8x8_c(in, out, stride, tx_type, bd);
|
||||
}
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
|
@ -130,7 +130,7 @@ class AV1HighbdTrans8x8HT : public ::testing::TestWithParam<HighbdHt8x8Param> {
|
|||
private:
|
||||
HbdHtFunc fwd_txfm_;
|
||||
HbdHtFunc fwd_txfm_ref_;
|
||||
int tx_type_;
|
||||
TX_TYPE tx_type_;
|
||||
int bit_depth_;
|
||||
int mask_;
|
||||
int num_coeffs_;
|
||||
|
|
@ -167,56 +167,67 @@ TEST_P(AV1HighbdTrans8x8HT, HighbdCoeffCheck) { RunBitexactCheck(); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if HAVE_SSE2 && !CONFIG_DAALA_DCT8
|
||||
const Ht8x8Param kArrayHt8x8Param_sse2[] = {
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 0, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 1, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 2, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 3, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, DCT_DCT, AOM_BITS_8,
|
||||
64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, ADST_DCT, AOM_BITS_8,
|
||||
64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, DCT_ADST, AOM_BITS_8,
|
||||
64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, ADST_ADST, AOM_BITS_8,
|
||||
64),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 4, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 5, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 6, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 7, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 8, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 9, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 10, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 11, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 12, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 13, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 14, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 15, AOM_BITS_8, 64)
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, FLIPADST_DCT,
|
||||
AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, DCT_FLIPADST,
|
||||
AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, FLIPADST_FLIPADST,
|
||||
AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, ADST_FLIPADST,
|
||||
AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, FLIPADST_ADST,
|
||||
AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, IDTX, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, V_DCT, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, H_DCT, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, V_ADST, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, H_ADST, AOM_BITS_8, 64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, V_FLIPADST, AOM_BITS_8,
|
||||
64),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, H_FLIPADST, AOM_BITS_8,
|
||||
64)
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans8x8HT,
|
||||
::testing::ValuesIn(kArrayHt8x8Param_sse2));
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT8
|
||||
const HighbdHt8x8Param kArrayHBDHt8x8Param_sse4_1[] = {
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 0, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 0, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 1, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 1, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 2, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 2, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 3, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 3, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_DCT, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_DCT, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, ADST_DCT, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, ADST_DCT, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_ADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_ADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, ADST_ADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, ADST_ADST, 12),
|
||||
#if CONFIG_EXT_TX
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 4, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 4, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 5, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 5, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 6, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 6, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 7, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 7, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 8, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, 8, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, FLIPADST_DCT, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, FLIPADST_DCT, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_FLIPADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_FLIPADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, FLIPADST_FLIPADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, FLIPADST_FLIPADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, ADST_FLIPADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, ADST_FLIPADST, 12),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, FLIPADST_ADST, 10),
|
||||
make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, FLIPADST_ADST, 12),
|
||||
#endif // CONFIG_EXT_TX
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans8x8HT,
|
||||
::testing::ValuesIn(kArrayHBDHt8x8Param_sse4_1));
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT8
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
30
third_party/aom/test/av1_fwd_txfm1d_test.cc
vendored
30
third_party/aom/test/av1_fwd_txfm1d_test.cc
vendored
|
|
@ -51,11 +51,6 @@ TEST(av1_fwd_txfm1d, round_shift) {
|
|||
EXPECT_EQ(round_shift(-8, 2), -2);
|
||||
}
|
||||
|
||||
TEST(av1_fwd_txfm1d, get_max_bit) {
|
||||
int max_bit = get_max_bit(8);
|
||||
EXPECT_EQ(max_bit, 3);
|
||||
}
|
||||
|
||||
TEST(av1_fwd_txfm1d, cospi_arr_data) {
|
||||
for (int i = 0; i < 7; i++) {
|
||||
for (int j = 0; j < 64; j++) {
|
||||
|
|
@ -65,31 +60,6 @@ TEST(av1_fwd_txfm1d, cospi_arr_data) {
|
|||
}
|
||||
}
|
||||
|
||||
TEST(av1_fwd_txfm1d, clamp_block) {
|
||||
int16_t block[5][5] = { { 7, -5, 6, -3, 9 },
|
||||
{ 7, -5, 6, -3, 9 },
|
||||
{ 7, -5, 6, -3, 9 },
|
||||
{ 7, -5, 6, -3, 9 },
|
||||
{ 7, -5, 6, -3, 9 } };
|
||||
|
||||
int16_t ref_block[5][5] = { { 7, -5, 6, -3, 9 },
|
||||
{ 7, -5, 6, -3, 9 },
|
||||
{ 7, -4, 2, -3, 9 },
|
||||
{ 7, -4, 2, -3, 9 },
|
||||
{ 7, -4, 2, -3, 9 } };
|
||||
|
||||
int row = 2;
|
||||
int col = 1;
|
||||
int block_size = 3;
|
||||
int stride = 5;
|
||||
clamp_block(block[row] + col, block_size, block_size, stride, -4, 2);
|
||||
for (int r = 0; r < stride; r++) {
|
||||
for (int c = 0; c < stride; c++) {
|
||||
EXPECT_EQ(block[r][c], ref_block[r][c]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST(av1_fwd_txfm1d, accuracy) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
for (int si = 0; si < txfm_size_num; ++si) {
|
||||
|
|
|
|||
26
third_party/aom/test/av1_fwd_txfm2d_test.cc
vendored
26
third_party/aom/test/av1_fwd_txfm2d_test.cc
vendored
|
|
@ -177,5 +177,31 @@ const AV1FwdTxfm2dParam av1_fwd_txfm2d_param_c[] = {
|
|||
INSTANTIATE_TEST_CASE_P(C, AV1FwdTxfm2d,
|
||||
::testing::ValuesIn(av1_fwd_txfm2d_param_c));
|
||||
|
||||
TEST(AV1FwdTxfm2d, CfgTest) {
|
||||
for (int bd_idx = 0; bd_idx < BD_NUM; ++bd_idx) {
|
||||
int bd = libaom_test::bd_arr[bd_idx];
|
||||
int8_t low_range = libaom_test::low_range_arr[bd_idx];
|
||||
int8_t high_range = libaom_test::high_range_arr[bd_idx];
|
||||
// TODO(angiebird): include rect txfm in this test
|
||||
for (int tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
|
||||
for (int tx_type = 0; tx_type < TX_TYPES; ++tx_type) {
|
||||
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_cfg(
|
||||
static_cast<TX_TYPE>(tx_type), static_cast<TX_SIZE>(tx_size));
|
||||
int8_t stage_range_col[MAX_TXFM_STAGE_NUM];
|
||||
int8_t stage_range_row[MAX_TXFM_STAGE_NUM];
|
||||
av1_gen_fwd_stage_range(stage_range_col, stage_range_row, &cfg, bd);
|
||||
const TXFM_1D_CFG *col_cfg = cfg.col_cfg;
|
||||
const TXFM_1D_CFG *row_cfg = cfg.row_cfg;
|
||||
libaom_test::txfm_stage_range_check(stage_range_col, col_cfg->stage_num,
|
||||
col_cfg->cos_bit, low_range,
|
||||
high_range);
|
||||
libaom_test::txfm_stage_range_check(stage_range_row, row_cfg->stage_num,
|
||||
row_cfg->cos_bit, low_range,
|
||||
high_range);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
|
|
|||
37
third_party/aom/test/av1_highbd_iht_test.cc
vendored
37
third_party/aom/test/av1_highbd_iht_test.cc
vendored
|
|
@ -26,10 +26,10 @@ using std::tr1::tuple;
|
|||
using libaom_test::ACMRandom;
|
||||
|
||||
typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
|
||||
typedef void (*IHbdHtFunc)(const int32_t *coeff, uint16_t *output, int stride,
|
||||
int tx_type, int bd);
|
||||
TX_TYPE tx_type, int bd);
|
||||
|
||||
// Test parameter argument list:
|
||||
// <transform reference function,
|
||||
|
|
@ -38,7 +38,7 @@ typedef void (*IHbdHtFunc)(const int32_t *coeff, uint16_t *output, int stride,
|
|||
// num_coeffs,
|
||||
// tx_type,
|
||||
// bit_depth>
|
||||
typedef tuple<HbdHtFunc, IHbdHtFunc, IHbdHtFunc, int, int, int> IHbdHtParam;
|
||||
typedef tuple<HbdHtFunc, IHbdHtFunc, IHbdHtFunc, int, TX_TYPE, int> IHbdHtParam;
|
||||
|
||||
class AV1HighbdInvHTNxN : public ::testing::TestWithParam<IHbdHtParam> {
|
||||
public:
|
||||
|
|
@ -97,7 +97,7 @@ class AV1HighbdInvHTNxN : public ::testing::TestWithParam<IHbdHtParam> {
|
|||
IHbdHtFunc inv_txfm_;
|
||||
IHbdHtFunc inv_txfm_ref_;
|
||||
int num_coeffs_;
|
||||
int tx_type_;
|
||||
TX_TYPE tx_type_;
|
||||
int bit_depth_;
|
||||
|
||||
int16_t *input_;
|
||||
|
|
@ -135,21 +135,26 @@ TEST_P(AV1HighbdInvHTNxN, InvTransResultCheck) { RunBitexactCheck(); }
|
|||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && \
|
||||
!(CONFIG_DAALA_DCT4 && CONFIG_DAALA_DCT8 && CONFIG_DAALA_DCT16)
|
||||
#if !CONFIG_DAALA_DCT4
|
||||
#define PARAM_LIST_4X4 \
|
||||
&av1_fwd_txfm2d_4x4_c, &av1_inv_txfm2d_add_4x4_sse4_1, \
|
||||
&av1_inv_txfm2d_add_4x4_c, 16
|
||||
|
||||
#endif
|
||||
#if !CONFIG_DAALA_DCT8
|
||||
#define PARAM_LIST_8X8 \
|
||||
&av1_fwd_txfm2d_8x8_c, &av1_inv_txfm2d_add_8x8_sse4_1, \
|
||||
&av1_inv_txfm2d_add_8x8_c, 64
|
||||
|
||||
#endif
|
||||
#if !CONFIG_DAALA_DCT16
|
||||
#define PARAM_LIST_16X16 \
|
||||
&av1_fwd_txfm2d_16x16_c, &av1_inv_txfm2d_add_16x16_sse4_1, \
|
||||
&av1_inv_txfm2d_add_16x16_c, 256
|
||||
|
||||
#endif
|
||||
const IHbdHtParam kArrayIhtParam[] = {
|
||||
// 16x16
|
||||
// 16x16
|
||||
#if !CONFIG_DAALA_DCT16
|
||||
make_tuple(PARAM_LIST_16X16, DCT_DCT, 10),
|
||||
make_tuple(PARAM_LIST_16X16, DCT_DCT, 12),
|
||||
make_tuple(PARAM_LIST_16X16, ADST_DCT, 10),
|
||||
|
|
@ -170,7 +175,9 @@ const IHbdHtParam kArrayIhtParam[] = {
|
|||
make_tuple(PARAM_LIST_16X16, FLIPADST_ADST, 10),
|
||||
make_tuple(PARAM_LIST_16X16, FLIPADST_ADST, 12),
|
||||
#endif
|
||||
// 8x8
|
||||
#endif
|
||||
// 8x8
|
||||
#if !CONFIG_DAALA_DCT8
|
||||
make_tuple(PARAM_LIST_8X8, DCT_DCT, 10),
|
||||
make_tuple(PARAM_LIST_8X8, DCT_DCT, 12),
|
||||
make_tuple(PARAM_LIST_8X8, ADST_DCT, 10),
|
||||
|
|
@ -191,7 +198,9 @@ const IHbdHtParam kArrayIhtParam[] = {
|
|||
make_tuple(PARAM_LIST_8X8, FLIPADST_ADST, 10),
|
||||
make_tuple(PARAM_LIST_8X8, FLIPADST_ADST, 12),
|
||||
#endif
|
||||
// 4x4
|
||||
#endif
|
||||
// 4x4
|
||||
#if !CONFIG_DAALA_DCT4
|
||||
make_tuple(PARAM_LIST_4X4, DCT_DCT, 10),
|
||||
make_tuple(PARAM_LIST_4X4, DCT_DCT, 12),
|
||||
make_tuple(PARAM_LIST_4X4, ADST_DCT, 10),
|
||||
|
|
@ -212,13 +221,15 @@ const IHbdHtParam kArrayIhtParam[] = {
|
|||
make_tuple(PARAM_LIST_4X4, FLIPADST_ADST, 10),
|
||||
make_tuple(PARAM_LIST_4X4, FLIPADST_ADST, 12),
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdInvHTNxN,
|
||||
::testing::ValuesIn(kArrayIhtParam));
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH &&
|
||||
// !(CONFIG_DAALA_DCT4 && CONFIG_DAALA_DCT8 && CONFIG_DAALA_DCT16)
|
||||
|
||||
#if HAVE_AVX2 && CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_AVX2 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT32
|
||||
#define PARAM_LIST_32X32 \
|
||||
&av1_fwd_txfm2d_32x32_c, &av1_inv_txfm2d_add_32x32_avx2, \
|
||||
&av1_inv_txfm2d_add_32x32_c, 1024
|
||||
|
|
|
|||
64
third_party/aom/test/av1_inv_txfm1d_test.cc
vendored
64
third_party/aom/test/av1_inv_txfm1d_test.cc
vendored
|
|
@ -9,6 +9,8 @@
|
|||
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "test/av1_txfm_test.h"
|
||||
#include "test/util.h"
|
||||
#include "av1/common/av1_fwd_txfm1d.h"
|
||||
|
|
@ -45,6 +47,68 @@ const TxfmFunc inv_txfm_func_ls[][2] = {
|
|||
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 };
|
||||
|
||||
void reference_idct_1d_int(const int32_t *in, int32_t *out, int size) {
|
||||
double input[64];
|
||||
for (int i = 0; i < size; ++i) input[i] = in[i];
|
||||
|
||||
double output[64];
|
||||
libaom_test::reference_idct_1d(input, output, size);
|
||||
|
||||
for (int i = 0; i < size; ++i)
|
||||
out[i] = static_cast<int32_t>(round(output[i]));
|
||||
}
|
||||
|
||||
void random_matrix(int32_t *dst, int len, ACMRandom *rnd) {
|
||||
const int bits = 16;
|
||||
const int maxVal = (1 << (bits - 1)) - 1;
|
||||
const int minVal = -(1 << (bits - 1));
|
||||
for (int i = 0; i < len; ++i) {
|
||||
if (rnd->Rand8() % 10)
|
||||
dst[i] = minVal + rnd->Rand16() % (1 << bits);
|
||||
else
|
||||
dst[i] = rnd->Rand8() % 2 ? minVal : maxVal;
|
||||
}
|
||||
}
|
||||
|
||||
TEST(av1_inv_txfm1d, InvAccuracyCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = 20000;
|
||||
const int max_error[] = { 6, 10, 19, 28 };
|
||||
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];
|
||||
|
||||
int32_t input[64];
|
||||
random_matrix(input, txfm_size, &rnd);
|
||||
|
||||
int32_t ref_output[64];
|
||||
reference_idct_1d_int(input, ref_output, txfm_size);
|
||||
|
||||
int32_t output[64];
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE int get_max_bit(int x) {
|
||||
int max_bit = -1;
|
||||
while (x) {
|
||||
x = x >> 1;
|
||||
max_bit++;
|
||||
}
|
||||
return max_bit;
|
||||
}
|
||||
|
||||
TEST(av1_inv_txfm1d, get_max_bit) {
|
||||
int max_bit = get_max_bit(8);
|
||||
EXPECT_EQ(max_bit, 3);
|
||||
}
|
||||
|
||||
TEST(av1_inv_txfm1d, round_trip) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
for (int si = 0; si < NELEMENTS(fwd_txfm_func_ls); ++si) {
|
||||
|
|
|
|||
93
third_party/aom/test/av1_inv_txfm2d_test.cc
vendored
93
third_party/aom/test/av1_inv_txfm2d_test.cc
vendored
|
|
@ -40,11 +40,12 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
|
|||
tx_size_ = GET_PARAM(1);
|
||||
max_error_ = GET_PARAM(2);
|
||||
max_avg_error_ = GET_PARAM(3);
|
||||
txfm1d_size_ = libaom_test::get_txfm1d_size(tx_size_);
|
||||
txfm2d_size_ = txfm1d_size_ * txfm1d_size_;
|
||||
}
|
||||
|
||||
void RunRoundtripCheck() {
|
||||
int tx_w = tx_size_wide[tx_size_];
|
||||
int tx_h = tx_size_high[tx_size_];
|
||||
int txfm2d_size = tx_w * tx_h;
|
||||
const Fwd_Txfm2d_Func fwd_txfm_func =
|
||||
libaom_test::fwd_txfm_func_ls[tx_size_];
|
||||
const Inv_Txfm2d_Func inv_txfm_func =
|
||||
|
|
@ -56,9 +57,9 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
|
|||
|
||||
for (int ci = 0; ci < count; ci++) {
|
||||
int16_t expected[64 * 64] = { 0 };
|
||||
ASSERT_LT(txfm2d_size_, NELEMENTS(expected));
|
||||
ASSERT_LT(txfm2d_size, NELEMENTS(expected));
|
||||
|
||||
for (int ni = 0; ni < txfm2d_size_; ++ni) {
|
||||
for (int ni = 0; ni < txfm2d_size; ++ni) {
|
||||
if (ci == 0) {
|
||||
int extreme_input = input_base - 1;
|
||||
expected[ni] = extreme_input; // extreme case
|
||||
|
|
@ -68,25 +69,26 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
|
|||
}
|
||||
|
||||
int32_t coeffs[64 * 64] = { 0 };
|
||||
ASSERT_LT(txfm2d_size_, NELEMENTS(coeffs));
|
||||
fwd_txfm_func(expected, coeffs, txfm1d_size_, tx_type_, bd);
|
||||
ASSERT_LT(txfm2d_size, NELEMENTS(coeffs));
|
||||
fwd_txfm_func(expected, coeffs, tx_w, tx_type_, bd);
|
||||
|
||||
uint16_t actual[64 * 64] = { 0 };
|
||||
ASSERT_LT(txfm2d_size_, NELEMENTS(actual));
|
||||
inv_txfm_func(coeffs, actual, txfm1d_size_, tx_type_, bd);
|
||||
ASSERT_LT(txfm2d_size, NELEMENTS(actual));
|
||||
inv_txfm_func(coeffs, actual, tx_w, tx_type_, bd);
|
||||
|
||||
for (int ni = 0; ni < txfm2d_size_; ++ni) {
|
||||
for (int ni = 0; ni < txfm2d_size; ++ni) {
|
||||
EXPECT_GE(max_error_, abs(expected[ni] - actual[ni]));
|
||||
}
|
||||
avg_abs_error += compute_avg_abs_error<int16_t, uint16_t>(
|
||||
expected, actual, txfm2d_size_);
|
||||
expected, actual, txfm2d_size);
|
||||
}
|
||||
|
||||
avg_abs_error /= count;
|
||||
// max_abs_avg_error comes from upper bound of
|
||||
// printf("txfm1d_size: %d accuracy_avg_abs_error: %f\n",
|
||||
// txfm1d_size_, avg_abs_error);
|
||||
EXPECT_GE(max_avg_error_, avg_abs_error);
|
||||
EXPECT_GE(max_avg_error_, avg_abs_error)
|
||||
<< " tx_w: " << tx_w << " tx_h " << tx_h << " tx_type: " << tx_type_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
@ -94,14 +96,53 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
|
|||
double max_avg_error_;
|
||||
TX_TYPE tx_type_;
|
||||
TX_SIZE tx_size_;
|
||||
int txfm1d_size_;
|
||||
int txfm2d_size_;
|
||||
};
|
||||
|
||||
TEST_P(AV1InvTxfm2d, RunRoundtripCheck) { RunRoundtripCheck(); }
|
||||
|
||||
const AV1InvTxfm2dParam av1_inv_txfm2d_param[] = {
|
||||
#if CONFIG_EXT_TX
|
||||
#if CONFIG_RECT_TX
|
||||
AV1InvTxfm2dParam(DCT_DCT, TX_4X8, 2, 0.007),
|
||||
AV1InvTxfm2dParam(ADST_DCT, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(DCT_ADST, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(ADST_ADST, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(FLIPADST_DCT, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(DCT_FLIPADST, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(FLIPADST_FLIPADST, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(ADST_FLIPADST, TX_4X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(FLIPADST_ADST, TX_4X8, 2, 0.012),
|
||||
|
||||
AV1InvTxfm2dParam(DCT_DCT, TX_8X4, 2, 0.007),
|
||||
AV1InvTxfm2dParam(ADST_DCT, TX_8X4, 2, 0.012),
|
||||
AV1InvTxfm2dParam(DCT_ADST, TX_8X4, 2, 0.012),
|
||||
AV1InvTxfm2dParam(ADST_ADST, TX_8X4, 2, 0.012),
|
||||
AV1InvTxfm2dParam(FLIPADST_DCT, TX_8X4, 2, 0.007),
|
||||
AV1InvTxfm2dParam(DCT_FLIPADST, TX_8X4, 2, 0.012),
|
||||
AV1InvTxfm2dParam(FLIPADST_FLIPADST, TX_8X4, 2, 0.012),
|
||||
AV1InvTxfm2dParam(ADST_FLIPADST, TX_8X4, 2, 0.012),
|
||||
AV1InvTxfm2dParam(FLIPADST_ADST, TX_8X4, 2, 0.012),
|
||||
|
||||
AV1InvTxfm2dParam(DCT_DCT, TX_8X16, 2, 0.025),
|
||||
AV1InvTxfm2dParam(ADST_DCT, TX_8X16, 2, 0.020),
|
||||
AV1InvTxfm2dParam(DCT_ADST, TX_8X16, 2, 0.027),
|
||||
AV1InvTxfm2dParam(ADST_ADST, TX_8X16, 2, 0.023),
|
||||
AV1InvTxfm2dParam(FLIPADST_DCT, TX_8X16, 2, 0.020),
|
||||
AV1InvTxfm2dParam(DCT_FLIPADST, TX_8X16, 2, 0.027),
|
||||
AV1InvTxfm2dParam(FLIPADST_FLIPADST, TX_8X16, 2, 0.032),
|
||||
AV1InvTxfm2dParam(ADST_FLIPADST, TX_8X16, 2, 0.023),
|
||||
AV1InvTxfm2dParam(FLIPADST_ADST, TX_8X16, 2, 0.023),
|
||||
|
||||
AV1InvTxfm2dParam(DCT_DCT, TX_16X8, 2, 0.007),
|
||||
AV1InvTxfm2dParam(ADST_DCT, TX_16X8, 2, 0.012),
|
||||
AV1InvTxfm2dParam(DCT_ADST, TX_16X8, 2, 0.024),
|
||||
AV1InvTxfm2dParam(ADST_ADST, TX_16X8, 2, 0.033),
|
||||
AV1InvTxfm2dParam(FLIPADST_DCT, TX_16X8, 2, 0.015),
|
||||
AV1InvTxfm2dParam(DCT_FLIPADST, TX_16X8, 2, 0.032),
|
||||
AV1InvTxfm2dParam(FLIPADST_FLIPADST, TX_16X8, 2, 0.032),
|
||||
AV1InvTxfm2dParam(ADST_FLIPADST, TX_16X8, 2, 0.033),
|
||||
AV1InvTxfm2dParam(FLIPADST_ADST, TX_16X8, 2, 0.032),
|
||||
#endif
|
||||
AV1InvTxfm2dParam(FLIPADST_DCT, TX_4X4, 2, 0.002),
|
||||
AV1InvTxfm2dParam(DCT_FLIPADST, TX_4X4, 2, 0.002),
|
||||
AV1InvTxfm2dParam(FLIPADST_FLIPADST, TX_4X4, 2, 0.002),
|
||||
|
|
@ -144,6 +185,32 @@ const AV1InvTxfm2dParam av1_inv_txfm2d_param[] = {
|
|||
INSTANTIATE_TEST_CASE_P(C, AV1InvTxfm2d,
|
||||
::testing::ValuesIn(av1_inv_txfm2d_param));
|
||||
|
||||
TEST(AV1InvTxfm2d, CfgTest) {
|
||||
for (int bd_idx = 0; bd_idx < BD_NUM; ++bd_idx) {
|
||||
int bd = libaom_test::bd_arr[bd_idx];
|
||||
int8_t low_range = libaom_test::low_range_arr[bd_idx];
|
||||
int8_t high_range = libaom_test::high_range_arr[bd_idx];
|
||||
// TODO(angiebird): include rect txfm in this test
|
||||
for (int tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
|
||||
for (int tx_type = 0; tx_type < TX_TYPES; ++tx_type) {
|
||||
TXFM_2D_FLIP_CFG cfg = av1_get_inv_txfm_cfg(
|
||||
static_cast<TX_TYPE>(tx_type), static_cast<TX_SIZE>(tx_size));
|
||||
int8_t stage_range_col[MAX_TXFM_STAGE_NUM];
|
||||
int8_t stage_range_row[MAX_TXFM_STAGE_NUM];
|
||||
av1_gen_inv_stage_range(stage_range_col, stage_range_row, &cfg,
|
||||
fwd_shift_sum[tx_size], bd);
|
||||
const TXFM_1D_CFG *col_cfg = cfg.col_cfg;
|
||||
const TXFM_1D_CFG *row_cfg = cfg.row_cfg;
|
||||
libaom_test::txfm_stage_range_check(stage_range_col, col_cfg->stage_num,
|
||||
col_cfg->cos_bit, low_range,
|
||||
high_range);
|
||||
libaom_test::txfm_stage_range_check(stage_range_row, row_cfg->stage_num,
|
||||
row_cfg->cos_bit, low_range,
|
||||
high_range);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
16
third_party/aom/test/av1_inv_txfm_test.cc
vendored
16
third_party/aom/test/av1_inv_txfm_test.cc
vendored
|
|
@ -18,6 +18,7 @@
|
|||
#include "./av1_rtcd.h"
|
||||
#include "./aom_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/av1_txfm_test.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
|
@ -29,19 +30,6 @@
|
|||
using libaom_test::ACMRandom;
|
||||
|
||||
namespace {
|
||||
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
||||
|
||||
void reference_idct_1d(const double *in, double *out, int size) {
|
||||
for (int n = 0; n < size; ++n) {
|
||||
out[n] = 0;
|
||||
for (int k = 0; k < size; ++k) {
|
||||
if (k == 0)
|
||||
out[n] += kInvSqrt2 * in[k] * cos(PI * (2 * n + 1) * k / (2 * size));
|
||||
else
|
||||
out[n] += in[k] * cos(PI * (2 * n + 1) * k / (2 * size));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (*IdctFunc)(const tran_low_t *in, tran_low_t *out);
|
||||
|
||||
|
|
@ -65,7 +53,7 @@ class TransTestBase {
|
|||
}
|
||||
|
||||
inv_txfm_(input, output);
|
||||
reference_idct_1d(ref_input, ref_output, txfm_size_);
|
||||
libaom_test::reference_idct_1d(ref_input, ref_output, txfm_size_);
|
||||
|
||||
for (int ni = 0; ni < txfm_size_; ++ni) {
|
||||
EXPECT_LE(
|
||||
|
|
|
|||
6
third_party/aom/test/av1_quantize_test.cc
vendored
6
third_party/aom/test/av1_quantize_test.cc
vendored
|
|
@ -99,8 +99,8 @@ class AV1QuantizeTest : public ::testing::TestWithParam<QuantizeFuncParams> {
|
|||
for (int j = 0; j < count; ++j) {
|
||||
err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
|
||||
(ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
|
||||
EXPECT_EQ(ref_qcoeff_ptr[j], qcoeff_ptr[j]) << "qcoeff error: i = " << i
|
||||
<< " j = " << j << "\n";
|
||||
EXPECT_EQ(ref_qcoeff_ptr[j], qcoeff_ptr[j])
|
||||
<< "qcoeff error: i = " << i << " j = " << j << "\n";
|
||||
EXPECT_EQ(ref_dqcoeff_ptr[j], dqcoeff_ptr[j])
|
||||
<< "dqcoeff error: i = " << i << " j = " << j << "\n";
|
||||
}
|
||||
|
|
@ -195,7 +195,6 @@ TEST_P(AV1QuantizeTest, BitExactCheck) { RunQuantizeTest(); }
|
|||
TEST_P(AV1QuantizeTest, EobVerify) { RunEobTest(); }
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
#if !CONFIG_AOM_QM
|
||||
const QuantizeFuncParams qfps[4] = {
|
||||
QuantizeFuncParams(av1_highbd_quantize_fp_sse4_1, &av1_highbd_quantize_fp_c,
|
||||
16),
|
||||
|
|
@ -208,6 +207,5 @@ const QuantizeFuncParams qfps[4] = {
|
|||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1QuantizeTest, ::testing::ValuesIn(qfps));
|
||||
#endif // !CONFIG_AOM_QM
|
||||
#endif // HAVE_SSE4_1
|
||||
} // namespace
|
||||
|
|
|
|||
34
third_party/aom/test/av1_txfm_test.cc
vendored
34
third_party/aom/test/av1_txfm_test.cc
vendored
|
|
@ -66,16 +66,32 @@ void get_txfm1d_type(TX_TYPE txfm2d_type, TYPE_TXFM *type0, TYPE_TXFM *type1) {
|
|||
|
||||
double invSqrt2 = 1 / pow(2, 0.5);
|
||||
|
||||
double dct_matrix(double n, double k, int size) {
|
||||
return cos(M_PI * (2 * n + 1) * k / (2 * size));
|
||||
}
|
||||
|
||||
void reference_dct_1d(const double *in, double *out, int size) {
|
||||
for (int k = 0; k < size; ++k) {
|
||||
out[k] = 0;
|
||||
for (int n = 0; n < size; ++n) {
|
||||
out[k] += in[n] * cos(M_PI * (2 * n + 1) * k / (2 * size));
|
||||
out[k] += in[n] * dct_matrix(n, k, size);
|
||||
}
|
||||
if (k == 0) out[k] = out[k] * invSqrt2;
|
||||
}
|
||||
}
|
||||
|
||||
void reference_idct_1d(const double *in, double *out, int size) {
|
||||
for (int k = 0; k < size; ++k) {
|
||||
out[k] = 0;
|
||||
for (int n = 0; n < size; ++n) {
|
||||
if (n == 0)
|
||||
out[k] += invSqrt2 * in[n] * dct_matrix(k, n, size);
|
||||
else
|
||||
out[k] += in[n] * dct_matrix(k, n, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void reference_adst_1d(const double *in, double *out, int size) {
|
||||
for (int k = 0; k < size; ++k) {
|
||||
out[k] = 0;
|
||||
|
|
@ -161,4 +177,20 @@ template void fliplr<double>(double *dest, int stride, int length);
|
|||
template void flipud<double>(double *dest, int stride, int length);
|
||||
template void fliplrud<double>(double *dest, int stride, int length);
|
||||
|
||||
int bd_arr[BD_NUM] = { 8, 10, 12 };
|
||||
int8_t low_range_arr[BD_NUM] = { 16, 32, 32 };
|
||||
int8_t high_range_arr[BD_NUM] = { 32, 32, 32 };
|
||||
|
||||
void txfm_stage_range_check(const int8_t *stage_range, int stage_num,
|
||||
const int8_t *cos_bit, int low_range,
|
||||
int high_range) {
|
||||
for (int i = 0; i < stage_num; ++i) {
|
||||
EXPECT_LE(stage_range[i], low_range);
|
||||
}
|
||||
for (int i = 0; i < stage_num - 1; ++i) {
|
||||
// make sure there is no overflow while doing half_btf()
|
||||
EXPECT_LE(stage_range[i] + cos_bit[i], high_range);
|
||||
EXPECT_LE(stage_range[i + 1] + cos_bit[i], high_range);
|
||||
}
|
||||
}
|
||||
} // namespace libaom_test
|
||||
|
|
|
|||
65
third_party/aom/test/av1_txfm_test.h
vendored
65
third_party/aom/test/av1_txfm_test.h
vendored
|
|
@ -40,6 +40,7 @@ int get_txfm1d_size(TX_SIZE tx_size);
|
|||
void get_txfm1d_type(TX_TYPE txfm2d_type, TYPE_TXFM *type0, TYPE_TXFM *type1);
|
||||
|
||||
void reference_dct_1d(const double *in, double *out, int size);
|
||||
void reference_idct_1d(const double *in, double *out, int size);
|
||||
|
||||
void reference_adst_1d(const double *in, double *out, int size);
|
||||
|
||||
|
|
@ -70,31 +71,79 @@ void fliplrud(Type *dest, int stride, int length);
|
|||
typedef void (*TxfmFunc)(const int32_t *in, int32_t *out, const int8_t *cos_bit,
|
||||
const int8_t *range_bit);
|
||||
|
||||
typedef void (*Fwd_Txfm2d_Func)(const int16_t *, int32_t *, int, int, int);
|
||||
typedef void (*Inv_Txfm2d_Func)(const int32_t *, uint16_t *, int, int, int);
|
||||
typedef void (*Fwd_Txfm2d_Func)(const int16_t *, int32_t *, int, TX_TYPE, int);
|
||||
typedef void (*Inv_Txfm2d_Func)(const int32_t *, uint16_t *, int, TX_TYPE, int);
|
||||
|
||||
static const int bd = 10;
|
||||
static const int input_base = (1 << bd);
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
#if CONFIG_AV1_ENCODER
|
||||
static const Fwd_Txfm2d_Func fwd_txfm_func_ls[TX_SIZES] = {
|
||||
|
||||
static const Fwd_Txfm2d_Func fwd_txfm_func_ls[TX_SIZES_ALL] = {
|
||||
#if CONFIG_CHROMA_2X2
|
||||
NULL,
|
||||
#endif
|
||||
av1_fwd_txfm2d_4x4_c, av1_fwd_txfm2d_8x8_c, av1_fwd_txfm2d_16x16_c,
|
||||
av1_fwd_txfm2d_32x32_c
|
||||
av1_fwd_txfm2d_4x4_c,
|
||||
av1_fwd_txfm2d_8x8_c,
|
||||
av1_fwd_txfm2d_16x16_c,
|
||||
av1_fwd_txfm2d_32x32_c,
|
||||
#if CONFIG_TX64X64
|
||||
av1_fwd_txfm2d_64x64_c,
|
||||
#endif // CONFIG_TX64X64
|
||||
av1_fwd_txfm2d_4x8_c,
|
||||
av1_fwd_txfm2d_8x4_c,
|
||||
av1_fwd_txfm2d_8x16_c,
|
||||
av1_fwd_txfm2d_16x8_c,
|
||||
av1_fwd_txfm2d_16x32_c,
|
||||
av1_fwd_txfm2d_32x16_c,
|
||||
#if CONFIG_TX64X64
|
||||
av1_fwd_txfm2d_32x64_c,
|
||||
av1_fwd_txfm2d_64x32_c,
|
||||
#endif // CONFIG_TX64X64
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#endif
|
||||
|
||||
static const Inv_Txfm2d_Func inv_txfm_func_ls[TX_SIZES] = {
|
||||
static const Inv_Txfm2d_Func inv_txfm_func_ls[TX_SIZES_ALL] = {
|
||||
#if CONFIG_CHROMA_2X2
|
||||
NULL,
|
||||
#endif
|
||||
av1_inv_txfm2d_add_4x4_c, av1_inv_txfm2d_add_8x8_c,
|
||||
av1_inv_txfm2d_add_16x16_c, av1_inv_txfm2d_add_32x32_c
|
||||
av1_inv_txfm2d_add_4x4_c,
|
||||
av1_inv_txfm2d_add_8x8_c,
|
||||
av1_inv_txfm2d_add_16x16_c,
|
||||
av1_inv_txfm2d_add_32x32_c,
|
||||
#if CONFIG_TX64X64
|
||||
av1_inv_txfm2d_add_64x64_c,
|
||||
#endif // CONFIG_TX64X64
|
||||
av1_inv_txfm2d_add_4x8_c,
|
||||
av1_inv_txfm2d_add_8x4_c,
|
||||
av1_inv_txfm2d_add_8x16_c,
|
||||
av1_inv_txfm2d_add_16x8_c,
|
||||
av1_inv_txfm2d_add_16x32_c,
|
||||
av1_inv_txfm2d_add_32x16_c,
|
||||
#if CONFIG_TX64X64
|
||||
av1_inv_txfm2d_add_32x64_c,
|
||||
av1_inv_txfm2d_add_64x32_c,
|
||||
#endif // CONFIG_TX64X64
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#define BD_NUM 3
|
||||
|
||||
extern int bd_arr[];
|
||||
extern int8_t low_range_arr[];
|
||||
extern int8_t high_range_arr[];
|
||||
|
||||
void txfm_stage_range_check(const int8_t *stage_range, int stage_num,
|
||||
const int8_t *cos_bit, int low_range,
|
||||
int high_range);
|
||||
} // namespace libaom_test
|
||||
#endif // AV1_TXFM_TEST_H_
|
||||
|
|
|
|||
8
third_party/aom/test/boolcoder_test.cc
vendored
8
third_party/aom/test/boolcoder_test.cc
vendored
|
|
@ -86,11 +86,7 @@ TEST(AV1, TestBitIO) {
|
|||
}
|
||||
}
|
||||
|
||||
#if CONFIG_EC_SMALLMUL
|
||||
#define FRAC_DIFF_TOTAL_ERROR 0.16
|
||||
#else
|
||||
#define FRAC_DIFF_TOTAL_ERROR 0.07
|
||||
#endif
|
||||
|
||||
TEST(AV1, TestTell) {
|
||||
const int kBufferSize = 10000;
|
||||
|
|
@ -116,8 +112,8 @@ TEST(AV1, TestTell) {
|
|||
aom_read(&br, p, NULL);
|
||||
uint32_t tell = aom_reader_tell(&br);
|
||||
uint32_t tell_frac = aom_reader_tell_frac(&br);
|
||||
GTEST_ASSERT_GE(tell, last_tell) << "tell: " << tell
|
||||
<< ", last_tell: " << last_tell;
|
||||
GTEST_ASSERT_GE(tell, last_tell)
|
||||
<< "tell: " << tell << ", last_tell: " << last_tell;
|
||||
GTEST_ASSERT_GE(tell_frac, last_tell_frac)
|
||||
<< "tell_frac: " << tell_frac
|
||||
<< ", last_tell_frac: " << last_tell_frac;
|
||||
|
|
|
|||
417
third_party/aom/test/cdef_test.cc
vendored
Normal file
417
third_party/aom/test/cdef_test.cc
vendored
Normal file
|
|
@ -0,0 +1,417 @@
|
|||
/*
|
||||
* 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 <cstdlib>
|
||||
#include <string>
|
||||
|
||||
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
|
||||
|
||||
#include "./aom_config.h"
|
||||
#include "./av1_rtcd.h"
|
||||
#include "aom_ports/aom_timer.h"
|
||||
#include "av1/common/cdef_block.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
using libaom_test::ACMRandom;
|
||||
|
||||
namespace {
|
||||
|
||||
typedef std::tr1::tuple<cdef_filter_block_func, cdef_filter_block_func, int>
|
||||
cdef_dir_param_t;
|
||||
|
||||
class CDEFBlockTest : public ::testing::TestWithParam<cdef_dir_param_t> {
|
||||
public:
|
||||
virtual ~CDEFBlockTest() {}
|
||||
virtual void SetUp() {
|
||||
cdef = GET_PARAM(0);
|
||||
ref_cdef = GET_PARAM(1);
|
||||
bsize = GET_PARAM(2);
|
||||
}
|
||||
|
||||
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
int bsize;
|
||||
cdef_filter_block_func cdef;
|
||||
cdef_filter_block_func ref_cdef;
|
||||
};
|
||||
|
||||
typedef CDEFBlockTest CDEFSpeedTest;
|
||||
|
||||
void test_cdef(int bsize, int iterations, cdef_filter_block_func cdef,
|
||||
cdef_filter_block_func ref_cdef) {
|
||||
const int size = 8;
|
||||
const int ysize = size + 2 * CDEF_VBORDER;
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
DECLARE_ALIGNED(16, uint16_t, s[ysize * CDEF_BSTRIDE]);
|
||||
DECLARE_ALIGNED(16, static uint16_t, d[size * size]);
|
||||
DECLARE_ALIGNED(16, static uint16_t, ref_d[size * size]);
|
||||
memset(ref_d, 0, sizeof(ref_d));
|
||||
memset(d, 0, sizeof(d));
|
||||
|
||||
int error = 0, pristrength = 0, secstrength, dir;
|
||||
int boundary, pridamping, secdamping, depth, bits, level, count,
|
||||
errdepth = 0, errpristrength = 0, errsecstrength = 0, errboundary = 0,
|
||||
errpridamping = 0, errsecdamping = 0;
|
||||
unsigned int pos = 0;
|
||||
|
||||
for (boundary = 0; boundary < 16; boundary++) {
|
||||
for (depth = 8; depth <= 12; depth += 2) {
|
||||
const unsigned int max_pos = size * size >> (depth == 8);
|
||||
for (pridamping = 3 + depth - 8;
|
||||
pridamping < 7 - 3 * !!boundary + depth - 8; pridamping++) {
|
||||
for (secdamping = 3 + depth - 8;
|
||||
secdamping < 7 - 3 * !!boundary + depth - 8; secdamping++) {
|
||||
for (count = 0; count < iterations; count++) {
|
||||
for (level = 0; level < (1 << depth) && !error;
|
||||
level += (2 + 6 * !!boundary) << (depth - 8)) {
|
||||
for (bits = 1; bits <= depth && !error;
|
||||
bits += 1 + 3 * !!boundary) {
|
||||
for (unsigned int i = 0; i < sizeof(s) / sizeof(*s); i++)
|
||||
s[i] = clamp((rnd.Rand16() & ((1 << bits) - 1)) + level, 0,
|
||||
(1 << depth) - 1);
|
||||
if (boundary) {
|
||||
if (boundary & 1) { // Left
|
||||
for (int i = 0; i < ysize; i++)
|
||||
for (int j = 0; j < CDEF_HBORDER; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 2) { // Right
|
||||
for (int i = 0; i < ysize; i++)
|
||||
for (int j = CDEF_HBORDER + size; j < CDEF_BSTRIDE; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 4) { // Above
|
||||
for (int i = 0; i < CDEF_VBORDER; i++)
|
||||
for (int j = 0; j < CDEF_BSTRIDE; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 8) { // Below
|
||||
for (int i = CDEF_VBORDER + size; i < ysize; i++)
|
||||
for (int j = 0; j < CDEF_BSTRIDE; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
}
|
||||
for (dir = 0; dir < 8; dir++) {
|
||||
for (pristrength = 0;
|
||||
pristrength <= 19 << (depth - 8) && !error;
|
||||
pristrength += (1 + 4 * !!boundary) << (depth - 8)) {
|
||||
if (pristrength == 16) pristrength = 19;
|
||||
for (secstrength = 0;
|
||||
secstrength <= 4 << (depth - 8) && !error;
|
||||
secstrength += 1 << (depth - 8)) {
|
||||
if (secstrength == 3 << (depth - 8)) continue;
|
||||
ref_cdef(depth == 8 ? (uint8_t *)ref_d : 0, ref_d, size,
|
||||
s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
|
||||
pristrength, secstrength, dir, pridamping,
|
||||
secdamping, bsize, (1 << depth) - 1);
|
||||
// If cdef and ref_cdef are the same, we're just testing
|
||||
// speed
|
||||
if (cdef != ref_cdef)
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
cdef(depth == 8 ? (uint8_t *)d : 0, d, size,
|
||||
s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
|
||||
pristrength, secstrength, dir, pridamping,
|
||||
secdamping, bsize, (1 << depth) - 1));
|
||||
if (ref_cdef != cdef) {
|
||||
for (pos = 0; pos < max_pos && !error; pos++) {
|
||||
error = ref_d[pos] != d[pos];
|
||||
errdepth = depth;
|
||||
errpristrength = pristrength;
|
||||
errsecstrength = secstrength;
|
||||
errboundary = boundary;
|
||||
errpridamping = pridamping;
|
||||
errsecdamping = secdamping;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pos--;
|
||||
EXPECT_EQ(0, error) << "Error: CDEFBlockTest, SIMD and C mismatch."
|
||||
<< std::endl
|
||||
<< "First error at " << pos % size << "," << pos / size
|
||||
<< " (" << (int16_t)ref_d[pos] << " : " << (int16_t)d[pos]
|
||||
<< ") " << std::endl
|
||||
<< "pristrength: " << errpristrength << std::endl
|
||||
<< "pridamping: " << errpridamping << std::endl
|
||||
<< "secstrength: " << errsecstrength << std::endl
|
||||
<< "secdamping: " << errsecdamping << std::endl
|
||||
<< "depth: " << errdepth << std::endl
|
||||
<< "size: " << bsize << std::endl
|
||||
<< "boundary: " << errboundary << std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void test_cdef_speed(int bsize, int iterations, cdef_filter_block_func cdef,
|
||||
cdef_filter_block_func ref_cdef) {
|
||||
aom_usec_timer ref_timer;
|
||||
aom_usec_timer timer;
|
||||
|
||||
aom_usec_timer_start(&ref_timer);
|
||||
test_cdef(bsize, iterations, ref_cdef, ref_cdef);
|
||||
aom_usec_timer_mark(&ref_timer);
|
||||
int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
|
||||
|
||||
aom_usec_timer_start(&timer);
|
||||
test_cdef(bsize, iterations, cdef, cdef);
|
||||
aom_usec_timer_mark(&timer);
|
||||
int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
|
||||
|
||||
#if 0
|
||||
std::cout << "[ ] C time = " << ref_elapsed_time / 1000
|
||||
<< " ms, SIMD time = " << elapsed_time / 1000 << " ms" << std::endl;
|
||||
#endif
|
||||
|
||||
EXPECT_GT(ref_elapsed_time, elapsed_time)
|
||||
<< "Error: CDEFSpeedTest, SIMD slower than C." << std::endl
|
||||
<< "C time: " << ref_elapsed_time << " us" << std::endl
|
||||
<< "SIMD time: " << elapsed_time << " us" << std::endl;
|
||||
}
|
||||
|
||||
typedef int (*find_dir_t)(const uint16_t *img, int stride, int32_t *var,
|
||||
int coeff_shift);
|
||||
|
||||
typedef std::tr1::tuple<find_dir_t, find_dir_t> find_dir_param_t;
|
||||
|
||||
class CDEFFindDirTest : public ::testing::TestWithParam<find_dir_param_t> {
|
||||
public:
|
||||
virtual ~CDEFFindDirTest() {}
|
||||
virtual void SetUp() {
|
||||
finddir = GET_PARAM(0);
|
||||
ref_finddir = GET_PARAM(1);
|
||||
}
|
||||
|
||||
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
find_dir_t finddir;
|
||||
find_dir_t ref_finddir;
|
||||
};
|
||||
|
||||
typedef CDEFFindDirTest CDEFFindDirSpeedTest;
|
||||
|
||||
void test_finddir(int (*finddir)(const uint16_t *img, int stride, int32_t *var,
|
||||
int coeff_shift),
|
||||
int (*ref_finddir)(const uint16_t *img, int stride,
|
||||
int32_t *var, int coeff_shift)) {
|
||||
const int size = 8;
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
DECLARE_ALIGNED(16, uint16_t, s[size * size]);
|
||||
|
||||
int error = 0;
|
||||
int depth, bits, level, count, errdepth = 0;
|
||||
int ref_res = 0, res = 0;
|
||||
int32_t ref_var = 0, var = 0;
|
||||
|
||||
for (depth = 8; depth <= 12 && !error; depth += 2) {
|
||||
for (count = 0; count < 512 && !error; count++) {
|
||||
for (level = 0; level < (1 << depth) && !error;
|
||||
level += 1 << (depth - 8)) {
|
||||
for (bits = 1; bits <= depth && !error; bits++) {
|
||||
for (unsigned int i = 0; i < sizeof(s) / sizeof(*s); i++)
|
||||
s[i] = clamp((rnd.Rand16() & ((1 << bits) - 1)) + level, 0,
|
||||
(1 << depth) - 1);
|
||||
for (int c = 0; c < 1 + 9 * (finddir == ref_finddir); c++)
|
||||
ref_res = ref_finddir(s, size, &ref_var, depth - 8);
|
||||
if (finddir != ref_finddir)
|
||||
ASM_REGISTER_STATE_CHECK(res = finddir(s, size, &var, depth - 8));
|
||||
if (ref_finddir != finddir) {
|
||||
if (res != ref_res || var != ref_var) error = 1;
|
||||
errdepth = depth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_EQ(0, error) << "Error: CDEFFindDirTest, SIMD and C mismatch."
|
||||
<< std::endl
|
||||
<< "return: " << res << " : " << ref_res << std::endl
|
||||
<< "var: " << var << " : " << ref_var << std::endl
|
||||
<< "depth: " << errdepth << std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void test_finddir_speed(int (*finddir)(const uint16_t *img, int stride,
|
||||
int32_t *var, int coeff_shift),
|
||||
int (*ref_finddir)(const uint16_t *img, int stride,
|
||||
int32_t *var, int coeff_shift)) {
|
||||
aom_usec_timer ref_timer;
|
||||
aom_usec_timer timer;
|
||||
|
||||
aom_usec_timer_start(&ref_timer);
|
||||
test_finddir(ref_finddir, ref_finddir);
|
||||
aom_usec_timer_mark(&ref_timer);
|
||||
int ref_elapsed_time = (int)aom_usec_timer_elapsed(&ref_timer);
|
||||
|
||||
aom_usec_timer_start(&timer);
|
||||
test_finddir(finddir, finddir);
|
||||
aom_usec_timer_mark(&timer);
|
||||
int elapsed_time = (int)aom_usec_timer_elapsed(&timer);
|
||||
|
||||
#if 0
|
||||
std::cout << "[ ] C time = " << ref_elapsed_time / 1000
|
||||
<< " ms, SIMD time = " << elapsed_time / 1000 << " ms" << std::endl;
|
||||
#endif
|
||||
|
||||
EXPECT_GT(ref_elapsed_time, elapsed_time)
|
||||
<< "Error: CDEFFindDirSpeedTest, SIMD slower than C." << std::endl
|
||||
<< "C time: " << ref_elapsed_time << " us" << std::endl
|
||||
<< "SIMD time: " << elapsed_time << " us" << std::endl;
|
||||
}
|
||||
|
||||
TEST_P(CDEFBlockTest, TestSIMDNoMismatch) {
|
||||
test_cdef(bsize, 1, cdef, ref_cdef);
|
||||
}
|
||||
|
||||
TEST_P(CDEFSpeedTest, DISABLED_TestSpeed) {
|
||||
test_cdef_speed(bsize, 4, cdef, ref_cdef);
|
||||
}
|
||||
|
||||
TEST_P(CDEFFindDirTest, TestSIMDNoMismatch) {
|
||||
test_finddir(finddir, ref_finddir);
|
||||
}
|
||||
|
||||
TEST_P(CDEFFindDirSpeedTest, DISABLED_TestSpeed) {
|
||||
test_finddir_speed(finddir, ref_finddir);
|
||||
}
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
// VS compiling for 32 bit targets does not support vector types in
|
||||
// structs as arguments, which makes the v256 type of the intrinsics
|
||||
// hard to support, so optimizations for this target are disabled.
|
||||
#if defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, CDEFBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_sse2, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_sse2, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, CDEFFindDirTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse2,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
#if HAVE_SSSE3
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, CDEFBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_ssse3, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_ssse3, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, CDEFFindDirTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_ssse3,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE4_1, CDEFBlockTest,
|
||||
::testing::Values(make_tuple(&cdef_filter_block_sse4_1,
|
||||
&cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_sse4_1,
|
||||
&cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFFindDirTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_AVX2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, CDEFBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_avx2, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_avx2, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, CDEFFindDirTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_avx2,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, CDEFBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_neon, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_neon, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(NEON, CDEFFindDirTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_neon,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
// Test speed for all supported architectures
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, CDEFSpeedTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_sse2, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_sse2, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, CDEFFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse2,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSSE3
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, CDEFSpeedTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_ssse3, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_ssse3, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, CDEFFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_ssse3,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE4_1, CDEFSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_filter_block_sse4_1,
|
||||
&cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_sse4_1,
|
||||
&cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_AVX2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, CDEFSpeedTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_avx2, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_avx2, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, CDEFFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_avx2,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, CDEFSpeedTest,
|
||||
::testing::Values(
|
||||
make_tuple(&cdef_filter_block_neon, &cdef_filter_block_c, BLOCK_4X4),
|
||||
make_tuple(&cdef_filter_block_neon, &cdef_filter_block_c, BLOCK_8X8)));
|
||||
INSTANTIATE_TEST_CASE_P(NEON, CDEFFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_find_dir_neon,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#endif // defined(_WIN64) || !defined(_MSC_VER)
|
||||
} // namespace
|
||||
10
third_party/aom/test/clpf_test.cc
vendored
10
third_party/aom/test/clpf_test.cc
vendored
|
|
@ -17,7 +17,7 @@
|
|||
#include "./aom_config.h"
|
||||
#include "./av1_rtcd.h"
|
||||
#include "aom_ports/aom_timer.h"
|
||||
#include "av1/common/od_dering.h"
|
||||
#include "av1/common/cdef_block.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
|
|
@ -128,22 +128,22 @@ void test_clpf(int w, int h, unsigned int depth, unsigned int iterations,
|
|||
if (boundary & 1) { // Left
|
||||
for (int i = 0; i < size; i++)
|
||||
for (int j = 0; j < xpos; j++)
|
||||
s[i * size + j] = OD_DERING_VERY_LARGE;
|
||||
s[i * size + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 2) { // Right
|
||||
for (int i = 0; i < size; i++)
|
||||
for (int j = xpos + w; j < size; j++)
|
||||
s[i * size + j] = OD_DERING_VERY_LARGE;
|
||||
s[i * size + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 4) { // Above
|
||||
for (int i = 0; i < ypos; i++)
|
||||
for (int j = 0; j < size; j++)
|
||||
s[i * size + j] = OD_DERING_VERY_LARGE;
|
||||
s[i * size + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 8) { // Below
|
||||
for (int i = ypos + h; i < size; i++)
|
||||
for (int j = 0; j < size; j++)
|
||||
s[i * size + j] = OD_DERING_VERY_LARGE;
|
||||
s[i * size + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
}
|
||||
for (strength = depth - 8; strength < depth - 5 && !error;
|
||||
|
|
|
|||
95
third_party/aom/test/coding_path_sync.cc
vendored
95
third_party/aom/test/coding_path_sync.cc
vendored
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
#include "./aom_config.h"
|
||||
|
||||
#if CONFIG_AV1_ENCODER && CONFIG_AV1_DECODER
|
||||
|
||||
#include "aom_ports/mem.h" // ROUND_POWER_OF_TWO
|
||||
#include "aom/aomcx.h"
|
||||
#include "aom/aomdx.h"
|
||||
|
|
@ -26,9 +24,9 @@
|
|||
using libaom_test::ACMRandom;
|
||||
namespace {
|
||||
|
||||
struct CompressedSource {
|
||||
explicit CompressedSource(int seed) : rnd_(seed) {
|
||||
frame_count_ = 0;
|
||||
class CompressedSource {
|
||||
public:
|
||||
explicit CompressedSource(int seed) : rnd_(seed), frame_count_(0) {
|
||||
aom_codec_iface_t *algo = &aom_codec_av1_cx_algo;
|
||||
|
||||
aom_codec_enc_cfg_t cfg;
|
||||
|
|
@ -39,8 +37,15 @@ struct CompressedSource {
|
|||
cfg.rc_end_usage = AOM_CQ;
|
||||
cfg.rc_max_quantizer = max_q;
|
||||
cfg.rc_min_quantizer = max_q;
|
||||
cfg.g_w = WIDTH;
|
||||
cfg.g_h = HEIGHT;
|
||||
|
||||
// choose the picture size
|
||||
{
|
||||
width_ = rnd_.PseudoUniform(kWidth - 8) + 8;
|
||||
height_ = rnd_.PseudoUniform(kHeight - 8) + 8;
|
||||
}
|
||||
|
||||
cfg.g_w = width_;
|
||||
cfg.g_h = height_;
|
||||
cfg.g_lag_in_frames = 0;
|
||||
|
||||
aom_codec_enc_init(&enc_, algo, &cfg, 0);
|
||||
|
|
@ -48,8 +53,8 @@ struct CompressedSource {
|
|||
|
||||
~CompressedSource() { aom_codec_destroy(&enc_); }
|
||||
|
||||
const aom_codec_cx_pkt_t *readFrame() {
|
||||
uint8_t buf[WIDTH * HEIGHT * 3 / 2] = { 0 };
|
||||
const aom_codec_cx_pkt_t *ReadFrame() {
|
||||
uint8_t buf[kWidth * kHeight * 3 / 2] = { 0 };
|
||||
|
||||
// render regular pattern
|
||||
const int period = rnd_.Rand8() % 32 + 1;
|
||||
|
|
@ -57,52 +62,63 @@ struct CompressedSource {
|
|||
|
||||
const int val_a = rnd_.Rand8();
|
||||
const int val_b = rnd_.Rand8();
|
||||
|
||||
for (int i = 0; i < (int)sizeof buf; ++i)
|
||||
buf[i] = (i + phase) % period < period / 2 ? val_a : val_b;
|
||||
|
||||
aom_image_t img;
|
||||
aom_img_wrap(&img, AOM_IMG_FMT_I420, WIDTH, HEIGHT, 0, buf);
|
||||
aom_img_wrap(&img, AOM_IMG_FMT_I420, width_, height_, 0, buf);
|
||||
aom_codec_encode(&enc_, &img, frame_count_++, 1, 0, 0);
|
||||
|
||||
aom_codec_iter_t iter = NULL;
|
||||
return aom_codec_get_cx_data(&enc_, &iter);
|
||||
|
||||
const aom_codec_cx_pkt_t *pkt = NULL;
|
||||
|
||||
do {
|
||||
pkt = aom_codec_get_cx_data(&enc_, &iter);
|
||||
} while (pkt && pkt->kind != AOM_CODEC_CX_FRAME_PKT);
|
||||
|
||||
return pkt;
|
||||
}
|
||||
|
||||
private:
|
||||
static const int kWidth = 128;
|
||||
static const int kHeight = 128;
|
||||
|
||||
ACMRandom rnd_;
|
||||
aom_codec_ctx_t enc_;
|
||||
int frame_count_;
|
||||
static const int WIDTH = 32;
|
||||
static const int HEIGHT = 32;
|
||||
int width_, height_;
|
||||
};
|
||||
|
||||
// lowers an aom_image_t to a easily comparable/printable form
|
||||
std::vector<int16_t> serialize(const aom_image_t *img) {
|
||||
const int w_uv = ROUND_POWER_OF_TWO(img->d_w, img->x_chroma_shift);
|
||||
const int h_uv = ROUND_POWER_OF_TWO(img->d_h, img->y_chroma_shift);
|
||||
const int w[] = { (int)img->d_w, w_uv, w_uv };
|
||||
const int h[] = { (int)img->d_h, h_uv, h_uv };
|
||||
|
||||
std::vector<int16_t> Serialize(const aom_image_t *img) {
|
||||
std::vector<int16_t> bytes;
|
||||
bytes.reserve(img->d_w * img->d_h * 3);
|
||||
for (int plane = 0; plane < 3; ++plane)
|
||||
for (int r = 0; r < h[plane]; ++r)
|
||||
for (int c = 0; c < w[plane]; ++c) {
|
||||
const int offset = r * img->stride[plane] + c;
|
||||
for (int plane = 0; plane < 3; ++plane) {
|
||||
const int w = aom_img_plane_width(img, plane);
|
||||
const int h = aom_img_plane_height(img, plane);
|
||||
|
||||
for (int r = 0; r < h; ++r) {
|
||||
for (int c = 0; c < w; ++c) {
|
||||
unsigned char *row = img->planes[plane] + r * img->stride[plane];
|
||||
if (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH)
|
||||
bytes.push_back(img->planes[plane][offset * 2]);
|
||||
bytes.push_back(row[c * 2]);
|
||||
else
|
||||
bytes.push_back(img->planes[plane][offset]);
|
||||
bytes.push_back(row[c]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
struct Decoder {
|
||||
class Decoder {
|
||||
public:
|
||||
explicit Decoder(int allowLowbitdepth) {
|
||||
aom_codec_iface_t *algo = &aom_codec_av1_dx_algo;
|
||||
|
||||
aom_codec_dec_cfg cfg = { 0 };
|
||||
aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t();
|
||||
cfg.allow_lowbitdepth = allowLowbitdepth;
|
||||
|
||||
aom_codec_dec_init(&dec_, algo, &cfg, 0);
|
||||
|
|
@ -111,11 +127,11 @@ struct Decoder {
|
|||
~Decoder() { aom_codec_destroy(&dec_); }
|
||||
|
||||
std::vector<int16_t> decode(const aom_codec_cx_pkt_t *pkt) {
|
||||
aom_codec_decode(&dec_, (uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz,
|
||||
NULL, 0);
|
||||
aom_codec_decode(&dec_, static_cast<uint8_t *>(pkt->data.frame.buf),
|
||||
static_cast<unsigned int>(pkt->data.frame.sz), NULL, 0);
|
||||
|
||||
aom_codec_iter_t iter = NULL;
|
||||
return serialize(aom_codec_get_frame(&dec_, &iter));
|
||||
return Serialize(aom_codec_get_frame(&dec_, &iter));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
@ -124,22 +140,19 @@ struct Decoder {
|
|||
|
||||
// Try to reveal a mismatch between LBD and HBD coding paths.
|
||||
TEST(CodingPathSync, SearchForHbdLbdMismatch) {
|
||||
// disable test. Re-enable it locally to help diagnosing LBD/HBD mismatches.
|
||||
// And re-enable it once both coding paths match
|
||||
// so they don't diverge anymore.
|
||||
return;
|
||||
|
||||
const int count_tests = 100;
|
||||
for (int i = 0; i < count_tests; ++i) {
|
||||
Decoder dec_HBD(0);
|
||||
Decoder dec_LBD(1);
|
||||
Decoder dec_hbd(0);
|
||||
Decoder dec_lbd(1);
|
||||
|
||||
CompressedSource enc(i);
|
||||
const aom_codec_cx_pkt_t *frame = enc.readFrame();
|
||||
ASSERT_EQ(dec_LBD.decode(frame), dec_HBD.decode(frame));
|
||||
const aom_codec_cx_pkt_t *frame = enc.ReadFrame();
|
||||
|
||||
std::vector<int16_t> lbd_yuv = dec_lbd.decode(frame);
|
||||
std::vector<int16_t> hbd_yuv = dec_hbd.decode(frame);
|
||||
|
||||
ASSERT_EQ(lbd_yuv, hbd_yuv);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
|
|
|
|||
43
third_party/aom/test/convolve_round_test.cc
vendored
43
third_party/aom/test/convolve_round_test.cc
vendored
|
|
@ -12,13 +12,13 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "./av1_rtcd.h"
|
||||
#include "aom/aom_integer.h"
|
||||
#include "aom_ports/aom_timer.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
|
||||
#include "aom/aom_integer.h"
|
||||
#include "aom_ports/aom_timer.h"
|
||||
|
||||
using libaom_test::ACMRandom;
|
||||
|
||||
|
|
@ -68,12 +68,18 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
|
|||
virtual void SetUp() {
|
||||
const size_t block_size = 128 * 128;
|
||||
src_ = reinterpret_cast<int32_t *>(
|
||||
aom_memalign(16, 3 * block_size * sizeof(int32_t)));
|
||||
dst_ref_ = reinterpret_cast<uint16_t *>(src_ + block_size);
|
||||
dst_ = dst_ref_ + block_size;
|
||||
aom_memalign(16, block_size * sizeof(*src_)));
|
||||
dst_ref_ = reinterpret_cast<uint16_t *>(
|
||||
aom_memalign(16, block_size * sizeof(*dst_ref_)));
|
||||
dst_ = reinterpret_cast<uint16_t *>(
|
||||
aom_memalign(16, block_size * sizeof(*dst_)));
|
||||
}
|
||||
|
||||
virtual void TearDown() { aom_free(src_); }
|
||||
virtual void TearDown() {
|
||||
aom_free(src_);
|
||||
aom_free(dst_ref_);
|
||||
aom_free(dst_);
|
||||
}
|
||||
|
||||
void ConvolveRoundingRun() {
|
||||
int test_num = 0;
|
||||
|
|
@ -82,7 +88,6 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
|
|||
int bits = 13;
|
||||
uint8_t *dst = 0;
|
||||
uint8_t *dst_ref = 0;
|
||||
int diff_wide;
|
||||
|
||||
if (data_path_ == LOWBITDEPTH_TEST) {
|
||||
dst = reinterpret_cast<uint8_t *>(dst_);
|
||||
|
|
@ -109,14 +114,24 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
|
|||
GenerateBufferWithRandom(src_, src_stride, bits, w, h);
|
||||
|
||||
func_ref_(src_, src_stride, dst_ref, dst_stride, w, h, bits);
|
||||
func_(src_, src_stride, dst, dst_stride, w, h, bits);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
func_(src_, src_stride, dst, dst_stride, w, h, bits));
|
||||
|
||||
diff_wide = w;
|
||||
if (data_path_ == LOWBITDEPTH_TEST) diff_wide >>= 1;
|
||||
for (int r = 0; r < h; ++r) {
|
||||
for (int c = 0; c < diff_wide; ++c) {
|
||||
ASSERT_EQ(dst_ref_[r * dst_stride + c], dst_[r * dst_stride + c])
|
||||
<< "Mismatch at r: " << r << " c: " << c << " test: " << test_num;
|
||||
if (data_path_ == LOWBITDEPTH_TEST) {
|
||||
for (int r = 0; r < h; ++r) {
|
||||
for (int c = 0; c < w; ++c) {
|
||||
ASSERT_EQ(dst_ref[r * dst_stride + c], dst[r * dst_stride + c])
|
||||
<< "Mismatch at r: " << r << " c: " << c << " w: " << w
|
||||
<< " h: " << h << " test: " << test_num;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int r = 0; r < h; ++r) {
|
||||
for (int c = 0; c < w; ++c) {
|
||||
ASSERT_EQ(dst_ref_[r * dst_stride + c], dst_[r * dst_stride + c])
|
||||
<< "Mismatch at r: " << r << " c: " << c << " w: " << w
|
||||
<< " h: " << h << " test: " << test_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
44
third_party/aom/test/convolve_test.cc
vendored
44
third_party/aom/test/convolve_test.cc
vendored
|
|
@ -67,18 +67,7 @@ struct ConvolveFunctions {
|
|||
|
||||
typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam;
|
||||
|
||||
#if CONFIG_AV1 && CONFIG_EXT_PARTITION
|
||||
#define ALL_SIZES(convolve_fn) \
|
||||
make_tuple(128, 64, &convolve_fn), make_tuple(64, 128, &convolve_fn), \
|
||||
make_tuple(128, 128, &convolve_fn), make_tuple(4, 4, &convolve_fn), \
|
||||
make_tuple(8, 4, &convolve_fn), make_tuple(4, 8, &convolve_fn), \
|
||||
make_tuple(8, 8, &convolve_fn), make_tuple(16, 8, &convolve_fn), \
|
||||
make_tuple(8, 16, &convolve_fn), make_tuple(16, 16, &convolve_fn), \
|
||||
make_tuple(32, 16, &convolve_fn), make_tuple(16, 32, &convolve_fn), \
|
||||
make_tuple(32, 32, &convolve_fn), make_tuple(64, 32, &convolve_fn), \
|
||||
make_tuple(32, 64, &convolve_fn), make_tuple(64, 64, &convolve_fn)
|
||||
#else
|
||||
#define ALL_SIZES(convolve_fn) \
|
||||
#define ALL_SIZES_64(convolve_fn) \
|
||||
make_tuple(4, 4, &convolve_fn), make_tuple(8, 4, &convolve_fn), \
|
||||
make_tuple(4, 8, &convolve_fn), make_tuple(8, 8, &convolve_fn), \
|
||||
make_tuple(16, 8, &convolve_fn), make_tuple(8, 16, &convolve_fn), \
|
||||
|
|
@ -86,6 +75,13 @@ typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam;
|
|||
make_tuple(16, 32, &convolve_fn), make_tuple(32, 32, &convolve_fn), \
|
||||
make_tuple(64, 32, &convolve_fn), make_tuple(32, 64, &convolve_fn), \
|
||||
make_tuple(64, 64, &convolve_fn)
|
||||
|
||||
#if CONFIG_AV1 && CONFIG_EXT_PARTITION
|
||||
#define ALL_SIZES(convolve_fn) \
|
||||
make_tuple(128, 64, &convolve_fn), make_tuple(64, 128, &convolve_fn), \
|
||||
make_tuple(128, 128, &convolve_fn), ALL_SIZES_64(convolve_fn)
|
||||
#else
|
||||
#define ALL_SIZES ALL_SIZES_64
|
||||
#endif // CONFIG_AV1 && CONFIG_EXT_PARTITION
|
||||
|
||||
// Reference 8-tap subpixel filter, slightly modified to fit into this test.
|
||||
|
|
@ -414,7 +410,9 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
|
|||
|
||||
void CheckGuardBlocks() {
|
||||
for (int i = 0; i < kOutputBufferSize; ++i) {
|
||||
if (IsIndexInBorder(i)) EXPECT_EQ(255, output_[i]);
|
||||
if (IsIndexInBorder(i)) {
|
||||
EXPECT_EQ(255, output_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1282,9 +1280,9 @@ const ConvolveFunctions convolve12_avx2(
|
|||
wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
|
||||
wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12,
|
||||
wrap_convolve8_avg_c_12, 12);
|
||||
const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES(convolve8_avx2),
|
||||
ALL_SIZES(convolve10_avx2),
|
||||
ALL_SIZES(convolve12_avx2) };
|
||||
const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES_64(convolve8_avx2),
|
||||
ALL_SIZES_64(convolve10_avx2),
|
||||
ALL_SIZES_64(convolve12_avx2) };
|
||||
#else
|
||||
const ConvolveFunctions convolve8_avx2(
|
||||
aom_convolve_copy_c, aom_convolve_avg_c, aom_convolve8_horiz_avx2,
|
||||
|
|
@ -1293,7 +1291,7 @@ const ConvolveFunctions convolve8_avx2(
|
|||
aom_scaled_horiz_c, aom_scaled_avg_horiz_c, aom_scaled_vert_c,
|
||||
aom_scaled_avg_vert_c, aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
|
||||
|
||||
const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES(convolve8_avx2) };
|
||||
const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES_64(convolve8_avx2) };
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest,
|
||||
::testing::ValuesIn(kArrayConvolve8_avx2));
|
||||
|
|
@ -1317,10 +1315,10 @@ const ConvolveFunctions convolve8_neon(
|
|||
aom_scaled_avg_vert_c, aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
|
||||
#endif // HAVE_NEON_ASM
|
||||
|
||||
const ConvolveParam kArrayConvolve8_neon[] = { ALL_SIZES(convolve8_neon) };
|
||||
const ConvolveParam kArrayConvolve8_neon[] = { ALL_SIZES_64(convolve8_neon) };
|
||||
INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest,
|
||||
::testing::ValuesIn(kArrayConvolve8_neon));
|
||||
#endif // HAVE_NEON
|
||||
#endif // HAVE_NEON && !(CONFIG_AV1 && CONFIG_EXT_PARTITION)
|
||||
|
||||
// TODO(any): Make DSPR2 versions support 128x128 128x64 64x128 block sizes
|
||||
#if HAVE_DSPR2 && !(CONFIG_AV1 && CONFIG_EXT_PARTITION)
|
||||
|
|
@ -1331,10 +1329,10 @@ const ConvolveFunctions convolve8_dspr2(
|
|||
aom_scaled_horiz_c, aom_scaled_avg_horiz_c, aom_scaled_vert_c,
|
||||
aom_scaled_avg_vert_c, aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
|
||||
|
||||
const ConvolveParam kArrayConvolve8_dspr2[] = { ALL_SIZES(convolve8_dspr2) };
|
||||
const ConvolveParam kArrayConvolve8_dspr2[] = { ALL_SIZES_64(convolve8_dspr2) };
|
||||
INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest,
|
||||
::testing::ValuesIn(kArrayConvolve8_dspr2));
|
||||
#endif // HAVE_DSPR2
|
||||
#endif // HAVE_DSPR2 && !(CONFIG_AV1 && CONFIG_EXT_PARTITION)
|
||||
|
||||
// TODO(any): Make MSA versions support 128x128 128x64 64x128 block sizes
|
||||
#if HAVE_MSA && !(CONFIG_AV1 && CONFIG_EXT_PARTITION)
|
||||
|
|
@ -1345,8 +1343,8 @@ const ConvolveFunctions convolve8_msa(
|
|||
aom_scaled_horiz_c, aom_scaled_avg_horiz_c, aom_scaled_vert_c,
|
||||
aom_scaled_avg_vert_c, aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
|
||||
|
||||
const ConvolveParam kArrayConvolve8_msa[] = { ALL_SIZES(convolve8_msa) };
|
||||
const ConvolveParam kArrayConvolve8_msa[] = { ALL_SIZES_64(convolve8_msa) };
|
||||
INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest,
|
||||
::testing::ValuesIn(kArrayConvolve8_msa));
|
||||
#endif // HAVE_MSA
|
||||
#endif // HAVE_MSA && !(CONFIG_AV1 && CONFIG_EXT_PARTITION)
|
||||
} // namespace
|
||||
|
|
|
|||
4
third_party/aom/test/datarate_test.cc
vendored
4
third_party/aom/test/datarate_test.cc
vendored
|
|
@ -89,8 +89,8 @@ class DatarateTestLarge
|
|||
duration * timebase_ * cfg_.rc_target_bitrate * 1000);
|
||||
|
||||
// Buffer should not go negative.
|
||||
ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
|
||||
<< pkt->data.frame.pts;
|
||||
ASSERT_GE(bits_in_buffer_model_, 0)
|
||||
<< "Buffer Underrun at frame " << pkt->data.frame.pts;
|
||||
|
||||
const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
|
||||
|
||||
|
|
|
|||
115
third_party/aom/test/dct16x16_test.cc
vendored
115
third_party/aom/test/dct16x16_test.cc
vendored
|
|
@ -230,9 +230,11 @@ typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
|
|||
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
||||
const TxfmParam *txfm_param);
|
||||
|
||||
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct16x16Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht16x16Param;
|
||||
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, aom_bit_depth_t>
|
||||
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 fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
|
|
@ -510,8 +512,8 @@ class Trans16x16TestBase {
|
|||
const int diff = dst[j] - src[j];
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
const uint32_t error = diff * diff;
|
||||
EXPECT_GE(1u, error) << "Error: 16x16 IDCT has error " << error
|
||||
<< " at index " << j;
|
||||
EXPECT_GE(1u, error)
|
||||
<< "Error: 16x16 IDCT has error " << error << " at index " << j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -778,94 +780,109 @@ using std::tr1::make_tuple;
|
|||
INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct16x16_c,
|
||||
&aom_idct16x16_256_add_c,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct16x16_c,
|
||||
&aom_idct16x16_256_add_c,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16HT,
|
||||
::testing::Values(
|
||||
make_tuple(&fht16x16_10, &iht16x16_10, 0, AOM_BITS_10),
|
||||
make_tuple(&fht16x16_10, &iht16x16_10, 1, AOM_BITS_10),
|
||||
make_tuple(&fht16x16_10, &iht16x16_10, 2, AOM_BITS_10),
|
||||
make_tuple(&fht16x16_10, &iht16x16_10, 3, AOM_BITS_10),
|
||||
make_tuple(&fht16x16_12, &iht16x16_12, 0, AOM_BITS_12),
|
||||
make_tuple(&fht16x16_12, &iht16x16_12, 1, AOM_BITS_12),
|
||||
make_tuple(&fht16x16_12, &iht16x16_12, 2, AOM_BITS_12),
|
||||
make_tuple(&fht16x16_12, &iht16x16_12, 3, AOM_BITS_12),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 3, AOM_BITS_8)));
|
||||
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)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, 3, AOM_BITS_8)));
|
||||
::testing::Values(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)));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct16x16_c, &aom_idct16x16_256_add_neon,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct16x16_sse2,
|
||||
&aom_idct16x16_256_add_sse2, 0, AOM_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(
|
||||
&aom_fdct16x16_sse2, &aom_idct16x16_256_add_sse2,
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#if !CONFIG_DAALA_DCT16
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16HT,
|
||||
::testing::Values(make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
||||
0, AOM_BITS_8),
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
||||
1, AOM_BITS_8),
|
||||
ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
||||
2, AOM_BITS_8),
|
||||
DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
||||
3, AOM_BITS_8)));
|
||||
ADST_ADST, AOM_BITS_8)));
|
||||
#endif // CONFIG_DAALA_DCT16
|
||||
#endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct16x16_sse2,
|
||||
&aom_idct16x16_256_add_c,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#if !CONFIG_DAALA_DCT16
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c, 3,
|
||||
AOM_BITS_8)));
|
||||
::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
|
||||
#endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(MSA, Trans16x16DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct16x16_msa,
|
||||
&aom_idct16x16_256_add_msa,
|
||||
0, AOM_BITS_8)));
|
||||
#if !CONFIG_EXT_TX
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#if !CONFIG_EXT_TX && !CONFIG_DAALA_DCT16
|
||||
// TODO(yaowu): re-enable this after msa versions are updated to match C.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
DISABLED_MSA, Trans16x16HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa, 3,
|
||||
AOM_BITS_8)));
|
||||
#endif // !CONFIG_EXT_TX
|
||||
::testing::Values(make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa,
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa,
|
||||
ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa,
|
||||
DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht16x16_msa, &av1_iht16x16_256_add_msa,
|
||||
ADST_ADST, AOM_BITS_8)));
|
||||
#endif // !CONFIG_EXT_TX && !CONFIG_DAALA_DCT16
|
||||
#endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
|
|
|||
42
third_party/aom/test/dct32x32_test.cc
vendored
42
third_party/aom/test/dct32x32_test.cc
vendored
|
|
@ -363,53 +363,63 @@ INSTANTIATE_TEST_CASE_P(
|
|||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_c, &aom_idct32x32_1024_add_neon,
|
||||
0, AOM_BITS_8),
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_c,
|
||||
&aom_idct32x32_1024_add_neon, 1, AOM_BITS_8)));
|
||||
&aom_idct32x32_1024_add_neon, ADST_DCT,
|
||||
AOM_BITS_8)));
|
||||
#endif // HAVE_NEON && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_sse2,
|
||||
&aom_idct32x32_1024_add_sse2, 0, AOM_BITS_8),
|
||||
&aom_idct32x32_1024_add_sse2, DCT_DCT,
|
||||
AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_sse2,
|
||||
&aom_idct32x32_1024_add_sse2, 1, AOM_BITS_8)));
|
||||
&aom_idct32x32_1024_add_sse2, ADST_DCT,
|
||||
AOM_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_sse2, &aom_idct32x32_1024_add_c,
|
||||
0, AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_sse2,
|
||||
&aom_idct32x32_1024_add_c, 1, AOM_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_sse2,
|
||||
&aom_idct32x32_1024_add_c,
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_sse2,
|
||||
&aom_idct32x32_1024_add_c,
|
||||
ADST_DCT, AOM_BITS_8)));
|
||||
#endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_AVX2 && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_avx2,
|
||||
&aom_idct32x32_1024_add_sse2, 0, AOM_BITS_8),
|
||||
&aom_idct32x32_1024_add_sse2, DCT_DCT,
|
||||
AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_avx2,
|
||||
&aom_idct32x32_1024_add_sse2, 1, AOM_BITS_8)));
|
||||
&aom_idct32x32_1024_add_sse2, ADST_DCT,
|
||||
AOM_BITS_8)));
|
||||
#endif // HAVE_AVX2 && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_AVX2 && CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_avx2,
|
||||
&aom_idct32x32_1024_add_sse2, 0, AOM_BITS_8),
|
||||
&aom_idct32x32_1024_add_sse2, DCT_DCT,
|
||||
AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_avx2,
|
||||
&aom_idct32x32_1024_add_sse2, 1, AOM_BITS_8)));
|
||||
&aom_idct32x32_1024_add_sse2, ADST_DCT,
|
||||
AOM_BITS_8)));
|
||||
#endif // HAVE_AVX2 && CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans32x32Test,
|
||||
::testing::Values(make_tuple(&aom_fdct32x32_msa,
|
||||
&aom_idct32x32_1024_add_msa, 0, AOM_BITS_8),
|
||||
&aom_idct32x32_1024_add_msa, DCT_DCT,
|
||||
AOM_BITS_8),
|
||||
make_tuple(&aom_fdct32x32_rd_msa,
|
||||
&aom_idct32x32_1024_add_msa, 1, AOM_BITS_8)));
|
||||
&aom_idct32x32_1024_add_msa, ADST_DCT,
|
||||
AOM_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
|
|
|||
3
third_party/aom/test/decode_api_test.cc
vendored
3
third_party/aom/test/decode_api_test.cc
vendored
|
|
@ -44,8 +44,11 @@ TEST(DecodeAPI, InvalidParams) {
|
|||
aom_codec_dec_init(NULL, kCodecs[i], NULL, 0));
|
||||
|
||||
EXPECT_EQ(AOM_CODEC_OK, aom_codec_dec_init(&dec, kCodecs[i], NULL, 0));
|
||||
#if !CONFIG_OBU
|
||||
// Needs to be fixed
|
||||
EXPECT_EQ(AOM_CODEC_UNSUP_BITSTREAM,
|
||||
aom_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0));
|
||||
#endif
|
||||
EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
|
||||
aom_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0));
|
||||
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(&dec, buf, 0, NULL, 0));
|
||||
|
|
|
|||
11
third_party/aom/test/decode_test_driver.cc
vendored
11
third_party/aom/test/decode_test_driver.cc
vendored
|
|
@ -59,14 +59,15 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder,
|
|||
/* Vp8's implementation of PeekStream returns an error if the frame you
|
||||
* pass it is not a keyframe, so we only expect AOM_CODEC_OK on the first
|
||||
* frame, which must be a keyframe. */
|
||||
if (video->frame_number() == 0)
|
||||
ASSERT_EQ(AOM_CODEC_OK, res_peek) << "Peek return failed: "
|
||||
<< aom_codec_err_to_string(res_peek);
|
||||
if (video->frame_number() == 0) {
|
||||
ASSERT_EQ(AOM_CODEC_OK, res_peek)
|
||||
<< "Peek return failed: " << aom_codec_err_to_string(res_peek);
|
||||
}
|
||||
} else {
|
||||
/* The Av1 implementation of PeekStream returns an error only if the
|
||||
* data passed to it isn't a valid Av1 chunk. */
|
||||
ASSERT_EQ(AOM_CODEC_OK, res_peek) << "Peek return failed: "
|
||||
<< aom_codec_err_to_string(res_peek);
|
||||
ASSERT_EQ(AOM_CODEC_OK, res_peek)
|
||||
<< "Peek return failed: " << aom_codec_err_to_string(res_peek);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
191
third_party/aom/test/dering_test.cc
vendored
191
third_party/aom/test/dering_test.cc
vendored
|
|
@ -17,7 +17,7 @@
|
|||
#include "./aom_config.h"
|
||||
#include "./av1_rtcd.h"
|
||||
#include "aom_ports/aom_timer.h"
|
||||
#include "av1/common/od_dering.h"
|
||||
#include "av1/common/cdef_block.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
|
|
@ -27,8 +27,7 @@ using libaom_test::ACMRandom;
|
|||
|
||||
namespace {
|
||||
|
||||
typedef std::tr1::tuple<od_filter_dering_direction_func,
|
||||
od_filter_dering_direction_func, int>
|
||||
typedef std::tr1::tuple<cdef_direction_func, cdef_direction_func, int>
|
||||
dering_dir_param_t;
|
||||
|
||||
class CDEFDeringDirTest : public ::testing::TestWithParam<dering_dir_param_t> {
|
||||
|
|
@ -44,19 +43,18 @@ class CDEFDeringDirTest : public ::testing::TestWithParam<dering_dir_param_t> {
|
|||
|
||||
protected:
|
||||
int bsize;
|
||||
od_filter_dering_direction_func dering;
|
||||
od_filter_dering_direction_func ref_dering;
|
||||
cdef_direction_func dering;
|
||||
cdef_direction_func ref_dering;
|
||||
};
|
||||
|
||||
typedef CDEFDeringDirTest CDEFDeringSpeedTest;
|
||||
|
||||
void test_dering(int bsize, int iterations,
|
||||
od_filter_dering_direction_func dering,
|
||||
od_filter_dering_direction_func ref_dering) {
|
||||
void test_dering(int bsize, int iterations, cdef_direction_func dering,
|
||||
cdef_direction_func ref_dering) {
|
||||
const int size = 8;
|
||||
const int ysize = size + 2 * OD_FILT_VBORDER;
|
||||
const int ysize = size + 2 * CDEF_VBORDER;
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
DECLARE_ALIGNED(16, uint16_t, s[ysize * OD_FILT_BSTRIDE]);
|
||||
DECLARE_ALIGNED(16, uint16_t, s[ysize * CDEF_BSTRIDE]);
|
||||
DECLARE_ALIGNED(16, static uint16_t, d[size * size]);
|
||||
DECLARE_ALIGNED(16, static uint16_t, ref_d[size * size]);
|
||||
memset(ref_d, 0, sizeof(ref_d));
|
||||
|
|
@ -80,38 +78,36 @@ void test_dering(int bsize, int iterations,
|
|||
if (boundary) {
|
||||
if (boundary & 1) { // Left
|
||||
for (int i = 0; i < ysize; i++)
|
||||
for (int j = 0; j < OD_FILT_HBORDER; j++)
|
||||
s[i * OD_FILT_BSTRIDE + j] = OD_DERING_VERY_LARGE;
|
||||
for (int j = 0; j < CDEF_HBORDER; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 2) { // Right
|
||||
for (int i = 0; i < ysize; i++)
|
||||
for (int j = OD_FILT_HBORDER + size; j < OD_FILT_BSTRIDE;
|
||||
j++)
|
||||
s[i * OD_FILT_BSTRIDE + j] = OD_DERING_VERY_LARGE;
|
||||
for (int j = CDEF_HBORDER + size; j < CDEF_BSTRIDE; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 4) { // Above
|
||||
for (int i = 0; i < OD_FILT_VBORDER; i++)
|
||||
for (int j = 0; j < OD_FILT_BSTRIDE; j++)
|
||||
s[i * OD_FILT_BSTRIDE + j] = OD_DERING_VERY_LARGE;
|
||||
for (int i = 0; i < CDEF_VBORDER; i++)
|
||||
for (int j = 0; j < CDEF_BSTRIDE; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
if (boundary & 8) { // Below
|
||||
for (int i = OD_FILT_VBORDER + size; i < ysize; i++)
|
||||
for (int j = 0; j < OD_FILT_BSTRIDE; j++)
|
||||
s[i * OD_FILT_BSTRIDE + j] = OD_DERING_VERY_LARGE;
|
||||
for (int i = CDEF_VBORDER + size; i < ysize; i++)
|
||||
for (int j = 0; j < CDEF_BSTRIDE; j++)
|
||||
s[i * CDEF_BSTRIDE + j] = CDEF_VERY_LARGE;
|
||||
}
|
||||
}
|
||||
for (dir = 0; dir < 8; dir++) {
|
||||
for (threshold = 0; threshold < 64 << (depth - 8) && !error;
|
||||
threshold += (1 + 4 * !!boundary) << (depth - 8)) {
|
||||
ref_dering(ref_d, size, s + OD_FILT_HBORDER +
|
||||
OD_FILT_VBORDER * OD_FILT_BSTRIDE,
|
||||
ref_dering(ref_d, size,
|
||||
s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
|
||||
threshold, dir, damping);
|
||||
// If dering and ref_dering are the same, we're just testing
|
||||
// speed
|
||||
if (dering != ref_dering)
|
||||
ASM_REGISTER_STATE_CHECK(dering(
|
||||
d, size,
|
||||
s + OD_FILT_HBORDER + OD_FILT_VBORDER * OD_FILT_BSTRIDE,
|
||||
d, size, s + CDEF_HBORDER + CDEF_VBORDER * CDEF_BSTRIDE,
|
||||
threshold, dir, damping));
|
||||
if (ref_dering != dering) {
|
||||
for (pos = 0; pos < sizeof(d) / sizeof(*d) && !error;
|
||||
|
|
@ -146,9 +142,8 @@ void test_dering(int bsize, int iterations,
|
|||
<< std::endl;
|
||||
}
|
||||
|
||||
void test_dering_speed(int bsize, int iterations,
|
||||
od_filter_dering_direction_func dering,
|
||||
od_filter_dering_direction_func ref_dering) {
|
||||
void test_dering_speed(int bsize, int iterations, cdef_direction_func dering,
|
||||
cdef_direction_func ref_dering) {
|
||||
aom_usec_timer ref_timer;
|
||||
aom_usec_timer timer;
|
||||
|
||||
|
|
@ -173,7 +168,7 @@ void test_dering_speed(int bsize, int iterations,
|
|||
<< "SIMD time: " << elapsed_time << " us" << std::endl;
|
||||
}
|
||||
|
||||
typedef int (*find_dir_t)(const od_dering_in *img, int stride, int32_t *var,
|
||||
typedef int (*find_dir_t)(const uint16_t *img, int stride, int32_t *var,
|
||||
int coeff_shift);
|
||||
|
||||
typedef std::tr1::tuple<find_dir_t, find_dir_t> find_dir_param_t;
|
||||
|
|
@ -196,9 +191,9 @@ class CDEFDeringFindDirTest
|
|||
|
||||
typedef CDEFDeringFindDirTest CDEFDeringFindDirSpeedTest;
|
||||
|
||||
void test_finddir(int (*finddir)(const od_dering_in *img, int stride,
|
||||
int32_t *var, int coeff_shift),
|
||||
int (*ref_finddir)(const od_dering_in *img, int stride,
|
||||
void test_finddir(int (*finddir)(const uint16_t *img, int stride, int32_t *var,
|
||||
int coeff_shift),
|
||||
int (*ref_finddir)(const uint16_t *img, int stride,
|
||||
int32_t *var, int coeff_shift)) {
|
||||
const int size = 8;
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
|
@ -238,9 +233,9 @@ void test_finddir(int (*finddir)(const od_dering_in *img, int stride,
|
|||
<< std::endl;
|
||||
}
|
||||
|
||||
void test_finddir_speed(int (*finddir)(const od_dering_in *img, int stride,
|
||||
void test_finddir_speed(int (*finddir)(const uint16_t *img, int stride,
|
||||
int32_t *var, int coeff_shift),
|
||||
int (*ref_finddir)(const od_dering_in *img, int stride,
|
||||
int (*ref_finddir)(const uint16_t *img, int stride,
|
||||
int32_t *var, int coeff_shift)) {
|
||||
aom_usec_timer ref_timer;
|
||||
aom_usec_timer timer;
|
||||
|
|
@ -289,99 +284,99 @@ using std::tr1::make_tuple;
|
|||
// hard to support, so optimizations for this target are disabled.
|
||||
#if defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_sse2,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_sse2,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_sse2,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_sse2,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, CDEFDeringFindDirTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_sse2,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse2,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
#if HAVE_SSSE3
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_ssse3,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_ssse3,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_ssse3,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_ssse3,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, CDEFDeringFindDirTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_ssse3,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_ssse3,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE4_1, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_sse4_1,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_sse4_1,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_sse4_1,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_sse4_1,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFDeringFindDirTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_sse4_1,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_neon,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_neon,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(NEON, CDEFDeringDirTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_neon,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_neon,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(NEON, CDEFDeringFindDirTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_neon,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_neon,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
// Test speed for all supported architectures
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_sse2,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_sse2,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_sse2,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_sse2,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, CDEFDeringFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_sse2,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse2,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSSE3
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_ssse3,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_ssse3,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_ssse3,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_ssse3,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, CDEFDeringFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_ssse3,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_ssse3,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE4_1, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_sse4_1,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_sse4_1,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_sse4_1,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_sse4_1,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, CDEFDeringFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_sse4_1,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&od_filter_dering_direction_4x4_neon,
|
||||
&od_filter_dering_direction_4x4_c, 4),
|
||||
make_tuple(&od_filter_dering_direction_8x8_neon,
|
||||
&od_filter_dering_direction_8x8_c, 8)));
|
||||
INSTANTIATE_TEST_CASE_P(NEON, CDEFDeringSpeedTest,
|
||||
::testing::Values(make_tuple(&cdef_direction_4x4_neon,
|
||||
&cdef_direction_4x4_c, 4),
|
||||
make_tuple(&cdef_direction_8x8_neon,
|
||||
&cdef_direction_8x8_c,
|
||||
8)));
|
||||
INSTANTIATE_TEST_CASE_P(NEON, CDEFDeringFindDirSpeedTest,
|
||||
::testing::Values(make_tuple(&od_dir_find8_neon,
|
||||
&od_dir_find8_c)));
|
||||
::testing::Values(make_tuple(&cdef_find_dir_neon,
|
||||
&cdef_find_dir_c)));
|
||||
#endif
|
||||
|
||||
#endif // defined(_WIN64) || !defined(_MSC_VER)
|
||||
|
|
|
|||
36
third_party/aom/test/encode_test_driver.cc
vendored
36
third_party/aom/test/encode_test_driver.cc
vendored
|
|
@ -149,11 +149,6 @@ static bool compare_img(const aom_image_t *img1, const aom_image_t *img2,
|
|||
int *const mismatch_row, int *const mismatch_col,
|
||||
int *const mismatch_plane, int *const mismatch_pix1,
|
||||
int *const mismatch_pix2) {
|
||||
const unsigned int w_y = img1->d_w;
|
||||
const unsigned int h_y = img1->d_h;
|
||||
const unsigned int w_uv = ROUND_POWER_OF_TWO(w_y, img1->x_chroma_shift);
|
||||
const unsigned int h_uv = ROUND_POWER_OF_TWO(h_y, img1->y_chroma_shift);
|
||||
|
||||
if (img1->fmt != img2->fmt || img1->cs != img2->cs ||
|
||||
img1->d_w != img2->d_w || img1->d_h != img2->d_h) {
|
||||
if (mismatch_row != NULL) *mismatch_row = -1;
|
||||
|
|
@ -161,28 +156,15 @@ static bool compare_img(const aom_image_t *img1, const aom_image_t *img2,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!compare_plane(img1->planes[AOM_PLANE_Y], img1->stride[AOM_PLANE_Y],
|
||||
img2->planes[AOM_PLANE_Y], img2->stride[AOM_PLANE_Y], w_y,
|
||||
h_y, mismatch_row, mismatch_col, mismatch_pix1,
|
||||
mismatch_pix2)) {
|
||||
if (mismatch_plane != NULL) *mismatch_plane = AOM_PLANE_Y;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!compare_plane(img1->planes[AOM_PLANE_U], img1->stride[AOM_PLANE_U],
|
||||
img2->planes[AOM_PLANE_U], img2->stride[AOM_PLANE_U], w_uv,
|
||||
h_uv, mismatch_row, mismatch_col, mismatch_pix1,
|
||||
mismatch_pix2)) {
|
||||
if (mismatch_plane != NULL) *mismatch_plane = AOM_PLANE_U;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!compare_plane(img1->planes[AOM_PLANE_V], img1->stride[AOM_PLANE_V],
|
||||
img2->planes[AOM_PLANE_V], img2->stride[AOM_PLANE_V], w_uv,
|
||||
h_uv, mismatch_row, mismatch_col, mismatch_pix1,
|
||||
mismatch_pix2)) {
|
||||
if (mismatch_plane != NULL) *mismatch_plane = AOM_PLANE_U;
|
||||
return false;
|
||||
for (int plane = 0; plane < 3; plane++) {
|
||||
if (!compare_plane(img1->planes[plane], img1->stride[plane],
|
||||
img2->planes[plane], img2->stride[plane],
|
||||
aom_img_plane_width(img1, plane),
|
||||
aom_img_plane_height(img1, plane), mismatch_row,
|
||||
mismatch_col, mismatch_pix1, mismatch_pix2)) {
|
||||
if (mismatch_plane != NULL) *mismatch_plane = plane;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
2
third_party/aom/test/end_to_end_test.cc
vendored
2
third_party/aom/test/end_to_end_test.cc
vendored
|
|
@ -128,13 +128,11 @@ class EndToEndTest
|
|||
encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
|
||||
encoder->Control(AV1E_SET_TILE_COLUMNS, 4);
|
||||
encoder->Control(AOME_SET_CPUUSED, cpu_used_);
|
||||
#if CONFIG_PALETTE
|
||||
// Test screen coding tools at cpu_used = 1 && encoding mode is two-pass.
|
||||
if (cpu_used_ == 1 && encoding_mode_ == ::libaom_test::kTwoPassGood)
|
||||
encoder->Control(AV1E_SET_TUNE_CONTENT, AOM_CONTENT_SCREEN);
|
||||
else
|
||||
encoder->Control(AV1E_SET_TUNE_CONTENT, AOM_CONTENT_DEFAULT);
|
||||
#endif // CONFIG_PALETTE
|
||||
if (encoding_mode_ != ::libaom_test::kRealTime) {
|
||||
encoder->Control(AOME_SET_ENABLEAUTOALTREF, 1);
|
||||
encoder->Control(AOME_SET_ARNR_MAXFRAMES, 7);
|
||||
|
|
|
|||
147
third_party/aom/test/fdct4x4_test.cc
vendored
147
third_party/aom/test/fdct4x4_test.cc
vendored
|
|
@ -36,9 +36,10 @@ typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
|||
const TxfmParam *txfm_param);
|
||||
using libaom_test::FhtFunc;
|
||||
|
||||
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t, int>
|
||||
typedef std::tr1::tuple<FdctFunc, IdctFunc, TX_TYPE, aom_bit_depth_t, int>
|
||||
Dct4x4Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t, int>
|
||||
Ht4x4Param;
|
||||
|
||||
void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
TxfmParam * /*txfm_param*/) {
|
||||
|
|
@ -211,119 +212,139 @@ using std::tr1::make_tuple;
|
|||
|
||||
INSTANTIATE_TEST_CASE_P(C, Trans4x4DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct4x4_c,
|
||||
&aom_idct4x4_16_add_c, 0,
|
||||
AOM_BITS_8, 16)));
|
||||
&aom_idct4x4_16_add_c,
|
||||
DCT_DCT, AOM_BITS_8, 16)));
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
DISABLED_C, Trans4x4HT,
|
||||
::testing::Values(make_tuple(&fht4x4_12, &iht4x4_12, 0, AOM_BITS_12, 16),
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, 1, AOM_BITS_12, 16),
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, 2, AOM_BITS_12, 16),
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, 3, AOM_BITS_12, 16)));
|
||||
::testing::Values(
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, DCT_DCT, AOM_BITS_12, 16),
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, ADST_DCT, AOM_BITS_12, 16),
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, DCT_ADST, AOM_BITS_12, 16),
|
||||
make_tuple(&fht4x4_12, &iht4x4_12, ADST_ADST, AOM_BITS_12, 16)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4HT,
|
||||
::testing::Values(
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, 0, AOM_BITS_10, 16),
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, 1, AOM_BITS_10, 16),
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, 2, AOM_BITS_10, 16),
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, 3, AOM_BITS_10, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 3, AOM_BITS_8, 16)));
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, DCT_DCT, AOM_BITS_10, 16),
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, ADST_DCT, AOM_BITS_10, 16),
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, DCT_ADST, AOM_BITS_10, 16),
|
||||
make_tuple(&fht4x4_10, &iht4x4_10, ADST_ADST, AOM_BITS_10, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, DCT_DCT, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_DCT, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, DCT_ADST, AOM_BITS_8,
|
||||
16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_ADST, AOM_BITS_8,
|
||||
16)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, 3, AOM_BITS_8, 16)));
|
||||
::testing::Values(make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, DCT_DCT,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_DCT,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, DCT_ADST,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_ADST,
|
||||
AOM_BITS_8, 16)));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4WHT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_10, 0, AOM_BITS_10, 16),
|
||||
make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_12, 0, AOM_BITS_12, 16),
|
||||
make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, 0, AOM_BITS_8, 16)));
|
||||
::testing::Values(make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_10, DCT_DCT,
|
||||
AOM_BITS_10, 16),
|
||||
make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_12, DCT_DCT,
|
||||
AOM_BITS_12, 16),
|
||||
make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, DCT_DCT,
|
||||
AOM_BITS_8, 16)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(C, Trans4x4WHT,
|
||||
::testing::Values(make_tuple(&av1_fwht4x4_c,
|
||||
&aom_iwht4x4_16_add_c, 0,
|
||||
AOM_BITS_8, 16)));
|
||||
&aom_iwht4x4_16_add_c,
|
||||
DCT_DCT, AOM_BITS_8, 16)));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(NEON, Trans4x4DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct4x4_c,
|
||||
&aom_idct4x4_16_add_neon,
|
||||
0, AOM_BITS_8, 16)));
|
||||
DCT_DCT, AOM_BITS_8, 16)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans4x4HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 0, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 1, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 2, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon, 3, AOM_BITS_8, 16)));
|
||||
::testing::Values(make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
|
||||
DCT_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
|
||||
ADST_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
|
||||
DCT_ADST, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
|
||||
ADST_ADST, AOM_BITS_8, 16)));
|
||||
#endif // HAVE_NEON && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if HAVE_SSE2 && !CONFIG_DAALA_DCT4
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4WHT,
|
||||
::testing::Values(make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, 0,
|
||||
::testing::Values(make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, DCT_DCT,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_sse2, 0,
|
||||
AOM_BITS_8, 16)));
|
||||
make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_sse2,
|
||||
DCT_DCT, AOM_BITS_8, 16)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, Trans4x4DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct4x4_sse2,
|
||||
&aom_idct4x4_16_add_sse2,
|
||||
0, AOM_BITS_8, 16)));
|
||||
DCT_DCT, AOM_BITS_8, 16)));
|
||||
#if !CONFIG_DAALA_DCT4
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4HT,
|
||||
::testing::Values(make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 0,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 1,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 2,
|
||||
AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, 3,
|
||||
AOM_BITS_8, 16)));
|
||||
::testing::Values(make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
|
||||
DCT_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
|
||||
ADST_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
|
||||
DCT_ADST, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
|
||||
ADST_ADST, AOM_BITS_8, 16)));
|
||||
#endif // !CONFIG_DAALA_DCT4
|
||||
#endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT4
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 0, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 1, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 2, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c, 3, AOM_BITS_8, 16)));
|
||||
#endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
::testing::Values(make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c,
|
||||
DCT_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c,
|
||||
ADST_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c,
|
||||
DCT_ADST, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c,
|
||||
ADST_ADST, AOM_BITS_8, 16)));
|
||||
#endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_DCT4
|
||||
|
||||
#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(MSA, Trans4x4DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct4x4_msa,
|
||||
&aom_idct4x4_16_add_msa, 0,
|
||||
AOM_BITS_8, 16)));
|
||||
#if !CONFIG_EXT_TX
|
||||
&aom_idct4x4_16_add_msa,
|
||||
DCT_DCT, AOM_BITS_8, 16)));
|
||||
#if !CONFIG_EXT_TX && !CONFIG_DAALA_DCT4
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans4x4HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 0, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 1, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 2, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa, 3, AOM_BITS_8,
|
||||
16)));
|
||||
#endif // !CONFIG_EXT_TX
|
||||
::testing::Values(make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa,
|
||||
DCT_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa,
|
||||
ADST_DCT, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa,
|
||||
DCT_ADST, AOM_BITS_8, 16),
|
||||
make_tuple(&av1_fht4x4_msa, &av1_iht4x4_16_add_msa,
|
||||
ADST_ADST, AOM_BITS_8, 16)));
|
||||
#endif // !CONFIG_EXT_TX && && !CONFIG_DAALA_DCT4
|
||||
#endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
|
|
|||
127
third_party/aom/test/fdct8x8_test.cc
vendored
127
third_party/aom/test/fdct8x8_test.cc
vendored
|
|
@ -44,8 +44,9 @@ typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
|
|||
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
||||
const TxfmParam *txfm_param);
|
||||
|
||||
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct8x8Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht8x8Param;
|
||||
typedef std::tr1::tuple<FdctFunc, IdctFunc, TX_TYPE, aom_bit_depth_t>
|
||||
Dct8x8Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, TX_TYPE, aom_bit_depth_t> Ht8x8Param;
|
||||
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, aom_bit_depth_t> Idct8x8Param;
|
||||
|
||||
void reference_8x8_dct_1d(const double in[8], double out[8]) {
|
||||
|
|
@ -485,8 +486,8 @@ class FwdTrans8x8TestBase {
|
|||
const int diff = dst[j] - ref[j];
|
||||
#endif
|
||||
const uint32_t error = diff * diff;
|
||||
EXPECT_EQ(0u, error) << "Error: 8x8 IDCT has error " << error
|
||||
<< " at index " << j;
|
||||
EXPECT_EQ(0u, error)
|
||||
<< "Error: 8x8 IDCT has error " << error << " at index " << j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -614,108 +615,124 @@ using std::tr1::make_tuple;
|
|||
#if CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_c,
|
||||
&aom_idct8x8_64_add_c, 0,
|
||||
AOM_BITS_8)));
|
||||
&aom_idct8x8_64_add_c,
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_c,
|
||||
&aom_idct8x8_64_add_c, 0,
|
||||
AOM_BITS_8)));
|
||||
&aom_idct8x8_64_add_c,
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 0, AOM_BITS_8),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, 0, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, 1, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, 2, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, 3, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, 0, AOM_BITS_12),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, 1, AOM_BITS_12),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, 2, AOM_BITS_12),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, 3, AOM_BITS_12),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 3, AOM_BITS_8)));
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, DCT_DCT, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, ADST_DCT, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, DCT_ADST, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_10, &iht8x8_10, ADST_ADST, AOM_BITS_10),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, DCT_DCT, AOM_BITS_12),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, ADST_DCT, AOM_BITS_12),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, DCT_ADST, AOM_BITS_12),
|
||||
make_tuple(&fht8x8_12, &iht8x8_12, ADST_ADST, AOM_BITS_12),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_ADST,
|
||||
AOM_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, 3, AOM_BITS_8)));
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_ADST,
|
||||
AOM_BITS_8)));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(NEON, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_neon,
|
||||
&aom_idct8x8_64_add_neon,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon, 3, AOM_BITS_8)));
|
||||
::testing::Values(make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
|
||||
ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
|
||||
DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
|
||||
ADST_ADST, AOM_BITS_8)));
|
||||
#endif // HAVE_NEON && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_sse2,
|
||||
&aom_idct8x8_64_add_sse2,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#if !CONFIG_DAALA_DCT8
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, 3, AOM_BITS_8)));
|
||||
::testing::Values(make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
|
||||
ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
|
||||
DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
|
||||
ADST_ADST, AOM_BITS_8)));
|
||||
#endif // !CONFIG_DAALA_DCT8
|
||||
#endif // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_sse2,
|
||||
&aom_idct8x8_64_add_c, 0,
|
||||
AOM_BITS_8)));
|
||||
|
||||
&aom_idct8x8_64_add_c,
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#if !CONFIG_DAALA_DCT8
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c, 3, AOM_BITS_8)));
|
||||
|
||||
::testing::Values(make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c,
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c,
|
||||
ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c,
|
||||
DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c,
|
||||
ADST_ADST, AOM_BITS_8)));
|
||||
#endif // !CONFIG_DAALA_DCT8
|
||||
#endif // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_SSSE3 && ARCH_X86_64
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_ssse3,
|
||||
&aom_idct8x8_64_add_ssse3,
|
||||
0, AOM_BITS_8)));
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(MSA, FwdTrans8x8DCT,
|
||||
::testing::Values(make_tuple(&aom_fdct8x8_msa,
|
||||
&aom_idct8x8_64_add_msa, 0,
|
||||
AOM_BITS_8)));
|
||||
#if !CONFIG_EXT_TX
|
||||
&aom_idct8x8_64_add_msa,
|
||||
DCT_DCT, AOM_BITS_8)));
|
||||
#if !CONFIG_EXT_TX && !CONFIG_DAALA_DCT8
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa, 0, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa, 1, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa, 2, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa, 3, AOM_BITS_8)));
|
||||
#endif // !CONFIG_EXT_TX
|
||||
::testing::Values(make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa,
|
||||
DCT_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa,
|
||||
ADST_DCT, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa,
|
||||
DCT_ADST, AOM_BITS_8),
|
||||
make_tuple(&av1_fht8x8_msa, &av1_iht8x8_64_add_msa,
|
||||
ADST_ADST, AOM_BITS_8)));
|
||||
#endif // !CONFIG_EXT_TX && !CONFIG_DAALA_DCT8
|
||||
#endif // HAVE_MSA && !CONFIG_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
|
|
|||
2
third_party/aom/test/hiprec_convolve_test.cc
vendored
2
third_party/aom/test/hiprec_convolve_test.cc
vendored
|
|
@ -22,11 +22,13 @@ using libaom_test::AV1HighbdHiprecConvolve::AV1HighbdHiprecConvolveTest;
|
|||
|
||||
namespace {
|
||||
|
||||
#if HAVE_SSE2
|
||||
TEST_P(AV1HiprecConvolveTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); }
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1HiprecConvolveTest,
|
||||
libaom_test::AV1HiprecConvolve::BuildParams(
|
||||
aom_convolve8_add_src_hip_sse2));
|
||||
#endif
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH && HAVE_SSSE3
|
||||
TEST_P(AV1HighbdHiprecConvolveTest, CheckOutput) {
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ void AV1HiprecConvolveTest::RunCheckOutput(hiprec_convolve_func test_impl) {
|
|||
vkernel, 16, out_w, out_h);
|
||||
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(output[j], output2[j]) << "Pixel mismatch at index " << j
|
||||
<< " = (" << (j % out_w) << ", "
|
||||
<< (j / out_w) << ") on iteration " << i;
|
||||
ASSERT_EQ(output[j], output2[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", "
|
||||
<< (j / out_w) << ") on iteration " << i;
|
||||
}
|
||||
delete[] input_;
|
||||
delete[] output;
|
||||
|
|
@ -175,9 +175,9 @@ void AV1HighbdHiprecConvolveTest::RunCheckOutput(
|
|||
hkernel, 16, vkernel, 16, out_w, out_h, bd);
|
||||
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(output[j], output2[j]) << "Pixel mismatch at index " << j
|
||||
<< " = (" << (j % out_w) << ", "
|
||||
<< (j / out_w) << ") on iteration " << i;
|
||||
ASSERT_EQ(output[j], output2[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w) << ", "
|
||||
<< (j / out_w) << ") on iteration " << i;
|
||||
}
|
||||
delete[] input;
|
||||
delete[] output;
|
||||
|
|
|
|||
370
third_party/aom/test/intrapred_test.cc
vendored
370
third_party/aom/test/intrapred_test.cc
vendored
|
|
@ -29,27 +29,35 @@ using libaom_test::ACMRandom;
|
|||
|
||||
const int count_test_block = 100000;
|
||||
|
||||
typedef void (*IntraPred)(uint16_t *dst, ptrdiff_t stride,
|
||||
const uint16_t *above, const uint16_t *left, int bps);
|
||||
typedef void (*HighbdIntraPred)(uint16_t *dst, ptrdiff_t stride,
|
||||
const uint16_t *above, const uint16_t *left,
|
||||
int bps);
|
||||
typedef void (*IntraPred)(uint8_t *dst, ptrdiff_t stride, const uint8_t *above,
|
||||
const uint8_t *left);
|
||||
|
||||
template <typename FuncType>
|
||||
struct IntraPredFunc {
|
||||
IntraPredFunc(IntraPred pred = NULL, IntraPred ref = NULL,
|
||||
int block_size_value = 0, int bit_depth_value = 0)
|
||||
: pred_fn(pred), ref_fn(ref), block_size(block_size_value),
|
||||
bit_depth(bit_depth_value) {}
|
||||
IntraPredFunc(FuncType pred = NULL, FuncType ref = NULL,
|
||||
int block_width_value = 0, int block_height_value = 0,
|
||||
int bit_depth_value = 0)
|
||||
: pred_fn(pred), ref_fn(ref), block_width(block_width_value),
|
||||
block_height(block_height_value), bit_depth(bit_depth_value) {}
|
||||
|
||||
IntraPred pred_fn;
|
||||
IntraPred ref_fn;
|
||||
int block_size;
|
||||
FuncType pred_fn;
|
||||
FuncType ref_fn;
|
||||
int block_width;
|
||||
int block_height;
|
||||
int bit_depth;
|
||||
};
|
||||
|
||||
class AV1IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> {
|
||||
template <typename FuncType, typename Pixel>
|
||||
class AV1IntraPredTest
|
||||
: public ::testing::TestWithParam<IntraPredFunc<FuncType> > {
|
||||
public:
|
||||
void RunTest(uint16_t *left_col, uint16_t *above_data, uint16_t *dst,
|
||||
uint16_t *ref_dst) {
|
||||
void RunTest(Pixel *left_col, Pixel *above_data, Pixel *dst, Pixel *ref_dst) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int block_size = params_.block_size;
|
||||
const int block_width = params_.block_width;
|
||||
const int block_height = params_.block_height;
|
||||
above_row_ = above_data + 16;
|
||||
left_col_ = left_col;
|
||||
dst_ = dst;
|
||||
|
|
@ -57,14 +65,14 @@ class AV1IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> {
|
|||
int error_count = 0;
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
// Fill edges with random data, try first with saturated values.
|
||||
for (int x = -1; x <= block_size * 2; x++) {
|
||||
for (int x = -1; x <= block_width * 2; x++) {
|
||||
if (i == 0) {
|
||||
above_row_[x] = mask_;
|
||||
} else {
|
||||
above_row_[x] = rnd.Rand16() & mask_;
|
||||
}
|
||||
}
|
||||
for (int y = 0; y < block_size; y++) {
|
||||
for (int y = 0; y < block_height; y++) {
|
||||
if (i == 0) {
|
||||
left_col_[y] = mask_;
|
||||
} else {
|
||||
|
|
@ -79,43 +87,59 @@ class AV1IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> {
|
|||
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
params_ = GetParam();
|
||||
stride_ = params_.block_size * 3;
|
||||
params_ = this->GetParam();
|
||||
stride_ = params_.block_width * 3;
|
||||
mask_ = (1 << params_.bit_depth) - 1;
|
||||
}
|
||||
|
||||
virtual void Predict() = 0;
|
||||
|
||||
void CheckPrediction(int test_case_number, int *error_count) const {
|
||||
// For each pixel ensure that the calculated value is the same as reference.
|
||||
const int block_width = params_.block_width;
|
||||
const int block_height = params_.block_height;
|
||||
for (int y = 0; y < block_height; y++) {
|
||||
for (int x = 0; x < block_width; x++) {
|
||||
*error_count += ref_dst_[x + y * stride_] != dst_[x + y * stride_];
|
||||
if (*error_count == 1) {
|
||||
ASSERT_EQ(ref_dst_[x + y * stride_], dst_[x + y * stride_])
|
||||
<< " Failed on Test Case Number " << test_case_number
|
||||
<< " location: x = " << x << " y = " << y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Pixel *above_row_;
|
||||
Pixel *left_col_;
|
||||
Pixel *dst_;
|
||||
Pixel *ref_dst_;
|
||||
ptrdiff_t stride_;
|
||||
int mask_;
|
||||
|
||||
IntraPredFunc<FuncType> params_;
|
||||
};
|
||||
|
||||
class HighbdIntraPredTest : public AV1IntraPredTest<HighbdIntraPred, uint16_t> {
|
||||
protected:
|
||||
void Predict() {
|
||||
const int bit_depth = params_.bit_depth;
|
||||
params_.ref_fn(ref_dst_, stride_, above_row_, left_col_, bit_depth);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
params_.pred_fn(dst_, stride_, above_row_, left_col_, bit_depth));
|
||||
}
|
||||
|
||||
void CheckPrediction(int test_case_number, int *error_count) const {
|
||||
// For each pixel ensure that the calculated value is the same as reference.
|
||||
const int block_size = params_.block_size;
|
||||
for (int y = 0; y < block_size; y++) {
|
||||
for (int x = 0; x < block_size; x++) {
|
||||
*error_count += ref_dst_[x + y * stride_] != dst_[x + y * stride_];
|
||||
if (*error_count == 1) {
|
||||
ASSERT_EQ(ref_dst_[x + y * stride_], dst_[x + y * stride_])
|
||||
<< " Failed on Test Case Number " << test_case_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t *above_row_;
|
||||
uint16_t *left_col_;
|
||||
uint16_t *dst_;
|
||||
uint16_t *ref_dst_;
|
||||
ptrdiff_t stride_;
|
||||
int mask_;
|
||||
|
||||
IntraPredFunc params_;
|
||||
};
|
||||
|
||||
TEST_P(AV1IntraPredTest, IntraPredTests) {
|
||||
class LowbdIntraPredTest : public AV1IntraPredTest<IntraPred, uint8_t> {
|
||||
protected:
|
||||
void Predict() {
|
||||
params_.ref_fn(ref_dst_, stride_, above_row_, left_col_);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
params_.pred_fn(dst_, stride_, above_row_, left_col_));
|
||||
}
|
||||
};
|
||||
|
||||
TEST_P(HighbdIntraPredTest, Bitexact) {
|
||||
// max block size is 32
|
||||
DECLARE_ALIGNED(16, uint16_t, left_col[2 * 32]);
|
||||
DECLARE_ALIGNED(16, uint16_t, above_data[2 * 32 + 32]);
|
||||
|
|
@ -124,114 +148,186 @@ TEST_P(AV1IntraPredTest, IntraPredTests) {
|
|||
RunTest(left_col, above_data, dst, ref_dst);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
const IntraPredFunc IntraPredTestVector8[] = {
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_32x32_sse2,
|
||||
&aom_highbd_dc_predictor_32x32_c, 32, 8),
|
||||
#if !CONFIG_ALT_INTRA
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_16x16_sse2,
|
||||
&aom_highbd_tm_predictor_16x16_c, 16, 8),
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_32x32_sse2,
|
||||
&aom_highbd_tm_predictor_32x32_c, 32, 8),
|
||||
#endif // !CONFIG_ALT_INTRA
|
||||
TEST_P(LowbdIntraPredTest, Bitexact) {
|
||||
// max block size is 32
|
||||
DECLARE_ALIGNED(16, uint8_t, left_col[2 * 32]);
|
||||
DECLARE_ALIGNED(16, uint8_t, above_data[2 * 32 + 32]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst[3 * 32 * 32]);
|
||||
DECLARE_ALIGNED(16, uint8_t, ref_dst[3 * 32 * 32]);
|
||||
RunTest(left_col, above_data, dst, ref_dst);
|
||||
}
|
||||
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_4x4_sse2,
|
||||
&aom_highbd_dc_predictor_4x4_c, 4, 8),
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_8x8_sse2,
|
||||
&aom_highbd_dc_predictor_8x8_c, 8, 8),
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_16x16_sse2,
|
||||
&aom_highbd_dc_predictor_16x16_c, 16, 8),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_4x4_sse2, &aom_highbd_v_predictor_4x4_c,
|
||||
4, 8),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_8x8_sse2, &aom_highbd_v_predictor_8x8_c,
|
||||
8, 8),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_16x16_sse2,
|
||||
&aom_highbd_v_predictor_16x16_c, 16, 8),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_32x32_sse2,
|
||||
&aom_highbd_v_predictor_32x32_c, 32, 8)
|
||||
#if !CONFIG_ALT_INTRA
|
||||
,
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_4x4_sse2,
|
||||
&aom_highbd_tm_predictor_4x4_c, 4, 8),
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_8x8_sse2,
|
||||
&aom_highbd_tm_predictor_8x8_c, 8, 8)
|
||||
#endif // !CONFIG_ALT_INTRA
|
||||
// -----------------------------------------------------------------------------
|
||||
// High Bit Depth Tests
|
||||
|
||||
#define highbd_entry(type, width, height, opt, bd) \
|
||||
IntraPredFunc<HighbdIntraPred>( \
|
||||
&aom_highbd_##type##_predictor_##width##x##height##_##opt, \
|
||||
&aom_highbd_##type##_predictor_##width##x##height##_c, width, height, \
|
||||
bd)
|
||||
|
||||
#define highbd_intrapred(type, opt, bd) \
|
||||
highbd_entry(type, 4, 4, opt, bd), highbd_entry(type, 4, 8, opt, bd), \
|
||||
highbd_entry(type, 8, 4, opt, bd), highbd_entry(type, 8, 8, opt, bd), \
|
||||
highbd_entry(type, 8, 16, opt, bd), highbd_entry(type, 16, 8, opt, bd), \
|
||||
highbd_entry(type, 16, 16, opt, bd), \
|
||||
highbd_entry(type, 16, 32, opt, bd), \
|
||||
highbd_entry(type, 32, 16, opt, bd), highbd_entry(type, 32, 32, opt, bd)
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
#if HAVE_SSE2
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVector8[] = {
|
||||
highbd_intrapred(dc, sse2, 8), highbd_intrapred(dc_left, sse2, 8),
|
||||
highbd_intrapred(dc_top, sse2, 8), highbd_intrapred(dc_128, sse2, 8),
|
||||
highbd_intrapred(h, sse2, 8), highbd_intrapred(v, sse2, 8),
|
||||
highbd_entry(d117, 4, 4, sse2, 8), highbd_entry(d135, 4, 4, sse2, 8),
|
||||
highbd_entry(d153, 4, 4, sse2, 8), highbd_entry(d45e, 4, 4, sse2, 8),
|
||||
highbd_entry(d45e, 4, 8, sse2, 8), highbd_entry(d45e, 8, 4, sse2, 8),
|
||||
highbd_entry(d45e, 8, 8, sse2, 8), highbd_entry(d45e, 8, 16, sse2, 8),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, AV1IntraPredTest,
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVector8));
|
||||
|
||||
const IntraPredFunc IntraPredTestVector10[] = {
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_32x32_sse2,
|
||||
&aom_highbd_dc_predictor_32x32_c, 32, 10),
|
||||
#if !CONFIG_ALT_INTRA
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_16x16_sse2,
|
||||
&aom_highbd_tm_predictor_16x16_c, 16, 10),
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_32x32_sse2,
|
||||
&aom_highbd_tm_predictor_32x32_c, 32, 10),
|
||||
#endif // !CONFIG_ALT_INTRA
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_4x4_sse2,
|
||||
&aom_highbd_dc_predictor_4x4_c, 4, 10),
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_8x8_sse2,
|
||||
&aom_highbd_dc_predictor_8x8_c, 8, 10),
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_16x16_sse2,
|
||||
&aom_highbd_dc_predictor_16x16_c, 16, 10),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_4x4_sse2, &aom_highbd_v_predictor_4x4_c,
|
||||
4, 10),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_8x8_sse2, &aom_highbd_v_predictor_8x8_c,
|
||||
8, 10),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_16x16_sse2,
|
||||
&aom_highbd_v_predictor_16x16_c, 16, 10),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_32x32_sse2,
|
||||
&aom_highbd_v_predictor_32x32_c, 32, 10)
|
||||
#if !CONFIG_ALT_INTRA
|
||||
,
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_4x4_sse2,
|
||||
&aom_highbd_tm_predictor_4x4_c, 4, 10),
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_8x8_sse2,
|
||||
&aom_highbd_tm_predictor_8x8_c, 8, 10)
|
||||
#endif // !CONFIG_ALT_INTRA
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVector10[] = {
|
||||
highbd_intrapred(dc, sse2, 10), highbd_intrapred(dc_left, sse2, 10),
|
||||
highbd_intrapred(dc_top, sse2, 10), highbd_intrapred(dc_128, sse2, 10),
|
||||
highbd_intrapred(h, sse2, 10), highbd_intrapred(v, sse2, 10),
|
||||
highbd_entry(d117, 4, 4, sse2, 10), highbd_entry(d135, 4, 4, sse2, 10),
|
||||
highbd_entry(d153, 4, 4, sse2, 10), highbd_entry(d45e, 4, 4, sse2, 10),
|
||||
highbd_entry(d45e, 4, 8, sse2, 10), highbd_entry(d45e, 8, 4, sse2, 10),
|
||||
highbd_entry(d45e, 8, 8, sse2, 10), highbd_entry(d45e, 8, 16, sse2, 10),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_10, AV1IntraPredTest,
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_10, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVector10));
|
||||
|
||||
const IntraPredFunc IntraPredTestVector12[] = {
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_32x32_sse2,
|
||||
&aom_highbd_dc_predictor_32x32_c, 32, 12),
|
||||
#if !CONFIG_ALT_INTRA
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_16x16_sse2,
|
||||
&aom_highbd_tm_predictor_16x16_c, 16, 12),
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_32x32_sse2,
|
||||
&aom_highbd_tm_predictor_32x32_c, 32, 12),
|
||||
#endif // !CONFIG_ALT_INTRA
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_4x4_sse2,
|
||||
&aom_highbd_dc_predictor_4x4_c, 4, 12),
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_8x8_sse2,
|
||||
&aom_highbd_dc_predictor_8x8_c, 8, 12),
|
||||
IntraPredFunc(&aom_highbd_dc_predictor_16x16_sse2,
|
||||
&aom_highbd_dc_predictor_16x16_c, 16, 12),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_4x4_sse2, &aom_highbd_v_predictor_4x4_c,
|
||||
4, 12),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_8x8_sse2, &aom_highbd_v_predictor_8x8_c,
|
||||
8, 12),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_16x16_sse2,
|
||||
&aom_highbd_v_predictor_16x16_c, 16, 12),
|
||||
IntraPredFunc(&aom_highbd_v_predictor_32x32_sse2,
|
||||
&aom_highbd_v_predictor_32x32_c, 32, 12)
|
||||
#if !CONFIG_ALT_INTRA
|
||||
,
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_4x4_sse2,
|
||||
&aom_highbd_tm_predictor_4x4_c, 4, 12),
|
||||
IntraPredFunc(&aom_highbd_tm_predictor_8x8_sse2,
|
||||
&aom_highbd_tm_predictor_8x8_c, 8, 12)
|
||||
#endif // !CONFIG_ALT_INTRA
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVector12[] = {
|
||||
highbd_intrapred(dc, sse2, 12), highbd_intrapred(dc_left, sse2, 12),
|
||||
highbd_intrapred(dc_top, sse2, 12), highbd_intrapred(dc_128, sse2, 12),
|
||||
highbd_intrapred(h, sse2, 12), highbd_intrapred(v, sse2, 12),
|
||||
highbd_entry(d117, 4, 4, sse2, 12), highbd_entry(d135, 4, 4, sse2, 12),
|
||||
highbd_entry(d153, 4, 4, sse2, 12), highbd_entry(d45e, 4, 4, sse2, 12),
|
||||
highbd_entry(d45e, 4, 8, sse2, 12), highbd_entry(d45e, 8, 4, sse2, 12),
|
||||
highbd_entry(d45e, 8, 8, sse2, 12), highbd_entry(d45e, 8, 16, sse2, 12),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, AV1IntraPredTest,
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVector12));
|
||||
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVectorSsse3_8[] = {
|
||||
highbd_entry(d117, 8, 8, ssse3, 8), highbd_entry(d117, 16, 16, ssse3, 8),
|
||||
highbd_entry(d117, 32, 32, ssse3, 8), highbd_entry(d135, 8, 8, ssse3, 8),
|
||||
highbd_entry(d135, 16, 16, ssse3, 8), highbd_entry(d135, 32, 32, ssse3, 8),
|
||||
highbd_entry(d153, 8, 8, ssse3, 8), highbd_entry(d153, 16, 16, ssse3, 8),
|
||||
highbd_entry(d153, 32, 32, ssse3, 8),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3_TO_C_8, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVectorSsse3_8));
|
||||
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVectorSsse3_10[] = {
|
||||
highbd_entry(d117, 8, 8, ssse3, 10), highbd_entry(d117, 16, 16, ssse3, 10),
|
||||
highbd_entry(d117, 32, 32, ssse3, 10), highbd_entry(d135, 8, 8, ssse3, 10),
|
||||
highbd_entry(d135, 16, 16, ssse3, 10), highbd_entry(d135, 32, 32, ssse3, 10),
|
||||
highbd_entry(d153, 8, 8, ssse3, 10), highbd_entry(d153, 16, 16, ssse3, 10),
|
||||
highbd_entry(d153, 32, 32, ssse3, 10),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3_TO_C_10, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVectorSsse3_10));
|
||||
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVectorSsse3_12[] = {
|
||||
highbd_entry(d117, 8, 8, ssse3, 12), highbd_entry(d117, 16, 16, ssse3, 12),
|
||||
highbd_entry(d117, 32, 32, ssse3, 12), highbd_entry(d135, 8, 8, ssse3, 12),
|
||||
highbd_entry(d135, 16, 16, ssse3, 12), highbd_entry(d135, 32, 32, ssse3, 12),
|
||||
highbd_entry(d153, 8, 8, ssse3, 12), highbd_entry(d153, 16, 16, ssse3, 12),
|
||||
highbd_entry(d153, 32, 32, ssse3, 12),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3_TO_C_12, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVectorSsse3_12));
|
||||
#endif // HAVE_SSSE3
|
||||
|
||||
#if HAVE_AVX2
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVectorAvx2_8[] = {
|
||||
highbd_entry(d45e, 16, 8, avx2, 8), highbd_entry(d45e, 16, 16, avx2, 8),
|
||||
highbd_entry(d45e, 16, 32, avx2, 8), highbd_entry(d45e, 32, 16, avx2, 8),
|
||||
highbd_entry(d45e, 32, 32, avx2, 8),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(AVX2_TO_C_8, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVectorAvx2_8));
|
||||
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVectorAvx2_10[] = {
|
||||
highbd_entry(d45e, 16, 8, avx2, 10), highbd_entry(d45e, 16, 16, avx2, 10),
|
||||
highbd_entry(d45e, 16, 32, avx2, 10), highbd_entry(d45e, 32, 16, avx2, 10),
|
||||
highbd_entry(d45e, 32, 32, avx2, 10),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(AVX2_TO_C_10, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVectorAvx2_10));
|
||||
|
||||
const IntraPredFunc<HighbdIntraPred> IntraPredTestVectorAvx2_12[] = {
|
||||
highbd_entry(d45e, 16, 8, avx2, 12), highbd_entry(d45e, 16, 16, avx2, 12),
|
||||
highbd_entry(d45e, 16, 32, avx2, 12), highbd_entry(d45e, 32, 16, avx2, 12),
|
||||
highbd_entry(d45e, 32, 32, avx2, 12),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(AVX2_TO_C_12, HighbdIntraPredTest,
|
||||
::testing::ValuesIn(IntraPredTestVectorAvx2_12));
|
||||
#endif // HAVE_AVX2
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Low Bit Depth Tests
|
||||
|
||||
#define lowbd_entry(type, width, height, opt) \
|
||||
IntraPredFunc<IntraPred>(&aom_##type##_predictor_##width##x##height##_##opt, \
|
||||
&aom_##type##_predictor_##width##x##height##_c, \
|
||||
width, height, 8)
|
||||
|
||||
#define lowbd_intrapred(type, opt) \
|
||||
lowbd_entry(type, 4, 4, opt), lowbd_entry(type, 4, 8, opt), \
|
||||
lowbd_entry(type, 8, 4, opt), lowbd_entry(type, 8, 8, opt), \
|
||||
lowbd_entry(type, 8, 16, opt), lowbd_entry(type, 16, 8, opt), \
|
||||
lowbd_entry(type, 16, 16, opt), lowbd_entry(type, 16, 32, opt), \
|
||||
lowbd_entry(type, 32, 16, opt), lowbd_entry(type, 32, 32, opt)
|
||||
|
||||
#if HAVE_SSE2
|
||||
const IntraPredFunc<IntraPred> LowbdIntraPredTestVector[] = {
|
||||
lowbd_intrapred(dc, sse2), lowbd_intrapred(dc_top, sse2),
|
||||
lowbd_intrapred(dc_left, sse2), lowbd_intrapred(dc_128, sse2),
|
||||
lowbd_intrapred(v, sse2), lowbd_intrapred(h, sse2),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, LowbdIntraPredTest,
|
||||
::testing::ValuesIn(LowbdIntraPredTestVector));
|
||||
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_AVX2
|
||||
const IntraPredFunc<IntraPred> LowbdIntraPredTestVectorAvx2[] = {
|
||||
lowbd_entry(dc, 32, 32, avx2), lowbd_entry(dc_top, 32, 32, avx2),
|
||||
lowbd_entry(dc_left, 32, 32, avx2), lowbd_entry(dc_128, 32, 32, avx2),
|
||||
lowbd_entry(v, 32, 32, avx2), lowbd_entry(h, 32, 32, avx2),
|
||||
lowbd_entry(dc, 32, 16, avx2), lowbd_entry(dc_top, 32, 16, avx2),
|
||||
lowbd_entry(dc_left, 32, 16, avx2), lowbd_entry(dc_128, 32, 16, avx2),
|
||||
lowbd_entry(v, 32, 16, avx2), lowbd_entry(paeth, 16, 8, avx2),
|
||||
lowbd_entry(paeth, 16, 16, avx2), lowbd_entry(paeth, 16, 32, avx2),
|
||||
lowbd_entry(paeth, 32, 16, avx2), lowbd_entry(paeth, 32, 32, avx2),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, LowbdIntraPredTest,
|
||||
::testing::ValuesIn(LowbdIntraPredTestVectorAvx2));
|
||||
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3
|
||||
const IntraPredFunc<IntraPred> LowbdIntraPredTestVectorSsse3[] = {
|
||||
lowbd_intrapred(paeth, ssse3), lowbd_intrapred(smooth, ssse3),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, LowbdIntraPredTest,
|
||||
::testing::ValuesIn(LowbdIntraPredTestVectorSsse3));
|
||||
|
||||
#endif // HAVE_SSSE3
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
4
third_party/aom/test/ivf_video_source.h
vendored
4
third_party/aom/test/ivf_video_source.h
vendored
|
|
@ -48,8 +48,8 @@ class IVFVideoSource : public CompressedVideoSource {
|
|||
|
||||
virtual void Begin() {
|
||||
input_file_ = OpenTestDataFile(file_name_);
|
||||
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
|
||||
<< file_name_;
|
||||
ASSERT_TRUE(input_file_ != NULL)
|
||||
<< "Input file open failed. Filename: " << file_name_;
|
||||
|
||||
// Read file header
|
||||
uint8_t file_hdr[kIvfFileHdrSize];
|
||||
|
|
|
|||
155
third_party/aom/test/lpf_8_test.cc
vendored
155
third_party/aom/test/lpf_8_test.cc
vendored
|
|
@ -35,6 +35,8 @@ const int kNumCoeffs = 1024;
|
|||
|
||||
const int number_of_iterations = 10000;
|
||||
|
||||
const int kSpeedTestNum = 500000;
|
||||
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
typedef void (*loop_op_t)(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh, int bd);
|
||||
|
|
@ -242,6 +244,43 @@ TEST_P(Loop8Test6Param, ValueCheck) {
|
|||
<< "First failed at test case " << first_failure;
|
||||
}
|
||||
|
||||
TEST_P(Loop8Test6Param, DISABLED_Speed) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = kSpeedTestNum;
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
const int32_t bd = bit_depth_;
|
||||
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
|
||||
#else
|
||||
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = rnd.Rand8();
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
|
||||
int32_t p = kNumCoeffs / 32;
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
s[j] = rnd.Rand16() & mask_;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd);
|
||||
#else
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh);
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(Loop8Test9Param, OperationCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = number_of_iterations;
|
||||
|
|
@ -408,9 +447,59 @@ TEST_P(Loop8Test9Param, ValueCheck) {
|
|||
<< "First failed at test case " << first_failure;
|
||||
}
|
||||
|
||||
TEST_P(Loop8Test9Param, DISABLED_Speed) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = kSpeedTestNum;
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
|
||||
#else
|
||||
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
||||
uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = rnd.Rand8();
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
tmp = rnd.Rand8();
|
||||
DECLARE_ALIGNED(16, const uint8_t,
|
||||
thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
|
||||
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
|
||||
int32_t p = kNumCoeffs / 32; // TODO(pdlf) can we have non-square here?
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
s[j] = rnd.Rand16() & mask_;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
const int32_t bd = bit_depth_;
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1,
|
||||
thresh1, bd);
|
||||
#else
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1,
|
||||
thresh1);
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2 && (!CONFIG_PARALLEL_DEBLOCKING)
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
|
||||
const loop8_param_t kHbdLoop8Test6[] = {
|
||||
|
|
@ -470,12 +559,38 @@ const loop8_param_t kLoop8Test6[] = {
|
|||
make_tuple(&aom_lpf_vertical_4_sse2, &aom_lpf_vertical_4_c, 8),
|
||||
make_tuple(&aom_lpf_vertical_8_sse2, &aom_lpf_vertical_8_c, 8),
|
||||
make_tuple(&aom_lpf_vertical_16_sse2, &aom_lpf_vertical_16_c, 8),
|
||||
#if !CONFIG_PARALLEL_DEBLOCKING
|
||||
make_tuple(&aom_lpf_vertical_16_dual_sse2, &aom_lpf_vertical_16_dual_c, 8)
|
||||
#endif
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param,
|
||||
::testing::ValuesIn(kLoop8Test6));
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_AVX2
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
|
||||
const loop8_param_t kHbdLoop8Test6Avx2[] = {
|
||||
make_tuple(&aom_highbd_lpf_horizontal_edge_16_avx2,
|
||||
&aom_highbd_lpf_horizontal_edge_16_c, 8),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_edge_16_avx2,
|
||||
&aom_highbd_lpf_horizontal_edge_16_c, 10),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_edge_16_avx2,
|
||||
&aom_highbd_lpf_horizontal_edge_16_c, 12),
|
||||
make_tuple(&aom_highbd_lpf_vertical_16_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_16_dual_c, 8),
|
||||
make_tuple(&aom_highbd_lpf_vertical_16_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_16_dual_c, 10),
|
||||
make_tuple(&aom_highbd_lpf_vertical_16_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_16_dual_c, 12)
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test6Param,
|
||||
::testing::ValuesIn(kHbdLoop8Test6Avx2));
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_AVX2 && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
|
||||
|
|
@ -487,7 +602,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||
&aom_lpf_horizontal_edge_16_c, 8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && (!CONFIG_PARALLEL_DEBLOCKING)
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
const dualloop8_param_t kHbdLoop8Test9[] = {
|
||||
make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2,
|
||||
|
|
@ -519,6 +634,7 @@ const dualloop8_param_t kHbdLoop8Test9[] = {
|
|||
INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param,
|
||||
::testing::ValuesIn(kHbdLoop8Test9));
|
||||
#else
|
||||
#if !CONFIG_PARALLEL_DEBLOCKING
|
||||
const dualloop8_param_t kLoop8Test9[] = {
|
||||
make_tuple(&aom_lpf_horizontal_4_dual_sse2, &aom_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&aom_lpf_horizontal_8_dual_sse2, &aom_lpf_horizontal_8_dual_c, 8),
|
||||
|
|
@ -528,7 +644,42 @@ const dualloop8_param_t kLoop8Test9[] = {
|
|||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param,
|
||||
::testing::ValuesIn(kLoop8Test9));
|
||||
#endif
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_AVX2
|
||||
#if CONFIG_HIGHBITDEPTH
|
||||
const dualloop8_param_t kHbdLoop8Test9Avx2[] = {
|
||||
make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
|
||||
&aom_highbd_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
|
||||
&aom_highbd_lpf_horizontal_4_dual_c, 10),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
|
||||
&aom_highbd_lpf_horizontal_4_dual_c, 12),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_8_dual_avx2,
|
||||
&aom_highbd_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_8_dual_avx2,
|
||||
&aom_highbd_lpf_horizontal_8_dual_c, 10),
|
||||
make_tuple(&aom_highbd_lpf_horizontal_8_dual_avx2,
|
||||
&aom_highbd_lpf_horizontal_8_dual_c, 12),
|
||||
make_tuple(&aom_highbd_lpf_vertical_4_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&aom_highbd_lpf_vertical_4_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_4_dual_c, 10),
|
||||
make_tuple(&aom_highbd_lpf_vertical_4_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_4_dual_c, 12),
|
||||
make_tuple(&aom_highbd_lpf_vertical_8_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_8_dual_c, 8),
|
||||
make_tuple(&aom_highbd_lpf_vertical_8_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_8_dual_c, 10),
|
||||
make_tuple(&aom_highbd_lpf_vertical_8_dual_avx2,
|
||||
&aom_highbd_lpf_vertical_8_dual_c, 12),
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test9Param,
|
||||
::testing::ValuesIn(kHbdLoop8Test9Avx2));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING)
|
||||
|
|
|
|||
8
third_party/aom/test/minmax_test.cc
vendored
8
third_party/aom/test/minmax_test.cc
vendored
|
|
@ -108,10 +108,10 @@ TEST_P(MinMaxTest, CompareReferenceAndVaryStride) {
|
|||
int min_ref, max_ref, min, max;
|
||||
reference_minmax(a, a_stride, b, b_stride, &min_ref, &max_ref);
|
||||
ASM_REGISTER_STATE_CHECK(mm_func_(a, a_stride, b, b_stride, &min, &max));
|
||||
EXPECT_EQ(max_ref, max) << "when a_stride = " << a_stride
|
||||
<< " and b_stride = " << b_stride;
|
||||
EXPECT_EQ(min_ref, min) << "when a_stride = " << a_stride
|
||||
<< " and b_stride = " << b_stride;
|
||||
EXPECT_EQ(max_ref, max)
|
||||
<< "when a_stride = " << a_stride << " and b_stride = " << b_stride;
|
||||
EXPECT_EQ(min_ref, min)
|
||||
<< "when a_stride = " << a_stride << " and b_stride = " << b_stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
third_party/aom/test/quantize_func_test.cc
vendored
4
third_party/aom/test/quantize_func_test.cc
vendored
|
|
@ -157,8 +157,8 @@ class QuantizeTest : public ::testing::TestWithParam<QuantizeParam> {
|
|||
<< " Q: " << q << " coeff: " << coeff_ptr[j];
|
||||
}
|
||||
|
||||
ASSERT_EQ(eob[0], eob[1]) << "eobs mismatch on test: " << i
|
||||
<< " Q: " << q;
|
||||
ASSERT_EQ(eob[0], eob[1])
|
||||
<< "eobs mismatch on test: " << i << " Q: " << q;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
25
third_party/aom/test/register_state_check.h
vendored
25
third_party/aom/test/register_state_check.h
vendored
|
|
@ -49,7 +49,7 @@ namespace libaom_test {
|
|||
class RegisterStateCheck {
|
||||
public:
|
||||
RegisterStateCheck() { initialized_ = StoreRegisters(&pre_context_); }
|
||||
~RegisterStateCheck() { EXPECT_TRUE(Check()); }
|
||||
~RegisterStateCheck() { Check(); }
|
||||
|
||||
private:
|
||||
static bool StoreRegisters(CONTEXT *const context) {
|
||||
|
|
@ -62,10 +62,10 @@ class RegisterStateCheck {
|
|||
}
|
||||
|
||||
// Compares the register state. Returns true if the states match.
|
||||
bool Check() const {
|
||||
if (!initialized_) return false;
|
||||
void Check() const {
|
||||
ASSERT_TRUE(initialized_);
|
||||
CONTEXT post_context;
|
||||
if (!StoreRegisters(&post_context)) return false;
|
||||
ASSERT_TRUE(StoreRegisters(&post_context));
|
||||
|
||||
const M128A *xmm_pre = &pre_context_.Xmm6;
|
||||
const M128A *xmm_post = &post_context.Xmm6;
|
||||
|
|
@ -74,7 +74,6 @@ class RegisterStateCheck {
|
|||
++xmm_pre;
|
||||
++xmm_post;
|
||||
}
|
||||
return !testing::Test::HasNonfatalFailure();
|
||||
}
|
||||
|
||||
bool initialized_;
|
||||
|
|
@ -105,7 +104,7 @@ namespace libaom_test {
|
|||
class RegisterStateCheck {
|
||||
public:
|
||||
RegisterStateCheck() { initialized_ = StoreRegisters(pre_store_); }
|
||||
~RegisterStateCheck() { EXPECT_TRUE(Check()); }
|
||||
~RegisterStateCheck() { Check(); }
|
||||
|
||||
private:
|
||||
static bool StoreRegisters(int64_t store[8]) {
|
||||
|
|
@ -114,15 +113,14 @@ class RegisterStateCheck {
|
|||
}
|
||||
|
||||
// Compares the register state. Returns true if the states match.
|
||||
bool Check() const {
|
||||
if (!initialized_) return false;
|
||||
void Check() const {
|
||||
ASSERT_TRUE(initialized_);
|
||||
int64_t post_store[8];
|
||||
aom_push_neon(post_store);
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
EXPECT_EQ(pre_store_[i], post_store[i]) << "d" << i + 8
|
||||
<< " has been modified";
|
||||
EXPECT_EQ(pre_store_[i], post_store[i])
|
||||
<< "d" << i + 8 << " has been modified";
|
||||
}
|
||||
return !testing::Test::HasNonfatalFailure();
|
||||
}
|
||||
|
||||
bool initialized_;
|
||||
|
|
@ -159,12 +157,12 @@ class RegisterStateCheckMMX {
|
|||
RegisterStateCheckMMX() {
|
||||
__asm__ volatile("fstenv %0" : "=rm"(pre_fpu_env_));
|
||||
}
|
||||
~RegisterStateCheckMMX() { EXPECT_TRUE(Check()); }
|
||||
~RegisterStateCheckMMX() { Check(); }
|
||||
|
||||
private:
|
||||
// Checks the FPU tag word pre/post execution, returning false if not cleared
|
||||
// to 0xffff.
|
||||
bool Check() const {
|
||||
void Check() const {
|
||||
EXPECT_EQ(0xffff, pre_fpu_env_[4])
|
||||
<< "FPU was in an inconsistent state prior to call";
|
||||
|
||||
|
|
@ -172,7 +170,6 @@ class RegisterStateCheckMMX {
|
|||
__asm__ volatile("fstenv %0" : "=rm"(post_fpu_env));
|
||||
EXPECT_EQ(0xffff, post_fpu_env[4])
|
||||
<< "FPU was left in an inconsistent state after call";
|
||||
return !testing::Test::HasNonfatalFailure();
|
||||
}
|
||||
|
||||
uint16_t pre_fpu_env_[14];
|
||||
|
|
|
|||
35
third_party/aom/test/resize_test.cc
vendored
35
third_party/aom/test/resize_test.cc
vendored
|
|
@ -298,10 +298,10 @@ TEST_P(ResizeTest, TestExternalResizeWorks) {
|
|||
unsigned int expected_h;
|
||||
ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight, &expected_w,
|
||||
&expected_h, 0);
|
||||
EXPECT_EQ(expected_w, info->w) << "Frame " << frame
|
||||
<< " had unexpected width";
|
||||
EXPECT_EQ(expected_h, info->h) << "Frame " << frame
|
||||
<< " had unexpected height";
|
||||
EXPECT_EQ(expected_w, info->w)
|
||||
<< "Frame " << frame << " had unexpected width";
|
||||
EXPECT_EQ(expected_h, info->h)
|
||||
<< "Frame " << frame << " had unexpected height";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,11 +351,11 @@ class ResizeInternalTest : public ResizeTest {
|
|||
encoder->Config(&cfg_);
|
||||
}
|
||||
} else {
|
||||
if (video->frame() == kStepDownFrame) {
|
||||
if (video->frame() >= kStepDownFrame && video->frame() < kStepUpFrame) {
|
||||
struct aom_scaling_mode mode = { AOME_FOURFIVE, AOME_THREEFIVE };
|
||||
encoder->Control(AOME_SET_SCALEMODE, &mode);
|
||||
}
|
||||
if (video->frame() == kStepUpFrame) {
|
||||
if (video->frame() >= kStepUpFrame) {
|
||||
struct aom_scaling_mode mode = { AOME_NORMAL, AOME_NORMAL };
|
||||
encoder->Control(AOME_SET_SCALEMODE, &mode);
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@ class ResizeInternalTest : public ResizeTest {
|
|||
|
||||
virtual void PSNRPktHook(const aom_codec_cx_pkt_t *pkt) {
|
||||
if (frame0_psnr_ == 0.) frame0_psnr_ = pkt->data.psnr.psnr[0];
|
||||
EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0);
|
||||
EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.5);
|
||||
}
|
||||
|
||||
#if WRITE_COMPRESSED_STREAM
|
||||
|
|
@ -404,6 +404,9 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
|
|||
cfg_.g_lag_in_frames = 0;
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
|
||||
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
|
||||
info != frame_info_list_.end(); ++info) {
|
||||
}
|
||||
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
|
||||
info != frame_info_list_.end(); ++info) {
|
||||
const aom_codec_pts_t pts = info->pts;
|
||||
|
|
@ -509,10 +512,10 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
|
|||
unsigned int expected_h;
|
||||
ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight, &expected_w,
|
||||
&expected_h, 1);
|
||||
EXPECT_EQ(expected_w, info->w) << "Frame " << frame
|
||||
<< " had unexpected width";
|
||||
EXPECT_EQ(expected_h, info->h) << "Frame " << frame
|
||||
<< " had unexpected height";
|
||||
EXPECT_EQ(expected_w, info->w)
|
||||
<< "Frame " << frame << " had unexpected width";
|
||||
EXPECT_EQ(expected_h, info->h)
|
||||
<< "Frame " << frame << " had unexpected height";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
}
|
||||
|
|
@ -520,7 +523,7 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
|
|||
// Verify the dynamic resizer behavior for real time, 1 pass CBR mode.
|
||||
// Run at low bitrate, with resize_allowed = 1, and verify that we get
|
||||
// one resize down event.
|
||||
TEST_P(ResizeRealtimeTest, TestInternalResizeDown) {
|
||||
TEST_P(ResizeRealtimeTest, DISABLED_TestInternalResizeDown) {
|
||||
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 299);
|
||||
DefaultConfig();
|
||||
|
|
@ -558,7 +561,7 @@ TEST_P(ResizeRealtimeTest, TestInternalResizeDown) {
|
|||
// Verify the dynamic resizer behavior for real time, 1 pass CBR mode.
|
||||
// Start at low target bitrate, raise the bitrate in the middle of the clip,
|
||||
// scaling-up should occur after bitrate changed.
|
||||
TEST_P(ResizeRealtimeTest, TestInternalResizeDownUpChangeBitRate) {
|
||||
TEST_P(ResizeRealtimeTest, DISABLED_TestInternalResizeDownUpChangeBitRate) {
|
||||
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 359);
|
||||
DefaultConfig();
|
||||
|
|
@ -693,7 +696,11 @@ class ResizingCspVideoSource : public ::libaom_test::DummyVideoSource {
|
|||
}
|
||||
};
|
||||
|
||||
#if (defined(DISABLE_TRELLISQ_SEARCH) && DISABLE_TRELLISQ_SEARCH)
|
||||
TEST_P(ResizeCspTest, DISABLED_TestResizeCspWorks) {
|
||||
#else
|
||||
TEST_P(ResizeCspTest, TestResizeCspWorks) {
|
||||
#endif
|
||||
ResizingCspVideoSource video;
|
||||
init_flags_ = AOM_CODEC_USE_PSNR;
|
||||
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
|
||||
|
|
@ -704,7 +711,7 @@ TEST_P(ResizeCspTest, TestResizeCspWorks) {
|
|||
AV1_INSTANTIATE_TEST_CASE(ResizeTest,
|
||||
::testing::Values(::libaom_test::kRealTime));
|
||||
AV1_INSTANTIATE_TEST_CASE(ResizeInternalTest,
|
||||
::testing::Values(::libaom_test::kOnePassBest));
|
||||
::testing::Values(::libaom_test::kOnePassGood));
|
||||
AV1_INSTANTIATE_TEST_CASE(ResizeRealtimeTest,
|
||||
::testing::Values(::libaom_test::kRealTime),
|
||||
::testing::Range(5, 9));
|
||||
|
|
|
|||
33
third_party/aom/test/scan_test.cc
vendored
33
third_party/aom/test/scan_test.cc
vendored
|
|
@ -43,6 +43,7 @@ TEST(ScanTest, av1_augment_prob) {
|
|||
}
|
||||
}
|
||||
|
||||
#if USE_TOPOLOGICAL_SORT
|
||||
TEST(ScanTest, av1_update_sort_order) {
|
||||
const TX_SIZE tx_size = TX_4X4;
|
||||
const TX_TYPE tx_type = DCT_DCT;
|
||||
|
|
@ -54,7 +55,9 @@ TEST(ScanTest, av1_update_sort_order) {
|
|||
av1_update_sort_order(tx_size, tx_type, prob, sort_order);
|
||||
for (int i = 0; i < 16; ++i) EXPECT_EQ(ref_sort_order[i], sort_order[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if USE_TOPOLOGICAL_SORT
|
||||
TEST(ScanTest, av1_update_scan_order) {
|
||||
TX_SIZE tx_size = TX_4X4;
|
||||
const TX_TYPE tx_type = DCT_DCT;
|
||||
|
|
@ -74,6 +77,7 @@ TEST(ScanTest, av1_update_scan_order) {
|
|||
EXPECT_EQ(i, scan[ref_iscan[i]]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(ScanTest, av1_update_neighbors) {
|
||||
TX_SIZE tx_size = TX_4X4;
|
||||
|
|
@ -94,4 +98,33 @@ TEST(ScanTest, av1_update_neighbors) {
|
|||
}
|
||||
}
|
||||
|
||||
#if USE_2X2_PROB
|
||||
TEST(ScanTest, av1_down_sample_scan_count) {
|
||||
const uint32_t non_zero_count[256] = {
|
||||
13, 12, 11, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 9, 10, 8, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 13, 9, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
const uint32_t ref_non_zero_count_ds[64] = {
|
||||
13, 11, 0, 0, 0, 0, 0, 0, 11, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
uint32_t non_zero_count_ds[64];
|
||||
av1_down_sample_scan_count(non_zero_count_ds, non_zero_count, TX_16X16);
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
EXPECT_EQ(ref_non_zero_count_ds[i], non_zero_count_ds[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
174
third_party/aom/test/selfguided_filter_test.cc
vendored
174
third_party/aom/test/selfguided_filter_test.cc
vendored
|
|
@ -40,18 +40,25 @@ class AV1SelfguidedFilterTest
|
|||
|
||||
protected:
|
||||
void RunSpeedTest() {
|
||||
const int w = 256, h = 256;
|
||||
const int pu_width = RESTORATION_PROC_UNIT_SIZE;
|
||||
const int pu_height = RESTORATION_PROC_UNIT_SIZE;
|
||||
const int width = 256, height = 256, stride = 288, out_stride = 288;
|
||||
const int NUM_ITERS = 2000;
|
||||
int i, j;
|
||||
int i, j, k;
|
||||
|
||||
uint8_t *input = (uint8_t *)aom_memalign(16, w * h * sizeof(uint8_t));
|
||||
uint8_t *output = (uint8_t *)aom_memalign(16, w * h * sizeof(uint8_t));
|
||||
uint8_t *input_ =
|
||||
(uint8_t *)aom_memalign(16, stride * (height + 32) * sizeof(uint8_t));
|
||||
uint8_t *output_ = (uint8_t *)aom_memalign(
|
||||
16, out_stride * (height + 32) * sizeof(uint8_t));
|
||||
int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE);
|
||||
uint8_t *input = input_ + stride * 16 + 16;
|
||||
uint8_t *output = output_ + out_stride * 16 + 16;
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
for (i = 0; i < h; ++i)
|
||||
for (j = 0; j < w; ++j) input[i * w + j] = rnd.Rand16() & 0xFF;
|
||||
for (i = -16; i < height + 16; ++i)
|
||||
for (j = -16; j < width + 16; ++j)
|
||||
input[i * stride + j] = rnd.Rand16() & 0xFF;
|
||||
|
||||
int xqd[2] = {
|
||||
SGRPROJ_PRJ_MIN0 +
|
||||
|
|
@ -67,20 +74,30 @@ class AV1SelfguidedFilterTest
|
|||
|
||||
std::clock_t start = std::clock();
|
||||
for (i = 0; i < NUM_ITERS; ++i) {
|
||||
apply_selfguided_restoration(input, w, h, w, eps, xqd, output, w, tmpbuf);
|
||||
for (k = 0; k < height; k += pu_height)
|
||||
for (j = 0; j < width; j += pu_width) {
|
||||
int w = AOMMIN(pu_width, width - j);
|
||||
int h = AOMMIN(pu_height, height - k);
|
||||
uint8_t *input_p = input + k * stride + j;
|
||||
uint8_t *output_p = output + k * out_stride + j;
|
||||
apply_selfguided_restoration(input_p, w, h, stride, eps, xqd,
|
||||
output_p, out_stride, tmpbuf);
|
||||
}
|
||||
}
|
||||
std::clock_t end = std::clock();
|
||||
double elapsed = ((end - start) / (double)CLOCKS_PER_SEC);
|
||||
|
||||
printf("%5d %dx%d blocks in %7.3fs = %7.3fus/block\n", NUM_ITERS, w, h,
|
||||
elapsed, elapsed * 1000000. / NUM_ITERS);
|
||||
printf("%5d %dx%d blocks in %7.3fs = %7.3fus/block\n", NUM_ITERS, width,
|
||||
height, elapsed, elapsed * 1000000. / NUM_ITERS);
|
||||
|
||||
aom_free(input);
|
||||
aom_free(output);
|
||||
aom_free(input_);
|
||||
aom_free(output_);
|
||||
aom_free(tmpbuf);
|
||||
}
|
||||
|
||||
void RunCorrectnessTest() {
|
||||
const int pu_width = RESTORATION_PROC_UNIT_SIZE;
|
||||
const int pu_height = RESTORATION_PROC_UNIT_SIZE;
|
||||
// Set the maximum width/height to test here. We actually test a small
|
||||
// range of sizes *up to* this size, so that we can check, eg.,
|
||||
// the behaviour on tiles which are not a multiple of 4 wide.
|
||||
|
|
@ -88,21 +105,26 @@ class AV1SelfguidedFilterTest
|
|||
const int NUM_ITERS = 81;
|
||||
int i, j, k;
|
||||
|
||||
uint8_t *input =
|
||||
(uint8_t *)aom_memalign(16, stride * max_h * sizeof(uint8_t));
|
||||
uint8_t *output =
|
||||
(uint8_t *)aom_memalign(16, out_stride * max_h * sizeof(uint8_t));
|
||||
uint8_t *output2 =
|
||||
(uint8_t *)aom_memalign(16, out_stride * max_h * sizeof(uint8_t));
|
||||
uint8_t *input_ =
|
||||
(uint8_t *)aom_memalign(16, stride * (max_h + 32) * sizeof(uint8_t));
|
||||
uint8_t *output_ = (uint8_t *)aom_memalign(
|
||||
16, out_stride * (max_h + 32) * sizeof(uint8_t));
|
||||
uint8_t *output2_ = (uint8_t *)aom_memalign(
|
||||
16, out_stride * (max_h + 32) * sizeof(uint8_t));
|
||||
int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE);
|
||||
|
||||
uint8_t *input = input_ + stride * 16 + 16;
|
||||
uint8_t *output = output_ + out_stride * 16 + 16;
|
||||
uint8_t *output2 = output2_ + out_stride * 16 + 16;
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
av1_loop_restoration_precal();
|
||||
|
||||
for (i = 0; i < NUM_ITERS; ++i) {
|
||||
for (j = 0; j < max_h; ++j)
|
||||
for (k = 0; k < max_w; ++k) input[j * stride + k] = rnd.Rand16() & 0xFF;
|
||||
for (j = -16; j < max_h + 16; ++j)
|
||||
for (k = -16; k < max_w + 16; ++k)
|
||||
input[j * stride + k] = rnd.Rand16() & 0xFF;
|
||||
|
||||
int xqd[2] = {
|
||||
SGRPROJ_PRJ_MIN0 +
|
||||
|
|
@ -116,18 +138,33 @@ class AV1SelfguidedFilterTest
|
|||
int test_w = max_w - (i / 9);
|
||||
int test_h = max_h - (i % 9);
|
||||
|
||||
for (k = 0; k < test_h; k += pu_height)
|
||||
for (j = 0; j < test_w; j += pu_width) {
|
||||
int w = AOMMIN(pu_width, test_w - j);
|
||||
int h = AOMMIN(pu_height, test_h - k);
|
||||
uint8_t *input_p = input + k * stride + j;
|
||||
uint8_t *output_p = output + k * out_stride + j;
|
||||
uint8_t *output2_p = output2 + k * out_stride + j;
|
||||
apply_selfguided_restoration(input_p, w, h, stride, eps, xqd,
|
||||
output_p, out_stride, tmpbuf);
|
||||
apply_selfguided_restoration_c(input_p, w, h, stride, eps, xqd,
|
||||
output2_p, out_stride, tmpbuf);
|
||||
}
|
||||
/*
|
||||
apply_selfguided_restoration(input, test_w, test_h, stride, eps, xqd,
|
||||
output, out_stride, tmpbuf);
|
||||
apply_selfguided_restoration_c(input, test_w, test_h, stride, eps, xqd,
|
||||
output2, out_stride, tmpbuf);
|
||||
*/
|
||||
for (j = 0; j < test_h; ++j)
|
||||
for (k = 0; k < test_w; ++k)
|
||||
for (k = 0; k < test_w; ++k) {
|
||||
ASSERT_EQ(output[j * out_stride + k], output2[j * out_stride + k]);
|
||||
}
|
||||
}
|
||||
|
||||
aom_free(input);
|
||||
aom_free(output);
|
||||
aom_free(output2);
|
||||
aom_free(input_);
|
||||
aom_free(output_);
|
||||
aom_free(output2_);
|
||||
aom_free(tmpbuf);
|
||||
}
|
||||
};
|
||||
|
|
@ -135,9 +172,8 @@ class AV1SelfguidedFilterTest
|
|||
TEST_P(AV1SelfguidedFilterTest, SpeedTest) { RunSpeedTest(); }
|
||||
TEST_P(AV1SelfguidedFilterTest, CorrectnessTest) { RunCorrectnessTest(); }
|
||||
|
||||
const FilterTestParam params[] = { make_tuple() };
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
const FilterTestParam params[] = { make_tuple() };
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1SelfguidedFilterTest,
|
||||
::testing::ValuesIn(params));
|
||||
#endif
|
||||
|
|
@ -156,20 +192,27 @@ class AV1HighbdSelfguidedFilterTest
|
|||
|
||||
protected:
|
||||
void RunSpeedTest() {
|
||||
const int w = 256, h = 256;
|
||||
const int pu_width = RESTORATION_PROC_UNIT_SIZE;
|
||||
const int pu_height = RESTORATION_PROC_UNIT_SIZE;
|
||||
const int width = 256, height = 256, stride = 288, out_stride = 288;
|
||||
const int NUM_ITERS = 2000;
|
||||
int i, j;
|
||||
int i, j, k;
|
||||
int bit_depth = GET_PARAM(0);
|
||||
int mask = (1 << bit_depth) - 1;
|
||||
|
||||
uint16_t *input = (uint16_t *)aom_memalign(16, w * h * sizeof(uint16_t));
|
||||
uint16_t *output = (uint16_t *)aom_memalign(16, w * h * sizeof(uint16_t));
|
||||
uint16_t *input_ =
|
||||
(uint16_t *)aom_memalign(16, stride * (height + 32) * sizeof(uint16_t));
|
||||
uint16_t *output_ = (uint16_t *)aom_memalign(
|
||||
16, out_stride * (height + 32) * sizeof(uint16_t));
|
||||
int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE);
|
||||
uint16_t *input = input_ + stride * 16 + 16;
|
||||
uint16_t *output = output_ + out_stride * 16 + 16;
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
for (i = 0; i < h; ++i)
|
||||
for (j = 0; j < w; ++j) input[i * w + j] = rnd.Rand16() & mask;
|
||||
for (i = -16; i < height + 16; ++i)
|
||||
for (j = -16; j < width + 16; ++j)
|
||||
input[i * stride + j] = rnd.Rand16() & mask;
|
||||
|
||||
int xqd[2] = {
|
||||
SGRPROJ_PRJ_MIN0 +
|
||||
|
|
@ -185,21 +228,31 @@ class AV1HighbdSelfguidedFilterTest
|
|||
|
||||
std::clock_t start = std::clock();
|
||||
for (i = 0; i < NUM_ITERS; ++i) {
|
||||
apply_selfguided_restoration_highbd(input, w, h, w, bit_depth, eps, xqd,
|
||||
output, w, tmpbuf);
|
||||
for (k = 0; k < height; k += pu_height)
|
||||
for (j = 0; j < width; j += pu_width) {
|
||||
int w = AOMMIN(pu_width, width - j);
|
||||
int h = AOMMIN(pu_height, height - k);
|
||||
uint16_t *input_p = input + k * stride + j;
|
||||
uint16_t *output_p = output + k * out_stride + j;
|
||||
apply_selfguided_restoration_highbd(input_p, w, h, stride, bit_depth,
|
||||
eps, xqd, output_p, out_stride,
|
||||
tmpbuf);
|
||||
}
|
||||
}
|
||||
std::clock_t end = std::clock();
|
||||
double elapsed = ((end - start) / (double)CLOCKS_PER_SEC);
|
||||
|
||||
printf("%5d %dx%d blocks in %7.3fs = %7.3fus/block\n", NUM_ITERS, w, h,
|
||||
elapsed, elapsed * 1000000. / NUM_ITERS);
|
||||
printf("%5d %dx%d blocks in %7.3fs = %7.3fus/block\n", NUM_ITERS, width,
|
||||
height, elapsed, elapsed * 1000000. / NUM_ITERS);
|
||||
|
||||
aom_free(input);
|
||||
aom_free(output);
|
||||
aom_free(input_);
|
||||
aom_free(output_);
|
||||
aom_free(tmpbuf);
|
||||
}
|
||||
|
||||
void RunCorrectnessTest() {
|
||||
const int pu_width = RESTORATION_PROC_UNIT_SIZE;
|
||||
const int pu_height = RESTORATION_PROC_UNIT_SIZE;
|
||||
// Set the maximum width/height to test here. We actually test a small
|
||||
// range of sizes *up to* this size, so that we can check, eg.,
|
||||
// the behaviour on tiles which are not a multiple of 4 wide.
|
||||
|
|
@ -209,21 +262,26 @@ class AV1HighbdSelfguidedFilterTest
|
|||
int bit_depth = GET_PARAM(0);
|
||||
int mask = (1 << bit_depth) - 1;
|
||||
|
||||
uint16_t *input =
|
||||
(uint16_t *)aom_memalign(16, stride * max_h * sizeof(uint16_t));
|
||||
uint16_t *output =
|
||||
(uint16_t *)aom_memalign(16, out_stride * max_h * sizeof(uint16_t));
|
||||
uint16_t *output2 =
|
||||
(uint16_t *)aom_memalign(16, out_stride * max_h * sizeof(uint16_t));
|
||||
uint16_t *input_ =
|
||||
(uint16_t *)aom_memalign(16, stride * (max_h + 32) * sizeof(uint16_t));
|
||||
uint16_t *output_ = (uint16_t *)aom_memalign(
|
||||
16, out_stride * (max_h + 32) * sizeof(uint16_t));
|
||||
uint16_t *output2_ = (uint16_t *)aom_memalign(
|
||||
16, out_stride * (max_h + 32) * sizeof(uint16_t));
|
||||
int32_t *tmpbuf = (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE);
|
||||
|
||||
uint16_t *input = input_ + stride * 16 + 16;
|
||||
uint16_t *output = output_ + out_stride * 16 + 16;
|
||||
uint16_t *output2 = output2_ + out_stride * 16 + 16;
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
av1_loop_restoration_precal();
|
||||
|
||||
for (i = 0; i < NUM_ITERS; ++i) {
|
||||
for (j = 0; j < max_h; ++j)
|
||||
for (k = 0; k < max_w; ++k) input[j * stride + k] = rnd.Rand16() & mask;
|
||||
for (j = -16; j < max_h + 16; ++j)
|
||||
for (k = -16; k < max_w + 16; ++k)
|
||||
input[j * stride + k] = rnd.Rand16() & mask;
|
||||
|
||||
int xqd[2] = {
|
||||
SGRPROJ_PRJ_MIN0 +
|
||||
|
|
@ -237,20 +295,37 @@ class AV1HighbdSelfguidedFilterTest
|
|||
int test_w = max_w - (i / 9);
|
||||
int test_h = max_h - (i % 9);
|
||||
|
||||
for (k = 0; k < test_h; k += pu_height)
|
||||
for (j = 0; j < test_w; j += pu_width) {
|
||||
int w = AOMMIN(pu_width, test_w - j);
|
||||
int h = AOMMIN(pu_height, test_h - k);
|
||||
uint16_t *input_p = input + k * stride + j;
|
||||
uint16_t *output_p = output + k * out_stride + j;
|
||||
uint16_t *output2_p = output2 + k * out_stride + j;
|
||||
apply_selfguided_restoration_highbd(input_p, w, h, stride, bit_depth,
|
||||
eps, xqd, output_p, out_stride,
|
||||
tmpbuf);
|
||||
apply_selfguided_restoration_highbd_c(input_p, w, h, stride,
|
||||
bit_depth, eps, xqd, output2_p,
|
||||
out_stride, tmpbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
apply_selfguided_restoration_highbd(input, test_w, test_h, stride,
|
||||
bit_depth, eps, xqd, output,
|
||||
out_stride, tmpbuf);
|
||||
apply_selfguided_restoration_highbd_c(input, test_w, test_h, stride,
|
||||
bit_depth, eps, xqd, output2,
|
||||
out_stride, tmpbuf);
|
||||
*/
|
||||
for (j = 0; j < test_h; ++j)
|
||||
for (k = 0; k < test_w; ++k)
|
||||
ASSERT_EQ(output[j * out_stride + k], output2[j * out_stride + k]);
|
||||
}
|
||||
|
||||
aom_free(input);
|
||||
aom_free(output);
|
||||
aom_free(output2);
|
||||
aom_free(input_);
|
||||
aom_free(output_);
|
||||
aom_free(output2_);
|
||||
aom_free(tmpbuf);
|
||||
}
|
||||
};
|
||||
|
|
@ -258,10 +333,9 @@ class AV1HighbdSelfguidedFilterTest
|
|||
TEST_P(AV1HighbdSelfguidedFilterTest, SpeedTest) { RunSpeedTest(); }
|
||||
TEST_P(AV1HighbdSelfguidedFilterTest, CorrectnessTest) { RunCorrectnessTest(); }
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
const HighbdFilterTestParam highbd_params[] = { make_tuple(8), make_tuple(10),
|
||||
make_tuple(12) };
|
||||
|
||||
#if HAVE_SSE4_1
|
||||
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdSelfguidedFilterTest,
|
||||
::testing::ValuesIn(highbd_params));
|
||||
#endif
|
||||
|
|
|
|||
8
third_party/aom/test/simd_cmp_impl.h
vendored
8
third_party/aom/test/simd_cmp_impl.h
vendored
|
|
@ -371,10 +371,10 @@ typedef struct {
|
|||
fptr simd;
|
||||
} mapping;
|
||||
|
||||
#define MAP(name) \
|
||||
{ \
|
||||
#name, reinterpret_cast < fptr > (c_##name), \
|
||||
reinterpret_cast < fptr > (name) \
|
||||
#define MAP(name) \
|
||||
{ \
|
||||
#name, \
|
||||
reinterpret_cast < fptr > (c_##name), reinterpret_cast < fptr > (name) \
|
||||
}
|
||||
|
||||
const mapping m[] = { MAP(v64_sad_u8),
|
||||
|
|
|
|||
58
third_party/aom/test/subtract_test.cc
vendored
58
third_party/aom/test/subtract_test.cc
vendored
|
|
@ -130,7 +130,11 @@ class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> {
|
|||
|
||||
rnd_.Reset(ACMRandom::DeterministicSeed());
|
||||
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const size_t max_width = 128;
|
||||
#else
|
||||
const size_t max_width = 64;
|
||||
#endif
|
||||
const size_t max_block_size = max_width * max_width;
|
||||
src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
|
||||
aom_memalign(16, max_block_size * sizeof(uint16_t))));
|
||||
|
|
@ -147,8 +151,8 @@ class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> {
|
|||
}
|
||||
|
||||
protected:
|
||||
void RunForSpeed();
|
||||
void CheckResult();
|
||||
void RunForSpeed();
|
||||
|
||||
private:
|
||||
ACMRandom rnd_;
|
||||
|
|
@ -161,27 +165,13 @@ class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> {
|
|||
int16_t *diff_;
|
||||
};
|
||||
|
||||
void AV1HBDSubtractBlockTest::RunForSpeed() {
|
||||
const int test_num = 200000;
|
||||
const int max_width = 128;
|
||||
const int max_block_size = max_width * max_width;
|
||||
const int mask = (1 << bit_depth_) - 1;
|
||||
int i, j;
|
||||
|
||||
for (j = 0; j < max_block_size; ++j) {
|
||||
CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask;
|
||||
CONVERT_TO_SHORTPTR(pred_)[j] = rnd_.Rand16() & mask;
|
||||
}
|
||||
|
||||
for (i = 0; i < test_num; ++i) {
|
||||
func_(block_height_, block_width_, diff_, block_width_, src_, block_width_,
|
||||
pred_, block_width_, bit_depth_);
|
||||
}
|
||||
}
|
||||
|
||||
void AV1HBDSubtractBlockTest::CheckResult() {
|
||||
const int test_num = 100;
|
||||
const int max_width = 128;
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const size_t max_width = 128;
|
||||
#else
|
||||
const size_t max_width = 64;
|
||||
#endif
|
||||
const int max_block_size = max_width * max_width;
|
||||
const int mask = (1 << bit_depth_) - 1;
|
||||
int i, j;
|
||||
|
|
@ -208,9 +198,29 @@ void AV1HBDSubtractBlockTest::CheckResult() {
|
|||
|
||||
TEST_P(AV1HBDSubtractBlockTest, CheckResult) { CheckResult(); }
|
||||
|
||||
#if USE_SPEED_TEST
|
||||
TEST_P(AV1HBDSubtractBlockTest, CheckSpeed) { RunForSpeed(); }
|
||||
#endif // USE_SPEED_TEST
|
||||
void AV1HBDSubtractBlockTest::RunForSpeed() {
|
||||
const int test_num = 200000;
|
||||
#if CONFIG_EXT_PARTITION
|
||||
const size_t max_width = 128;
|
||||
#else
|
||||
const size_t max_width = 64;
|
||||
#endif
|
||||
const int max_block_size = max_width * max_width;
|
||||
const int mask = (1 << bit_depth_) - 1;
|
||||
int i, j;
|
||||
|
||||
for (j = 0; j < max_block_size; ++j) {
|
||||
CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask;
|
||||
CONVERT_TO_SHORTPTR(pred_)[j] = rnd_.Rand16() & mask;
|
||||
}
|
||||
|
||||
for (i = 0; i < test_num; ++i) {
|
||||
func_(block_height_, block_width_, diff_, block_width_, src_, block_width_,
|
||||
pred_, block_width_, bit_depth_);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(AV1HBDSubtractBlockTest, DISABLED_Speed) { RunForSpeed(); }
|
||||
|
||||
#if HAVE_SSE2
|
||||
|
||||
|
|
@ -241,12 +251,14 @@ const Params kAV1HBDSubtractBlock_sse2[] = {
|
|||
make_tuple(64, 32, 12, &aom_highbd_subtract_block_c),
|
||||
make_tuple(64, 64, 12, &aom_highbd_subtract_block_sse2),
|
||||
make_tuple(64, 64, 12, &aom_highbd_subtract_block_c),
|
||||
#if CONFIG_EXT_PARTITION
|
||||
make_tuple(64, 128, 12, &aom_highbd_subtract_block_sse2),
|
||||
make_tuple(64, 128, 12, &aom_highbd_subtract_block_c),
|
||||
make_tuple(128, 64, 12, &aom_highbd_subtract_block_sse2),
|
||||
make_tuple(128, 64, 12, &aom_highbd_subtract_block_c),
|
||||
make_tuple(128, 128, 12, &aom_highbd_subtract_block_sse2),
|
||||
make_tuple(128, 128, 12, &aom_highbd_subtract_block_c)
|
||||
#endif // CONFIG_EXT_PARTITION
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AV1HBDSubtractBlockTest,
|
||||
|
|
|
|||
4
third_party/aom/test/test-data.mk
vendored
4
third_party/aom/test/test-data.mk
vendored
|
|
@ -40,6 +40,10 @@ LIBAOM_TEST_DATA-$(CONFIG_AV1_ENCODER) += tacomasmallcameramovement_640_480_30.y
|
|||
LIBAOM_TEST_DATA-$(CONFIG_AV1_ENCODER) += thaloundeskmtg_640_480_30.yuv
|
||||
endif # CONFIG_ENCODE_PERF_TESTS
|
||||
|
||||
ifeq ($(CONFIG_EXT_TILE),yes)
|
||||
LIBAOM_TEST_DATA-$(CONFIG_AV1_ENCODER) += vase10x10.yuv
|
||||
endif # CONFIG_EXT_TILE
|
||||
|
||||
# sort and remove duplicates
|
||||
LIBAOM_TEST_DATA-yes := $(sort $(LIBAOM_TEST_DATA-yes))
|
||||
|
||||
|
|
|
|||
1
third_party/aom/test/test-data.sha1
vendored
1
third_party/aom/test/test-data.sha1
vendored
|
|
@ -26,3 +26,4 @@ e7d315dbf4f3928779e0dc624311196d44491d32 *niklas_1280_720_30.yuv
|
|||
717da707afcaa1f692ff1946f291054eb75a4f06 *screendata.y4m
|
||||
9cfc855459e7549fd015c79e8eca512b2f2cb7e3 *niklas_1280_720_30.y4m
|
||||
5b5763b388b1b52a81bb82b39f7ec25c4bd3d0e1 *desktop_credits.y4m
|
||||
36ddab9b99eb7545aa0bf362d6f498212d596516 *vase10x10.yuv
|
||||
|
|
|
|||
108
third_party/aom/test/test.cmake
vendored
108
third_party/aom/test/test.cmake
vendored
|
|
@ -103,6 +103,7 @@ set(AOM_UNIT_TEST_ENCODER_SOURCES
|
|||
"${AOM_ROOT}/test/encode_test_driver.h"
|
||||
"${AOM_ROOT}/test/error_resilience_test.cc"
|
||||
"${AOM_ROOT}/test/i420_video_source.h"
|
||||
"${AOM_ROOT}/test/resize_test.cc"
|
||||
"${AOM_ROOT}/test/y4m_test.cc"
|
||||
"${AOM_ROOT}/test/y4m_video_source.h"
|
||||
"${AOM_ROOT}/test/yuv_video_source.h")
|
||||
|
|
@ -133,24 +134,35 @@ if (NOT BUILD_SHARED_LIBS)
|
|||
"${AOM_ROOT}/test/av1_txfm_test.h"
|
||||
"${AOM_ROOT}/test/intrapred_test.cc"
|
||||
"${AOM_ROOT}/test/lpf_8_test.cc"
|
||||
"${AOM_ROOT}/test/motion_vector_test.cc"
|
||||
"${AOM_ROOT}/test/simd_cmp_impl.h")
|
||||
|
||||
if (CONFIG_CDEF)
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/clpf_test.cc"
|
||||
"${AOM_ROOT}/test/dering_test.cc")
|
||||
endif ()
|
||||
set(AOM_UNIT_TEST_ENCODER_SOURCES
|
||||
${AOM_UNIT_TEST_ENCODER_SOURCES}
|
||||
"${AOM_ROOT}/test/motion_vector_test.cc")
|
||||
|
||||
if (CONFIG_FILTER_INTRA)
|
||||
if (HAVE_SSE4_1)
|
||||
if (CONFIG_CDEF)
|
||||
if (CONFIG_CDEF_SINGLEPASS)
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/filterintra_predictors_test.cc")
|
||||
"${AOM_ROOT}/test/cdef_test.cc")
|
||||
else ()
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/clpf_test.cc"
|
||||
"${AOM_ROOT}/test/dering_test.cc")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Omit 4-tap filter intra predictor test-- currently a 3-tap filter is in
|
||||
# use.
|
||||
#if (CONFIG_FILTER_INTRA)
|
||||
# if (HAVE_SSE4_1)
|
||||
# set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
# ${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
# "${AOM_ROOT}/test/filterintra_predictors_test.cc")
|
||||
# endif ()
|
||||
#endif ()
|
||||
|
||||
if (CONFIG_INTRABC)
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
|
|
@ -160,10 +172,15 @@ if (NOT BUILD_SHARED_LIBS)
|
|||
if (CONFIG_LOOP_RESTORATION)
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/hiprec_convolve_test.cc"
|
||||
"${AOM_ROOT}/test/selfguided_filter_test.cc")
|
||||
|
||||
if (HAVE_SSE2)
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/hiprec_convolve_test.cc"
|
||||
"${AOM_ROOT}/test/hiprec_convolve_test_util.cc"
|
||||
"${AOM_ROOT}/test/hiprec_convolve_test_util.h"
|
||||
"${AOM_ROOT}/test/selfguided_filter_test.cc")
|
||||
"${AOM_ROOT}/test/hiprec_convolve_test_util.h")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(AOM_UNIT_TEST_COMMON_INTRIN_NEON
|
||||
|
|
@ -202,11 +219,12 @@ if (CONFIG_AV1_ENCODER)
|
|||
"${AOM_ROOT}/test/av1_fht16x16_test.cc"
|
||||
"${AOM_ROOT}/test/av1_fht32x32_test.cc"
|
||||
"${AOM_ROOT}/test/av1_fht8x8_test.cc"
|
||||
"${AOM_ROOT}/test/av1_inv_txfm_test.cc"
|
||||
"${AOM_ROOT}/test/av1_fwd_txfm1d_test.cc"
|
||||
"${AOM_ROOT}/test/av1_fwd_txfm2d_test.cc"
|
||||
"${AOM_ROOT}/test/av1_inv_txfm1d_test.cc"
|
||||
"${AOM_ROOT}/test/av1_inv_txfm2d_test.cc"
|
||||
"${AOM_ROOT}/test/av1_inv_txfm_test.cc"
|
||||
"${AOM_ROOT}/test/av1_wedge_utils_test.cc"
|
||||
"${AOM_ROOT}/test/avg_test.cc"
|
||||
"${AOM_ROOT}/test/blend_a64_mask_1d_test.cc"
|
||||
"${AOM_ROOT}/test/blend_a64_mask_test.cc"
|
||||
|
|
@ -214,27 +232,37 @@ if (CONFIG_AV1_ENCODER)
|
|||
"${AOM_ROOT}/test/fdct4x4_test.cc"
|
||||
"${AOM_ROOT}/test/fdct8x8_test.cc"
|
||||
"${AOM_ROOT}/test/hadamard_test.cc"
|
||||
"${AOM_ROOT}/test/masked_sad_test.cc"
|
||||
"${AOM_ROOT}/test/masked_variance_test.cc"
|
||||
"${AOM_ROOT}/test/minmax_test.cc"
|
||||
"${AOM_ROOT}/test/quantize_func_test.cc"
|
||||
"${AOM_ROOT}/test/subtract_test.cc"
|
||||
"${AOM_ROOT}/test/sum_squares_test.cc"
|
||||
"${AOM_ROOT}/test/variance_test.cc")
|
||||
|
||||
if (NOT CONFIG_AOM_QM AND NOT CONFIG_NEW_QUANT)
|
||||
set(AOM_UNIT_TEST_ENCODER_SOURCES
|
||||
${AOM_UNIT_TEST_ENCODER_SOURCES}
|
||||
"${AOM_ROOT}/test/quantize_func_test.cc")
|
||||
endif ()
|
||||
|
||||
if (CONFIG_CONVOLVE_ROUND)
|
||||
set(AOM_UNIT_TEST_ENCODER_SOURCES
|
||||
${AOM_UNIT_TEST_ENCODER_SOURCES}
|
||||
"${AOM_ROOT}/test/av1_convolve_2d_test.cc"
|
||||
"${AOM_ROOT}/test/av1_convolve_2d_test_util.cc"
|
||||
"${AOM_ROOT}/test/av1_convolve_2d_test_util.h"
|
||||
"${AOM_ROOT}/test/convolve_round_test.cc")
|
||||
if (HAVE_SSE2)
|
||||
set(AOM_UNIT_TEST_ENCODER_SOURCES
|
||||
${AOM_UNIT_TEST_ENCODER_SOURCES}
|
||||
"${AOM_ROOT}/test/av1_convolve_2d_test.cc"
|
||||
"${AOM_ROOT}/test/av1_convolve_2d_test_util.cc"
|
||||
"${AOM_ROOT}/test/av1_convolve_2d_test_util.h")
|
||||
endif ()
|
||||
if (NOT CONFIG_COMPOUND_ROUND)
|
||||
if (HAVE_SSE4_1)
|
||||
set(AOM_UNIT_TEST_ENCODER_SOURCES
|
||||
${AOM_UNIT_TEST_ENCODER_SOURCES}
|
||||
"${AOM_ROOT}/test/av1_convolve_scale_test.cc")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (CONFIG_EXT_INTER)
|
||||
set(AOM_UNIT_TEST_ENCODER_SOURCES
|
||||
${AOM_UNIT_TEST_ENCODER_SOURCES}
|
||||
"${AOM_ROOT}/test/av1_wedge_utils_test.cc"
|
||||
"${AOM_ROOT}/test/masked_sad_test.cc"
|
||||
"${AOM_ROOT}/test/masked_variance_test.cc")
|
||||
endif ()
|
||||
|
||||
if (CONFIG_EXT_TX)
|
||||
|
|
@ -274,9 +302,9 @@ if (NOT BUILD_SHARED_LIBS)
|
|||
if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER)
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/binary_codes_test.cc"
|
||||
"${AOM_ROOT}/test/divu_small_test.cc"
|
||||
"${AOM_ROOT}/test/ethread_test.cc"
|
||||
"${AOM_ROOT}/test/coding_path_sync.cc"
|
||||
"${AOM_ROOT}/test/idct8x8_test.cc"
|
||||
"${AOM_ROOT}/test/partial_idct_test.cc"
|
||||
"${AOM_ROOT}/test/superframe_test.cc"
|
||||
|
|
@ -290,6 +318,7 @@ if (NOT BUILD_SHARED_LIBS)
|
|||
else ()
|
||||
set(AOM_UNIT_TEST_COMMON_SOURCES
|
||||
${AOM_UNIT_TEST_COMMON_SOURCES}
|
||||
"${AOM_ROOT}/test/binary_codes_test.cc"
|
||||
"${AOM_ROOT}/test/boolcoder_test.cc")
|
||||
endif ()
|
||||
|
||||
|
|
@ -327,22 +356,25 @@ if (CONFIG_UNIT_TESTS)
|
|||
# Force static run time to avoid collisions with googletest.
|
||||
include("${AOM_ROOT}/build/cmake/msvc_runtime.cmake")
|
||||
endif ()
|
||||
include_directories(
|
||||
"${AOM_ROOT}/third_party/googletest/src/googletest/src"
|
||||
"${AOM_ROOT}/third_party/googletest/src/googletest/include")
|
||||
|
||||
if (BUILD_SHARED_LIBS AND APPLE)
|
||||
# Silence an RPATH warning.
|
||||
set(CMAKE_MACOSX_RPATH 1)
|
||||
endif ()
|
||||
add_subdirectory("${AOM_ROOT}/third_party/googletest/src/googletest"
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
# Generate a stub file containing the C function usage_exit(); this is
|
||||
# required because of the test dependency on aom_common_app_util.
|
||||
# Specifically, the function die() in tools_common.c calls usage_exit() to
|
||||
# terminate the program on the caller's behalf.
|
||||
file(WRITE "${AOM_CONFIG_DIR}/usage_exit.c" "void usage_exit(void) {}")
|
||||
include_directories(
|
||||
"${AOM_ROOT}/third_party/googletest/src/googletest/src"
|
||||
"${AOM_ROOT}/third_party/googletest/src/googletest/include")
|
||||
|
||||
if (AOM_DISABLE_GTEST_CMAKE)
|
||||
include_directories("${AOM_ROOT}/third_party/googletest/src/googletest")
|
||||
add_library(gtest STATIC
|
||||
"${AOM_ROOT}/third_party/googletest/src/googletest/src/gtest-all.cc")
|
||||
else ()
|
||||
add_subdirectory("${AOM_ROOT}/third_party/googletest/src/googletest"
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
|
||||
# Setup the targets for CONFIG_UNIT_TESTS. The libaom and app util targets must
|
||||
|
|
@ -364,6 +396,7 @@ function (setup_aom_test_targets)
|
|||
add_executable(test_libaom ${AOM_UNIT_TEST_WRAPPER_SOURCES}
|
||||
$<TARGET_OBJECTS:aom_common_app_util>
|
||||
$<TARGET_OBJECTS:test_aom_common>)
|
||||
set(AOM_APP_TARGETS ${AOM_APP_TARGETS} test_libaom)
|
||||
|
||||
if (CONFIG_AV1_DECODER)
|
||||
target_sources(test_libaom PRIVATE
|
||||
|
|
@ -390,6 +423,7 @@ function (setup_aom_test_targets)
|
|||
$<TARGET_OBJECTS:aom_common_app_util>)
|
||||
target_link_libraries(test_intra_pred_speed ${AOM_LIB_LINK_TYPE}
|
||||
aom gtest)
|
||||
set(AOM_APP_TARGETS ${AOM_APP_TARGETS} test_intra_pred_speed)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
|
@ -483,6 +517,8 @@ function (setup_aom_test_targets)
|
|||
endforeach ()
|
||||
add_custom_target(runtests)
|
||||
add_dependencies(runtests ${test_targets})
|
||||
|
||||
set(AOM_APP_TARGETS ${AOM_APP_TARGETS} PARENT_SCOPE)
|
||||
endfunction ()
|
||||
|
||||
endif () # AOM_TEST_TEST_CMAKE_
|
||||
|
|
|
|||
16
third_party/aom/test/test.mk
vendored
16
third_party/aom/test/test.mk
vendored
|
|
@ -33,11 +33,10 @@ LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += altref_test.cc
|
|||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += aq_segment_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += datarate_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += encode_api_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += coding_path_sync.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += error_resilience_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += i420_video_source.h
|
||||
#LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += realtime_test.cc
|
||||
#LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += resize_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += resize_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += y4m_video_source.h
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += yuv_video_source.h
|
||||
|
||||
|
|
@ -107,6 +106,7 @@ ifeq ($(CONFIG_AV1),yes)
|
|||
# These tests require both the encoder and decoder to be built.
|
||||
ifeq ($(CONFIG_AV1_ENCODER)$(CONFIG_AV1_DECODER),yesyes)
|
||||
# IDCT test currently depends on FDCT function
|
||||
LIBAOM_TEST_SRCS-yes += coding_path_sync.cc
|
||||
LIBAOM_TEST_SRCS-yes += idct8x8_test.cc
|
||||
LIBAOM_TEST_SRCS-yes += partial_idct_test.cc
|
||||
LIBAOM_TEST_SRCS-yes += superframe_test.cc
|
||||
|
|
@ -135,8 +135,12 @@ endif
|
|||
LIBAOM_TEST_SRCS-$(CONFIG_ADAPT_SCAN) += scan_test.cc
|
||||
LIBAOM_TEST_SRCS-yes += convolve_test.cc
|
||||
LIBAOM_TEST_SRCS-yes += lpf_8_test.cc
|
||||
ifeq ($(CONFIG_CDEF_SINGLEPASS),yes)
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_CDEF) += cdef_test.cc
|
||||
else
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_CDEF) += dering_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_CDEF) += clpf_test.cc
|
||||
endif
|
||||
LIBAOM_TEST_SRCS-yes += simd_cmp_impl.h
|
||||
LIBAOM_TEST_SRCS-$(HAVE_SSE2) += simd_cmp_sse2.cc
|
||||
LIBAOM_TEST_SRCS-$(HAVE_SSSE3) += simd_cmp_ssse3.cc
|
||||
|
|
@ -163,11 +167,9 @@ LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += error_block_test.cc
|
|||
#LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_quantize_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += subtract_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += arf_freq_test.cc
|
||||
ifneq ($(CONFIG_AOM_QM), yes)
|
||||
ifneq ($(CONFIG_NEW_QUANT), yes)
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += quantize_func_test.cc
|
||||
endif
|
||||
endif
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += block_error_test.cc
|
||||
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_inv_txfm_test.cc
|
||||
|
|
@ -193,11 +195,9 @@ LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += subtract_test.cc
|
|||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += blend_a64_mask_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += blend_a64_mask_1d_test.cc
|
||||
|
||||
ifeq ($(CONFIG_EXT_INTER),yes)
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += masked_variance_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += masked_sad_test.cc
|
||||
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_wedge_utils_test.cc
|
||||
endif
|
||||
|
||||
## Skip the unit test written for 4-tap filter intra predictor, because we
|
||||
## revert to 3-tap filter.
|
||||
|
|
@ -252,6 +252,10 @@ LIBAOM_TEST_SRCS-$(HAVE_SSE2) += av1_convolve_2d_test_util.cc
|
|||
LIBAOM_TEST_SRCS-yes += convolve_round_test.cc
|
||||
endif
|
||||
|
||||
ifeq (yesx,$(CONFIG_CONVOLVE_ROUND)x$(CONFIG_COMPOUND_ROUND))
|
||||
LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += av1_convolve_scale_test.cc
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_GLOBAL_MOTION)$(CONFIG_AV1_ENCODER),yesyes)
|
||||
LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += corner_match_test.cc
|
||||
endif
|
||||
|
|
|
|||
49
third_party/aom/test/test_data_util.cmake
vendored
49
third_party/aom/test/test_data_util.cmake
vendored
|
|
@ -9,6 +9,47 @@
|
|||
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
||||
##
|
||||
|
||||
set(AOM_TEST_DATA_FILE_NAMES
|
||||
"hantro_collage_w352h288.yuv"
|
||||
"hantro_odd.yuv"
|
||||
"park_joy_90p_10_420.y4m"
|
||||
"park_joy_90p_10_422.y4m"
|
||||
"park_joy_90p_10_444.y4m"
|
||||
"park_joy_90p_10_440.yuv"
|
||||
"park_joy_90p_12_420.y4m"
|
||||
"park_joy_90p_12_422.y4m"
|
||||
"park_joy_90p_12_444.y4m"
|
||||
"park_joy_90p_12_440.yuv"
|
||||
"park_joy_90p_8_420_a10-1.y4m"
|
||||
"park_joy_90p_8_420.y4m"
|
||||
"park_joy_90p_8_422.y4m"
|
||||
"park_joy_90p_8_444.y4m"
|
||||
"park_joy_90p_8_440.yuv"
|
||||
"desktop_credits.y4m"
|
||||
"niklas_1280_720_30.y4m"
|
||||
"rush_hour_444.y4m"
|
||||
"screendata.y4m"
|
||||
"niklas_640_480_30.yuv")
|
||||
|
||||
if (CONFIG_DECODE_PERF_TESTS AND CONFIG_AV1_ENCODER)
|
||||
set(AOM_TEST_DATA_FILE_NAMES
|
||||
${AOM_TEST_DATA_FILE_NAMES}
|
||||
"niklas_1280_720_30.yuv")
|
||||
endif ()
|
||||
|
||||
if (CONFIG_ENCODE_PERF_TESTS AND CONFIG_AV1_ENCODER)
|
||||
set(AOM_TEST_DATA_FILE_NAMES
|
||||
${AOM_TEST_DATA_FILE_NAMES}
|
||||
"desktop_640_360_30.yuv"
|
||||
"kirland_640_480_30.yuv"
|
||||
"macmarcomoving_640_480_30.yuv"
|
||||
"macmarcostationary_640_480_30.yuv"
|
||||
"niklas_1280_720_30.yuv"
|
||||
"tacomanarrows_640_480_30.yuv"
|
||||
"tacomasmallcameramovement_640_480_30.yuv"
|
||||
"thaloundeskmtg_640_480_30.yuv")
|
||||
endif ()
|
||||
|
||||
# Parses test/test-data.sha1 and writes captured file names and checksums to
|
||||
# $out_files and $out_checksums as lists.
|
||||
function (make_test_data_lists test_data_file out_files out_checksums)
|
||||
|
|
@ -28,8 +69,12 @@ function (make_test_data_lists test_data_file out_files out_checksums)
|
|||
string(SUBSTRING "${line}" 0 ${delim_pos} checksum)
|
||||
string(SUBSTRING "${line}" ${filename_pos} -1 filename)
|
||||
|
||||
set(checksums ${checksums} ${checksum})
|
||||
set(filenames ${filenames} ${filename})
|
||||
list(FIND AOM_TEST_DATA_FILE_NAMES ${filename} list_index)
|
||||
if (NOT ${list_index} EQUAL -1)
|
||||
# Include the name and checksum in output only when the file is needed.
|
||||
set(checksums ${checksums} ${checksum})
|
||||
set(filenames ${filenames} ${filename})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
list(LENGTH filenames num_files)
|
||||
|
|
|
|||
1565
third_party/aom/test/test_intra_pred_speed.cc
vendored
1565
third_party/aom/test/test_intra_pred_speed.cc
vendored
File diff suppressed because it is too large
Load diff
145
third_party/aom/test/warp_filter_test_util.cc
vendored
145
third_party/aom/test/warp_filter_test_util.cc
vendored
|
|
@ -21,9 +21,9 @@ namespace AV1WarpFilter {
|
|||
::testing::internal::ParamGenerator<WarpTestParam> BuildParams(
|
||||
warp_affine_func filter) {
|
||||
const WarpTestParam params[] = {
|
||||
make_tuple(4, 4, 50000, filter), make_tuple(8, 8, 50000, filter),
|
||||
make_tuple(64, 64, 1000, filter), make_tuple(4, 16, 20000, filter),
|
||||
make_tuple(32, 8, 10000, filter),
|
||||
make_tuple(4, 4, 100, filter), make_tuple(8, 8, 100, filter),
|
||||
make_tuple(64, 64, 100, filter), make_tuple(4, 16, 100, filter),
|
||||
make_tuple(32, 8, 100, filter),
|
||||
};
|
||||
return ::testing::ValuesIn(params);
|
||||
}
|
||||
|
|
@ -113,34 +113,76 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) {
|
|||
int32_t mat[8];
|
||||
int16_t alpha, beta, gamma, delta;
|
||||
ConvolveParams conv_params = get_conv_params(0, 0, 0);
|
||||
|
||||
// Generate an input block and extend its borders horizontally
|
||||
for (i = 0; i < h; ++i)
|
||||
for (j = 0; j < w; ++j) input[i * stride + j] = rnd_.Rand8();
|
||||
for (i = 0; i < h; ++i) {
|
||||
memset(input + i * stride - border, input[i * stride], border);
|
||||
memset(input + i * stride + w, input[i * stride + (w - 1)], border);
|
||||
}
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
int32_t *dsta = new int32_t[output_n];
|
||||
int32_t *dstb = new int32_t[output_n];
|
||||
#endif
|
||||
|
||||
for (i = 0; i < num_iters; ++i) {
|
||||
// Generate an input block and extend its borders horizontally
|
||||
for (int r = 0; r < h; ++r)
|
||||
for (int c = 0; c < w; ++c) input[r * stride + c] = rnd_.Rand8();
|
||||
for (int r = 0; r < h; ++r) {
|
||||
memset(input + r * stride - border, input[r * stride], border);
|
||||
memset(input + r * stride + w, input[r * stride + (w - 1)], border);
|
||||
}
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
const int use_no_round = rnd_.Rand8() & 1;
|
||||
#endif
|
||||
for (sub_x = 0; sub_x < 2; ++sub_x)
|
||||
for (sub_y = 0; sub_y < 2; ++sub_y) {
|
||||
generate_model(mat, &alpha, &beta, &gamma, &delta);
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
if (use_no_round) {
|
||||
// Prepare two copies of the destination
|
||||
for (j = 0; j < out_w * out_h; ++j) {
|
||||
int32_t v = rnd_.Rand16();
|
||||
dsta[j] = v;
|
||||
dstb[j] = v;
|
||||
}
|
||||
conv_params = get_conv_params_no_round(0, 0, 0, dsta, out_w);
|
||||
} else {
|
||||
conv_params = get_conv_params(0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
av1_warp_affine_c(mat, input, w, h, stride, output, 32, 32, out_w,
|
||||
out_h, out_w, sub_x, sub_y, &conv_params, alpha, beta,
|
||||
gamma, delta);
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
if (use_no_round) {
|
||||
conv_params = get_conv_params_no_round(0, 0, 0, dstb, out_w);
|
||||
}
|
||||
#endif
|
||||
test_impl(mat, input, w, h, stride, output2, 32, 32, out_w, out_h,
|
||||
out_w, sub_x, sub_y, &conv_params, alpha, beta, gamma, delta);
|
||||
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
if (use_no_round) {
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(dsta[j], dstb[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w)
|
||||
<< ", " << (j / out_w) << ") on iteration " << i;
|
||||
} else {
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(output[j], output2[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w)
|
||||
<< ", " << (j / out_w) << ") on iteration " << i;
|
||||
}
|
||||
#else
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(output[j], output2[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w)
|
||||
<< ", " << (j / out_w) << ") on iteration " << i;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
delete[] input_;
|
||||
delete[] output;
|
||||
delete[] output2;
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
delete[] dsta;
|
||||
delete[] dstb;
|
||||
#endif
|
||||
}
|
||||
} // namespace AV1WarpFilter
|
||||
|
||||
|
|
@ -149,14 +191,14 @@ namespace AV1HighbdWarpFilter {
|
|||
|
||||
::testing::internal::ParamGenerator<HighbdWarpTestParam> GetDefaultParams() {
|
||||
const HighbdWarpTestParam defaultParams[] = {
|
||||
make_tuple(4, 4, 50000, 8), make_tuple(8, 8, 50000, 8),
|
||||
make_tuple(64, 64, 1000, 8), make_tuple(4, 16, 20000, 8),
|
||||
make_tuple(32, 8, 10000, 8), make_tuple(4, 4, 50000, 10),
|
||||
make_tuple(8, 8, 50000, 10), make_tuple(64, 64, 1000, 10),
|
||||
make_tuple(4, 16, 20000, 10), make_tuple(32, 8, 10000, 10),
|
||||
make_tuple(4, 4, 50000, 12), make_tuple(8, 8, 50000, 12),
|
||||
make_tuple(64, 64, 1000, 12), make_tuple(4, 16, 20000, 12),
|
||||
make_tuple(32, 8, 10000, 12),
|
||||
make_tuple(4, 4, 100, 8), make_tuple(8, 8, 100, 8),
|
||||
make_tuple(64, 64, 100, 8), make_tuple(4, 16, 100, 8),
|
||||
make_tuple(32, 8, 100, 8), make_tuple(4, 4, 100, 10),
|
||||
make_tuple(8, 8, 100, 10), make_tuple(64, 64, 100, 10),
|
||||
make_tuple(4, 16, 100, 10), make_tuple(32, 8, 100, 10),
|
||||
make_tuple(4, 4, 100, 12), make_tuple(8, 8, 100, 12),
|
||||
make_tuple(64, 64, 100, 12), make_tuple(4, 16, 100, 12),
|
||||
make_tuple(32, 8, 100, 12),
|
||||
};
|
||||
return ::testing::ValuesIn(defaultParams);
|
||||
}
|
||||
|
|
@ -250,39 +292,82 @@ void AV1HighbdWarpFilterTest::RunCheckOutput(
|
|||
int32_t mat[8];
|
||||
int16_t alpha, beta, gamma, delta;
|
||||
ConvolveParams conv_params = get_conv_params(0, 0, 0);
|
||||
|
||||
// Generate an input block and extend its borders horizontally
|
||||
for (i = 0; i < h; ++i)
|
||||
for (j = 0; j < w; ++j) input[i * stride + j] = rnd_.Rand16() & mask;
|
||||
for (i = 0; i < h; ++i) {
|
||||
for (j = 0; j < border; ++j) {
|
||||
input[i * stride - border + j] = input[i * stride];
|
||||
input[i * stride + w + j] = input[i * stride + (w - 1)];
|
||||
}
|
||||
}
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
int32_t *dsta = new int32_t[output_n];
|
||||
int32_t *dstb = new int32_t[output_n];
|
||||
#endif
|
||||
|
||||
for (i = 0; i < num_iters; ++i) {
|
||||
// Generate an input block and extend its borders horizontally
|
||||
for (int r = 0; r < h; ++r)
|
||||
for (int c = 0; c < w; ++c) input[r * stride + c] = rnd_.Rand16() & mask;
|
||||
for (int r = 0; r < h; ++r) {
|
||||
for (int c = 0; c < border; ++c) {
|
||||
input[r * stride - border + c] = input[r * stride];
|
||||
input[r * stride + w + c] = input[r * stride + (w - 1)];
|
||||
}
|
||||
}
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
const int use_no_round = rnd_.Rand8() & 1;
|
||||
#endif
|
||||
for (sub_x = 0; sub_x < 2; ++sub_x)
|
||||
for (sub_y = 0; sub_y < 2; ++sub_y) {
|
||||
generate_model(mat, &alpha, &beta, &gamma, &delta);
|
||||
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
if (use_no_round) {
|
||||
// Prepare two copies of the destination
|
||||
for (j = 0; j < out_w * out_h; ++j) {
|
||||
int32_t v = rnd_.Rand16();
|
||||
dsta[j] = v;
|
||||
dstb[j] = v;
|
||||
}
|
||||
conv_params = get_conv_params_no_round(0, 0, 0, dsta, out_w);
|
||||
} else {
|
||||
conv_params = get_conv_params(0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
av1_highbd_warp_affine_c(mat, input, w, h, stride, output, 32, 32,
|
||||
out_w, out_h, out_w, sub_x, sub_y, bd,
|
||||
&conv_params, alpha, beta, gamma, delta);
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
if (use_no_round) {
|
||||
// TODO(angiebird): Change this to test_impl once we have SIMD
|
||||
// implementation
|
||||
conv_params = get_conv_params_no_round(0, 0, 0, dstb, out_w);
|
||||
}
|
||||
#endif
|
||||
test_impl(mat, input, w, h, stride, output2, 32, 32, out_w, out_h,
|
||||
out_w, sub_x, sub_y, bd, &conv_params, alpha, beta, gamma,
|
||||
delta);
|
||||
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
if (use_no_round) {
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(dsta[j], dstb[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w)
|
||||
<< ", " << (j / out_w) << ") on iteration " << i;
|
||||
} else {
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(output[j], output2[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w)
|
||||
<< ", " << (j / out_w) << ") on iteration " << i;
|
||||
}
|
||||
#else
|
||||
for (j = 0; j < out_w * out_h; ++j)
|
||||
ASSERT_EQ(output[j], output2[j])
|
||||
<< "Pixel mismatch at index " << j << " = (" << (j % out_w)
|
||||
<< ", " << (j / out_w) << ") on iteration " << i;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
delete[] input_;
|
||||
delete[] output;
|
||||
delete[] output2;
|
||||
#if CONFIG_CONVOLVE_ROUND
|
||||
delete[] dsta;
|
||||
delete[] dstb;
|
||||
#endif
|
||||
}
|
||||
} // namespace AV1HighbdWarpFilter
|
||||
#endif // CONFIG_HIGHBITDEPTH
|
||||
|
|
|
|||
4
third_party/aom/test/webm_video_source.h
vendored
4
third_party/aom/test/webm_video_source.h
vendored
|
|
@ -41,8 +41,8 @@ class WebMVideoSource : public CompressedVideoSource {
|
|||
|
||||
virtual void Begin() {
|
||||
aom_ctx_->file = OpenTestDataFile(file_name_);
|
||||
ASSERT_TRUE(aom_ctx_->file != NULL) << "Input file open failed. Filename: "
|
||||
<< file_name_;
|
||||
ASSERT_TRUE(aom_ctx_->file != NULL)
|
||||
<< "Input file open failed. Filename: " << file_name_;
|
||||
|
||||
ASSERT_EQ(file_is_webm(webm_ctx_, aom_ctx_), 1) << "file is not WebM";
|
||||
|
||||
|
|
|
|||
4
third_party/aom/test/y4m_video_source.h
vendored
4
third_party/aom/test/y4m_video_source.h
vendored
|
|
@ -35,8 +35,8 @@ class Y4mVideoSource : public VideoSource {
|
|||
virtual void OpenSource() {
|
||||
CloseSource();
|
||||
input_file_ = OpenTestDataFile(file_name_);
|
||||
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
|
||||
<< file_name_;
|
||||
ASSERT_TRUE(input_file_ != NULL)
|
||||
<< "Input file open failed. Filename: " << file_name_;
|
||||
}
|
||||
|
||||
virtual void ReadSourceToStart() {
|
||||
|
|
|
|||
4
third_party/aom/test/yuv_video_source.h
vendored
4
third_party/aom/test/yuv_video_source.h
vendored
|
|
@ -44,8 +44,8 @@ class YUVVideoSource : public VideoSource {
|
|||
virtual void Begin() {
|
||||
if (input_file_) fclose(input_file_);
|
||||
input_file_ = OpenTestDataFile(file_name_);
|
||||
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
|
||||
<< file_name_;
|
||||
ASSERT_TRUE(input_file_ != NULL)
|
||||
<< "Input file open failed. Filename: " << file_name_;
|
||||
if (start_)
|
||||
fseek(input_file_, static_cast<unsigned>(raw_size_) * start_, SEEK_SET);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue