Commit 81b2e502 authored by Angie Chiang's avatar Angie Chiang

Pass conv_params into warp-related functions

This aims at integrate convolve_round/compound_round
with global_motion

Change-Id: I1d91ff2de6b075f807eaaaa0a7a66edb2036e57b
parent 31d19279
......@@ -605,11 +605,11 @@ if (aom_config("CONFIG_PVQ") eq "yes") {
if ((aom_config("CONFIG_WARPED_MOTION") eq "yes") ||
(aom_config("CONFIG_GLOBAL_MOTION") eq "yes")) {
add_proto qw/void av1_warp_affine/, "const int32_t *mat, const uint8_t *ref, int width, int height, int stride, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int comp_avg, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
add_proto qw/void av1_warp_affine/, "const int32_t *mat, const uint8_t *ref, int width, int height, int stride, uint8_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
specialize qw/av1_warp_affine sse2 ssse3/;
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
add_proto qw/void av1_highbd_warp_affine/, "const int32_t *mat, const uint16_t *ref, int width, int height, int stride, uint16_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, int comp_avg, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
add_proto qw/void av1_highbd_warp_affine/, "const int32_t *mat, const uint16_t *ref, int width, int height, int stride, uint16_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
specialize qw/av1_highbd_warp_affine ssse3/;
}
}
......
......@@ -433,8 +433,7 @@ static INLINE void av1_make_inter_predictor(
#endif // CONFIG_HIGHBITDEPTH
pre_buf->buf0, pre_buf->width, pre_buf->height,
pre_buf->stride, dst, p_col, p_row, w, h, dst_stride,
pd->subsampling_x, pd->subsampling_y, xs, ys,
conv_params->do_average);
pd->subsampling_x, pd->subsampling_y, xs, ys, conv_params);
return;
}
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
#include "aom_ports/mem.h"
#include "aom_dsp/aom_dsp_common.h"
#include "av1/common/mv.h"
#include "av1/common/convolve.h"
#define MAX_PARAMDIM 9
#if CONFIG_WARPED_MOTION
......@@ -100,7 +101,8 @@ void av1_warp_plane(WarpedMotionParams *wm,
const uint8_t *ref, int width, int height, int stride,
uint8_t *pred, int p_col, int p_row, int p_width,
int p_height, int p_stride, int subsampling_x,
int subsampling_y, int x_scale, int y_scale, int comp_avg);
int subsampling_y, int x_scale, int y_scale,
ConvolveParams *conv_params);
int find_projection(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, int mvy,
int mvx, WarpedMotionParams *wm_params, int mi_row,
......
......@@ -19,8 +19,9 @@ void av1_highbd_warp_affine_ssse3(const int32_t *mat, const uint16_t *ref,
uint16_t *pred, int p_col, int p_row,
int p_width, int p_height, int p_stride,
int subsampling_x, int subsampling_y, int bd,
int comp_avg, int16_t alpha, int16_t beta,
int16_t gamma, int16_t delta) {
ConvolveParams *conv_params, int16_t alpha,
int16_t beta, int16_t gamma, int16_t delta) {
int comp_avg = conv_params->do_average;
#if HORSHEAR_REDUCE_PREC_BITS >= 5
__m128i tmp[15];
#else
......
......@@ -17,9 +17,10 @@
void av1_warp_affine_sse2(const int32_t *mat, const uint8_t *ref, int width,
int height, int stride, uint8_t *pred, int p_col,
int p_row, int p_width, int p_height, int p_stride,
int subsampling_x, int subsampling_y, int comp_avg,
int16_t alpha, int16_t beta, int16_t gamma,
int16_t delta) {
int subsampling_x, int subsampling_y,
ConvolveParams *conv_params, int16_t alpha,
int16_t beta, int16_t gamma, int16_t delta) {
int comp_avg = conv_params->do_average;
__m128i tmp[15];
int i, j, k;
const int bd = 8;
......
......@@ -204,9 +204,10 @@ static const uint8_t odd_mask[16] = { 1, 3, 3, 5, 5, 7, 7, 9,
void av1_warp_affine_ssse3(const int32_t *mat, const uint8_t *ref, int width,
int height, int stride, uint8_t *pred, int p_col,
int p_row, int p_width, int p_height, int p_stride,
int subsampling_x, int subsampling_y, int comp_avg,
int16_t alpha, int16_t beta, int16_t gamma,
int16_t delta) {
int subsampling_x, int subsampling_y,
ConvolveParams *conv_params, int16_t alpha,
int16_t beta, int16_t gamma, int16_t delta) {
int comp_avg = conv_params->do_average;
__m128i tmp[15];
int i, j, k;
const int bd = 8;
......
......@@ -112,6 +112,7 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) {
uint8_t *output2 = new uint8_t[output_n];
int32_t mat[8];
int16_t alpha, beta, gamma, delta;
ConvolveParams conv_params = get_conv_params(0, 0, 0);
// Generate an input block and extend its borders horizontally
for (i = 0; i < h; ++i)
......@@ -126,10 +127,10 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) {
for (sub_y = 0; sub_y < 2; ++sub_y) {
generate_model(mat, &alpha, &beta, &gamma, &delta);
av1_warp_affine_c(mat, input, w, h, stride, output, 32, 32, out_w,
out_h, out_w, sub_x, sub_y, 0, alpha, beta, gamma,
delta);
out_h, out_w, sub_x, sub_y, &conv_params, alpha, beta,
gamma, delta);
test_impl(mat, input, w, h, stride, output2, 32, 32, out_w, out_h,
out_w, sub_x, sub_y, 0, alpha, beta, gamma, delta);
out_w, sub_x, sub_y, &conv_params, alpha, beta, gamma, delta);
for (j = 0; j < out_w * out_h; ++j)
ASSERT_EQ(output[j], output2[j])
......@@ -248,6 +249,7 @@ void AV1HighbdWarpFilterTest::RunCheckOutput(
uint16_t *output2 = new uint16_t[output_n];
int32_t mat[8];
int16_t alpha, beta, gamma, delta;
ConvolveParams conv_params = get_conv_params(0, 0, 0);
// Generate an input block and extend its borders horizontally
for (i = 0; i < h; ++i)
......@@ -265,10 +267,11 @@ void AV1HighbdWarpFilterTest::RunCheckOutput(
generate_model(mat, &alpha, &beta, &gamma, &delta);
av1_highbd_warp_affine_c(mat, input, w, h, stride, output, 32, 32,
out_w, out_h, out_w, sub_x, sub_y, bd, 0,
alpha, beta, gamma, delta);
out_w, out_h, out_w, sub_x, sub_y, bd,
&conv_params, alpha, beta, gamma, delta);
test_impl(mat, input, w, h, stride, output2, 32, 32, out_w, out_h,
out_w, sub_x, sub_y, bd, 0, alpha, beta, gamma, delta);
out_w, sub_x, sub_y, bd, &conv_params, alpha, beta, gamma,
delta);
for (j = 0; j < out_w * out_h; ++j)
ASSERT_EQ(output[j], output2[j])
......
......@@ -31,8 +31,8 @@ typedef void (*warp_affine_func)(const int32_t *mat, const uint8_t *ref,
uint8_t *pred, int p_col, int p_row,
int p_width, int p_height, int p_stride,
int subsampling_x, int subsampling_y,
int ref_frm, int16_t alpha, int16_t beta,
int16_t gamma, int16_t delta);
ConvolveParams *conv_params, int16_t alpha,
int16_t beta, int16_t gamma, int16_t delta);
typedef std::tr1::tuple<int, int, int, warp_affine_func> WarpTestParam;
......@@ -60,11 +60,14 @@ class AV1WarpFilterTest : public ::testing::TestWithParam<WarpTestParam> {
#if CONFIG_HIGHBITDEPTH
namespace AV1HighbdWarpFilter {
typedef void (*highbd_warp_affine_func)(
const int32_t *mat, const uint16_t *ref, int width, int height, int stride,
uint16_t *pred, int p_col, int p_row, int p_width, int p_height,
int p_stride, int subsampling_x, int subsampling_y, int bd, int ref_frm,
int16_t alpha, int16_t beta, int16_t gamma, int16_t delta);
typedef void (*highbd_warp_affine_func)(const int32_t *mat, const uint16_t *ref,
int width, int height, int stride,
uint16_t *pred, int p_col, int p_row,
int p_width, int p_height, int p_stride,
int subsampling_x, int subsampling_y,
int bd, ConvolveParams *conv_params,
int16_t alpha, int16_t beta,
int16_t gamma, int16_t delta);
typedef std::tr1::tuple<int, int, int, int> HighbdWarpTestParam;
......
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