summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2017-02-15 09:18:34 -0800
committerMarco <marpan@google.com>2017-02-15 09:28:16 -0800
commit716c1d5ff512135577ba80d336f0c572c987db21 (patch)
tree4daa60d3b4ca282ab0b0fcd644278509bdbdb045 /vp9/encoder
parentccada0636b6783598af4f6a35d90b13b6b5d39b3 (diff)
downloadlibvpx-716c1d5ff512135577ba80d336f0c572c987db21.tar
libvpx-716c1d5ff512135577ba80d336f0c572c987db21.tar.gz
libvpx-716c1d5ff512135577ba80d336f0c572c987db21.tar.bz2
libvpx-716c1d5ff512135577ba80d336f0c572c987db21.zip
Vp9: Speed 8 aq-mode=3: Reduce computation in estimating bits per mb.
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
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_aq_cyclicrefresh.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c
index ba6f1b2ea..0e8e11ca7 100644
--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -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,