Commit d91ab373 authored by Angie Chiang's avatar Angie Chiang

Merge 2 sharp interpolation filters

Compression will drop slightly
       BDRate
lowres -0.096%
midres -0.069%
hdres  -0.084%

However, this will reduce the combinations of filter types needed to search in
dual_filter experiment

Change-Id: I75d4ddc73b91099e17fd52a1b1174bd3d2ab3e18
parent e067de00
......@@ -1274,25 +1274,26 @@ static const aom_prob default_txfm_partition_probs[TXFM_PARTITION_CONTEXTS] = {
static const aom_prob default_skip_probs[SKIP_CONTEXTS] = { 192, 128, 64 };
#if CONFIG_EXT_INTERP
static const aom_prob default_switchable_interp_prob
[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS - 1] = {
static const aom_prob
default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1] = {
#if CONFIG_DUAL_FILTER
{ 235, 192, 128, 128 }, { 36, 243, 208, 128 }, { 34, 16, 128, 128 },
{ 36, 243, 48, 128 }, { 34, 16, 128, 128 }, { 149, 160, 128, 128 },
{ 235, 192, 128, 128 }, { 36, 243, 208, 128 }, { 34, 16, 128, 128 },
{ 36, 243, 48, 128 }, { 34, 16, 128, 128 }, { 149, 160, 128, 128 },
{ 235, 192, 128, 128 }, { 36, 243, 208, 128 }, { 34, 16, 128, 128 },
{ 36, 243, 48, 128 }, { 34, 16, 128, 128 }, { 149, 160, 128, 128 },
{ 235, 192, 128, 128 }, { 36, 243, 208, 128 }, { 34, 16, 128, 128 },
{ 36, 243, 48, 128 }, { 34, 16, 128, 128 }, { 149, 160, 128, 128 },
{ 235, 192, 128 }, { 36, 243, 48 },
{ 34, 16, 128 }, { 34, 16, 128 },
{ 149, 160, 128 }, { 235, 192, 128 },
{ 36, 243, 48 }, { 34, 16, 128 },
{ 34, 16, 128 }, { 149, 160, 128 },
{ 235, 192, 128 }, { 36, 243, 48 },
{ 34, 16, 128 }, { 34, 16, 128 },
{ 149, 160, 128 }, { 235, 192, 128 },
{ 36, 243, 48 }, { 34, 16, 128 },
{ 34, 16, 128 }, { 149, 160, 128 },
#else
{ 235, 192, 128, 128 }, { 36, 243, 208, 128 }, { 34, 16, 128, 128 },
{ 36, 243, 48, 128 }, { 34, 16, 128, 128 }, { 149, 160, 128, 128 },
{ 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
......@@ -1789,14 +1790,8 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
#if CONFIG_EXT_INTERP
const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] =
{
-EIGHTTAP_REGULAR,
2,
4,
6,
-EIGHTTAP_SMOOTH,
-EIGHTTAP_REGULAR, 2, 4, -MULTITAP_SHARP, -EIGHTTAP_SMOOTH,
-EIGHTTAP_SMOOTH2,
-MULTITAP_SHARP,
-MULTITAP_SHARP2,
};
#else
const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] =
......
......@@ -78,24 +78,24 @@ DECLARE_ALIGNED(256, static const InterpKernel,
#endif // CONFIG_EXT_INTRA
DECLARE_ALIGNED(256, static const int16_t,
sub_pel_filters_10sharp[SUBPEL_SHIFTS][10]) = {
// intfilt 0.77
{ 0, 0, 0, 0, 128, 0, 0, 0, 0, 0 },
{ 0, -1, 3, -6, 127, 8, -4, 2, -1, 0 },
{ 1, -2, 5, -12, 124, 18, -7, 3, -2, 0 },
{ 1, -3, 7, -17, 119, 28, -11, 5, -2, 1 },
{ 1, -4, 8, -20, 114, 38, -14, 7, -3, 1 },
{ 1, -4, 9, -22, 107, 49, -17, 8, -4, 1 },
{ 2, -5, 10, -24, 99, 59, -20, 9, -4, 2 },
{ 2, -5, 10, -24, 90, 70, -22, 10, -5, 2 },
{ 2, -5, 10, -23, 80, 80, -23, 10, -5, 2 },
{ 2, -5, 10, -22, 70, 90, -24, 10, -5, 2 },
{ 2, -4, 9, -20, 59, 99, -24, 10, -5, 2 },
{ 1, -4, 8, -17, 49, 107, -22, 9, -4, 1 },
{ 1, -3, 7, -14, 38, 114, -20, 8, -4, 1 },
{ 1, -2, 5, -11, 28, 119, -17, 7, -3, 1 },
{ 0, -2, 3, -7, 18, 124, -12, 5, -2, 1 },
{ 0, -1, 2, -4, 8, 127, -6, 3, -1, 0 },
sub_pel_filters_12sharp[SUBPEL_SHIFTS][12]) = {
// intfilt 0.8
{ 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0 },
{ 0, 1, -1, 3, -7, 127, 8, -4, 2, -1, 0, 0 },
{ 0, 1, -3, 5, -12, 124, 18, -8, 4, -2, 1, 0 },
{ -1, 2, -4, 8, -17, 120, 28, -11, 6, -3, 1, -1 },
{ -1, 2, -4, 10, -21, 114, 38, -15, 8, -4, 2, -1 },
{ -1, 3, -5, 11, -23, 107, 49, -18, 9, -5, 2, -1 },
{ -1, 3, -6, 12, -25, 99, 60, -21, 11, -6, 3, -1 },
{ -1, 3, -6, 12, -25, 90, 70, -23, 12, -6, 3, -1 },
{ -1, 3, -6, 12, -24, 80, 80, -24, 12, -6, 3, -1 },
{ -1, 3, -6, 12, -23, 70, 90, -25, 12, -6, 3, -1 },
{ -1, 3, -6, 11, -21, 60, 99, -25, 12, -6, 3, -1 },
{ -1, 2, -5, 9, -18, 49, 107, -23, 11, -5, 3, -1 },
{ -1, 2, -4, 8, -15, 38, 114, -21, 10, -4, 2, -1 },
{ -1, 1, -3, 6, -11, 28, 120, -17, 8, -4, 2, -1 },
{ 0, 1, -2, 4, -8, 18, 124, -12, 5, -3, 1, 0 },
{ 0, 0, -1, 2, -4, 8, 127, -7, 3, -1, 1, 0 },
};
DECLARE_ALIGNED(256, static const InterpKernel,
......@@ -123,27 +123,6 @@ DECLARE_ALIGNED(256, static const InterpKernel,
{ 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 },
};
DECLARE_ALIGNED(16, static const int16_t,
sub_pel_filters_12sharp[SUBPEL_SHIFTS][12]) = {
// intfilt 0.85
{ 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0 },
{ 0, 1, -2, 3, -7, 127, 8, -4, 2, -1, 1, 0 },
{ -1, 2, -3, 6, -13, 124, 18, -8, 4, -2, 2, -1 },
{ -1, 3, -4, 8, -18, 120, 28, -12, 7, -4, 2, -1 },
{ -1, 3, -6, 10, -21, 115, 38, -15, 8, -5, 3, -1 },
{ -2, 4, -6, 12, -24, 108, 49, -18, 10, -6, 3, -2 },
{ -2, 4, -7, 13, -25, 100, 60, -21, 11, -7, 4, -2 },
{ -2, 4, -7, 13, -26, 91, 71, -24, 13, -7, 4, -2 },
{ -2, 4, -7, 13, -25, 81, 81, -25, 13, -7, 4, -2 },
{ -2, 4, -7, 13, -24, 71, 91, -26, 13, -7, 4, -2 },
{ -2, 4, -7, 11, -21, 60, 100, -25, 13, -7, 4, -2 },
{ -2, 3, -6, 10, -18, 49, 108, -24, 12, -6, 4, -2 },
{ -1, 3, -5, 8, -15, 38, 115, -21, 10, -6, 3, -1 },
{ -1, 2, -4, 7, -12, 28, 120, -18, 8, -4, 3, -1 },
{ -1, 2, -2, 4, -8, 18, 124, -13, 6, -3, 2, -1 },
{ 0, 1, -1, 2, -4, 8, 127, -7, 3, -2, 1, 0 },
};
#else // CONFIG_EXT_INTERP
DECLARE_ALIGNED(256, static const InterpKernel,
......@@ -232,12 +211,10 @@ static const InterpFilterParams
EIGHTTAP_REGULAR },
{ (const int16_t *)sub_pel_filters_8smooth, SUBPEL_TAPS, SUBPEL_SHIFTS,
EIGHTTAP_SMOOTH },
{ (const int16_t *)sub_pel_filters_10sharp, 10, SUBPEL_SHIFTS,
{ (const int16_t *)sub_pel_filters_12sharp, 12, SUBPEL_SHIFTS,
MULTITAP_SHARP },
{ (const int16_t *)sub_pel_filters_8smooth2, SUBPEL_TAPS, SUBPEL_SHIFTS,
EIGHTTAP_SMOOTH2 },
{ (const int16_t *)sub_pel_filters_12sharp, 12, SUBPEL_SHIFTS,
MULTITAP_SHARP2 },
{ (const int16_t *)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS,
BILINEAR }
};
......
......@@ -27,12 +27,11 @@ extern "C" {
#if CONFIG_EXT_INTERP
#define EIGHTTAP_SMOOTH2 3
#define MULTITAP_SHARP2 4
#define MAX_SUBPEL_TAPS 12
#define SUPPORT_NONINTERPOLATING_FILTERS 0 /* turn on for experimentation */
#define SWITCHABLE_FILTERS 5 /* Number of switchable filters */
#define SWITCHABLE_FILTERS 4 /* Number of switchable filters */
#define LOG_SWITCHABLE_FILTERS \
3 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */
#else
......
......@@ -20,12 +20,6 @@
#define HEIGHT_BOUND (16)
#if CONFIG_EXT_INTERP
DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_10sharp_signal_dir[15][2][16]);
DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_10sharp_ver_signal_dir[15][6][16]);
DECLARE_ALIGNED(16, static int8_t,
sub_pel_filters_12sharp_signal_dir[15][2][16]);
......@@ -46,11 +40,8 @@ typedef int8_t (*SubpelFilterCoeffs)[16];
static INLINE SubpelFilterCoeffs
get_subpel_filter_signal_dir(const InterpFilterParams p, int index) {
#if CONFIG_EXT_INTERP
if (p.interp_filter == MULTITAP_SHARP2) {
return &sub_pel_filters_12sharp_signal_dir[index][0];
}
if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_10sharp_signal_dir[index][0];
return &sub_pel_filters_12sharp_signal_dir[index][0];
}
#endif
#if USE_TEMPORALFILTER_12TAP
......@@ -66,11 +57,8 @@ get_subpel_filter_signal_dir(const InterpFilterParams p, int index) {
static INLINE SubpelFilterCoeffs
get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) {
#if CONFIG_EXT_INTERP
if (p.interp_filter == MULTITAP_SHARP2) {
return &sub_pel_filters_12sharp_ver_signal_dir[index][0];
}
if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_10sharp_ver_signal_dir[index][0];
return &sub_pel_filters_12sharp_ver_signal_dir[index][0];
}
#endif
#if USE_TEMPORALFILTER_12TAP
......@@ -993,11 +981,9 @@ typedef struct SimdFilter {
} SimdFilter;
#if CONFIG_EXT_INTERP
#define MULTITAP_FILTER_NUM 2
#define MULTITAP_FILTER_NUM 1
SimdFilter simd_filters[MULTITAP_FILTER_NUM] = {
{ MULTITAP_SHARP, &sub_pel_filters_10sharp_signal_dir[0],
&sub_pel_filters_10sharp_ver_signal_dir[0] },
{ MULTITAP_SHARP2, &sub_pel_filters_12sharp_signal_dir[0],
{ MULTITAP_SHARP, &sub_pel_filters_12sharp_signal_dir[0],
&sub_pel_filters_12sharp_ver_signal_dir[0] },
};
#endif
......
......@@ -25,11 +25,8 @@ typedef void (*TransposeSave)(const int width, int pixelsNum, uint32_t *src,
static INLINE HbdSubpelFilterCoeffs
hbd_get_subpel_filter_ver_signal_dir(const InterpFilterParams p, int index) {
#if CONFIG_EXT_INTERP
if (p.interp_filter == MULTITAP_SHARP2) {
return &sub_pel_filters_12sharp_highbd_ver_signal_dir[index][0];
}
if (p.interp_filter == MULTITAP_SHARP) {
return &sub_pel_filters_10sharp_highbd_ver_signal_dir[index][0];
return &sub_pel_filters_12sharp_highbd_ver_signal_dir[index][0];
}
#endif
#if USE_TEMPORALFILTER_12TAP
......
......@@ -56,10 +56,9 @@
#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 }, { 0, 4 }, { 1, 0 }, { 1, 1 },
{ 1, 2 }, { 1, 3 }, { 1, 4 }, { 2, 0 }, { 2, 1 }, { 2, 2 }, { 2, 3 },
{ 2, 4 }, { 3, 0 }, { 3, 1 }, { 3, 2 }, { 3, 3 }, { 3, 4 }, { 4, 0 },
{ 4, 1 }, { 4, 2 }, { 4, 3 }, { 4, 4 },
{ 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] = {
......
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