Merge ext_interp and dual_filter
Change-Id: I0ebd6951d2b42869ae872b33f63a07db03e99c62
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 4deb059..f78d9ff 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -49,12 +49,6 @@
FRAME_TYPES,
} FRAME_TYPE;
-#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
-#define IsInterpolatingFilter(filter) (av1_is_interpolating_filter(filter))
-#else
-#define IsInterpolatingFilter(filter) (1)
-#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
-
static INLINE int is_inter_mode(PREDICTION_MODE mode) {
#if CONFIG_EXT_INTER
return mode >= NEARESTMV && mode <= NEW_NEWMV;
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index bad72db..d8715c0 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -1304,11 +1304,10 @@
static const aom_prob default_skip_probs[SKIP_CONTEXTS] = { 192, 128, 64 };
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
static const aom_prob
default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1] = {
-#if CONFIG_DUAL_FILTER
{ 235, 192, 128 }, { 36, 243, 48 },
{ 34, 16, 128 }, { 34, 16, 128 },
{ 149, 160, 128 }, { 235, 192, 128 },
@@ -1319,30 +1318,8 @@
{ 149, 160, 128 }, { 235, 192, 128 },
{ 36, 243, 48 }, { 34, 16, 128 },
{ 34, 16, 128 }, { 149, 160, 128 },
-#else
- { 235, 192, 128 }, { 36, 243, 48 },
- { 34, 16, 128 }, { 34, 16, 128 },
- { 149, 160, 128 },
-#endif
};
-#else // CONFIG_EXT_INTERP
-#if CONFIG_DUAL_FILTER
-static const aom_prob
- default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
- [SWITCHABLE_FILTERS - 1] = {
- { 235, 162 }, { 36, 255 },
- { 34, 3 }, { 149, 144 },
-
- { 235, 162 }, { 36, 255 },
- { 34, 3 }, { 10, 3 },
-
- { 235, 162 }, { 36, 255 },
- { 34, 3 }, { 149, 144 },
-
- { 235, 162 }, { 36, 255 },
- { 34, 3 }, { 10, 3 },
- };
-#else
+#else // CONFIG_DUAL_FILTER
static const aom_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1] = {
{ 235, 162 },
@@ -1350,8 +1327,7 @@
{ 34, 3 },
{ 149, 144 },
};
-#endif
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
#if CONFIG_EXT_TX
/* clang-format off */
@@ -1847,7 +1823,7 @@
}
#endif
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] =
{
-EIGHTTAP_REGULAR, 2, 4, -MULTITAP_SHARP, -EIGHTTAP_SMOOTH,
@@ -1856,7 +1832,7 @@
#else
const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] =
{ -EIGHTTAP_REGULAR, 2, -EIGHTTAP_SMOOTH, -MULTITAP_SHARP };
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
int i, j;
diff --git a/av1/common/filter.c b/av1/common/filter.c
index 0d6bc3b..44bced4 100644
--- a/av1/common/filter.c
+++ b/av1/common/filter.c
@@ -48,7 +48,7 @@
};
#endif // USE_TEMPORALFILTER_12TAP
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8[SUBPEL_SHIFTS]) = {
// intfilt 0.575
@@ -121,7 +121,7 @@
{ 0, 1, -12, 49, 90, 5, -7, 2 }, { 1, 1, -12, 43, 92, 9, -8, 2 },
{ 0, 2, -12, 37, 94, 14, -9, 2 }, { 0, 2, -11, 31, 95, 19, -10, 2 },
};
-#else // CONFIG_EXT_INTERP
+#else // CONFIG_DUAL_FILTER
DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8[SUBPEL_SHIFTS]) = {
@@ -191,7 +191,7 @@
{ 0, -3, 2, 41, 63, 29, -2, -2 }, { 0, -3, 1, 38, 64, 32, -1, -3 }
#endif
};
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
#if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP
@@ -204,7 +204,7 @@
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
static const InterpFilterParams
av1_interp_filter_params_list[SWITCHABLE_FILTERS + EXTRA_FILTERS] = {
{ (const int16_t *)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS,
@@ -217,10 +217,8 @@
EIGHTTAP_SMOOTH2 },
{ (const int16_t *)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS,
BILINEAR },
-#if CONFIG_DUAL_FILTER
{ (const int16_t *)sub_pel_filters_8sharp, SUBPEL_TAPS, SUBPEL_SHIFTS,
EIGHTTAP_SHARP },
-#endif
};
#else
static const InterpFilterParams
@@ -234,7 +232,7 @@
{ (const int16_t *)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS,
BILINEAR }
};
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
#if USE_TEMPORALFILTER_12TAP
static const InterpFilterParams av1_interp_temporalfilter_12tap = {
diff --git a/av1/common/filter.h b/av1/common/filter.h
index 020d7dd..7fdb103 100644
--- a/av1/common/filter.h
+++ b/av1/common/filter.h
@@ -25,41 +25,38 @@
#define EIGHTTAP_SMOOTH 1
#define MULTITAP_SHARP 2
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
#define EIGHTTAP_SMOOTH2 3
#define MAX_SUBPEL_TAPS 12
-#define SUPPORT_NONINTERPOLATING_FILTERS 0 /* turn on for experimentation */
-#define SWITCHABLE_FILTERS 4 /* Number of switchable filters */
+#define SWITCHABLE_FILTERS 4 /* Number of switchable filters */
#define LOG_SWITCHABLE_FILTERS \
3 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */
-#else
+
+#define EIGHTTAP_SHARP (SWITCHABLE_FILTERS + 1)
+#define EXTRA_FILTERS 2
+#define SWITCHABLE_FILTER_CONTEXTS ((SWITCHABLE_FILTERS + 1) * 4)
+#define INTER_FILTER_COMP_OFFSET (SWITCHABLE_FILTERS + 1)
+#define INTER_FILTER_DIR_OFFSET ((SWITCHABLE_FILTERS + 1) * 2)
+
+#else // CONFIG_DUAL_FILTER
+
#define SWITCHABLE_FILTERS 3 /* Number of switchable filters */
#define LOG_SWITCHABLE_FILTERS \
- 2 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */
-#endif // CONFIG_EXT_INTERP
+ 2 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */
+#define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1)
+#define EXTRA_FILTERS 1
+
+#endif // CONFIG_DUAL_FILTER
#define USE_TEMPORALFILTER_12TAP 1
#if USE_TEMPORALFILTER_12TAP
#define TEMPORALFILTER_12TAP (SWITCHABLE_FILTERS + 2)
#endif
-// The codec can operate in four possible inter prediction filter mode:
-// 8-tap, 8-tap-smooth, 8-tap-sharp, and switching between the three.
-
#define BILINEAR (SWITCHABLE_FILTERS)
#define SWITCHABLE (SWITCHABLE_FILTERS + 1) /* the last one */
-#if CONFIG_DUAL_FILTER
-#define EIGHTTAP_SHARP (SWITCHABLE_FILTERS + 1)
-#define EXTRA_FILTERS 2
-#define SWITCHABLE_FILTER_CONTEXTS ((SWITCHABLE_FILTERS + 1) * 4)
-#define INTER_FILTER_COMP_OFFSET (SWITCHABLE_FILTERS + 1)
-#define INTER_FILTER_DIR_OFFSET ((SWITCHABLE_FILTERS + 1) * 2)
-#else
-#define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1)
-#define EXTRA_FILTERS 1
-#endif
typedef uint8_t InterpFilter;
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h
index 80bea00..1819bb2 100644
--- a/av1/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -56,19 +56,8 @@
const int16_t *kernel_y =
av1_get_interp_filter_subpel_kernel(interp_filter_params, subpel_y);
#endif
-#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
- if (IsInterpolatingFilter(interp_filter)) {
- // Interpolating filter
- sf->predict[subpel_x != 0][subpel_y != 0][ref](
- src, src_stride, dst, dst_stride, kernel_x, xs, kernel_y, ys, w, h);
- } else {
- sf->predict_ni[subpel_x != 0][subpel_y != 0][ref](
- src, src_stride, dst, dst_stride, kernel_x, xs, kernel_y, ys, w, h);
- }
-#else
sf->predict[subpel_x != 0][subpel_y != 0][ref_idx](
src, src_stride, dst, dst_stride, kernel_x, xs, kernel_y, ys, w, h);
-#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
} else {
// ref_idx > 0 means this is the second reference frame
// first reference frame's prediction result is already in dst
@@ -115,21 +104,8 @@
const int16_t *kernel_y =
av1_get_interp_filter_subpel_kernel(interp_filter_params, subpel_y);
#endif // CONFIG_DUAL_FILTER
-#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
- if (IsInterpolatingFilter(interp_filter)) {
- // Interpolating filter
- sf->highbd_predict[subpel_x != 0][subpel_y != 0][ref](
- src, src_stride, dst, dst_stride, kernel_x, xs, kernel_y, ys, w, h,
- bd);
- } else {
- sf->highbd_predict_ni[subpel_x != 0][subpel_y != 0][ref](
- src, src_stride, dst, dst_stride, kernel_x, xs, kernel_y, ys, w, h,
- bd);
- }
-#else
sf->highbd_predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride, kernel_x, xs, kernel_y, ys, w, h, bd);
-#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
} else {
// ref > 0 means this is the second reference frame
// first reference frame's prediction result is already in dst
diff --git a/av1/common/scale.c b/av1/common/scale.c
index 896c4e1..5c43bb0 100644
--- a/av1/common/scale.c
+++ b/av1/common/scale.c
@@ -70,22 +70,12 @@
sf->scale_value_y = unscaled_value;
}
-// TODO(agrange): Investigate the best choice of functions to use here
-// for EIGHTTAP_SMOOTH. Since it is not interpolating, need to choose what
-// to do at full-pel offsets. The current selection, where the filter is
-// applied in one direction only, and not at all for 0,0, seems to give the
-// best quality, but it may be worth trying an additional mode that does
-// do the filtering on full-pel.
-#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
- sf->predict_ni[0][0][0] = aom_convolve8_c;
- sf->predict_ni[0][0][1] = aom_convolve8_avg_c;
- sf->predict_ni[0][1][0] = aom_convolve8_c;
- sf->predict_ni[0][1][1] = aom_convolve8_avg_c;
- sf->predict_ni[1][0][0] = aom_convolve8_c;
- sf->predict_ni[1][0][1] = aom_convolve8_avg_c;
- sf->predict_ni[1][1][0] = aom_convolve8;
- sf->predict_ni[1][1][1] = aom_convolve8_avg;
-#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
+ // TODO(agrange): Investigate the best choice of functions to use here
+ // for EIGHTTAP_SMOOTH. Since it is not interpolating, need to choose what
+ // to do at full-pel offsets. The current selection, where the filter is
+ // applied in one direction only, and not at all for 0,0, seems to give the
+ // best quality, but it may be worth trying an additional mode that does
+ // do the filtering on full-pel.
if (sf->x_step_q4 == 16) {
if (sf->y_step_q4 == 16) {
// No scaling in either direction.
@@ -129,16 +119,6 @@
#if CONFIG_AOM_HIGHBITDEPTH
if (use_highbd) {
-#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
- sf->highbd_predict_ni[0][0][0] = aom_highbd_convolve8_c;
- sf->highbd_predict_ni[0][0][1] = aom_highbd_convolve8_avg_c;
- sf->highbd_predict_ni[0][1][0] = aom_highbd_convolve8_c;
- sf->highbd_predict_ni[0][1][1] = aom_highbd_convolve8_avg_c;
- sf->highbd_predict_ni[1][0][0] = aom_highbd_convolve8_c;
- sf->highbd_predict_ni[1][0][1] = aom_highbd_convolve8_avg_c;
- sf->highbd_predict_ni[1][1][0] = aom_highbd_convolve8;
- sf->highbd_predict_ni[1][1][1] = aom_highbd_convolve8_avg;
-#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
if (sf->x_step_q4 == 16) {
if (sf->y_step_q4 == 16) {
// No scaling in either direction.
diff --git a/av1/common/scale.h b/av1/common/scale.h
index 4badcc1..40385e5 100644
--- a/av1/common/scale.h
+++ b/av1/common/scale.h
@@ -36,14 +36,6 @@
#if CONFIG_AOM_HIGHBITDEPTH
highbd_convolve_fn_t highbd_predict[2][2][2]; // horiz, vert, avg
#endif // CONFIG_AOM_HIGHBITDEPTH
-
-// Functions for non-interpolating filters (those that filter zero offsets)
-#if CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
- convolve_fn_t predict_ni[2][2][2]; // horiz, vert, avg
-#if CONFIG_AOM_HIGHBITDEPTH
- highbd_convolve_fn_t highbd_predict_ni[2][2][2]; // horiz, vert, avg
-#endif // CONFIG_AOM_HIGHBITDEPTH
-#endif // CONFIG_EXT_INTERP && SUPPORT_NONINTERPOLATING_FILTERS
};
MV32 av1_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
diff --git a/av1/common/x86/av1_convolve_ssse3.c b/av1/common/x86/av1_convolve_ssse3.c
index 0de56ba..4f78f3e 100644
--- a/av1/common/x86/av1_convolve_ssse3.c
+++ b/av1/common/x86/av1_convolve_ssse3.c
@@ -19,13 +19,13 @@
#define WIDTH_BOUND (16)
#define HEIGHT_BOUND (16)
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_12sharp_signal_dir[15][2][16]);
DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_12sharp_ver_signal_dir[15][6][16]);
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
#if USE_TEMPORALFILTER_12TAP
DECLARE_ALIGNED(16, static int8_t,
@@ -39,7 +39,7 @@
static INLINE SubpelFilterCoeffs
get_subpel_filter_signal_dir(const InterpFilterParams p, int index) {
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_12sharp_signal_dir[index][0];
}
@@ -56,7 +56,7 @@
static INLINE SubpelFilterCoeffs
get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) {
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_12sharp_ver_signal_dir[index][0];
}
@@ -980,7 +980,7 @@
int8_t (*simd_vert_filter)[6][16];
} SimdFilter;
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
#define MULTITAP_FILTER_NUM 1
SimdFilter simd_filters[MULTITAP_FILTER_NUM] = {
{ MULTITAP_SHARP, &sub_pel_filters_12sharp_signal_dir[0],
@@ -1008,7 +1008,7 @@
temporal_simd_filter.simd_vert_filter);
}
#endif
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
{
int i;
for (i = 0; i < MULTITAP_FILTER_NUM; ++i) {
diff --git a/av1/common/x86/av1_highbd_convolve_filters_sse4.h b/av1/common/x86/av1_highbd_convolve_filters_sse4.h
index b3e8596..0cf9e1f 100644
--- a/av1/common/x86/av1_highbd_convolve_filters_sse4.h
+++ b/av1/common/x86/av1_highbd_convolve_filters_sse4.h
@@ -15,7 +15,7 @@
#include "./aom_config.h"
#if CONFIG_AOM_HIGHBITDEPTH
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
DECLARE_ALIGNED(16, static const int16_t,
sub_pel_filters_12sharp_highbd_ver_signal_dir[15][6][8]) = {
{
diff --git a/av1/common/x86/av1_highbd_convolve_sse4.c b/av1/common/x86/av1_highbd_convolve_sse4.c
index adc142d..4970bb3 100644
--- a/av1/common/x86/av1_highbd_convolve_sse4.c
+++ b/av1/common/x86/av1_highbd_convolve_sse4.c
@@ -24,7 +24,7 @@
static INLINE HbdSubpelFilterCoeffs
hbd_get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) {
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_12sharp_highbd_ver_signal_dir[index][0];
}
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 31f42b6..e07625d 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1110,12 +1110,6 @@
mbmi->interp_filter[3] = mbmi->interp_filter[1];
}
#else // CONFIG_DUAL_FILTER
-#if CONFIG_EXT_INTERP
- if (!av1_is_interp_needed(xd)) {
- mbmi->interp_filter = EIGHTTAP_REGULAR;
- return;
- }
-#endif // CONFIG_EXT_INTERP
if (cm->interp_filter != SWITCHABLE) {
mbmi->interp_filter = cm->interp_filter;
} else {
@@ -1661,9 +1655,9 @@
}
#endif
-#if !CONFIG_EXT_INTERP && !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
+#if !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
read_mb_interp_filter(cm, xd, mbmi, r);
-#endif // !CONFIG_EXT_INTERP && !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
+#endif // !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
if (bsize < BLOCK_8X8 && !unify_bsize) {
const int num_4x4_w = 1 << xd->bmode_blocks_wl;
@@ -1903,9 +1897,9 @@
#if CONFIG_WARPED_MOTION
if (mbmi->motion_mode != WARPED_CAUSAL) {
#endif // CONFIG_WARPED_MOTION
-#if CONFIG_DUAL_FILTER || CONFIG_EXT_INTERP || CONFIG_WARPED_MOTION
+#if CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION
read_mb_interp_filter(cm, xd, mbmi, r);
-#endif // CONFIG_DUAL_FILTER || CONFIG_EXT_INTERP || CONFIG_WARPED_MOTION
+#endif // CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
} else {
#if CONFIG_DUAL_FILTER
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 094698b..9c0d3bf 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -181,7 +181,7 @@
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_EC_MULTISYMBOL
- /* This hack is necessary when CONFIG_EXT_INTERP is enabled because the five
+ /* This hack is necessary when CONFIG_DUAL_FILTER is enabled because the five
SWITCHABLE_FILTERS are not consecutive, e.g., 0, 1, 2, 3, 4, when doing
an in-order traversal of the av1_switchable_interp_tree structure. */
av1_indices_from_tree(av1_switchable_interp_ind, av1_switchable_interp_inv,
@@ -1076,24 +1076,12 @@
int dir;
#endif
if (cm->interp_filter == SWITCHABLE) {
-#if CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
if (!av1_is_interp_needed(xd)) {
assert(mbmi->interp_filter[0] == EIGHTTAP_REGULAR);
return;
}
-#else
- if (!av1_is_interp_needed(xd)) {
-#if CONFIG_DUAL_FILTER
- assert(mbmi->interp_filter[0] == EIGHTTAP_REGULAR);
- assert(mbmi->interp_filter[1] == EIGHTTAP_REGULAR);
-#else
- assert(mbmi->interp_filter == EIGHTTAP_REGULAR);
-#endif
- return;
- }
#endif // CONFIG_DUAL_FILTER
-#endif // CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
for (dir = 0; dir < 2; ++dir) {
if (has_subpel_mv_component(xd->mi[0], xd, dir) ||
@@ -1428,9 +1416,9 @@
}
}
-#if !CONFIG_EXT_INTERP && !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
+#if !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
write_mb_interp_filter(cpi, xd, w);
-#endif // !CONFIG_EXT_INTERP && !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
+#endif // !CONFIG_DUAL_FILTER && !CONFIG_WARPED_MOTION
if (bsize < BLOCK_8X8 && !unify_bsize) {
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
@@ -1647,9 +1635,9 @@
#if CONFIG_WARPED_MOTION
if (mbmi->motion_mode != WARPED_CAUSAL)
#endif // CONFIG_WARPED_MOTION
-#if CONFIG_EXT_INTERP || CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION
+#if CONFIG_DUAL_FILTER || CONFIG_WARPED_MOTION
write_mb_interp_filter(cpi, xd, w);
-#endif // CONFIG_EXT_INTERP || CONFIG_DUAL_FILTE || CONFIG_WARPED_MOTION
+#endif // CONFIG_DUAL_FILTE || CONFIG_WARPED_MOTION
}
write_tx_type(cm, mbmi,
@@ -1865,12 +1853,12 @@
xd->left_txfm_context =
xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
#endif
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
// av1_is_interp_needed needs the ref frame buffers set up to look
// up if they are scaled. av1_is_interp_needed is in turn needed by
// write_switchable_interp_filter, which is called by pack_inter_mode_mvs.
set_ref_ptrs(cm, xd, m->mbmi.ref_frame[0], m->mbmi.ref_frame[1]);
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
#if 0
// NOTE(zoeliu): For debug
if (cm->current_video_frame == FRAME_TO_CHECK && cm->show_frame == 1) {
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 1933345..196bcaf 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1191,7 +1191,7 @@
}
#endif // CONFIG_GLOBAL_MOTION
if (cm->interp_filter == SWITCHABLE
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
&& av1_is_interp_needed(xd)
#endif
#if CONFIG_WARPED_MOTION
@@ -1371,7 +1371,7 @@
#endif // CONFIG_GLOBAL_MOTION
if (cm->interp_filter == SWITCHABLE
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
&& av1_is_interp_needed(xd)
#endif
) {
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 64b94b9..5771946 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -849,15 +849,10 @@
int av1_get_switchable_rate(const AV1_COMP *cpi, const MACROBLOCKD *xd) {
const AV1_COMMON *const cm = &cpi->common;
if (cm->interp_filter == SWITCHABLE) {
-#if CONFIG_EXT_INTERP
- if (av1_is_interp_needed(xd))
-#endif
- {
- const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
- const int ctx = av1_get_pred_context_switchable_interp(xd);
- return SWITCHABLE_INTERP_RATE_FACTOR *
- cpi->switchable_interp_costs[ctx][mbmi->interp_filter];
- }
+ const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
+ const int ctx = av1_get_pred_context_switchable_interp(xd);
+ return SWITCHABLE_INTERP_RATE_FACTOR *
+ cpi->switchable_interp_costs[ctx][mbmi->interp_filter];
}
return 0;
}
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index f9ab467..4316b91 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -57,18 +57,11 @@
#endif
#if CONFIG_DUAL_FILTER
#define DUAL_FILTER_SET_SIZE (SWITCHABLE_FILTERS * SWITCHABLE_FILTERS)
-#if CONFIG_EXT_INTERP
static const int filter_sets[DUAL_FILTER_SET_SIZE][2] = {
{ 0, 0 }, { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 0 }, { 1, 1 },
{ 1, 2 }, { 1, 3 }, { 2, 0 }, { 2, 1 }, { 2, 2 }, { 2, 3 },
{ 3, 0 }, { 3, 1 }, { 3, 2 }, { 3, 3 },
};
-#else // CONFIG_EXT_INTERP
-static const int filter_sets[DUAL_FILTER_SET_SIZE][2] = {
- { 0, 0 }, { 0, 1 }, { 0, 2 }, { 1, 0 }, { 1, 1 },
- { 1, 2 }, { 2, 0 }, { 2, 1 }, { 2, 2 },
-};
-#endif // CONFIG_EXT_INTERP
#endif // CONFIG_DUAL_FILTER
#if CONFIG_EXT_REFS
@@ -7441,7 +7434,7 @@
assign_filter =
predict_interp_filter(cpi, x, bsize, mi_row, mi_col, single_filter);
#endif
-#if CONFIG_EXT_INTERP || CONFIG_DUAL_FILTER
+#if CONFIG_DUAL_FILTER
if (!av1_is_interp_needed(xd)) assign_filter = EIGHTTAP_REGULAR;
#endif
} else {
@@ -7535,7 +7528,7 @@
mbmi->interp_filter = best_filter;
#endif
} else {
-#if !CONFIG_EXT_INTERP && !CONFIG_DUAL_FILTER
+#if !CONFIG_DUAL_FILTER
int tmp_rs;
InterpFilter best_filter = mbmi->interp_filter;
rs = av1_get_switchable_rate(cpi, xd);
@@ -7843,16 +7836,12 @@
av1_cost_bit(cm->fc->interintra_prob[size_group_lookup[bsize]], 0);
}
-#if CONFIG_EXT_INTERP
- if (!av1_is_interp_needed(xd) && cm->interp_filter == SWITCHABLE) {
#if CONFIG_DUAL_FILTER
+ if (!av1_is_interp_needed(xd) && cm->interp_filter == SWITCHABLE) {
for (i = 0; i < 4; ++i) mbmi->interp_filter[i] = EIGHTTAP_REGULAR;
-#else
- mbmi->interp_filter = EIGHTTAP_REGULAR;
-#endif
pred_exists = 0;
}
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
if (pred_exists == 0) {
int tmp_rate;
int64_t tmp_dist;
@@ -7946,19 +7935,15 @@
#else
tmp_rate2 = rate2_nocoeff - rate_mv + tmp_rate_mv;
#endif // CONFIG_EXT_INTER
-#if CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
if (!has_subpel_mv_component(xd->mi[0], xd, 0))
mbmi->interp_filter[0] = EIGHTTAP_REGULAR;
if (!has_subpel_mv_component(xd->mi[0], xd, 1))
mbmi->interp_filter[1] = EIGHTTAP_REGULAR;
-#else
- if (!av1_is_interp_needed(xd)) mbmi->interp_filter = EIGHTTAP_REGULAR;
-#endif // CONFIG_DUAL_FILTER
// This is not quite correct with CONFIG_DUAL_FILTER when a filter
// is needed in only one direction
if (!av1_is_interp_needed(xd)) tmp_rate2 -= rs;
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
av1_build_inter_predictors_sb(xd, mi_row, mi_col, &orig_dst, bsize);
#if CONFIG_EXT_INTER
} else {
@@ -10387,9 +10372,9 @@
if (cm->interp_filter != BILINEAR) {
best_filter = EIGHTTAP_REGULAR;
if (cm->interp_filter == SWITCHABLE &&
-#if CONFIG_EXT_INTERP
+#if CONFIG_DUAL_FILTER
av1_is_interp_needed(xd) &&
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
x->source_variance >= cpi->sf.disable_filter_search_var_thresh) {
int rs;
int best_rs = INT_MAX;
@@ -10901,18 +10886,12 @@
compound_seg_newmvs,
#endif // CONFIG_EXT_INTER
bsi, switchable_filter_index, mi_row, mi_col);
-#if CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
if (!av1_is_interp_needed(xd) && cm->interp_filter == SWITCHABLE &&
(mbmi->interp_filter[0] != EIGHTTAP_REGULAR ||
mbmi->interp_filter[1] != EIGHTTAP_REGULAR)) // invalid config
continue;
-#else
- if (!av1_is_interp_needed(xd) && cm->interp_filter == SWITCHABLE &&
- mbmi->interp_filter != EIGHTTAP_REGULAR) // invalid config
- continue;
-#endif
-#endif // CONFIG_EXT_INTERP
+#endif // CONFIG_DUAL_FILTER
if (tmp_rd == INT64_MAX) continue;
rs = av1_get_switchable_rate(cpi, xd);
rs_rd = RDCOST(x->rdmult, x->rddiv, rs, 0);
@@ -10986,7 +10965,6 @@
compound_seg_newmvs,
#endif // CONFIG_EXT_INTER
bsi, 0, mi_row, mi_col);
-#if CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
if (!av1_is_interp_needed(xd) && cm->interp_filter == SWITCHABLE &&
(mbmi->interp_filter[0] != EIGHTTAP_REGULAR ||
@@ -10994,12 +10972,7 @@
mbmi->interp_filter[0] = EIGHTTAP_REGULAR;
mbmi->interp_filter[1] = EIGHTTAP_REGULAR;
}
-#else
- if (!av1_is_interp_needed(xd) && cm->interp_filter == SWITCHABLE &&
- mbmi->interp_filter != EIGHTTAP_REGULAR)
- mbmi->interp_filter = EIGHTTAP_REGULAR;
#endif // CONFIG_DUAL_FILTER
-#endif // CONFIG_EXT_INTERP
if (tmp_rd == INT64_MAX) continue;
} else {
total_sse = tmp_best_sse;
diff --git a/test/av1_convolve_optimz_test.cc b/test/av1_convolve_optimz_test.cc
index b891e99..70ed654 100644
--- a/test/av1_convolve_optimz_test.cc
+++ b/test/av1_convolve_optimz_test.cc
@@ -201,7 +201,7 @@
using std::tr1::make_tuple;
-#if (HAVE_SSSE3 || HAVE_SSE4_1) && CONFIG_EXT_INTERP
+#if (HAVE_SSSE3 || HAVE_SSE4_1) && CONFIG_DUAL_FILTER
const BlockDimension kBlockDim[] = {
make_tuple(2, 2), make_tuple(2, 4), make_tuple(4, 4),
make_tuple(4, 8), make_tuple(8, 4), make_tuple(8, 8),
@@ -219,7 +219,7 @@
const int kAvg[] = { 0, 1 };
#endif
-#if HAVE_SSSE3 && CONFIG_EXT_INTERP
+#if HAVE_SSSE3 && CONFIG_DUAL_FILTER
INSTANTIATE_TEST_CASE_P(
SSSE3, AV1ConvolveOptimzTest,
::testing::Combine(::testing::Values(av1_convolve_horiz_ssse3),
@@ -228,7 +228,7 @@
::testing::ValuesIn(kFilter),
::testing::ValuesIn(kSubpelQ4),
::testing::ValuesIn(kAvg)));
-#endif // HAVE_SSSE3 && CONFIG_EXT_INTERP
+#endif // HAVE_SSSE3 && CONFIG_DUAL_FILTER
#if CONFIG_AOM_HIGHBITDEPTH
typedef ::testing::TestWithParam<HbdConvParams> TestWithHbdConvParams;
@@ -377,7 +377,7 @@
RunVertFilterBitExactCheck();
}
-#if HAVE_SSE4_1 && CONFIG_EXT_INTERP
+#if HAVE_SSE4_1 && CONFIG_DUAL_FILTER
const int kBitdepth[] = { 10, 12 };
@@ -390,6 +390,6 @@
::testing::ValuesIn(kSubpelQ4),
::testing::ValuesIn(kAvg),
::testing::ValuesIn(kBitdepth)));
-#endif // HAVE_SSE4_1 && CONFIG_EXT_INTERP
+#endif // HAVE_SSE4_1 && CONFIG_DUAL_FILTER
#endif // CONFIG_AOM_HIGHBITDEPTH
} // namespace
diff --git a/test/av1_convolve_test.cc b/test/av1_convolve_test.cc
index 7e8cb4f..5be2a48 100644
--- a/test/av1_convolve_test.cc
+++ b/test/av1_convolve_test.cc
@@ -137,7 +137,7 @@
}
}
-#if CONFIG_EXT_INTERP && CONFIG_DUAL_FILTER
+#if CONFIG_DUAL_FILTER
TEST(AV1ConvolveTest, av1_convolve_vert_first) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
InterpFilter interp_filter[4] = { EIGHTTAP_REGULAR, MULTITAP_SHARP,
diff --git a/test/convolve_test.cc b/test/convolve_test.cc
index 3c93463..12af4fd 100644
--- a/test/convolve_test.cc
+++ b/test/convolve_test.cc
@@ -639,7 +639,7 @@
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter_bank);
-#if CONFIG_EXT_INTERP || CONFIG_DUAL_FILTER
+#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter_bank);
if (filter_params.taps != SUBPEL_TAPS) continue;
@@ -682,7 +682,7 @@
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter_bank);
-#if CONFIG_EXT_INTERP || CONFIG_DUAL_FILTER
+#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter_bank);
if (filter_params.taps != SUBPEL_TAPS) continue;
@@ -764,7 +764,7 @@
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter_bank);
-#if CONFIG_EXT_INTERP || CONFIG_DUAL_FILTER
+#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter_bank);
if (filter_params.taps != SUBPEL_TAPS) continue;
@@ -866,7 +866,7 @@
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter_bank);
-#if CONFIG_EXT_INTERP || CONFIG_DUAL_FILTER
+#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter_bank);
if (filter_params.taps != SUBPEL_TAPS) continue;