summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2019-04-02 18:01:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-04-02 18:01:26 +0000
commit39ea3d72f5751ff09f7ac0e7b9dfe61b247ddeae (patch)
tree2cfd05431ce4839a2b9c97b1e9239083c61d4369
parentf67b2b8929e2edd242c68a3aeac555f1e79587ab (diff)
parentce9e52b13c9f1d1e356d3061877e661b5ab1f4da (diff)
downloadlibvpx-39ea3d72f5751ff09f7ac0e7b9dfe61b247ddeae.tar
libvpx-39ea3d72f5751ff09f7ac0e7b9dfe61b247ddeae.tar.gz
libvpx-39ea3d72f5751ff09f7ac0e7b9dfe61b247ddeae.tar.bz2
libvpx-39ea3d72f5751ff09f7ac0e7b9dfe61b247ddeae.zip
Merge "vp9-rtc: Move noise estimation to after scene change detection"
-rw-r--r--vp9/encoder/vp9_encoder.c3
-rw-r--r--vp9/encoder/vp9_noise_estimate.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 03e8ed674..ada1a3934 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3839,7 +3839,6 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
if (cpi->oxcf.noise_sensitivity > 0 && cpi->use_svc)
vp9_denoiser_reset_on_first_frame(cpi);
#endif
- vp9_update_noise_estimate(cpi);
// Scene detection is always used for VBR mode or screen-content case.
// For other cases (e.g., CBR mode) use it for 5 <= speed < 8 for now
@@ -3871,6 +3870,8 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
}
}
+ vp9_update_noise_estimate(cpi);
+
// For 1 pass CBR, check if we are dropping this frame.
// Never drop on key frame, if base layer is key for svc,
// on scene change, or if superframe has layer sync.
diff --git a/vp9/encoder/vp9_noise_estimate.c b/vp9/encoder/vp9_noise_estimate.c
index b60500346..4bc81986e 100644
--- a/vp9/encoder/vp9_noise_estimate.c
+++ b/vp9/encoder/vp9_noise_estimate.c
@@ -209,8 +209,11 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
// Only consider blocks that are likely steady background. i.e, have
// been encoded as zero/low motion x (= thresh_consec_zeromv) frames
// in a row. consec_zero_mv[] defined for 8x8 blocks, so consider all
- // 4 sub-blocks for 16x16 block. Also, avoid skin blocks.
- if (frame_low_motion && consec_zeromv > thresh_consec_zeromv) {
+ // 4 sub-blocks for 16x16 block. And exclude this frame if
+ // high_source_sad is true (i.e., scene/content change).
+ if (frame_low_motion && consec_zeromv > thresh_consec_zeromv &&
+ !cpi->rc.high_source_sad &&
+ !cpi->svc.high_source_sad_superframe) {
int is_skin = 0;
if (cpi->use_skin_detection) {
is_skin =