]> granicus.if.org Git - libvpx/commitdiff
Cosmetic cleanups of filters
authorDeb Mukherjee <debargha@google.com>
Sun, 9 Jun 2013 13:54:17 +0000 (06:54 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Mon, 10 Jun 2013 19:06:36 +0000 (12:06 -0700)
No bitstream change.

Removes unused filters and the code for the case of 2 switchable filters;
also changes the 8tap-smooth filter coefficients for integer shifts to be
interpolating to be consistent with the way it is implemented currently.

Change-Id: I96c542fd8c06f4e0df507a645976f58e6de92aae

test/convolve_test.cc
vp9/common/vp9_entropymode.c
vp9/common/vp9_filter.c

index 151a38b7fd285c7a2cd4e7fd6a4e8fd049cc6292..f5e0cf736db1a48cd4c9daa55bcb65c5a483d405 100644 (file)
@@ -303,7 +303,6 @@ TEST_P(ConvolveTest, Copy2D) {
 
 const int16_t (*kTestFilterList[])[8] = {
   vp9_bilinear_filters,
-  vp9_sub_pel_filters_6,
   vp9_sub_pel_filters_8,
   vp9_sub_pel_filters_8s,
   vp9_sub_pel_filters_8lp
index 911b5556e44e06b62d66a90cef5bd1fb5d5f7e66..3208538281c503aff66458feba3e595ffd8b23a4 100644 (file)
@@ -244,7 +244,6 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
              sizeof(vp9_default_mbskip_probs));
 }
 
-#if VP9_SWITCHABLE_FILTERS == 3
 const vp9_tree_index vp9_switchable_interp_tree[VP9_SWITCHABLE_FILTERS*2-2] = {
   -0, 2,
   -1, -2
@@ -257,25 +256,9 @@ const vp9_prob vp9_switchable_interp_prob [VP9_SWITCHABLE_FILTERS+1]
                                           [VP9_SWITCHABLE_FILTERS-1] = {
   {248, 192}, { 32, 248}, { 32,  32}, {192, 160}
 };
-#elif VP9_SWITCHABLE_FILTERS == 2
-const vp9_tree_index vp9_switchable_interp_tree[VP9_SWITCHABLE_FILTERS*2-2] = {
-  -0, -1,
-};
-struct vp9_token vp9_switchable_interp_encodings[VP9_SWITCHABLE_FILTERS];
-const vp9_prob vp9_switchable_interp_prob [VP9_SWITCHABLE_FILTERS+1]
-                                          [VP9_SWITCHABLE_FILTERS-1] = {
-  {248},
-  { 64},
-  {192},
-};
-const INTERPOLATIONFILTERTYPE vp9_switchable_interp[VP9_SWITCHABLE_FILTERS] = {
-  EIGHTTAP, EIGHTTAP_SHARP};
-const int vp9_switchable_interp_map[SWITCHABLE+1] = {-1, 0, 1, -1, -1};
-#endif  // VP9_SWITCHABLE_FILTERS
 
 // Indicates if the filter is interpolating or non-interpolating
-// Note currently only the EIGHTTAP_SMOOTH is non-interpolating
-const int vp9_is_interpolating_filter[SWITCHABLE + 1] = {0, 1, 1, 1, -1};
+const int vp9_is_interpolating_filter[SWITCHABLE + 1] = {1, 1, 1, 1, -1};
 
 void vp9_entropy_mode_init() {
   vp9_tokens_from_tree(vp9_intra_mode_encodings, vp9_intra_mode_tree);
index 6c1ea21a1b594f7e4c276373e7e5e222bf259351..e5503cdd9ec347028265d64092a586ef1e127207 100644 (file)
@@ -34,12 +34,7 @@ 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  0
-#define FILTER_ALPHA_SMOOTH 50
-DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8])
-    = {
-#if FILTER_ALPHA == 0
+DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]) = {
   /* Lagrangian interpolation filter */
   { 0,   0,   0, 128,   0,   0,   0,  0},
   { 0,   1,  -5, 126,   8,  -3,   1,  0},
@@ -57,38 +52,10 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8])
   { -1,   3,  -9,  27, 118, -13,   4, -1},
   { 0,   2,  -6,  18, 122, -10,   3, -1},
   { 0,   1,  -3,   8, 126,  -5,   1,  0}
-
-#elif FILTER_ALPHA == 50
-  /* Generated using MATLAB:
-   * alpha = 0.5;
-   * b=intfilt(8,4,alpha);
-   * bi=round(128*b);
-   * ba=flipud(reshape([bi 0], 8, 8));
-   * disp(num2str(ba, '%d,'))
-   */
-  { 0,   0,   0, 128,   0,   0,   0,  0},
-  { 0,   1,  -5, 126,   8,  -3,   1,  0},
-  { 0,   2, -10, 122,  18,  -6,   2,  0},
-  { -1,   3, -13, 118,  27,  -9,   3,  0},
-  { -1,   4, -16, 112,  37, -11,   3,  0},
-  { -1,   5, -17, 104,  48, -14,   4, -1},
-  { -1,   5, -18,  96,  58, -16,   5, -1},
-  { -1,   5, -19,  88,  68, -17,   5, -1},
-  { -1,   5, -18,  78,  78, -18,   5, -1},
-  { -1,   5, -17,  68,  88, -19,   5, -1},
-  { -1,   5, -16,  58,  96, -18,   5, -1},
-  { -1,   4, -14,  48, 104, -17,   5, -1},
-  { 0,   3, -11,  37, 112, -16,   4, -1},
-  { 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 == 0
   /* dct based filter */
   {0,   0,   0, 128,   0,   0,   0, 0},
   {-1,   3,  -7, 127,   8,  -3,   1, 0},
@@ -106,88 +73,25 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8])
   {-2,   5, -10,  27, 121, -17,   7, -3},
   {-1,   3,  -6,  17, 125, -13,   5, -2},
   {0,   1,  -3,   8, 127,  -7,   3, -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 */
 };
 
 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},
-  { 0, -8, 20, 78, 45, -5, -3,  1},
-  { 0, -8, 16, 76, 50, -4, -3,  1},
-  { 0, -7, 13, 74, 54, -3, -4,  1},
-  { 1, -7,  9, 71, 58, -1, -4,  1},
-  { 1, -6,  6, 68, 62,  1, -5,  1},
-  { 1, -6,  4, 65, 65,  4, -6,  1},
-  { 1, -5,  1, 62, 68,  6, -6,  1},
-  { 1, -4, -1, 58, 71,  9, -7,  1},
-  { 1, -4, -3, 54, 74, 13, -7,  0},
-  { 1, -3, -4, 50, 76, 16, -8,  0},
-  { 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])
-    = {
-  {0, 0,   0, 128,   0,   0, 0,  0},
-  {0, 1,  -5, 125,   8,  -2, 1,  0},
-  {0, 1,  -8, 122,  17,  -5, 1,  0},
-  {0, 2, -11, 116,  27,  -8, 2,  0},
-  {0, 3, -14, 110,  37, -10, 2,  0},
-  {0, 3, -15, 103,  47, -12, 2,  0},
-  {0, 3, -16,  95,  57, -14, 3,  0},
-  {0, 3, -16,  86,  67, -15, 3,  0},
-  {0, 3, -16,  77,  77, -16, 3,  0},
-  {0, 3, -15,  67,  86, -16, 3,  0},
-  {0, 3, -14,  57,  95, -16, 3,  0},
-  {0, 2, -12,  47, 103, -15, 3,  0},
-  {0, 2, -10,  37, 110, -14, 3,  0},
-  {0, 2,  -8,  27, 116, -11, 2,  0},
-  {0, 1,  -5,  17, 122,  -8, 1,  0},
-  {0, 1,  -2,   8, 125,  -5, 1,  0}
+  { 0,  0,  0, 128,  0,  0,  0,  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}
 };