Commit aadbb025 authored by Angie Chiang's avatar Angie Chiang

Mark SMOOTH2 filter under USE_EXTRA_FILTER flag

Change-Id: Ia9a5d818e8c2ff9b4cc41c6d7950cfe005c20bfc
parent 90dad2e4
...@@ -290,12 +290,14 @@ void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst, ...@@ -290,12 +290,14 @@ void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
InterpFilterParams filter_params_y = InterpFilterParams filter_params_y =
av1_get_interp_filter_params(interp_filter[0 + 2 * conv_params->ref]); av1_get_interp_filter_params(interp_filter[0 + 2 * conv_params->ref]);
#if USE_EXTRA_FILTER
if (filter_params_x.interp_filter == MULTITAP_SHARP && if (filter_params_x.interp_filter == MULTITAP_SHARP &&
filter_params_y.interp_filter == MULTITAP_SHARP) { filter_params_y.interp_filter == MULTITAP_SHARP) {
// Avoid two directions both using 12-tap filter. // Avoid two directions both using 12-tap filter.
// This will reduce hardware implementation cost. // This will reduce hardware implementation cost.
filter_params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP); filter_params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP);
} }
#endif // USE_EXTRA_FILTER
#else #else
InterpFilterParams filter_params_x = InterpFilterParams filter_params_x =
av1_get_interp_filter_params(*interp_filter); av1_get_interp_filter_params(*interp_filter);
...@@ -419,12 +421,14 @@ void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride, ...@@ -419,12 +421,14 @@ void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride,
InterpFilterParams filter_params_y = InterpFilterParams filter_params_y =
av1_get_interp_filter_params(interp_filter[0 + 2 * conv_params->ref]); av1_get_interp_filter_params(interp_filter[0 + 2 * conv_params->ref]);
#if USE_EXTRA_FILTER
if (filter_params_x.interp_filter == MULTITAP_SHARP && if (filter_params_x.interp_filter == MULTITAP_SHARP &&
filter_params_y.interp_filter == MULTITAP_SHARP) { filter_params_y.interp_filter == MULTITAP_SHARP) {
// Avoid two directions both using 12-tap filter. // Avoid two directions both using 12-tap filter.
// This will reduce hardware implementation cost. // This will reduce hardware implementation cost.
filter_params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP); filter_params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP);
} }
#endif
#else #else
InterpFilterParams filter_params_x = InterpFilterParams filter_params_x =
av1_get_interp_filter_params(*interp_filter); av1_get_interp_filter_params(*interp_filter);
...@@ -526,7 +530,7 @@ static void convolve_helper(const uint8_t *src, int src_stride, uint8_t *dst, ...@@ -526,7 +530,7 @@ static void convolve_helper(const uint8_t *src, int src_stride, uint8_t *dst,
temp[((MAX_SB_SIZE * 2 + 16) + 16) * MAX_SB_SIZE]); temp[((MAX_SB_SIZE * 2 + 16) + 16) * MAX_SB_SIZE]);
int max_intermediate_size = ((MAX_SB_SIZE * 2 + 16) + 16); int max_intermediate_size = ((MAX_SB_SIZE * 2 + 16) + 16);
int filter_size; int filter_size;
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
if (interp_filter[0 + 2 * conv_params->ref] == MULTITAP_SHARP && if (interp_filter[0 + 2 * conv_params->ref] == MULTITAP_SHARP &&
interp_filter[1 + 2 * conv_params->ref] == MULTITAP_SHARP) { interp_filter[1 + 2 * conv_params->ref] == MULTITAP_SHARP) {
// Avoid two directions both using 12-tap filter. // Avoid two directions both using 12-tap filter.
...@@ -559,7 +563,7 @@ static void convolve_helper(const uint8_t *src, int src_stride, uint8_t *dst, ...@@ -559,7 +563,7 @@ static void convolve_helper(const uint8_t *src, int src_stride, uint8_t *dst,
convolve_horiz(temp + (filter_size / 2 - 1), temp_stride, dst, dst_stride, convolve_horiz(temp + (filter_size / 2 - 1), temp_stride, dst, dst_stride,
w, h, filter_params, subpel_x_q4, x_step_q4, conv_params); w, h, filter_params, subpel_x_q4, x_step_q4, conv_params);
} else } else
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
{ {
int intermediate_height; int intermediate_height;
int temp_stride = MAX_SB_SIZE; int temp_stride = MAX_SB_SIZE;
...@@ -840,15 +844,15 @@ void av1_highbd_convolve(const uint8_t *src8, int src_stride, uint8_t *dst8, ...@@ -840,15 +844,15 @@ void av1_highbd_convolve(const uint8_t *src8, int src_stride, uint8_t *dst8,
av1_get_interp_filter_params(interp_filter[1 + 2 * ref_idx]); av1_get_interp_filter_params(interp_filter[1 + 2 * ref_idx]);
InterpFilterParams filter_params_y = InterpFilterParams filter_params_y =
av1_get_interp_filter_params(interp_filter[0 + 2 * ref_idx]); av1_get_interp_filter_params(interp_filter[0 + 2 * ref_idx]);
#endif
#if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
if (interp_filter[0 + 2 * ref_idx] == MULTITAP_SHARP && if (interp_filter[0 + 2 * ref_idx] == MULTITAP_SHARP &&
interp_filter[1 + 2 * ref_idx] == MULTITAP_SHARP) { interp_filter[1 + 2 * ref_idx] == MULTITAP_SHARP) {
// Avoid two directions both using 12-tap filter. // Avoid two directions both using 12-tap filter.
// This will reduce hardware implementation cost. // This will reduce hardware implementation cost.
filter_params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP); filter_params_y = av1_get_interp_filter_params(EIGHTTAP_SHARP);
} }
#endif
#if CONFIG_DUAL_FILTER
if (filter_params_y.taps < filter_params_x.taps) { if (filter_params_y.taps < filter_params_x.taps) {
int intermediate_width; int intermediate_width;
int temp_stride = max_intermediate_size; int temp_stride = max_intermediate_size;
...@@ -871,7 +875,7 @@ void av1_highbd_convolve(const uint8_t *src8, int src_stride, uint8_t *dst8, ...@@ -871,7 +875,7 @@ void av1_highbd_convolve(const uint8_t *src8, int src_stride, uint8_t *dst8,
temp8 + (filter_size / 2 - 1), temp_stride, dst8, dst_stride, w, h, temp8 + (filter_size / 2 - 1), temp_stride, dst8, dst_stride, w, h,
filter_params, subpel_x_q4, x_step_q4, ref_idx, bd); filter_params, subpel_x_q4, x_step_q4, ref_idx, bd);
} else } else
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
{ {
int intermediate_height; int intermediate_height;
int temp_stride = MAX_SB_SIZE; int temp_stride = MAX_SB_SIZE;
......
...@@ -1769,6 +1769,7 @@ static const aom_prob default_txfm_partition_probs[TXFM_PARTITION_CONTEXTS] = { ...@@ -1769,6 +1769,7 @@ static const aom_prob default_txfm_partition_probs[TXFM_PARTITION_CONTEXTS] = {
static const aom_prob default_skip_probs[SKIP_CONTEXTS] = { 192, 128, 64 }; static const aom_prob default_skip_probs[SKIP_CONTEXTS] = { 192, 128, 64 };
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER
#if USE_EXTRA_FILTER
static const aom_prob default_switchable_interp_prob static const aom_prob default_switchable_interp_prob
[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS - 1] = { [SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS - 1] = {
{ 235, 192, 128 }, { 36, 243, 48 }, { 34, 16, 128 }, { 235, 192, 128 }, { 36, 243, 48 }, { 34, 16, 128 },
...@@ -1779,6 +1780,15 @@ static const aom_prob default_switchable_interp_prob ...@@ -1779,6 +1780,15 @@ static const aom_prob default_switchable_interp_prob
{ 235, 192, 128 }, { 36, 243, 48 }, { 34, 16, 128 }, { 235, 192, 128 }, { 36, 243, 48 }, { 34, 16, 128 },
{ 34, 16, 128 }, { 149, 160, 128 }, { 34, 16, 128 }, { 149, 160, 128 },
}; };
#else // USE_EXTRA_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 }, { 149, 144 },
{ 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 },
{ 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 },
};
#endif // USE_EXTRA_FILTER
#else // CONFIG_DUAL_FILTER #else // CONFIG_DUAL_FILTER
static const aom_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] static const aom_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1] = { [SWITCHABLE_FILTERS - 1] = {
...@@ -2230,6 +2240,7 @@ static const aom_prob default_segment_pred_probs[PREDICTION_PROBS] = { ...@@ -2230,6 +2240,7 @@ static const aom_prob default_segment_pred_probs[PREDICTION_PROBS] = {
// clang-format on // clang-format on
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER
#if USE_EXTRA_FILTER
static const aom_cdf_prob static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE( default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE(
SWITCHABLE_FILTERS)] = { SWITCHABLE_FILTERS)] = {
...@@ -2254,7 +2265,29 @@ static const aom_cdf_prob ...@@ -2254,7 +2265,29 @@ static const aom_cdf_prob
{ AOM_ICDF(4352), AOM_ICDF(5240), AOM_ICDF(6128), AOM_ICDF(32768), 0 }, { AOM_ICDF(4352), AOM_ICDF(5240), AOM_ICDF(6128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19072), AOM_ICDF(23352), AOM_ICDF(27632), AOM_ICDF(32768), 0 } { AOM_ICDF(19072), AOM_ICDF(23352), AOM_ICDF(27632), AOM_ICDF(32768), 0 }
}; };
#else #else // USE_EXTRA_FILTER
static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE(
SWITCHABLE_FILTERS)] = {
{ AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 },
};
#endif // USE_EXTRA_FILTER
#else // CONFIG_DUAL_FILTER
static const aom_cdf_prob static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE( default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE(
SWITCHABLE_FILTERS)] = { SWITCHABLE_FILTERS)] = {
...@@ -2263,7 +2296,7 @@ static const aom_cdf_prob ...@@ -2263,7 +2296,7 @@ static const aom_cdf_prob
{ AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 }, { AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 }, { AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 },
}; };
#endif #endif // CONFIG_DUAL_FILTER
static const aom_cdf_prob default_seg_tree_cdf[CDF_SIZE(MAX_SEGMENTS)] = { static const aom_cdf_prob default_seg_tree_cdf[CDF_SIZE(MAX_SEGMENTS)] = {
AOM_ICDF(4096), AOM_ICDF(8192), AOM_ICDF(12288), AOM_ICDF(4096), AOM_ICDF(8192), AOM_ICDF(12288),
...@@ -4641,7 +4674,7 @@ void av1_set_mode_cdfs(struct AV1Common *cm) { ...@@ -4641,7 +4674,7 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
} }
#endif // !CONFIG_EC_ADAPT #endif // !CONFIG_EC_ADAPT
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] = const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] =
{ {
-EIGHTTAP_REGULAR, 2, 4, -MULTITAP_SHARP, -EIGHTTAP_SMOOTH, -EIGHTTAP_REGULAR, 2, 4, -MULTITAP_SHARP, -EIGHTTAP_SMOOTH,
......
...@@ -48,7 +48,7 @@ DECLARE_ALIGNED(16, static const int16_t, ...@@ -48,7 +48,7 @@ DECLARE_ALIGNED(16, static const int16_t,
}; };
#endif // USE_TEMPORALFILTER_12TAP #endif // USE_TEMPORALFILTER_12TAP
#if CONFIG_DUAL_FILTER #if USE_EXTRA_FILTER
DECLARE_ALIGNED(256, static const InterpKernel, DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8[SUBPEL_SHIFTS]) = { sub_pel_filters_8[SUBPEL_SHIFTS]) = {
#if CONFIG_FILTER_7BIT #if CONFIG_FILTER_7BIT
...@@ -229,7 +229,7 @@ DECLARE_ALIGNED(256, static const InterpKernel, ...@@ -229,7 +229,7 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{ 0, 1, -8, 31, 100, 8, -4, 0 }, { 0, 1, -7, 24, 102, 13, -5, 0 }, { 0, 1, -8, 31, 100, 8, -4, 0 }, { 0, 1, -7, 24, 102, 13, -5, 0 },
#endif #endif
}; };
#else // CONFIG_DUAL_FILTER #else // USE_EXTRA_FILTER
DECLARE_ALIGNED(256, static const InterpKernel, DECLARE_ALIGNED(256, static const InterpKernel,
sub_pel_filters_8[SUBPEL_SHIFTS]) = { sub_pel_filters_8[SUBPEL_SHIFTS]) = {
...@@ -299,7 +299,7 @@ DECLARE_ALIGNED(256, static const InterpKernel, ...@@ -299,7 +299,7 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{ 0, -3, 2, 41, 63, 29, -2, -2 }, { 0, -3, 1, 38, 64, 32, -1, -3 } { 0, -3, 2, 41, 63, 29, -2, -2 }, { 0, -3, 1, 38, 64, 32, -1, -3 }
#endif #endif
}; };
#endif // CONFIG_DUAL_FILTER #endif // USE_EXTRA_FILTER
#if CONFIG_EXT_INTRA #if CONFIG_EXT_INTRA
#if CONFIG_INTRA_INTERP #if CONFIG_INTRA_INTERP
...@@ -312,7 +312,7 @@ const InterpKernel *av1_intra_filter_kernels[INTRA_FILTERS] = { ...@@ -312,7 +312,7 @@ const InterpKernel *av1_intra_filter_kernels[INTRA_FILTERS] = {
#endif // CONFIG_INTRA_INTERP #endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
#if CONFIG_DUAL_FILTER #if USE_EXTRA_FILTER
static const InterpFilterParams static const InterpFilterParams
av1_interp_filter_params_list[SWITCHABLE_FILTERS + EXTRA_FILTERS] = { av1_interp_filter_params_list[SWITCHABLE_FILTERS + EXTRA_FILTERS] = {
{ (const int16_t *)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS, { (const int16_t *)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS,
...@@ -353,7 +353,7 @@ static const InterpFilterParams ...@@ -353,7 +353,7 @@ static const InterpFilterParams
{ (const int16_t *)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS, { (const int16_t *)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS,
BILINEAR } BILINEAR }
}; };
#endif // CONFIG_DUAL_FILTER #endif // USE_EXTRA_FILTER
#if USE_TEMPORALFILTER_12TAP #if USE_TEMPORALFILTER_12TAP
static const InterpFilterParams av1_interp_temporalfilter_12tap = { static const InterpFilterParams av1_interp_temporalfilter_12tap = {
...@@ -384,11 +384,17 @@ const int16_t *av1_get_interp_filter_kernel(const InterpFilter interp_filter) { ...@@ -384,11 +384,17 @@ const int16_t *av1_get_interp_filter_kernel(const InterpFilter interp_filter) {
InterpFilter av1_get_plane_interp_filter(InterpFilter interp_filter, InterpFilter av1_get_plane_interp_filter(InterpFilter interp_filter,
int plane) { int plane) {
#if USE_TEMPORALFILTER_12TAP #if USE_TEMPORALFILTER_12TAP
#if USE_EXTRA_FILTER
assert(interp_filter <= EIGHTTAP_SHARP || assert(interp_filter <= EIGHTTAP_SHARP ||
interp_filter == TEMPORALFILTER_12TAP); interp_filter == TEMPORALFILTER_12TAP);
#else // USE_EXTRA_FILTER
assert(interp_filter <= SWITCHABLE_FILTERS ||
interp_filter == TEMPORALFILTER_12TAP);
#endif // USE_EXTRA_FILTER
#else #else
assert(interp_filter <= EIGHTTAP_SHARP); assert(interp_filter <= EIGHTTAP_SHARP);
#endif #endif
#if USE_EXTRA_FILTER
if (plane == 0) { if (plane == 0) {
return interp_filter; return interp_filter;
} else { } else {
...@@ -400,5 +406,9 @@ InterpFilter av1_get_plane_interp_filter(InterpFilter interp_filter, ...@@ -400,5 +406,9 @@ InterpFilter av1_get_plane_interp_filter(InterpFilter interp_filter,
default: return interp_filter; default: return interp_filter;
} }
} }
#else // USE_EXTRA_FILTER
(void)plane;
return interp_filter;
#endif // USE_EXTRA_FILTER
} }
#endif #endif
...@@ -25,22 +25,23 @@ extern "C" { ...@@ -25,22 +25,23 @@ extern "C" {
#define MAX_FILTER_TAP 12 #define MAX_FILTER_TAP 12
#define USE_12TAP_FILTER 0 #define USE_12TAP_FILTER 0
#define USE_EXTRA_FILTER 0
typedef enum { typedef enum {
EIGHTTAP_REGULAR, EIGHTTAP_REGULAR,
EIGHTTAP_SMOOTH, EIGHTTAP_SMOOTH,
MULTITAP_SHARP, MULTITAP_SHARP,
#if CONFIG_DUAL_FILTER #if USE_EXTRA_FILTER
EIGHTTAP_SMOOTH2, EIGHTTAP_SMOOTH2,
#endif // CONFIG_DUAL_FILTER #endif // USE_EXTRA_FILTER
BILINEAR, BILINEAR,
#if CONFIG_DUAL_FILTER #if USE_EXTRA_FILTER
EIGHTTAP_SHARP, EIGHTTAP_SHARP,
FILTER_REGULAR_UV, FILTER_REGULAR_UV,
FILTER_SMOOTH_UV, FILTER_SMOOTH_UV,
FILTER_SHARP_UV, FILTER_SHARP_UV,
FILTER_SMOOTH2_UV, FILTER_SMOOTH2_UV,
#endif // CONFIG_DUAL_FILTER #endif // USE_EXTRA_FILTER
INTERP_FILTERS_ALL, INTERP_FILTERS_ALL,
SWITCHABLE_FILTERS = BILINEAR, SWITCHABLE_FILTERS = BILINEAR,
SWITCHABLE = SWITCHABLE_FILTERS + 1, /* the last switchable one */ SWITCHABLE = SWITCHABLE_FILTERS + 1, /* the last switchable one */
......
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
#define WIDTH_BOUND (16) #define WIDTH_BOUND (16)
#define HEIGHT_BOUND (16) #define HEIGHT_BOUND (16)
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
DECLARE_ALIGNED(16, static int8_t, DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_12sharp_signal_dir[15][2][16]); sub_pel_filters_12sharp_signal_dir[15][2][16]);
DECLARE_ALIGNED(16, static int8_t, DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_12sharp_ver_signal_dir[15][6][16]); sub_pel_filters_12sharp_ver_signal_dir[15][6][16]);
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
#if USE_TEMPORALFILTER_12TAP #if USE_TEMPORALFILTER_12TAP
DECLARE_ALIGNED(16, static int8_t, DECLARE_ALIGNED(16, static int8_t,
...@@ -39,7 +39,7 @@ typedef int8_t (*SubpelFilterCoeffs)[16]; ...@@ -39,7 +39,7 @@ typedef int8_t (*SubpelFilterCoeffs)[16];
static INLINE SubpelFilterCoeffs static INLINE SubpelFilterCoeffs
get_subpel_filter_signal_dir(const InterpFilterParams p, int index) { get_subpel_filter_signal_dir(const InterpFilterParams p, int index) {
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
if (p.interp_filter == MULTITAP_SHARP) { if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_12sharp_signal_dir[index][0]; return &sub_pel_filters_12sharp_signal_dir[index][0];
} }
...@@ -56,7 +56,7 @@ get_subpel_filter_signal_dir(const InterpFilterParams p, int index) { ...@@ -56,7 +56,7 @@ get_subpel_filter_signal_dir(const InterpFilterParams p, int index) {
static INLINE SubpelFilterCoeffs static INLINE SubpelFilterCoeffs
get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) { get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) {
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
if (p.interp_filter == MULTITAP_SHARP) { if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_12sharp_ver_signal_dir[index][0]; return &sub_pel_filters_12sharp_ver_signal_dir[index][0];
} }
...@@ -143,6 +143,7 @@ static void horiz_w4_ssse3(const uint8_t *src, const __m128i *f, int tapsNum, ...@@ -143,6 +143,7 @@ static void horiz_w4_ssse3(const uint8_t *src, const __m128i *f, int tapsNum,
const __m128i k_256 = _mm_set1_epi16(1 << 8); const __m128i k_256 = _mm_set1_epi16(1 << 8);
const __m128i zero = _mm_setzero_si128(); const __m128i zero = _mm_setzero_si128();
assert(tapsNum == 10 || tapsNum == 12);
if (10 == tapsNum) { if (10 == tapsNum) {
src -= 1; src -= 1;
} }
...@@ -470,6 +471,7 @@ static void filter_horiz_v8p_ssse3(const uint8_t *src_ptr, ptrdiff_t src_pitch, ...@@ -470,6 +471,7 @@ static void filter_horiz_v8p_ssse3(const uint8_t *src_ptr, ptrdiff_t src_pitch,
__m128i min_x2x3, max_x2x3; __m128i min_x2x3, max_x2x3;
__m128i temp; __m128i temp;
assert(tapsNum == 10 || tapsNum == 12);
if (tapsNum == 10) { if (tapsNum == 10) {
src_ptr -= 1; src_ptr -= 1;
} }
...@@ -612,6 +614,7 @@ static void filter_horiz_v4p_ssse3(const uint8_t *src_ptr, ptrdiff_t src_pitch, ...@@ -612,6 +614,7 @@ static void filter_horiz_v4p_ssse3(const uint8_t *src_ptr, ptrdiff_t src_pitch,
__m128i x0, x1, x2, x3, x4, x5; __m128i x0, x1, x2, x3, x4, x5;
__m128i min_x2x3, max_x2x3, temp; __m128i min_x2x3, max_x2x3, temp;
assert(tapsNum == 10 || tapsNum == 12);
if (tapsNum == 10) { if (tapsNum == 10) {
src_ptr -= 1; src_ptr -= 1;
} }
...@@ -982,7 +985,7 @@ typedef struct SimdFilter { ...@@ -982,7 +985,7 @@ typedef struct SimdFilter {
int8_t (*simd_vert_filter)[6][16]; int8_t (*simd_vert_filter)[6][16];
} SimdFilter; } SimdFilter;
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
#define MULTITAP_FILTER_NUM 1 #define MULTITAP_FILTER_NUM 1
SimdFilter simd_filters[MULTITAP_FILTER_NUM] = { SimdFilter simd_filters[MULTITAP_FILTER_NUM] = {
{ MULTITAP_SHARP, &sub_pel_filters_12sharp_signal_dir[0], { MULTITAP_SHARP, &sub_pel_filters_12sharp_signal_dir[0],
...@@ -1010,7 +1013,7 @@ void av1_lowbd_convolve_init_ssse3(void) { ...@@ -1010,7 +1013,7 @@ void av1_lowbd_convolve_init_ssse3(void) {
temporal_simd_filter.simd_vert_filter); temporal_simd_filter.simd_vert_filter);
} }
#endif #endif
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
{ {
int i; int i;
for (i = 0; i < MULTITAP_FILTER_NUM; ++i) { for (i = 0; i < MULTITAP_FILTER_NUM; ++i) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "./av1_rtcd.h" #include "./av1_rtcd.h"
#include "av1/common/filter.h" #include "av1/common/filter.h"
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
DECLARE_ALIGNED(16, static int16_t, subpel_filters_sharp[15][6][8]); DECLARE_ALIGNED(16, static int16_t, subpel_filters_sharp[15][6][8]);
#endif #endif
...@@ -31,7 +31,7 @@ typedef void (*TransposeSave)(int width, int pixelsNum, uint32_t *src, ...@@ -31,7 +31,7 @@ typedef void (*TransposeSave)(int width, int pixelsNum, uint32_t *src,
static INLINE HbdSubpelFilterCoeffs static INLINE HbdSubpelFilterCoeffs
hbd_get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) { hbd_get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) {
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
if (p.interp_filter == MULTITAP_SHARP) { if (p.interp_filter == MULTITAP_SHARP) {
return &subpel_filters_sharp[index][0]; return &subpel_filters_sharp[index][0];
} }
...@@ -76,7 +76,7 @@ void av1_highbd_convolve_init_sse4_1(void) { ...@@ -76,7 +76,7 @@ void av1_highbd_convolve_init_sse4_1(void) {
init_simd_filter(filter_ptr, taps, subpel_temporalfilter); init_simd_filter(filter_ptr, taps, subpel_temporalfilter);
} }
#endif #endif
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
{ {
InterpFilterParams filter_params = InterpFilterParams filter_params =
av1_get_interp_filter_params(MULTITAP_SHARP); av1_get_interp_filter_params(MULTITAP_SHARP);
...@@ -246,6 +246,7 @@ static void highbd_filter_horiz(const uint16_t *src, int src_stride, __m128i *f, ...@@ -246,6 +246,7 @@ static void highbd_filter_horiz(const uint16_t *src, int src_stride, __m128i *f,
int tapsNum, uint32_t *buf) { int tapsNum, uint32_t *buf) {
__m128i u[8], v[6]; __m128i u[8], v[6];
assert(tapsNum == 10 || tapsNum == 12);
if (tapsNum == 10) { if (tapsNum == 10) {
src -= 1; src -= 1;
} }
...@@ -412,6 +413,7 @@ static void filter_vert_horiz_parallel(const uint16_t *src, int src_stride, ...@@ -412,6 +413,7 @@ static void filter_vert_horiz_parallel(const uint16_t *src, int src_stride,
int r = 0; int r = 0;
// TODO(luoyi) treat s[12] as a circular buffer in width = 2 case // TODO(luoyi) treat s[12] as a circular buffer in width = 2 case
assert(taps == 10 || taps == 12);
if (10 == taps) { if (10 == taps) {
i += 1; i += 1;
s[0] = zero; s[0] = zero;
......
...@@ -66,11 +66,18 @@ ...@@ -66,11 +66,18 @@
#endif // CONFIG_PVQ || CONFIG_DAALA_DIST #endif // CONFIG_PVQ || CONFIG_DAALA_DIST
#if CONFIG_DUAL_FILTER #if CONFIG_DUAL_FILTER
#define DUAL_FILTER_SET_SIZE (SWITCHABLE_FILTERS * SWITCHABLE_FILTERS) #define DUAL_FILTER_SET_SIZE (SWITCHABLE_FILTERS * SWITCHABLE_FILTERS)
#if USE_EXTRA_FILTER
static const int filter_sets[DUAL_FILTER_SET_SIZE][2] = { static const int filter_sets[DUAL_FILTER_SET_SIZE][2] = {
{ 0, 0 }, { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 0 }, { 1, 1 }, { 0, 0 }, { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 0 }, { 1, 1 },
{ 1, 2 }, { 1, 3 }, { 2, 0 }, { 2, 1 }, { 2, 2 }, { 2, 3 }, { 1, 2 }, { 1, 3 }, { 2, 0 }, { 2, 1 }, { 2, 2 }, { 2, 3 },
{ 3, 0 }, { 3, 1 }, { 3, 2 }, { 3, 3 }, { 3, 0 }, { 3, 1 }, { 3, 2 }, { 3, 3 },
}; };
#else // USE_EXTRA_FILTER
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 // USE_EXTRA_FILTER
#endif // CONFIG_DUAL_FILTER #endif // CONFIG_DUAL_FILTER
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
......
...@@ -218,7 +218,7 @@ const BlockDimension kBlockDim[] = { ...@@ -218,7 +218,7 @@ const BlockDimension kBlockDim[] = {
}; };
// 10/12-tap filters // 10/12-tap filters
const InterpFilter kFilter[] = { FILTER_REGULAR_UV, BILINEAR, MULTITAP_SHARP }; const InterpFilter kFilter[] = { EIGHTTAP_REGULAR, BILINEAR, MULTITAP_SHARP };
const int kSubpelQ4[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; const int kSubpelQ4[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
......
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