12#ifndef AOM_AV1_COMMON_AV1_LOOPFILTER_H_
13#define AOM_AV1_COMMON_AV1_LOOPFILTER_H_
15#include "config/aom_config.h"
17#include "aom/internal/aom_codec_internal.h"
19#include "aom_ports/mem.h"
20#include "av1/common/blockd.h"
21#include "av1/common/seg_common.h"
27#define MAX_LOOP_FILTER 63
28#define MAX_SHARPNESS 7
39enum { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } UENUM1BYTE(EDGE_DIR);
49 int backup_filter_level[2];
50 int backup_filter_level_u;
51 int backup_filter_level_v;
55 uint8_t mode_ref_delta_enabled;
56 uint8_t mode_ref_delta_update;
60 int8_t ref_deltas[REF_FRAMES];
63 int8_t mode_deltas[MAX_MODE_LF_DELTAS];
69 DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, mblim[SIMD_WIDTH]);
70 DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, lim[SIMD_WIDTH]);
71 DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, hev_thr[SIMD_WIDTH]);
75 loop_filter_thresh lfthr[MAX_LOOP_FILTER + 1];
76 uint8_t lvl[MAX_MB_PLANE][MAX_SEGMENTS][2][REF_FRAMES][MAX_MODE_LF_DELTAS];
79typedef struct AV1_DEBLOCKING_PARAMETERS {
81 uint8_t filter_length;
83 const loop_filter_thresh *lfthr;
84} AV1_DEBLOCKING_PARAMETERS;
86typedef struct LoopFilterWorkerData {
87 YV12_BUFFER_CONFIG *frame_buffer;
89 struct macroblockd_plane planes[MAX_MB_PLANE];
94 AV1_DEBLOCKING_PARAMETERS params_buf[MAX_MIB_SIZE];
95 TX_SIZE tx_buf[MAX_MIB_SIZE];
96 struct aom_internal_error_info error_info;
105void av1_loop_filter_init(
struct AV1Common *cm);
107void av1_loop_filter_frame_init(
struct AV1Common *cm,
int plane_start,
110void av1_filter_block_plane_vert(
const struct AV1Common *
const cm,
111 const MACROBLOCKD *
const xd,
const int plane,
112 const MACROBLOCKD_PLANE *
const plane_ptr,
113 const uint32_t mi_row,
const uint32_t mi_col);
115void av1_filter_block_plane_horz(
const struct AV1Common *
const cm,
116 const MACROBLOCKD *
const xd,
const int plane,
117 const MACROBLOCKD_PLANE *
const plane_ptr,
118 const uint32_t mi_row,
const uint32_t mi_col);
120void av1_filter_block_plane_vert_opt(
121 const struct AV1Common *
const cm,
const MACROBLOCKD *
const xd,
122 const MACROBLOCKD_PLANE *
const plane_ptr,
const uint32_t mi_row,
123 const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
124 TX_SIZE *tx_buf,
int num_mis_in_lpf_unit_height_log2);
126void av1_filter_block_plane_vert_opt_chroma(
127 const struct AV1Common *
const cm,
const MACROBLOCKD *
const xd,
128 const MACROBLOCKD_PLANE *
const plane_ptr,
const uint32_t mi_row,
129 const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
130 TX_SIZE *tx_buf,
int plane,
bool joint_filter_chroma,
131 int num_mis_in_lpf_unit_height_log2);
133void av1_filter_block_plane_horz_opt(
134 const struct AV1Common *
const cm,
const MACROBLOCKD *
const xd,
135 const MACROBLOCKD_PLANE *
const plane_ptr,
const uint32_t mi_row,
136 const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
137 TX_SIZE *tx_buf,
int num_mis_in_lpf_unit_height_log2);
139void av1_filter_block_plane_horz_opt_chroma(
140 const struct AV1Common *
const cm,
const MACROBLOCKD *
const xd,
141 const MACROBLOCKD_PLANE *
const plane_ptr,
const uint32_t mi_row,
142 const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
143 TX_SIZE *tx_buf,
int plane,
bool joint_filter_chroma,
144 int num_mis_in_lpf_unit_height_log2);
Top level common structure used by both encoder and decoder.
Definition av1_common_int.h:764
Variables related to current coding block.
Definition blockd.h:570