Commit 05685e9a authored by Angie Chiang's avatar Angie Chiang

Make convolve_round work with warped_motion

Warped_motion doesn't go through inter_predictor() function to
generate prediction where convolve_round is activated.
Therefore, we could avoid doing post rounding when the
warped_motion mode is on.

We use do_post_rounding to indicate whether post rounding is
needed
Change-Id: Ib17a0c0d4e6e5232e9682afa8cfdb9576f5cf4c0
parent 930c51c3
...@@ -33,6 +33,7 @@ typedef struct ConvolveParams { ...@@ -33,6 +33,7 @@ typedef struct ConvolveParams {
int round_0; int round_0;
int round_1; int round_1;
int plane; int plane;
int do_post_rounding;
} ConvolveParams; } ConvolveParams;
static INLINE ConvolveParams get_conv_params(int ref, int plane) { static INLINE ConvolveParams get_conv_params(int ref, int plane) {
...@@ -40,6 +41,7 @@ static INLINE ConvolveParams get_conv_params(int ref, int plane) { ...@@ -40,6 +41,7 @@ static INLINE ConvolveParams get_conv_params(int ref, int plane) {
conv_params.ref = ref; conv_params.ref = ref;
conv_params.round = CONVOLVE_OPT_ROUND; conv_params.round = CONVOLVE_OPT_ROUND;
conv_params.plane = plane; conv_params.plane = plane;
conv_params.do_post_rounding = 0;
return conv_params; return conv_params;
} }
struct AV1Common; struct AV1Common;
...@@ -73,6 +75,7 @@ static INLINE ConvolveParams get_conv_params_no_round(int ref, int plane, ...@@ -73,6 +75,7 @@ static INLINE ConvolveParams get_conv_params_no_round(int ref, int plane,
conv_params.dst = dst; conv_params.dst = dst;
conv_params.dst_stride = dst_stride; conv_params.dst_stride = dst_stride;
conv_params.plane = plane; conv_params.plane = plane;
conv_params.do_post_rounding = 0;
return conv_params; return conv_params;
} }
......
...@@ -1151,19 +1151,21 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, ...@@ -1151,19 +1151,21 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane,
} }
#if CONFIG_CONVOLVE_ROUND #if CONFIG_CONVOLVE_ROUND
// TODO(angiebird): This part needs optimization // TODO(angiebird): This part needs optimization
if (conv_params.do_post_rounding) {
#if CONFIG_HIGHBITDEPTH #if CONFIG_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
av1_highbd_convolve_rounding(tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride, av1_highbd_convolve_rounding(tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride,
w, h, FILTER_BITS * 2 + is_compound - w, h, FILTER_BITS * 2 + is_compound -
conv_params.round_0 - conv_params.round_0 -
conv_params.round_1, conv_params.round_1,
xd->bd); xd->bd);
else else
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
av1_convolve_rounding(tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride, w, h, av1_convolve_rounding(tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride, w, h,
FILTER_BITS * 2 + is_compound - FILTER_BITS * 2 + is_compound -
conv_params.round_0 - conv_params.round_1); conv_params.round_0 - conv_params.round_1);
}
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND
} }
} }
......
...@@ -72,6 +72,7 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride, ...@@ -72,6 +72,7 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
&interp_filter, &interp_filter,
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER
subpel_x, xs, subpel_y, ys, conv_params); subpel_x, xs, subpel_y, ys, conv_params);
conv_params->do_post_rounding = 1;
#else #else
assert(0); assert(0);
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND
...@@ -136,6 +137,7 @@ static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride, ...@@ -136,6 +137,7 @@ static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride,
&interp_filter, &interp_filter,
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER
subpel_x, xs, subpel_y, ys, conv_params, bd); subpel_x, xs, subpel_y, ys, conv_params, bd);
conv_params->do_post_rounding = 1;
#else #else
assert(0); assert(0);
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND
......
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