]> granicus.if.org Git - libvpx/commitdiff
vp9: Adjustments for ARF usage in 1 pass vbr.
authorMarco <marpan@google.com>
Tue, 19 Sep 2017 00:30:49 +0000 (17:30 -0700)
committerMarco <marpan@google.com>
Tue, 19 Sep 2017 01:46:41 +0000 (18:46 -0700)
Only when USE_ALT_REF_ONE_PASS is enabled (off by default).
Force fixed partition to 64x64 when is_src_alt_ref_frame is true,
and don't force early exit for some modes in nonrd_pickmode
for ARF noshow frames.

Small gain ~0.2% on ytlive metrics for speed 6.
Neutral speed difference.

Change-Id: I27eb6622d0453c09a06ccdc3b16368762474d11d

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_speed_features.c

index 39c94adf3ac779f1ea64ba19fc41542b85e4288c..d84cd488dfec499fa7ff081bf17cbd764ef7feab 100644 (file)
@@ -4179,7 +4179,7 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, ThreadData *td,
       int sb_offset2 = ((cm->mi_cols + 7) >> 3) * (mi_row >> 3) + (mi_col >> 3);
       int64_t source_sad = avg_source_sad(cpi, x, shift, sb_offset2);
       if (sf->adapt_partition_source_sad &&
-          (cpi->oxcf.rc_mode == VPX_VBR &&
+          (cpi->oxcf.rc_mode == VPX_VBR && !cpi->rc.is_src_frame_alt_ref &&
            source_sad > sf->adapt_partition_thresh &&
            cpi->refresh_golden_frame))
         partition_search_type = REFERENCE_PARTITION;
index 85779c636fd99aeadacd38b31352da24e4c2b3c4..826bb31d350a5f21a16fce994321e32b7390e5ee 100644 (file)
@@ -1669,13 +1669,13 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
            frame_mv[this_mode][ref_frame].as_int != 0))
         continue;
 
-      if (cpi->rc.alt_ref_gf_group &&
+      if (cpi->rc.alt_ref_gf_group && cm->show_frame &&
           cpi->rc.frames_since_golden > (cpi->rc.baseline_gf_interval >> 1) &&
           ref_frame == GOLDEN_FRAME &&
           frame_mv[this_mode][ref_frame].as_int != 0)
         continue;
 
-      if (cpi->rc.alt_ref_gf_group &&
+      if (cpi->rc.alt_ref_gf_group && cm->show_frame &&
           cpi->rc.frames_since_golden < (cpi->rc.baseline_gf_interval >> 1) &&
           ref_frame == ALTREF_FRAME &&
           frame_mv[this_mode][ref_frame].as_int != 0)
index 17de9d7c51d0f117ca895cd1b29103b121827315..ea49dec30e440ac210d5e926819ae15f09c2fab4 100644 (file)
@@ -523,6 +523,11 @@ static void set_rt_speed_feature_framesize_independent(
 
   if (speed >= 6) {
     sf->partition_search_type = VAR_BASED_PARTITION;
+    if (cpi->oxcf.rc_mode == VPX_VBR && cpi->oxcf.lag_in_frames > 0 &&
+        cpi->rc.is_src_frame_alt_ref && !is_keyframe) {
+      sf->partition_search_type = FIXED_PARTITION;
+      sf->always_this_block_size = BLOCK_64X64;
+    }
     // Turn on this to use non-RD key frame coding mode.
     sf->use_nonrd_pick_mode = 1;
     sf->mv.search_method = NSTEP;