/src/mozilla-central/third_party/aom/av1/common/cdef.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
3 | | * |
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. |
10 | | */ |
11 | | #ifndef AOM_AV1_COMMON_CDEF_H_ |
12 | | #define AOM_AV1_COMMON_CDEF_H_ |
13 | | |
14 | 0 | #define CDEF_STRENGTH_BITS 6 |
15 | | |
16 | | #define CDEF_PRI_STRENGTHS 16 |
17 | 0 | #define CDEF_SEC_STRENGTHS 4 |
18 | | |
19 | | #include "config/aom_config.h" |
20 | | |
21 | | #include "aom/aom_integer.h" |
22 | | #include "aom_ports/mem.h" |
23 | | #include "av1/common/cdef_block.h" |
24 | | #include "av1/common/onyxc_int.h" |
25 | | |
26 | 0 | static INLINE int sign(int i) { return i < 0 ? -1 : 1; } Unexecuted instantiation: cdef.c:sign Unexecuted instantiation: cdef_block.c:sign Unexecuted instantiation: decodeframe.c:sign |
27 | | |
28 | 0 | static INLINE int constrain(int diff, int threshold, int damping) { |
29 | 0 | if (!threshold) return 0; |
30 | 0 | |
31 | 0 | const int shift = AOMMAX(0, damping - get_msb(threshold)); |
32 | 0 | return sign(diff) * |
33 | 0 | AOMMIN(abs(diff), AOMMAX(0, threshold - (abs(diff) >> shift))); |
34 | 0 | } Unexecuted instantiation: cdef.c:constrain Unexecuted instantiation: cdef_block.c:constrain Unexecuted instantiation: decodeframe.c:constrain |
35 | | |
36 | | #ifdef __cplusplus |
37 | | extern "C" { |
38 | | #endif |
39 | | |
40 | | int sb_all_skip(const AV1_COMMON *const cm, int mi_row, int mi_col); |
41 | | int sb_compute_cdef_list(const AV1_COMMON *const cm, int mi_row, int mi_col, |
42 | | cdef_list *dlist, BLOCK_SIZE bsize); |
43 | | void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, MACROBLOCKD *xd); |
44 | | |
45 | | void av1_cdef_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref, |
46 | | AV1_COMMON *cm, MACROBLOCKD *xd, int fast); |
47 | | |
48 | | #ifdef __cplusplus |
49 | | } // extern "C" |
50 | | #endif |
51 | | #endif // AOM_AV1_COMMON_CDEF_H_ |