2012-08-03 04:03:14 +04:00
|
|
|
/*
|
2016-09-02 22:04:54 +03:00
|
|
|
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
|
2012-08-03 04:03:14 +04:00
|
|
|
*
|
2016-09-02 22:04:54 +03:00
|
|
|
* 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.
|
|
|
|
*/
|
2012-08-03 04:03:14 +04:00
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
2015-07-30 00:51:36 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "./av1_rtcd.h"
|
|
|
|
#include "./aom_dsp_rtcd.h"
|
2013-09-05 23:44:03 +04:00
|
|
|
#include "test/acm_random.h"
|
|
|
|
#include "test/clear_system_state.h"
|
|
|
|
#include "test/register_state_check.h"
|
|
|
|
#include "test/util.h"
|
2016-08-23 02:08:15 +03:00
|
|
|
#include "av1/common/entropy.h"
|
|
|
|
#include "av1/common/scan.h"
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "aom/aom_codec.h"
|
|
|
|
#include "aom/aom_integer.h"
|
2016-08-23 02:08:15 +03:00
|
|
|
#include "aom_ports/mem.h"
|
|
|
|
#include "aom_ports/msvc.h" // for round()
|
2014-01-19 01:03:31 +04:00
|
|
|
|
2016-08-23 02:08:15 +03:00
|
|
|
using libaom_test::ACMRandom;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
|
|
|
namespace {
|
2013-02-05 03:22:55 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
const int kNumCoeffs = 256;
|
|
|
|
const double C1 = 0.995184726672197;
|
|
|
|
const double C2 = 0.98078528040323;
|
|
|
|
const double C3 = 0.956940335732209;
|
|
|
|
const double C4 = 0.923879532511287;
|
|
|
|
const double C5 = 0.881921264348355;
|
|
|
|
const double C6 = 0.831469612302545;
|
|
|
|
const double C7 = 0.773010453362737;
|
|
|
|
const double C8 = 0.707106781186548;
|
|
|
|
const double C9 = 0.634393284163646;
|
|
|
|
const double C10 = 0.555570233019602;
|
|
|
|
const double C11 = 0.471396736825998;
|
|
|
|
const double C12 = 0.38268343236509;
|
|
|
|
const double C13 = 0.290284677254462;
|
|
|
|
const double C14 = 0.195090322016128;
|
|
|
|
const double C15 = 0.098017140329561;
|
2012-08-08 00:55:49 +04:00
|
|
|
|
2013-08-28 04:03:46 +04:00
|
|
|
void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
2012-08-03 04:03:14 +04:00
|
|
|
double step[16];
|
|
|
|
double intermediate[16];
|
|
|
|
double temp1, temp2;
|
|
|
|
|
|
|
|
// step 1
|
2016-08-12 03:46:05 +03:00
|
|
|
step[0] = input[0] + input[15];
|
|
|
|
step[1] = input[1] + input[14];
|
|
|
|
step[2] = input[2] + input[13];
|
|
|
|
step[3] = input[3] + input[12];
|
|
|
|
step[4] = input[4] + input[11];
|
|
|
|
step[5] = input[5] + input[10];
|
|
|
|
step[6] = input[6] + input[9];
|
|
|
|
step[7] = input[7] + input[8];
|
|
|
|
step[8] = input[7] - input[8];
|
|
|
|
step[9] = input[6] - input[9];
|
2012-08-03 04:03:14 +04:00
|
|
|
step[10] = input[5] - input[10];
|
|
|
|
step[11] = input[4] - input[11];
|
|
|
|
step[12] = input[3] - input[12];
|
|
|
|
step[13] = input[2] - input[13];
|
|
|
|
step[14] = input[1] - input[14];
|
|
|
|
step[15] = input[0] - input[15];
|
|
|
|
|
|
|
|
// step 2
|
|
|
|
output[0] = step[0] + step[7];
|
|
|
|
output[1] = step[1] + step[6];
|
|
|
|
output[2] = step[2] + step[5];
|
|
|
|
output[3] = step[3] + step[4];
|
|
|
|
output[4] = step[3] - step[4];
|
|
|
|
output[5] = step[2] - step[5];
|
|
|
|
output[6] = step[1] - step[6];
|
|
|
|
output[7] = step[0] - step[7];
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
temp1 = step[8] * C7;
|
2013-09-05 23:44:03 +04:00
|
|
|
temp2 = step[15] * C9;
|
2016-08-12 03:46:05 +03:00
|
|
|
output[8] = temp1 + temp2;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
temp1 = step[9] * C11;
|
2013-09-05 23:44:03 +04:00
|
|
|
temp2 = step[14] * C5;
|
2016-08-12 03:46:05 +03:00
|
|
|
output[9] = temp1 - temp2;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = step[10] * C3;
|
|
|
|
temp2 = step[13] * C13;
|
2012-08-03 04:03:14 +04:00
|
|
|
output[10] = temp1 + temp2;
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = step[11] * C15;
|
|
|
|
temp2 = step[12] * C1;
|
2012-08-03 04:03:14 +04:00
|
|
|
output[11] = temp1 - temp2;
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = step[11] * C1;
|
|
|
|
temp2 = step[12] * C15;
|
2012-08-03 04:03:14 +04:00
|
|
|
output[12] = temp2 + temp1;
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = step[10] * C13;
|
|
|
|
temp2 = step[13] * C3;
|
2012-08-03 04:03:14 +04:00
|
|
|
output[13] = temp2 - temp1;
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
temp1 = step[9] * C5;
|
2013-09-05 23:44:03 +04:00
|
|
|
temp2 = step[14] * C11;
|
2012-08-03 04:03:14 +04:00
|
|
|
output[14] = temp2 + temp1;
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
temp1 = step[8] * C9;
|
2013-09-05 23:44:03 +04:00
|
|
|
temp2 = step[15] * C7;
|
2012-08-03 04:03:14 +04:00
|
|
|
output[15] = temp2 - temp1;
|
|
|
|
|
|
|
|
// step 3
|
2016-08-12 03:46:05 +03:00
|
|
|
step[0] = output[0] + output[3];
|
|
|
|
step[1] = output[1] + output[2];
|
|
|
|
step[2] = output[1] - output[2];
|
|
|
|
step[3] = output[0] - output[3];
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = output[4] * C14;
|
|
|
|
temp2 = output[7] * C2;
|
2016-08-12 03:46:05 +03:00
|
|
|
step[4] = temp1 + temp2;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = output[5] * C10;
|
|
|
|
temp2 = output[6] * C6;
|
2016-08-12 03:46:05 +03:00
|
|
|
step[5] = temp1 + temp2;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = output[5] * C6;
|
|
|
|
temp2 = output[6] * C10;
|
2016-08-12 03:46:05 +03:00
|
|
|
step[6] = temp2 - temp1;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = output[4] * C2;
|
|
|
|
temp2 = output[7] * C14;
|
2016-08-12 03:46:05 +03:00
|
|
|
step[7] = temp2 - temp1;
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
step[8] = output[8] + output[11];
|
|
|
|
step[9] = output[9] + output[10];
|
|
|
|
step[10] = output[9] - output[10];
|
|
|
|
step[11] = output[8] - output[11];
|
2012-08-03 04:03:14 +04:00
|
|
|
|
|
|
|
step[12] = output[12] + output[15];
|
|
|
|
step[13] = output[13] + output[14];
|
|
|
|
step[14] = output[13] - output[14];
|
|
|
|
step[15] = output[12] - output[15];
|
|
|
|
|
|
|
|
// step 4
|
2016-08-12 03:46:05 +03:00
|
|
|
output[0] = (step[0] + step[1]);
|
|
|
|
output[8] = (step[0] - step[1]);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = step[2] * C12;
|
|
|
|
temp2 = step[3] * C4;
|
2012-08-03 04:03:14 +04:00
|
|
|
temp1 = temp1 + temp2;
|
2016-08-12 03:46:05 +03:00
|
|
|
output[4] = 2 * (temp1 * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = step[2] * C4;
|
|
|
|
temp2 = step[3] * C12;
|
2012-08-03 04:03:14 +04:00
|
|
|
temp1 = temp2 - temp1;
|
2013-09-05 23:44:03 +04:00
|
|
|
output[12] = 2 * (temp1 * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
output[2] = 2 * ((step[4] + step[5]) * C8);
|
|
|
|
output[14] = 2 * ((step[7] - step[6]) * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
|
|
|
temp1 = step[4] - step[5];
|
|
|
|
temp2 = step[6] + step[7];
|
2016-08-12 03:46:05 +03:00
|
|
|
output[6] = (temp1 + temp2);
|
2012-08-03 04:03:14 +04:00
|
|
|
output[10] = (temp1 - temp2);
|
|
|
|
|
|
|
|
intermediate[8] = step[8] + step[14];
|
|
|
|
intermediate[9] = step[9] + step[15];
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = intermediate[8] * C12;
|
|
|
|
temp2 = intermediate[9] * C4;
|
2012-08-03 04:03:14 +04:00
|
|
|
temp1 = temp1 - temp2;
|
2013-09-05 23:44:03 +04:00
|
|
|
output[3] = 2 * (temp1 * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = intermediate[8] * C4;
|
|
|
|
temp2 = intermediate[9] * C12;
|
2012-08-03 04:03:14 +04:00
|
|
|
temp1 = temp2 + temp1;
|
2013-09-05 23:44:03 +04:00
|
|
|
output[13] = 2 * (temp1 * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
output[9] = 2 * ((step[10] + step[11]) * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
|
|
|
intermediate[11] = step[10] - step[11];
|
|
|
|
intermediate[12] = step[12] + step[13];
|
|
|
|
intermediate[13] = step[12] - step[13];
|
2016-08-12 03:46:05 +03:00
|
|
|
intermediate[14] = step[8] - step[14];
|
|
|
|
intermediate[15] = step[9] - step[15];
|
2012-08-03 04:03:14 +04:00
|
|
|
|
|
|
|
output[15] = (intermediate[11] + intermediate[12]);
|
2016-08-12 03:46:05 +03:00
|
|
|
output[1] = -(intermediate[11] - intermediate[12]);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
output[7] = 2 * (intermediate[13] * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = intermediate[14] * C12;
|
|
|
|
temp2 = intermediate[15] * C4;
|
2012-08-03 04:03:14 +04:00
|
|
|
temp1 = temp1 - temp2;
|
2013-09-05 23:44:03 +04:00
|
|
|
output[11] = -2 * (temp1 * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
temp1 = intermediate[14] * C4;
|
|
|
|
temp2 = intermediate[15] * C12;
|
2012-08-03 04:03:14 +04:00
|
|
|
temp1 = temp2 + temp1;
|
2016-08-12 03:46:05 +03:00
|
|
|
output[5] = 2 * (temp1 * C8);
|
2012-08-03 04:03:14 +04:00
|
|
|
}
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
|
2012-08-03 04:03:14 +04:00
|
|
|
// First transform columns
|
|
|
|
for (int i = 0; i < 16; ++i) {
|
|
|
|
double temp_in[16], temp_out[16];
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < 16; ++j) temp_in[j] = input[j * 16 + i];
|
2012-08-03 04:03:14 +04:00
|
|
|
butterfly_16x16_dct_1d(temp_in, temp_out);
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < 16; ++j) output[j * 16 + i] = temp_out[j];
|
2012-08-03 04:03:14 +04:00
|
|
|
}
|
|
|
|
// Then transform rows
|
|
|
|
for (int i = 0; i < 16; ++i) {
|
|
|
|
double temp_in[16], temp_out[16];
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < 16; ++j) temp_in[j] = output[j + i * 16];
|
2012-08-03 04:03:14 +04:00
|
|
|
butterfly_16x16_dct_1d(temp_in, temp_out);
|
|
|
|
// Scale by some magic number
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < 16; ++j) output[j + i * 16] = temp_out[j] / 2;
|
2012-08-03 04:03:14 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
|
|
|
|
typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
|
|
|
|
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
|
2014-07-17 05:53:33 +04:00
|
|
|
int tx_type);
|
2014-09-03 03:34:09 +04:00
|
|
|
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
|
2014-07-17 05:53:33 +04:00
|
|
|
int tx_type);
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
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>
|
2014-10-24 11:48:02 +04:00
|
|
|
Idct16x16Param;
|
2013-11-19 05:07:55 +04:00
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
2014-08-22 23:11:42 +04:00
|
|
|
int /*tx_type*/) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_fdct16x16_c(in, out, stride);
|
2013-09-10 04:07:55 +04:00
|
|
|
}
|
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
2014-08-22 23:11:42 +04:00
|
|
|
int /*tx_type*/) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_c(in, dest, stride);
|
2014-05-29 23:50:54 +04:00
|
|
|
}
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
2016-08-31 00:01:10 +03:00
|
|
|
av1_fht16x16_c(in, out, stride, tx_type);
|
2013-09-10 04:07:55 +04:00
|
|
|
}
|
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
|
|
|
int tx_type) {
|
2016-08-31 00:01:10 +03:00
|
|
|
av1_iht16x16_256_add_c(in, dest, stride, tx_type);
|
2014-05-29 23:50:54 +04:00
|
|
|
}
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_256_add_c(in, out, stride, 10);
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_256_add_c(in, out, stride, 12);
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
|
2016-07-14 22:33:48 +03:00
|
|
|
int /*tx_type*/) {
|
2014-09-03 03:34:09 +04:00
|
|
|
idct16x16_10(in, out, stride);
|
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
|
2016-07-14 22:33:48 +03:00
|
|
|
int /*tx_type*/) {
|
2014-09-03 03:34:09 +04:00
|
|
|
idct16x16_12(in, out, stride);
|
|
|
|
}
|
|
|
|
|
|
|
|
void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
2016-08-31 00:01:10 +03:00
|
|
|
av1_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10);
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
2016-08-31 00:01:10 +03:00
|
|
|
av1_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12);
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
2014-10-24 11:48:02 +04:00
|
|
|
|
2016-02-03 06:42:19 +03:00
|
|
|
#if HAVE_SSE2
|
2014-10-24 11:48:02 +04:00
|
|
|
void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_10_add_c(in, out, stride, 10);
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_10_add_c(in, out, stride, 12);
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_256_add_sse2(in, out, stride, 10);
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_256_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_256_add_sse2(in, out, stride, 12);
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_10_add_sse2(in, out, stride, 10);
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
#endif // HAVE_SSE2
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
class Trans16x16TestBase {
|
2013-07-10 03:16:49 +04:00
|
|
|
public:
|
2013-09-05 23:44:03 +04:00
|
|
|
virtual ~Trans16x16TestBase() {}
|
2013-07-10 03:16:49 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
protected:
|
2014-09-03 03:34:09 +04:00
|
|
|
virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0;
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
virtual void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) = 0;
|
2013-09-05 23:44:03 +04:00
|
|
|
|
|
|
|
void RunAccuracyCheck() {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
2013-09-10 04:07:55 +04:00
|
|
|
uint32_t max_error = 0;
|
|
|
|
int64_t total_error = 0;
|
2013-09-05 23:44:03 +04:00
|
|
|
const int count_test_block = 10000;
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
|
2014-09-03 03:34:09 +04:00
|
|
|
#endif
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
2013-09-05 23:44:03 +04:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2014-09-03 03:34:09 +04:00
|
|
|
src[j] = rnd.Rand8();
|
|
|
|
dst[j] = rnd.Rand8();
|
|
|
|
test_input_block[j] = src[j] - dst[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
} else {
|
|
|
|
src16[j] = rnd.Rand16() & mask_;
|
|
|
|
dst16[j] = rnd.Rand16() & mask_;
|
|
|
|
test_input_block[j] = src16[j] - dst16[j];
|
|
|
|
#endif
|
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunFwdTxfm(test_input_block, test_temp_block, pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
} else {
|
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
|
|
|
|
#endif
|
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-06-01 02:54:58 +03:00
|
|
|
const int32_t diff =
|
2016-08-31 00:01:10 +03:00
|
|
|
bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
2014-09-03 03:34:09 +04:00
|
|
|
#else
|
2016-06-01 02:54:58 +03:00
|
|
|
const int32_t diff = dst[j] - src[j];
|
2014-09-03 03:34:09 +04:00
|
|
|
#endif
|
2013-09-10 04:07:55 +04:00
|
|
|
const uint32_t error = diff * diff;
|
2016-08-12 03:46:05 +03:00
|
|
|
if (max_error < error) max_error = error;
|
2013-09-05 23:44:03 +04:00
|
|
|
total_error += error;
|
|
|
|
}
|
2013-05-15 21:16:02 +04:00
|
|
|
}
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
|
2013-09-05 23:44:03 +04:00
|
|
|
<< "Error: 16x16 FHT/IHT has an individual round trip error > 1";
|
|
|
|
|
2014-09-03 03:34:09 +04:00
|
|
|
EXPECT_GE(count_test_block << 2 * (bit_depth_ - 8), total_error)
|
2013-09-05 23:44:03 +04:00
|
|
|
<< "Error: 16x16 FHT/IHT has average round trip error > 1 per block";
|
2013-07-10 03:16:49 +04:00
|
|
|
}
|
|
|
|
|
2013-09-10 04:07:55 +04:00
|
|
|
void RunCoeffCheck() {
|
2013-09-05 23:44:03 +04:00
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 1000;
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
|
2013-09-10 04:07:55 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
2014-09-03 03:34:09 +04:00
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
2013-09-10 04:07:55 +04:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j)
|
2014-09-03 03:34:09 +04:00
|
|
|
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
|
2013-09-10 04:07:55 +04:00
|
|
|
|
|
|
|
fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
|
2014-07-10 08:02:02 +04:00
|
|
|
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
|
2013-09-10 04:07:55 +04:00
|
|
|
|
|
|
|
// The minimum quant value is 4.
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j)
|
|
|
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RunMemCheck() {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 1000;
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
|
2013-05-15 21:16:02 +04:00
|
|
|
|
2013-09-10 04:07:55 +04:00
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
2014-09-03 03:34:09 +04:00
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
2013-09-05 23:44:03 +04:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2014-09-03 03:34:09 +04:00
|
|
|
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
2014-06-03 03:40:01 +04:00
|
|
|
if (i == 0) {
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
|
2014-06-03 03:40:01 +04:00
|
|
|
} else if (i == 1) {
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
|
2014-06-03 03:40:01 +04:00
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2013-09-10 04:07:55 +04:00
|
|
|
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunFwdTxfm(input_extreme_block, output_block, pitch_));
|
2013-09-05 23:44:03 +04:00
|
|
|
|
|
|
|
// The minimum quant value is 4.
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2013-09-10 04:07:55 +04:00
|
|
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
2014-09-03 03:34:09 +04:00
|
|
|
EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j]))
|
2013-09-05 23:44:03 +04:00
|
|
|
<< "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
|
|
|
|
}
|
2013-07-11 20:37:25 +04:00
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
|
|
|
|
2014-05-29 23:50:54 +04:00
|
|
|
void RunQuantCheck(int dc_thred, int ac_thred) {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
2014-10-06 21:18:17 +04:00
|
|
|
const int count_test_block = 100000;
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
|
2014-05-29 23:50:54 +04:00
|
|
|
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
|
2014-09-03 03:34:09 +04:00
|
|
|
#endif
|
2014-05-29 23:50:54 +04:00
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
2014-09-03 03:34:09 +04:00
|
|
|
// Initialize a test block with input range [-mask_, mask_].
|
2014-05-29 23:50:54 +04:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2014-09-03 03:34:09 +04:00
|
|
|
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
|
2014-05-29 23:50:54 +04:00
|
|
|
}
|
|
|
|
if (i == 0)
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
|
2014-05-29 23:50:54 +04:00
|
|
|
if (i == 1)
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
|
2014-05-29 23:50:54 +04:00
|
|
|
|
|
|
|
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
|
|
|
|
|
|
|
|
// clear reconstructed pixel buffers
|
2015-04-24 06:47:40 +03:00
|
|
|
memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
|
|
|
|
memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2015-04-24 06:47:40 +03:00
|
|
|
memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
|
|
|
|
memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
|
2014-09-03 03:34:09 +04:00
|
|
|
#endif
|
2014-05-29 23:50:54 +04:00
|
|
|
|
|
|
|
// quantization with maximum allowed step sizes
|
|
|
|
output_ref_block[0] = (output_ref_block[0] / dc_thred) * dc_thred;
|
|
|
|
for (int j = 1; j < kNumCoeffs; ++j)
|
|
|
|
output_ref_block[j] = (output_ref_block[j] / ac_thred) * ac_thred;
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2014-09-03 03:34:09 +04:00
|
|
|
inv_txfm_ref(output_ref_block, ref, pitch_, tx_type_);
|
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
} else {
|
|
|
|
inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
|
|
|
|
tx_type_);
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
|
2014-09-03 03:34:09 +04:00
|
|
|
#endif
|
|
|
|
}
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref[j], dst[j]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
} else {
|
2016-08-12 03:46:05 +03:00
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref16[j], dst16[j]);
|
2014-09-03 03:34:09 +04:00
|
|
|
#endif
|
|
|
|
}
|
2014-05-29 23:50:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
void RunInvAccuracyCheck() {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 1000;
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
|
|
|
double out_r[kNumCoeffs];
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
// Initialize a test block with input range [-255, 255].
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2014-09-03 03:34:09 +04:00
|
|
|
src[j] = rnd.Rand8();
|
|
|
|
dst[j] = rnd.Rand8();
|
|
|
|
in[j] = src[j] - dst[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
} else {
|
|
|
|
src16[j] = rnd.Rand16() & mask_;
|
|
|
|
dst16[j] = rnd.Rand16() & mask_;
|
|
|
|
in[j] = src16[j] - dst16[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
reference_16x16_dct_2d(in, out_r);
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j)
|
2014-10-24 11:48:02 +04:00
|
|
|
coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2014-09-03 03:34:09 +04:00
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
} else {
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), 16));
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-10-24 19:21:09 +03:00
|
|
|
const int diff =
|
2016-08-31 00:01:10 +03:00
|
|
|
bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
2014-09-03 03:34:09 +04:00
|
|
|
#else
|
2016-10-24 19:21:09 +03:00
|
|
|
const int diff = dst[j] - src[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2013-09-10 04:07:55 +04:00
|
|
|
const uint32_t error = diff * diff;
|
2016-08-12 03:46:05 +03:00
|
|
|
EXPECT_GE(1u, error) << "Error: 16x16 IDCT has error " << error
|
|
|
|
<< " at index " << j;
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
2012-08-03 04:03:14 +04:00
|
|
|
}
|
|
|
|
}
|
2014-10-24 11:48:02 +04:00
|
|
|
|
|
|
|
void CompareInvReference(IdctFunc ref_txfm, int thresh) {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
const int count_test_block = 10000;
|
|
|
|
const int eob = 10;
|
2016-08-31 00:01:10 +03:00
|
|
|
const int16_t *scan = av1_default_scan_orders[TX_16X16].scan;
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2015-05-02 23:24:16 +03:00
|
|
|
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-10-24 11:48:02 +04:00
|
|
|
|
|
|
|
for (int i = 0; i < count_test_block; ++i) {
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
|
|
|
if (j < eob) {
|
|
|
|
// Random values less than the threshold, either positive or negative
|
|
|
|
coeff[scan[j]] = rnd(thresh) * (1 - 2 * (i % 2));
|
|
|
|
} else {
|
|
|
|
coeff[scan[j]] = 0;
|
|
|
|
}
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2014-10-24 11:48:02 +04:00
|
|
|
dst[j] = 0;
|
|
|
|
ref[j] = 0;
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-10-24 11:48:02 +04:00
|
|
|
} else {
|
|
|
|
dst16[j] = 0;
|
|
|
|
ref16[j] = 0;
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
}
|
2016-08-31 00:01:10 +03:00
|
|
|
if (bit_depth_ == AOM_BITS_8) {
|
2014-10-24 11:48:02 +04:00
|
|
|
ref_txfm(coeff, ref, pitch_);
|
|
|
|
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
|
|
|
|
} else {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-10-24 11:48:02 +04:00
|
|
|
ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
|
2016-08-12 03:46:05 +03:00
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-10-24 19:21:09 +03:00
|
|
|
const int diff =
|
2016-08-31 00:01:10 +03:00
|
|
|
bit_depth_ == AOM_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
|
2014-10-24 11:48:02 +04:00
|
|
|
#else
|
2016-10-24 19:21:09 +03:00
|
|
|
const int diff = dst[j] - ref[j];
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-10-24 11:48:02 +04:00
|
|
|
const uint32_t error = diff * diff;
|
2016-08-12 03:46:05 +03:00
|
|
|
EXPECT_EQ(0u, error) << "Error: 16x16 IDCT Comparison has error "
|
|
|
|
<< error << " at index " << j;
|
2014-10-24 11:48:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-10 04:07:55 +04:00
|
|
|
int pitch_;
|
|
|
|
int tx_type_;
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_bit_depth_t bit_depth_;
|
2014-09-03 03:34:09 +04:00
|
|
|
int mask_;
|
2014-07-17 05:53:33 +04:00
|
|
|
FhtFunc fwd_txfm_ref;
|
|
|
|
IhtFunc inv_txfm_ref;
|
2013-09-05 23:44:03 +04:00
|
|
|
};
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
class Trans16x16DCT : public Trans16x16TestBase,
|
|
|
|
public ::testing::TestWithParam<Dct16x16Param> {
|
2013-09-05 23:44:03 +04:00
|
|
|
public:
|
|
|
|
virtual ~Trans16x16DCT() {}
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
virtual void SetUp() {
|
|
|
|
fwd_txfm_ = GET_PARAM(0);
|
|
|
|
inv_txfm_ = GET_PARAM(1);
|
2016-08-12 03:46:05 +03:00
|
|
|
tx_type_ = GET_PARAM(2);
|
2014-09-03 03:34:09 +04:00
|
|
|
bit_depth_ = GET_PARAM(3);
|
2016-08-12 03:46:05 +03:00
|
|
|
pitch_ = 16;
|
2013-09-10 04:07:55 +04:00
|
|
|
fwd_txfm_ref = fdct16x16_ref;
|
2014-05-29 23:50:54 +04:00
|
|
|
inv_txfm_ref = idct16x16_ref;
|
2014-09-03 03:34:09 +04:00
|
|
|
mask_ = (1 << bit_depth_) - 1;
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
switch (bit_depth_) {
|
2016-08-31 00:01:10 +03:00
|
|
|
case AOM_BITS_10: inv_txfm_ref = idct16x16_10_ref; break;
|
|
|
|
case AOM_BITS_12: inv_txfm_ref = idct16x16_12_ref; break;
|
2016-08-12 03:46:05 +03:00
|
|
|
default: inv_txfm_ref = idct16x16_ref; break;
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
inv_txfm_ref = idct16x16_ref;
|
|
|
|
#endif
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
2016-08-23 02:08:15 +03:00
|
|
|
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
2012-08-03 04:03:14 +04:00
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
protected:
|
2014-09-03 03:34:09 +04:00
|
|
|
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
|
2013-09-05 23:44:03 +04:00
|
|
|
fwd_txfm_(in, out, stride);
|
|
|
|
}
|
2014-09-03 03:34:09 +04:00
|
|
|
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
|
2013-10-18 22:49:33 +04:00
|
|
|
inv_txfm_(out, dst, stride);
|
2012-08-03 04:03:14 +04:00
|
|
|
}
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2014-07-17 05:53:33 +04:00
|
|
|
FdctFunc fwd_txfm_;
|
|
|
|
IdctFunc inv_txfm_;
|
2013-09-05 23:44:03 +04:00
|
|
|
};
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16DCT, AccuracyCheck) { RunAccuracyCheck(); }
|
2013-07-10 03:16:49 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16DCT, CoeffCheck) { RunCoeffCheck(); }
|
2013-09-10 04:07:55 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16DCT, MemCheck) { RunMemCheck(); }
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2014-05-29 23:50:54 +04:00
|
|
|
TEST_P(Trans16x16DCT, QuantCheck) {
|
|
|
|
// Use maximally allowed quantization step sizes for DC and AC
|
|
|
|
// coefficients respectively.
|
|
|
|
RunQuantCheck(1336, 1828);
|
|
|
|
}
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
class Trans16x16HT : public Trans16x16TestBase,
|
|
|
|
public ::testing::TestWithParam<Ht16x16Param> {
|
2013-09-05 23:44:03 +04:00
|
|
|
public:
|
|
|
|
virtual ~Trans16x16HT() {}
|
|
|
|
|
|
|
|
virtual void SetUp() {
|
|
|
|
fwd_txfm_ = GET_PARAM(0);
|
|
|
|
inv_txfm_ = GET_PARAM(1);
|
2016-08-12 03:46:05 +03:00
|
|
|
tx_type_ = GET_PARAM(2);
|
2014-09-03 03:34:09 +04:00
|
|
|
bit_depth_ = GET_PARAM(3);
|
2016-08-12 03:46:05 +03:00
|
|
|
pitch_ = 16;
|
2013-09-10 04:07:55 +04:00
|
|
|
fwd_txfm_ref = fht16x16_ref;
|
2014-05-29 23:50:54 +04:00
|
|
|
inv_txfm_ref = iht16x16_ref;
|
2014-09-03 03:34:09 +04:00
|
|
|
mask_ = (1 << bit_depth_) - 1;
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
switch (bit_depth_) {
|
2016-08-31 00:01:10 +03:00
|
|
|
case AOM_BITS_10: inv_txfm_ref = iht16x16_10; break;
|
|
|
|
case AOM_BITS_12: inv_txfm_ref = iht16x16_12; break;
|
2016-08-12 03:46:05 +03:00
|
|
|
default: inv_txfm_ref = iht16x16_ref; break;
|
2014-09-03 03:34:09 +04:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
inv_txfm_ref = iht16x16_ref;
|
|
|
|
#endif
|
2013-07-10 03:16:49 +04:00
|
|
|
}
|
2016-08-23 02:08:15 +03:00
|
|
|
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
2013-09-05 23:44:03 +04:00
|
|
|
|
|
|
|
protected:
|
2014-09-03 03:34:09 +04:00
|
|
|
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
|
2013-09-10 04:07:55 +04:00
|
|
|
fwd_txfm_(in, out, stride, tx_type_);
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
2014-09-03 03:34:09 +04:00
|
|
|
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
|
2013-09-10 04:07:55 +04:00
|
|
|
inv_txfm_(out, dst, stride, tx_type_);
|
2013-09-05 23:44:03 +04:00
|
|
|
}
|
|
|
|
|
2014-07-17 05:53:33 +04:00
|
|
|
FhtFunc fwd_txfm_;
|
|
|
|
IhtFunc inv_txfm_;
|
2013-09-05 23:44:03 +04:00
|
|
|
};
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(); }
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
|
2013-09-10 04:07:55 +04:00
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
TEST_P(Trans16x16HT, MemCheck) { RunMemCheck(); }
|
2013-07-10 03:16:49 +04:00
|
|
|
|
2014-05-29 23:50:54 +04:00
|
|
|
TEST_P(Trans16x16HT, QuantCheck) {
|
|
|
|
// The encoder skips any non-DC intra prediction modes,
|
|
|
|
// when the quantization step size goes beyond 988.
|
2014-10-06 21:18:17 +04:00
|
|
|
RunQuantCheck(429, 729);
|
2014-05-29 23:50:54 +04:00
|
|
|
}
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
class InvTrans16x16DCT : public Trans16x16TestBase,
|
|
|
|
public ::testing::TestWithParam<Idct16x16Param> {
|
2014-10-24 11:48:02 +04:00
|
|
|
public:
|
|
|
|
virtual ~InvTrans16x16DCT() {}
|
|
|
|
|
|
|
|
virtual void SetUp() {
|
|
|
|
ref_txfm_ = GET_PARAM(0);
|
|
|
|
inv_txfm_ = GET_PARAM(1);
|
|
|
|
thresh_ = GET_PARAM(2);
|
|
|
|
bit_depth_ = GET_PARAM(3);
|
|
|
|
pitch_ = 16;
|
|
|
|
mask_ = (1 << bit_depth_) - 1;
|
2016-08-12 03:46:05 +03:00
|
|
|
}
|
2016-08-23 02:08:15 +03:00
|
|
|
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
2014-10-24 11:48:02 +04:00
|
|
|
|
|
|
|
protected:
|
2016-07-14 22:33:48 +03:00
|
|
|
void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/, int /*stride*/) {}
|
2014-10-24 11:48:02 +04:00
|
|
|
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
|
|
|
|
inv_txfm_(out, dst, stride);
|
|
|
|
}
|
|
|
|
|
|
|
|
IdctFunc ref_txfm_;
|
|
|
|
IdctFunc inv_txfm_;
|
|
|
|
int thresh_;
|
|
|
|
};
|
|
|
|
|
|
|
|
TEST_P(InvTrans16x16DCT, CompareReference) {
|
|
|
|
CompareInvReference(ref_txfm_, thresh_);
|
|
|
|
}
|
|
|
|
|
2016-08-12 03:46:05 +03:00
|
|
|
class PartialTrans16x16Test : public ::testing::TestWithParam<
|
2016-08-31 00:01:10 +03:00
|
|
|
std::tr1::tuple<FdctFunc, aom_bit_depth_t> > {
|
2016-03-30 07:04:38 +03:00
|
|
|
public:
|
|
|
|
virtual ~PartialTrans16x16Test() {}
|
|
|
|
virtual void SetUp() {
|
|
|
|
fwd_txfm_ = GET_PARAM(0);
|
|
|
|
bit_depth_ = GET_PARAM(1);
|
|
|
|
}
|
|
|
|
|
2016-08-23 02:08:15 +03:00
|
|
|
virtual void TearDown() { libaom_test::ClearSystemState(); }
|
2016-03-30 07:04:38 +03:00
|
|
|
|
|
|
|
protected:
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_bit_depth_t bit_depth_;
|
2016-03-30 07:04:38 +03:00
|
|
|
FdctFunc fwd_txfm_;
|
|
|
|
};
|
|
|
|
|
|
|
|
TEST_P(PartialTrans16x16Test, Extremes) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-03-30 07:04:38 +03:00
|
|
|
const int16_t maxval =
|
|
|
|
static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
|
|
|
|
#else
|
|
|
|
const int16_t maxval = 255;
|
|
|
|
#endif
|
|
|
|
const int minval = -maxval;
|
|
|
|
DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
|
|
|
|
|
|
|
|
for (int i = 0; i < kNumCoeffs; ++i) input[i] = maxval;
|
|
|
|
output[0] = 0;
|
|
|
|
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
|
|
|
|
EXPECT_EQ((maxval * kNumCoeffs) >> 1, output[0]);
|
|
|
|
|
|
|
|
for (int i = 0; i < kNumCoeffs; ++i) input[i] = minval;
|
|
|
|
output[0] = 0;
|
|
|
|
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
|
|
|
|
EXPECT_EQ((minval * kNumCoeffs) >> 1, output[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_P(PartialTrans16x16Test, Random) {
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2016-03-30 07:04:38 +03:00
|
|
|
const int16_t maxval =
|
|
|
|
static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
|
|
|
|
#else
|
|
|
|
const int16_t maxval = 255;
|
|
|
|
#endif
|
|
|
|
DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
|
|
|
|
DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
for (int i = 0; i < kNumCoeffs; ++i) {
|
|
|
|
const int val = (i & 1) ? -rnd(maxval + 1) : rnd(maxval + 1);
|
|
|
|
input[i] = val;
|
|
|
|
sum += val;
|
|
|
|
}
|
|
|
|
output[0] = 0;
|
|
|
|
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
|
|
|
|
EXPECT_EQ(sum >> 1, output[0]);
|
|
|
|
}
|
|
|
|
|
2013-09-05 23:44:03 +04:00
|
|
|
using std::tr1::make_tuple;
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
C, Trans16x16DCT,
|
|
|
|
::testing::Values(
|
2016-08-31 00:01:10 +03:00
|
|
|
make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_10, 0, AOM_BITS_10),
|
|
|
|
make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_12, 0, AOM_BITS_12),
|
|
|
|
make_tuple(&aom_fdct16x16_c, &aom_idct16x16_256_add_c, 0, AOM_BITS_8)));
|
2014-09-03 03:34:09 +04:00
|
|
|
#else
|
2016-08-12 03:46:05 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_c,
|
|
|
|
&aom_idct16x16_256_add_c,
|
|
|
|
0, AOM_BITS_8)));
|
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2014-09-03 03:34:09 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AOM_HIGHBITDEPTH
|
2013-09-05 23:44:03 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
C, Trans16x16HT,
|
|
|
|
::testing::Values(
|
2016-08-31 00:01:10 +03:00
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 0, AOM_BITS_10),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 1, AOM_BITS_10),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 2, AOM_BITS_10),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_10, 3, AOM_BITS_10),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 0, AOM_BITS_12),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 1, AOM_BITS_12),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &iht16x16_12, 2, AOM_BITS_12),
|
|
|
|
make_tuple(&av1_highbd_fht16x16_c, &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)));
|
2016-03-30 07:04:38 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
C, PartialTrans16x16Test,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_8),
|
|
|
|
make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_10),
|
|
|
|
make_tuple(&aom_highbd_fdct16x16_1_c, AOM_BITS_12)));
|
2014-09-03 03:34:09 +04:00
|
|
|
#else
|
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
C, Trans16x16HT,
|
|
|
|
::testing::Values(
|
2016-08-31 00:01:10 +03:00
|
|
|
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)));
|
2016-03-30 07:04:38 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(C, PartialTrans16x16Test,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_1_c,
|
|
|
|
AOM_BITS_8)));
|
|
|
|
#endif // CONFIG_AOM_HIGHBITDEPTH
|
2013-09-05 23:44:03 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if HAVE_NEON_ASM && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2014-02-26 11:11:49 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
NEON, Trans16x16DCT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_c, &aom_idct16x16_256_add_neon,
|
|
|
|
0, AOM_BITS_8)));
|
2014-02-26 11:11:49 +04:00
|
|
|
#endif
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if HAVE_SSE2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2013-09-05 23:44:03 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
SSE2, Trans16x16DCT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_sse2,
|
|
|
|
&aom_idct16x16_256_add_sse2, 0, AOM_BITS_8)));
|
2013-09-05 23:44:03 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
SSE2, Trans16x16HT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
|
|
|
0, AOM_BITS_8),
|
|
|
|
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
|
|
|
1, AOM_BITS_8),
|
|
|
|
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
|
|
|
2, AOM_BITS_8),
|
|
|
|
make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
|
|
|
|
3, AOM_BITS_8)));
|
2016-03-30 07:04:38 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_1_sse2,
|
|
|
|
AOM_BITS_8)));
|
|
|
|
#endif // HAVE_SSE2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2014-10-24 11:48:02 +04:00
|
|
|
|
2016-09-21 20:45:01 +03:00
|
|
|
#if HAVE_AVX2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
|
|
|
INSTANTIATE_TEST_CASE_P(AVX2, PartialTrans16x16Test,
|
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_1_avx2,
|
|
|
|
AOM_BITS_8)));
|
|
|
|
#endif // HAVE_AVX2 && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if HAVE_SSE2 && CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2014-10-24 11:48:02 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
SSE2, Trans16x16DCT,
|
|
|
|
::testing::Values(
|
2016-08-31 00:01:10 +03:00
|
|
|
make_tuple(&aom_highbd_fdct16x16_sse2, &idct16x16_10, 0, AOM_BITS_10),
|
|
|
|
make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_256_add_10_sse2, 0,
|
|
|
|
AOM_BITS_10),
|
|
|
|
make_tuple(&aom_highbd_fdct16x16_sse2, &idct16x16_12, 0, AOM_BITS_12),
|
|
|
|
make_tuple(&aom_highbd_fdct16x16_c, &idct16x16_256_add_12_sse2, 0,
|
|
|
|
AOM_BITS_12),
|
|
|
|
make_tuple(&aom_fdct16x16_sse2, &aom_idct16x16_256_add_c, 0,
|
|
|
|
AOM_BITS_8)));
|
2014-10-24 11:48:02 +04:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
SSE2, Trans16x16HT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::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)));
|
2014-10-24 11:48:02 +04:00
|
|
|
// Optimizations take effect at a threshold of 3155, so we use a value close to
|
|
|
|
// that to test both branches.
|
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
SSE2, InvTrans16x16DCT,
|
2016-08-12 03:46:05 +03:00
|
|
|
::testing::Values(make_tuple(&idct16x16_10_add_10_c,
|
2016-08-31 00:01:10 +03:00
|
|
|
&idct16x16_10_add_10_sse2, 3167, AOM_BITS_10),
|
2016-08-12 03:46:05 +03:00
|
|
|
make_tuple(&idct16x16_10, &idct16x16_256_add_10_sse2,
|
2016-08-31 00:01:10 +03:00
|
|
|
3167, AOM_BITS_10),
|
2016-08-12 03:46:05 +03:00
|
|
|
make_tuple(&idct16x16_10_add_12_c,
|
2016-08-31 00:01:10 +03:00
|
|
|
&idct16x16_10_add_12_sse2, 3167, AOM_BITS_12),
|
2016-08-12 03:46:05 +03:00
|
|
|
make_tuple(&idct16x16_12, &idct16x16_256_add_12_sse2,
|
2016-08-31 00:01:10 +03:00
|
|
|
3167, AOM_BITS_12)));
|
2016-09-02 21:46:46 +03:00
|
|
|
// TODO(luoyi):
|
|
|
|
// For this test case, we should test function: aom_highbd_fdct16x16_1_sse2.
|
|
|
|
// However this function is not available yet. if we mistakely test
|
|
|
|
// aom_fdct16x16_1_sse2, it could only pass AOM_BITS_8/AOM_BITS_10 but not
|
|
|
|
// AOM_BITS_12.
|
2016-03-30 07:04:38 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_1_sse2,
|
|
|
|
AOM_BITS_8)));
|
|
|
|
#endif // HAVE_SSE2 && CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2015-05-04 11:15:55 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if HAVE_MSA && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2016-08-12 03:46:05 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(MSA, Trans16x16DCT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_msa,
|
|
|
|
&aom_idct16x16_256_add_msa,
|
|
|
|
0, AOM_BITS_8)));
|
2016-11-17 02:38:01 +03:00
|
|
|
#if !CONFIG_EXT_TX
|
|
|
|
// TODO(yaowu): re-enable this after msa versions are updated to match C.
|
2015-05-04 11:15:55 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
2016-11-17 02:38:01 +03:00
|
|
|
DISABLED_MSA, Trans16x16HT,
|
2016-08-31 00:01:10 +03:00
|
|
|
::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)));
|
2016-08-13 20:58:54 +03:00
|
|
|
#endif // !CONFIG_EXT_TX
|
2016-03-30 07:04:38 +03:00
|
|
|
INSTANTIATE_TEST_CASE_P(MSA, PartialTrans16x16Test,
|
2016-08-31 00:01:10 +03:00
|
|
|
::testing::Values(make_tuple(&aom_fdct16x16_1_msa,
|
|
|
|
AOM_BITS_8)));
|
|
|
|
#endif // HAVE_MSA && !CONFIG_AOM_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
2012-08-03 04:03:14 +04:00
|
|
|
} // namespace
|