Add CONVOLVE_POST_ROUNDING flag
By turning on CONVOLVE_POST_ROUNDING, in the compound inter
prediction mode, FILTER_BITS rounding is moved after the summation
of two predictions.
Note that the post rounding is only applied on non-sub8x8 block
PSNR BDRate
lowres -0.808% -0.673%
Change-Id: Ib91304e6122c24d832a582ab9f5757d33eac876c
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index eaff6c8..be4e886 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -866,6 +866,9 @@
uint8_t *pre[2];
MV32 scaled_mv[2];
SubpelParams subpel_params[2];
+#if CONVOLVE_POST_ROUNDING
+ int32_t tmp_dst[MAX_SB_SIZE * MAX_SB_SIZE];
+#endif // CONVOLVE_POST_ROUNDING
for (ref = 0; ref < 1 + is_compound; ++ref) {
const struct scale_factors *const sf = &xd->block_refs[ref]->sf;
@@ -916,8 +919,13 @@
for (ref = 0; ref < 1 + is_compound; ++ref) {
const struct scale_factors *const sf = &xd->block_refs[ref]->sf;
- ConvolveParams conv_params = get_conv_params(ref);
struct buf_2d *const pre_buf = &pd->pre[ref];
+#if CONVOLVE_POST_ROUNDING
+ ConvolveParams conv_params =
+ get_conv_params_no_round(ref, tmp_dst, MAX_SB_SIZE);
+#else
+ ConvolveParams conv_params = get_conv_params(ref);
+#endif // CONVOLVE_POST_ROUNDING
#if CONFIG_EXT_INTER
if (ref &&
is_masked_compound_type(mi->mbmi.interinter_compound_data.type))
@@ -955,6 +963,11 @@
&conv_params, mi->mbmi.interp_filter, subpel_params[ref].xs,
subpel_params[ref].ys, xd);
}
+
+#if CONVOLVE_POST_ROUNDING
+ // TODO(angiebird): This part needs optimization
+ av1_convolve_rounding(tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride, w, h);
+#endif // CONVOLVE_POST_ROUNDING
}
}