#ifndef AOM_AV1_COMMON_BLOCKD_H_
#define AOM_AV1_COMMON_BLOCKD_H_
#include "config/aom_config.h"
#include "aom_dsp/aom_dsp_common.h"
#include "aom_ports/mem.h"
#include "aom_scale/yv12config.h"
#include "av1/common/common_data.h"
#include "av1/common/quant_common.h"
#include "av1/common/entropy.h"
#include "av1/common/entropymode.h"
#include "av1/common/mv.h"
#include "av1/common/scale.h"
#include "av1/common/seg_common.h"
#include "av1/common/tile_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define USE_B_QUANT_NO_TRELLIS …
#define MAX_MB_PLANE …
#define MAX_DIFFWTD_MASK_BITS …
#define INTERINTRA_WEDGE_SIGN …
#define DEFAULT_INTER_TX_TYPE …
#define MAX_PALETTE_BLOCK_WIDTH …
#define MAX_PALETTE_BLOCK_HEIGHT …
enum { … } UENUM1BYTE(…) …;
enum { … } UENUM1BYTE(…) …;
static inline int is_comp_ref_allowed(BLOCK_SIZE bsize) { … }
static inline int is_inter_mode(PREDICTION_MODE mode) { … }
BUFFER_SET;
static inline int is_inter_singleref_mode(PREDICTION_MODE mode) { … }
static inline int is_inter_compound_mode(PREDICTION_MODE mode) { … }
static inline PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) { … }
static inline PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) { … }
static inline int have_nearmv_in_inter_mode(PREDICTION_MODE mode) { … }
static inline int have_newmv_in_inter_mode(PREDICTION_MODE mode) { … }
static inline int is_masked_compound_type(COMPOUND_TYPE type) { … }
PALETTE_MODE_INFO;
FILTER_INTRA_MODE_INFO;
static const PREDICTION_MODE fimode_to_intradir[FILTER_INTRA_MODES] = …;
#if CONFIG_RD_DEBUG
#define TXB_COEFF_COST_MAP_SIZE …
#endif
RD_STATS;
INTERINTER_COMPOUND_DATA;
#define INTER_TX_SIZE_BUF_LEN …
#define TXK_TYPE_BUF_LEN …
MB_MODE_INFO;
static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) { … }
static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) { … }
static inline int is_inter_block(const MB_MODE_INFO *mbmi) { … }
static inline int has_second_ref(const MB_MODE_INFO *mbmi) { … }
static inline int has_uni_comp_refs(const MB_MODE_INFO *mbmi) { … }
static inline MV_REFERENCE_FRAME comp_ref0(int ref_idx) { … }
static inline MV_REFERENCE_FRAME comp_ref1(int ref_idx) { … }
PREDICTION_MODE av1_left_block_mode(const MB_MODE_INFO *left_mi);
PREDICTION_MODE av1_above_block_mode(const MB_MODE_INFO *above_mi);
static inline int is_global_mv_block(const MB_MODE_INFO *const mbmi,
TransformationType type) { … }
#if CONFIG_MISMATCH_DEBUG
static inline void mi_to_pixel_loc(int *pixel_c, int *pixel_r, int mi_col,
int mi_row, int tx_blk_col, int tx_blk_row,
int subsampling_x, int subsampling_y) {
*pixel_c = ((mi_col >> subsampling_x) << MI_SIZE_LOG2) +
(tx_blk_col << MI_SIZE_LOG2);
*pixel_r = ((mi_row >> subsampling_y) << MI_SIZE_LOG2) +
(tx_blk_row << MI_SIZE_LOG2);
}
#endif
enum { … } UENUM1BYTE(…) …;
struct buf_2d { … };
eob_info;
CB_BUFFER;
MACROBLOCKD_PLANE;
#define BLOCK_OFFSET(i) …
WienerInfo;
SgrprojInfo;
#define CFL_MAX_BLOCK_SIZE …
#define CFL_BUF_LINE …
#define CFL_BUF_LINE_I128 …
#define CFL_BUF_LINE_I256 …
#define CFL_BUF_SQUARE …
CFL_CTX;
DIST_WTD_COMP_PARAMS;
struct scale_factors;
MACROBLOCKD;
static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) { … }
static inline uint8_t *get_buf_by_bd(const MACROBLOCKD *xd, uint8_t *buf16) { … }
BitDepthInfo;
static inline BitDepthInfo get_bit_depth_info(const MACROBLOCKD *xd) { … }
static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) { … }
static inline BLOCK_SIZE get_partition_subsize(BLOCK_SIZE bsize,
PARTITION_TYPE partition) { … }
static TX_TYPE intra_mode_to_tx_type(const MB_MODE_INFO *mbmi,
PLANE_TYPE plane_type) { … }
static inline int is_rect_tx(TX_SIZE tx_size) { … }
static inline int block_signals_txsize(BLOCK_SIZE bsize) { … }
static const int av1_num_ext_tx_set[EXT_TX_SET_TYPES] = …;
static const int av1_ext_tx_used[EXT_TX_SET_TYPES][TX_TYPES] = …;
static const uint16_t av1_derived_intra_tx_used_flag[INTRA_MODES] = …;
static const uint16_t av1_reduced_intra_tx_used_flag[INTRA_MODES] = …;
static const uint16_t av1_ext_tx_used_flag[EXT_TX_SET_TYPES] = …;
static const TxSetType av1_ext_tx_set_lookup[2][2] = …;
static inline TxSetType av1_get_ext_tx_set_type(TX_SIZE tx_size, int is_inter,
int use_reduced_set) { … }
static const int ext_tx_set_index[2][EXT_TX_SET_TYPES] = …;
static inline int get_ext_tx_set(TX_SIZE tx_size, int is_inter,
int use_reduced_set) { … }
static inline int get_ext_tx_types(TX_SIZE tx_size, int is_inter,
int use_reduced_set) { … }
#define TXSIZEMAX(t1, t2) …
#define TXSIZEMIN(t1, t2) …
static inline TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode) { … }
static const uint8_t mode_to_angle_map[INTRA_MODES] = …;
static inline int av1_block_index_to_raster_order(TX_SIZE tx_size,
int block_idx) { … }
static inline int av1_raster_order_to_block_index(TX_SIZE tx_size,
int raster_order) { … }
static inline TX_TYPE get_default_tx_type(PLANE_TYPE plane_type,
const MACROBLOCKD *xd,
TX_SIZE tx_size,
int use_screen_content_tools) { … }
static inline BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize,
int subsampling_x,
int subsampling_y) { … }
static inline int av1_get_txb_size_index(BLOCK_SIZE bsize, int blk_row,
int blk_col) { … }
#if CONFIG_INSPECTION
static inline int av1_get_txk_type_index(BLOCK_SIZE bsize, int blk_row,
int blk_col) {
static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 2, 2,
};
static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 2, 2,
};
static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
0, 0, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 0, 2, 0, 2, 0, 2,
};
const int index =
((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
(blk_col >> tw_w_log2_table[bsize]);
assert(index < TXK_TYPE_BUF_LEN);
return index;
}
#endif
static inline void update_txk_array(MACROBLOCKD *const xd, int blk_row,
int blk_col, TX_SIZE tx_size,
TX_TYPE tx_type) { … }
static inline TX_TYPE av1_get_tx_type(const MACROBLOCKD *xd,
PLANE_TYPE plane_type, int blk_row,
int blk_col, TX_SIZE tx_size,
int reduced_tx_set) { … }
void av1_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y,
const int num_planes);
static inline int bsize_to_max_depth(BLOCK_SIZE bsize) { … }
static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) { … }
static inline TX_SIZE depth_to_tx_size(int depth, BLOCK_SIZE bsize) { … }
static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) { … }
static inline TX_SIZE av1_get_max_uv_txsize(BLOCK_SIZE bsize, int subsampling_x,
int subsampling_y) { … }
static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) { … }
void av1_reset_entropy_context(MACROBLOCKD *xd, BLOCK_SIZE bsize,
const int num_planes);
void av1_reset_loop_filter_delta(MACROBLOCKD *xd, int num_planes);
void av1_reset_loop_restoration(MACROBLOCKD *xd, const int num_planes);
foreach_transformed_block_visitor;
void av1_set_entropy_contexts(const MACROBLOCKD *xd,
struct macroblockd_plane *pd, int plane,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
int has_eob, int aoff, int loff);
#define MAX_INTERINTRA_SB_SQUARE …
static inline int is_interintra_mode(const MB_MODE_INFO *mbmi) { … }
static inline int is_interintra_allowed_bsize(const BLOCK_SIZE bsize) { … }
static inline int is_interintra_allowed_mode(const PREDICTION_MODE mode) { … }
static inline int is_interintra_allowed_ref(const MV_REFERENCE_FRAME rf[2]) { … }
static inline int is_interintra_allowed(const MB_MODE_INFO *mbmi) { … }
static inline int is_interintra_allowed_bsize_group(int group) { … }
static inline int is_interintra_pred(const MB_MODE_INFO *mbmi) { … }
static inline int get_vartx_max_txsize(const MACROBLOCKD *xd, BLOCK_SIZE bsize,
int plane) { … }
static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) { … }
static inline int is_motion_variation_allowed_compound(
const MB_MODE_INFO *mbmi) { … }
static const int max_neighbor_obmc[6] = …;
static inline int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) { … }
static inline MOTION_MODE motion_mode_allowed(
const WarpedMotionParams *gm_params, const MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi, int allow_warped_motion) { … }
static inline int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) { … }
static inline int av1_allow_palette(int allow_screen_content_tools,
BLOCK_SIZE sb_type) { … }
static inline void av1_get_block_dimensions(BLOCK_SIZE bsize, int plane,
const MACROBLOCKD *xd, int *width,
int *height,
int *rows_within_bounds,
int *cols_within_bounds) { … }
MapCdf;
ColorCost;
Av1ColorMapParam;
static inline int is_nontrans_global_motion(const MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi) { … }
static inline PLANE_TYPE get_plane_type(int plane) { … }
static inline int av1_get_max_eob(TX_SIZE tx_size) { … }
#ifdef __cplusplus
}
#endif
#endif