Merge 12sharp filter into ext-interp Change-Id: I7df48e7f3b57f212798ef4be86f28aed928fc3e0
diff --git a/vp10/common/entropymode.c b/vp10/common/entropymode.c index 735e10e..abdb7db 100644 --- a/vp10/common/entropymode.c +++ b/vp10/common/entropymode.c
@@ -809,7 +809,17 @@ { 36, 243, 48}, { 149, 160, 128}, }; -#else +#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5 +static const vpx_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] + [SWITCHABLE_FILTERS - 1] = { + { 235, 192, 128, 128}, + { 36, 243, 208, 128}, + { 34, 16, 128, 128}, + { 36, 243, 48, 128}, + { 34, 16, 128, 128}, + { 149, 160, 128, 128}, +}; +#else // CONFIG_EXT_INTERP static const vpx_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] [SWITCHABLE_FILTERS - 1] = { { 235, 162, }, @@ -817,7 +827,7 @@ { 34, 3, }, { 149, 144, }, }; -#endif +#endif // CONFIG_EXT_INTERP #if CONFIG_EXT_TX const vpx_tree_index vp10_ext_tx_inter_tree[EXT_TX_SETS_INTER] @@ -1335,6 +1345,14 @@ 4, -EIGHTTAP_SHARP, -EIGHTTAP_SMOOTH, -EIGHTTAP_SMOOTH2, }; +#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5 +const vpx_tree_index vp10_switchable_interp_tree +[TREE_SIZE(SWITCHABLE_FILTERS)] = { + -EIGHTTAP, 2, + 4, 6, + -EIGHTTAP_SMOOTH, -EIGHTTAP_SMOOTH2, + -EIGHTTAP_SHARP, -EIGHTTAP_SHARP2, +}; #else const vpx_tree_index vp10_switchable_interp_tree [TREE_SIZE(SWITCHABLE_FILTERS)] = {
diff --git a/vp10/common/filter.c b/vp10/common/filter.c index a5987f1..c001f7f 100644 --- a/vp10/common/filter.c +++ b/vp10/common/filter.c
@@ -12,8 +12,6 @@ #include "vp10/common/filter.h" -#define USE_12_SHARP_FILTER 0 - DECLARE_ALIGNED(256, static const InterpKernel, bilinear_filters[SUBPEL_SHIFTS]) = { { 0, 0, 0, 128, 0, 0, 0, 0 }, @@ -75,29 +73,6 @@ #endif // CONFIG_EXT_INTERP }; -#if USE_12_SHARP_FILTER -DECLARE_ALIGNED(16, static const int16_t, - sub_pel_filters_12sharp[16][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}, -}; -#endif // USE_12_SHARP_FILTER - DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_8sharp[SUBPEL_SHIFTS]) = { #if CONFIG_EXT_INTERP @@ -139,7 +114,7 @@ #endif // CONFIG_EXT_INTERP }; -#if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4 +#if CONFIG_EXT_INTERP && (SWITCHABLE_FILTERS == 4 || SWITCHABLE_FILTERS == 5) DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_8smooth2[SUBPEL_SHIFTS]) = { @@ -183,6 +158,27 @@ {0, 2, -11, 31, 95, 19, -10, 2}, }; +DECLARE_ALIGNED(16, static const int16_t, + sub_pel_filters_12sharp[16][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}, +}; + #else DECLARE_ALIGNED(256, static const InterpKernel, @@ -214,6 +210,9 @@ sub_pel_filters_8sharp, #if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4 sub_pel_filters_8smooth2, +#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5 + sub_pel_filters_8smooth2, + (const InterpKernel*)sub_pel_filters_12sharp, #endif bilinear_filters }; @@ -231,13 +230,12 @@ vp10_interp_filter_params_list[SWITCHABLE_FILTERS + 1] = { {(const int16_t*)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS}, {(const int16_t*)sub_pel_filters_8smooth, SUBPEL_TAPS, SUBPEL_SHIFTS}, -#if USE_12_SHARP_FILTER - {(const int16_t*)sub_pel_filters_12sharp, 12, SUBPEL_SHIFTS}, -#else // USE_12_SHARP_FILTER {(const int16_t*)sub_pel_filters_8sharp, SUBPEL_TAPS, SUBPEL_SHIFTS}, -#endif // USE_12_SHARP_FILTER #if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4 {(const int16_t*)sub_pel_filters_8smooth2, SUBPEL_TAPS, SUBPEL_SHIFTS}, +#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5 + {(const int16_t*)sub_pel_filters_8smooth2, SUBPEL_TAPS, SUBPEL_SHIFTS}, + {(const int16_t*)sub_pel_filters_12sharp, 12, SUBPEL_SHIFTS}, #endif {(const int16_t*)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS} };
diff --git a/vp10/common/filter.h b/vp10/common/filter.h index afebee0..fea8330 100644 --- a/vp10/common/filter.h +++ b/vp10/common/filter.h
@@ -27,8 +27,19 @@ #if CONFIG_EXT_INTERP #define SUPPORT_NONINTERPOLATING_FILTERS 0 /* turn it on for experimentation */ +#define SWITCHABLE_FILTERS 5 /* Number of switchable filters */ + +#if SWITCHABLE_FILTERS == 4 + #define EIGHTTAP_SMOOTH2 3 -#define SWITCHABLE_FILTERS 4 /* Number of switchable filters */ + +#elif SWITCHABLE_FILTERS == 5 + +#define EIGHTTAP_SMOOTH2 3 +#define EIGHTTAP_SHARP2 4 + +#endif // SWITCHABLE_FILTERS + #else #define SWITCHABLE_FILTERS 3 /* Number of switchable filters */ #endif // CONFIG_EXT_INTERP
diff --git a/vp10/encoder/bitstream.c b/vp10/encoder/bitstream.c index 930f73f..caa98be 100644 --- a/vp10/encoder/bitstream.c +++ b/vp10/encoder/bitstream.c
@@ -42,6 +42,9 @@ #if CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 4 static const struct vp10_token switchable_interp_encodings[SWITCHABLE_FILTERS] = {{0, 1}, {4, 3}, {3, 2}, {5, 3}}; +#elif CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5 +static const struct vp10_token switchable_interp_encodings[SWITCHABLE_FILTERS] = + {{0, 1}, {4, 3}, {6, 3}, {5, 3}, {7, 3}}; #else static const struct vp10_token switchable_interp_encodings[SWITCHABLE_FILTERS] = {{0, 1}, {2, 2}, {3, 2}};