summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c')
-rw-r--r--chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c b/chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c
index 8f24052c7aa..7474a88bcce 100644
--- a/chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c
+++ b/chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_filter.c
@@ -10,12 +10,9 @@
#include <assert.h>
-#include "vpx_ports/mem.h"
-
#include "vp9/common/vp9_filter.h"
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_bilinear_filters[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_bilinear_filters[SUBPEL_SHIFTS] = {
{ 0, 0, 0, 128, 0, 0, 0, 0 },
{ 0, 0, 0, 120, 8, 0, 0, 0 },
{ 0, 0, 0, 112, 16, 0, 0, 0 },
@@ -35,8 +32,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
// Lagrangian interpolation filter
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS] = {
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 1, -5, 126, 8, -3, 1, 0},
{ -1, 3, -10, 122, 18, -6, 2, 0},
@@ -56,8 +52,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
// DCT based filter
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS] = {
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -7, 127, 8, -3, 1, 0},
{-2, 5, -13, 125, 17, -6, 3, -1},
@@ -77,8 +72,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
// freqmultiplier = 0.5
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS] = {
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-3, -1, 32, 64, 38, 1, -3, 0},
{-2, -2, 29, 63, 41, 2, -3, 0},
@@ -97,19 +91,16 @@ DECLARE_ALIGNED(256, const subpel_kernel,
{ 0, -3, 1, 38, 64, 32, -1, -3}
};
-const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type) {
- switch (type) {
- case EIGHTTAP:
- return vp9_sub_pel_filters_8;
- case EIGHTTAP_SMOOTH:
- return vp9_sub_pel_filters_8lp;
- case EIGHTTAP_SHARP:
- return vp9_sub_pel_filters_8s;
- case BILINEAR:
- return vp9_bilinear_filters;
- default:
- assert(!"Invalid interpolation type.");
- return NULL;
- }
+
+static const InterpKernel* vp9_filter_kernels[4] = {
+ vp9_sub_pel_filters_8,
+ vp9_sub_pel_filters_8lp,
+ vp9_sub_pel_filters_8s,
+ vp9_bilinear_filters
+};
+
+const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter) {
+ assert(filter != SWITCHABLE);
+ return vp9_filter_kernels[filter];
}