Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vp9 / common / vp9_filter.h
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 #include "vpx_ports/mem.h"
17
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #define FILTER_BITS 7
24
25 #define SUBPEL_BITS 4
26 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
27 #define SUBPEL_SHIFTS (1 << SUBPEL_BITS)
28 #define SUBPEL_TAPS 8
29
30 typedef enum {
31   EIGHTTAP = 0,
32   EIGHTTAP_SMOOTH = 1,
33   EIGHTTAP_SHARP = 2,
34   BILINEAR = 3,
35   SWITCHABLE = 4  /* should be the last one */
36 } INTERP_FILTER;
37
38 // Number of switchable filters
39 #define SWITCHABLE_FILTERS 3
40
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)
44
45 typedef int16_t InterpKernel[SUBPEL_TAPS];
46
47 const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter);
48
49 DECLARE_ALIGNED(256, extern const InterpKernel,
50                 vp9_bilinear_filters[SUBPEL_SHIFTS]);
51
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)
56
57 #ifdef __cplusplus
58 }  // extern "C"
59 #endif
60
61 #endif  // VP9_COMMON_VP9_FILTER_H_