1 /* 2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved. 3 * 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. 9 */ 10 11 #ifndef VP9_COMMON_VP9_FILTER_H_ 12 #define VP9_COMMON_VP9_FILTER_H_ 13 14 #include "./vpx_config.h" 15 #include "vpx/vpx_integer.h" 16 17 #define FILTER_BITS 7 18 19 #define SUBPEL_BITS 4 20 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) 21 #define SUBPEL_SHIFTS (1 << SUBPEL_BITS) 22 #define SUBPEL_TAPS 8 23 24 typedef enum { 25 EIGHTTAP = 0, 26 EIGHTTAP_SMOOTH = 1, 27 EIGHTTAP_SHARP = 2, 28 BILINEAR = 3, 29 SWITCHABLE = 4 /* should be the last one */ 30 } INTERPOLATION_TYPE; 31 32 typedef int16_t subpel_kernel[SUBPEL_TAPS]; 33 34 struct subpix_fn_table { 35 const subpel_kernel *filter_x; 36 const subpel_kernel *filter_y; 37 }; 38 39 const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type); 40 41 extern const subpel_kernel vp9_bilinear_filters[SUBPEL_SHIFTS]; 42 extern const subpel_kernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS]; 43 extern const subpel_kernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]; 44 extern const subpel_kernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]; 45 46 // The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear 47 // filter kernel as a 2 tap filter. 48 #define BILINEAR_FILTERS_2TAP(x) \ 49 (vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1) 50 51 #endif // VP9_COMMON_VP9_FILTER_H_ 52