Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 12 | #ifndef AOM_DSP_AOM_FILTER_H_ |
| 13 | #define AOM_DSP_AOM_FILTER_H_ |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 14 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 15 | #include "aom/aom_integer.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | #define FILTER_BITS 7 |
| 22 | |
| 23 | #define SUBPEL_BITS 4 |
| 24 | #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) |
| 25 | #define SUBPEL_SHIFTS (1 << SUBPEL_BITS) |
| 26 | #define SUBPEL_TAPS 8 |
| 27 | |
Fergus Simpson | 505f006 | 2017-06-27 11:23:34 -0700 | [diff] [blame] | 28 | #define SCALE_SUBPEL_BITS 10 |
| 29 | #define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS) |
| 30 | #define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1) |
| 31 | #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS) |
| 32 | #define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2) |
| 33 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 34 | typedef int16_t InterpKernel[SUBPEL_TAPS]; |
| 35 | |
| 36 | #define BIL_SUBPEL_BITS 3 |
| 37 | #define BIL_SUBPEL_SHIFTS (1 << BIL_SUBPEL_BITS) |
| 38 | |
| 39 | // 2 tap bilinear filters |
| 40 | static const uint8_t bilinear_filters_2t[BIL_SUBPEL_SHIFTS][2] = { |
| 41 | { 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 }, |
| 42 | { 64, 64 }, { 48, 80 }, { 32, 96 }, { 16, 112 }, |
| 43 | }; |
| 44 | |
| 45 | #ifdef __cplusplus |
| 46 | } // extern "C" |
| 47 | #endif |
| 48 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 49 | #endif // AOM_DSP_AOM_FILTER_H_ |