[svc rc] Increase worst quality for enhancement layers
authorMinghai Shang <minghai@google.com>
Thu, 24 Apr 2014 18:33:23 +0000 (11:33 -0700)
committerMinghai Shang <minghai@google.com>
Thu, 24 Apr 2014 18:33:23 +0000 (11:33 -0700)
Change-Id: Ifbfa90894eec9944bd55f364f1d17eb152338d6b

vp9/encoder/vp9_firstpass.c

index 3d4b962..34506f2 100644 (file)
@@ -920,12 +920,19 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi,
     const int target_norm_bits_per_mb = ((uint64_t)section_target_bandwidth <<
                                             BPER_MB_NORMBITS) / num_mbs;
     int q;
+    int is_svc_upper_layer = 0;
+    if (cpi->use_svc && cpi->svc.number_temporal_layers == 1 &&
+        cpi->svc.spatial_layer_id > 0) {
+      is_svc_upper_layer = 1;
+    }
 
     // Try and pick a max Q that will be high enough to encode the
     // content at the given rate.
     for (q = rc->best_quality; q < rc->worst_quality; ++q) {
-      const double factor = calc_correction_factor(err_per_mb, ERR_DIVISOR,
-                                                   0.5, 0.90, q);
+      const double factor =
+          calc_correction_factor(err_per_mb, ERR_DIVISOR,
+                                 is_svc_upper_layer ? 0.8 : 0.5,
+                                 is_svc_upper_layer ? 1.0 : 0.90, q);
       const int bits_per_mb = vp9_rc_bits_per_mb(INTER_FRAME, q,
                                                  factor * speed_term);
       if (bits_per_mb <= target_norm_bits_per_mb)