 |
AOMedia AV1 Codec
|
12 #ifndef AOM_AV1_ENCODER_RDOPT_H_
13 #define AOM_AV1_ENCODER_RDOPT_H_
17 #include "av1/common/blockd.h"
18 #include "av1/common/txb_common.h"
21 #include "av1/encoder/context_tree.h"
23 #include "av1/encoder/encodetxb.h"
24 #include "av1/encoder/rdopt_utils.h"
30 #define COMP_TYPE_RD_THRESH_SCALE 11
31 #define COMP_TYPE_RD_THRESH_SHIFT 4
32 #define MAX_WINNER_MOTION_MODES 10
63 struct RD_STATS *rd_cost, BLOCK_SIZE bsize,
64 PICK_MODE_CONTEXT *ctx, int64_t best_rd);
94 struct macroblock *x,
struct RD_STATS *rd_cost,
95 BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
96 int64_t best_rd_so_far);
124 BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx);
156 struct TileDataEnc *tile_data,
158 struct RD_STATS *rd_cost, BLOCK_SIZE bsize,
159 PICK_MODE_CONTEXT *ctx);
161 void av1_rd_pick_inter_mode_sb_seg_skip(
162 const struct AV1_COMP *cpi,
struct TileDataEnc *tile_data,
163 struct macroblock *x,
int mi_row,
int mi_col,
struct RD_STATS *rd_cost,
164 BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, int64_t best_rd_so_far);
184 EdgeInfo av1_edge_exists(
const uint8_t *src,
int src_stride,
int w,
int h,
185 bool high_bd,
int bd);
190 void av1_gaussian_blur(
const uint8_t *src,
int src_stride,
int w,
int h,
191 uint8_t *dst,
bool high_bd,
int bd);
201 sobel_xy av1_sobel(
const uint8_t *input,
int stride,
int i,
int j,
204 void av1_inter_mode_data_init(
struct TileDataEnc *tile_data);
205 void av1_inter_mode_data_fit(TileDataEnc *tile_data,
int rdmult);
207 static INLINE
int coded_to_superres_mi(
int mi_col,
int denom) {
208 return (mi_col * denom + SCALE_NUMERATOR / 2) / SCALE_NUMERATOR;
211 static INLINE
int av1_encoder_get_relative_dist(
int a,
int b) {
212 assert(a >= 0 && b >= 0);
217 static INLINE
int av1_get_sb_mi_size(
const AV1_COMMON *
const cm) {
220 (mi_size_wide[cm->
seq_params.sb_size] + mi_alloc_size_1d - 1) /
222 assert(mi_size_wide[cm->
seq_params.sb_size] ==
224 int sb_mi_size = sb_mi_rows * sb_mi_rows;
232 static INLINE
void av1_copy_usable_ref_mv_stack_and_weight(
234 MV_REFERENCE_FRAME ref_frame) {
235 memcpy(mbmi_ext->
weight[ref_frame], xd->
weight[ref_frame],
236 USABLE_REF_MV_STACK_SIZE *
sizeof(xd->
weight[0][0]));
238 USABLE_REF_MV_STACK_SIZE *
sizeof(xd->
ref_mv_stack[0][0]));
243 static INLINE
int prune_ref(
const MV_REFERENCE_FRAME *
const ref_frame,
244 const unsigned int *
const ref_display_order_hint,
245 const unsigned int frame_display_order_hint,
246 const int *ref_frame_list) {
247 for (
int i = 0; i < 2; i++) {
248 if (ref_frame_list[i] == NONE_FRAME)
continue;
250 if (ref_frame[0] == ref_frame_list[i] ||
251 ref_frame[1] == ref_frame_list[i]) {
252 if (av1_encoder_get_relative_dist(
253 ref_display_order_hint[ref_frame_list[i] - LAST_FRAME],
254 frame_display_order_hint) < 0)
261 static INLINE
int prune_ref_by_selective_ref_frame(
263 const MV_REFERENCE_FRAME *
const ref_frame,
264 const unsigned int *
const ref_display_order_hint) {
266 if (!sf->
inter_sf.selective_ref_frame)
return 0;
268 const int comp_pred = ref_frame[1] > INTRA_FRAME;
270 if (sf->
inter_sf.selective_ref_frame >= 2 ||
271 (sf->
inter_sf.selective_ref_frame == 1 && comp_pred)) {
272 int ref_frame_list[2] = { LAST3_FRAME, LAST2_FRAME };
279 ref_frame_list[0] = NONE_FRAME;
283 ref_frame_list[1] = NONE_FRAME;
287 if (prune_ref(ref_frame, ref_display_order_hint,
288 ref_display_order_hint[GOLDEN_FRAME - LAST_FRAME],
293 if (sf->
inter_sf.selective_ref_frame >= 3) {
294 int ref_frame_list[2] = { ALTREF2_FRAME, BWDREF_FRAME };
301 ref_frame_list[0] = NONE_FRAME;
305 ref_frame_list[1] = NONE_FRAME;
309 if (prune_ref(ref_frame, ref_display_order_hint,
310 ref_display_order_hint[LAST_FRAME - LAST_FRAME],
320 static INLINE
void av1_copy_mbmi_ext_to_mbmi_ext_frame(
324 sizeof(mbmi_ext->
ref_mv_stack[USABLE_REF_MV_STACK_SIZE]));
325 memcpy(mbmi_ext_best->
weight, mbmi_ext->
weight[ref_frame_type],
326 sizeof(mbmi_ext->
weight[USABLE_REF_MV_STACK_SIZE]));
337 #endif // AOM_AV1_ENCODER_RDOPT_H_
int mb_to_left_edge
Definition: blockd.h:675
uint8_t * left_pred
Prediction from the up predictor.
Definition: block.h:355
REAL_TIME_SPEED_FEATURES rt_sf
Definition: speed_features.h:1184
uint8_t tpl_bsize_1d
Definition: tpl_model.h:138
int16_t mode_context[MODE_CTX_REF_FRAMES]
Context used to encode the current mode.
Definition: block.h:207
Declares top-level encoder structures and functions.
Stores best extended mode information at frame level.
Definition: block.h:216
InterpFilter interp_filter
Definition: av1_common_int.h:383
OBMCBuffer obmc_buffer
Modified source and masks used for fast OBMC search.
Definition: block.h:905
int64_t av1_rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, TX_SIZE max_tx_size)
Perform intra-mode search on chroma channels.
Definition: intra_mode_search.c:558
int y_dc_delta_q
Definition: av1_common_int.h:592
WarpedMotionParams wm_params
The parameters used in warp motion mode.
Definition: blockd.h:251
Variables related to intra-mode search during inter frame coding.
Definition: intra_mode_search.h:31
Frame level features.
Definition: av1_common_int.h:334
int ** mv_cost_stack
Points to the nmv_cost_hp in use.
Definition: block.h:777
IntraBCMVCosts * dv_costs
Definition: block.h:968
uint8_t ref_mv_idx
Which ref_mv to use.
Definition: blockd.h:308
int zeromv_mode_cost[GLOBALMV_MODE_CONTEXTS][2]
zeromv_mode_cost
Definition: block.h:645
Holds the entropy costs for various modes sent to the bitstream.
Definition: block.h:583
struct macroblock_plane plane[3]
Each of the encoding plane.
Definition: block.h:856
Contains buffers used to speed up rdopt for obmc.
Definition: block.h:335
TX_SIZE tx_size
Transform size when fixed size txfm is used (e.g. intra modes).
Definition: blockd.h:284
Holds the motion samples for warp motion model estimation.
Definition: block.h:815
int8_t angle_delta[PLANE_TYPES]
Directional mode delta: the angle is base angle + (angle_delta * step).
Definition: blockd.h:266
Declares functions used in palette search.
int num
Definition: encoder.h:1121
int comp_ref_cost[REF_CONTEXTS][FWD_REFS - 1][2]
Cost for signaling ref_frame[0] in bidir-comp mode.
Definition: block.h:670
uint8_t height
Definition: blockd.h:764
int skip_motion_mode
Definition: rdopt.c:2079
int comp_inter_cost[COMP_INTER_CONTEXTS][2]
comp_inter_cost
Definition: block.h:659
#define AOM_PLANE_Y
Definition: aom_image.h:199
PARTITION_SPEED_FEATURES part_sf
Definition: speed_features.h:1139
uint16_t weight[USABLE_REF_MV_STACK_SIZE]
The weights used to compute the ref mvs.
Definition: block.h:220
uint8_t blk_skip[MAX_MIB_SIZE *MAX_MIB_SIZE]
Whether to skip transform and quantization on a txfm block level.
Definition: block.h:531
int_interpfilters interp_filters
Filter used in subpel interpolation.
Definition: blockd.h:242
Defines utility functions used in intra mode search.
MB_MODE_INFO_EXT mbmi_ext
Derived coding information.
Definition: block.h:871
static int intra_mode_info_cost_uv(const AV1_COMP *cpi, const MACROBLOCK *x, const MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mode_cost)
Return the rate cost for chroma prediction mode info of intra blocks.
Definition: intra_mode_search_utils.h:340
bool enable_tpl_model
Definition: encoder.h:753
MB_MODE_INFO * above_mbmi
Definition: blockd.h:643
uint8_t width
Definition: blockd.h:763
FrameProbInfo frame_probs
Definition: encoder.h:2496
Defines the parameters used to perform txfm search.
Definition: block.h:425
FILTER_INTRA_MODE_INFO filter_intra_mode_info
The type of filter intra mode used (if applicable).
Definition: blockd.h:268
#define AOM_PLANE_U
Definition: aom_image.h:200
int mi_col
Definition: blockd.h:574
int speed
Definition: encoder.h:2309
int mb_to_bottom_edge
Definition: blockd.h:678
PREDICTION_MODE best_intra_mode
The best luma intra-mode found so far.
Definition: intra_mode_search.h:35
int64_t best_inter_cost
Definition: rdopt.c:2163
SPEED_FEATURES sf
Definition: encoder.h:2314
int rate2_nocoeff
Definition: rdopt.c:2073
int interintra_cost[4][2]
interintra_cost
Definition: block.h:691
unsigned char gf_frame_index
Definition: encoder.h:2362
int skip_txfm
Whether to skip transform and quantization on a partition block level.
Definition: block.h:522
void av1_rd_pick_inter_mode(struct AV1_COMP *cpi, struct TileDataEnc *tile_data, struct macroblock *x, struct RD_STATS *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, int64_t best_rd_so_far)
AV1 inter mode selection.
Definition: rdopt.c:5163
SuperBlockEnc sb_enc
Information on a whole superblock level.
Definition: block.h:1018
int arnr_max_frames
Definition: encoder.h:735
struct segmentation seg
Definition: av1_common_int.h:904
bool cur_frame_force_integer_mv
Definition: av1_common_int.h:347
void av1_rd_pick_intra_mode_sb(const struct AV1_COMP *cpi, struct macroblock *x, struct RD_STATS *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, int64_t best_rd)
AV1 intra mode selection for intra frames.
Definition: rdopt.c:3107
int bd
Definition: blockd.h:806
KeyFrameCfg kf_cfg
Definition: encoder.h:822
int prune_ref_frame_mask
Definition: encoder.h:2518
bool is_chroma_ref
Definition: blockd.h:599
WinnerModeStats * winner_mode_stats
Tracks the winner modes in the current coding block.
Definition: block.h:1117
bool up_available
Definition: blockd.h:620
static void init_intra_mode_search_state(IntraModeSearchState *intra_search_state)
Initializes the IntraModeSearchState struct.
Definition: intra_mode_search.h:259
Params related to temporal dependency model.
Definition: tpl_model.h:129
void av1_nonrd_pick_intra_mode(AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx)
AV1 intra mode selection based on Non-RD optimized model.
Definition: nonrd_pickmode.c:1657
bool allow_screen_content_tools
Definition: av1_common_int.h:351
RefCntBuffer * cur_frame
Definition: av1_common_int.h:809
void av1_restore_uv_color_map(const struct AV1_COMP *cpi, struct macroblock *x)
Resets palette color map for chroma channels.
int16_t mode_context
Context used to encode the current mode.
Definition: block.h:227
int rdmult
Rate-distortion multiplier.
Definition: block.h:951
int motion_mode_cost[BLOCK_SIZES_ALL][MOTION_MODES]
motion_mode_cost
Definition: block.h:713
MB_MODE_INFO * left_mbmi
Definition: blockd.h:638
int num
Number of samples.
Definition: block.h:817
GF_GROUP gf_group
Definition: encoder.h:2357
Top level encoder structure.
Definition: encoder.h:2095
int64_t est_rd_arr[MAX_INTER_MODES]
Definition: encoder.h:1137
int64_t rd_cost
Definition: rdopt.c:2083
RdIdxPair rd_idx_pair_arr[MAX_INTER_MODES]
Definition: encoder.h:1141
uint8_t compound_idx
Indicates whether dist_wtd_comp(0) is used or not (0).
Definition: blockd.h:316
int height
Definition: av1_common_int.h:749
CANDIDATE_MV ref_mv_stack[MODE_CTX_REF_FRAMES][USABLE_REF_MV_STACK_SIZE]
The reference mv list for the current block.
Definition: block.h:199
int qindex
Quantization index for the current partition block.
Definition: block.h:934
uint8_t tpl_keep_ref_frame[REF_FRAMES]
Disables certain ref frame pruning based on tpl.
Definition: block.h:1046
uint8_t use_intrabc
Whether intrabc is used.
Definition: blockd.h:312
int mb_to_right_edge
Definition: blockd.h:676
INTERINTRA_MODE interintra_mode
The type of intra mode used by inter-intra.
Definition: blockd.h:253
int comp_bwdref_cost[REF_CONTEXTS][BWD_REFS - 1][2]
Cost for signaling ref_frame[1] in bidir-comp mode.
Definition: block.h:675
PALETTE_MODE_INFO palette_mode_info
Stores the size and colors of palette mode.
Definition: blockd.h:274
int ref_relative_dist[INTER_REFS_PER_FRAME]
Definition: encoder.h:1792
int32_t * wsrc
A new source weighted with the above and left predictors.
Definition: block.h:340
int intrabc_cost[2]
intrabc_cost
Definition: block.h:618
bool enable_intrabc
Definition: encoder.h:424
uint8_t * above_pred
Prediction from the up predictor.
Definition: block.h:350
search_site_config search_site_cfg[SS_CFG_TOTAL][NUM_DISTINCT_SEARCH_METHODS]
Definition: encoder.h:1756
int64_t tpl_inter_cost[(128/16) *(128/16)]
TPL's estimate of inter cost for each tpl block.
Definition: block.h:70
MvCosts * mv_costs
Definition: block.h:963
int obmc_probs[FRAME_UPDATE_TYPES][BLOCK_SIZES_ALL]
Definition: encoder.h:966
int all_one_sided_refs
Definition: encoder.h:2325
uint8_t skip_mode
Inter skip mode.
Definition: blockd.h:310
AV1_COMMON common
Definition: encoder.h:2138
int pred_mv_sad[REF_FRAMES]
Sum absolute distortion of the predicted mv for each ref frame.
Definition: block.h:1036
MV_REFERENCE_FRAME ref_frame[2]
The reference frames for the MV.
Definition: blockd.h:240
UV_PREDICTION_MODE uv_mode
The UV mode when intra is used.
Definition: blockd.h:228
INTERINTER_COMPOUND_DATA interinter_comp
Struct that stores the data used in interinter compound mode.
Definition: blockd.h:257
int mv_step_param
Definition: encoder.h:1740
Each source plane of the current macroblock.
Definition: block.h:103
int mb_to_top_edge
Definition: blockd.h:677
int superres_upscaled_width
Definition: av1_common_int.h:772
TplParams tpl_data
Definition: encoder.h:2202
const YV12_BUFFER_CONFIG * cur_buf
Definition: blockd.h:693
int uni_comp_ref_cost[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1][((2)+1)]
uni_comp_ref_cost
Definition: block.h:665
int * dv_costs[2]
Definition: block.h:795
int pts_inref[16]
Sample location in the reference frame.
Definition: block.h:821
MotionVectorSearchParams mv_search_params
Definition: encoder.h:2319
int av1_search_palette_mode(IntraModeSearchState *intra_search_state, const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, unsigned int ref_frame_cost, PICK_MODE_CONTEXT *ctx, RD_STATS *this_rd_cost, int64_t best_rd)
Evaluate luma palette mode for inter frames.
Definition: intra_mode_search.c:718
int comp_rd_stats_idx
The idx for the latest compound mode in the cache comp_rd_stats.
Definition: block.h:1154
int use_mb_mode_cache
Whether to reuse the mode stored in mb_mode_cache.
Definition: block.h:1172
CANDIDATE_MV ref_mv_stack[USABLE_REF_MV_STACK_SIZE]
The reference mv list for the current block.
Definition: block.h:218
aom_variance_fn_ptr_t fn_ptr[BLOCK_SIZES_ALL]
Definition: encoder.h:2347
MB_MODE_INFO mbmi
The mbmi used to reconstruct the winner mode.
Definition: block.h:84
WINNER_MODE_SPEED_FEATURES winner_mode_sf
Definition: speed_features.h:1174
Struct used to hold inter mode data for fast tx search.
Definition: encoder.h:1116
int mi_rows
Definition: av1_common_int.h:498
int tpl_data_count
Number of TPL blocks in this superblock.
Definition: block.h:68
int8_t nearest_past_ref
Definition: encoder.h:1796
int16_t * src_diff
Stores source - pred so the txfm can be computed later.
Definition: block.h:105
const WarpedMotionParams * global_motion
Definition: blockd.h:841
int mode_rate_arr[MAX_INTER_MODES]
Definition: encoder.h:1129
Contains buffers used by av1_compound_type_rd()
Definition: block.h:372
IntraBCHashInfo intrabc_hash_info
Data structure to speed up intrabc search.
Definition: block.h:1169
WARP_SAMPLE_INFO warp_sample_info[REF_FRAMES]
Warp motion samples buffer.
Definition: block.h:1052
Stores the best performing modes.
Definition: block.h:82
Top level speed vs quality trade off data struture.
Definition: speed_features.h:1120
int64_t av1_rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, BLOCK_SIZE bsize, int64_t best_rd, PICK_MODE_CONTEXT *ctx)
Perform intra-mode search on luma channels for intra frames.
Definition: intra_mode_search.c:1153
int drl_mode_cost0[DRL_MODE_CONTEXTS][2]
drl_mode_cost0
Definition: block.h:649
uint16_t weight[MODE_CTX_REF_FRAMES][USABLE_REF_MV_STACK_SIZE]
The weights used to compute the ref mvs.
Definition: block.h:201
FullMvLimits mv_limits
Limit for the range of motion vectors.
Definition: block.h:1194
static int64_t motion_mode_rd(const AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *const x, BLOCK_SIZE bsize, RD_STATS *rd_stats, RD_STATS *rd_stats_y, RD_STATS *rd_stats_uv, HandleInterModeArgs *const args, int64_t ref_best_rd, int64_t *ref_skip_rd, int *rate_mv, const BUFFER_SET *orig_dst, int64_t *best_est_rd, int do_tx_search, InterModesInfo *inter_modes_info, int eval_motion_mode, int64_t *yrd)
AV1 motion mode search.
Definition: rdopt.c:1258
INTER_MODE_SPEED_FEATURES inter_sf
Definition: speed_features.h:1149
Extended mode info derived from mbmi.
Definition: block.h:196
BLOCK_SIZE bsize
The block size of the current coding block.
Definition: blockd.h:222
int picked_ref_frames_mask[MAX_MIB_SIZE *MAX_MIB_SIZE]
Reference frames picked by the square subblocks in a superblock.
Definition: block.h:1060
PARTITION_TYPE partition
The partition type of the current coding block.
Definition: blockd.h:224
RD_STATS rd_cost
Rdstats of the winner mode.
Definition: block.h:86
int rate_uv
Chroma rate of the winner mode.
Definition: block.h:92
RD_STATS rd_cost_arr[MAX_INTER_MODES]
Definition: encoder.h:1145
MOTION_MODE motion_mode
The motion mode used by the inter prediction.
Definition: blockd.h:244
RD_OPT rd
Definition: encoder.h:2268
int show_frame
Definition: av1_common_int.h:862
int best_pred_mv_sad
The minimum of pred_mv_sad.
Definition: block.h:1038
uint8_t ref_mv_count[MODE_CTX_REF_FRAMES]
Number of ref mvs in the drl.
Definition: block.h:203
int rate_y
Luma rate of the winner mode.
Definition: block.h:90
int8_t nearest_future_ref
Definition: encoder.h:1800
CommonQuantParams quant_params
Definition: av1_common_int.h:899
YV12 frame buffer data structure.
Definition: yv12config.h:38
static int64_t handle_inter_mode(AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *x, BLOCK_SIZE bsize, RD_STATS *rd_stats, RD_STATS *rd_stats_y, RD_STATS *rd_stats_uv, HandleInterModeArgs *args, int64_t ref_best_rd, uint8_t *const tmp_buf, const CompoundTypeRdBuffers *rd_buffers, int64_t *best_est_rd, const int do_tx_search, InterModesInfo *inter_modes_info, motion_mode_candidate *motion_mode_cand, int64_t *skip_rd, PruneInfoFromTpl *inter_cost_info_from_tpl, int64_t *yrd)
AV1 inter mode RD computation.
Definition: rdopt.c:2578
PREDICTION_MODE mode
The prediction mode used.
Definition: blockd.h:226
int pts[16]
Sample locations in current frame.
Definition: block.h:819
WarpedMotionParams global_motion[REF_FRAMES]
Definition: av1_common_int.h:947
int_mv mv[2]
The motion vectors used by the current inter mode.
Definition: blockd.h:238
static void search_intra_modes_in_interframe(InterModeSearchState *search_state, const AV1_COMP *cpi, MACROBLOCK *x, RD_STATS *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx, InterModeSFArgs *sf_args, unsigned int intra_ref_frame_cost, int64_t yrd_threshold)
Search intra modes in interframes.
Definition: rdopt.c:5001
bool allow_warped_motion
Definition: av1_common_int.h:353
struct buf_2d src
A buffer containing the source frame.
Definition: block.h:117
RATE_CONTROL rc
Definition: encoder.h:2294
uint8_t * tmp_pred_bufs[2]
Temporary buffer to hold prediction.
Definition: block.h:922
int refmv_mode_cost[REFMV_MODE_CONTEXTS][2]
refmv_mode_cost
Definition: block.h:647
int comp_ref_type_cost[COMP_REF_TYPE_CONTEXTS][((COMP_REFERENCE_TYPES)+1)]
comp_ref_type_cost
Definition: block.h:662
int base_qindex
Definition: av1_common_int.h:586
int must_find_valid_partition
Whether to disable some features to force a mode in current block.
Definition: block.h:1086
bool switchable_motion_mode
Definition: av1_common_int.h:381
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:723
Superblock level encoder info.
Definition: block.h:54
int64_t sse_arr[MAX_INTER_MODES]
Definition: encoder.h:1133
THR_MODES mode_index
The current winner mode.
Definition: block.h:96
int ref_frame_flags
Definition: encoder.h:2304
int thresh_freq_fact[BLOCK_SIZES_ALL][MAX_MODES]
Factors used for rd-thresholding.
Definition: block.h:1107
INTRA_MODE_SPEED_FEATURES intra_sf
Definition: speed_features.h:1159
int lossless[8]
Definition: blockd.h:815
Struct used to hold TPL data to narrow down parts of the inter mode search.
Definition: rdopt.c:2159
AlgoCfg algo_cfg
Definition: encoder.h:817
int av1_search_intra_uv_modes_in_interframe(IntraModeSearchState *intra_search_state, const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, RD_STATS *rd_stats, const RD_STATS *rd_stats_y, RD_STATS *rd_stats_uv, int64_t best_rd)
Search through all chroma intra-modes for inter frames.
Definition: intra_mode_search.c:1093
MB_MODE_INFO mbmi
Definition: rdopt.c:2065
uint8_t num_proj_ref
Number of samples used by warp causal.
Definition: blockd.h:246
#define MAX_WINNER_MODE_COUNT_INTER
Number of inter winner modes kept.
Definition: block.h:42
BLOCK_SIZE mi_alloc_bsize
Definition: av1_common_int.h:526
TxfmSearchInfo txfm_search_info
Results of the txfm searches that have been done.
Definition: block.h:1213
int_mv global_mvs[REF_FRAMES]
Global mvs.
Definition: block.h:225
int nmv_joint_cost[4]
Costs for coding the zero components.
Definition: block.h:766
TX_MODE tx_mode_search_type
How to search for the optimal tx_size.
Definition: block.h:468
unsigned int pred_sse[REF_FRAMES]
SSE of the current predictor.
Definition: block.h:1230
int_mv global_mvs[REF_FRAMES]
Global mvs.
Definition: block.h:205
int8_t skip_txfm
Whether to skip transforming and sending.
Definition: blockd.h:282
Motion mode information for inter mode search speedup.
Definition: rdopt.c:2061
uint8_t comp_group_idx
Indicates if masked compound is used(1) or not (0).
Definition: blockd.h:314
int newmv_mode_cost[NEWMV_MODE_CONTEXTS][2]
newmv_mode_cost
Definition: block.h:643
const MB_MODE_INFO * mb_mode_cache
The mode to reuse during av1_rd_pick_intra_mode_sb and av1_rd_pick_inter_mode.
Definition: block.h:1175
Stores various encoding/search decisions related to txfm search.
Definition: block.h:520
int single_ref_cost[REF_CONTEXTS][SINGLE_REFS - 1][2]
single_ref_cost
Definition: block.h:657
int mi_row
Definition: blockd.h:573
int64_t av1_interpolation_filter_search(MACROBLOCK *const x, const AV1_COMP *const cpi, const TileDataEnc *tile_data, BLOCK_SIZE bsize, const BUFFER_SET *const tmp_dst, const BUFFER_SET *const orig_dst, int64_t *const rd, int *const switchable_rate, int *skip_build_pred, HandleInterModeArgs *args, int64_t ref_best_rd)
AV1 interpolation filter search.
Definition: interp_search.c:648
uint8_t tpl_stats_block_mis_log2
Definition: tpl_model.h:133
int inter_compound_mode_cost[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES]
inter_compound_mode_cost
Definition: block.h:685
Stores the prediction/txfm mode of the current coding block.
Definition: blockd.h:216
uint8_t superres_scale_denominator
Definition: av1_common_int.h:780
static int64_t rd_pick_intrabc_mode_sb(const AV1_COMP *cpi, MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, RD_STATS *rd_stats, BLOCK_SIZE bsize, int64_t best_rd)
Search for the best intrabc predictor.
Definition: rdopt.c:2916
Holds mv costs for intrabc.
Definition: block.h:783
RD_STATS rd_cost_y_arr[MAX_INTER_MODES]
Definition: encoder.h:1149
Variables related to current coding block.
Definition: blockd.h:568
uint8_t compound_idx
How to blend the compound predictions.
Definition: block.h:1149
int skip_mode_cost[SKIP_MODE_CONTEXTS][2]
skip_mode_cost
Definition: block.h:641
int intra_inter_cost[INTRA_INTER_CONTEXTS][2]
intra_inter_cost
Definition: block.h:683
MACROBLOCKD e_mbd
Decoder's view of current coding block.
Definition: block.h:864
int joint_mv[4]
Definition: block.h:785
int mi_cols
Definition: av1_common_int.h:503
int av1_handle_intra_y_mode(IntraModeSearchState *intra_search_state, const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, unsigned int ref_frame_cost, const PICK_MODE_CONTEXT *ctx, RD_STATS *rd_stats_y, int64_t best_rd, int *mode_cost_y, int64_t *rd_y)
Evaluate a given luma intra-mode for inter frames.
Definition: intra_mode_search.c:1005
TxfmSearchParams txfm_search_params
Parameters that control how motion search is done.
Definition: block.h:1206
RD_STATS rd_cost_uv_arr[MAX_INTER_MODES]
Definition: encoder.h:1153
int winner_mode_count
Tracks how many winner modes there are.
Definition: block.h:1119
CANDIDATE_MV ref_mv_stack[MODE_CTX_REF_FRAMES][MAX_REF_MV_STACK_SIZE]
Definition: blockd.h:774
uint8_t segment_id
The segment id.
Definition: blockd.h:304
int width
Definition: av1_common_int.h:748
int64_t tpl_intra_cost[(128/16) *(128/16)]
TPL's estimate of tpl cost for each tpl block.
Definition: block.h:72
bool left_available
Definition: blockd.h:624
int mi_stride
Definition: blockd.h:580
AV1EncoderConfig oxcf
Definition: encoder.h:2143
TplDepFrame * tpl_frame
Definition: tpl_model.h:163
SequenceHeader seq_params
Definition: av1_common_int.h:953
RefFrameDistanceInfo ref_frame_dist_info
Definition: encoder.h:2592
ModeCosts mode_costs
The rate needed to signal a mode to the bitstream.
Definition: block.h:959
MV_SPEED_FEATURES mv_sf
Definition: speed_features.h:1144
TX_SIZE inter_tx_size[INTER_TX_SIZE_BUF_LEN]
Transform size when recursive txfm tree is on.
Definition: blockd.h:286
bool allow_high_precision_mv
Definition: av1_common_int.h:343
struct macroblockd_plane plane[3]
Definition: blockd.h:604
uint8_t ref_mv_count
Number of ref mvs in the drl.
Definition: block.h:222
TileInfo tile
Definition: blockd.h:609
int motion_mode_cost1[BLOCK_SIZES_ALL][2]
motion_mode_cost1
Definition: block.h:715
Declares high level functions to search through intra modes.
MB_MODE_INFO mbmi_arr[MAX_INTER_MODES]
Definition: encoder.h:1125
FeatureFlags features
Definition: av1_common_int.h:882
CurrentFrame current_frame
Definition: av1_common_int.h:727
int tpl_stride
TPL's stride for the arrays in this struct.
Definition: block.h:76
int32_t * mask
A new mask constructed from the original horz/vert mask.
Definition: block.h:345
CompoundTypeRdBuffers comp_rd_buffer
Buffer used for compound_type_rd().
Definition: block.h:909
int intra_uv_mode_cost[CFL_ALLOWED_TYPES][INTRA_MODES][UV_INTRA_MODES]
Chroma mode cost.
Definition: block.h:601
uint16_t weight[MODE_CTX_REF_FRAMES][MAX_REF_MV_STACK_SIZE]
Definition: blockd.h:779
CommonModeInfoParams mi_params
Definition: av1_common_int.h:887
unsigned int source_variance
Variance of the source frame.
Definition: block.h:1228
Refrence frame distance related variables.
Definition: encoder.h:1788
Encoder's parameters related to the current coding block.
Definition: block.h:846
uint8_t * tx_type_map
Definition: blockd.h:664
MB_MODE_INFO ** mi
Definition: blockd.h:615
int rate_mv
Definition: rdopt.c:2069
int skip_txfm_cost[SKIP_CONTEXTS][2]
skip_txfm_cost
Definition: block.h:725
static int process_compound_inter_mode(AV1_COMP *const cpi, MACROBLOCK *x, HandleInterModeArgs *args, int64_t ref_best_rd, int_mv *cur_mv, BLOCK_SIZE bsize, int *compmode_interinter_cost, const CompoundTypeRdBuffers *rd_buffers, const BUFFER_SET *orig_dst, const BUFFER_SET *tmp_dst, int *rate_mv, RD_STATS *rd_stats, int64_t *skip_rd, int *skip_build_pred)
High level function to select parameters for compound mode.
Definition: rdopt.c:2424
int64_t ref_inter_cost[INTER_REFS_PER_FRAME]
Definition: rdopt.c:2167
void av1_nonrd_pick_inter_mode_sb(struct AV1_COMP *cpi, struct TileDataEnc *tile_data, struct macroblock *x, struct RD_STATS *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx)
AV1 inter mode selection based on Non-RD optimized model.
Definition: nonrd_pickmode.c:2066
struct inter_modes_info * inter_modes_info
Stores the inter mode information needed to build an rd model.
Definition: block.h:1146