]> granicus.if.org Git - libvpx/commitdiff
Fix a bug in calculating the compound ref frame cost
authorZoe Liu <zoeliu@google.com>
Wed, 24 Aug 2016 23:14:00 +0000 (16:14 -0700)
committerZoe Liu <zoeliu@google.com>
Wed, 31 Aug 2016 16:43:31 +0000 (09:43 -0700)
The previous ext-refs experiment did not consider the cost of the 2nd
reference frame on mode decision in the compound mode. With the fix,
using Overall PSNR, compared to the previous ext-refs RD performance
before the bug fix, all against the baseline, the improvements are:

"ext-refs" before fix: lowres -5.665%  midres: -4.833%
"ext-refs" after fix:  lowres -5.776%  midres: -5.000%
Improvement by the fix: lowres -0.111%  midres: -0.167%

Change-Id: I2eceedf2d4046b169514e049fd01baaf0bbb50c6

vp10/encoder/rdopt.c

index 4e0fa2c5cca92f936cc097d151a493b32e29cd31..ed1aba79ff88df652867a30c0ed23f5ea9824236 100644 (file)
@@ -9029,6 +9029,9 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi, TileDataEnc *tile_data,
     // to the rolling cost variable.
     if (comp_pred) {
       rate2 += ref_costs_comp[ref_frame];
+#if CONFIG_EXT_REFS
+      rate2 += ref_costs_comp[second_ref_frame];
+#endif  // CONFIG_EXT_REFS
     } else {
       rate2 += ref_costs_single[ref_frame];
     }
@@ -10382,6 +10385,9 @@ void vp10_rd_pick_inter_mode_sub8x8(struct VP10_COMP *cpi,
     // to the rolling cost variable.
     if (second_ref_frame > INTRA_FRAME) {
       rate2 += ref_costs_comp[ref_frame];
+#if CONFIG_EXT_REFS
+      rate2 += ref_costs_comp[second_ref_frame];
+#endif  // CONFIG_EXT_REFS
     } else {
       rate2 += ref_costs_single[ref_frame];
     }