]> granicus.if.org Git - libvpx/commitdiff
Vp9: Speed 8 aq-mode=3: Reduce computation in estimating bits per mb.
authorMarco <marpan@google.com>
Wed, 15 Feb 2017 17:18:34 +0000 (09:18 -0800)
committerMarco <marpan@google.com>
Wed, 15 Feb 2017 17:28:16 +0000 (09:28 -0800)
vp9_compute_qdelta_by_rate has almost 2% overhead in profiling on Nexus 6.
Reduce the calling of that function in speed 8 by estimating the delta-q.
Both rtc and rtc_derf show little/no change in avg psnr/ssim.
Encoding speed is 2~3% faster on Nexus 6.

Change-Id: If25933715783f31104a18a5092ea347b1221b5f5

vp9/encoder/vp9_aq_cyclicrefresh.c

index ba6f1b2ea549c153e634779c1397bc307d1dbe33..0e8e11ca75bd10c0c552027711de22e04935fe37 100644 (file)
@@ -128,8 +128,7 @@ int vp9_cyclic_refresh_rc_bits_per_mb(const VP9_COMP *cpi, int i,
   CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
   int bits_per_mb;
   int num8x8bl = cm->MBs << 2;
-  // Compute delta-q corresponding to qindex i.
-  int deltaq = compute_deltaq(cpi, i, cr->rate_ratio_qdelta);
+  int deltaq = 0;
   // Weight for segment prior to encoding: take the average of the target
   // number for the frame to be encoded and the actual from the previous frame.
   // Use the target if its less.
@@ -142,6 +141,12 @@ int vp9_cyclic_refresh_rc_bits_per_mb(const VP9_COMP *cpi, int i,
       num8x8bl;
   if (weight_segment_target < 7 * weight_segment / 8)
     weight_segment = weight_segment_target;
+  // Compute delta-q corresponding to qindex i.
+  // Take a quick estimate for speed >=8, half of the max allowed deltaq.
+  if (cpi->oxcf.speed < 8)
+    deltaq = compute_deltaq(cpi, i, cr->rate_ratio_qdelta);
+  else
+    deltaq = -(cr->max_qdelta_perc * i) / 200;
   // Take segment weighted average for bits per mb.
   bits_per_mb = (int)((1.0 - weight_segment) *
                           vp9_rc_bits_per_mb(cm->frame_type, i,