Use unfiltered source frame for PSNR with denoiser
When CONFIG_VP9_TEMPORAL_DENOISING is enabled and noise_sensitivity > 0,
vp9_denoiser_denoise() filters cpi->Source in-place during encoding.
Previously, cpi->raw_source_frame pointed directly to cpi->Source unless
ENABLE_KF_DENOISE was defined, causing VPX_CODEC_PSNR_PKT and internal
PSNR stats to compare the reconstructed frame against the denoised
source rather than the original input frame.
Preserve the unfiltered input frame in cpi->raw_unscaled_source (and
cpi->raw_scaled_source when spatial scaling is active) when PSNR
calculation and temporal denoising are enabled, and point
cpi->raw_source_frame to the unfiltered buffer.
Change-Id: I5035c3407c39f63be7c7832a69c4cc2681361cdf
Bug: 571976041
3 files changed