From d19ac4b66dda3ea5d7d9f4344d2ae4a9ee278f07 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Tue, 20 Aug 2013 12:29:57 -0700 Subject: [PATCH] vp9_filter.{h, c} cleanup + adding SUBPEL_TAPS constant. Change-Id: Ib394ea23f464591dad50b5c65c316701378d06d7 --- vp9/common/vp9_filter.c | 25 ++++++++++++------------- vp9/common/vp9_filter.h | 17 ++++++++--------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c index e5503cdd9..4ac2bc93f 100644 --- a/vp9/common/vp9_filter.c +++ b/vp9/common/vp9_filter.c @@ -8,14 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ - -#include -#include "vp9/common/vp9_filter.h" #include "vpx_ports/mem.h" -#include "vp9_rtcd.h" -#include "vp9/common/vp9_common.h" -DECLARE_ALIGNED(256, const int16_t, vp9_bilinear_filters[SUBPEL_SHIFTS][8]) = { +#include "vp9/common/vp9_filter.h" + +DECLARE_ALIGNED(256, const int16_t, + vp9_bilinear_filters[SUBPEL_SHIFTS][SUBPEL_TAPS]) = { { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 0, 0, 120, 8, 0, 0, 0 }, { 0, 0, 0, 112, 16, 0, 0, 0 }, @@ -34,8 +32,9 @@ DECLARE_ALIGNED(256, const int16_t, vp9_bilinear_filters[SUBPEL_SHIFTS][8]) = { { 0, 0, 0, 8, 120, 0, 0, 0 } }; -DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]) = { - /* Lagrangian interpolation filter */ +// Lagrangian interpolation filter +DECLARE_ALIGNED(256, const int16_t, + vp9_sub_pel_filters_8[SUBPEL_SHIFTS][SUBPEL_TAPS]) = { { 0, 0, 0, 128, 0, 0, 0, 0}, { 0, 1, -5, 126, 8, -3, 1, 0}, { -1, 3, -10, 122, 18, -6, 2, 0}, @@ -54,9 +53,9 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]) = { { 0, 1, -3, 8, 126, -5, 1, 0} }; -DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]) - = { - /* dct based filter */ +// DCT based filter +DECLARE_ALIGNED(256, const int16_t, + vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][SUBPEL_TAPS]) = { {0, 0, 0, 128, 0, 0, 0, 0}, {-1, 3, -7, 127, 8, -3, 1, 0}, {-2, 5, -13, 125, 17, -6, 3, -1}, @@ -75,9 +74,9 @@ DECLARE_ALIGNED(256, const int16_t, vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]) {0, 1, -3, 8, 127, -7, 3, -1} }; +// freqmultiplier = 0.5 DECLARE_ALIGNED(256, const int16_t, - vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][8]) = { - /* freqmultiplier = 0.5 */ + vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][SUBPEL_TAPS]) = { { 0, 0, 0, 128, 0, 0, 0, 0}, {-3, -1, 32, 64, 38, 1, -3, 0}, {-2, -2, 29, 63, 41, 2, -3, 0}, diff --git a/vp9/common/vp9_filter.h b/vp9/common/vp9_filter.h index cf5e6f117..33a97ccb3 100644 --- a/vp9/common/vp9_filter.h +++ b/vp9/common/vp9_filter.h @@ -17,18 +17,17 @@ #define SUBPEL_BITS 4 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) #define SUBPEL_SHIFTS (1 << SUBPEL_BITS) +#define SUBPEL_TAPS 8 -extern const int16_t vp9_bilinear_filters[SUBPEL_SHIFTS][8]; -extern const int16_t vp9_sub_pel_filters_6[SUBPEL_SHIFTS][8]; -extern const int16_t vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]; -extern const int16_t vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]; -extern const int16_t vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][8]; +extern const int16_t vp9_bilinear_filters[SUBPEL_SHIFTS][SUBPEL_TAPS]; +extern const int16_t vp9_sub_pel_filters_6[SUBPEL_SHIFTS][SUBPEL_TAPS]; +extern const int16_t vp9_sub_pel_filters_8[SUBPEL_SHIFTS][SUBPEL_TAPS]; +extern const int16_t vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][SUBPEL_TAPS]; +extern const int16_t vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][SUBPEL_TAPS]; // The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear // filter kernel as a 2 tap filter. -#define BF_LENGTH (sizeof(vp9_bilinear_filters[0]) / \ - sizeof(vp9_bilinear_filters[0][0])) -#define BF_OFFSET (BF_LENGTH / 2 - 1) -#define VP9_BILINEAR_FILTERS_2TAP(x) (vp9_bilinear_filters[x] + BF_OFFSET) +#define VP9_BILINEAR_FILTERS_2TAP(x) \ + (vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1) #endif // VP9_COMMON_VP9_FILTER_H_