]> granicus.if.org Git - libvpx/commitdiff
vp9: Only compute y_sad for golden in variance partition for speed < 8.
authorJerome Jiang <jianj@google.com>
Wed, 22 Feb 2017 17:49:17 +0000 (09:49 -0800)
committerJerome Jiang <jianj@google.com>
Wed, 22 Feb 2017 18:19:09 +0000 (10:19 -0800)
Only affects speed 8. No obvious quality regression. Systematic speed
ups by ~1% on Nexus 6.

Change-Id: Ia904ca28ea041c3281c532911ec38fb7d7f46a17

vp9/encoder/vp9_encodeframe.c

index 23b164f1e34d2f86650885790f47eb8bde591d50..e09f94b89549bff74a71cfa9d713248fba4609f9 100644 (file)
@@ -1043,7 +1043,9 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
       yv12_g = get_ref_frame_buffer(cpi, GOLDEN_FRAME);
     }
 
-    if (yv12_g && yv12_g != yv12 && (cpi->ref_frame_flags & VP9_GOLD_FLAG)) {
+    // Only compute y_sad_g (sad for golden reference) for speed < 8.
+    if (cpi->oxcf.speed < 8 && yv12_g && yv12_g != yv12 &&
+        (cpi->ref_frame_flags & VP9_GOLD_FLAG)) {
       vp9_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col,
                            &cm->frame_refs[GOLDEN_FRAME - 1].sf);
       y_sad_g = cpi->fn_ptr[bsize].sdf(