2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef VP9_COMMON_VP9_FILTER_H_
12 #define VP9_COMMON_VP9_FILTER_H_
14 #include "./vpx_config.h"
15 #include "vpx/vpx_integer.h"
16 #include "vpx_ports/mem.h"
26 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
27 #define SUBPEL_SHIFTS (1 << SUBPEL_BITS)
35 SWITCHABLE = 4 /* should be the last one */
38 // Number of switchable filters
39 #define SWITCHABLE_FILTERS 3
41 // The codec can operate in four possible inter prediction filter mode:
42 // 8-tap, 8-tap-smooth, 8-tap-sharp, and switching between the three.
43 #define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1)
45 typedef int16_t InterpKernel[SUBPEL_TAPS];
47 const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter);
49 DECLARE_ALIGNED(256, extern const InterpKernel,
50 vp9_bilinear_filters[SUBPEL_SHIFTS]);
52 // The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear
53 // filter kernel as a 2 tap filter.
54 #define BILINEAR_FILTERS_2TAP(x) \
55 (vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1)
61 #endif // VP9_COMMON_VP9_FILTER_H_