#ifndef AOM_AV1_ENCODER_ENCODEFRAME_UTILS_H_
#define AOM_AV1_ENCODER_ENCODEFRAME_UTILS_H_
#include "aom_ports/aom_timer.h"
#include "av1/common/reconinter.h"
#include "av1/encoder/encoder.h"
#include "av1/encoder/rdopt.h"
#ifdef __cplusplus
extern "C" {
#endif
#define WRITE_FEATURE_TO_FILE …
#define FEATURE_SIZE_SMS_SPLIT_FAST …
#define FEATURE_SIZE_SMS_SPLIT …
#define FEATURE_SIZE_SMS_PRUNE_PART …
#define FEATURE_SIZE_SMS_TERM_NONE …
#define FEATURE_SIZE_FP_SMS_TERM_NONE …
#define FEATURE_SIZE_MAX_MIN_PART_PRED …
#define MAX_NUM_CLASSES_MAX_MIN_PART_PRED …
#define FEATURE_SMS_NONE_FLAG …
#define FEATURE_SMS_SPLIT_FLAG …
#define FEATURE_SMS_RECT_FLAG …
#define FEATURE_SMS_PRUNE_PART_FLAG …
#define FEATURE_SMS_SPLIT_MODEL_FLAG …
#define SUB_PARTITIONS_RECT …
#define SUB_PARTITIONS_SPLIT …
#define SUB_PARTITIONS_AB …
#define SUB_PARTITIONS_PART4 …
enum { … } UENUM1BYTE(…) …;
enum { … } UENUM1BYTE(…) …;
enum { … } UENUM1BYTE(…) …;
RD_RECT_PART_WIN_INFO;
enum { … };
enum { … } UENUM1BYTE(…) …;
RD_SEARCH_MACROBLOCK_CONTEXT;
SB_FIRST_PASS_STATS;
PartitionBlkParams;
#if CONFIG_COLLECT_PARTITION_STATS
typedef struct PartitionTimingStats {
int partition_decisions[EXT_PARTITION_TYPES];
int partition_attempts[EXT_PARTITION_TYPES];
int64_t partition_times[EXT_PARTITION_TYPES];
int64_t partition_rdcost[EXT_PARTITION_TYPES];
struct aom_usec_timer timer;
int timer_is_on;
} PartitionTimingStats;
#endif
PartitionSearchState;
static inline void av1_disable_square_split_partition(
PartitionSearchState *part_state) { … }
static inline void av1_disable_rect_partitions(
PartitionSearchState *part_state) { … }
static inline void av1_disable_all_splits(PartitionSearchState *part_state) { … }
static inline void av1_set_square_split_only(PartitionSearchState *part_state) { … }
static inline bool av1_blk_has_rows_and_cols(
const PartitionBlkParams *blk_params) { … }
static inline bool av1_is_whole_blk_in_frame(
const PartitionBlkParams *blk_params,
const CommonModeInfoParams *mi_params) { … }
static inline void update_filter_type_cdf(const MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi,
int dual_filter) { … }
static inline int set_rdmult(const AV1_COMP *const cpi,
const MACROBLOCK *const x, int segment_id) { … }
static inline int do_split_check(BLOCK_SIZE bsize) { … }
#if !CONFIG_REALTIME_ONLY
static inline const FIRSTPASS_STATS *read_one_frame_stats(const TWO_PASS *p,
int frm) {
assert(frm >= 0);
if (frm < 0 ||
p->stats_buf_ctx->stats_in_start + frm > p->stats_buf_ctx->stats_in_end) {
return NULL;
}
return &p->stats_buf_ctx->stats_in_start[frm];
}
int av1_get_rdmult_delta(AV1_COMP *cpi, BLOCK_SIZE bsize, int mi_row,
int mi_col, int orig_rdmult);
int av1_active_h_edge(const AV1_COMP *cpi, int mi_row, int mi_step);
int av1_active_v_edge(const AV1_COMP *cpi, int mi_col, int mi_step);
void av1_get_tpl_stats_sb(AV1_COMP *cpi, BLOCK_SIZE bsize, int mi_row,
int mi_col, SuperBlockEnc *sb_enc);
int av1_get_q_for_deltaq_objective(AV1_COMP *const cpi, ThreadData *td,
int64_t *delta_dist, BLOCK_SIZE bsize,
int mi_row, int mi_col);
int av1_get_q_for_hdr(AV1_COMP *const cpi, MACROBLOCK *const x,
BLOCK_SIZE bsize, int mi_row, int mi_col);
int av1_get_cb_rdmult(const AV1_COMP *const cpi, MACROBLOCK *const x,
const BLOCK_SIZE bsize, const int mi_row,
const int mi_col);
#endif
void av1_set_ssim_rdmult(const AV1_COMP *const cpi, int *errorperbit,
const BLOCK_SIZE bsize, const int mi_row,
const int mi_col, int *const rdmult);
#if CONFIG_SALIENCY_MAP
void av1_set_saliency_map_vmaf_rdmult(const AV1_COMP *const cpi,
int *errorperbit, const BLOCK_SIZE bsize,
const int mi_row, const int mi_col,
int *const rdmult);
#endif
void av1_update_state(const AV1_COMP *const cpi, ThreadData *td,
const PICK_MODE_CONTEXT *const ctx, int mi_row,
int mi_col, BLOCK_SIZE bsize, RUN_TYPE dry_run);
void av1_update_inter_mode_stats(FRAME_CONTEXT *fc, FRAME_COUNTS *counts,
PREDICTION_MODE mode, int16_t mode_context);
void av1_sum_intra_stats(const AV1_COMMON *const cm, FRAME_COUNTS *counts,
MACROBLOCKD *xd, const MB_MODE_INFO *const mbmi,
const MB_MODE_INFO *above_mi,
const MB_MODE_INFO *left_mi, const int intraonly);
void av1_restore_context(MACROBLOCK *x, const RD_SEARCH_MACROBLOCK_CONTEXT *ctx,
int mi_row, int mi_col, BLOCK_SIZE bsize,
const int num_planes);
void av1_save_context(const MACROBLOCK *x, RD_SEARCH_MACROBLOCK_CONTEXT *ctx,
int mi_row, int mi_col, BLOCK_SIZE bsize,
const int num_planes);
void av1_set_fixed_partitioning(AV1_COMP *cpi, const TileInfo *const tile,
MB_MODE_INFO **mib, int mi_row, int mi_col,
BLOCK_SIZE bsize);
int av1_is_leaf_split_partition(AV1_COMMON *cm, int mi_row, int mi_col,
BLOCK_SIZE bsize);
void av1_reset_simple_motion_tree_partition(SIMPLE_MOTION_DATA_TREE *sms_tree,
BLOCK_SIZE bsize);
void av1_update_picked_ref_frames_mask(MACROBLOCK *const x, int ref_type,
BLOCK_SIZE bsize, int mib_size,
int mi_row, int mi_col);
void av1_avg_cdf_symbols(FRAME_CONTEXT *ctx_left, FRAME_CONTEXT *ctx_tr,
int wt_left, int wt_tr);
void av1_source_content_sb(AV1_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
int mi_row, int mi_col);
void av1_reset_mbmi(CommonModeInfoParams *const mi_params, BLOCK_SIZE sb_size,
int mi_row, int mi_col);
void av1_backup_sb_state(SB_FIRST_PASS_STATS *sb_fp_stats, const AV1_COMP *cpi,
ThreadData *td, const TileDataEnc *tile_data,
int mi_row, int mi_col);
void av1_restore_sb_state(const SB_FIRST_PASS_STATS *sb_fp_stats, AV1_COMP *cpi,
ThreadData *td, TileDataEnc *tile_data, int mi_row,
int mi_col);
void av1_set_cost_upd_freq(AV1_COMP *cpi, ThreadData *td,
const TileInfo *const tile_info, const int mi_row,
const int mi_col);
void av1_dealloc_src_diff_buf(struct macroblock *mb, int num_planes);
static inline void av1_dealloc_mb_data(struct macroblock *mb, int num_planes) { … }
static inline void allocate_winner_mode_stats(const AV1_COMP *cpi,
struct macroblock *mb) { … }
void av1_alloc_src_diff_buf(const struct AV1Common *cm, struct macroblock *mb);
static inline void av1_alloc_mb_data(const AV1_COMP *cpi,
struct macroblock *mb) { … }
static inline unsigned int get_num_refs_to_disable(
const AV1_COMP *cpi, const int *ref_frame_flags,
const unsigned int *ref_display_order_hint,
unsigned int cur_frame_display_index) { … }
static inline int get_max_allowed_ref_frames(
const AV1_COMP *cpi, const int *ref_frame_flags,
const unsigned int *ref_display_order_hint,
unsigned int cur_frame_display_index) { … }
static inline void enforce_max_ref_frames(
AV1_COMP *cpi, int *ref_frame_flags,
const unsigned int *ref_display_order_hint,
unsigned int cur_frame_display_index) { … }
#ifdef __cplusplus
}
#endif
#endif