shithub: libvpx

Download patch

ref: 16a4fab9e2c6d80c08183bf0cc27a3e0b9bd2346
parent: 06bdcea6063bb86fc93f559bb2d412baf7f395e6
parent: d5b3f29f3c19583bb9b5a10b96c1f23ec66f9689
author: Marco Paniconi <[email protected]>
date: Fri Dec 4 19:06:14 EST 2015

Merge "Adjust variance threshold based on source noise level."

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -488,13 +488,14 @@
     thresholds[2] = threshold_base >> 2;
     thresholds[3] = threshold_base << 2;
   } else {
-    // Increase base variance threshold if estimated noise level is high.
+    // Increase base variance threshold based on  estimated noise level.
     if (cpi->noise_estimate.enabled) {
-      if (cpi->noise_estimate.level == kHigh)
+      NOISE_LEVEL noise_level = vp9_noise_estimate_extract_level(
+          &cpi->noise_estimate);
+      if (noise_level == kHigh)
         threshold_base = 3 * threshold_base;
-      else
-        if (cpi->noise_estimate.level == kMedium)
-          threshold_base = threshold_base << 1;
+      else if (noise_level == kMedium)
+        threshold_base = threshold_base << 1;
     }
     if (cm->width <= 352 && cm->height <= 288) {
       thresholds[0] = threshold_base >> 3;