Improve 1-pass TPL by adjusting propagation ratio
(vmaf score is a bit strange a lot of scores are zeros)
(base_q_ratio is off for simplification)
Against legacy without deltaq
avg_psnr ovr_psnr ssim vmaf
hd -3.769 -4.324 -3.702 -1.899
q_mode 80.270 6.949 5.806 230.788
Against legacy with deltaq
avg_psnr ovr_psnr ssim vmaf
hd -4.564 -5.129 -3.119 -1.392
q_mode 79.467 8.879 9.515 210.097
Against two-pass without deltaq
avg_psnr ovr_psnr ssim vmaf
hd -0.067 0.490 2.345 -0.197
q_mode 70.467 7.331 6.926 84.812
With deltaq against without deltaq
avg_psnr ovr_psnr ssim vmaf
hd -0.380 -0.573 0.797 0.185
(Don't have two-pass with deltaq data at the moment)
The performance of hd dataset looks okay.
But for q_mode, it's a lot worse. (Will do some investigation)
Also the deltaq gain is not as significant as 2pass, which also
worth some investigation.
Change-Id: I22d680d71283fbf8e52537bc73b88c767fda0ff5
diff --git a/av1/qmode_rc/ratectrl_qmode.cc b/av1/qmode_rc/ratectrl_qmode.cc
index 5bd9277..302c796 100644
--- a/av1/qmode_rc/ratectrl_qmode.cc
+++ b/av1/qmode_rc/ratectrl_qmode.cc
@@ -1323,15 +1323,26 @@
ref_unit_col * unit_size, unit_size);
const double overlap_ratio =
overlap_area * 1.0 / (unit_size * unit_size);
+ const double propagation_fraction_power = 0.3;
+ // We apply propagation_fraction with power of 0.3 to improve
+ // propagation rate. The power coefficient is tuned from empirical
+ // practice due to the fact that the inter/intra cost is RD cost
+ // not prediction error which is used in the original design. This
+ // action will increase the propagation_fraction when the
+ // difference between intra_cost and inter_cost are reasonably big
+ // but not enough for propagation.
+ // TODO(angiebird): Check this part again when we use prediction
+ // error for inter/intra cost.
const double propagation_fraction =
- GetPropagationFraction(unit_dep_stats);
+ std::pow(GetPropagationFraction(unit_dep_stats),
+ propagation_fraction_power);
const double propagation_ratio =
- 1.0 / ref_frame_count * overlap_ratio * propagation_fraction;
+ 1.0 / ref_frame_count * overlap_ratio;
TplUnitDepStats &ref_unit_stats =
ref_frame_dep_stats.unit_stats[ref_unit_row][ref_unit_col];
ref_unit_stats.propagation_cost +=
- (unit_dep_stats.intra_cost +
- unit_dep_stats.propagation_cost) *
+ (unit_dep_stats.intra_cost - unit_dep_stats.inter_cost +
+ unit_dep_stats.propagation_cost * propagation_fraction) *
propagation_ratio;
}
}