Commit 9aea97d1 authored by Yaowu Xu's avatar Yaowu Xu

Remove CONFIG_DUAL_FILTER

The experiment is fully adopted.

Change-Id: I76d2bbf5ba09b58efbc1ecebfc16b3c2843b2fad
parent 0c4a6321
......@@ -65,13 +65,8 @@ static INLINE void av1_get_convolve_filter_params(InterpFilters interp_filters,
int w, int h
#endif
) {
#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
#if CONFIG_SHORT_FILTER
*params_x = av1_get_interp_filter_params_with_block_size(filter_x, w);
*params_y = av1_get_interp_filter_params_with_block_size(filter_y, h);
......
......@@ -621,7 +621,6 @@ static const aom_cdf_prob
{ AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) }
};
#if CONFIG_DUAL_FILTER
static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE(
SWITCHABLE_FILTERS)] = {
......@@ -634,16 +633,6 @@ static const aom_cdf_prob
{ AOM_CDF3(31616, 31787) }, { AOM_CDF3(4224, 32433) },
{ AOM_CDF3(128, 256) }, { AOM_CDF3(17408, 18248) }
};
#else // CONFIG_DUAL_FILTER
static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
[CDF_SIZE(SWITCHABLE_FILTERS)] = {
{ AOM_CDF3(30080, 31781) },
{ AOM_CDF3(4608, 32658) },
{ AOM_CDF3(4352, 4685) },
{ AOM_CDF3(19072, 26776) },
};
#endif // CONFIG_DUAL_FILTER
#if CONFIG_SPATIAL_SEGMENTATION
static const aom_cdf_prob
......
......@@ -278,7 +278,6 @@ typedef enum ATTRIBUTE_PACKED {
TX_TYPES,
} TX_TYPE;
#if CONFIG_DUAL_FILTER
typedef enum {
REG_REG,
REG_SMOOTH,
......@@ -290,7 +289,6 @@ typedef enum {
SHARP_SMOOTH,
SHARP_SHARP,
} DUAL_FILTER_TYPE;
#endif
typedef enum ATTRIBUTE_PACKED {
// DCT only
......
......@@ -42,7 +42,6 @@ typedef enum ATTRIBUTE_PACKED {
// 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) {
......@@ -59,21 +58,6 @@ static INLINE InterpFilters av1_make_interp_filters(InterpFilter y_filter,
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) {
#ifdef NDEBUG
(void)x_filter;
#endif
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;
......@@ -82,14 +66,10 @@ static INLINE InterpFilter av1_unswitchable_filter(InterpFilter filter) {
#define LOG_SWITCHABLE_FILTERS \
2 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */
#if CONFIG_DUAL_FILTER
#define MAX_SUBPEL_TAPS 12
#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_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1)
#endif // CONFIG_DUAL_FILTER
typedef struct InterpFilterParams {
const int16_t *filter_ptr;
......
......@@ -16,7 +16,6 @@
#include "av1/common/seg_common.h"
// Returns a context number for the given MB prediction signal
#if CONFIG_DUAL_FILTER
static InterpFilter get_ref_filter_type(const MODE_INFO *mi,
const MACROBLOCKD *xd, int dir,
MV_REFERENCE_FRAME ref_frame) {
......@@ -67,36 +66,6 @@ int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir) {
return filter_type_ctx;
}
#else
int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries corresponding to real macroblocks.
// The prediction flags in these dummy entries are initialized to 0.
const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
const int left_type =
xd->left_available && is_inter_block(left_mbmi)
? av1_extract_interp_filter(left_mbmi->interp_filters, 0)
: SWITCHABLE_FILTERS;
const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
const int above_type =
xd->up_available && is_inter_block(above_mbmi)
? av1_extract_interp_filter(above_mbmi->interp_filters, 0)
: SWITCHABLE_FILTERS;
if (left_type == above_type) {
return left_type;
} else if (left_type == SWITCHABLE_FILTERS) {
assert(above_type != SWITCHABLE_FILTERS);
return above_type;
} else if (above_type == SWITCHABLE_FILTERS) {
assert(left_type != SWITCHABLE_FILTERS);
return left_type;
} else {
return SWITCHABLE_FILTERS;
}
}
#endif
static void palette_add_to_cache(uint16_t *cache, int *n, uint16_t val) {
// Do not add an already existing value
......
......@@ -162,11 +162,7 @@ static INLINE int av1_get_skip_context(const MACROBLOCKD *xd) {
return above_skip + left_skip;
}
#if CONFIG_DUAL_FILTER
int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir);
#else
int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
#endif
// Get a list of palette base colors that are used in the above and left blocks,
// referred to as "color cache". The return value is the number of colors in the
......
......@@ -1337,7 +1337,6 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
if (cm->interp_filter != SWITCHABLE) {
mbmi->interp_filters = av1_broadcast_interp_filter(cm->interp_filter);
} else {
#if CONFIG_DUAL_FILTER
InterpFilter ref0_filter[2] = { EIGHTTAP_REGULAR, EIGHTTAP_REGULAR };
for (int dir = 0; dir < 2; ++dir) {
if (has_subpel_mv_component(xd->mi[0], xd, dir) ||
......@@ -1352,12 +1351,6 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
// The index system works as: (0, 1) -> (vertical, horizontal) filter types
mbmi->interp_filters =
av1_make_interp_filters(ref0_filter[0], ref0_filter[1]);
#else // CONFIG_DUAL_FILTER
const int ctx = av1_get_pred_context_switchable_interp(xd);
InterpFilter filter = (InterpFilter)aom_read_symbol(
r, ec_ctx->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS, ACCT_STR);
mbmi->interp_filters = av1_broadcast_interp_filter(filter);
#endif // CONFIG_DUAL_FILTER
}
}
......
......@@ -95,13 +95,9 @@ int ifd_inspect(insp_frame_data *fd, void *decoder) {
mi->sb_type = mbmi->sb_type;
// Skip Flag
mi->skip = mbmi->skip;
#if CONFIG_DUAL_FILTER
mi->filter[0] = av1_extract_interp_filter(mbmi->interp_filters, 0);
mi->filter[1] = av1_extract_interp_filter(mbmi->interp_filters, 1);
mi->dual_filter_type = mi->filter[0] * 3 + mi->filter[1];
#else
mi->filter = av1_extract_interp_filter(mbmi->interp_filters, 0);
#endif
// Transform
mi->tx_type = mbmi->tx_type;
mi->tx_size = mbmi->tx_size;
......
......@@ -41,12 +41,8 @@ struct insp_mi_data {
int16_t sb_type;
int16_t skip;
int16_t segment_id;
#if CONFIG_DUAL_FILTER
int16_t dual_filter_type;
int16_t filter[2];
#else
int16_t filter;
#endif
int16_t tx_type;
int16_t tx_size;
int16_t cdef_level;
......
......@@ -692,7 +692,6 @@ static void write_mb_interp_filter(AV1_COMP *cpi, const MACROBLOCKD *xd,
return;
}
if (cm->interp_filter == SWITCHABLE) {
#if CONFIG_DUAL_FILTER
int dir;
for (dir = 0; dir < 2; ++dir) {
if (has_subpel_mv_component(xd->mi[0], xd, dir) ||
......@@ -709,15 +708,6 @@ static void write_mb_interp_filter(AV1_COMP *cpi, const MACROBLOCKD *xd,
EIGHTTAP_REGULAR);
}
}
#else
{
const int ctx = av1_get_pred_context_switchable_interp(xd);
InterpFilter filter = av1_extract_interp_filter(mbmi->interp_filters, 0);
aom_write_symbol(w, filter, ec_ctx->switchable_interp_cdf[ctx],
SWITCHABLE_FILTERS);
++cpi->interp_filter_selected[0][filter];
}
#endif // CONFIG_DUAL_FILTER
}
}
......
......@@ -325,7 +325,6 @@ static void set_offsets(const AV1_COMP *const cpi, const TileInfo *const tile,
}
}
#if CONFIG_DUAL_FILTER
static void reset_intmv_filter_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
MB_MODE_INFO *mbmi) {
InterpFilter filters[2];
......@@ -361,7 +360,6 @@ static void update_filter_type_count(uint8_t allow_update_cdf,
}
}
}
#endif
static void update_global_motion_used(PREDICTION_MODE mode, BLOCK_SIZE bsize,
const MB_MODE_INFO *mbmi,
RD_COUNTS *rdc) {
......@@ -461,9 +459,7 @@ static void update_state(const AV1_COMP *const cpi, TileDataEnc *tile_data,
*mi_addr = *mi;
*x->mbmi_ext = ctx->mbmi_ext;
#if CONFIG_DUAL_FILTER
reset_intmv_filter_type(cm, xd, mbmi);
#endif
rf_type = av1_ref_frame_type(mbmi->ref_frame);
if (x->mbmi_ext->ref_mv_count[rf_type] > 1) {
......@@ -566,16 +562,8 @@ static void update_state(const AV1_COMP *const cpi, TileDataEnc *tile_data,
if (cm->interp_filter == SWITCHABLE && mbmi->motion_mode != WARPED_CAUSAL &&
!is_nontrans_global_motion(xd)) {
#if CONFIG_DUAL_FILTER
update_filter_type_count(tile_data->allow_update_cdf, td->counts, xd,
mbmi);
#else
(void)tile_data;
const int switchable_ctx = av1_get_pred_context_switchable_interp(xd);
const InterpFilter filter =
av1_extract_interp_filter(mbmi->interp_filters, 0);
++td->counts->switchable_interp[switchable_ctx][filter];
#endif
}
rdc->comp_pred_diff[SINGLE_REFERENCE] += ctx->single_pred_diff;
......@@ -4633,9 +4621,7 @@ void av1_encode_frame(AV1_COMP *cpi) {
else
cm->reference_mode = REFERENCE_MODE_SELECT;
#if CONFIG_DUAL_FILTER
cm->interp_filter = SWITCHABLE;
#endif
#if CONFIG_EXT_TILE
if (cm->large_scale_tile) cm->interp_filter = EIGHTTAP_REGULAR;
#endif // CONFIG_EXT_TILE
......
......@@ -960,7 +960,6 @@ YV12_BUFFER_CONFIG *av1_get_scaled_ref_frame(const AV1_COMP *cpi,
: NULL;
}
#if CONFIG_DUAL_FILTER
int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x,
const MACROBLOCKD *xd) {
if (cm->interp_filter == SWITCHABLE) {
......@@ -983,20 +982,6 @@ int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x,
return 0;
}
}
#else
int av1_get_switchable_rate(const AV1_COMMON *const cm, MACROBLOCK *x,
const MACROBLOCKD *xd) {
if (cm->interp_filter == SWITCHABLE) {
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const int ctx = av1_get_pred_context_switchable_interp(xd);
const InterpFilter filter =
av1_extract_interp_filter(mbmi->interp_filters, 0);
return SWITCHABLE_INTERP_RATE_FACTOR *
x->switchable_interp_costs[ctx][filter];
}
return 0;
}
#endif
void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
int i;
......
This diff is collapsed.
......@@ -151,9 +151,7 @@ static void set_good_speed_features_framesize_independent(AV1_COMP *cpi,
#if CONFIG_EXT_PARTITION_TYPES
sf->prune_ext_partition_types_search = 1;
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_DUAL_FILTER
sf->use_fast_interpolation_filter_search = 1;
#endif // CONFIG_DUAL_FILTER
#if 0 // CONFIG_HASH_ME
// TODO(mfo): Activate feature once it gives positive results.
sf->use_hash_based_trellis = 1;
......
......@@ -98,7 +98,6 @@ set(CONFIG_COLORSPACE_HEADERS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_DEPENDENT_HORZTILEGROUPS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_DEPENDENT_HORZTILES 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_DIST_8X8 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_DUAL_FILTER 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_ENTROPY_STATS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_EOB_FIRST 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_EXT_COMP_REFS 1 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -94,10 +94,8 @@ static const arg_def_t dump_cdef_arg = ARG_DEF("c", "cdef", 0, "Dump CDEF");
static const arg_def_t dump_cfl_arg =
ARG_DEF("cfl", "chroma_from_luma", 0, "Dump Chroma from Luma Alphas");
#endif
#if CONFIG_DUAL_FILTER
static const arg_def_t dump_dual_filter_type_arg =
ARG_DEF("df", "dualFilterType", 0, "Dump Dual Filter Type");
#endif
static const arg_def_t dump_reference_frame_arg =
ARG_DEF("r", "referenceFrame", 0, "Dump Reference Frame");
static const arg_def_t dump_delta_q_arg =
......@@ -120,9 +118,7 @@ static const arg_def_t *main_args[] = { &limit_arg,
&dump_skip_arg,
&dump_filter_arg,
&dump_cdef_arg,
#if CONFIG_DUAL_FILTER
&dump_dual_filter_type_arg,
#endif
#if CONFIG_CFL
&dump_cfl_arg,
#endif
......@@ -189,13 +185,11 @@ const map_entry tx_type_map[] = { ENUM(DCT_DCT),
ENUM(V_FLIPADST),
ENUM(H_FLIPADST),
LAST_ENUM };
#if CONFIG_DUAL_FILTER
const map_entry dual_filter_map[] = { ENUM(REG_REG), ENUM(REG_SMOOTH),
ENUM(REG_SHARP), ENUM(SMOOTH_REG),
ENUM(SMOOTH_SMOOTH), ENUM(SMOOTH_SHARP),
ENUM(SHARP_REG), ENUM(SHARP_SMOOTH),
ENUM(SHARP_SHARP), LAST_ENUM };
#endif
const map_entry prediction_mode_map[] = {
ENUM(DC_PRED), ENUM(V_PRED), ENUM(H_PRED),
......@@ -534,12 +528,10 @@ void inspect(void *pbi, void *data) {
buf += put_block_info(buf, tx_type_map, "transformType",
offsetof(insp_mi_data, tx_type), 0);
}
#if CONFIG_DUAL_FILTER
if (layers & DUAL_FILTER_LAYER) {
buf += put_block_info(buf, dual_filter_map, "dualFilterType",
offsetof(insp_mi_data, dual_filter_type), 0);
}
#endif
if (layers & MODE_LAYER) {
buf += put_block_info(buf, prediction_mode_map, "mode",
offsetof(insp_mi_data, mode), 0);
......@@ -553,13 +545,8 @@ void inspect(void *pbi, void *data) {
put_block_info(buf, skip_map, "skip", offsetof(insp_mi_data, skip), 0);
}
if (layers & FILTER_LAYER) {
#if CONFIG_DUAL_FILTER
buf +=
put_block_info(buf, NULL, "filter", offsetof(insp_mi_data, filter), 2);
#else
buf +=
put_block_info(buf, NULL, "filter", offsetof(insp_mi_data, filter), 0);
#endif
}
if (layers & CDEF_LAYER) {
buf += put_block_info(buf, NULL, "cdef_level",
......@@ -733,10 +720,8 @@ static void parse_args(char **argv) {
layers |= REFERENCE_FRAME_LAYER;
else if (arg_match(&arg, &dump_motion_vectors_arg, argi))
layers |= MOTION_VECTORS_LAYER;
#if CONFIG_DUAL_FILTER
else if (arg_match(&arg, &dump_dual_filter_type_arg, argi))
layers |= DUAL_FILTER_LAYER;
#endif
else if (arg_match(&arg, &dump_delta_q_arg, argi))
layers |= Q_INDEX_LAYER;
else if (arg_match(&arg, &dump_seg_id_arg, argi))
......
......@@ -199,7 +199,7 @@ TEST_P(AV1ConvolveOptimzTest, VerticalBitExactCheck) {
using std::tr1::make_tuple;
#if (HAVE_SSSE3 || HAVE_SSE4_1) && CONFIG_DUAL_FILTER
#if (HAVE_SSSE3 || HAVE_SSE4_1)
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),
......@@ -217,7 +217,7 @@ const int kSubpelQ4[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
const int kAvg[] = { 0, 1 };
#endif
#if HAVE_SSSE3 && CONFIG_DUAL_FILTER
#if HAVE_SSSE3
INSTANTIATE_TEST_CASE_P(
SSSE3, AV1ConvolveOptimzTest,
::testing::Combine(::testing::Values(av1_convolve_horiz_ssse3),
......@@ -226,7 +226,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::ValuesIn(kFilter),
::testing::ValuesIn(kSubpelQ4),
::testing::ValuesIn(kAvg)));
#endif // HAVE_SSSE3 && CONFIG_DUAL_FILTER
#endif // HAVE_SSSE3
typedef ::testing::TestWithParam<HbdConvParams> TestWithHbdConvParams;
class AV1HbdConvolveOptimzTest : public TestWithHbdConvParams {
......@@ -374,7 +374,7 @@ TEST_P(AV1HbdConvolveOptimzTest, VertBitExactCheck) {
RunVertFilterBitExactCheck();
}
#if HAVE_SSE4_1 && CONFIG_DUAL_FILTER
#if HAVE_SSE4_1
const int kBitdepth[] = { 10, 12 };
......@@ -387,5 +387,5 @@ INSTANTIATE_TEST_CASE_P(
::testing::ValuesIn(kSubpelQ4),
::testing::ValuesIn(kAvg),
::testing::ValuesIn(kBitdepth)));
#endif // HAVE_SSE4_1 && CONFIG_DUAL_FILTER
#endif // HAVE_SSE4_1
} // namespace
......@@ -589,11 +589,9 @@ TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) {
const InterpFilter filter = (InterpFilter)filter_bank;
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter);
#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter);
if (filter_params.taps != SUBPEL_TAPS) continue;
#endif
for (int i = 0; i < kNumFilters; i++) {
const int p0 = filters[i][0] + filters[i][1];
const int p1 = filters[i][2] + filters[i][3];
......@@ -629,11 +627,9 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
const InterpFilter filter = (InterpFilter)filter_bank;
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter);
#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter);
if (filter_params.taps != SUBPEL_TAPS) continue;
#endif
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
......@@ -703,11 +699,9 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
const InterpFilter filter = (InterpFilter)filter_bank;
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter);
#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter);
if (filter_params.taps != SUBPEL_TAPS) continue;
#endif
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
......@@ -793,11 +787,9 @@ TEST_P(ConvolveTest, FilterExtremes) {
const InterpFilter filter = (InterpFilter)filter_bank;
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter);
#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter);
if (filter_params.taps != SUBPEL_TAPS) continue;
#endif
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
wrapper_filter_block2d_8_c(in, kInputStride, filters[filter_x],
......@@ -947,11 +939,9 @@ TEST_P(ConvolveTest, DISABLED_Speed) {
const InterpFilter filter = (InterpFilter)filter_bank;
const InterpKernel *filters =
(const InterpKernel *)av1_get_interp_filter_kernel(filter);
#if CONFIG_DUAL_FILTER
const InterpFilterParams filter_params =
av1_get_interp_filter_params(filter);
if (filter_params.taps != SUBPEL_TAPS) continue;
#endif
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
......
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