Commit 9c5b1088 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Add scaled convolve functions for convolve_round

Change-Id: I343d94520955b6632c2a990af26454859b29a97e
parent 9b75e210
......@@ -620,11 +620,14 @@ if (aom_config("CONFIG_CONVOLVE_ROUND") eq "yes") {
add_proto qw/void av1_convolve_rounding/, "const int32_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, int h, int bits";
specialize qw/av1_convolve_rounding avx2/;
add_proto qw/void av1_convolve_2d_scale/, "const uint8_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_qn, const int x_step_qn, const int subpel_y_q4, const int y_step_qn, ConvolveParams *conv_params";
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
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";
specialize qw/av1_highbd_convolve_2d ssse3/;
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/;
add_proto qw/void av1_highbd_convolve_2d_scale/, "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 x_step_qn, const int subpel_y_q4, const int y_step_qn, ConvolveParams *conv_params, int bd";
}
}
......
This diff is collapsed.
......@@ -54,7 +54,7 @@ void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h,
const InterpFilter *interp_filter,
const int subpel_x_q4, int x_step_q4,
const int subpel_y_q4, int y_step_q4,
const int subpel_y_q4, int y_step_q4, int scaled,
ConvolveParams *conv_params);
static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average,
......@@ -83,7 +83,8 @@ void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride,
const InterpFilter *interp_filter,
const int subpel_x_q4, int x_step_q4,
const int subpel_y_q4, int y_step_q4,
ConvolveParams *conv_params, int bd);
int scaled, ConvolveParams *conv_params,
int bd);
#endif
#endif // CONFIG_CONVOLVE_ROUND
......
......@@ -66,8 +66,24 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
if (has_scale(xs, ys)) {
// TODO(afergs, debargha): Use a different scale convolve function
// that uses higher precision for subpel_x, subpel_y, xs, ys
av1_convolve_scale(src, src_stride, dst, dst_stride, w, h, interp_filter,
subpel_x, xs, subpel_y, ys, conv_params);
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
#if CONFIG_CONVOLVE_ROUND
av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
#if CONFIG_DUAL_FILTER
interp_filter,
#else // CONFIG_DUAL_FILTER
&interp_filter,
#endif // CONFIG_DUAL_FILTER
subpel_x, xs, subpel_y, ys, 1, conv_params);
conv_params->do_post_rounding = 1;
#else
assert(0);
#endif // CONFIG_CONVOLVE_ROUND
} else {
assert(conv_params->round == CONVOLVE_OPT_ROUND);
av1_convolve_scale(src, src_stride, dst, dst_stride, w, h, interp_filter,
subpel_x, xs, subpel_y, ys, conv_params);
}
} else {
subpel_x >>= SCALE_EXTRA_BITS;
subpel_y >>= SCALE_EXTRA_BITS;
......@@ -85,7 +101,7 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
#else // CONFIG_DUAL_FILTER
&interp_filter,
#endif // CONFIG_DUAL_FILTER
subpel_x, xs, subpel_y, ys, conv_params);
subpel_x, xs, subpel_y, ys, 0, conv_params);
conv_params->do_post_rounding = 1;
#else
assert(0);
......@@ -138,10 +154,25 @@ static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride,
#endif
if (has_scale(xs, ys)) {
av1_highbd_convolve_scale(
src, src_stride, dst, dst_stride, w, h, interp_filter,
subpel_x >> SCALE_EXTRA_BITS, xs >> SCALE_EXTRA_BITS,
subpel_y >> SCALE_EXTRA_BITS, ys >> SCALE_EXTRA_BITS, avg, bd);
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
#if CONFIG_CONVOLVE_ROUND
av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
#if CONFIG_DUAL_FILTER
interp_filter,
#else // CONFIG_DUAL_FILTER
&interp_filter,
#endif // CONFIG_DUAL_FILTER
subpel_x, xs, subpel_y, ys, 1, conv_params,
bd);
conv_params->do_post_rounding = 1;
#else
assert(0);
#endif // CONFIG_CONVOLVE_ROUND
} else {
av1_highbd_convolve_scale(src, src_stride, dst, dst_stride, w, h,
interp_filter, subpel_x, xs, subpel_y, ys, avg,
bd);
}
} else {
subpel_x >>= SCALE_EXTRA_BITS;
subpel_y >>= SCALE_EXTRA_BITS;
......@@ -159,7 +190,7 @@ static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride,
#else // CONFIG_DUAL_FILTER
&interp_filter,
#endif // CONFIG_DUAL_FILTER
subpel_x, xs, subpel_y, ys, conv_params,
subpel_x, xs, subpel_y, ys, 0, conv_params,
bd);
conv_params->do_post_rounding = 1;
#else
......
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