]> granicus.if.org Git - libvpx/commitdiff
Add "unknown" status for noise estimation.
authorjackychen <jackychen@google.com>
Mon, 14 Dec 2015 22:45:28 +0000 (14:45 -0800)
committerjackychen <jackychen@google.com>
Mon, 14 Dec 2015 23:38:20 +0000 (15:38 -0800)
Change-Id: I0fe95332ccfa2e1ad2a01a8e7ddd631289e0f8eb

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_noise_estimate.c
vp9/encoder/vp9_noise_estimate.h

index 1606b16a2fc131f6e2b06c1986a82e4d47279ba0..89f2bd9b85f9f04b9886a180b93b6c58f4c5f671 100644 (file)
@@ -496,7 +496,7 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) {
         threshold_base = 3 * threshold_base;
       else if (noise_level == kMedium)
         threshold_base = threshold_base << 1;
-      else if (noise_level < kLow)
+      else if (noise_level == kLowLow)
         threshold_base = (7 * threshold_base) >> 3;
     }
     if (cm->width <= 352 && cm->height <= 288) {
index 4befbb066f4f0b135208b7dbfe8dc81f5cf357aa..6e717e53c80742193d574c40e950752fc7eb89a9 100644 (file)
@@ -25,7 +25,7 @@ void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne,
                              int width,
                              int height) {
   ne->enabled = 0;
-  ne->level = kLowLow;
+  ne->level = kUnknown;
   ne->value = 0;
   ne->count = 0;
   ne->thresh = 90;
@@ -83,7 +83,7 @@ static void copy_frame(YV12_BUFFER_CONFIG * const dest,
 }
 
 NOISE_LEVEL vp9_noise_estimate_extract_level(NOISE_ESTIMATE *const ne) {
-  int noise_level = kLowLow;
+  int noise_level = kUnknown;
   if (ne->value > (ne->thresh << 1)) {
     noise_level = kHigh;
   } else {
index 826d125b5bbb0df870ac0f7a88fed50094bf3bc2..26632628668807980929d8ae1b9a321054657bee 100644 (file)
@@ -24,6 +24,7 @@ extern "C" {
 #endif
 
 typedef enum noise_level {
+  kUnknown,
   kLowLow,
   kLow,
   kMedium,