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_ports/mem.h" 18 #include "av1/common/blockd.h" 19 #include "av1/common/seg_common.h" 25 #define MAX_LOOP_FILTER 63 26 #define MAX_SHARPNESS 7 37 enum { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } UENUM1BYTE(EDGE_DIR);
54 FilterMask left_y[TX_SIZES];
55 FilterMask above_y[TX_SIZES];
56 FilterMask left_u[TX_SIZES];
57 FilterMask above_u[TX_SIZES];
58 FilterMask left_v[TX_SIZES];
59 FilterMask above_v[TX_SIZES];
62 uint8_t lfl_y_hor[MI_SIZE_64X64][MI_SIZE_64X64];
63 uint8_t lfl_y_ver[MI_SIZE_64X64][MI_SIZE_64X64];
66 uint8_t lfl_u_ver[MI_SIZE_64X64][MI_SIZE_64X64];
67 uint8_t lfl_u_hor[MI_SIZE_64X64][MI_SIZE_64X64];
70 uint8_t lfl_v_ver[MI_SIZE_64X64][MI_SIZE_64X64];
71 uint8_t lfl_v_hor[MI_SIZE_64X64][MI_SIZE_64X64];
75 FilterMask is_vert_border;
76 FilterMask is_horz_border;
78 FilterMask tx_size_ver[2][5];
79 FilterMask tx_size_hor[2][5];
81 #endif // CONFIG_LPF_MASK 90 uint8_t mode_ref_delta_enabled;
91 uint8_t mode_ref_delta_update;
95 int8_t ref_deltas[REF_FRAMES];
98 int8_t mode_deltas[MAX_MODE_LF_DELTAS];
100 int combine_vert_horz_lf;
106 #endif // CONFIG_LPF_MASK 112 DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, mblim[SIMD_WIDTH]);
113 DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, lim[SIMD_WIDTH]);
114 DECLARE_ALIGNED(SIMD_WIDTH, uint8_t, hev_thr[SIMD_WIDTH]);
115 } loop_filter_thresh;
118 loop_filter_thresh lfthr[MAX_LOOP_FILTER + 1];
119 uint8_t lvl[MAX_MB_PLANE][MAX_SEGMENTS][2][REF_FRAMES][MAX_MODE_LF_DELTAS];
120 } loop_filter_info_n;
122 typedef struct LoopFilterWorkerData {
125 struct macroblockd_plane planes[MAX_MB_PLANE];
135 struct AV1LfSyncData;
137 void av1_loop_filter_init(
struct AV1Common *cm);
139 void av1_loop_filter_frame_init(
struct AV1Common *cm,
int plane_start,
150 int plane_start,
int plane_end,
int partial_frame);
154 int plane_end,
int partial_frame);
157 void av1_filter_block_plane_vert(
const struct AV1Common *
const cm,
159 const MACROBLOCKD_PLANE *
const plane_ptr,
160 const uint32_t mi_row,
const uint32_t mi_col);
162 void av1_filter_block_plane_horz(
const struct AV1Common *
const cm,
164 const MACROBLOCKD_PLANE *
const plane_ptr,
165 const uint32_t mi_row,
const uint32_t mi_col);
167 uint8_t av1_get_filter_level(
const struct AV1Common *cm,
168 const loop_filter_info_n *lfi_n,
const int dir_idx,
171 void av1_filter_block_plane_ver(
struct AV1Common *
const cm,
172 struct macroblockd_plane *
const plane_ptr,
173 int pl,
int mi_row,
int mi_col);
175 void av1_filter_block_plane_hor(
struct AV1Common *
const cm,
176 struct macroblockd_plane *
const plane,
int pl,
177 int mi_row,
int mi_col);
179 int get_index_shift(
int mi_col,
int mi_row,
int *index);
181 void av1_build_bitmask_vert_info(
182 struct AV1Common *
const cm,
const struct macroblockd_plane *
const plane_ptr,
185 void av1_build_bitmask_horz_info(
186 struct AV1Common *
const cm,
const struct macroblockd_plane *
const plane_ptr,
189 void av1_filter_block_plane_bitmask_vert(
190 struct AV1Common *
const cm,
struct macroblockd_plane *
const plane_ptr,
191 int pl,
int mi_row,
int mi_col);
193 void av1_filter_block_plane_bitmask_horz(
194 struct AV1Common *
const cm,
struct macroblockd_plane *
const plane_ptr,
195 int pl,
int mi_row,
int mi_col);
197 void av1_store_bitmask_univariant_tx(
struct AV1Common *cm,
int mi_row,
198 int mi_col, BLOCK_SIZE bsize,
201 void av1_store_bitmask_other_info(
struct AV1Common *cm,
int mi_row,
int mi_col,
203 int is_horz_coding_block_border,
204 int is_vert_coding_block_border);
206 void av1_store_bitmask_vartx(
struct AV1Common *cm,
int mi_row,
int mi_col,
207 BLOCK_SIZE bsize, TX_SIZE tx_size,
209 #endif // CONFIG_LPF_MASK 215 #endif // AOM_AV1_COMMON_AV1_LOOPFILTER_H_ void av1_loop_filter_frame(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm, struct macroblockd *xd, int plane_start, int plane_end, int partial_frame)
Apply AV1 loop filter.
YV12 frame buffer data structure.
Definition: yv12config.h:38
Variables related to current coding block.
Definition: blockd.h:568
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:723
Stores the prediction/txfm mode of the current coding block.
Definition: blockd.h:216