#ifndef AOM_AV1_ENCODER_RDOPT_UTILS_H_
#define AOM_AV1_ENCODER_RDOPT_UTILS_H_
#include "aom/aom_integer.h"
#include "av1/encoder/block.h"
#include "av1/common/cfl.h"
#include "av1/common/pred_common.h"
#include "av1/encoder/rdopt_data_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_REF_MV_SEARCH …
#define MAX_TX_RD_GATE_LEVEL …
#define INTER_INTRA_RD_THRESH_SCALE …
#define INTER_INTRA_RD_THRESH_SHIFT …
MODE_DEFINITION;
static const MODE_DEFINITION av1_mode_defs[MAX_MODES] = …;
static const int winner_mode_count_allowed[MULTI_WINNER_MODE_LEVELS] = …;
static inline void restore_dst_buf(MACROBLOCKD *xd, const BUFFER_SET dst,
const int num_planes) { … }
static inline void swap_dst_buf(MACROBLOCKD *xd, const BUFFER_SET *dst_bufs[2],
int num_planes) { … }
static inline int64_t get_rd_thresh_from_best_rd(int64_t ref_best_rd,
int mul_factor,
int div_factor) { … }
static inline THR_MODES get_prediction_mode_idx(
PREDICTION_MODE this_mode, MV_REFERENCE_FRAME ref_frame,
MV_REFERENCE_FRAME second_ref_frame) { … }
static inline int inter_mode_data_block_idx(BLOCK_SIZE bsize) { … }
static inline void get_txb_dimensions(const MACROBLOCKD *xd, int plane,
BLOCK_SIZE plane_bsize, int blk_row,
int blk_col, BLOCK_SIZE tx_bsize,
int *width, int *height,
int *visible_width, int *visible_height) { … }
static inline int bsize_to_num_blk(BLOCK_SIZE bsize) { … }
static inline int check_txfm_eval(MACROBLOCK *const x, BLOCK_SIZE bsize,
int64_t best_skip_rd, int64_t skip_rd,
int level, int is_luma_only) { … }
static TX_MODE select_tx_mode(
const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) { … }
static inline int bypass_winner_mode_processing(const MACROBLOCK *const x,
const SPEED_FEATURES *sf,
int use_txfm_skip,
int actual_txfm_skip,
PREDICTION_MODE best_mode) { … }
static inline int is_winner_mode_processing_enabled(const struct AV1_COMP *cpi,
const MACROBLOCK *const x,
MB_MODE_INFO *const mbmi,
int actual_txfm_skip) { … }
static inline void set_tx_size_search_method(
const AV1_COMMON *cm, const WinnerModeParams *winner_mode_params,
TxfmSearchParams *txfm_params, int enable_winner_mode_for_tx_size_srch,
int is_winner_mode) { … }
static inline void set_tx_type_prune(const SPEED_FEATURES *sf,
TxfmSearchParams *txfm_params,
int winner_mode_tx_type_pruning,
int is_winner_mode) { … }
static inline void set_tx_domain_dist_params(
const WinnerModeParams *winner_mode_params, TxfmSearchParams *txfm_params,
int enable_winner_mode_for_tx_domain_dist, int is_winner_mode) { … }
static inline void set_mode_eval_params(const struct AV1_COMP *cpi,
MACROBLOCK *x,
MODE_EVAL_TYPE mode_eval_type) { … }
static inline CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm,
const MACROBLOCK *x) { … }
static inline void init_sbuv_mode(MB_MODE_INFO *const mbmi) { … }
static inline void store_winner_mode_stats(
const AV1_COMMON *const cm, MACROBLOCK *x, const MB_MODE_INFO *mbmi,
RD_STATS *rd_cost, RD_STATS *rd_cost_y, RD_STATS *rd_cost_uv,
THR_MODES mode_index, uint8_t *color_map, BLOCK_SIZE bsize, int64_t this_rd,
int multi_winner_mode_type, int txfm_search_done) { … }
unsigned int av1_get_perpixel_variance(const AV1_COMP *cpi,
const MACROBLOCKD *xd,
const struct buf_2d *ref,
BLOCK_SIZE bsize, int plane,
int use_hbd);
unsigned int av1_get_perpixel_variance_facade(const struct AV1_COMP *cpi,
const MACROBLOCKD *xd,
const struct buf_2d *ref,
BLOCK_SIZE bsize, int plane);
static inline int is_mode_intra(PREDICTION_MODE mode) { … }
static inline void av1_copy_usable_ref_mv_stack_and_weight(
const MACROBLOCKD *xd, MB_MODE_INFO_EXT *const mbmi_ext,
MV_REFERENCE_FRAME ref_frame) { … }
static inline int get_txfm_rd_gate_level(
const int is_masked_compound_enabled,
const int txfm_rd_gate_level[TX_SEARCH_CASES], BLOCK_SIZE bsize,
TX_SEARCH_CASE tx_search_case, int eval_motion_mode) { … }
#ifdef __cplusplus
}
#endif
#endif