Commit da3a5a6209 for aom
commit da3a5a6209e446ebfd0a49fb34377afb84379a2d
Author: Remya Prakasan <remya.prakasan@ittiam.com>
Date: Wed Jun 17 13:19:46 2026 +0530
Invoke masked_compound_type_rd() for COMP_WEDGE
In this CL, a new speed feature
'enable_comp_wedge_search_using_model_rd' is introduced to
enable model RD based fast compound wedge mask search by
invoking the function masked_compound_type_rd(). The speed
feature is enabled for speed >=1.
Encoder performance results averaged over all resolutions are as
follows:
Instruction Count BD-Rate Loss(%)
cpu Reduction(%) avg.psnr ovr.psnr ssim vmaf vmaf_neg
1 10.064 0.0218 0.0242 0.0190 0.0174 0.0046
2 1.037 -0.1309 -0.1310 -0.1036 -0.1570 -0.1652
3 -0.108 -0.0410 -0.0440 -0.0267 -0.0580 -0.0549
STATS_CHANGED for speed = 1, 2, 3
Change-Id: I055e6ade9d800814f3f39d4abca2916f9753f64a
diff --git a/av1/encoder/compound_type.c b/av1/encoder/compound_type.c
index 23a912e205..3bfe78f468 100644
--- a/av1/encoder/compound_type.c
+++ b/av1/encoder/compound_type.c
@@ -1431,7 +1431,8 @@ int av1_compound_type_rd(const AV1_COMP *const cpi, MACROBLOCK *x,
// use spare buffer for following compound type try
if (cur_type == COMPOUND_AVERAGE) restore_dst_buf(xd, *tmp_dst, 1);
- } else if (cur_type == COMPOUND_WEDGE) {
+ } else if (!cpi->sf.inter_sf.enable_comp_wedge_search_using_model_rd &&
+ cur_type == COMPOUND_WEDGE) {
int best_mask_index = 0;
int best_wedge_sign = 0;
int_mv tmp_mv[2] = { mbmi->mv[0], mbmi->mv[1] };
@@ -1669,7 +1670,7 @@ int av1_compound_type_rd(const AV1_COMP *const cpi, MACROBLOCK *x,
} else {
// Handle masked compound types
bool eval_masked_comp_type = true;
- if (*rd != INT64_MAX) {
+ if (*rd != INT64_MAX && cur_type == COMPOUND_DIFFWTD) {
// Factors to control gating of compound type selection based on best
// approximate rd so far
const int max_comp_type_rd_threshold_mul =
@@ -1678,8 +1679,7 @@ int av1_compound_type_rd(const AV1_COMP *const cpi, MACROBLOCK *x,
const int max_comp_type_rd_threshold_div =
comp_type_rd_threshold_div[cpi->sf.inter_sf
.prune_comp_type_by_comp_avg];
- // Evaluate COMPOUND_WEDGE / COMPOUND_DIFFWTD if approximated cost is
- // within threshold
+ // Evaluate COMPOUND_DIFFWTD if approximated cost is within threshold.
const int64_t approx_rd = ((*rd / max_comp_type_rd_threshold_div) *
max_comp_type_rd_threshold_mul);
if (approx_rd >= ref_best_rd) eval_masked_comp_type = false;
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index fb7b817ad0..65189e2df6 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -1201,6 +1201,7 @@ static void set_good_speed_features_framesize_independent(
sf->inter_sf.skip_arf_compound = 1;
sf->inter_sf.prune_comp_using_best_single_mode_ref = 2;
sf->inter_sf.use_dist_wtd_comp_flag = DIST_WTD_COMP_DISABLED;
+ sf->inter_sf.enable_comp_wedge_search_using_model_rd = 1;
sf->interp_sf.use_interp_filter = 1;
sf->interp_sf.skip_model_rd_uv = 1;
@@ -2416,6 +2417,7 @@ static inline void init_inter_sf(INTER_MODE_SPEED_FEATURES *inter_sf) {
inter_sf->bias_obmc_mode_rd_scale_pct = 0.0f;
inter_sf->skip_cmp_using_top_cmp_avg_est_rd_lvl = 0;
inter_sf->skip_interinter_wedge_search_based_on_mse = 0;
+ inter_sf->enable_comp_wedge_search_using_model_rd = 0;
set_txfm_rd_gate_level(inter_sf->txfm_rd_gate_level, 0);
}
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index e884dade05..47ef9be7fc 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -1256,6 +1256,9 @@ typedef struct INTER_MODE_SPEED_FEATURES {
// Skip interinter wedge search based on MSE between the two predictors.
int skip_interinter_wedge_search_based_on_mse;
+
+ // Enable/disable model RD based fast compound wedge mask search.
+ int enable_comp_wedge_search_using_model_rd;
} INTER_MODE_SPEED_FEATURES;
typedef struct INTERP_FILTER_SPEED_FEATURES {