11#ifndef AOM_AV1_COMMON_CDEF_H_
12#define AOM_AV1_COMMON_CDEF_H_
14#define CDEF_STRENGTH_BITS 6
16#define CDEF_PRI_STRENGTHS 16
17#define CDEF_SEC_STRENGTHS 4
19#include "config/aom_config.h"
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"
26enum { TOP, LEFT, BOTTOM, RIGHT, BOUNDARIES } UENUM1BYTE(BOUNDARY);
28struct AV1CdefSyncData;
33 uint16_t *top_linebuf[MAX_MB_PLANE];
34 uint16_t *bot_linebuf[MAX_MB_PLANE];
37 dlist[MI_SIZE_64X64 * MI_SIZE_64X64];
43 int frame_boundary[BOUNDARIES];
52 int var[CDEF_NBLOCKS][CDEF_NBLOCKS];
59static inline int sign(
int i) {
return i < 0 ? -1 : 1; }
61static inline int constrain(
int diff,
int threshold,
int damping) {
62 if (!threshold)
return 0;
64 const int shift = AOMMAX(0, damping - get_msb(threshold));
66 AOMMIN(abs(diff), AOMMAX(0, threshold - (abs(diff) >> shift)));
74 int mi_row,
int mi_col, cdef_list *dlist,
77typedef void (*cdef_init_fb_row_t)(
79 CdefBlockInfo *
const fb_info, uint16_t **
const linebuf, uint16_t *
const src,
80 struct AV1CdefSyncData *
const cdef_sync,
int fbr);
96 MACROBLOCKD *xd, cdef_init_fb_row_t cdef_init_fb_row_fn);
98 uint16_t **
const linebuf, uint16_t **
const colbuf,
99 uint16_t *
const src,
int fbr,
100 cdef_init_fb_row_t cdef_init_fb_row_fn,
101 struct AV1CdefSyncData *
const cdef_sync,
102 struct aom_internal_error_info *error_info);
103void av1_cdef_init_fb_row(
const AV1_COMMON *
const cm,
106 uint16_t **
const linebuf, uint16_t *
const src,
107 struct AV1CdefSyncData *
const cdef_sync,
int fbr);
void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *const cm, MACROBLOCKD *xd, cdef_init_fb_row_t cdef_init_fb_row_fn)
Function for applying CDEF to a frame.
Top level common structure used by both encoder and decoder.
Definition av1_common_int.h:757
Parameters related to CDEF Block.
Definition cdef.h:31
int cdef_count
Definition cdef.h:49
int sec_strength
Definition cdef.h:48
int roffset
Definition cdef.h:56
int ydec
Definition cdef.h:40
int damping
Definition cdef.h:45
int coeff_shift
Definition cdef.h:46
uint16_t * src
Definition cdef.h:32
int xdec
Definition cdef.h:39
int dst_stride
Definition cdef.h:54
int mi_wide_l2
Definition cdef.h:41
int mi_high_l2
Definition cdef.h:42
int coffset
Definition cdef.h:55
int level
Definition cdef.h:47
uint8_t * dst
Definition cdef.h:35
Params related to MB_MODE_INFO arrays and related info.
Definition av1_common_int.h:508
Variables related to current coding block.
Definition blockd.h:570
YV12 frame buffer data structure.
Definition yv12config.h:46