Commit 09d45303 authored by Cherma Rajan A's avatar Cherma Rajan A Committed by Yunqing Wang

Unify HBD and 8-bit convolve functions

Code clean-up in HBD convolve facade.
HBD convolve functions are modified similar to 8-bit functions.
Function pointers table added for HBD convolve.
Unit test updated for new functions.

Change-Id: Ide0abe5e0eec5893f004344d02bafa9781701e99
parent 901d622d
......@@ -508,8 +508,23 @@ if (aom_config("CONFIG_JNT_COMP") eq "yes") {
specialize qw/av1_jnt_convolve_y sse4_1/;
}
add_proto qw/void av1_highbd_convolve_2d/, "const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_2d/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
specialize qw/av1_highbd_convolve_2d ssse3 avx2/;
add_proto qw/void av1_highbd_convolve_2d_copy/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_2d_copy_sr/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_2d_sr/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_x/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_x_sr/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_y/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_y_sr/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_convolve_rounding/, "const int32_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, int h, int bits, int bd";
specialize qw/av1_highbd_convolve_rounding avx2/;
......@@ -517,7 +532,7 @@ add_proto qw/void av1_highbd_convolve_2d_scale/, "const uint16_t *src, int src_s
specialize qw/av1_highbd_convolve_2d_scale sse4_1/;
if (aom_config("CONFIG_JNT_COMP") eq "yes") {
add_proto qw/void av1_highbd_jnt_convolve_2d/, "const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
add_proto qw/void av1_highbd_jnt_convolve_2d/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
specialize qw/av1_highbd_jnt_convolve_2d sse4_1/;
}
......
This diff is collapsed.
......@@ -57,6 +57,12 @@ typedef void (*aom_convolve_fn_t)(const uint8_t *src, int src_stride,
const int subpel_x_q4, const int subpel_y_q4,
ConvolveParams *conv_params);
typedef void (*aom_highbd_convolve_fn_t)(
const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w,
int h, InterpFilterParams *filter_params_x,
InterpFilterParams *filter_params_y, const int subpel_x_q4,
const int subpel_y_q4, ConvolveParams *conv_params, int bd);
static INLINE void av1_get_convolve_filter_params(InterpFilters interp_filters,
InterpFilterParams *params_x,
InterpFilterParams *params_y
......@@ -153,7 +159,7 @@ void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride,
const int subpel_x_q4, int x_step_q4,
const int subpel_y_q4, int y_step_q4,
int scaled, ConvolveParams *conv_params,
int bd);
const struct scale_factors *sf, int bd);
void av1_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, InterpFilters interp_filters,
......
......@@ -123,7 +123,7 @@ static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride,
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
interp_filters, subpel_x, xs, subpel_y, ys,
1, conv_params, bd);
1, conv_params, sf, bd);
} else {
av1_highbd_convolve_scale(src, src_stride, dst, dst_stride, w, h,
interp_filters, subpel_x, xs, subpel_y, ys, avg,
......@@ -141,7 +141,7 @@ static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride,
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
interp_filters, subpel_x, xs, subpel_y, ys,
0, conv_params, bd);
0, conv_params, sf, bd);
} else {
InterpFilterParams filter_params_x, filter_params_y;
#if CONFIG_SHORT_FILTER
......
......@@ -205,4 +205,34 @@ void av1_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
// subpel_x_q4 != 0 && subpel_y_q4 != 0
sf->convolve[1][1][1] = av1_convolve_2d;
#endif // CONFIG_JNT_COMP
// AV1 High BD convolve functions
// Special case convolve functions should produce the same result as
// av1_highbd_convolve_2d.
// subpel_x_q4 == 0 && subpel_y_q4 == 0
sf->highbd_convolve[0][0][0] = av1_highbd_convolve_2d_copy_sr;
// subpel_x_q4 == 0
sf->highbd_convolve[0][1][0] = av1_highbd_convolve_y_sr;
// subpel_y_q4 == 0
sf->highbd_convolve[1][0][0] = av1_highbd_convolve_x_sr;
// subpel_x_q4 != 0 && subpel_y_q4 != 0
sf->highbd_convolve[1][1][0] = av1_highbd_convolve_2d_sr;
#if CONFIG_JNT_COMP
// subpel_x_q4 == 0 && subpel_y_q4 == 0
sf->highbd_convolve[0][0][1] = av1_highbd_jnt_convolve_2d;
// subpel_x_q4 == 0
sf->highbd_convolve[0][1][1] = av1_highbd_jnt_convolve_2d;
// subpel_y_q4 == 0
sf->highbd_convolve[1][0][1] = av1_highbd_jnt_convolve_2d;
// subpel_x_q4 != 0 && subpel_y_q4 != 0
sf->highbd_convolve[1][1][1] = av1_highbd_jnt_convolve_2d;
#else
// subpel_x_q4 == 0 && subpel_y_q4 == 0
sf->highbd_convolve[0][0][1] = av1_highbd_convolve_2d_copy;
// subpel_x_q4 == 0
sf->highbd_convolve[0][1][1] = av1_highbd_convolve_y;
// subpel_y_q4 == 0
sf->highbd_convolve[1][0][1] = av1_highbd_convolve_x;
// subpel_x_q4 != 0 && subpel_y_q4 != 0
sf->highbd_convolve[1][1][1] = av1_highbd_convolve_2d;
#endif
}
......@@ -40,6 +40,7 @@ struct scale_factors {
// convolve_fn_ptr[subpel_x != 0][subpel_y != 0][is_compound]
aom_convolve_fn_t convolve[2][2][2];
aom_highbd_convolve_fn_t highbd_convolve[2][2][2];
};
MV32 av1_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
......
......@@ -19,13 +19,15 @@
#include "av1/common/convolve.h"
void av1_highbd_convolve_2d_avx2(const uint16_t *src, int src_stride,
CONV_BUF_TYPE *dst, int dst_stride, int w,
int h, InterpFilterParams *filter_params_x,
uint16_t *dst0, int dst_stride0, int w, int h,
InterpFilterParams *filter_params_x,
InterpFilterParams *filter_params_y,
const int subpel_x_q4, const int subpel_y_q4,
ConvolveParams *conv_params, int bd) {
DECLARE_ALIGNED(32, int16_t,
im_block[(MAX_SB_SIZE + MAX_FILTER_TAP - 1) * MAX_SB_SIZE]);
CONV_BUF_TYPE *dst = conv_params->dst;
int dst_stride = conv_params->dst_stride;
int im_h = h + filter_params_y->taps - 1;
int im_stride = MAX_SB_SIZE;
int i, j;
......@@ -33,7 +35,8 @@ void av1_highbd_convolve_2d_avx2(const uint16_t *src, int src_stride,
const int fo_vert = filter_params_y->taps / 2 - 1;
const int fo_horiz = filter_params_x->taps / 2 - 1;
const uint16_t *const src_ptr = src - fo_vert * src_stride - fo_horiz;
(void)dst0;
(void)dst_stride0;
// Check that, even with 12-bit input, the intermediate values will fit
// into an unsigned 16-bit intermediate array.
assert(bd + FILTER_BITS + 2 - conv_params->round_0 <= 16);
......
......@@ -21,12 +21,14 @@
#if CONFIG_JNT_COMP
void av1_highbd_jnt_convolve_2d_sse4_1(
const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride,
int w, int h, InterpFilterParams *filter_params_x,
const uint16_t *src, int src_stride, uint16_t *dst0, int dst_stride0, int w,
int h, InterpFilterParams *filter_params_x,
InterpFilterParams *filter_params_y, const int subpel_x_q4,
const int subpel_y_q4, ConvolveParams *conv_params, int bd) {
DECLARE_ALIGNED(16, int16_t,
im_block[(MAX_SB_SIZE + MAX_FILTER_TAP - 1) * MAX_SB_SIZE]);
CONV_BUF_TYPE *dst = conv_params->dst;
int dst_stride = conv_params->dst_stride;
int im_h = h + filter_params_y->taps - 1;
int im_stride = MAX_SB_SIZE;
int i, j;
......@@ -40,6 +42,9 @@ void av1_highbd_jnt_convolve_2d_sse4_1(
const __m128i wt0 = _mm_set1_epi32(w0);
const __m128i wt1 = _mm_set1_epi32(w1);
(void)dst0;
(void)dst_stride0;
// Check that, even with 12-bit input, the intermediate values will fit
// into an unsigned 16-bit intermediate array.
assert(bd + FILTER_BITS + 2 - conv_params->round_0 <= 16);
......
......@@ -19,13 +19,15 @@
#include "av1/common/convolve.h"
void av1_highbd_convolve_2d_ssse3(const uint16_t *src, int src_stride,
CONV_BUF_TYPE *dst, int dst_stride, int w,
int h, InterpFilterParams *filter_params_x,
uint16_t *dst0, int dst_stride0, int w, int h,
InterpFilterParams *filter_params_x,
InterpFilterParams *filter_params_y,
const int subpel_x_q4, const int subpel_y_q4,
ConvolveParams *conv_params, int bd) {
DECLARE_ALIGNED(16, int16_t,
im_block[(MAX_SB_SIZE + MAX_FILTER_TAP - 1) * MAX_SB_SIZE]);
CONV_BUF_TYPE *dst = conv_params->dst;
int dst_stride = conv_params->dst_stride;
int im_h = h + filter_params_y->taps - 1;
int im_stride = MAX_SB_SIZE;
int i, j;
......@@ -33,7 +35,8 @@ void av1_highbd_convolve_2d_ssse3(const uint16_t *src, int src_stride,
const int fo_vert = filter_params_y->taps / 2 - 1;
const int fo_horiz = filter_params_x->taps / 2 - 1;
const uint16_t *const src_ptr = src - fo_vert * src_stride - fo_horiz;
(void)dst0;
(void)dst_stride0;
// Check that, even with 12-bit input, the intermediate values will fit
// into an unsigned 16-bit intermediate array.
assert(bd + FILTER_BITS + 2 - conv_params->round_0 <= 16);
......
......@@ -20,6 +20,7 @@ using std::tr1::tuple;
#if CONFIG_JNT_COMP
using libaom_test::AV1Convolve2D::AV1JntConvolve2DTest;
#endif
using libaom_test::AV1HighbdConvolve2D::AV1HighbdConvolve2DSrTest;
using libaom_test::AV1HighbdConvolve2D::AV1HighbdConvolve2DTest;
#if CONFIG_JNT_COMP
using libaom_test::AV1HighbdConvolve2D::AV1HighbdJntConvolve2DTest;
......@@ -136,13 +137,39 @@ TEST_P(AV1HighbdConvolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(1)); }
INSTANTIATE_TEST_CASE_P(SSSE3, AV1HighbdConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_2d_ssse3));
av1_highbd_convolve_2d_ssse3, 1, 1, 1));
#if HAVE_AVX2
INSTANTIATE_TEST_CASE_P(
AVX2, AV1HighbdConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(av1_highbd_convolve_2d_avx2));
INSTANTIATE_TEST_CASE_P(AVX2, AV1HighbdConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_2d_avx2, 1, 1, 1));
#endif
INSTANTIATE_TEST_CASE_P(C_X, AV1HighbdConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_x_c, 1, 0, 1));
INSTANTIATE_TEST_CASE_P(C_Y, AV1HighbdConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_y_c, 0, 1, 1));
INSTANTIATE_TEST_CASE_P(C_COPY, AV1HighbdConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_2d_copy_c, 0, 0, 1));
TEST_P(AV1HighbdConvolve2DSrTest, CheckOutput) { RunCheckOutput(GET_PARAM(1)); }
INSTANTIATE_TEST_CASE_P(C_X, AV1HighbdConvolve2DSrTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_x_sr_c, 1, 0, 0));
INSTANTIATE_TEST_CASE_P(C_Y, AV1HighbdConvolve2DSrTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_y_sr_c, 0, 1, 0));
INSTANTIATE_TEST_CASE_P(C_COPY, AV1HighbdConvolve2DSrTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_convolve_2d_copy_sr_c, 0, 0, 0));
#if CONFIG_JNT_COMP && HAVE_SSE4_1
TEST_P(AV1HighbdJntConvolve2DTest, CheckOutput) {
RunCheckOutput(GET_PARAM(1));
......@@ -150,7 +177,7 @@ TEST_P(AV1HighbdJntConvolve2DTest, CheckOutput) {
INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdJntConvolve2DTest,
libaom_test::AV1HighbdConvolve2D::BuildParams(
av1_highbd_jnt_convolve_2d_sse4_1));
av1_highbd_jnt_convolve_2d_sse4_1, 1, 1, 1));
#endif // CONFIG_JNT_COMP
#endif
......
......@@ -397,9 +397,12 @@ void AV1JntConvolve2DTest::RunCheckOutput(convolve_2d_func test_impl) {
namespace AV1HighbdConvolve2D {
::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams(
highbd_convolve_2d_func filter) {
return ::testing::Values(make_tuple(8, filter), make_tuple(10, filter),
make_tuple(12, filter));
highbd_convolve_2d_func filter, int has_subx, int has_suby,
int is_compound) {
return ::testing::Values(
make_tuple(8, filter, has_subx, has_suby, is_compound),
make_tuple(10, filter, has_subx, has_suby, is_compound),
make_tuple(12, filter, has_subx, has_suby, is_compound));
}
AV1HighbdConvolve2DTest::~AV1HighbdConvolve2DTest() {}
......@@ -413,10 +416,14 @@ void AV1HighbdConvolve2DTest::RunCheckOutput(
highbd_convolve_2d_func test_impl) {
const int w = kMaxSize, h = kMaxSize;
const int bd = GET_PARAM(0);
const int has_subx = GET_PARAM(2);
const int has_suby = GET_PARAM(3);
const int is_compound = GET_PARAM(4);
int hfilter, vfilter, subx, suby;
uint16_t input[kMaxSize * kMaxSize];
DECLARE_ALIGNED(32, CONV_BUF_TYPE, output[MAX_SB_SQUARE]);
DECLARE_ALIGNED(32, CONV_BUF_TYPE, output2[MAX_SB_SQUARE]);
(void)is_compound;
for (int i = 0; i < h; ++i)
for (int j = 0; j < w; ++j)
......@@ -440,18 +447,20 @@ void AV1HighbdConvolve2DTest::RunCheckOutput(
ConvolveParams conv_params2 = get_conv_params_no_round(
0, do_average, 0, output2, MAX_SB_SIZE, 1, bd);
for (subx = 0; subx < 16; ++subx) {
for (suby = 0; suby < 16; ++suby) {
const int subx_range = has_subx ? 16 : 1;
const int suby_range = has_suby ? 16 : 1;
for (subx = 0; subx < subx_range; ++subx) {
for (suby = 0; suby < suby_range; ++suby) {
// Choose random locations within the source block
const int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7);
const int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7);
av1_highbd_convolve_2d_c(input + offset_r * w + offset_c, w,
output, MAX_SB_SIZE, out_w, out_h,
&filter_params_x, &filter_params_y, subx,
suby, &conv_params1, bd);
test_impl(input + offset_r * w + offset_c, w, output2,
MAX_SB_SIZE, out_w, out_h, &filter_params_x,
&filter_params_y, subx, suby, &conv_params2, bd);
av1_highbd_convolve_2d_c(input + offset_r * w + offset_c, w, NULL,
0, out_w, out_h, &filter_params_x,
&filter_params_y, subx, suby,
&conv_params1, bd);
test_impl(input + offset_r * w + offset_c, w, NULL, 0, out_w,
out_h, &filter_params_x, &filter_params_y, subx, suby,
&conv_params2, bd);
for (int i = 0; i < out_h; ++i) {
for (int j = 0; j < out_w; ++j) {
......@@ -471,6 +480,91 @@ void AV1HighbdConvolve2DTest::RunCheckOutput(
}
}
AV1HighbdConvolve2DSrTest::~AV1HighbdConvolve2DSrTest() {}
void AV1HighbdConvolve2DSrTest::SetUp() {
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void AV1HighbdConvolve2DSrTest::TearDown() { libaom_test::ClearSystemState(); }
void AV1HighbdConvolve2DSrTest::RunCheckOutput(
highbd_convolve_2d_func test_impl) {
const int w = kMaxSize, h = kMaxSize;
const int bd = GET_PARAM(0);
const int has_subx = GET_PARAM(2);
const int has_suby = GET_PARAM(3);
const int is_compound = GET_PARAM(4);
int hfilter, vfilter, subx, suby;
uint16_t input[kMaxSize * kMaxSize];
DECLARE_ALIGNED(32, uint16_t, output[MAX_SB_SQUARE]);
DECLARE_ALIGNED(32, uint16_t, output2[MAX_SB_SQUARE]);
(void)is_compound;
for (int i = 0; i < h; ++i)
for (int j = 0; j < w; ++j)
input[i * w + j] = rnd_.Rand16() & ((1 << bd) - 1);
for (int i = 0; i < MAX_SB_SQUARE; ++i)
output[i] = output2[i] = rnd_.Rand31();
for (int block_idx = BLOCK_4X4; block_idx < BLOCK_SIZES_ALL; ++block_idx) {
// Make sure that sizes 2xN and Nx2 are also tested for chroma.
const int num_sizes =
(block_size_wide[block_idx] == 4 || block_size_high[block_idx] == 4)
? 2
: 1;
for (int shift = 0; shift < num_sizes; ++shift) { // luma and chroma
const int out_w = block_size_wide[block_idx] >> shift;
const int out_h = block_size_high[block_idx] >> shift;
for (hfilter = EIGHTTAP_REGULAR; hfilter < INTERP_FILTERS_ALL;
++hfilter) {
for (vfilter = EIGHTTAP_REGULAR; vfilter < INTERP_FILTERS_ALL;
++vfilter) {
InterpFilterParams filter_params_x =
av1_get_interp_filter_params((InterpFilter)hfilter);
InterpFilterParams filter_params_y =
av1_get_interp_filter_params((InterpFilter)vfilter);
for (int do_average = 0; do_average < 1; ++do_average) {
ConvolveParams conv_params1 =
get_conv_params_no_round(0, do_average, 0, NULL, 0, 0, bd);
ConvolveParams conv_params2 =
get_conv_params_no_round(0, do_average, 0, NULL, 0, 0, bd);
const int subx_range = has_subx ? 16 : 1;
const int suby_range = has_suby ? 16 : 1;
for (subx = 0; subx < subx_range; ++subx) {
for (suby = 0; suby < suby_range; ++suby) {
// Choose random locations within the source block
const int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7);
const int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7);
av1_highbd_convolve_2d_sr_c(input + offset_r * w + offset_c, w,
output, MAX_SB_SIZE, out_w, out_h,
&filter_params_x, &filter_params_y,
subx, suby, &conv_params1, bd);
test_impl(input + offset_r * w + offset_c, w, output2,
MAX_SB_SIZE, out_w, out_h, &filter_params_x,
&filter_params_y, subx, suby, &conv_params2, bd);
if (memcmp(output, output2, sizeof(output))) {
for (int i = 0; i < MAX_SB_SIZE; ++i) {
for (int j = 0; j < MAX_SB_SIZE; ++j) {
int idx = i * MAX_SB_SIZE + j;
ASSERT_EQ(output[idx], output2[idx])
<< out_w << "x" << out_h
<< " Pixel mismatch at index " << idx << " = (" << i
<< ", " << j << "), sub pixel offset = (" << suby
<< ", " << subx << ")";
}
}
}
}
}
}
}
}
}
}
}
#if CONFIG_JNT_COMP
AV1HighbdJntConvolve2DTest::~AV1HighbdJntConvolve2DTest() {}
void AV1HighbdJntConvolve2DTest::SetUp() {
......@@ -520,12 +614,12 @@ void AV1HighbdJntConvolve2DTest::RunCheckOutput(
const int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7);
const int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7);
av1_highbd_jnt_convolve_2d_c(input + offset_r * w + offset_c, w,
output, MAX_SB_SIZE, out_w, out_h,
NULL, 0, out_w, out_h,
&filter_params_x, &filter_params_y,
subx, suby, &conv_params1, bd);
test_impl(input + offset_r * w + offset_c, w, output2,
MAX_SB_SIZE, out_w, out_h, &filter_params_x,
&filter_params_y, subx, suby, &conv_params2, bd);
test_impl(input + offset_r * w + offset_c, w, NULL, 0, out_w,
out_h, &filter_params_x, &filter_params_y, subx, suby,
&conv_params2, bd);
for (int i = 0; i < out_h; ++i) {
for (int j = 0; j < out_w; ++j) {
......@@ -556,12 +650,12 @@ void AV1HighbdJntConvolve2DTest::RunCheckOutput(
const int offset_r = 3 + rnd_.PseudoUniform(h - out_h - 7);
const int offset_c = 3 + rnd_.PseudoUniform(w - out_w - 7);
av1_highbd_jnt_convolve_2d_c(
input + offset_r * w + offset_c, w, output, MAX_SB_SIZE,
out_w, out_h, &filter_params_x, &filter_params_y, subx,
suby, &conv_params1, bd);
test_impl(input + offset_r * w + offset_c, w, output2,
MAX_SB_SIZE, out_w, out_h, &filter_params_x,
&filter_params_y, subx, suby, &conv_params2, bd);
input + offset_r * w + offset_c, w, NULL, 0, out_w, out_h,
&filter_params_x, &filter_params_y, subx, suby,
&conv_params1, bd);
test_impl(input + offset_r * w + offset_c, w, NULL, 0, out_w,
out_h, &filter_params_x, &filter_params_y, subx,
suby, &conv_params2, bd);
for (int i = 0; i < out_h; ++i) {
for (int j = 0; j < out_w; ++j) {
......
......@@ -83,15 +83,17 @@ class AV1JntConvolve2DTest : public ::testing::TestWithParam<Convolve2DParam> {
namespace AV1HighbdConvolve2D {
typedef void (*highbd_convolve_2d_func)(
const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride,
int w, int h, InterpFilterParams *filter_params_x,
const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w,
int h, InterpFilterParams *filter_params_x,
InterpFilterParams *filter_params_y, const int subpel_x_q4,
const int subpel_y_q4, ConvolveParams *conv_params, int bd);
typedef std::tr1::tuple<int, highbd_convolve_2d_func> HighbdConvolve2DParam;
typedef std::tr1::tuple<int, highbd_convolve_2d_func, int, int, int>
HighbdConvolve2DParam;
::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams(
highbd_convolve_2d_func filter);
highbd_convolve_2d_func filter, int subx_exist, int suby_exist,
int is_compound);
class AV1HighbdConvolve2DTest
: public ::testing::TestWithParam<HighbdConvolve2DParam> {
......@@ -107,6 +109,20 @@ class AV1HighbdConvolve2DTest
libaom_test::ACMRandom rnd_;
};
class AV1HighbdConvolve2DSrTest
: public ::testing::TestWithParam<HighbdConvolve2DParam> {
public:
virtual ~AV1HighbdConvolve2DSrTest();
virtual void SetUp();
virtual void TearDown();
protected:
void RunCheckOutput(highbd_convolve_2d_func test_impl);
libaom_test::ACMRandom rnd_;
};
#if CONFIG_JNT_COMP
class AV1HighbdJntConvolve2DTest
: public ::testing::TestWithParam<HighbdConvolve2DParam> {
......
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