Stop using get_conv_params_round()
This is the first step towards clean ups to remove the round
convolve option completely.
Change-Id: I89594c4f825d8c73f39413e184916a14325ee822
diff --git a/av1/common/convolve.c b/av1/common/convolve.c
index e96aa44..a8fac2a 100644
--- a/av1/common/convolve.c
+++ b/av1/common/convolve.c
@@ -82,7 +82,6 @@
const int subpel_x_q4, int x_step_q4,
ConvolveParams *conv_params) {
int filter_size = filter_params.taps;
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
src -= filter_size / 2 - 1;
for (int y = 0; y < h; ++y) {
int x_q4 = subpel_x_q4;
@@ -112,7 +111,6 @@
const int subpel_x_qn, int x_step_qn,
ConvolveParams *conv_params) {
int filter_size = filter_params.taps;
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
src -= filter_size / 2 - 1;
for (int y = 0; y < h; ++y) {
int x_qn = subpel_x_qn;
@@ -144,7 +142,6 @@
const int subpel_y_q4, int y_step_q4,
ConvolveParams *conv_params) {
int filter_size = filter_params.taps;
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
src -= src_stride * (filter_size / 2 - 1);
for (int x = 0; x < w; ++x) {
int y_q4 = subpel_y_q4;
@@ -175,7 +172,6 @@
const int subpel_y_qn, int y_step_qn,
ConvolveParams *conv_params) {
int filter_size = filter_params.taps;
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
src -= src_stride * (filter_size / 2 - 1);
for (int x = 0; x < w; ++x) {
int y_qn = subpel_y_qn;
@@ -206,7 +202,6 @@
static void convolve_copy(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (conv_params->do_average == 0) {
for (int r = 0; r < h; ++r) {
memcpy(dst, src, w);
@@ -229,7 +224,6 @@
const InterpFilterParams filter_params,
const int subpel_x_q4, int x_step_q4,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (filter_params.taps == SUBPEL_TAPS) {
const int16_t *filter_x =
av1_get_interp_filter_subpel_kernel(filter_params, subpel_x_q4);
@@ -250,7 +244,6 @@
const InterpFilterParams filter_params,
const int subpel_x_q4, int x_step_q4,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (filter_params.taps == SUBPEL_TAPS) {
const int16_t *filter_x =
av1_get_interp_filter_subpel_kernel(filter_params, subpel_x_q4);
@@ -271,7 +264,6 @@
const InterpFilterParams filter_params,
const int subpel_x_qn, int x_step_qn,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (filter_params.taps == SUBPEL_TAPS) {
const int16_t *filter_x = av1_get_interp_filter_subpel_kernel(
filter_params, subpel_x_qn >> SCALE_EXTRA_BITS);
@@ -293,7 +285,6 @@
const InterpFilterParams filter_params,
const int subpel_y_q4, int y_step_q4,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (filter_params.taps == SUBPEL_TAPS) {
const int16_t *filter_y =
av1_get_interp_filter_subpel_kernel(filter_params, subpel_y_q4);
@@ -315,7 +306,6 @@
const InterpFilterParams filter_params,
const int subpel_y_q4, int y_step_q4,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (filter_params.taps == SUBPEL_TAPS) {
const int16_t *filter_y =
av1_get_interp_filter_subpel_kernel(filter_params, subpel_y_q4);
@@ -337,7 +327,6 @@
const InterpFilterParams filter_params,
const int subpel_y_qn, int y_step_qn,
ConvolveParams *conv_params) {
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
if (filter_params.taps == SUBPEL_TAPS) {
const int16_t *filter_y = av1_get_interp_filter_subpel_kernel(
filter_params, subpel_y_qn >> SCALE_EXTRA_BITS);
@@ -1704,8 +1693,6 @@
&filter_params_y);
#endif
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
-
assert(w <= MAX_BLOCK_WIDTH);
assert(h <= MAX_BLOCK_HEIGHT);
assert(y_step_q4 <= MAX_STEP);
@@ -1733,7 +1720,6 @@
ConvolveParams temp_conv_params;
temp_conv_params.ref = 0;
temp_conv_params.do_average = 0;
- temp_conv_params.round = CONVOLVE_OPT_ROUND;
filter_size = filter_params_y.taps;
const int intermediate_height =
(((h - 1) * y_step_q4 + subpel_y_q4) >> SUBPEL_BITS) + filter_size;
@@ -1774,7 +1760,6 @@
av1_get_convolve_filter_params(interp_filters, &filter_params_x,
&filter_params_y);
#endif
- assert(conv_params->round == CONVOLVE_OPT_ROUND);
assert(w <= MAX_BLOCK_WIDTH);
assert(h <= MAX_BLOCK_HEIGHT);
@@ -1803,7 +1788,6 @@
ConvolveParams temp_conv_params;
temp_conv_params.ref = 0;
temp_conv_params.do_average = 0;
- temp_conv_params.round = CONVOLVE_OPT_ROUND;
filter_size = filter_params_y.taps;
const int intermediate_height =
(((h - 1) * y_step_qn + subpel_y_qn) >> SCALE_SUBPEL_BITS) +
diff --git a/av1/common/convolve.h b/av1/common/convolve.h
index d3c84ff..112c9c7 100644
--- a/av1/common/convolve.h
+++ b/av1/common/convolve.h
@@ -92,30 +92,6 @@
int scaled, ConvolveParams *conv_params,
const struct scale_factors *sf);
-static INLINE ConvolveParams get_conv_params_round(int ref, int do_average,
- int plane, int bd) {
- ConvolveParams conv_params;
- conv_params.ref = ref;
- conv_params.do_average = do_average;
- conv_params.plane = plane;
- conv_params.round = CONVOLVE_OPT_ROUND;
- conv_params.round_0 = ROUND0_BITS;
- conv_params.round_1 = 0;
- conv_params.is_compound = 0;
- conv_params.dst = NULL;
- conv_params.dst_stride = 0;
-#if CONFIG_LOWPRECISION_BLEND
- const int intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2;
- if (bd < 12) assert(intbufrange <= 16);
- if (intbufrange > 16) {
- conv_params.round_0 += intbufrange - 16;
- }
-#else
- (void)bd;
-#endif // CONFIG_LOWPRECISION_BLEND
- return conv_params;
-}
-
static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average,
int plane,
CONV_BUF_TYPE *dst,
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index f672fba..4f884fe 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -819,7 +819,7 @@
mv.row += SCALE_EXTRA_OFF;
const int subpel_x = mv.col & SCALE_SUBPEL_MASK;
const int subpel_y = mv.row & SCALE_SUBPEL_MASK;
- ConvolveParams conv_params = get_conv_params(ref, ref, plane, xd->bd);
+ ConvolveParams conv_params = get_conv_params(ref, 0, plane, xd->bd);
src += (mv.row >> SCALE_SUBPEL_BITS) * src_stride +
(mv.col >> SCALE_SUBPEL_BITS);
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
index 757c8d8..0ced151 100644
--- a/av1/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -41,7 +41,7 @@
enum mv_precision mv_precision_uv;
int uv_stride;
// TODO(angiebird): change plane setting accordingly
- ConvolveParams conv_params = get_conv_params(which_mv, which_mv, 0, xd->bd);
+ ConvolveParams conv_params = get_conv_params(which_mv, 0, 0, xd->bd);
const InterpFilters interp_filters = xd->mi[0]->mbmi.interp_filters;
WarpTypesAllowed warp_types;
memset(&warp_types, 0, sizeof(WarpTypesAllowed));
diff --git a/test/av1_convolve_optimz_test.cc b/test/av1_convolve_optimz_test.cc
index e0b7e1d..4ed4a01 100644
--- a/test/av1_convolve_optimz_test.cc
+++ b/test/av1_convolve_optimz_test.cc
@@ -66,7 +66,7 @@
subpel_ = GET_PARAM(4);
int ref = GET_PARAM(5);
const int plane = 0;
- conv_params_ = get_conv_params_round(ref, ref, plane, 8);
+ conv_params_ = get_conv_params(ref, 0, plane, 8);
alloc_ = new uint8_t[maxBlockSize * 4];
src_ = alloc_ + (vertiOffset * maxWidth);
diff --git a/test/av1_convolve_test.cc b/test/av1_convolve_test.cc
index 397fc70..cb58289 100644
--- a/test/av1_convolve_test.cc
+++ b/test/av1_convolve_test.cc
@@ -149,7 +149,7 @@
TEST_P(Av1ConvolveTest, av1_convolve_vert) {
const int y_step_q4 = 16;
- ConvolveParams conv_params = get_conv_params_round(0, 0, 0, 8);
+ ConvolveParams conv_params = get_conv_params(0, 0, 0, 8);
int in_stride, out_stride, ref_out_stride, avg_out_stride, ref_avg_out_stride;
uint8_t *in = add_input(MAX_SB_SIZE, MAX_SB_SIZE, &in_stride);
@@ -202,7 +202,7 @@
TEST_P(Av1ConvolveTest, av1_convolve_horiz) {
const int x_step_q4 = 16;
- ConvolveParams conv_params = get_conv_params_round(0, 0, 0, 8);
+ ConvolveParams conv_params = get_conv_params(0, 0, 0, 8);
int in_stride, out_stride, ref_out_stride, avg_out_stride, ref_avg_out_stride;
uint8_t *in = add_input(MAX_SB_SIZE, MAX_SB_SIZE, &in_stride);