Commit 27e90295 authored by Rupert Swarbrick's avatar Rupert Swarbrick

Pack InterpFilters into a single integer

Before this patch, if CONFIG_DUAL_FILTER was true then an MB_MODE_INFO
stored its filter choices as an array of four numbers, each of which
was between 0 and 10. It also seems that elements 2 and 3 of the array
were always the same as elements 0 and 1 when used.

This patch defines a new type(def) called InterpFilters together with
constructor and extractor functions. When CONFIG_DUAL_FILTER is zero,
InterpFilters is a synonym for InterpFilter and the constructor and
extractor functions should compile away to nothing. When it is
nonzero, InterpFilters is a uint32_t which stores the x filter in the
high part and the y filter in the low part (this looks strange, but
matches the old numbering).

Making this change allows us to get rid of lots of special case code
that was dependent on CONFIG_DUAL_FILTER. The uniform
extract/make/broadcast interface also actually shortens code in
general.

Change-Id: I6b24a61bac3e4b220d8d46d0b27cfe865dcfba81
parent 26ad0b22
...@@ -378,12 +378,8 @@ typedef struct MB_MODE_INFO { ...@@ -378,12 +378,8 @@ typedef struct MB_MODE_INFO {
uint8_t use_intrabc; uint8_t use_intrabc;
#endif // CONFIG_INTRABC #endif // CONFIG_INTRABC
// Only for INTER blocks // Only for INTER blocks
#if CONFIG_DUAL_FILTER InterpFilters interp_filters;
InterpFilter interp_filter[4];
#else
InterpFilter interp_filter;
#endif
MV_REFERENCE_FRAME ref_frame[2]; MV_REFERENCE_FRAME ref_frame[2];
TX_TYPE tx_type; TX_TYPE tx_type;
#if CONFIG_TXK_SEL #if CONFIG_TXK_SEL
......
This diff is collapsed.
...@@ -47,15 +47,49 @@ static INLINE ConvolveParams get_conv_params(int ref, int do_average, ...@@ -47,15 +47,49 @@ static INLINE ConvolveParams get_conv_params(int ref, int do_average,
conv_params.do_post_rounding = 0; conv_params.do_post_rounding = 0;
return conv_params; return conv_params;
} }
#if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
static INLINE void av1_convolve_filter_params_fixup_1212(
const InterpFilterParams *params_x, InterpFilterParams *params_y) {
if (params_x->interp_filter == MULTITAP_SHARP &&
params_y->interp_filter == MULTITAP_SHARP) {
// Avoid two directions both using 12-tap filter.
// This will reduce hardware implementation cost.
*params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP);
}
}
#endif
static INLINE void av1_get_convolve_filter_params(
InterpFilters interp_filters, int avoid_1212, InterpFilterParams *params_x,
InterpFilterParams *params_y) {
#if CONFIG_DUAL_FILTER
InterpFilter filter_x = av1_extract_interp_filter(interp_filters, 1);
InterpFilter filter_y = av1_extract_interp_filter(interp_filters, 0);
#else
InterpFilter filter_x = av1_extract_interp_filter(interp_filters, 0);
InterpFilter filter_y = av1_extract_interp_filter(interp_filters, 0);
#endif
*params_x = av1_get_interp_filter_params(filter_x);
*params_y = av1_get_interp_filter_params(filter_y);
if (avoid_1212) {
#if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
convolve_filter_params_fixup_1212(params_x, params_y);
#endif
}
}
struct AV1Common; struct AV1Common;
void av1_convolve_init(struct AV1Common *cm); void av1_convolve_init(struct AV1Common *cm);
#if CONFIG_CONVOLVE_ROUND #if CONFIG_CONVOLVE_ROUND
void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst, void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, int dst_stride, int w, int h,
const InterpFilter *interp_filter, InterpFilters interp_filters, const int subpel_x_q4,
const int subpel_x_q4, int x_step_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, int scaled, ConvolveParams *conv_params);
ConvolveParams *conv_params);
static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average, static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average,
int plane, int32_t *dst, int plane, int32_t *dst,
...@@ -80,7 +114,7 @@ static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average, ...@@ -80,7 +114,7 @@ static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average,
#if CONFIG_HIGHBITDEPTH #if CONFIG_HIGHBITDEPTH
void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride, void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride,
uint8_t *dst, int dst_stride, int w, int h, uint8_t *dst, int dst_stride, int w, int h,
const InterpFilter *interp_filter, InterpFilters interp_filters,
const int subpel_x_q4, int x_step_q4, 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, int scaled, ConvolveParams *conv_params,
...@@ -89,55 +123,33 @@ void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride, ...@@ -89,55 +123,33 @@ void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride,
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND
void av1_convolve(const uint8_t *src, int src_stride, uint8_t *dst, void av1_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, int dst_stride, int w, int h, InterpFilters interp_filters,
#if CONFIG_DUAL_FILTER
const InterpFilter *interp_filter,
#else
const InterpFilter interp_filter,
#endif
const int subpel_x, int xstep, const int subpel_y, int ystep, const int subpel_x, int xstep, const int subpel_y, int ystep,
ConvolveParams *conv_params); ConvolveParams *conv_params);
void av1_convolve_c(const uint8_t *src, int src_stride, uint8_t *dst, void av1_convolve_c(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, int dst_stride, int w, int h, InterpFilters interp_filters,
#if CONFIG_DUAL_FILTER
const InterpFilter *interp_filter,
#else
const InterpFilter interp_filter,
#endif
const int subpel_x, int xstep, const int subpel_y, const int subpel_x, int xstep, const int subpel_y,
int ystep, ConvolveParams *conv_params); int ystep, ConvolveParams *conv_params);
void av1_convolve_scale(const uint8_t *src, int src_stride, uint8_t *dst, void av1_convolve_scale(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, int dst_stride, int w, int h,
#if CONFIG_DUAL_FILTER InterpFilters interp_filters, const int subpel_x,
const InterpFilter *interp_filter, int xstep, const int subpel_y, int ystep,
#else ConvolveParams *conv_params);
const InterpFilter interp_filter,
#endif
const int subpel_x, int xstep, const int subpel_y,
int ystep, ConvolveParams *conv_params);
#if CONFIG_HIGHBITDEPTH #if CONFIG_HIGHBITDEPTH
void av1_highbd_convolve(const uint8_t *src, int src_stride, uint8_t *dst, void av1_highbd_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, int dst_stride, int w, int h,
#if CONFIG_DUAL_FILTER InterpFilters interp_filters, const int subpel_x,
const InterpFilter *interp_filter, int xstep, const int subpel_y, int ystep, int avg,
#else int bd);
const InterpFilter interp_filter,
#endif
const int subpel_x, int xstep, const int subpel_y,
int ystep, int avg, int bd);
void av1_highbd_convolve_scale(const uint8_t *src, int src_stride, uint8_t *dst, void av1_highbd_convolve_scale(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h, int dst_stride, int w, int h,
#if CONFIG_DUAL_FILTER InterpFilters interp_filters, const int subpel_x,
const InterpFilter *interp_filter, int xstep, const int subpel_y, int ystep,
#else int avg, int bd);
const InterpFilter interp_filter,
#endif // CONFIG_DUAL_FILTER
const int subpel_x, int xstep,
const int subpel_y, int ystep, int avg, int bd);
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#ifndef AV1_COMMON_FILTER_H_ #ifndef AV1_COMMON_FILTER_H_
#define AV1_COMMON_FILTER_H_ #define AV1_COMMON_FILTER_H_
#include <assert.h>
#include "./aom_config.h" #include "./aom_config.h"
#include "aom/aom_integer.h" #include "aom/aom_integer.h"
#include "aom_dsp/aom_filter.h" #include "aom_dsp/aom_filter.h"
...@@ -51,6 +53,46 @@ typedef enum { ...@@ -51,6 +53,46 @@ typedef enum {
#endif #endif
} InterpFilter; } InterpFilter;
// With CONFIG_DUAL_FILTER, pack two InterpFilter's into a uint32_t: since
// there are at most 10 filters, we can use 16 bits for each and have more than
// enough space. This reduces argument passing and unifies the operation of
// setting a (pair of) filters.
//
// Without CONFIG_DUAL_FILTER,
#if CONFIG_DUAL_FILTER
typedef uint32_t InterpFilters;
static INLINE InterpFilter av1_extract_interp_filter(InterpFilters filters,
int x_filter) {
return (InterpFilter)((filters >> (x_filter ? 16 : 0)) & 0xffff);
}
static INLINE InterpFilters av1_make_interp_filters(InterpFilter y_filter,
InterpFilter x_filter) {
uint16_t y16 = y_filter & 0xffff;
uint16_t x16 = x_filter & 0xffff;
return y16 | ((uint32_t)x16 << 16);
}
static INLINE InterpFilters av1_broadcast_interp_filter(InterpFilter filter) {
return av1_make_interp_filters(filter, filter);
}
#else
typedef InterpFilter InterpFilters;
static INLINE InterpFilter av1_extract_interp_filter(InterpFilters filters,
int x_filter) {
assert(!x_filter);
return filters;
}
static INLINE InterpFilters av1_broadcast_interp_filter(InterpFilter filter) {
return filter;
}
#endif
static INLINE InterpFilter av1_unswitchable_filter(InterpFilter filter) {
return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter;
}
#if USE_EXTRA_FILTER #if USE_EXTRA_FILTER
#define LOG_SWITCHABLE_FILTERS \ #define LOG_SWITCHABLE_FILTERS \
3 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */ 3 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */
......
...@@ -22,19 +22,16 @@ ...@@ -22,19 +22,16 @@
static InterpFilter get_ref_filter_type(const MODE_INFO *mi, static InterpFilter get_ref_filter_type(const MODE_INFO *mi,
const MACROBLOCKD *xd, int dir, const MACROBLOCKD *xd, int dir,
MV_REFERENCE_FRAME ref_frame) { MV_REFERENCE_FRAME ref_frame) {
InterpFilter ref_type = SWITCHABLE_FILTERS;
const MB_MODE_INFO *ref_mbmi = &mi->mbmi; const MB_MODE_INFO *ref_mbmi = &mi->mbmi;
int use_subpel[2] = { int use_subpel[2] = {
has_subpel_mv_component(mi, xd, dir), has_subpel_mv_component(mi, xd, dir),
has_subpel_mv_component(mi, xd, dir + 2), has_subpel_mv_component(mi, xd, dir + 2),
}; };
if (ref_mbmi->ref_frame[0] == ref_frame && use_subpel[0]) return (((ref_mbmi->ref_frame[0] == ref_frame && use_subpel[0]) ||
ref_type = ref_mbmi->interp_filter[(dir & 0x01)]; (ref_mbmi->ref_frame[1] == ref_frame && use_subpel[1]))
else if (ref_mbmi->ref_frame[1] == ref_frame && use_subpel[1]) ? av1_extract_interp_filter(ref_mbmi->interp_filters, dir & 0x01)
ref_type = ref_mbmi->interp_filter[(dir & 0x01) + 2]; : SWITCHABLE_FILTERS);
return ref_type;
} }
int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir) { int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir) {
...@@ -79,13 +76,15 @@ int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd) { ...@@ -79,13 +76,15 @@ int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
// left of the entries corresponding to real macroblocks. // left of the entries corresponding to real macroblocks.
// The prediction flags in these dummy entries are initialized to 0. // The prediction flags in these dummy entries are initialized to 0.
const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
const int left_type = xd->left_available && is_inter_block(left_mbmi) const int left_type =
? left_mbmi->interp_filter xd->left_available && is_inter_block(left_mbmi)
: SWITCHABLE_FILTERS; ? av1_extract_interp_filter(left_mbmi->interp_filters, 0)
: SWITCHABLE_FILTERS;
const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
const int above_type = xd->up_available && is_inter_block(above_mbmi) const int above_type =
? above_mbmi->interp_filter xd->up_available && is_inter_block(above_mbmi)
: SWITCHABLE_FILTERS; ? av1_extract_interp_filter(above_mbmi->interp_filters, 0)
: SWITCHABLE_FILTERS;
if (left_type == above_type) { if (left_type == above_type) {
return left_type; return left_type;
...@@ -110,11 +109,7 @@ static INTRA_FILTER get_ref_intra_filter(const MB_MODE_INFO *ref_mbmi) { ...@@ -110,11 +109,7 @@ static INTRA_FILTER get_ref_intra_filter(const MB_MODE_INFO *ref_mbmi) {
if (ref_mbmi->sb_type >= BLOCK_8X8) { if (ref_mbmi->sb_type >= BLOCK_8X8) {
const PREDICTION_MODE mode = ref_mbmi->mode; const PREDICTION_MODE mode = ref_mbmi->mode;
if (is_inter_block(ref_mbmi)) { if (is_inter_block(ref_mbmi)) {
#if CONFIG_DUAL_FILTER switch (av1_extract_interp_filter(ref_mbmi->interp_filters, 0)) {
switch (ref_mbmi->interp_filter[0]) {
#else
switch (ref_mbmi->interp_filter) {
#endif
case EIGHTTAP_REGULAR: ref_type = INTRA_FILTER_8TAP; break; case EIGHTTAP_REGULAR: ref_type = INTRA_FILTER_8TAP; break;
case EIGHTTAP_SMOOTH: ref_type = INTRA_FILTER_8TAP_SMOOTH; break; case EIGHTTAP_SMOOTH: ref_type = INTRA_FILTER_8TAP_SMOOTH; break;
case MULTITAP_SHARP: ref_type = INTRA_FILTER_8TAP_SHARP; break; case MULTITAP_SHARP: ref_type = INTRA_FILTER_8TAP_SHARP; break;
......
...@@ -130,12 +130,7 @@ static INLINE int allow_warp(const MODE_INFO *const mi, ...@@ -130,12 +130,7 @@ static INLINE int allow_warp(const MODE_INFO *const mi,
static INLINE void av1_make_inter_predictor( static INLINE void av1_make_inter_predictor(
const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
const int subpel_x, const int subpel_y, const struct scale_factors *sf, const int subpel_x, const int subpel_y, const struct scale_factors *sf,
int w, int h, ConvolveParams *conv_params, int w, int h, ConvolveParams *conv_params, InterpFilters interp_filters,
#if CONFIG_DUAL_FILTER
const InterpFilter *interp_filter,
#else
const InterpFilter interp_filter,
#endif
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
const WarpTypesAllowed *warp_types, int p_col, int p_row, int plane, const WarpTypesAllowed *warp_types, int p_col, int p_row, int plane,
int ref, int ref,
...@@ -202,13 +197,13 @@ static INLINE void av1_make_inter_predictor( ...@@ -202,13 +197,13 @@ static INLINE void av1_make_inter_predictor(
#if CONFIG_HIGHBITDEPTH #if CONFIG_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
highbd_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, highbd_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
sf, w, h, conv_params, interp_filter, xs, ys, sf, w, h, conv_params, interp_filters, xs, ys,
xd->bd); xd->bd);
return; return;
} }
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, sf, w, inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, sf, w,
h, conv_params, interp_filter, xs, ys); h, conv_params, interp_filters, xs, ys);
} }
#define NSMOOTHERS 1 #define NSMOOTHERS 1
...@@ -946,26 +941,19 @@ static void build_masked_compound_highbd( ...@@ -946,26 +941,19 @@ static void build_masked_compound_highbd(
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride, void av1_make_masked_inter_predictor(
uint8_t *dst, int dst_stride, const uint8_t *pre, int pre_stride, uint8_t *dst, int dst_stride,
const int subpel_x, const int subpel_y, const int subpel_x, const int subpel_y, const struct scale_factors *sf,
const struct scale_factors *sf, int w, int w, int h, ConvolveParams *conv_params, InterpFilters interp_filters,
int h, ConvolveParams *conv_params, int xs, int ys,
#if CONFIG_DUAL_FILTER
const InterpFilter *interp_filter,
#else
const InterpFilter interp_filter,
#endif
int xs, int ys,
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
int wedge_offset_x, int wedge_offset_y, int wedge_offset_x, int wedge_offset_y,
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
int plane, int plane,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
const WarpTypesAllowed *warp_types, const WarpTypesAllowed *warp_types, int p_col, int p_row, int ref,
int p_col, int p_row, int ref,
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
MACROBLOCKD *xd) { MACROBLOCKD *xd) {
const MODE_INFO *mi = xd->mi[0]; const MODE_INFO *mi = xd->mi[0];
const INTERINTER_COMPOUND_DATA comp_data = { const INTERINTER_COMPOUND_DATA comp_data = {
...@@ -1024,7 +1012,7 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride, ...@@ -1024,7 +1012,7 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride,
// This will generate a prediction in tmp_buf for the second reference // This will generate a prediction in tmp_buf for the second reference
av1_make_inter_predictor(pre, pre_stride, tmp_dst, MAX_SB_SIZE, subpel_x, av1_make_inter_predictor(pre, pre_stride, tmp_dst, MAX_SB_SIZE, subpel_x,
subpel_y, sf, w, h, conv_params, interp_filter, subpel_y, sf, w, h, conv_params, interp_filters,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
warp_types, p_col, p_row, plane, ref, warp_types, p_col, p_row, plane, ref,
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
...@@ -1103,7 +1091,6 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride, ...@@ -1103,7 +1091,6 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride,
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
build_masked_compound(dst, dst_stride, dst, dst_stride, tmp_dst, build_masked_compound(dst, dst_stride, dst, dst_stride, tmp_dst,
MAX_SB_SIZE, &comp_data, mi->mbmi.sb_type, h, w); MAX_SB_SIZE, &comp_data, mi->mbmi.sb_type, h, w);
#if CONFIG_CONVOLVE_ROUND #if CONFIG_CONVOLVE_ROUND
} }
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND
...@@ -1121,11 +1108,7 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride, ...@@ -1121,11 +1108,7 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride,
void av1_highbd_build_inter_predictor( void av1_highbd_build_inter_predictor(
const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
const MV *src_mv, const struct scale_factors *sf, int w, int h, int ref, const MV *src_mv, const struct scale_factors *sf, int w, int h, int ref,
#if CONFIG_DUAL_FILTER InterpFilters interp_filters,
const InterpFilter *interp_filter,
#else
const InterpFilter interp_filter,
#endif
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
const WarpTypesAllowed *warp_types, int p_col, int p_row, const WarpTypesAllowed *warp_types, int p_col, int p_row,
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
...@@ -1145,7 +1128,7 @@ void av1_highbd_build_inter_predictor( ...@@ -1145,7 +1128,7 @@ void av1_highbd_build_inter_predictor(
(mv.col >> SCALE_SUBPEL_BITS); (mv.col >> SCALE_SUBPEL_BITS);
av1_make_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, av1_make_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
sf, w, h, &conv_params, interp_filter, sf, w, h, &conv_params, interp_filters,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
warp_types, p_col, p_row, plane, ref, warp_types, p_col, p_row, plane, ref,
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
...@@ -1160,11 +1143,7 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, ...@@ -1160,11 +1143,7 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, const MV *src_mv, int dst_stride, const MV *src_mv,
const struct scale_factors *sf, int w, int h, const struct scale_factors *sf, int w, int h,
ConvolveParams *conv_params, ConvolveParams *conv_params,
#if CONFIG_DUAL_FILTER InterpFilters interp_filters,
const InterpFilter *interp_filter,
#else
const InterpFilter interp_filter,
#endif
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
const WarpTypesAllowed *warp_types, int p_col, const WarpTypesAllowed *warp_types, int p_col,
int p_row, int plane, int ref, int p_row, int plane, int ref,
...@@ -1184,7 +1163,7 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, ...@@ -1184,7 +1163,7 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
(mv.col >> SCALE_SUBPEL_BITS); (mv.col >> SCALE_SUBPEL_BITS);
av1_make_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, av1_make_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
sf, w, h, conv_params, interp_filter, sf, w, h, conv_params, interp_filters,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
warp_types, p_col, p_row, plane, ref, warp_types, p_col, p_row, plane, ref,
#endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #endif // CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
...@@ -1391,7 +1370,7 @@ static INLINE void build_inter_predictors( ...@@ -1391,7 +1370,7 @@ static INLINE void build_inter_predictors(
if (ref && is_masked_compound_type(mi->mbmi.interinter_compound_type)) if (ref && is_masked_compound_type(mi->mbmi.interinter_compound_type))
av1_make_masked_inter_predictor( av1_make_masked_inter_predictor(
pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y, pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y,
sf, b4_w, b4_h, &conv_params, mi->mbmi.interp_filter, xs, ys, sf, b4_w, b4_h, &conv_params, mi->mbmi.interp_filters, xs, ys,
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
wedge_offset_x, wedge_offset_y, wedge_offset_x, wedge_offset_y,
#endif // CONFIG_SUPERTX #endif // CONFIG_SUPERTX
...@@ -1404,7 +1383,7 @@ static INLINE void build_inter_predictors( ...@@ -1404,7 +1383,7 @@ static INLINE void build_inter_predictors(
else else
av1_make_inter_predictor( av1_make_inter_predictor(
pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y, pre, pre_buf->stride, dst, dst_buf->stride, subpel_x, subpel_y,
sf, b4_w, b4_h, &conv_params, this_mbmi->interp_filter, sf, b4_w, b4_h, &conv_params, this_mbmi->interp_filters,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
&warp_types, (mi_x >> pd->subsampling_x) + x, &warp_types, (mi_x >> pd->subsampling_x) + x,
(mi_y >> pd->subsampling_y) + y, plane, ref, (mi_y >> pd->subsampling_y) + y, plane, ref,
...@@ -1585,7 +1564,7 @@ static INLINE void build_inter_predictors( ...@@ -1585,7 +1564,7 @@ static INLINE void build_inter_predictors(
av1_make_masked_inter_predictor( av1_make_masked_inter_predictor(
pre[ref], pre_buf->stride, dst, dst_buf->stride, pre[ref], pre_buf->stride, dst, dst_buf->stride,
subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h, subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h,
&conv_params, mi->mbmi.interp_filter, subpel_params[ref].xs, &conv_params, mi->mbmi.interp_filters, subpel_params[ref].xs,
subpel_params[ref].ys, subpel_params[ref].ys,
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
wedge_offset_x, wedge_offset_y, wedge_offset_x, wedge_offset_y,
...@@ -1600,7 +1579,7 @@ static INLINE void build_inter_predictors( ...@@ -1600,7 +1579,7 @@ static INLINE void build_inter_predictors(
av1_make_inter_predictor( av1_make_inter_predictor(
pre[ref], pre_buf->stride, dst, dst_buf->stride, pre[ref], pre_buf->stride, dst, dst_buf->stride,
subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h, subpel_params[ref].subpel_x, subpel_params[ref].subpel_y, sf, w, h,
&conv_params, mi->mbmi.interp_filter, &conv_params, mi->mbmi.interp_filters,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
&warp_types, (mi_x >> pd->subsampling_x) + x, &warp_types, (mi_x >> pd->subsampling_x) + x,
(mi_y >> pd->subsampling_y) + y, plane, ref, (mi_y >> pd->subsampling_y) + y, plane, ref,
...@@ -3267,7 +3246,7 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane, ...@@ -3267,7 +3246,7 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane,
av1_make_inter_predictor(pre, pre_buf->stride, dst, ext_dst_stride, subpel_x, av1_make_inter_predictor(pre, pre_buf->stride, dst, ext_dst_stride, subpel_x,
subpel_y, sf, w, h, &conv_params, subpel_y, sf, w, h, &conv_params,
mi->mbmi.interp_filter, mi->mbmi.interp_filters,
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION #if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION
&warp_types, (mi_x >> pd->subsampling_x) + x, &warp_types, (mi_x >> pd->subsampling_x) + x,
(mi_y >> pd->subsampling_y) + y, plane, ref, (mi_y >> pd->subsampling_y) + y, plane, ref,
......
...@@ -40,27 +40,8 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride, ...@@ -40,27 +40,8 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride, int subpel_x, uint8_t *dst, int dst_stride, int subpel_x,
int subpel_y, const struct scale_factors *sf, int subpel_y, const struct scale_factors *sf,
int w, int h, ConvolveParams *conv_params, int w, int h, ConvolveParams *conv_params,
#if CONFIG_DUAL_FILTER InterpFilters interp_filters, int xs,
const InterpFilter *interp_filter, int ys) {
#else
const InterpFilter interp_filter,
#endif
int xs, int ys) {
#if CONFIG_DUAL_FILTER
const InterpFilter filter_x = av1_get_plane_interp_filter(
interp_filter[1 + 2 * conv_params->ref], conv_params->plane);
const InterpFilter filter_y = av1_get_plane_interp_filter(
interp_filter[0 + 2 * conv_params->ref], conv_params->plane);
const InterpFilterParams interp_filter_params_x =
av1_get_interp_filter_params(filter_x);
const InterpFilterParams interp_filter_params_y =
av1_get_interp_filter_params(filter_y);
#else
const InterpFilterParams interp_filter_params_x =
av1_get_interp_filter_params(interp_filter);
const InterpFilterParams interp_filter_params_y = interp_filter_params_x;
#endif
assert(conv_params->do_average == 0 || conv_params->do_average == 1); assert(conv_params->do_average == 0 || conv_params->do_average == 1);
assert(sf); assert(sf);
if (has_scale(xs, ys)) { if (has_scale(xs, ys)) {
...@@ -69,19 +50,15 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride, ...@@ -69,19 +50,15 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) { if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
#if CONFIG_CONVOLVE_ROUND #if CONFIG_CONVOLVE_ROUND
av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,