Extend prune_zero_mv_with_sse speed feature to speed 3
This patch extends SF prune_zero_mv_with_sse to speed 3
with reduced aggressiveness.
cpu-used Instruction Count BD-Rate Loss(%)
Reduction(%) avg.psnr ovr.psnr ssim
3 1.093 -0.0162 -0.0093 -0.0038
STATS_CHANGED
Change-Id: I95bfe546653722db870201578642e74fca9ac415
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 7cd8e54..acf1db3 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -2468,11 +2468,13 @@
* \param[in] bsize The current block_size.
* \param[in] args The args to handle_inter_mode, used to track
* the best SSE.
+ * \param[in] prune_zero_mv_with_sse The argument holds speed feature
+ * prune_zero_mv_with_sse value
* \return Returns 1 if zero_mv is pruned, 0 otherwise.
*/
static AOM_INLINE int prune_zero_mv_with_sse(
const aom_variance_fn_ptr_t *fn_ptr, const MACROBLOCK *x, BLOCK_SIZE bsize,
- const HandleInterModeArgs *args) {
+ const HandleInterModeArgs *args, int prune_zero_mv_with_sse) {
const MACROBLOCKD *xd = &x->e_mbd;
const MB_MODE_INFO *mbmi = xd->mi[0];
@@ -2513,7 +2515,9 @@
const unsigned int best_sse = args->best_single_sse_in_refs[refs[idx]];
best_sse_sum += best_sse;
}
- if (this_sse_sum > best_sse_sum) {
+
+ const double mul = prune_zero_mv_with_sse > 1 ? 1.00 : 1.25;
+ if ((double)this_sse_sum > (mul * (double)best_sse_sum)) {
return 1;
}
@@ -2931,7 +2935,8 @@
if (cpi->sf.gm_sf.prune_zero_mv_with_sse &&
cpi->sf.gm_sf.gm_search_type == GM_DISABLE_SEARCH &&
(this_mode == GLOBALMV || this_mode == GLOBAL_GLOBALMV)) {
- if (prune_zero_mv_with_sse(cpi->ppi->fn_ptr, x, bsize, args)) {
+ if (prune_zero_mv_with_sse(cpi->ppi->fn_ptr, x, bsize, args,
+ cpi->sf.gm_sf.prune_zero_mv_with_sse)) {
continue;
}
}
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index e004bb6..e6199fa 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -983,6 +983,7 @@
sf->hl_sf.high_precision_mv_usage = CURRENT_Q;
sf->gm_sf.gm_search_type = GM_DISABLE_SEARCH;
+ sf->gm_sf.prune_zero_mv_with_sse = 1;
sf->part_sf.less_rectangular_check_level = 2;
sf->part_sf.simple_motion_search_prune_agg =
@@ -1055,7 +1056,7 @@
}
if (speed >= 4) {
- sf->gm_sf.prune_zero_mv_with_sse = 1;
+ sf->gm_sf.prune_zero_mv_with_sse = 2;
sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index b09599f..087e56d 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -477,6 +477,9 @@
// When the current GM type is set to ZEROMV, prune ZEROMV if its performance
// is worse than NEWMV under SSE metric.
+ // 0 : no pruning
+ // 1 : conservative pruning
+ // 2 : aggressive pruning
int prune_zero_mv_with_sse;
// Disable global motion estimation based on stats of previous frames in the