Fix vmaf model initialization error when not set to tune=vmaf
BUG=aomedia:3021
Change-Id: I70431be1fab71c59b66d37813637170f5d78864b
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 0787c49..ab7a403 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -2492,8 +2492,11 @@
}
#if CONFIG_TUNE_VMAF
- aom_init_vmaf_model(&cpi->vmaf_info.vmaf_model,
- cpi->oxcf.tune_cfg.vmaf_model_path);
+ if (ctx->extra_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
+ ctx->extra_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
+ aom_init_vmaf_model(&cpi->vmaf_info.vmaf_model,
+ cpi->oxcf.tune_cfg.vmaf_model_path);
+ }
#endif
// Handle fixed keyframe intervals