summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2018-08-27 15:58:41 -0700
committerJingning Han <jingning@google.com>2018-09-01 03:49:50 +0000
commitcb338d452f81cb6004be662721a151faae06d737 (patch)
tree9b9d37b8c324e2b6fa43242945481374a252fb33 /vp9/encoder
parentfc905edb3a0f0330957094b2836ef8bf03573e04 (diff)
downloadlibvpx-cb338d452f81cb6004be662721a151faae06d737.tar
libvpx-cb338d452f81cb6004be662721a151faae06d737.tar.gz
libvpx-cb338d452f81cb6004be662721a151faae06d737.tar.bz2
libvpx-cb338d452f81cb6004be662721a151faae06d737.zip
Properly update the raw_src_frame for psnr calculation
Update the raw_src_frame to be the current input source frame in the show_existing_frame mode. Change-Id: Ia8edf49ca948c45ffe6c60556756b36124ab092a
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encoder.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 7f9f2c5d5..714c8a241 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3831,6 +3831,20 @@ static void save_encode_params(VP9_COMP *cpi) {
}
#endif
+static INLINE void set_raw_source_frame(VP9_COMP *cpi) {
+#ifdef ENABLE_KF_DENOISE
+ if (is_spatial_denoise_enabled(cpi)) {
+ cpi->raw_source_frame = vp9_scale_if_required(
+ cm, &cpi->raw_unscaled_source, &cpi->raw_scaled_source,
+ (oxcf->pass == 0), EIGHTTAP, 0);
+ } else {
+ cpi->raw_source_frame = cpi->Source;
+ }
+#else
+ cpi->raw_source_frame = cpi->Source;
+#endif
+}
+
static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
uint8_t *dest) {
VP9_COMMON *const cm = &cpi->common;
@@ -3844,7 +3858,10 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
? cpi->svc.downsample_filter_phase[cpi->svc.spatial_layer_id]
: 0;
- if (cm->show_existing_frame) return 1;
+ if (cm->show_existing_frame) {
+ if (is_psnr_calc_enabled(cpi)) set_raw_source_frame(cpi);
+ return 1;
+ }
// Flag to check if its valid to compute the source sad (used for
// scene detection and for superblock content state in CBR mode).
@@ -4123,7 +4140,10 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size,
int qrange_adj = 1;
#endif
- if (cm->show_existing_frame) return;
+ if (cm->show_existing_frame) {
+ if (is_psnr_calc_enabled(cpi)) set_raw_source_frame(cpi);
+ return;
+ }
set_size_independent_vars(cpi);