 |
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);
166 void av1_inter_mode_data_init(
struct TileDataEnc *tile_data);
167 void av1_inter_mode_data_fit(TileDataEnc *tile_data,
int rdmult);
169 static INLINE
int coded_to_superres_mi(
int mi_col,
int denom) {
170 return (mi_col * denom + SCALE_NUMERATOR / 2) / SCALE_NUMERATOR;
173 static INLINE
int av1_encoder_get_relative_dist(
int a,
int b) {
174 assert(a >= 0 && b >= 0);
179 static INLINE
int av1_get_sb_mi_size(
const AV1_COMMON *
const cm) {
182 (mi_size_wide[cm->
seq_params->sb_size] + mi_alloc_size_1d - 1) /
184 assert(mi_size_wide[cm->
seq_params->sb_size] ==
186 int sb_mi_size = sb_mi_rows * sb_mi_rows;
194 static INLINE
void av1_copy_usable_ref_mv_stack_and_weight(
196 MV_REFERENCE_FRAME ref_frame) {
197 memcpy(mbmi_ext->
weight[ref_frame], xd->
weight[ref_frame],
198 USABLE_REF_MV_STACK_SIZE *
sizeof(xd->
weight[0][0]));
200 USABLE_REF_MV_STACK_SIZE *
sizeof(xd->
ref_mv_stack[0][0]));
205 static INLINE
int prune_ref(
const MV_REFERENCE_FRAME *
const ref_frame,
206 const unsigned int *
const ref_display_order_hint,
207 const unsigned int frame_display_order_hint,
208 const int *ref_frame_list) {
209 for (
int i = 0; i < 2; i++) {
210 if (ref_frame_list[i] == NONE_FRAME)
continue;
212 if (ref_frame[0] == ref_frame_list[i] ||
213 ref_frame[1] == ref_frame_list[i]) {
214 if (av1_encoder_get_relative_dist(
215 ref_display_order_hint[ref_frame_list[i] - LAST_FRAME],
216 frame_display_order_hint) < 0)
223 static INLINE
int prune_ref_by_selective_ref_frame(
225 const MV_REFERENCE_FRAME *
const ref_frame,
226 const unsigned int *
const ref_display_order_hint) {
228 if (!sf->
inter_sf.selective_ref_frame)
return 0;
230 const int comp_pred = ref_frame[1] > INTRA_FRAME;
232 if (sf->
inter_sf.selective_ref_frame >= 2 ||
233 (sf->
inter_sf.selective_ref_frame == 1 && comp_pred)) {
234 int ref_frame_list[2] = { LAST3_FRAME, LAST2_FRAME };
241 ref_frame_list[0] = NONE_FRAME;
245 ref_frame_list[1] = NONE_FRAME;
249 if (prune_ref(ref_frame, ref_display_order_hint,
250 ref_display_order_hint[GOLDEN_FRAME - LAST_FRAME],
255 if (sf->
inter_sf.selective_ref_frame >= 3) {
256 int ref_frame_list[2] = { ALTREF2_FRAME, BWDREF_FRAME };
263 ref_frame_list[0] = NONE_FRAME;
267 ref_frame_list[1] = NONE_FRAME;
271 if (prune_ref(ref_frame, ref_display_order_hint,
272 ref_display_order_hint[LAST_FRAME - LAST_FRAME],
282 static INLINE
void av1_copy_mbmi_ext_to_mbmi_ext_frame(
286 sizeof(mbmi_ext->
ref_mv_stack[USABLE_REF_MV_STACK_SIZE]));
287 memcpy(mbmi_ext_best->
weight, mbmi_ext->
weight[ref_frame_type],
288 sizeof(mbmi_ext->
weight[USABLE_REF_MV_STACK_SIZE]));
299 #endif // AOM_AV1_ENCODER_RDOPT_H_
int mb_to_left_edge
Definition: blockd.h:684
uint8_t * left_pred
Prediction from the up predictor.
Definition: block.h:323
REAL_TIME_SPEED_FEATURES rt_sf
Definition: speed_features.h:1457
bool enable_angle_delta
Definition: encoder.h:330
FrameProbInfo frame_probs
Definition: encoder.h:2618
uint8_t tpl_bsize_1d
Definition: tpl_model.h:153
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:411
OBMCBuffer obmc_buffer
Modified source and masks used for fast OBMC search.
Definition: block.h:837
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:686
WarpedMotionParams wm_params
The parameters used in warp motion mode.
Definition: blockd.h:257
Variables related to intra-mode search during inter frame coding.
Definition: intra_mode_search.h:31
Frame level features.
Definition: av1_common_int.h:362
int ** mv_cost_stack
Points to the nmv_cost_hp in use.
Definition: block.h:701
IntraBCMVCosts * dv_costs
Definition: block.h:900
uint8_t ref_mv_idx
Which ref_mv to use.
Definition: blockd.h:314
int zeromv_mode_cost[GLOBALMV_MODE_CONTEXTS][2]
zeromv_mode_cost
Definition: block.h:569
Holds the entropy costs for various modes sent to the bitstream.
Definition: block.h:507
struct macroblock_plane plane[3]
Each of the encoding plane.
Definition: block.h:788
Contains buffers used to speed up rdopt for obmc.
Definition: block.h:303
TX_SIZE tx_size
Transform size when fixed size txfm is used (e.g. intra modes).
Definition: blockd.h:290
Holds the motion samples for warp motion model estimation.
Definition: block.h:739
int8_t angle_delta[PLANE_TYPES]
Directional mode delta: the angle is base angle + (angle_delta * step).
Definition: blockd.h:272
Declares functions used in palette search.
int num
Definition: encoder.h:1222
int comp_ref_cost[REF_CONTEXTS][FWD_REFS - 1][2]
Cost for signaling ref_frame[0] in bidir-comp mode.
Definition: block.h:594
uint8_t height
Definition: blockd.h:773
int skip_motion_mode
Definition: rdopt.c:2120
int comp_inter_cost[COMP_INTER_CONTEXTS][2]
comp_inter_cost
Definition: block.h:583
#define AOM_PLANE_Y
Definition: aom_image.h:199
PARTITION_SPEED_FEATURES part_sf
Definition: speed_features.h:1412
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:465
int_interpfilters interp_filters
Filter used in subpel interpolation.
Definition: blockd.h:248
Defines utility functions used in intra mode search.
MB_MODE_INFO_EXT mbmi_ext
Derived coding information.
Definition: block.h:803
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:532
bool enable_tpl_model
Definition: encoder.h:833
MB_MODE_INFO * above_mbmi
Definition: blockd.h:652
uint8_t width
Definition: blockd.h:772
Defines the parameters used to perform txfm search.
Definition: block.h:393
FILTER_INTRA_MODE_INFO filter_intra_mode_info
The type of filter intra mode used (if applicable).
Definition: blockd.h:274
#define AOM_PLANE_U
Definition: aom_image.h:200
int mi_col
Definition: blockd.h:583
int speed
Definition: encoder.h:2828
int mb_to_bottom_edge
Definition: blockd.h:687
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:2204
SPEED_FEATURES sf
Definition: encoder.h:2833
int rate2_nocoeff
Definition: rdopt.c:2114
int interintra_cost[4][2]
interintra_cost
Definition: block.h:615
unsigned char gf_frame_index
Definition: encoder.h:2864
int skip_txfm
Whether to skip transform and quantization on a partition block level.
Definition: block.h:456
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:5623
SuperBlockEnc sb_enc
Information on a whole superblock level.
Definition: block.h:950
int arnr_max_frames
Definition: encoder.h:815
struct segmentation seg
Definition: av1_common_int.h:932
Encoder flags for intra prediction.
Definition: encoder.h:295
bool cur_frame_force_integer_mv
Definition: av1_common_int.h:375
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:3282
GF_GROUP gf_group
Definition: encoder.h:2453
int bd
Definition: blockd.h:815
KeyFrameCfg kf_cfg
Definition: encoder.h:911
int prune_ref_frame_mask
Definition: encoder.h:3016
bool is_chroma_ref
Definition: blockd.h:608
WinnerModeStats * winner_mode_stats
Tracks the winner modes in the current coding block.
Definition: block.h:1053
bool up_available
Definition: blockd.h:629
static void init_intra_mode_search_state(IntraModeSearchState *intra_search_state)
Initializes the IntraModeSearchState struct.
Definition: intra_mode_search.h:264
Params related to temporal dependency model.
Definition: tpl_model.h:139
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:1713
bool allow_screen_content_tools
Definition: av1_common_int.h:379
RefCntBuffer * cur_frame
Definition: av1_common_int.h:837
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:883
int motion_mode_cost[BLOCK_SIZES_ALL][MOTION_MODES]
motion_mode_cost
Definition: block.h:637
MB_MODE_INFO * left_mbmi
Definition: blockd.h:647
int num
Number of samples.
Definition: block.h:741
Top level encoder structure.
Definition: encoder.h:2632
PartitionSearchInfo part_search_info
Stores some partition-search related buffers.
Definition: block.h:1013
int64_t est_rd_arr[MAX_INTER_MODES]
Definition: encoder.h:1238
int64_t rd_cost
Definition: rdopt.c:2124
RdIdxPair rd_idx_pair_arr[MAX_INTER_MODES]
Definition: encoder.h:1242
uint8_t compound_idx
Indicates whether dist_wtd_comp(0) is used or not (0).
Definition: blockd.h:322
int height
Definition: av1_common_int.h:781
TplParams tpl_data
Definition: encoder.h:2551
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:866
uint8_t tpl_keep_ref_frame[REF_FRAMES]
Disables certain ref frame pruning based on tpl.
Definition: block.h:982
uint8_t use_intrabc
Whether intrabc is used.
Definition: blockd.h:318
int mb_to_right_edge
Definition: blockd.h:685
INTERINTRA_MODE interintra_mode
The type of intra mode used by inter-intra.
Definition: blockd.h:259
int comp_bwdref_cost[REF_CONTEXTS][BWD_REFS - 1][2]
Cost for signaling ref_frame[1] in bidir-comp mode.
Definition: block.h:599
PALETTE_MODE_INFO palette_mode_info
Stores the size and colors of palette mode.
Definition: blockd.h:280
int ref_relative_dist[INTER_REFS_PER_FRAME]
Definition: encoder.h:2000
int32_t * wsrc
A new source weighted with the above and left predictors.
Definition: block.h:308
int intrabc_cost[2]
intrabc_cost
Definition: block.h:542
bool enable_intrabc
Definition: encoder.h:497
uint8_t * above_pred
Prediction from the up predictor.
Definition: block.h:318
search_site_config search_site_cfg[SS_CFG_TOTAL][NUM_DISTINCT_SEARCH_METHODS]
Definition: encoder.h:1964
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:895
SequenceHeader * seq_params
Definition: av1_common_int.h:981
int obmc_probs[FRAME_UPDATE_TYPES][BLOCK_SIZES_ALL]
Definition: encoder.h:1067
int all_one_sided_refs
Definition: encoder.h:2844
uint8_t skip_mode
Inter skip mode.
Definition: blockd.h:316
AV1_COMMON common
Definition: encoder.h:2675
int pred_mv_sad[REF_FRAMES]
Sum absolute distortion of the predicted mv for each ref frame.
Definition: block.h:968
MV_REFERENCE_FRAME ref_frame[2]
The reference frames for the MV.
Definition: blockd.h:246
UV_PREDICTION_MODE uv_mode
The UV mode when intra is used.
Definition: blockd.h:234
INTERINTER_COMPOUND_DATA interinter_comp
Struct that stores the data used in interinter compound mode.
Definition: blockd.h:263
int mv_step_param
Definition: encoder.h:1948
Each source plane of the current macroblock.
Definition: block.h:103
int mb_to_top_edge
Definition: blockd.h:686
int superres_upscaled_width
Definition: av1_common_int.h:804
const YV12_BUFFER_CONFIG * cur_buf
Definition: blockd.h:702
int uni_comp_ref_cost[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1][((2)+1)]
uni_comp_ref_cost
Definition: block.h:589
int * dv_costs[2]
Definition: block.h:719
int pts_inref[16]
Sample location in the reference frame.
Definition: block.h:745
MotionVectorSearchParams mv_search_params
Definition: encoder.h:2838
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:840
int comp_rd_stats_idx
The idx for the latest compound mode in the cache comp_rd_stats.
Definition: block.h:1090
int use_mb_mode_cache
Whether to reuse the mode stored in mb_mode_cache.
Definition: block.h:1108
int frames_since_golden
Definition: ratectrl.h:152
bool enable_smooth_intra
Definition: encoder.h:308
CANDIDATE_MV ref_mv_stack[USABLE_REF_MV_STACK_SIZE]
The reference mv list for the current block.
Definition: block.h:218
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:1447
Struct used to hold inter mode data for fast tx search.
Definition: encoder.h:1217
int mi_rows
Definition: av1_common_int.h:526
int tpl_data_count
Number of TPL blocks in this superblock.
Definition: block.h:68
int8_t nearest_past_ref
Definition: encoder.h:2004
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:850
int mode_rate_arr[MAX_INTER_MODES]
Definition: encoder.h:1230
Contains buffers used by av1_compound_type_rd()
Definition: block.h:340
IntraBCHashInfo intrabc_hash_info
Data structure to speed up intrabc search.
Definition: block.h:1105
WARP_SAMPLE_INFO warp_sample_info[REF_FRAMES]
Warp motion samples buffer.
Definition: block.h:988
Stores the best performing modes.
Definition: block.h:82
Top level speed vs quality trade off data struture.
Definition: speed_features.h:1388
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:1213
int drl_mode_cost0[DRL_MODE_CONTEXTS][2]
drl_mode_cost0
Definition: block.h:573
uint16_t weight[MODE_CTX_REF_FRAMES][USABLE_REF_MV_STACK_SIZE]
The weights used to compute the ref mvs.
Definition: block.h:201
void set_y_mode_and_delta_angle(const int mode_idx, MB_MODE_INFO *const mbmi)
set the luma intra mode and delta angles for a given mode index. The total number of luma intra mode ...
Definition: intra_mode_search.c:326
FullMvLimits mv_limits
Limit for the range of motion vectors.
Definition: block.h:1139
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:1254
INTER_MODE_SPEED_FEATURES inter_sf
Definition: speed_features.h:1422
Extended mode info derived from mbmi.
Definition: block.h:196
BLOCK_SIZE bsize
The block size of the current coding block.
Definition: blockd.h:228
int picked_ref_frames_mask[MAX_MIB_SIZE *MAX_MIB_SIZE]
Reference frames picked by the square subblocks in a superblock.
Definition: block.h:996
PARTITION_TYPE partition
The partition type of the current coding block.
Definition: blockd.h:230
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:1246
MOTION_MODE motion_mode
The motion mode used by the inter prediction.
Definition: blockd.h:250
RD_OPT rd
Definition: encoder.h:2787
int show_frame
Definition: av1_common_int.h:890
int best_pred_mv_sad
The minimum of pred_mv_sad.
Definition: block.h:970
uint8_t ref_mv_count[MODE_CTX_REF_FRAMES]
Number of ref mvs in the drl.
Definition: block.h:203
GLOBAL_MOTION_SPEED_FEATURES gm_sf
Definition: speed_features.h:1407
int rate_y
Luma rate of the winner mode.
Definition: block.h:90
int8_t nearest_future_ref
Definition: encoder.h:2008
YV12 frame buffer data structure.
Definition: yv12config.h:39
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:2724
static int prune_zero_mv_with_sse(const aom_variance_fn_ptr_t *fn_ptr, const MACROBLOCK *x, BLOCK_SIZE bsize, const HandleInterModeArgs *args, int prune_zero_mv_with_sse)
Prunes ZeroMV Search Using Best NEWMV's SSE.
Definition: rdopt.c:2475
uint8_t variance_low[105]
Variance of the subblocks in the superblock.
Definition: block.h:386
PREDICTION_MODE mode
The prediction mode used.
Definition: blockd.h:232
int pts[16]
Sample locations in current frame.
Definition: block.h:743
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, int64_t *best_model_rd, int64_t top_intra_model_rd[])
Evaluate a given luma intra-mode for inter frames.
Definition: intra_mode_search.c:1052
WarpedMotionParams global_motion[REF_FRAMES]
Definition: av1_common_int.h:975
int_mv mv[2]
The motion vectors used by the current inter mode.
Definition: blockd.h:244
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:5327
bool allow_warped_motion
Definition: av1_common_int.h:381
struct buf_2d src
A buffer containing the source frame.
Definition: block.h:117
RATE_CONTROL rc
Definition: encoder.h:2813
uint8_t * tmp_pred_bufs[2]
Temporary buffer to hold prediction.
Definition: block.h:854
int refmv_mode_cost[REFMV_MODE_CONTEXTS][2]
refmv_mode_cost
Definition: block.h:571
int comp_ref_type_cost[COMP_REF_TYPE_CONTEXTS][((COMP_REFERENCE_TYPES)+1)]
comp_ref_type_cost
Definition: block.h:586
int must_find_valid_partition
Whether to disable some features to force a mode in current block.
Definition: block.h:1022
bool switchable_motion_mode
Definition: av1_common_int.h:409
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:755
Superblock level encoder info.
Definition: block.h:54
int64_t sse_arr[MAX_INTER_MODES]
Definition: encoder.h:1234
THR_MODES mode_index
The current winner mode.
Definition: block.h:96
int ref_frame_flags
Definition: encoder.h:2823
int thresh_freq_fact[BLOCK_SIZES_ALL][MAX_MODES]
Factors used for rd-thresholding.
Definition: block.h:1043
INTRA_MODE_SPEED_FEATURES intra_sf
Definition: speed_features.h:1432
int lossless[8]
Definition: blockd.h:824
Struct used to hold TPL data to narrow down parts of the inter mode search.
Definition: rdopt.c:2200
AlgoCfg algo_cfg
Definition: encoder.h:906
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:1153
MB_MODE_INFO mbmi
Definition: rdopt.c:2106
uint8_t num_proj_ref
Number of samples used by warp causal.
Definition: blockd.h:252
#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:554
TxfmSearchInfo txfm_search_info
Results of the txfm searches that have been done.
Definition: block.h:1158
bool enable_paeth_intra
Definition: encoder.h:312
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:690
TX_MODE tx_mode_search_type
How to search for the optimal tx_size.
Definition: block.h:434
unsigned int pred_sse[REF_FRAMES]
SSE of the current predictor.
Definition: block.h:1177
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:288
Motion mode information for inter mode search speedup.
Definition: rdopt.c:2102
static bool fast_interp_search(const AV1_COMP *cpi, MACROBLOCK *x, int mi_row, int mi_col, BLOCK_SIZE bsize)
Searches for interpolation filter in realtime mode during winner eval.
Definition: rdopt.c:2548
uint8_t comp_group_idx
Indicates if masked compound is used(1) or not (0).
Definition: blockd.h:320
#define AOM_PLANE_V
Definition: aom_image.h:201
int newmv_mode_cost[NEWMV_MODE_CONTEXTS][2]
newmv_mode_cost
Definition: block.h:567
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:1111
Stores various encoding/search decisions related to txfm search.
Definition: block.h:454
int single_ref_cost[REF_CONTEXTS][SINGLE_REFS - 1][2]
single_ref_cost
Definition: block.h:581
int mi_row
Definition: blockd.h:582
AV1_PRIMARY * ppi
Definition: encoder.h:2636
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:654
uint8_t tpl_stats_block_mis_log2
Definition: tpl_model.h:148
int inter_compound_mode_cost[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES]
inter_compound_mode_cost
Definition: block.h:609
Stores the prediction/txfm mode of the current coding block.
Definition: blockd.h:222
uint8_t superres_scale_denominator
Definition: av1_common_int.h:812
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:3090
Holds mv costs for intrabc.
Definition: block.h:707
RD_STATS rd_cost_y_arr[MAX_INTER_MODES]
Definition: encoder.h:1250
Variables related to current coding block.
Definition: blockd.h:577
uint8_t compound_idx
How to blend the compound predictions.
Definition: block.h:1085
int skip_mode_cost[SKIP_MODE_CONTEXTS][2]
skip_mode_cost
Definition: block.h:565
int intra_inter_cost[INTRA_INTER_CONTEXTS][2]
intra_inter_cost
Definition: block.h:607
MACROBLOCKD e_mbd
Decoder's view of current coding block.
Definition: block.h:796
int joint_mv[4]
Definition: block.h:709
int mi_cols
Definition: av1_common_int.h:531
TxfmSearchParams txfm_search_params
Parameters that control how motion search is done.
Definition: block.h:1151
RD_STATS rd_cost_uv_arr[MAX_INTER_MODES]
Definition: encoder.h:1254
int winner_mode_count
Tracks how many winner modes there are.
Definition: block.h:1055
CANDIDATE_MV ref_mv_stack[MODE_CTX_REF_FRAMES][MAX_REF_MV_STACK_SIZE]
Definition: blockd.h:783
uint8_t segment_id
The segment id.
Definition: blockd.h:310
int width
Definition: av1_common_int.h:780
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:633
int mi_stride
Definition: blockd.h:589
AV1EncoderConfig oxcf
Definition: encoder.h:2680
TplDepFrame * tpl_frame
Definition: tpl_model.h:184
RefFrameDistanceInfo ref_frame_dist_info
Definition: encoder.h:3094
ModeCosts mode_costs
The rate needed to signal a mode to the bitstream.
Definition: block.h:891
aom_variance_fn_ptr_t fn_ptr[BLOCK_SIZES_ALL]
Definition: encoder.h:2530
MV_SPEED_FEATURES mv_sf
Definition: speed_features.h:1417
TX_SIZE inter_tx_size[INTER_TX_SIZE_BUF_LEN]
Transform size when recursive txfm tree is on.
Definition: blockd.h:292
bool allow_high_precision_mv
Definition: av1_common_int.h:371
struct macroblockd_plane plane[3]
Definition: blockd.h:613
uint8_t ref_mv_count
Number of ref mvs in the drl.
Definition: block.h:222
TileInfo tile
Definition: blockd.h:618
int motion_mode_cost1[BLOCK_SIZES_ALL][2]
motion_mode_cost1
Definition: block.h:639
Declares high level functions to search through intra modes.
MB_MODE_INFO mbmi_arr[MAX_INTER_MODES]
Definition: encoder.h:1226
FeatureFlags features
Definition: av1_common_int.h:910
CurrentFrame current_frame
Definition: av1_common_int.h:759
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:313
CompoundTypeRdBuffers comp_rd_buffer
Buffer used for compound_type_rd().
Definition: block.h:841
int intra_uv_mode_cost[CFL_ALLOWED_TYPES][INTRA_MODES][UV_INTRA_MODES]
Chroma mode cost.
Definition: block.h:525
uint16_t weight[MODE_CTX_REF_FRAMES][MAX_REF_MV_STACK_SIZE]
Definition: blockd.h:788
CommonModeInfoParams mi_params
Definition: av1_common_int.h:915
unsigned int source_variance
Variance of the source frame.
Definition: block.h:1175
Refrence frame distance related variables.
Definition: encoder.h:1996
Encoder's parameters related to the current coding block.
Definition: block.h:778
uint8_t * tx_type_map
Definition: blockd.h:673
MB_MODE_INFO ** mi
Definition: blockd.h:624
int rate_mv
Definition: rdopt.c:2110
int skip_txfm_cost[SKIP_CONTEXTS][2]
skip_txfm_cost
Definition: block.h:649
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:2364
int64_t ref_inter_cost[INTER_REFS_PER_FRAME]
Definition: rdopt.c:2208
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:2242
struct inter_modes_info * inter_modes_info
Stores the inter mode information needed to build an rd model.
Definition: block.h:1082