Adjust RD mult for keyframe in Q mode
Use slightly lower RD multiplier for keyframe when the qindex is between
64 and 192 in fixed-q mode. The formula is experimentally selected.
It improves encoding quality metrics slightly.
Speed 1, PSNR
NO. frames lowres midres ugc360
50 -0.03% -0.09% 0%
100 0.00% -0.07% -0.04%
150 -0.03% -0.09% -0.03%
Speed 1, SSIM
NO. frames lowres midres ugc360
50 -0.23% -0.28% -0.09%
100 -0.10% -0.20% -0.14%
150 -0.15% -0.15% -0.02%
Speed 2, PSNR
NO. frames lowres midres ugc360
50 -0.02% -0.06% -0.07%
100 -0.01% -0.05% -0.05%
150 -0.02% -0.09% -0.03%
Speed 2, SSIM
NO. frames lowres midres ugc360
50 -0.31% -0.24% -0.12%
100 -0.14% -0.23% -0.17%
150 -0.15% -0.23% -0.13%
Change-Id: I06031a2eea6ce6154835dcc5170e63f0afcf3e2e
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 55ba611..a55471e 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -351,6 +351,12 @@
const int q = av1_dc_quant_QTX(qindex, 0, cpi->common.seq_params.bit_depth);
int rdmult = q * q;
rdmult = rdmult * 3 + (rdmult * 2 / 3);
+ if (frame_is_intra_only(&cpi->common) && cpi->oxcf.rc_mode == AOM_Q &&
+ qindex > 64 && qindex <= 192) {
+ // Formula is picked experimentally.
+ rdmult = rdmult * 13 / 4;
+ }
+
switch (cpi->common.seq_params.bit_depth) {
case AOM_BITS_8: break;
case AOM_BITS_10: rdmult = ROUND_POWER_OF_TWO(rdmult, 4); break;