Quality Regression with Overlay Frames
After !1723 (merged) was merged, when enabling overlay frames, the PSNR for lower QP value encodes in preset 3 seemed quite good with the PSNR in a QP 20 aspen_1080p_60f encode being 43.816265. However, in the current master 3ff42050 the PSNR is now 37.758299 for the same encode.
Looking at the PSNR logs produced by ffmpeg, it seems that there are large differences in frames 58 and 60 (excerpt from the last 10 frames, full PSNR log attachedoutput.psnr):
n:50 mse_avg:2.10 mse_y:2.71 mse_u:1.02 mse_v:0.76 psnr_avg:44.91 psnr_y:43.81 psnr_u:48.05 psnr_v:49.34
n:51 mse_avg:1.92 mse_y:2.43 mse_u:1.01 mse_v:0.77 psnr_avg:45.30 psnr_y:44.27 psnr_u:48.08 psnr_v:49.26
n:52 mse_avg:2.26 mse_y:2.91 mse_u:1.11 mse_v:0.84 psnr_avg:44.59 psnr_y:43.50 psnr_u:47.68 psnr_v:48.89
n:53 mse_avg:2.44 mse_y:3.16 mse_u:1.16 mse_v:0.85 psnr_avg:44.25 psnr_y:43.13 psnr_u:47.50 psnr_v:48.86
n:54 mse_avg:2.25 mse_y:2.88 mse_u:1.11 mse_v:0.84 psnr_avg:44.61 psnr_y:43.53 psnr_u:47.69 psnr_v:48.88
n:55 mse_avg:1.92 mse_y:2.41 mse_u:1.05 mse_v:0.82 psnr_avg:45.30 psnr_y:44.31 psnr_u:47.91 psnr_v:49.00
n:56 mse_avg:2.17 mse_y:2.77 mse_u:1.08 mse_v:0.82 psnr_avg:44.77 psnr_y:43.70 psnr_u:47.80 psnr_v:49.00
n:57 mse_avg:2.16 mse_y:2.79 mse_u:1.03 mse_v:0.80 psnr_avg:44.78 psnr_y:43.68 psnr_u:47.99 psnr_v:49.11
n:58 mse_avg:170.92 mse_y:240.00 mse_u:52.02 mse_v:13.48 psnr_avg:25.80 psnr_y:24.33 psnr_u:30.97 psnr_v:36.83
n:59 mse_avg:1.95 mse_y:2.44 mse_u:1.10 mse_v:0.86 psnr_avg:45.23 psnr_y:44.26 psnr_u:47.72 psnr_v:48.79
n:60 mse_avg:180.87 mse_y:257.55 mse_u:42.65 mse_v:12.38 psnr_avg:25.56 psnr_y:24.02 psnr_u:31.83 psnr_v:37.20
The command line used for the encoder was:
./SvtAv1EncApp -enc-mode 3 -q 20 --enable-overlays 1 -intra-period -1 -lp 1 -i aspen_1080p_60f.y4m -b output.ivf
The command line used to get the PSNR was:
tools/ffmpeg -r 25 -i output.ivf -r 25 -i aspen_1080p_60f.y4m -lavfi "[0:v][1:v]psnr=stats_file=output.psnr" -f null -
After bisecting the issue, I found that the issue began in the commit introduced in !1729 (merged).