Address VQ issue in bug aomedia:3170
Add clamping on how much frame QP is allowed to increase in tune VMAF
presets '--tune=vmaf_without_preprocessing'. The fix addressed some
corner cases where QP offset can go very high without any clamp,
such that cause VQ drop significantly. Borg test results at speed=5
qmode are as below:
testset avg_psnr ovr_psnr ssim vmaf
hdres2 -0.301 -0.314 -0.304 -0.024
hdres -1.325 -1.459 -1.421 -0.06
Bug: aomedia:3170
Change-Id: I2d829e4bcc62d1acea7cafab73f0b92c171aecc9
diff --git a/av1/encoder/tune_vmaf.c b/av1/encoder/tune_vmaf.c
index 11c4df8..33b84d6 100644
--- a/av1/encoder/tune_vmaf.c
+++ b/av1/encoder/tune_vmaf.c
@@ -935,7 +935,8 @@
const double dvmaf = 26.11 * (1.0 - exp(-0.06 * motion));
const double dsse = dvmaf * approx_sse / approx_dvmaf;
- const double beta = approx_sse / (dsse + approx_sse);
+ // Clamping beta to address VQ issue (aomedia:3170).
+ const double beta = AOMMAX(approx_sse / (dsse + approx_sse), 0.5);
const int offset =
av1_get_deltaq_offset(cm->seq_params->bit_depth, current_qindex, beta);
int qindex = current_qindex + offset;