Line data Source code
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 AV1_COMMON_DERING_H_
12 : #define AV1_COMMON_DERING_H_
13 :
14 : #define CDEF_STRENGTH_BITS 7
15 :
16 : #define DERING_STRENGTHS 32
17 : #define CLPF_STRENGTHS 4
18 :
19 : #include "./aom_config.h"
20 : #include "aom/aom_integer.h"
21 : #include "aom_ports/mem.h"
22 : #include "av1/common/od_dering.h"
23 : #include "av1/common/onyxc_int.h"
24 : #include "./od_dering.h"
25 :
26 0 : static INLINE int sign(int i) { return i < 0 ? -1 : 1; }
27 :
28 0 : static INLINE int constrain(int diff, int threshold, unsigned int damping) {
29 : return threshold
30 0 : ? sign(diff) *
31 0 : AOMMIN(
32 : abs(diff),
33 : AOMMAX(0, threshold - (abs(diff) >>
34 : (damping - get_msb(threshold)))))
35 0 : : 0;
36 : }
37 :
38 : #ifdef __cplusplus
39 : extern "C" {
40 : #endif
41 :
42 : int sb_all_skip(const AV1_COMMON *const cm, int mi_row, int mi_col);
43 : int sb_compute_dering_list(const AV1_COMMON *const cm, int mi_row, int mi_col,
44 : dering_list *dlist, int filter_skip);
45 : void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, MACROBLOCKD *xd);
46 :
47 : void av1_cdef_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
48 : AV1_COMMON *cm, MACROBLOCKD *xd);
49 :
50 : #ifdef __cplusplus
51 : } // extern "C"
52 : #endif
53 : #endif // AV1_COMMON_DERING_H_
|