blob: 00686ac388499d57da480654332cc8ea9f86d4ba [file] [log] [blame]
Yaowu Xuc27fc142016-08-22 16:08:15 -07001/*
Yaowu Xu9c01aa12016-09-01 14:32:49 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Yaowu Xuc27fc142016-08-22 16:08:15 -07003 *
Yaowu Xu9c01aa12016-09-01 14:32:49 -07004 * 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 Xuc27fc142016-08-22 16:08:15 -070010 */
11
James Zerne1cbb132018-08-22 14:10:36 -070012#ifndef AOM_AOM_DSP_AOM_FILTER_H_
13#define AOM_AOM_DSP_AOM_FILTER_H_
Yaowu Xuc27fc142016-08-22 16:08:15 -070014
Yaowu Xuf883b422016-08-30 14:01:10 -070015#include "aom/aom_integer.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070016
17#ifdef __cplusplus
18extern "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 Simpson505f0062017-06-27 11:23:34 -070028#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
Debargha Mukherjeed365d3c2017-11-01 08:08:36 -070034#define RS_SUBPEL_BITS 6
35#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
36#define RS_SCALE_SUBPEL_BITS 14
37#define RS_SCALE_SUBPEL_MASK ((1 << RS_SCALE_SUBPEL_BITS) - 1)
38#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
39#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
40
Yaowu Xuc27fc142016-08-22 16:08:15 -070041typedef int16_t InterpKernel[SUBPEL_TAPS];
42
43#define BIL_SUBPEL_BITS 3
44#define BIL_SUBPEL_SHIFTS (1 << BIL_SUBPEL_BITS)
45
46// 2 tap bilinear filters
47static const uint8_t bilinear_filters_2t[BIL_SUBPEL_SHIFTS][2] = {
48 { 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 },
49 { 64, 64 }, { 48, 80 }, { 32, 96 }, { 16, 112 },
50};
51
52#ifdef __cplusplus
53} // extern "C"
54#endif
55
James Zerne1cbb132018-08-22 14:10:36 -070056#endif // AOM_AOM_DSP_AOM_FILTER_H_