AOMedia AV1 Codec: av1/common/cdef.h Source File

| AOMedia AV1 Codec

cdef.h
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 #define CDEF_STRENGTH_BITS 6
15
16 #define CDEF_PRI_STRENGTHS 16
17 #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/av1_common_int.h"
24 #include "av1/common/cdef_block.h"
25
26 static INLINE int sign(int i) { return i < 0 ? -1 : 1; }
27
28 static INLINE int constrain(int diff, int threshold, int damping) {
29 if (!threshold) return 0;
30
31 const int shift = AOMMAX(0, damping - get_msb(threshold));
32 return sign(diff) *
33 AOMMIN(abs(diff), AOMMAX(0, threshold - (abs(diff) >> shift)));
34 }
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 int av1_cdef_compute_sb_list(const CommonModeInfoParams *const mi_params,
41 int mi_row, int mi_col, cdef_list *dlist,
42 BLOCK_SIZE bsize);
43
56 void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, MACROBLOCKD *xd);
57
58 #ifdef __cplusplus
59 } // extern "C"
60 #endif
61 #endif // AOM_AV1_COMMON_CDEF_H_
av1_cdef_frame
void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, MACROBLOCKD *xd)
Function for applying CDEF to a frame.
AV1Common
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:725
CommonModeInfoParams
Params related to MB_MODE_INFO arrays and related info.
Definition: av1_common_int.h:479
macroblockd
Variables related to current coding block.
Definition: blockd.h:568
yv12_buffer_config
YV12 frame buffer data structure.
Definition: yv12config.h:38