Commit b4b1914878 for aom
commit b4b1914878aa39c7a409dde81047038cbf70a370
Author: Diksha Singh <diksha.singh@ittiam.com>
Date: Mon Feb 16 11:45:22 2026 +0530
Skip redundant initializations in av1_rd_pick_inter_mode()
In `av1_rd_pick_inter_mode()`, init_mbmi() and set_ref_ptrs() were
called unconditionally prior to mode evaluation. However, these
intializations are redundant when `is_skip_inter_mode` is true.
In this patch, init_mbmi() and set_ref_ptrs() are only called when
mode evaluation is not skipped.
This change is bit-exact for all presets.
Encoder performance results averaged over all resolutions:
Encoder Instruction
CPU Count Reduction (%)
1 0.33
2 0.39
3 0.70
4 0.75
5 0.77
6 1.03
Change-Id: I88a5e027a1a41af8d9c0da45b5fb77897f27c14d
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 76490359d5..dde46f697f 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -6255,11 +6255,8 @@ void av1_rd_pick_inter_mode(struct AV1_COMP *cpi, struct TileDataEnc *tile_data,
ref_frame > INTRA_FRAME && second_ref_frame == NONE_FRAME;
const int comp_pred = second_ref_frame > INTRA_FRAME;
- init_mbmi(mbmi, this_mode, ref_frames, cm);
-
txfm_info->skip_txfm = 0;
sf_args.num_single_modes_processed += is_single_pred;
- set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
#if CONFIG_COLLECT_COMPONENT_TIMING
start_timing(cpi, skip_inter_mode_time);
#endif
@@ -6271,6 +6268,9 @@ void av1_rd_pick_inter_mode(struct AV1_COMP *cpi, struct TileDataEnc *tile_data,
#endif
if (is_skip_inter_mode) continue;
+ init_mbmi(mbmi, this_mode, ref_frames, cm);
+ set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
+
// Select prediction reference frames.
for (i = 0; i < num_planes; i++) {
xd->plane[i].pre[0] = yv12_mb[ref_frame][i];