From 57c97e2a5ba53d945513aa54fdbffa82ce8d08d8 Mon Sep 17 00:00:00 2001 From: Deb Mukherjee Date: Mon, 25 Mar 2013 22:10:06 -0700 Subject: [PATCH] Reoptimizing the interpolation filters Reoptimizes the 8-tap smooth filter. Results: derf: +0.101% yt: +0.157% hd: +0.791% stdhd: +0.264% The next step will be to reoptimize the other two filters. Change-Id: I3d256a510ad9c7c30c33fae4a70fb43dfc708ed0 --- vp9/common/vp9_filter.c | 66 ++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c index 434c63e7e..6c1ea21a1 100644 --- a/vp9/common/vp9_filter.c +++ b/vp9/common/vp9_filter.c @@ -34,8 +34,9 @@ DECLARE_ALIGNED(256, const int16_t, vp9_bilinear_filters[SUBPEL_SHIFTS][8]) = { { 0, 0, 0, 8, 120, 0, 0, 0 } }; -#define FILTER_ALPHA 0 -#define FILTER_ALPHA_SHARP 1 +#define FILTER_ALPHA 0 +#define FILTER_ALPHA_SHARP 0 +#define FILTER_ALPHA_SMOOTH 50 DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]) = { #if FILTER_ALPHA == 0 @@ -81,12 +82,13 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]) { 0, 3, -9, 27, 118, -13, 3, -1}, { 0, 2, -6, 18, 122, -10, 2, 0}, { 0, 1, -3, 8, 126, -5, 1, 0} + #endif /* FILTER_ALPHA */ }; DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]) = { -#if FILTER_ALPHA_SHARP == 1 +#if FILTER_ALPHA_SHARP == 0 /* dct based filter */ {0, 0, 0, 128, 0, 0, 0, 0}, {-1, 3, -7, 127, 8, -3, 1, 0}, @@ -105,24 +107,24 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]) {-1, 3, -6, 17, 125, -13, 5, -2}, {0, 1, -3, 8, 127, -7, 3, -1} -#elif FILTER_ALPHA_SHARP == 75 - /* alpha = 0.75 */ - {0, 0, 0, 128, 0, 0, 0, 0}, - {-1, 2, -6, 126, 9, -3, 2, -1}, - {-1, 4, -11, 123, 18, -7, 3, -1}, - {-2, 6, -16, 119, 28, -10, 5, -2}, - {-2, 7, -19, 113, 38, -13, 6, -2}, - {-3, 8, -21, 106, 49, -16, 7, -2}, - {-3, 9, -22, 99, 59, -19, 8, -3}, - {-3, 9, -23, 90, 70, -21, 9, -3}, - {-3, 9, -22, 80, 80, -22, 9, -3}, - {-3, 9, -21, 70, 90, -23, 9, -3}, - {-3, 8, -19, 59, 99, -22, 9, -3}, - {-2, 7, -16, 49, 106, -21, 8, -3}, - {-2, 6, -13, 38, 113, -19, 7, -2}, - {-2, 5, -10, 28, 119, -16, 6, -2}, - {-1, 3, -7, 18, 123, -11, 4, -1}, - {-1, 2, -3, 9, 126, -6, 2, -1} +#elif FILTER_ALPHA_SHARP == 80 + /* alpha = 0.80 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + {-1, 2, -6, 127, 9, -4, 2, -1}, + {-2, 5, -12, 124, 18, -7, 4, -2}, + {-2, 7, -16, 119, 28, -11, 5, -2}, + {-3, 8, -19, 114, 38, -14, 7, -3}, + {-3, 9, -22, 107, 49, -17, 8, -3}, + {-4, 10, -23, 99, 60, -20, 10, -4}, + {-4, 11, -23, 90, 70, -22, 10, -4}, + {-4, 11, -23, 80, 80, -23, 11, -4}, + {-4, 10, -22, 70, 90, -23, 11, -4}, + {-4, 10, -20, 60, 99, -23, 10, -4}, + {-3, 8, -17, 49, 107, -22, 9, -3}, + {-3, 7, -14, 38, 114, -19, 8, -3}, + {-2, 5, -11, 28, 119, -16, 7, -2}, + {-2, 4, -7, 18, 124, -12, 5, -2}, + {-1, 2, -4, 9, 127, -6, 2, -1} #endif /* FILTER_ALPHA_SHARP */ }; @@ -130,6 +132,8 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][8]) = { /* 8-tap lowpass filter */ /* Hamming window */ + /* freqmultiplier = 0.625 */ +#if FILTER_ALPHA_SMOOTH == 625 {-1, -7, 32, 80, 32, -7, -1, 0}, {-1, -8, 28, 80, 37, -7, -2, 1}, { 0, -8, 24, 79, 41, -7, -2, 1}, @@ -146,6 +150,26 @@ DECLARE_ALIGNED(256, const int16_t, { 1, -3, -5, 45, 78, 20, -8, 0}, { 1, -2, -7, 41, 79, 24, -8, 0}, { 1, -2, -7, 37, 80, 28, -8, -1} + +#elif FILTER_ALPHA_SMOOTH == 50 + /* freqmultiplier = 0.5 */ + {-3, 0, 35, 64, 35, 0, -3, 0}, + {-3, -1, 32, 64, 38, 1, -3, 0}, + {-2, -2, 29, 63, 41, 2, -3, 0}, + {-2, -2, 26, 63, 43, 4, -4, 0}, + {-2, -3, 24, 62, 46, 5, -4, 0}, + {-2, -3, 21, 60, 49, 7, -4, 0}, + {-1, -4, 18, 59, 51, 9, -4, 0}, + {-1, -4, 16, 57, 53, 12, -4, -1}, + {-1, -4, 14, 55, 55, 14, -4, -1}, + {-1, -4, 12, 53, 57, 16, -4, -1}, + {0, -4, 9, 51, 59, 18, -4, -1}, + {0, -4, 7, 49, 60, 21, -3, -2}, + {0, -4, 5, 46, 62, 24, -3, -2}, + {0, -4, 4, 43, 63, 26, -2, -2}, + {0, -3, 2, 41, 63, 29, -2, -2}, + {0, -3, 1, 38, 64, 32, -1, -3} +#endif }; DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_6[SUBPEL_SHIFTS][8]) -- 2.40.0