]> granicus.if.org Git - libvpx/commitdiff
Add clause to alt ref group breakout.
authorpaulwilkins <paulwilkins@google.com>
Wed, 15 Nov 2017 16:39:54 +0000 (16:39 +0000)
committerpaulwilkins <paulwilkins@google.com>
Wed, 15 Nov 2017 16:40:12 +0000 (16:40 +0000)
Add a clause to the breakout test for alt ref groups that
examines the size of the accumulated second reference
frame error compared to the cost of intra coding.

This clause causes a reduction in the average group length for many
clips. Alongside the change to the group length the minimum
boost is increased.

On balance the results are positive for psnr and psnr-hvs
but is negative for ssim/fast ssim for the smaller image formats.

Strong gains on some harder clips (eg ducks take off (midres) ~20%,
husky (lowres) 6-17%. Most of the negative cases are lower motion
clips. Subsequent patch hopefully will help with those.

Change-Id: Ic1f5dbb9153d5089e58b1540470e799f91a65dc4

vp9/encoder/vp9_firstpass.c

index caa58e7a821fc345a14c74344e7af53b6d9408f0..277d15c779062f1a6769551e07479cb7c9e74817 100644 (file)
@@ -2091,8 +2091,8 @@ static int calc_arf_boost(VP9_COMP *cpi, int f_frames, int b_frames) {
   }
   arf_boost += (int)boost_score;
 
-  if (arf_boost < ((b_frames + f_frames) * 20))
-    arf_boost = ((b_frames + f_frames) * 20);
+  if (arf_boost < ((b_frames + f_frames) * 40))
+    arf_boost = ((b_frames + f_frames) * 40);
   arf_boost = VPXMAX(arf_boost, MIN_ARF_GF_BOOST);
 
   return arf_boost;
@@ -2562,7 +2562,6 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
     }
 
     // Calculate a boost number for this frame.
-    sr_accumulator = 0.0;
     boost_score += decay_accumulator *
                    calc_frame_boost(cpi, &next_frame, &sr_accumulator,
                                     this_frame_mv_in_out, GF_MAX_BOOST);
@@ -2580,7 +2579,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
             ((mv_ratio_accumulator > mv_ratio_accumulator_thresh) ||
              (abs_mv_in_out_accumulator > abs_mv_in_out_thresh) ||
              (mv_in_out_accumulator < -mv_in_out_thresh) ||
-             (decay_accumulator < ARF_DECAY_BREAKOUT)))) {
+             (decay_accumulator < ARF_DECAY_BREAKOUT) ||
+             (sr_accumulator > next_frame.intra_error)))) {
       boost_score = old_boost_score;
       break;
     }