Commit 4778e8c745 for aom
commit 4778e8c745476f35d0a10a16dab15df9a1d14635
Author: Yunqing Wang <yunqingwang@google.com>
Date: Fri Sep 11 13:15:17 2026 -0700
Remove tune for VMAF without pre-processing
Removed the option "--tune=vmaf_without_preprocessing", which
doesn't perform well.
Bug: 560267484
Change-Id: I9eaa9cfa853a97667ecadf59ee9cab6c5830bbf7
diff --git a/aom/aomcx.h b/aom/aomcx.h
index d1aa4aeae0..4730fb0c89 100644
--- a/aom/aomcx.h
+++ b/aom/aomcx.h
@@ -1779,7 +1779,7 @@ typedef enum {
AOM_TUNE_SSIM = 1,
/* NOTE: enums 2 and 3 unused */
AOM_TUNE_VMAF_WITH_PREPROCESSING = 4,
- AOM_TUNE_VMAF_WITHOUT_PREPROCESSING = 5,
+ /* NOTE: enum 5 unused */
AOM_TUNE_VMAF_MAX_GAIN = 6,
AOM_TUNE_VMAF_NEG_MAX_GAIN = 7,
AOM_TUNE_BUTTERAUGLI = 8,
diff --git a/av1/arg_defs.c b/av1/arg_defs.c
index 9a3352c6cd..52f8400d99 100644
--- a/av1/arg_defs.c
+++ b/av1/arg_defs.c
@@ -43,7 +43,6 @@ static const struct arg_enum_list tuning_enum[] = {
{ "psnr", AOM_TUNE_PSNR },
{ "ssim", AOM_TUNE_SSIM },
{ "vmaf_with_preprocessing", AOM_TUNE_VMAF_WITH_PREPROCESSING },
- { "vmaf_without_preprocessing", AOM_TUNE_VMAF_WITHOUT_PREPROCESSING },
{ "vmaf", AOM_TUNE_VMAF_MAX_GAIN },
{ "vmaf_neg", AOM_TUNE_VMAF_NEG_MAX_GAIN },
{ "butteraugli", AOM_TUNE_BUTTERAUGLI },
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index b43c96d7a1..18922ad304 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -887,8 +887,7 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
#endif
#if !CONFIG_TUNE_VMAF
- if (extra_cfg->tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
- extra_cfg->tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
+ if (is_vmaf_tuning_mode(extra_cfg->tuning)) {
ERROR(
"This error may be related to the wrong configuration options: try to "
"set -DCONFIG_TUNE_VMAF=1 at the time CMake is run.");
@@ -3408,8 +3407,7 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
}
#if CONFIG_TUNE_VMAF
- if (ctx->extra_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
- ctx->extra_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
+ if (is_vmaf_tuning_mode(ctx->extra_cfg.tuning)) {
aom_init_vmaf_model(&ppi->cpi->vmaf_info.vmaf_model,
ppi->cpi->oxcf.tune_cfg.vmaf_model_path);
}
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 85931ead4f..6f9715c2df 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -1771,8 +1771,7 @@ int av1_encode_strategy(AV1_COMP *const cpi, size_t *const size,
#if CONFIG_TUNE_VMAF
if (!is_stat_generation_stage(cpi) &&
- (oxcf->tune_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
- oxcf->tune_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN)) {
+ is_vmaf_tuning_mode(oxcf->tune_cfg.tuning)) {
av1_update_vmaf_curve(cpi);
}
#endif
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 0a8750bcdd..4a30b9d8dd 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -3399,8 +3399,7 @@ static int encode_with_recode_loop(AV1_COMP *cpi, size_t *size, uint8_t *dest,
}
#if CONFIG_TUNE_VMAF
- if (oxcf->tune_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
- oxcf->tune_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
+ if (is_vmaf_tuning_mode(oxcf->tune_cfg.tuning)) {
cpi->vmaf_info.original_qindex = q;
q = av1_get_vmaf_base_qindex(cpi, q);
}
@@ -3604,8 +3603,7 @@ static int encode_with_recode_loop(AV1_COMP *cpi, size_t *size, uint8_t *dest,
}
#if CONFIG_TUNE_VMAF
- if (oxcf->tune_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
- oxcf->tune_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
+ if (is_vmaf_tuning_mode(oxcf->tune_cfg.tuning)) {
q = cpi->vmaf_info.original_qindex;
}
#endif
@@ -4333,8 +4331,7 @@ static int encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size, uint8_t *dest,
}
#endif
#if CONFIG_TUNE_VMAF
- else if (oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_WITHOUT_PREPROCESSING ||
- oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN ||
+ else if (oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN ||
oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_NEG_MAX_GAIN) {
av1_set_mb_vmaf_rdmult_scaling(cpi);
}
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index c0ee4e7353..9f4a111894 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -4455,6 +4455,13 @@ static inline int is_psnr_calc_enabled(const AV1_COMP *cpi) {
cm->show_frame && !cpi->is_dropped_frame;
}
+// Check if VMAF tuning is enabled.
+static inline int is_vmaf_tuning_mode(const aom_tune_metric tuning) {
+ return tuning == AOM_TUNE_VMAF_WITH_PREPROCESSING ||
+ tuning == AOM_TUNE_VMAF_MAX_GAIN ||
+ tuning == AOM_TUNE_VMAF_NEG_MAX_GAIN;
+}
+
static inline int is_frame_resize_pending(const AV1_COMP *const cpi) {
const ResizePendingParams *const resize_pending_params =
&cpi->resize_pending_params;
diff --git a/av1/encoder/partition_search.c b/av1/encoder/partition_search.c
index b5f1d6a6f1..c038838bc0 100644
--- a/av1/encoder/partition_search.c
+++ b/av1/encoder/partition_search.c
@@ -637,8 +637,7 @@ static void setup_block_rdmult(const AV1_COMP *const cpi, MACROBLOCK *const x,
}
#endif
#if CONFIG_TUNE_VMAF
- else if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_WITHOUT_PREPROCESSING ||
- cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN ||
+ else if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN ||
cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_NEG_MAX_GAIN) {
av1_set_vmaf_rdmult(cpi, x, bsize, mi_row, mi_col, &x->rdmult);
}
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index 7af5bcf540..36775ffe16 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -4541,8 +4541,7 @@ void av1_twopass_postencode_update(AV1_COMP *cpi) {
p_rc->active_best_quality[i] = cpi->common.quant_params.base_qindex;
#if CONFIG_TUNE_VMAF
if (cpi->vmaf_info.original_qindex != -1 &&
- (cpi->oxcf.tune_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
- cpi->oxcf.tune_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN)) {
+ is_vmaf_tuning_mode(cpi->oxcf.tune_cfg.tuning)) {
p_rc->active_best_quality[i] = cpi->vmaf_info.original_qindex;
}
#endif