#include <math.h>
#include "config/aom_config.h"
#include "config/aom_dsp_rtcd.h"
#include "aom_dsp/aom_dsp_common.h"
#include "aom_mem/aom_mem.h"
#include "aom_ports/mem.h"
#include "av1/common/av1_common_int.h"
#include "av1/common/av1_loopfilter.h"
#include "av1/common/reconinter.h"
#include "av1/common/seg_common.h"
enum { … } UENUM1BYTE(…) …;
static const SEG_LVL_FEATURES seg_lvl_lf_lut[MAX_MB_PLANE][2] = …;
static const int delta_lf_id_lut[MAX_MB_PLANE][2] = …;
static const int mode_lf_lut[] = …;
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) { … }
static uint8_t get_filter_level(const AV1_COMMON *cm,
const loop_filter_info_n *lfi_n,
const int dir_idx, int plane,
const MB_MODE_INFO *mbmi) { … }
void av1_loop_filter_init(AV1_COMMON *cm) { … }
void av1_loop_filter_frame_init(AV1_COMMON *cm, int plane_start,
int plane_end) { … }
static AOM_FORCE_INLINE TX_SIZE
get_transform_size(const MACROBLOCKD *const xd, const MB_MODE_INFO *const mbmi,
const int mi_row, const int mi_col, const int plane,
const int ss_x, const int ss_y) { … }
static const int tx_dim_to_filter_length[TX_SIZES] = …;
static TX_SIZE set_lpf_parameters(
AV1_DEBLOCKING_PARAMETERS *const params, const ptrdiff_t mode_step,
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const EDGE_DIR edge_dir, const uint32_t x, const uint32_t y,
const int plane, const struct macroblockd_plane *const plane_ptr) { … }
static const uint32_t vert_filter_length_luma[TX_SIZES_ALL][TX_SIZES_ALL] = …;
static const uint32_t horz_filter_length_luma[TX_SIZES_ALL][TX_SIZES_ALL] = …;
static const uint32_t vert_filter_length_chroma[TX_SIZES_ALL][TX_SIZES_ALL] = …;
static const uint32_t horz_filter_length_chroma[TX_SIZES_ALL][TX_SIZES_ALL] = …;
static AOM_FORCE_INLINE void set_one_param_for_line_luma(
AV1_DEBLOCKING_PARAMETERS *const params, TX_SIZE *tx_size,
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const EDGE_DIR edge_dir, uint32_t mi_col, uint32_t mi_row,
const struct macroblockd_plane *const plane_ptr, int coord,
bool is_first_block, TX_SIZE prev_tx_size, const ptrdiff_t mode_step,
int *min_dim) { … }
static AOM_FORCE_INLINE void set_lpf_parameters_for_line_luma(
AV1_DEBLOCKING_PARAMETERS *const params_buf, TX_SIZE *tx_buf,
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const EDGE_DIR edge_dir, uint32_t mi_col, uint32_t mi_row,
const struct macroblockd_plane *const plane_ptr, const uint32_t mi_range,
const ptrdiff_t mode_step, int *min_dim) { … }
static AOM_FORCE_INLINE void set_one_param_for_line_chroma(
AV1_DEBLOCKING_PARAMETERS *const params, TX_SIZE *tx_size,
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const EDGE_DIR edge_dir, uint32_t mi_col, uint32_t mi_row, int coord,
bool is_first_block, TX_SIZE prev_tx_size,
const struct macroblockd_plane *const plane_ptr, const ptrdiff_t mode_step,
const int scale_horz, const int scale_vert, int *min_dim, int plane,
int joint_filter_chroma) { … }
static AOM_FORCE_INLINE void set_lpf_parameters_for_line_chroma(
AV1_DEBLOCKING_PARAMETERS *const params_buf, TX_SIZE *tx_buf,
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const EDGE_DIR edge_dir, uint32_t mi_col, uint32_t mi_row,
const struct macroblockd_plane *const plane_ptr, const uint32_t mi_range,
const ptrdiff_t mode_step, const int scale_horz, const int scale_vert,
int *min_dim, int plane, int joint_filter_chroma) { … }
static inline void filter_vert(uint8_t *dst, int dst_stride,
const AV1_DEBLOCKING_PARAMETERS *params,
const SequenceHeader *seq_params,
USE_FILTER_TYPE use_filter_type) { … }
static inline void filter_vert_chroma(uint8_t *u_dst, uint8_t *v_dst,
int dst_stride,
const AV1_DEBLOCKING_PARAMETERS *params,
const SequenceHeader *seq_params,
USE_FILTER_TYPE use_filter_type) { … }
void av1_filter_block_plane_vert(const AV1_COMMON *const cm,
const MACROBLOCKD *const xd, const int plane,
const MACROBLOCKD_PLANE *const plane_ptr,
const uint32_t mi_row, const uint32_t mi_col) { … }
void av1_filter_block_plane_vert_opt(
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row,
const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
TX_SIZE *tx_buf, int num_mis_in_lpf_unit_height_log2) { … }
void av1_filter_block_plane_vert_opt_chroma(
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row,
const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
TX_SIZE *tx_buf, int plane, bool joint_filter_chroma,
int num_mis_in_lpf_unit_height_log2) { … }
static inline void filter_horz(uint8_t *dst, int dst_stride,
const AV1_DEBLOCKING_PARAMETERS *params,
const SequenceHeader *seq_params,
USE_FILTER_TYPE use_filter_type) { … }
static inline void filter_horz_chroma(uint8_t *u_dst, uint8_t *v_dst,
int dst_stride,
const AV1_DEBLOCKING_PARAMETERS *params,
const SequenceHeader *seq_params,
USE_FILTER_TYPE use_filter_type) { … }
void av1_filter_block_plane_horz(const AV1_COMMON *const cm,
const MACROBLOCKD *const xd, const int plane,
const MACROBLOCKD_PLANE *const plane_ptr,
const uint32_t mi_row, const uint32_t mi_col) { … }
void av1_filter_block_plane_horz_opt(
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row,
const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
TX_SIZE *tx_buf, int num_mis_in_lpf_unit_height_log2) { … }
void av1_filter_block_plane_horz_opt_chroma(
const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
const MACROBLOCKD_PLANE *const plane_ptr, const uint32_t mi_row,
const uint32_t mi_col, AV1_DEBLOCKING_PARAMETERS *params_buf,
TX_SIZE *tx_buf, int plane, bool joint_filter_chroma,
int num_mis_in_lpf_unit_height_log2) { … }