Commit e8bcce12 authored by Angie Chiang's avatar Angie Chiang Committed by Gerrit Code Review
Browse files

Merge "add dct 64x64 transform" into nextgenv2

parents 51f95129 ed2514a2
......@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "test/vp10_txfm_test.h"
#include "vp10/common/vp10_fwd_txfm1d.h"
#include "test/vp10_txfm_test.h"
using libvpx_test::ACMRandom;
......@@ -17,12 +17,14 @@ namespace {
static int txfm_type_num = 2;
static TYPE_TXFM txfm_type_ls[2] = {TYPE_DCT, TYPE_ADST};
static int txfm_size_num = 4;
static int txfm_size_ls[4] = {4, 8, 16, 32};
static int txfm_size_num = 5;
static int txfm_size_ls[5] = {4, 8, 16, 32, 64};
static TxfmFunc fwd_txfm_func_ls[2][4] = {
{vp10_fdct4_new, vp10_fdct8_new, vp10_fdct16_new, vp10_fdct32_new},
{vp10_fadst4_new, vp10_fadst8_new, vp10_fadst16_new, vp10_fadst32_new}};
static TxfmFunc fwd_txfm_func_ls[2][5] = {
{vp10_fdct4_new, vp10_fdct8_new, vp10_fdct16_new, vp10_fdct32_new,
vp10_fdct64_new},
{vp10_fadst4_new, vp10_fadst8_new, vp10_fadst16_new, vp10_fadst32_new,
NULL}};
// the maximum stage number of fwd/inv 1d dct/adst txfm is 12
static int8_t cos_bit[12] = {14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14};
......@@ -104,19 +106,21 @@ TEST(vp10_fwd_txfm1d, accuracy) {
int max_error = 7;
const int count_test_block = 5000;
for (int ti = 0; ti < count_test_block; ++ti) {
for (int ni = 0; ni < txfm_size; ++ni) {
input[ni] = rnd.Rand16() % base - rnd.Rand16() % base;
ref_input[ni] = static_cast<double>(input[ni]);
}
fwd_txfm_func(input, output, cos_bit, range_bit);
reference_hybrid_1d(ref_input, ref_output, txfm_size, txfm_type);
for (int ni = 0; ni < txfm_size; ++ni) {
EXPECT_LE(
abs(output[ni] - static_cast<int32_t>(round(ref_output[ni]))),
max_error);
if (fwd_txfm_func != NULL) {
for (int ti = 0; ti < count_test_block; ++ti) {
for (int ni = 0; ni < txfm_size; ++ni) {
input[ni] = rnd.Rand16() % base - rnd.Rand16() % base;
ref_input[ni] = static_cast<double>(input[ni]);
}
fwd_txfm_func(input, output, cos_bit, range_bit);
reference_hybrid_1d(ref_input, ref_output, txfm_size, txfm_type);
for (int ni = 0; ni < txfm_size; ++ni) {
EXPECT_LE(
abs(output[ni] - static_cast<int32_t>(round(ref_output[ni]))),
max_error);
}
}
}
}
......
......@@ -8,9 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
......@@ -23,21 +23,22 @@ using libvpx_test::ACMRandom;
namespace {
const int txfm_size_num = 4;
const int txfm_size_ls[4] = {4, 8, 16, 32};
const TXFM_2D_CFG fwd_txfm_cfg_ls[4][4] = {
{fwd_txfm_2d_cfg_dct_dct_4, fwd_txfm_2d_cfg_dct_adst_4,
fwd_txfm_2d_cfg_adst_adst_4, fwd_txfm_2d_cfg_adst_dct_4},
{fwd_txfm_2d_cfg_dct_dct_8, fwd_txfm_2d_cfg_dct_adst_8,
fwd_txfm_2d_cfg_adst_adst_8, fwd_txfm_2d_cfg_adst_dct_8},
{fwd_txfm_2d_cfg_dct_dct_16, fwd_txfm_2d_cfg_dct_adst_16,
fwd_txfm_2d_cfg_adst_adst_16, fwd_txfm_2d_cfg_adst_dct_16},
{fwd_txfm_2d_cfg_dct_dct_32, fwd_txfm_2d_cfg_dct_adst_32,
fwd_txfm_2d_cfg_adst_adst_32, fwd_txfm_2d_cfg_adst_dct_32}};
const Fwd_Txfm2d_Func fwd_txfm_func_ls[4] = {
const int txfm_size_num = 5;
const int txfm_size_ls[5] = {4, 8, 16, 32, 64};
const TXFM_2D_CFG* fwd_txfm_cfg_ls[5][4] = {
{&fwd_txfm_2d_cfg_dct_dct_4, &fwd_txfm_2d_cfg_dct_adst_4,
&fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_dct_4},
{&fwd_txfm_2d_cfg_dct_dct_8, &fwd_txfm_2d_cfg_dct_adst_8,
&fwd_txfm_2d_cfg_adst_adst_8, &fwd_txfm_2d_cfg_adst_dct_8},
{&fwd_txfm_2d_cfg_dct_dct_16, &fwd_txfm_2d_cfg_dct_adst_16,
&fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_dct_16},
{&fwd_txfm_2d_cfg_dct_dct_32, &fwd_txfm_2d_cfg_dct_adst_32,
&fwd_txfm_2d_cfg_adst_adst_32, &fwd_txfm_2d_cfg_adst_dct_32},
{&fwd_txfm_2d_cfg_dct_dct_64, NULL, NULL, NULL}};
const Fwd_Txfm2d_Func fwd_txfm_func_ls[5] = {
vp10_fwd_txfm2d_4x4, vp10_fwd_txfm2d_8x8, vp10_fwd_txfm2d_16x16,
vp10_fwd_txfm2d_32x32};
vp10_fwd_txfm2d_32x32, vp10_fwd_txfm2d_64x64};
const int txfm_type_num = 4;
const TYPE_TXFM type_ls_0[4] = {TYPE_DCT, TYPE_DCT, TYPE_ADST, TYPE_ADST};
......@@ -54,44 +55,48 @@ TEST(vp10_fwd_txfm2d, accuracy) {
for (int txfm_type_idx = 0; txfm_type_idx < txfm_type_num;
++txfm_type_idx) {
TXFM_2D_CFG fwd_txfm_cfg = fwd_txfm_cfg_ls[txfm_size_idx][txfm_type_idx];
Fwd_Txfm2d_Func fwd_txfm_func = fwd_txfm_func_ls[txfm_size_idx];
TYPE_TXFM type0 = type_ls_0[txfm_type_idx];
TYPE_TXFM type1 = type_ls_1[txfm_type_idx];
int amplify_bit =
fwd_txfm_cfg.shift[0] + fwd_txfm_cfg.shift[1] + fwd_txfm_cfg.shift[2];
double amplify_factor =
amplify_bit >= 0 ? (1 << amplify_bit) : (1.0 / (1 << -amplify_bit));
ACMRandom rnd(ACMRandom::DeterministicSeed());
int count = 5000;
double avg_abs_error = 0;
for (int ci = 0; ci < count; ci++) {
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
input[ni] = rnd.Rand16() % base;
ref_input[ni] = static_cast<double>(input[ni]);
output[ni] = 0;
ref_output[ni] = 0;
const TXFM_2D_CFG* fwd_txfm_cfg =
fwd_txfm_cfg_ls[txfm_size_idx][txfm_type_idx];
if (fwd_txfm_cfg != NULL) {
Fwd_Txfm2d_Func fwd_txfm_func = fwd_txfm_func_ls[txfm_size_idx];
TYPE_TXFM type0 = type_ls_0[txfm_type_idx];
TYPE_TXFM type1 = type_ls_1[txfm_type_idx];
int amplify_bit = fwd_txfm_cfg->shift[0] + fwd_txfm_cfg->shift[1] +
fwd_txfm_cfg->shift[2];
double amplify_factor =
amplify_bit >= 0 ? (1 << amplify_bit) : (1.0 / (1 << -amplify_bit));
ACMRandom rnd(ACMRandom::DeterministicSeed());
int count = 500;
double avg_abs_error = 0;
for (int ci = 0; ci < count; ci++) {
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
input[ni] = rnd.Rand16() % base;
ref_input[ni] = static_cast<double>(input[ni]);
output[ni] = 0;
ref_output[ni] = 0;
}
fwd_txfm_func(input, output, txfm_size, fwd_txfm_cfg, bd);
reference_hybrid_2d(ref_input, ref_output, txfm_size, type0, type1);
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
ref_output[ni] = round(ref_output[ni] * amplify_factor);
EXPECT_LE(fabs(output[ni] - ref_output[ni]) / amplify_factor, 60);
}
avg_abs_error += compute_avg_abs_error<int32_t, double>(
output, ref_output, sqr_txfm_size);
}
fwd_txfm_func(input, output, txfm_size, &fwd_txfm_cfg, bd);
reference_hybrid_2d(ref_input, ref_output, txfm_size, type0, type1);
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
ref_output[ni] = round(ref_output[ni] * amplify_factor);
EXPECT_LE(fabs(output[ni] - ref_output[ni]) / amplify_factor, 30);
}
avg_abs_error += compute_avg_abs_error<int32_t, double>(
output, ref_output, sqr_txfm_size);
avg_abs_error /= amplify_factor;
avg_abs_error /= count;
// max_abs_avg_error comes from upper bound of avg_abs_error
// printf("type0: %d type1: %d txfm_size: %d accuracy_avg_abs_error:
// %f\n",
// type0, type1, txfm_size, avg_abs_error);
double max_abs_avg_error = 5;
EXPECT_LE(avg_abs_error, max_abs_avg_error);
}
avg_abs_error /= amplify_factor;
avg_abs_error /= count;
// max_abs_avg_error comes from upper bound of avg_abs_error
// printf("type0: %d type1: %d txfm_size: %d accuracy_avg_abs_error:
// %f\n", type0, type1, txfm_size, avg_abs_error);
double max_abs_avg_error = 1.5;
EXPECT_LE(avg_abs_error, max_abs_avg_error);
}
delete[] input;
......
......@@ -16,16 +16,20 @@ using libvpx_test::ACMRandom;
namespace {
static int txfm_type_num = 2;
static int txfm_size_num = 4;
static int txfm_size_ls[4] = {4, 8, 16, 32};
static int txfm_size_num = 5;
static int txfm_size_ls[5] = {4, 8, 16, 32, 64};
static TxfmFunc fwd_txfm_func_ls[2][4] = {
{vp10_fdct4_new, vp10_fdct8_new, vp10_fdct16_new, vp10_fdct32_new},
{vp10_fadst4_new, vp10_fadst8_new, vp10_fadst16_new, vp10_fadst32_new}};
static TxfmFunc fwd_txfm_func_ls[2][5] = {
{vp10_fdct4_new, vp10_fdct8_new, vp10_fdct16_new, vp10_fdct32_new,
vp10_fdct64_new},
{vp10_fadst4_new, vp10_fadst8_new, vp10_fadst16_new, vp10_fadst32_new,
NULL}};
static TxfmFunc inv_txfm_func_ls[2][4] = {
{vp10_idct4_new, vp10_idct8_new, vp10_idct16_new, vp10_idct32_new},
{vp10_iadst4_new, vp10_iadst8_new, vp10_iadst16_new, vp10_iadst32_new}};
static TxfmFunc inv_txfm_func_ls[2][5] = {
{vp10_idct4_new, vp10_idct8_new, vp10_idct16_new, vp10_idct32_new,
vp10_idct64_new},
{vp10_iadst4_new, vp10_iadst8_new, vp10_iadst16_new, vp10_iadst32_new,
NULL}};
// the maximum stage number of fwd/inv 1d dct/adst txfm is 12
static int8_t cos_bit[12] = {14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14};
......@@ -44,19 +48,22 @@ TEST(vp10_inv_txfm1d, round_trip) {
TxfmFunc inv_txfm_func = inv_txfm_func_ls[ti][si];
int max_error = 2;
const int count_test_block = 5000;
for (int ci = 0; ci < count_test_block; ++ci) {
for (int ni = 0; ni < txfm_size; ++ni) {
input[ni] = rnd.Rand16() % base - rnd.Rand16() % base;
}
if (fwd_txfm_func != NULL) {
const int count_test_block = 5000;
for (int ci = 0; ci < count_test_block; ++ci) {
for (int ni = 0; ni < txfm_size; ++ni) {
input[ni] = rnd.Rand16() % base - rnd.Rand16() % base;
}
fwd_txfm_func(input, output, cos_bit, range_bit);
inv_txfm_func(output, round_trip_output, cos_bit, range_bit);
fwd_txfm_func(input, output, cos_bit, range_bit);
inv_txfm_func(output, round_trip_output, cos_bit, range_bit);
for (int ni = 0; ni < txfm_size; ++ni) {
EXPECT_LE(abs(input[ni] - round_shift(round_trip_output[ni],
get_max_bit(txfm_size) - 1)),
max_error);
for (int ni = 0; ni < txfm_size; ++ni) {
int node_err =
abs(input[ni] - round_shift(round_trip_output[ni],
get_max_bit(txfm_size) - 1));
EXPECT_LE(node_err, max_error);
}
}
}
}
......
......@@ -25,34 +25,36 @@ using libvpx_test::ACMRandom;
namespace {
const int txfm_size_num = 4;
const int txfm_size_ls[4] = {4, 8, 16, 32};
const TXFM_2D_CFG fwd_txfm_cfg_ls[4][4] = {
{fwd_txfm_2d_cfg_dct_dct_4, fwd_txfm_2d_cfg_dct_adst_4,
fwd_txfm_2d_cfg_adst_adst_4, fwd_txfm_2d_cfg_adst_dct_4},
{fwd_txfm_2d_cfg_dct_dct_8, fwd_txfm_2d_cfg_dct_adst_8,
fwd_txfm_2d_cfg_adst_adst_8, fwd_txfm_2d_cfg_adst_dct_8},
{fwd_txfm_2d_cfg_dct_dct_16, fwd_txfm_2d_cfg_dct_adst_16,
fwd_txfm_2d_cfg_adst_adst_16, fwd_txfm_2d_cfg_adst_dct_16},
{fwd_txfm_2d_cfg_dct_dct_32, fwd_txfm_2d_cfg_dct_adst_32,
fwd_txfm_2d_cfg_adst_adst_32, fwd_txfm_2d_cfg_adst_dct_32}};
const TXFM_2D_CFG inv_txfm_cfg_ls[4][4] = {
{inv_txfm_2d_cfg_dct_dct_4, inv_txfm_2d_cfg_dct_adst_4,
inv_txfm_2d_cfg_adst_adst_4, inv_txfm_2d_cfg_adst_dct_4},
{inv_txfm_2d_cfg_dct_dct_8, inv_txfm_2d_cfg_dct_adst_8,
inv_txfm_2d_cfg_adst_adst_8, inv_txfm_2d_cfg_adst_dct_8},
{inv_txfm_2d_cfg_dct_dct_16, inv_txfm_2d_cfg_dct_adst_16,
inv_txfm_2d_cfg_adst_adst_16, inv_txfm_2d_cfg_adst_dct_16},
{inv_txfm_2d_cfg_dct_dct_32, inv_txfm_2d_cfg_dct_adst_32,
inv_txfm_2d_cfg_adst_adst_32, inv_txfm_2d_cfg_adst_dct_32}};
const Fwd_Txfm2d_Func fwd_txfm_func_ls[4] = {
const int txfm_size_num = 5;
const int txfm_size_ls[5] = {4, 8, 16, 32, 64};
const TXFM_2D_CFG* fwd_txfm_cfg_ls[5][4] = {
{&fwd_txfm_2d_cfg_dct_dct_4, &fwd_txfm_2d_cfg_dct_adst_4,
&fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_dct_4},
{&fwd_txfm_2d_cfg_dct_dct_8, &fwd_txfm_2d_cfg_dct_adst_8,
&fwd_txfm_2d_cfg_adst_adst_8, &fwd_txfm_2d_cfg_adst_dct_8},
{&fwd_txfm_2d_cfg_dct_dct_16, &fwd_txfm_2d_cfg_dct_adst_16,
&fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_dct_16},
{&fwd_txfm_2d_cfg_dct_dct_32, &fwd_txfm_2d_cfg_dct_adst_32,
&fwd_txfm_2d_cfg_adst_adst_32, &fwd_txfm_2d_cfg_adst_dct_32},
{&fwd_txfm_2d_cfg_dct_dct_64, NULL, NULL, NULL}};
const TXFM_2D_CFG* inv_txfm_cfg_ls[5][4] = {
{&inv_txfm_2d_cfg_dct_dct_4, &inv_txfm_2d_cfg_dct_adst_4,
&inv_txfm_2d_cfg_adst_adst_4, &inv_txfm_2d_cfg_adst_dct_4},
{&inv_txfm_2d_cfg_dct_dct_8, &inv_txfm_2d_cfg_dct_adst_8,
&inv_txfm_2d_cfg_adst_adst_8, &inv_txfm_2d_cfg_adst_dct_8},
{&inv_txfm_2d_cfg_dct_dct_16, &inv_txfm_2d_cfg_dct_adst_16,
&inv_txfm_2d_cfg_adst_adst_16, &inv_txfm_2d_cfg_adst_dct_16},
{&inv_txfm_2d_cfg_dct_dct_32, &inv_txfm_2d_cfg_dct_adst_32,
&inv_txfm_2d_cfg_adst_adst_32, &inv_txfm_2d_cfg_adst_dct_32},
{&inv_txfm_2d_cfg_dct_dct_64, NULL, NULL, NULL}};
const Fwd_Txfm2d_Func fwd_txfm_func_ls[5] = {
vp10_fwd_txfm2d_4x4, vp10_fwd_txfm2d_8x8, vp10_fwd_txfm2d_16x16,
vp10_fwd_txfm2d_32x32};
const Inv_Txfm2d_Func inv_txfm_func_ls[4] = {
vp10_fwd_txfm2d_32x32, vp10_fwd_txfm2d_64x64};
const Inv_Txfm2d_Func inv_txfm_func_ls[5] = {
vp10_inv_txfm2d_add_4x4, vp10_inv_txfm2d_add_8x8, vp10_inv_txfm2d_add_16x16,
vp10_inv_txfm2d_add_32x32};
vp10_inv_txfm2d_add_32x32, vp10_inv_txfm2d_add_64x64};
const int txfm_type_num = 4;
......@@ -66,44 +68,46 @@ TEST(vp10_inv_txfm2d, round_trip) {
for (int txfm_type_idx = 0; txfm_type_idx < txfm_type_num;
++txfm_type_idx) {
const TXFM_2D_CFG fwd_txfm_cfg =
const TXFM_2D_CFG* fwd_txfm_cfg =
fwd_txfm_cfg_ls[txfm_size_idx][txfm_type_idx];
const TXFM_2D_CFG inv_txfm_cfg =
const TXFM_2D_CFG* inv_txfm_cfg =
inv_txfm_cfg_ls[txfm_size_idx][txfm_type_idx];
const Fwd_Txfm2d_Func fwd_txfm_func = fwd_txfm_func_ls[txfm_size_idx];
const Inv_Txfm2d_Func inv_txfm_func = inv_txfm_func_ls[txfm_size_idx];
const int count = 5000;
double avg_abs_error = 0;
ACMRandom rnd(ACMRandom::DeterministicSeed());
for (int ci = 0; ci < count; ci++) {
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
if (ci == 0) {
int extreme_input = base - 1;
input[ni] = extreme_input; // extreme case
ref_input[ni] = 0;
} else {
input[ni] = rnd.Rand16() % base;
ref_input[ni] = 0;
if (fwd_txfm_cfg != NULL) {
const Fwd_Txfm2d_Func fwd_txfm_func = fwd_txfm_func_ls[txfm_size_idx];
const Inv_Txfm2d_Func inv_txfm_func = inv_txfm_func_ls[txfm_size_idx];
const int count = 1000;
double avg_abs_error = 0;
ACMRandom rnd(ACMRandom::DeterministicSeed());
for (int ci = 0; ci < count; ci++) {
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
if (ci == 0) {
int extreme_input = base - 1;
input[ni] = extreme_input; // extreme case
ref_input[ni] = 0;
} else {
input[ni] = rnd.Rand16() % base;
ref_input[ni] = 0;
}
}
}
fwd_txfm_func(input, output, txfm_size, &fwd_txfm_cfg, bd);
inv_txfm_func(output, ref_input, txfm_size, &inv_txfm_cfg, bd);
fwd_txfm_func(input, output, txfm_size, fwd_txfm_cfg, bd);
inv_txfm_func(output, ref_input, txfm_size, inv_txfm_cfg, bd);
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
EXPECT_LE(abs(input[ni] - ref_input[ni]), 2);
for (int ni = 0; ni < sqr_txfm_size; ++ni) {
EXPECT_LE(abs(input[ni] - ref_input[ni]), 2);
}
avg_abs_error += compute_avg_abs_error<int16_t, uint16_t>(
input, ref_input, sqr_txfm_size);
}
avg_abs_error += compute_avg_abs_error<int16_t, uint16_t>(
input, ref_input, sqr_txfm_size);
}
avg_abs_error /= count;
// max_abs_avg_error comes from upper bound of
// printf("txfm_size: %d accuracy_avg_abs_error: %f\n", txfm_size,
// avg_abs_error);
// TODO(angiebird): this upper bound is from adst_adst_8
const double max_abs_avg_error = 0.024;
EXPECT_LE(avg_abs_error, max_abs_avg_error);
avg_abs_error /= count;
// max_abs_avg_error comes from upper bound of
// printf("txfm_size: %d accuracy_avg_abs_error: %f\n",
// txfm_size, avg_abs_error);
// TODO(angiebird): this upper bound is from adst_adst_8
const double max_abs_avg_error = 0.024;
EXPECT_LE(avg_abs_error, max_abs_avg_error);
}
}
delete[] input;
......
This diff is collapsed.
......@@ -25,6 +25,8 @@ void vp10_fdct16_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
void vp10_fdct32_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
void vp10_fdct64_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
void vp10_fadst4_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
......
......@@ -82,3 +82,11 @@ void vp10_fwd_txfm2d_32x32(const int16_t *input, int32_t *output,
(void)bd;
fwd_txfm2d_c(input, output, stride, cfg, txfm_buf);
}
void vp10_fwd_txfm2d_64x64(const int16_t *input, int32_t *output,
const int stride, const TXFM_2D_CFG *cfg,
const int bd) {
int txfm_buf[64 * 64 + 64 + 64];
(void)bd;
fwd_txfm2d_c(input, output, stride, cfg, txfm_buf);
}
......@@ -27,6 +27,9 @@ void vp10_fwd_txfm2d_16x16(const int16_t *input, int32_t *output,
void vp10_fwd_txfm2d_32x32(const int16_t *input, int32_t *output,
const int stride, const TXFM_2D_CFG *cfg,
const int bd);
void vp10_fwd_txfm2d_64x64(const int16_t *input, int32_t *output,
const int stride, const TXFM_2D_CFG *cfg,
const int bd);
#ifdef __cplusplus
}
#endif
......
......@@ -95,6 +95,29 @@ static const TXFM_2D_CFG fwd_txfm_2d_cfg_dct_dct_32 = {
vp10_fdct32_new, // .txfm_func_col
vp10_fdct32_new}; // .txfm_func_row;
// ---------------- config fwd_dct_dct_64 ----------------
static int8_t fwd_shift_dct_dct_64[3] = {2, -2, -2};
static int8_t fwd_stage_range_col_dct_dct_64[12] = {13, 14, 15, 16, 17, 18,
19, 19, 19, 19, 19, 19};
static int8_t fwd_stage_range_row_dct_dct_64[12] = {17, 18, 19, 20, 21, 22,
22, 22, 22, 22, 22, 22};
static int8_t fwd_cos_bit_col_dct_dct_64[12] = {15, 15, 15, 15, 15, 14,
13, 13, 13, 13, 13, 13};
static int8_t fwd_cos_bit_row_dct_dct_64[12] = {15, 14, 13, 12, 11, 10,
10, 10, 10, 10, 10, 10};
static const TXFM_2D_CFG fwd_txfm_2d_cfg_dct_dct_64 = {
64, // .txfm_size
12, // .stage_num_col
12, // .stage_num_row
fwd_shift_dct_dct_64, // .shift
fwd_stage_range_col_dct_dct_64, // .stage_range_col
fwd_stage_range_row_dct_dct_64, // .stage_range_row
fwd_cos_bit_col_dct_dct_64, // .cos_bit_col
fwd_cos_bit_row_dct_dct_64, // .cos_bit_row
vp10_fdct64_new, // .txfm_func_col
vp10_fdct64_new}; // .txfm_func_row;
// ---------------- config fwd_dct_adst_4 ----------------
static const int8_t fwd_shift_dct_adst_4[3] = {5, -2, -1};
static const int8_t fwd_stage_range_col_dct_adst_4[4] = {16, 17, 18, 18};
......
This diff is collapsed.
......@@ -25,6 +25,8 @@ void vp10_idct16_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
void vp10_idct32_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
void vp10_idct64_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
void vp10_iadst4_new(const int32_t *input, int32_t *output,
const int8_t *cos_bit, const int8_t *stage_range);
......
......@@ -96,3 +96,15 @@ void vp10_inv_txfm2d_add_32x32(const int32_t *input, uint16_t *output,
inv_txfm2d_add_c(input, (int16_t *)output, stride, cfg, txfm_buf);
clamp_block((int16_t *)output, 32, stride, 0, (1 << bd) - 1);
}
void vp10_inv_txfm2d_add_64x64(const int32_t *input, uint16_t *output,
const int stride, const TXFM_2D_CFG *cfg,
const int bd) {
int txfm_buf[64 * 64 + 64 + 64];
// output contains the prediction signal which is always positive and smaller
// than (1 << bd) - 1
// since bd < 16-1, therefore we can treat the uint16_t* output buffer as an
// int16_t*
inv_txfm2d_add_c(input, (int16_t *)output, stride, cfg, txfm_buf);
clamp_block((int16_t *)output, 64, stride, 0, (1 << bd) - 1);
}
......@@ -27,6 +27,9 @@ void vp10_inv_txfm2d_add_16x16(const int32_t *input, uint16_t *output,
void vp10_inv_txfm2d_add_32x32(const int32_t *input, uint16_t *output,
const int stride, const TXFM_2D_CFG *cfg,
const int bd);
void vp10_inv_txfm2d_add_64x64(const int32_t *input, uint16_t *output,
const int stride, const TXFM_2D_CFG *cfg,
const int bd);
#ifdef __cplusplus
}
#endif
......
......@@ -96,6 +96,29 @@ static const TXFM_2D_CFG inv_txfm_2d_cfg_dct_dct_32 = {
vp10_idct32_new, // .txfm_func_col
vp10_idct32_new}; // .txfm_func_row;
// ---------------- config inv_dct_dct_64 ----------------
static int8_t inv_shift_dct_dct_64[2] = {-1, -7};
static int8_t inv_stage_range_col_dct_dct_64[12] = {19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 18, 18};
static int8_t inv_stage_range_row_dct_dct_64[12] = {20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20};
static int8_t inv_cos_bit_col_dct_dct_64[12] = {13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 14};
static int8_t inv_cos_bit_row_dct_dct_64[12] = {12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12};
static const TXFM_2D_CFG inv_txfm_2d_cfg_dct_dct_64 = {
64, // .txfm_size
12, // .stage_num_col
12, // .stage_num_row
inv_shift_dct_dct_64, // .shift
inv_stage_range_col_dct_dct_64, // .stage_range_col
inv_stage_range_row_dct_dct_64, // .stage_range_row
inv_cos_bit_col_dct_dct_64, // .cos_bit_col
inv_cos_bit_row_dct_dct_64, // .cos_bit_row
vp10_idct64_new, // .txfm_func_col
vp10_idct64_new}; // .txfm_func_row;
// ---------------- config inv_dct_adst_4 ----------------
static const int8_t inv_shift_dct_adst_4[2] = {1, -5};
static const int8_t inv_stage_range_col_dct_adst_4[4] = {17, 17, 16, 16};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment