]> granicus.if.org Git - libvpx/commitdiff
vp9: Fix to setting content_state for real-time mode.
authorMarco <marpan@google.com>
Mon, 17 Jul 2017 23:04:04 +0000 (16:04 -0700)
committerMarco <marpan@google.com>
Mon, 17 Jul 2017 23:21:25 +0000 (16:21 -0700)
When content_state_sb is set to LowVarHighSumdiff, don't reset
it to VeryHighSad. Visually better on clips with strong lighting changes.

Small/negligible change in RTC metrics and speed.

Change-Id: I20c383e3c4cf8d1149de5f9260449c0b7cf7c6aa

vp9/encoder/vp9_encodeframe.c

index 7cc6e20a33a449634825cedf980299b28f05547b..e69b337b62baadce6263fc1d38594ee1342ab55a 100644 (file)
@@ -1013,8 +1013,7 @@ static void avg_source_sad(VP9_COMP *cpi, MACROBLOCK *x, int shift,
   // Detect large lighting change.
   if (tmp_variance < (tmp_sse >> 3) && (tmp_sse - tmp_variance) > 10000)
     x->content_state_sb = kLowVarHighSumdiff;
-
-  if (tmp_sad > (avg_source_sad_threshold << 1))
+  else if (tmp_sad > (avg_source_sad_threshold << 1))
     x->content_state_sb = kVeryHighSad;
 
   if (cpi->content_state_sb_fd != NULL) {